ode-explorer 2.2.3-develop.202504281812 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1390,7 +1390,7 @@ void main()
|
|
|
1390
1390
|
font-display: ${rt.display};
|
|
1391
1391
|
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(et){this._stylesheet!==et&&(this._stylesheet=et,this.styleID++)}normalizeColor(et){return Array.isArray(et)&&(et=rgb2hex(et)),typeof et=="number"?hex2string(et):et}dropShadowToCSS(){let et=this.normalizeColor(this.dropShadowColor);const rt=this.dropShadowAlpha,st=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),nt=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);et.startsWith("#")&&rt<1&&(et+=(rt*255|0).toString(16).padStart(2,"0"));const ot=`${st}px ${nt}px`;return this.dropShadowBlur>0?`text-shadow: ${ot} ${this.dropShadowBlur}px ${et}`:`text-shadow: ${ot} ${et}`}reset(){Object.assign(this,Wl.defaultOptions)}onBeforeDraw(){const{fontsDirty:et}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&et?new Promise(rt=>setTimeout(rt,100)):Promise.resolve()}get isSafari(){const{userAgent:et}=settings.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(et)}set fillGradientStops(et){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(et){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(et){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(et){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(et){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(et){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(et){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};_HTMLTextStyle.availableFonts={},_HTMLTextStyle.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let HTMLTextStyle=_HTMLTextStyle;const _HTMLText=class Xl extends Sprite{constructor(et="",rt={}){super(Texture.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const st=new Image,nt=Texture.from(st,{scaleMode:settings.SCALE_MODE,resourceOptions:{autoLoad:!1}});nt.orig=new Rectangle,nt.trim=new Rectangle,this.texture=nt;const ot="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml",lt=document.createElementNS(ot,"svg"),ut=document.createElementNS(ot,"foreignObject"),ct=document.createElementNS(at,"div"),dt=document.createElementNS(at,"style");ut.setAttribute("width","10000"),ut.setAttribute("height","10000"),ut.style.overflow="hidden",lt.appendChild(ut),this.maxWidth=Xl.defaultMaxWidth,this.maxHeight=Xl.defaultMaxHeight,this._domElement=ct,this._styleElement=dt,this._svgRoot=lt,this._foreignObject=ut,this._foreignObject.appendChild(dt),this._foreignObject.appendChild(ct),this._image=st,this._loadImage=new Image,this._autoResolution=Xl.defaultAutoResolution,this._resolution=Xl.defaultResolution??settings.RESOLUTION,this.text=et,this.style=rt}measureText(et){var dt,ht;const{text:rt,style:st,resolution:nt}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},et);Object.assign(this._domElement,{innerHTML:rt,style:st.toCSS(nt)}),this._styleElement.textContent=st.toGlobalCSS(),document.body.appendChild(this._svgRoot);const ot=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:at,height:lt}=ot;(at>this.maxWidth||lt>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const ut=Math.min(this.maxWidth,Math.ceil(at)),ct=Math.min(this.maxHeight,Math.ceil(lt));return this._svgRoot.setAttribute("width",ut.toString()),this._svgRoot.setAttribute("height",ct.toString()),rt!==this._text&&(this._domElement.innerHTML=this._text),st!==this._style&&(Object.assign(this._domElement,{style:(dt=this._style)==null?void 0:dt.toCSS(nt)}),this._styleElement.textContent=(ht=this._style)==null?void 0:ht.toGlobalCSS()),{width:ut+st.padding*2,height:ct+st.padding*2}}async updateText(et=!0){const{style:rt,_image:st,_loadImage:nt}=this;if(this.localStyleID!==rt.styleID&&(this.dirty=!0,this.localStyleID=rt.styleID),!this.dirty&&et)return;const{width:ot,height:at}=this.measureText();st.width=nt.width=Math.ceil(Math.max(1,ot)),st.height=nt.height=Math.ceil(Math.max(1,at)),this._updateID++;const lt=this._updateID;await new Promise(ut=>{nt.onload=async()=>{if(lt<this._updateID){ut();return}await rt.onBeforeDraw(),st.src=nt.src,nt.onload=null,nt.src="",this.updateTexture(),ut()};const ct=new XMLSerializer().serializeToString(this._svgRoot);nt.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(ct)}`})}get source(){return this._image}updateTexture(){const{style:et,texture:rt,_image:st,resolution:nt}=this,{padding:ot}=et,{baseTexture:at}=rt;rt.trim.width=rt._frame.width=st.width/nt,rt.trim.height=rt._frame.height=st.height/nt,rt.trim.x=-ot,rt.trim.y=-ot,rt.orig.width=rt._frame.width-ot*2,rt.orig.height=rt._frame.height-ot*2,this._onTextureUpdate(),at.setRealSize(st.width,st.height,nt),this.dirty=!1}_render(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._render(et)}_renderCanvas(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(et)}getLocalBounds(et){return this.updateText(!0),super.getLocalBounds(et)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(et){var st,nt,ot,at,lt;typeof et=="boolean"&&(et={children:et}),et=Object.assign({},Xl.defaultDestroyOptions,et),super.destroy(et);const rt=null;this.ownsStyle&&((st=this._style)==null||st.cleanFonts()),this._style=rt,(nt=this._svgRoot)==null||nt.remove(),this._svgRoot=rt,(ot=this._domElement)==null||ot.remove(),this._domElement=rt,(at=this._foreignObject)==null||at.remove(),this._foreignObject=rt,(lt=this._styleElement)==null||lt.remove(),this._styleElement=rt,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=rt,this._image.src="",this._image=rt}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(et){this.updateText(!0);const rt=sign(this.scale.x)||1;this.scale.x=rt*et/this._image.width/this.resolution,this._width=et}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(et){this.updateText(!0);const rt=sign(this.scale.y)||1;this.scale.y=rt*et/this._image.height/this.resolution,this._height=et}get style(){return this._style}set style(et){this._style!==et&&(et=et||{},et instanceof HTMLTextStyle?(this.ownsStyle=!1,this._style=et):et instanceof TextStyle?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=HTMLTextStyle.from(et)):(this.ownsStyle=!0,this._style=new HTMLTextStyle(et)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(et){et=String(et===""||et===null||et===void 0?" ":et),et=this.sanitiseText(et),this._text!==et&&(this._text=et,this.dirty=!0)}get resolution(){return this._resolution}set resolution(et){this._autoResolution=!1,this._resolution!==et&&(this._resolution=et,this.dirty=!0)}sanitiseText(et){return et.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};_HTMLText.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},_HTMLText.defaultMaxWidth=2024,_HTMLText.defaultMaxHeight=2024,_HTMLText.defaultAutoResolution=!0;const MIN_HEIGHT=100,MIN_WIDTH=100,MODAL_VERTICAL_PADDING=450,MODAL_HORIZONTAL_PADDING=64,DEFAULT_QUALITY=.5,DEFAULT_SPRITE_NAME="image";function updateImageFromBlob(tt,{spriteName:et,imgDatasource:rt,settings:st}){const nt=URL.createObjectURL(rt),ot=new Image;return ot.src=nt,new Promise(at=>{ot.onload=async()=>{await updateImage(tt,{spriteName:et,imgDatasource:ot,settings:st});const lt=tt==null?void 0:tt.stage.getChildByName(et,!0);at(lt)}})}async function updateImage(tt,{spriteName:et,imgDatasource:rt,settings:st}){if(tt===void 0||tt.stage===null)return;const nt=tt.stage.getChildByName(et,!0);nt==null||nt.removeFromParent();const ot=rt instanceof HTMLImageElement?Texture.from(rt):rt instanceof Sprite?rt:await Texture.fromURL(rt),at=ot instanceof Sprite?ot:Sprite.from(ot,{});if(at.interactive=!0,at.name=et,st){const{sprite:{anchor:lt,position:ut,scale:ct,size:dt,rotation:ht},stage:{size:ft}}=st,xt=ht%Math.PI!==0;at.anchor.x=lt.x,at.anchor.y=lt.y,at.position.x=ut.x,at.position.y=ut.y,at.scale.x=ct.x,at.scale.y=ct.y,at.width=xt?dt.height:dt.width,at.height=xt?dt.width:dt.height,tt.stage.height=ft.height,tt.stage.width=ft.width,tt.renderer.resize(ft.width,ft.height),tt.stage.addChild(at)}else tt.stage.addChild(at),tt.renderer.resize(at.width,at.height);autoResize(tt,at)}function autoResize(tt,et){var rt;const st=tt.view.parentNode,nt=window.innerWidth-MODAL_HORIZONTAL_PADDING,ot=Math.max((st==null?void 0:st.offsetWidth)??0,MIN_WIDTH),at=constraintSize({width:et.width,height:et.height},{width:{max:Math.min(ot,nt),min:MIN_WIDTH},height:{min:MIN_HEIGHT,max:window.innerHeight-MODAL_VERTICAL_PADDING}}),{height:lt,width:ut}=at;(rt=tt.view)!=null&&rt.style&&(tt.view.style.width=`${ut}px`,tt.view.style.height=`${lt}px`)}function constraintSize(tt,et){const{height:rt,width:st}=tt,nt=st/rt,{height:ot,width:at}=et;let lt=at.max,ut=at.max/nt;return st>at.max&&(lt=at.max,ut=lt/nt),ut>ot.max&&(ut=ot.max,lt=ut*nt),lt<at.min&&(lt=at.min,ut=lt/nt),ut<ot.min&&(ut=ot.min,lt=ut*nt),{width:lt,height:ut}}function saveAsBlob(tt){return new Promise((et,rt)=>{var st;(st=tt==null?void 0:tt.view)!=null&&st.toBlob?tt.view.toBlob(nt=>{nt?et(nt):rt("EXTRACT_FAILED")},"image/jpeg",DEFAULT_QUALITY):rt("EXTRACT_FAILED")})}function saveAsDataURL(tt){var et,rt;return(rt=(et=tt.view).toDataURL)==null?void 0:rt.call(et)}function getApplicationScale(tt){return tt.view.getBoundingClientRect?tt.view.getBoundingClientRect().width/tt.view.width:1}function toBlob(tt){return new Promise((et,rt)=>{var st,nt;(nt=(st=tt.view).toBlob)==null||nt.call(st,ot=>{ot?et(ot):rt("EXTRACT_FAIL")},"image/png",1)})}function createImageSettings({application:tt,sprite:et}){return{sprite:{rotation:et.rotation,size:{width:et.width,height:et.height},position:{x:et.position.x,y:et.position.y},scale:{x:et.scale.x,y:et.scale.y},anchor:{x:et.anchor.x,y:et.anchor.y}},stage:{size:{width:tt.stage.width,height:tt.stage.height},scale:{x:tt.stage.scale.x,y:tt.stage.scale.y}}}}function resizeStage({application:tt,sprite:et,newHeight:rt,newWidth:st}){et.anchor.x=.5,et.anchor.y=.5,et.position=new Point(st/2,rt/2),tt.stage.height=rt,tt.stage.width=st,tt.renderer.resize(st,rt)}const DEFAULT_MAX_HISTORY=20,useHistoryTool=({maxSize:tt=DEFAULT_MAX_HISTORY,application:et,spriteName:rt,onRestore:st})=>{const[nt,ot]=reactExports.useState([]);reactExports.useEffect(()=>{ot([])},[et]);const at=async()=>{const ct=nt.pop();ct&&(st(await ct.backup,ct),ot(nt.filter(dt=>dt!==ct)))},lt=ct=>(ct.length>tt&&ct.splice(0,ct.length-tt),ct),ut=async ct=>{{if(!et)return;const dt=et.stage.getChildByName(rt,!0);if(dt==null)return;const ht=toBlob(et),ft={backup:ht,sprite:{rotation:dt.rotation,size:{width:dt.width,height:dt.height},position:{x:dt.position.x,y:dt.position.y},scale:{x:dt.scale.x,y:dt.scale.y},anchor:{x:dt.anchor.x,y:dt.anchor.y}},stage:{size:{width:et.stage.width,height:et.stage.height},scale:{x:et.stage.scale.x,y:et.stage.scale.y}}};return ot([...lt(nt),ft]),await ht,ct.call(ct)}};return{historyCount:nt.length,restore:at,historize:ut}};function aggregate(tt,et,rt){let st;const nt=[];return function(ot){nt.push(et(ot)),!st&&(st=setTimeout(()=>{const at=[...nt];nt.splice(0,nt.length),rt(at),st=void 0},tt))}}const BRUSH_SIZE=20,DEBOUNCE=50,CURSOR_NAME="BRUSH_CURSOR";function drawBrush(tt,et){const rt=new Graphics;for(const st of tt)st&&(rt.beginFill(16777215,1),rt.drawCircle(st.x,st.y,BRUSH_SIZE/et),rt.lineStyle(0),rt.endFill());return rt}function drawBlurListener(tt,{spriteName:et}){return aggregate(DEBOUNCE,rt=>tt.stage.toLocal(rt.global),rt=>{const st=tt.stage.getChildByName(et),nt=getApplicationScale(tt);if(st==null)return;const ot=new Sprite(st.texture);ot.filters=[new BlurFilter(8,4,Math.min(nt,1))],ot.width=st.width,ot.height=st.height,ot.scale=new Point(1,1),ot.anchor=st.anchor,ot.mask=drawBrush(rt,nt),st.addChild(ot)})}function drawCursor(tt){removeCursor(tt);const et=getApplicationScale(tt),rt=new Graphics;return rt.lineStyle(Math.max(1,1/et),16711680),rt.drawCircle(0,0,BRUSH_SIZE/et),rt.endFill(),rt.name=CURSOR_NAME,tt.stage.addChild(rt),rt}function removeCursor(tt){const et=tt.stage.getChildByName(CURSOR_NAME);et&&et.removeFromParent()}function moveCursorListener(tt){return et=>{if(!tt)return;const rt=tt.stage.toLocal(et.global),st=tt.stage.getChildByName(CURSOR_NAME,!0);st&&(st.position.x=rt.x,st.position.y=rt.y)}}function start$2(tt,{spriteName:et}){tt.stage.interactive=!0;const rt=drawCursor(tt),st=moveCursorListener(tt);tt.stage.on("pointermove",st);const nt=drawBlurListener(tt,{spriteName:et});tt.stage.on("pointerdown",()=>{tt.stage.on("pointermove",nt)});const ot=()=>{var at;(at=tt==null?void 0:tt.stage)==null||at.off("pointermove",nt)};globalThis.addEventListener("pointerup",ot),rt.once("destroyed",()=>{globalThis.removeEventListener("pointerup",ot)})}function stop$2(tt){removeCursor(tt),tt.stage.off("pointerdown"),tt.stage.off("pointermove")}const CORNERS=["TOP_LEFT","TOP_RIGHT","BOTTOM_LEFT","BOTTOM_RIGHT"],PADDING=0,POINT_RADIUS$1=20,CROP_BACKGROUND_NAME="CROP_BACKGROUND_NAME",CROP_MASK_NAME="CROP_MASK_NAME";function getCornerName$1(tt){return"CROP_CORNER_"+tt}function drawBackground(tt,{spriteName:et}){removeBackground(tt);const rt=tt.stage.getChildByName(et);if(rt==null)return;const st=rt.getBounds(),nt=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(nt);ot.height=st.height,ot.width=st.width,ot.position=new Point(0,0);const at=new Graphics;at.beginFill(16777215,.5),at.drawRect(0,0,st.width,st.height),at.endFill(),at.name=CROP_BACKGROUND_NAME,at.position=new Point(st.x,st.y);const lt=new Graphics;lt.beginFill(0,1),lt.drawRect(0,0,st.width-2*PADDING,st.height-2*PADDING),lt.endFill(),lt.position=new Point(PADDING,PADDING),lt.name=CROP_MASK_NAME,ot.mask=lt,tt.stage.addChild(at),at.addChild(lt),at.addChild(ot)}function removeBackground(tt){const et=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0);et==null||et.removeFromParent()}function computeCornerPosition$1(tt,et){switch(tt){case"TOP_LEFT":return{x:et.x,y:et.y,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:et.x+et.width,y:et.y,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:et.x,y:et.y+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:et.x+et.width,y:et.y+et.height,start:Math.PI,end:3*Math.PI/2}}}function refreshCorners(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);et!=null&&CORNERS.forEach(rt=>{const st=tt.stage.getChildByName(getCornerName$1(rt),!0);if(st==null)return;const nt=computeCornerPosition$1(rt,{height:et.height,width:et.width,x:et.x,y:et.y});st.position=new Point(nt.x,nt.y)})}function drawCorner$1(tt,et,{spriteName:rt}){const st=tt.stage.getChildByName(getCornerName$1(et),!0),nt=getApplicationScale(tt);st==null||st.removeFromParent();const ot=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0),at=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(tt.stage.getChildByName(rt)==null||ot===null||ot===void 0||at===void 0||at===null)return;const ut=computeCornerPosition$1(et,{height:at.height,width:at.width,x:at.x,y:at.y}),ct=new Graphics;ct.beginFill(4960213,1),ct.arc(0,0,POINT_RADIUS$1/nt,ut.start,ut.end),ct.lineTo(0,0),ct.endFill(),ct.position=new Point(ut.x,ut.y),ct.name=getCornerName$1(et),ct.interactive=!0;let dt=!1;tt.stage.on("pointermove",xt=>{if(dt===!1)return;const yt=ot.toLocal(xt.global);ct.position.x=yt.x,ct.position.y=yt.y,moveMask(tt,et,yt)});const ht=()=>{dt=!0};ct.on("pointerdown",ht);const ft=()=>{dt=!1};globalThis.addEventListener("pointerup",ft),ct.once("destroyed",()=>{ct.off("pointerdown"),globalThis.removeEventListener("pointerup",ft)}),ot.addChild(ct)}function moveMask(tt,et,rt){const st=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(st==null)return;const nt=st.position.x+st.width,ot=st.position.y+st.height;switch(et){case"TOP_LEFT":{st.position.x=rt.x,st.position.y=rt.y,st.width=nt-rt.x,st.height=ot-rt.y;break}case"TOP_RIGHT":{st.position.y=rt.y,st.width=rt.x-st.position.x,st.height=ot-rt.y;break}case"BOTTOM_LEFT":{st.position.x=rt.x,st.width=nt-rt.x,st.height=rt.y-st.position.y;break}case"BOTTOM_RIGHT":{st.width=rt.x-st.position.x,st.height=rt.y-st.position.y;break}}refreshCorners(tt)}function start$1(tt,{spriteName:et}){stop$1(tt),tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,drawBackground(tt,{spriteName:et}),drawCorner$1(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner$1(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner$1(tt,"TOP_LEFT",{spriteName:et}),drawCorner$1(tt,"TOP_RIGHT",{spriteName:et})}function stop$1(tt){removeBackground(tt),tt.stage.off("pointermove"),tt.render()}function save$1(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(et==null)return;stop$1(tt);const rt=tt.renderer.generateTexture(tt.stage).clone(),st=new Sprite(rt),nt=et.getBounds(),ot=new Rectangle(Math.floor(nt.x),Math.floor(nt.y),Math.floor(nt.width),Math.floor(nt.height)),at=new Texture(st.texture.baseTexture,ot);return new Sprite(at)}const POINT_RADIUS=20,CONTROL_NAME="CONTROL_NAME";function getCornerName(tt){return"RESIZE_CORNER_"+tt}function computeCornerPosition(tt,et){const rt=et.x,st=et.y;switch(tt){case"TOP_LEFT":return{x:rt,y:st,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:rt+et.width,y:st,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:rt,y:st+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:rt+et.width,y:st+et.height,start:Math.PI,end:3*Math.PI/2}}}function resizeContainer(tt,{container:et,cornerType:rt,position:st,spriteName:nt}){const ot=tt.stage.getChildByName(nt,!0);if(ot==null)return;const at=ot.rotation%Math.PI!==0,lt=at?ot.height:ot.width,ut=at?ot.width:ot.height;switch(rt){case"TOP_LEFT":{et.position=new Point(st.x,st.y),et.width=lt-2*st.x,et.height=ut-2*st.y;break}case"TOP_RIGHT":{const ct=lt-st.x;et.position=new Point(ct,st.y),et.width=lt-2*ct,et.height=ut-2*st.y;break}case"BOTTOM_LEFT":{const ct=ut-st.y;et.position=new Point(st.x,ct),et.width=lt-2*st.x,et.height=ut-2*ct;break}case"BOTTOM_RIGHT":{const ct=ut-st.y,dt=lt-st.x;et.position=new Point(dt,ct),et.width=lt-2*dt,et.height=ut-2*ct;break}}}function removeCorner(tt,et){const rt=tt.stage.getChildByName(getCornerName(et),!0);rt==null||rt.removeFromParent()}function drawCorner(tt,et,{spriteName:rt}){removeCorner(tt,et);const st=tt.stage.getChildByName(rt,!0),nt=tt.stage.getChildByName(CONTROL_NAME,!0);if(st==null||nt===null||nt===void 0)return;const ot=computeCornerPosition(et,nt),at=new Graphics;at.beginFill(4960213,1),at.arc(0,0,POINT_RADIUS,ot.start,ot.end),at.lineTo(0,0),at.endFill(),at.position=new Point(ot.x,ot.y),at.name=getCornerName(et),at.interactive=!0;let lt=!1;tt.stage.on("pointermove",dt=>{if(lt===!1)return;const ht=tt.stage.toLocal(dt.global);resizeContainer(tt,{cornerType:et,position:ht,container:nt,spriteName:rt})});const ut=()=>{lt=!1};globalThis.addEventListener("pointerup",ut),at.once("destroyed",()=>{at.off("pointerdown"),globalThis.removeEventListener("pointerup",ut)});const ct=()=>{lt=!0};at.on("pointerdown",ct),nt.addChild(at)}function drawContainer(tt,et){removeContainer(tt);const rt=tt.stage.getChildByName(et,!0);if(rt==null)return;const st=tt.renderer.generateTexture(tt.stage),nt=new Sprite(st);tt.stage.children.forEach(at=>{at.alpha=0});const ot=new Graphics;ot.drawRect(0,0,rt.width,rt.height),ot.name=CONTROL_NAME,ot.interactive=!0,ot.interactiveChildren=!0,tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,tt.stage.addChild(ot),ot.addChild(nt)}function removeContainer(tt){const et=tt.stage.getChildByName(CONTROL_NAME,!0);et==null||et.removeFromParent(),tt.stage.children.forEach(rt=>{rt.alpha=1})}function drawControl(tt,et){drawContainer(tt,et),drawCorner(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner(tt,"TOP_LEFT",{spriteName:et}),drawCorner(tt,"TOP_RIGHT",{spriteName:et})}function removeControl(tt){removeContainer(tt),removeCorner(tt,"BOTTOM_LEFT"),removeCorner(tt,"BOTTOM_RIGHT"),removeCorner(tt,"TOP_LEFT"),removeCorner(tt,"TOP_RIGHT"),tt.stage.off("pointermove")}function start(tt,et){drawControl(tt,et)}function stop(tt){removeControl(tt),tt.stage.off("pointermove"),tt.render()}function save(tt){var et;const rt=(et=tt==null?void 0:tt.stage)==null?void 0:et.getChildByName(CONTROL_NAME,!0),st=rt?{height:rt.height,width:rt.width}:void 0;if(removeControl(tt),st){const nt=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(nt);return ot.width=st.width,ot.height=st.height,ot}else return}async function rotate(tt,et){const rt=tt==null?void 0:tt.stage.getChildByName(et,!0);if(tt&&rt){if(!tt)return;const st=await toBlob(tt),nt=await updateImageFromBlob(tt,{imgDatasource:st,spriteName:et,settings:createImageSettings({application:tt,sprite:rt})});if(!nt)return;let ot,at;const lt=tt.view;lt.style&&(ot=lt.style.maxHeight??"",at=lt.style.visibility??"",lt.style.maxHeight=`${lt.clientHeight}px`,lt.style.visibility="hidden"),nt.rotation+=Math.PI/2,resizeStage({application:tt,sprite:nt,newHeight:nt.width,newWidth:nt.height}),tt.render();const ut=await toBlob(tt);ot!==void 0&&(lt.style.maxHeight=ot),at!==void 0&&(lt.style.visibility=at),await updateImageFromBlob(tt,{imgDatasource:ut,spriteName:et})}}function useImageEffects({application:tt,spriteName:et,onSave:rt}){return{rotate:async()=>{tt&&await rotate(tt,et)},startCrop:()=>{tt&&start$1(tt,{spriteName:et})},stopCrop:st=>{if(tt){if(st){const nt=save$1(tt);nt&&rt(nt)}stop$1(tt)}},startBlur:()=>{tt&&start$2(tt,{spriteName:et})},stopBlur:()=>{tt&&stop$2(tt)},startResize:()=>{tt&&start(tt,et)},stopResize:st=>{if(tt){if(st){const nt=save(tt);nt&&rt(nt)}stop(tt)}}}}function useImageEditor({imageSrc:tt,spriteName:et=DEFAULT_SPRITE_NAME}){const[rt,st]=reactExports.useState(void 0),[nt,ot]=reactExports.useState(!0),{rotate:at,startBlur:lt,startCrop:ut,startResize:ct,stopBlur:dt,stopCrop:ht,stopResize:ft}=useImageEffects({spriteName:et,application:rt,onSave(wt){rt&&updateImage(rt,{imgDatasource:wt,spriteName:et})}}),xt=()=>rt?saveAsBlob(rt):Promise.resolve(void 0),yt=()=>{if(rt)return saveAsDataURL(rt)},{restore:vt,historize:Et,historyCount:bt}=useHistoryTool({application:rt,spriteName:et,onRestore(wt,St){rt&&updateImageFromBlob(rt,{imgDatasource:wt,spriteName:et,settings:St})}});return reactExports.useEffect(()=>{rt&&(ot(!0),updateImage(rt,{spriteName:et,imgDatasource:tt}).finally(()=>ot(!1)))},[rt,tt,et]),{historyCount:bt,setApplication:st,restore:vt,stopCrop:ht,stopBlur:dt,stopResize:ft,startResize:async()=>{ot(!0),await Et(ct),ot(!1)},startCrop:async()=>{ot(!0),await Et(ut),ot(!1)},startBlur:async()=>{ot(!0),await Et(lt),ot(!1)},rotate:async()=>{ot(!0),await Et(at),ot(!1)},toBlob:xt,toDataURL:yt,loading:nt}}const SvgIconBlur=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipPath:"url(#icon-blur_svg__a)",clipRule:"evenodd",children:jsxRuntimeExports.jsx("path",{d:"M17.504 1.673a1 1 0 0 1 .932.491c.37.63.9 1.935 1.404 3.18l.08.197c.502 1.24.994 2.457 1.369 3.205l-.895.447.895-.447c.561 1.122 1.962 4.049 2.136 6.753.087 1.364-.125 2.839-1.094 3.978-.987 1.16-2.573 1.76-4.757 1.76-2.186 0-3.777-.6-4.777-1.752-.983-1.134-1.221-2.604-1.152-3.973.138-2.711 1.514-5.636 2.13-6.79.86-1.611 2.414-5.32 2.874-6.433a1 1 0 0 1 .855-.616m.104 3.492c-.657 1.533-1.496 3.425-2.07 4.5-.59 1.106-1.781 3.703-1.895 5.949-.057 1.11.158 1.976.665 2.56.49.565 1.427 1.063 3.266 1.063 1.84 0 2.76-.498 3.233-1.055.492-.579.694-1.44.622-2.555-.145-2.253-1.36-4.848-1.929-5.986-.412-.823-.932-2.108-1.417-3.308l-.097-.238q-.196-.487-.378-.93M12.843 22.535a1 1 0 0 1-1.034.964l-.259-.009a1 1 0 0 1-.257-.042q-.125.029-.26.024l-.257-.009a11 11 0 0 1-2.102-.279 1 1 0 0 1 .457-1.947 9 9 0 0 0 1.715.228l.258.009q.134.004.257.042.125-.028.26-.024l.257.009a1 1 0 0 1 .965 1.034m-6.615-1.329a1 1 0 0 1-1.396.226 10.9 10.9 0 0 1-2.877-3.086 1 1 0 1 1 1.7-1.054 8.9 8.9 0 0 0 2.347 2.518 1 1 0 0 1 .226 1.396M1.622 15.22a1 1 0 0 1-1.147-.827 10.9 10.9 0 0 1 .148-4.218 1 1 0 0 1 1.947.457 8.9 8.9 0 0 0-.12 3.441 1 1 0 0 1-.828 1.147m.978-7.49a1 1 0 0 1-.226-1.397A10.9 10.9 0 0 1 5.46 3.455a1 1 0 0 1 1.054 1.7 8.9 8.9 0 0 0-2.518 2.347 1 1 0 0 1-1.396.226m5.988-4.607a1 1 0 0 1 .827-1.147 11 11 0 0 1 2.116-.132l.258.01q.135.004.257.042.125-.03.26-.025l.258.01a1 1 0 0 1-.07 1.998l-.258-.009a1 1 0 0 1-.258-.043q-.125.03-.259.025l-.258-.009a9 9 0 0 0-1.727.108 1 1 0 0 1-1.146-.828"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-blur_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconCrop=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{clipPath:"url(#icon-crop_svg__a)",children:jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7.13 1.009a1 1 0 1 0-2-.018l-.036 4.103-4.103.036a1 1 0 1 0 .018 2l4.068-.035L5 15.99V16a3 3 0 0 0 3 3h9v4a1 1 0 1 0 2 0v-4h4a1 1 0 1 0 0-2h-4V8a3 3 0 0 0-3-3l-8.905.077zm-.053 6.068L7 16.004A1 1 0 0 0 8 17h9V8a1 1 0 0 0-.996-1z",clipRule:"evenodd"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-crop_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconUndo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.707 13.707a1 1 0 0 0 0-1.414L5.414 8l4.293-4.293a1 1 0 0 0-1.414-1.414l-5 5a1 1 0 0 0 0 1.414l5 5a1 1 0 0 0 1.414 0",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 20a1 1 0 0 0 1-1v-7a5 5 0 0 0-5-5H4a1 1 0 1 0 0 2h12a3 3 0 0 1 3 3v7a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),ImageEditorToolbar=({historyCount:tt,handle:et})=>{const{t:rt}=useTranslation(),[st,nt]=reactExports.useState(void 0),ot=lt=>{nt(lt),et(lt)},at=[{type:"button",name:"undo",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconUndo,{}),"aria-label":rt("cancel"),children:rt("cancel"),onClick:()=>ot("UNDO"),disabled:tt===0},tooltip:rt("cancel")},{type:"divider",name:"div-1"},{type:"button",name:"reset",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconReset,{}),"aria-label":rt("rotate"),children:rt("rotate"),onClick:()=>ot("ROTATE")},tooltip:rt("rotate")},{type:"button",name:"crop",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconCrop,{}),"aria-label":rt("crop"),children:rt("crop"),className:st==="CROP"?"is-selected":"",onClick:()=>ot("CROP")},tooltip:rt("crop")},{type:"button",name:"blur",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconBlur,{}),"aria-label":rt("blur"),children:rt("blur"),className:st==="BLUR"?"is-selected":"",onClick:()=>ot("BLUR")},tooltip:rt("blur")}];return jsxRuntimeExports.jsx(Toolbar,{variant:"no-shadow",align:"left",isBlock:!0,items:at})},ImageEditor=({altText:tt,legend:et,image:rt,isOpen:st,onCancel:nt,onError:ot,onSave:at})=>{const{t:lt}=useTranslation(),[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(!1),[ft,xt]=reactExports.useState(tt??""),[yt,vt]=reactExports.useState(et??""),[Et,bt]=reactExports.useState(!1),{toBlob:wt,setApplication:St,startBlur:Rt,stopBlur:Ct,restore:Pt,rotate:It,startCrop:jt,stopCrop:Dt,startResize:Ht,stopResize:Nt,historyCount:Ut,loading:Lt}=useImageEditor({imageSrc:rt}),kt=()=>{Ct(),Dt(ut==="CROP"),Nt(ut==="RESIZE")},Mt=async()=>{try{ht(!0),kt();const $t=await wt();$t&&await at({blob:$t,legend:yt,altText:ft})}catch($t){ot==null||ot(`${$t}`)}finally{ht(!1)}},Bt=()=>{nt()},Gt=async $t=>{switch(kt(),ct($t),bt(!0),$t){case"ROTATE":{await It();break}case"UNDO":{await Pt();break}case"CROP":{jt();break}case"RESIZE":{await Ht();break}case"BLUR":{await Rt();break}}};return jsxRuntimeExports.jsxs(Modal,{id:"image-editor",isOpen:st,onModalClose:Bt,size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:Bt,children:jsxRuntimeExports.jsx("span",{className:"h2",children:lt("imageeditor.title")})}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex flex-column align-items-center",children:jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column gap-12 w-100 flex-grow-1",children:[jsxRuntimeExports.jsx(ImageEditorToolbar,{handle:Gt,historyCount:Ut}),jsxRuntimeExports.jsxs("div",{className:"position-relative d-flex flex-column align-items-center justify-content-center flex-grow-1 w-100 image-editor",children:[jsxRuntimeExports.jsx(moduleExports.Stage,{onMount:$t=>St($t),options:{preserveDrawingBuffer:!0,backgroundAlpha:0,resolution:1}}),!!Lt&&jsxRuntimeExports.jsx("div",{className:"position-absolute top-0 start-0 bottom-0 end-0 m-10 d-flex align-items-center justify-content-center bg-black opacity-25",children:jsxRuntimeExports.jsx(LoadingScreen,{})})]}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row m-10 gap-12 w-100",children:[jsxRuntimeExports.jsxs(FormControl,{id:"alt",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("alttext")}),jsxRuntimeExports.jsx(Input,{value:ft,onChange:$t=>{bt(!0),xt($t.target.value)},placeholder:lt("alttext.help"),size:"md",type:"text"})]}),jsxRuntimeExports.jsxs(FormControl,{id:"legend",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("legend")}),jsxRuntimeExports.jsx(Input,{value:yt,onChange:$t=>{bt(!0),vt($t.target.value)},placeholder:lt("legend.help"),size:"md",type:"text"})]})]})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:Bt,type:"button",variant:"ghost",children:lt("imageeditor.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:Mt,type:"button",variant:"filled",isLoading:dt,disabled:dt||!Et,children:lt("imageeditor.save")})]})]})},UploadFiles=({onFilesChange:tt,visibility:et="protected"})=>{const{files:rt,uploadedFiles:st,getUploadStatus:nt,uploadFile:ot,removeFile:at,updateImage:lt,editingImage:ut,setEditingImage:ct,getUrl:dt}=useUploadFiles({handleOnChange:tt,application:"media-library",visibility:et}),ht=reactExports.useRef(new Map);reactExports.useEffect(()=>{const yt=ht.current;return()=>{yt.forEach(vt=>URL.revokeObjectURL(vt)),yt.clear()}},[]);const ft=yt=>{const vt=yt.type.startsWith("image")?ht.current.get(yt.name):"";return ht.current.has(yt.name)||ht.current.set(yt.name,URL.createObjectURL(yt)),{name:yt.name,info:{type:yt.type,weight:c$3(yt.size||0,1)},src:vt}},xt=yt=>{const vt=ht.current.get(yt.name);vt&&(URL.revokeObjectURL(vt),ht.current.delete(yt.name)),at(yt)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[rt.map(yt=>{const vt=st.find(Et=>Et.name===yt.name);return jsxRuntimeExports.jsx(UploadCard,{status:nt(yt),item:ft(yt),onEdit:()=>ct(vt),onRetry:()=>ot(yt),onDelete:()=>xt(yt)},yt.name)}),ut&&jsxRuntimeExports.jsx(ImageEditor,{altText:ut.alt,legend:ut.title,image:dt(ut,!0),isOpen:!!ut,onCancel:()=>ct(void 0),onSave:lt,onError:console.error})]})},acceptedTypes=tt=>{const et=[];switch(tt){case"audio":et.push("audio/*");break;case"video":et.push("video/*");break;case"image":et.push("image/png"),et.push("image/jpeg"),et.push("image/webp"),et.push("image/gif"),et.push("image/avif");break}return et},Upload=()=>{const{type:tt,visibility:et,multiple:rt,setResult:st,setResultCounter:nt,setCancellable:ot}=useMediaLibraryContext(),at=lt=>{lt.length?(ot(lt),nt(lt.length),st(lt)):(ot([]),nt(void 0),st(void 0))};return jsxRuntimeExports.jsx("div",{className:"py-8 flex-grow-1",children:jsxRuntimeExports.jsx(Dropzone,{multiple:rt,accept:acceptedTypes(tt??"embedder"),children:jsxRuntimeExports.jsx(UploadFiles,{onFilesChange:at,visibility:et})})})},SvgIconRecordStop=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4z"})]}),VIDEO_HEIGHT=9,VIDEO_WIDTH=16,VideoRecorder=reactExports.forwardRef(({appCode:tt,caption:et,onSuccess:rt,onError:st,onRecordUpdated:nt,hideSaveAction:ot=!1},at)=>{const[lt,ut]=reactExports.useState(18e4),[ct,dt]=reactExports.useState([]),[ht,ft]=reactExports.useState(!1),[xt,yt]=reactExports.useState(!1),[vt,Et]=reactExports.useState(!1),[bt,wt]=reactExports.useState(!1),[St,Rt]=reactExports.useState(!1),[Ct,Pt]=reactExports.useState({audio:!0,video:{facingMode:"environment",aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT}}),[It,jt]=reactExports.useState(),[Dt,Ht]=reactExports.useState(""),[Nt,Ut]=reactExports.useState([]),[Lt,kt]=reactExports.useState(),[Mt,Bt]=reactExports.useState(0),[Gt,$t]=reactExports.useState(0),zt=reactExports.useRef(null),Ft=reactExports.useRef(null),{uploadBlob:Yt}=useUpload(void 0,tt),{device:Zt}=useBrowserInfo(navigator.userAgent);reactExports.useImperativeHandle(at,()=>({save:mr}));const{t:Xt}=useTranslation();reactExports.useEffect(()=>{rr(),hr()},[]),reactExports.useEffect(()=>(It||pr(Ct),()=>{It&&It.getTracks().forEach(_r=>_r.stop())}),[It]),reactExports.useEffect(()=>{if(Nt.length&&!ht&&zt.current){const _r=new Blob(Nt,{type:Dt});if(kt(_r),nt){const $r=window.URL.createObjectURL(_r);nt($r)}zt.current.autoplay=!1,zt.current.srcObject=null,zt.current.src=window.URL.createObjectURL(_r)}},[ht,Nt]),reactExports.useEffect(()=>{if(ht){const _r=Date.now(),$r=window.setInterval(()=>Bt(Date.now()-_r),500);return()=>{window.clearInterval($r)}}},[ht]),reactExports.useEffect(()=>{if(vt){const _r=window.setInterval(()=>$t($r=>$r+500),500);return()=>{window.clearInterval(_r)}}},[vt]);const rr=async()=>{const _r=await odeServices.video().getVideoConf();ut((_r.maxDuration??3)*60*1e3)},hr=async()=>{const _r=(await navigator.mediaDevices.enumerateDevices()).filter($r=>$r.kind==="videoinput");switch(Zt.type){case"mobile":case"tablet":{const $r={deviceId:"environment",label:Xt("video.back.camera"),groupId:"",kind:"videoinput"},qr={deviceId:"user",label:Xt("video.front.camera"),groupId:"",kind:"videoinput"};(_r==null?void 0:_r.length)>1?dt([$r,qr]):dt([$r]);break}default:dt(_r);break}},pr=async _r=>{try{const $r=await navigator.mediaDevices.getUserMedia(_r);jt($r),zt.current&&(zt.current.src&&(window.URL.revokeObjectURL(zt.current.src),zt.current.src=""),zt.current.srcObject=$r,zt.current.autoplay=!0,zt.current.volume=1,zt.current.muted=!0)}catch($r){console.error($r)}},xr=reactExports.useCallback(()=>{ft(!0),zt&&zt.current&&(zt.current.muted=!0);const _r=o$2();Ht(_r),It&&(Ft.current=new MediaRecorder(It,{mimeType:_r}),Ft.current.ondataavailable=({data:$r})=>{$r.size>0&&Ut(qr=>[...qr,$r])},Ft.current.onerror=$r=>console.error($r),Ft.current.start(1e3))},[It]),yr=reactExports.useCallback(()=>{var _r;ft(!1),yt(!0),((_r=Ft.current)==null?void 0:_r.state)==="recording"&&(Ft.current.requestData(),Ft.current.stop())},[Ft]),Er=reactExports.useCallback(()=>{var _r,$r;zt&&zt.current&&(zt.current.muted=!1),vt?(($r=zt==null?void 0:zt.current)==null||$r.pause(),Et(!1)):((_r=zt==null?void 0:zt.current)==null||_r.play(),Et(!0))},[vt]),wr=()=>{yt(!1),ft(!1),Et(!1),Rt(!1),Bt(0),Ut([]),kt(void 0),pr(Ct),nt&&nt()},mr=async()=>{var _r;if((_r=zt==null?void 0:zt.current)==null||_r.pause(),wt(!0),!Lt){console.error("Error while saving video: recorded video is undefined.");return}const $r=await Yt(Lt,{duration:Mt});if($r!=null)return rt==null||rt([$r]),wt(!1),Rt(!0),[$r];st("Error while uploading video"),wt(!1),Rt(!0)},Ar=()=>{Et(!1),$t(0),zt.current&&(zt.current.currentTime=0)},Pr=_r=>{var $r;const qr=ct.find(fs=>fs.label===_r);let Jr={};qr!=null&&qr.deviceId?((qr==null?void 0:qr.deviceId)==="environment"||(qr==null?void 0:qr.deviceId)==="user"?Jr={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,facingMode:qr==null?void 0:qr.deviceId}}:Jr={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,deviceId:qr.deviceId}},Pt(Jr),It&&((($r=Ft.current)==null?void 0:$r.state)==="recording"&&(Ft.current.requestData(),Ft.current.stop()),It.getTracks().forEach(fs=>fs.stop()),jt(void 0)),pr(Jr)):console.error("Selected input device id is null")};reactExports.useEffect(()=>{Mt>=lt&&yr()},[Mt,yr]);const Br=[{type:"icon",name:"record",props:{icon:jsxRuntimeExports.jsx(SvgIconRecord,{color:ht||xt?"":"red"}),color:"danger",disabled:ht||xt||bt,onClick:xr,"aria-label":Xt("bbm.video.record.start")},tooltip:Xt("bbm.video.record.start")},{type:"icon",name:"stop",props:{icon:jsxRuntimeExports.jsx(SvgIconRecordStop,{}),disabled:!ht||xt||bt,onClick:yr,"aria-label":Xt("bbm.video.record.stop")},tooltip:Xt("bbm.video.record.stop")},{type:"icon",name:"play",visibility:vt?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconPlayFilled,{}),disabled:!xt||bt,onClick:Er,"aria-label":Xt("bbm.video.play.start")},tooltip:Xt("bbm.video.play.start")},{type:"icon",name:"pause",visibility:vt?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconPause,{}),disabled:!xt||bt,onClick:Er,"aria-label":Xt("bbm.video.play.pause")},tooltip:Xt("bbm.video.play.pause")},{type:"divider"},{type:"icon",name:"reset",props:{icon:jsxRuntimeExports.jsx(SvgIconRefresh,{}),disabled:!xt||bt,onClick:wr,"aria-label":Xt("bbm.video.record.reset")},tooltip:Xt("bbm.video.record.reset")},{type:"icon",name:"save",visibility:ot?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconSave,{}),disabled:!xt||bt||St,onClick:mr,"aria-label":Xt("bbm.video.record.save")},tooltip:Xt("bbm.video.record.save")}];return jsxRuntimeExports.jsxs("div",{className:"video-recorder d-flex flex-fill flex-column align-items-center pb-8",children:[jsxRuntimeExports.jsx("div",{className:"video-recorder-caption d-none d-md-block",children:et}),ct.length>1&&jsxRuntimeExports.jsx("div",{className:"video-recorder-devices mb-12",children:jsxRuntimeExports.jsxs(FormControl,{id:"selectInputDevice",children:[jsxRuntimeExports.jsx(Label,{className:"d-none d-md-block",children:Xt("bbm.video.record.select.devices.label")}),jsxRuntimeExports.jsx(Select,{placeholderOption:Xt("bbm.video.record.select.devices.placeholder"),options:ct.map(_r=>_r.label),onValueChange:Pr})]})}),jsxRuntimeExports.jsxs("div",{className:"video-recorder-video-container position-relative align-self-stretch",children:[jsxRuntimeExports.jsx("video",{ref:zt,playsInline:!0,autoPlay:!0,controls:!1,muted:!0,onEnded:Ar,className:"rounded",children:jsxRuntimeExports.jsx("track",{default:!0,kind:"captions",srcLang:"fr",src:""})}),(ht||xt)&&jsxRuntimeExports.jsxs("div",{className:"video-recorder-time d-flex align-items-center font-monospace fs-6 text-bg-dark rounded",children:[ht&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecord,{width:12,height:12,color:"red",className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$3(Mt),"/",n$3(lt)]})]}),xt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecordVideo,{width:14,height:14,className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$3(Gt),"/",n$3(Mt)]})]})]}),It&&jsxRuntimeExports.jsx(Toolbar,{items:Br,className:"position-absolute bottom-0 start-50 bg-white"})]}),bt&&jsxRuntimeExports.jsx(LoadingScreen,{position:!1,caption:Xt("bbm.video.save.loader.caption")})]})}),Video=()=>{const{appCode:tt,setResult:et,setPreSuccess:rt}=useMediaLibraryContext(),{t:st}=useTranslation(),nt=reactExports.useRef(null),ot=lt=>{lt?(et(lt),rt(()=>nt.current.save)):et()},at=lt=>{console.error(lt)};return jsxRuntimeExports.jsx(VideoRecorder,{ref:nt,appCode:tt,caption:st("bbm.video.caption"),onRecordUpdated:ot,onError:at,hideSaveAction:!0})},SvgIconArrowRight=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L17.586 12l-6.293-6.293a1 1 0 0 1 0-1.414",clipRule:"evenodd"})]}),illuError="/assets/js/ode-explorer/illu-error.svg",illuError$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuError},Symbol.toStringTag,{value:"Module"})),VideoEmbed=({switchType:tt,onSuccess:et})=>{const{t:rt}=useTranslation(),[st,nt]=reactExports.useState(),[ot,at]=reactExports.useState(),[lt,ut]=reactExports.useState(void 0),[ct,dt]=reactExports.useState(),ht=useDebounce(st||"",300),ft=reactExports.useId();reactExports.useEffect(()=>{xt()},[]),reactExports.useEffect(()=>{if(ct&&ht){const bt=odeServices.embedder().getProviderFromUrl(ct,ht);if(bt){ut(bt);const wt=odeServices.embedder().getEmbedCodeForProvider(bt,ht);at(wt),et(wt)}else ut(void 0),et()}},[ht,ct]);const xt=async()=>{const bt=await Promise.all([odeServices.embedder().getDefault(),odeServices.embedder().getCustom()]).then(wt=>wt.flat());dt(bt)};function yt(bt){const wt=bt.currentTarget.value;nt(wt),et(wt!=null&&wt.length?wt:void 0)}function vt(){tt==null||tt("embedder")}const Et=()=>ht?lt?jsxRuntimeExports.jsxs("div",{className:"mx-auto mt-16",children:[jsxRuntimeExports.jsxs("div",{className:"video-embed-provider d-flex align-items-center",children:[jsxRuntimeExports.jsx(Image$1,{src:lt.logo,alt:"Logo "+lt.displayName,className:"video-embed-provider-logo"}),lt.displayName]}),ot&&jsxRuntimeExports.jsx("div",{className:"video-embed-preview mt-12",dangerouslySetInnerHTML:{__html:ot}})]}):jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column align-items-center m-16",children:[jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuError,title:rt("bbm.video.previewError.title"),text:rt("bbm.video.previewError.text")}),tt&&jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:vt,className:"align-items-start mt-16",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})]}):tt&&jsxRuntimeExports.jsx("div",{className:"d-flex my-16 align-items-start",children:jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:vt,className:"align-items-start",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})});return jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill video-embed",children:[jsxRuntimeExports.jsxs("div",{className:"mb-8 d-flex",children:[jsxRuntimeExports.jsx(SvgIconGlobe,{className:"me-8"}),rt("bbm.video.url.title")]}),jsxRuntimeExports.jsx(FormControl,{id:ft,children:jsxRuntimeExports.jsx(Input,{size:"md",type:"text",placeholder:rt("bbm.video.url.placeholder"),onChange:yt})}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Et()})]})},VideoEmbedder=()=>{const{switchType:tt,setResult:et}=useMediaLibraryContext();return jsxRuntimeExports.jsx(VideoEmbed,{switchType:tt,onSuccess:rt=>{et(rt)}})},SvgIconSortAscendingLetters=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 16.293a1 1 0 0 1 1.414 0L7 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 4a1 1 0 0 1 1 1v15a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),SvgIconSortDescendingLetters=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 8.707a1 1 0 0 0 1.414 0L7 6.414l2.293 2.293a1 1 0 0 0 1.414-1.414l-3-3a1 1 0 0 0-1.414 0l-3 3a1 1 0 0 0 0 1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 21a1 1 0 0 0 1-1V5a1 1 0 0 0-2 0v15a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),SvgIconSortTime=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.509 6.027a6.138 6.138 0 1 1-.28 12.099 1 1 0 1 0-.383 1.963A8.138 8.138 0 1 0 9.653 5.488a1 1 0 1 0 1.168 1.624 6.1 6.1 0 0 1 2.688-1.085",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.38 8.252a1 1 0 0 0-1 1v3.8a1 1 0 0 0 .456.838l2.052 1.332a1 1 0 0 0 1.089-1.678l-1.597-1.036V9.252a1 1 0 0 0-1-1M1.793 16.293a1 1 0 0 1 1.414 0L5.5 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.5 4a1 1 0 0 0-1 1v15a1 1 0 1 0 2 0V5a1 1 0 0 0-1-1",clipRule:"evenodd"})]}),illuTrash="/assets/js/ode-explorer/illu-trash.svg",illuTrash$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuTrash},Symbol.toStringTag,{value:"Module"})),Grid=({children:tt,className:et,...rt})=>{const st=clsx("grid",et);return jsxRuntimeExports.jsx("div",{className:st,...rt,children:tt})},Column=({sm:tt,md:et,lg:rt,xl:st,children:nt,className:ot,as:at,...lt})=>{const ut=at||"div",ct=clsx({[`g-col-${tt}`]:tt,[et?`g-col-md-${et}`:""]:et,[rt?`g-col-lg-${rt}`:""]:rt,[st?`g-col-xl-${st}`:""]:st},ot);return jsxRuntimeExports.jsx(ut,{className:ct,...lt,children:nt})};Grid.Col=Column;const SvgIconLandscape=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.222 5.037c-.895 0-1.222.555-1.222.792v12.675c0 .237.327.792 1.222.792h1.364l9.707-9.886a.987.987 0 0 1 1.414 0L21 13.782V5.829c0-.237-.328-.792-1.222-.792zM23 16.224V5.829C23 4.066 21.337 3 19.778 3H4.222C2.662 3 1 4.066 1 5.83v12.674c0 1.763 1.662 2.829 3.222 2.829h15.556c1.56 0 3.222-1.066 3.222-2.83v-2.279m-2 .439-5-5.093-7.585 7.726h11.363c.894 0 1.222-.555 1.222-.792zM8 8.093c-.552 0-1 .455-1 1.018a1.01 1.01 0 0 0 1 1.018c.552 0 1-.456 1-1.018a1.01 1.01 0 0 0-1-1.019M5 9.11c0-1.688 1.343-3.056 3-3.056s3 1.368 3 3.056-1.343 3.055-3 3.055-3-1.368-3-3.055",clipRule:"evenodd"})]}),SvgIconTextPage=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.286 3c-.35 0-.68.135-.92.368-.238.231-.366.54-.366.854v15.556c0 .315.128.623.367.854.239.233.569.368.919.368h11.428c.35 0 .68-.135.92-.368.238-.231.366-.54.366-.854V8h-3a2 2 0 0 1-2-2V3zM16 6h1.986L16 4.08zm5 13.778V6.556a1 1 0 0 0-.305-.72L15.98 1.281A1 1 0 0 0 15.286 1h-9a3.32 3.32 0 0 0-2.314.934A3.2 3.2 0 0 0 3 4.222v15.556c0 .864.353 1.686.972 2.288S5.423 23 6.286 23h11.428c.863 0 1.695-.333 2.314-.934.619-.602.972-1.424.972-2.288M8 6a1 1 0 0 0 0 2h3a1 1 0 1 0 0-2zm-1 6a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1m5 4a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2z",clipRule:"evenodd"})]}),SvgIconVideo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 4.962C4 4.376 4.435 4 4.853 4H6.5v2H4zM4 8h2.5v3H4zm-2 4V4.962C2 3.381 3.224 2 4.853 2h13.294C19.776 2 21 3.38 21 4.962v14.076C21 20.619 19.776 22 18.147 22H4.853C3.224 22 2 20.62 2 19.038zm17-6V4.962c0-.586-.435-.962-.853-.962H16.5v2zm0 2h-2.5v3H19zm-2.5 5H19v3h-2.5zm0 5H19v1.038c0 .586-.435.962-.853.962H16.5zm-2-7V4h-6v7zm-6 2h6v7h-6zm-2 5v2H4.853C4.435 20 4 19.624 4 19.038V18zm0-2v-3H4v3z",clipRule:"evenodd"})]}),FileIcon=({type:tt,roleMap:et})=>{const rt=typeof(et==null?void 0:et.icon)!="string"&&tt!=="unknown",st=clsx("position-absolute top-50 start-50 translate-middle",{"p-12 rounded-circle shadow":rt},et==null?void 0:et.color);return jsxRuntimeExports.jsx("div",{className:st,children:(et==null?void 0:et.icon)??jsxRuntimeExports.jsx(SvgIconPaperclip,{})})};var observerMap=new Map,RootIds=new WeakMap,rootId=0,unsupportedValue=void 0;function getRootId(tt){return tt?(RootIds.has(tt)||(rootId+=1,RootIds.set(tt,rootId.toString())),RootIds.get(tt)):"0"}function optionsToId(tt){return Object.keys(tt).sort().filter(et=>tt[et]!==void 0).map(et=>`${et}_${et==="root"?getRootId(tt.root):tt[et]}`).toString()}function createObserver(tt){let et=optionsToId(tt),rt=observerMap.get(et);if(!rt){const st=new Map;let nt;const ot=new IntersectionObserver(at=>{at.forEach(lt=>{var ut;const ct=lt.isIntersecting&&nt.some(dt=>lt.intersectionRatio>=dt);tt.trackVisibility&&typeof lt.isVisible>"u"&&(lt.isVisible=ct),(ut=st.get(lt.target))==null||ut.forEach(dt=>{dt(ct,lt)})})},tt);nt=ot.thresholds||(Array.isArray(tt.threshold)?tt.threshold:[tt.threshold||0]),rt={id:et,observer:ot,elements:st},observerMap.set(et,rt)}return rt}function observe(tt,et,rt={},st=unsupportedValue){if(typeof window.IntersectionObserver>"u"&&st!==void 0){const ut=tt.getBoundingClientRect();return et(st,{isIntersecting:st,target:tt,intersectionRatio:typeof rt.threshold=="number"?rt.threshold:0,time:0,boundingClientRect:ut,intersectionRect:ut,rootBounds:ut}),()=>{}}const{id:nt,observer:ot,elements:at}=createObserver(rt);let lt=at.get(tt)||[];return at.has(tt)||at.set(tt,lt),lt.push(et),ot.observe(tt),function(){lt.splice(lt.indexOf(et),1),lt.length===0&&(at.delete(tt),ot.unobserve(tt)),at.size===0&&(ot.disconnect(),observerMap.delete(nt))}}function useInView({threshold:tt,delay:et,trackVisibility:rt,rootMargin:st,root:nt,triggerOnce:ot,skip:at,initialInView:lt,fallbackInView:ut,onChange:ct}={}){var dt;const[ht,ft]=reactExports.useState(null),xt=reactExports.useRef(),[yt,vt]=reactExports.useState({inView:!!lt,entry:void 0});xt.current=ct,reactExports.useEffect(()=>{if(at||!ht)return;let St;return St=observe(ht,(Rt,Ct)=>{vt({inView:Rt,entry:Ct}),xt.current&&xt.current(Rt,Ct),Ct.isIntersecting&&ot&&St&&(St(),St=void 0)},{root:nt,rootMargin:st,threshold:tt,trackVisibility:rt,delay:et},ut),()=>{St&&St()}},[Array.isArray(tt)?tt.toString():tt,ht,nt,st,ot,at,rt,ut,et]);const Et=(dt=yt.entry)==null?void 0:dt.target,bt=reactExports.useRef();!ht&&Et&&!ot&&!at&&bt.current!==Et&&(bt.current=Et,vt({inView:!!lt,entry:void 0}));const wt=[ft,yt.inView,yt.entry];return wt.ref=wt[0],wt.inView=wt[1],wt.entry=wt[2],wt}function useThumbnail(tt,et){const[rt,st]=reactExports.useState(null),{ref:nt,inView:ot}=useInView({triggerOnce:!0,...et==null?void 0:et.intersectionOptions});return reactExports.useEffect(()=>{var at;(at=et==null?void 0:et.ref)!=null&&at.current&&(nt==null||nt(et.ref.current))},[et==null?void 0:et.ref,nt]),reactExports.useEffect(()=>{if((et==null?void 0:et.ref)===void 0||ot){const at=new Image;return at.src=tt,at.onload=()=>{st(!0)},at.onerror=()=>{st(!1)},()=>{at.onload=null,at.onerror=null,st(null)}}},[ot]),rt}const FileCard=({doc:tt,isClickable:et=!0,isSelectable:rt=!1,isSelected:st=!1,onClick:nt,className:ot})=>{var at;const lt=reactExports.useRef(null),ut=DocumentHelper.getRole(tt);function ct(yt){const vt={csv:{icon:".CSV",color:"bg-orange-200"},xls:{icon:".XLS",color:"bg-green-200"},doc:{icon:".DOC",color:"bg-blue-200"},txt:{icon:".TXT",color:"bg-blue-200"},pdf:{icon:".PDF",color:"bg-red-200"},audio:{icon:jsxRuntimeExports.jsx(SvgIconMic,{width:22,height:22}),color:"bg-red-200"},ppt:{icon:".PPT",color:"bg-yellow-200"},img:{icon:jsxRuntimeExports.jsx(SvgIconLandscape,{width:22,height:22}),color:"bg-green-200"},video:{icon:jsxRuntimeExports.jsx(SvgIconVideo,{width:22,height:22}),color:"bg-purple-200"},zip:{icon:".ZIP",color:"bg-gray-300"},md:{icon:".MD",color:"bg-blue-200"},unknown:{icon:jsxRuntimeExports.jsx(SvgIconTextPage,{width:22,height:22}),color:"bg-gray-300"}};return vt[yt]||vt.unknown}const dt=clsx("file position-relative rounded",((at=ct(ut??"default"))==null?void 0:at.color)??"bg-yellow-200"),ht=ut==="img"||ut==="video"?odeServices.workspace().getThumbnailUrl(tt):null,ft=useThumbnail(ht,{ref:lt}),xt=ft&&{backgroundImage:`url(${ht})`,backgroundSize:"cover"};return jsxRuntimeExports.jsx(Card,{className:clsx("card-file",ot),isClickable:et,isSelectable:rt,isSelected:st,onClick:nt,children:jsxRuntimeExports.jsxs(Card.Body,{space:"8",children:[jsxRuntimeExports.jsx("div",{ref:lt,className:dt,style:{aspectRatio:"16/10",...xt},children:ut!=="img"||ut==="img"&&!ft?jsxRuntimeExports.jsx(FileIcon,{type:ut,roleMap:ct(ut)}):null}),jsxRuntimeExports.jsxs("div",{className:"mt-4",children:[jsxRuntimeExports.jsx(Card.Text,{children:tt.name}),jsxRuntimeExports.jsx(Card.Text,{className:"text-black-50",children:tt==null?void 0:tt.ownerName})]})]})})},Workspace$1=({roles:tt,onSelect:et,multiple:rt=!0,className:st,defaultFolder:nt,showPublicFolder:ot})=>{const{t:at}=useTranslation(),{root:lt,loadContent:ut}=useWorkspaceSearch("root",at("workspace.tree.owner"),"owner",tt),{root:ct,loadContent:dt}=useWorkspaceSearch("root",at("workspace.tree.shared"),"shared",tt),{root:ht,loadContent:ft}=useWorkspaceSearch("root",at("workspace.tree.protected"),"protected",tt),{root:xt,loadContent:yt}=useWorkspaceSearch("root",at("workspace.tree.public"),"public",tt),vt=reactExports.useRef(null),Et=reactExports.useRef(null),bt=reactExports.useRef(null),wt=reactExports.useRef(null),[St,Rt]=reactExports.useState(()=>nt==="public"?ot?nt:"protected":nt==="protected"||nt==="shared"?nt:"owner"),[Ct,Pt]=reactExports.useState(()=>nt==="public"?ot?xt:ht:nt==="protected"?ht:nt==="shared"?ct:lt),[It,jt]=reactExports.useState(),[Dt,Ht]=reactExports.useState(null),[Nt,Ut]=reactExports.useState(["modified","desc"]),[Lt,kt]=reactExports.useState([]),Mt=reactExports.useCallback(Xt=>{switch(Xt){case"owner":return{root:lt,othersRef:[Et,bt,wt]};case"shared":return{root:ct,othersRef:[vt,bt,wt]};case"protected":return{root:ht,othersRef:[vt,Et,wt]};case"public":return{root:xt,othersRef:[vt,Et,bt]};default:throw"no.root.node"}},[lt,ct,ht,xt]),Bt=reactExports.useCallback(()=>{switch(St){case"owner":ut(Ct.id);break;case"shared":dt(Ct.id);break;case"protected":ft(Ct.id);break;case"public":yt(Ct.id);break;default:throw"no.way"}},[St,Ct.id,ut,ft,yt,dt]);function Gt(Xt,rr){Rt(Xt);const{root:hr,othersRef:pr}=Mt(Xt),xr=findTreeNode(hr,yr=>yr.id===rr);xr&&(Pt(xr),pr.forEach(yr=>{var Er;return(Er=yr.current)==null?void 0:Er.unselectAll()}))}reactExports.useEffect(()=>{var Xt;let rr;switch(St){case"owner":rr=vt;break;case"shared":rr=Et;break;case"protected":rr=bt;break;case"public":rr=wt;break;default:return}(Xt=rr==null?void 0:rr.current)==null||Xt.select("root")},[St]),reactExports.useEffect(Bt,[Bt]),reactExports.useEffect(()=>{if(Ct.files){let Xt=[].concat(Ct.files);Dt&&(Xt=Xt.filter(hr=>hr.name.indexOf(Dt)>=0));const rr=Nt[0]==="name"?Nt[1]==="asc"?(hr,pr)=>zt(hr.name,pr.name):(hr,pr)=>zt(pr.name,hr.name):(hr,pr)=>zt(pr.modified,hr.modified);jt(()=>Xt.sort(rr))}else jt(void 0)},[Ct,lt,ht,ct,xt,Dt,Nt]);const $t=reactExports.useCallback(Xt=>{Ht(Xt.target.value)},[Ht]);function zt(Xt,rr){return Xt?rr?Xt.localeCompare(rr):1:-1}function Ft(){return Nt[0]==="name"?Nt[1]==="asc"?at("sort.order.alpha.asc"):at("sort.order.alpha.desc"):at("sort.order.modify.desc")}function Yt(Xt){let rr=[...Lt];rt?rr.includes(Xt)?rr=rr.filter(hr=>hr._id!==Xt._id):rr=[...rr,Xt]:rr=[Xt],kt(rr),et(rr)}const Zt=clsx("workspace flex-grow-1 gap-0",st);return jsxRuntimeExports.jsxs(Grid,{className:Zt,children:[jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"3",xl:"4",className:"workspace-folders p-12 pt-0 gap-12",children:jsxRuntimeExports.jsxs("div",{style:{position:"sticky",top:0,paddingTop:"1.2rem"},children:[jsxRuntimeExports.jsx(TreeView,{ref:vt,data:lt,onTreeItemClick:Xt=>Gt("owner",Xt),onTreeItemUnfold:Xt=>Gt("owner",Xt)}),jsxRuntimeExports.jsx(TreeView,{ref:Et,data:ct,onTreeItemClick:Xt=>Gt("shared",Xt),onTreeItemUnfold:Xt=>Gt("shared",Xt)}),jsxRuntimeExports.jsx(TreeView,{ref:bt,data:ht,onTreeItemClick:Xt=>Gt("protected",Xt),onTreeItemUnfold:Xt=>Gt("protected",Xt)}),ot&&jsxRuntimeExports.jsx(TreeView,{ref:wt,data:xt,onTreeItemClick:Xt=>Gt("public",Xt),onTreeItemUnfold:Xt=>Gt("public",Xt)})]})}),jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"5",xl:"8",children:jsxRuntimeExports.jsxs(Grid,{className:"flex-grow-1 gap-0",children:[jsxRuntimeExports.jsxs(Grid.Col,{sm:"4",md:"8",xl:"12",children:[jsxRuntimeExports.jsx("div",{className:"workspace-search px-16 py-8 ",children:jsxRuntimeExports.jsx(SearchBar,{isVariant:!0,className:"gap-16",onChange:$t})}),jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center justify-content-end px-8 py-4",children:[jsxRuntimeExports.jsx("small",{className:"text-muted",children:at("workspace.search.order")}),jsxRuntimeExports.jsxs(Dropdown,{children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"sm",label:Ft(),variant:"ghost"}),jsxRuntimeExports.jsxs(Dropdown.Menu,{children:[jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortTime,{}),onClick:()=>Ut(["modified","desc"]),children:at("sort.order.modify.desc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortAscendingLetters,{}),onClick:()=>Ut(["name","asc"]),children:at("sort.order.alpha.asc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortDescendingLetters,{}),onClick:()=>Ut(["name","desc"]),children:at("sort.order.alpha.desc")})]})]})]})]}),jsxRuntimeExports.jsx(Grid.Col,{sm:"4",md:"8",xl:"12",className:"p-8 gap-8",children:It?It.length!==0?jsxRuntimeExports.jsx("div",{className:"grid grid-workspace",children:It.map(Xt=>{const rr=Lt.includes(Xt);return jsxRuntimeExports.jsx(FileCard,{doc:Xt,isSelected:rr,onClick:()=>Yt(Xt)},Xt._id)})}):jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuTrash,text:at("workspace.empty.docSpace"),title:at("explorer.emptyScreen.trash.title")}):jsxRuntimeExports.jsx(LoadingScreen,{})})]})})]})},Workspace=()=>{const{type:tt,setResultCounter:et,setResult:rt,multiple:st,visibility:nt}=useMediaLibraryContext();function ot(){switch(tt){case"image":return"img";case"audio":return"audio";case"video":return"video";default:return null}}function at(lt){et(lt.length),lt.length?rt(lt):rt()}return jsxRuntimeExports.jsx(Workspace$1,{roles:ot(),onSelect:at,multiple:st,className:"border rounded overflow-y-auto",defaultFolder:nt,showPublicFolder:nt==="public"})},InnerTabs={Audio,Video,Upload,ExternalLink,Workspace,InternalLink,Iframe,VideoEmbedder},TabsContext=reactExports.createContext(null);function useTabsContext(){const tt=reactExports.useContext(TabsContext);if(!tt)throw new Error("Tabs compound components cannot be rendered outside the Tabs component");return tt}const useTabs=({defaultId:tt,items:et,onChange:rt})=>{const[st,nt]=reactExports.useState(tt||""),[ot,at]=reactExports.useState(0),[lt,ut]=reactExports.useState(0),ct=reactExports.useRef([]),dt=reactExports.useCallback(yt=>{nt(yt)},[]);reactExports.useEffect(()=>{const yt=et.find(vt=>vt.id===st);yt&&(rt==null||rt(yt))},[st]),reactExports.useEffect(()=>{function yt(){var vt;if(((vt=document==null?void 0:document.activeElement)==null?void 0:vt.tagName)!=="INPUT"){const Et=et.findIndex(wt=>wt.id===st);Et===-1&&tt&&nt(tt);const bt=ct.current[Et];bt&&(bt.focus(),ut((bt==null?void 0:bt.offsetLeft)??0),at((bt==null?void 0:bt.clientWidth)??0))}}return yt(),window.addEventListener("resize",yt),()=>window.removeEventListener("resize",yt)},[st,et,tt]);const ht=reactExports.useCallback(yt=>{var vt,Et,bt;const wt=et.findIndex(St=>St.id===yt);yt===((vt=et[0])==null?void 0:vt.id)?nt((Et=et[et.length-1])==null?void 0:Et.id):nt((bt=et[wt-1])==null?void 0:bt.id)},[et]),ft=reactExports.useCallback(yt=>{var vt,Et,bt;const wt=et.findIndex(St=>St.id===yt);yt===((vt=et[et.length-1])==null?void 0:vt.id)?nt((Et=et[0])==null?void 0:Et.id):nt((bt=et[wt+1])==null?void 0:bt.id)},[et]),xt=reactExports.useCallback(yt=>{var vt,Et;switch(yt.code){case"ArrowLeft":ht(st);break;case"ArrowRight":ft(st);break;case"Home":nt((vt=et[0])==null?void 0:vt.id);break;case"End":nt((Et=et[et.length-1])==null?void 0:Et.id);break}},[st,et,ft,ht]);return{activeTab:st,setSelectedTab:dt,tabsRef:ct,tabUnderlineLeft:lt,tabUnderlineWidth:ot,onKeyDown:xt}},TabsItem=({icon:tt,label:et,id:rt,order:st})=>{const{activeTab:nt,setSelectedTab:ot,onKeyDown:at,tabsRef:lt}=useTabsContext(),{t:ut}=useTranslation(),ct=clsx("nav-link d-inline-flex gap-8 border-0",nt===rt?"selected":"");return jsxRuntimeExports.jsx("li",{className:"nav-item flex-shrink-0",role:"presentation",children:jsxRuntimeExports.jsxs("button",{ref:dt=>lt.current[st]=dt,type:"button",id:`tab-${rt}`,className:ct,onClick:()=>ot(rt),onKeyDown:dt=>at(dt),role:"tab","aria-controls":`tabpanel-${rt}`,"aria-selected":nt===rt,tabIndex:nt===rt?0:-1,children:[tt,jsxRuntimeExports.jsx("small",{children:ut(et)})]})})},TabsList=tt=>{const{items:et,tabUnderlineLeft:rt,tabUnderlineWidth:st}=useTabsContext(),{className:nt,...ot}=tt,at=clsx("position-relative flex-shrink-0 overflow-x-auto",nt);return jsxRuntimeExports.jsxs("div",{className:at,...ot,children:[jsxRuntimeExports.jsx("ul",{className:"nav nav-tabs flex-nowrap",role:"tablist",children:et.map((lt,ut)=>jsxRuntimeExports.jsx(Tabs.Item,{order:ut,...lt},lt.id))}),jsxRuntimeExports.jsx("span",{className:"nav-slide",style:{left:rt,width:st}})]})},TabsPanel=({children:tt,currentItem:et})=>{const{activeTab:rt}=useTabsContext();return jsxRuntimeExports.jsx("div",{className:"tab-content d-flex flex-fill w-100",children:jsxRuntimeExports.jsx("div",{className:`tab-pane flex-fill w-100 fade ${rt===(et==null?void 0:et.id)?"show active":""}`,id:`tabpanel-${et==null?void 0:et.id}`,role:"tabpanel","aria-labelledby":`tab-${et==null?void 0:et.id}`,tabIndex:0,children:tt})})},Tabs=({defaultId:tt,items:et,onChange:rt,children:st})=>{const{activeTab:nt,setSelectedTab:ot,tabsRef:at,tabUnderlineLeft:lt,tabUnderlineWidth:ut,onKeyDown:ct}=useTabs({defaultId:tt,items:et,onChange:rt}),dt=reactExports.useMemo(()=>({activeTab:nt,items:et,setSelectedTab:ot,tabsRef:at,tabUnderlineLeft:lt,tabUnderlineWidth:ut,onKeyDown:ct}),[nt,et,ct,ot,lt,ut,at]),ht=et.find(ft=>ft.id===nt);return jsxRuntimeExports.jsx(TabsContext.Provider,{value:dt,children:typeof st=="function"?st(ht):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tabs.List,{}),jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:ht,children:ht==null?void 0:ht.content})]})})};Tabs.Item=TabsItem;Tabs.Panel=TabsPanel;Tabs.List=TabsList;const orderedTabs=["audio-capture","video-capture","internal-link","external-link","iframe","upload","workspace","video-embedder"],mediaLibraryTypes={none:null,audio:{title:"bbm.audio.modal.title",defaultTab:"audio-capture"},video:{title:"bbm.video.modal.title",defaultTab:"video-capture"},image:{title:"bbm.image.modal.title",defaultTab:"workspace"},attachment:{title:"bbm.attachment.modal.title",defaultTab:"workspace"},hyperlink:{title:"bbm.link.modal.title",defaultTab:"linker"},embedder:{title:"bbm.embed.modal.title",defaultTab:"iframe"}},MediaLibrary=reactExports.forwardRef(({appCode:tt,visibility:et,multiple:rt,onSuccess:st,onCancel:nt,onTabChange:ot},at)=>{var lt;const ut=reactExports.useRef(),ct=reactExports.useRef(null);reactExports.useImperativeHandle(at,()=>({show:kt,hide:Mt,showLink:Bt,type:xt,...ct.current})),useHttpErrorToast({isDismissible:!0,duration:1/0});const{t:dt}=useTranslation(),ht=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"),ft=useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"),[xt,yt]=reactExports.useState(null),vt={workspace:{id:"workspace",icon:jsxRuntimeExports.jsx(SvgIconFolder,{}),label:dt("bbm.workspace"),content:jsxRuntimeExports.jsx(InnerTabs.Workspace,{}),availableFor:["audio","video","image","attachment"],isEnable:null},upload:{id:"upload",icon:jsxRuntimeExports.jsx(SvgIconSmartphone,{}),label:dt("bbm.device"),content:jsxRuntimeExports.jsx(InnerTabs.Upload,{}),availableFor:["audio","video","image","attachment"],isEnable:()=>!!ht},"video-capture":{id:"video-capture",icon:jsxRuntimeExports.jsx(SvgIconRecordVideo,{}),label:dt("bbm.video"),content:jsxRuntimeExports.jsx(InnerTabs.Video,{}),availableFor:["video"],isEnable:()=>!!ft},"audio-capture":{id:"audio-capture",icon:jsxRuntimeExports.jsx(SvgIconMic,{}),label:dt("bbm.audio"),content:jsxRuntimeExports.jsx(InnerTabs.Audio,{}),availableFor:["audio"],isEnable:()=>!!ht},"external-link":{id:"external-link",icon:jsxRuntimeExports.jsx(SvgIconGlobe,{}),label:dt("bbm.linker.ext"),content:jsxRuntimeExports.jsx(InnerTabs.ExternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},"internal-link":{id:"internal-link",icon:jsxRuntimeExports.jsx(SvgIconApplications,{}),label:dt("bbm.linker.int"),content:jsxRuntimeExports.jsx(InnerTabs.InternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},iframe:{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.Iframe,{}),availableFor:["embedder"],isEnable:null},"video-embedder":{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.VideoEmbedder,{}),availableFor:["video"],isEnable:null}},Et=reactExports.useMemo(()=>orderedTabs.map(Zt=>vt[Zt]).filter(Zt=>{var Xt;return((Xt=Zt.isEnable)==null?void 0:Xt.call(Zt))!==!1&&(Zt.availableFor.length===0||Zt.availableFor.includes(xt))}),[xt]),[bt,wt]=reactExports.useState(),St=reactExports.useMemo(()=>{const Zt=Et.findIndex(Xt=>Xt.id===bt);return 0>Zt||Zt>=Et.length?0:Zt},[Et,bt]),[Rt,Ct]=reactExports.useState(),[Pt,It]=reactExports.useState(),[jt,Dt]=reactExports.useState([]),[Ht,Nt]=reactExports.useState();function Ut(Zt){throw Et.findIndex(Xt=>Xt.id===Zt)<0?"tab.not.visible":"not.implemented.yet"}function Lt(Zt){ut.current=void 0,wt(void 0),yt(Zt)}const kt=Zt=>{yt(Zt)},Mt=()=>{yt(null)},Bt=Zt=>{ut.current=Zt,"resourceId"in Zt||"appPrefix"in Zt||wt("external-link"),yt("hyperlink")};reactExports.useEffect(()=>{var Zt,Xt;const rr=xt||"none";!bt&&typeof((Zt=mediaLibraryTypes[rr])==null?void 0:Zt.defaultTab)=="string"&&wt((Xt=mediaLibraryTypes[rr])==null?void 0:Xt.defaultTab)},[bt,xt]);const Gt=dt(((lt=mediaLibraryTypes[xt??"none"])==null?void 0:lt.title)??"bbm"),$t=()=>{ut.current=void 0,It(void 0),Ct(void 0),wt(void 0),Nt(void 0),Dt([])},zt=Zt=>{ot==null||ot(Zt,jt),$t()},Ft=reactExports.useCallback(()=>{const Zt=async Xt=>{Xt instanceof Array&&["protected","public"].findIndex(rr=>rr===et)>=0&&(Xt=await odeServices.workspace().transferDocuments(Xt,tt??"media-library",et)),st(Xt)};Ht?Ht().then(Xt=>{Zt(Xt)}):Pt&&Zt(Pt),$t()},[Ht,Pt,st,et,tt]),Yt=()=>{nt(jt),$t()};return xt&&jsxRuntimeExports.jsx(MediaLibraryContext.Provider,{value:{appCode:tt,visibility:et,multiple:rt,type:xt,setResultCounter:Ct,setResult:It,setCancellable:Zt=>Dt([...Zt]),setVisibleTab:Ut,switchType:Lt,setPreSuccess:Nt},children:jsxRuntimeExports.jsxs(Modal,{id:"media-library",isOpen:xt!==null,onModalClose:Yt,size:"lg",viewport:!0,scrollable:!0,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:Yt,children:Gt}),jsxRuntimeExports.jsx(Tabs,{items:Et,defaultId:Et[St].id,onChange:zt,children:Zt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Et.length>1&&jsxRuntimeExports.jsx(Tabs.List,{className:"mt-16"}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex",children:jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:Zt,children:Zt==null?void 0:Zt.content})})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:Yt,children:dt("cancel")}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",disabled:typeof Pt>"u",onClick:Ft,children:Rt&&Rt>1?dt("addMultiple",{number:Rt}):dt("add")})]})]})})});function PublishModal$2({isOpen:tt,resourceId:et,onSuccess:rt,onCancel:st}){const{appCode:nt,currentApp:ot}=useEdificeClient(),{ref:at,libraryMedia:lt,...ut}=useMediaLibrary(),{t:ct}=useTranslation(),dt=useResource(nt,et),{control:ht,cover:ft,formState:{isDirty:xt,isValid:yt,isSubmitting:vt},handleDeleteImage:Et,handleSubmit:bt,handleUploadImage:wt,handlePublish:St,register:Rt,selectActivities:Ct,selectedActivities:Pt,selectedSubjectAreas:It,selectSubjects:jt}=usePublishModal({resource:dt,onSuccess:rt});return dt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:st,id:"libraryModal",size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:st,children:ct("bpr.publish")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:ct("bpr.form.tip")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.general")}),jsxRuntimeExports.jsxs("form",{id:"libraryModalForm",onSubmit:bt(St),children:[jsxRuntimeExports.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[jsxRuntimeExports.jsxs("div",{style:{maxWidth:"160px"},children:[jsxRuntimeExports.jsx("div",{className:"form-label",children:ct("bpr.form.publication.cover.title")}),jsxRuntimeExports.jsx(ImagePicker,{app:ot,src:dt==null?void 0:dt.thumbnail,addButtonLabel:ct("bpr.form.publication.cover.upload.add"),deleteButtonLabel:ct("bpr.form.publication.cover.upload.remove"),onUploadImage:wt,onDeleteImage:Et,className:"align-self-center",libraryMedia:lt,mediaLibraryRef:at}),!ft&&jsxRuntimeExports.jsx("p",{className:"form-text is-invalid",children:jsxRuntimeExports.jsx("em",{children:ct("bpr.form.publication.cover.upload.required.image")})})]}),jsxRuntimeExports.jsxs("div",{className:"flex-fill",children:[jsxRuntimeExports.jsxs(FormControl,{id:"title",className:"mb-16",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.title")}),jsxRuntimeExports.jsx(Input,{type:"text",defaultValue:dt==null?void 0:dt.name,...Rt("title",{required:!0}),placeholder:ct("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),jsxRuntimeExports.jsxs(FormControl,{id:"description",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.description")}),jsxRuntimeExports.jsx(TextArea,{...Rt("description",{required:!0}),placeholder:ct("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.infos")}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[jsxRuntimeExports.jsx(ActivitiesDropdown,{control:ht,selectedActivities:Pt,selectActivities:Ct}),jsxRuntimeExports.jsx(SubjectsDropdown,{control:ht,selectedSubjectAreas:It,selectSubjects:jt}),jsxRuntimeExports.jsx(LangSelect,{control:ht})]}),jsxRuntimeExports.jsxs("div",{className:"mb-24",children:[jsxRuntimeExports.jsx("label",{htmlFor:"",className:"form-label",children:ct("bpr.form.publication.age")}),jsxRuntimeExports.jsxs("div",{className:"d-flex gap-8",children:[jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMin",placeholderOption:"bpr.form.publication.age.min",validate:(Nt,Ut)=>parseInt(Nt)<=parseInt(Ut.ageMax)})}),jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMax",placeholderOption:"bpr.form.publication.age.max",validate:(Nt,Ut)=>parseInt(Nt)>=parseInt(Ut.ageMin)})})]})]}),jsxRuntimeExports.jsx("div",{className:"mb-24",children:jsxRuntimeExports.jsxs(FormControl,{id:"keywords",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.keywords")}),jsxRuntimeExports.jsx(Input,{type:"text",...Rt("keyWords"),size:"md",placeholder:ct("bpr.form.publication.keywords.placeholder")})]})}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.licence.text")}),jsxRuntimeExports.jsx(PublishModalFooter,{})]})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:st,type:"button",variant:"ghost",children:ct("cancel")}),jsxRuntimeExports.jsx(Button,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:vt,disabled:!ft||vt||!xt||!yt,children:ct("bpr.form.submit")})]}),jsxRuntimeExports.jsx(MediaLibrary,{appCode:nt,ref:at,multiple:!1,visibility:"protected",...ut})]}),document.getElementById("portal")):jsxRuntimeExports.jsx(LoadingScreen,{})}const SvgIconCopy=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.676 3c.284-.672.853-1 1.263-1h11.423c.566 0 1.438.628 1.438 1.923v13.154c0 1.056-.58 1.668-1.1 1.858V6.923C19.7 4.99 18.3 3 16.061 3zm-2.272.007C4.765 1.41 6.056 0 7.939 0h11.423C21.599 0 23 1.99 23 3.923v13.154c0 1.865-1.303 3.782-3.403 3.916C19.235 22.59 17.944 24 16.06 24H4.638C2.401 24 1 22.01 1 20.077V6.923c0-1.865 1.303-3.782 3.404-3.916M3.2 6.923C3.2 5.628 4.072 5 4.638 5h11.423c.567 0 1.439.628 1.439 1.923v13.154c0 1.295-.872 1.923-1.439 1.923H4.638c-.566 0-1.438-.628-1.438-1.923z",clipRule:"evenodd"})]}),defaults=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function objectHash(tt,et){et?et={...defaults,...et}:et=defaults;const rt=createHasher(et);return rt.dispatch(tt),rt.toString()}const defaultPrototypesKeys=Object.freeze(["prototype","__proto__","constructor"]);function createHasher(tt){let et="",rt=new Map;const st=nt=>{et+=nt};return{toString(){return et},getContext(){return rt},dispatch(nt){return tt.replacer&&(nt=tt.replacer(nt)),this[nt===null?"null":typeof nt](nt)},object(nt){if(nt&&typeof nt.toJSON=="function")return this.object(nt.toJSON());const ot=Object.prototype.toString.call(nt);let at="";const lt=ot.length;lt<10?at="unknown:["+ot+"]":at=ot.slice(8,lt-1),at=at.toLowerCase();let ut=null;if((ut=rt.get(nt))===void 0)rt.set(nt,rt.size);else return this.dispatch("[CIRCULAR:"+ut+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(nt))return st("buffer:"),st(nt.toString("utf8"));if(at!=="object"&&at!=="function"&&at!=="asyncfunction")this[at]?this[at](nt):tt.ignoreUnknown||this.unkown(nt,at);else{let ct=Object.keys(nt);tt.unorderedObjects&&(ct=ct.sort());let dt=[];tt.respectType!==!1&&!isNativeFunction(nt)&&(dt=defaultPrototypesKeys),tt.excludeKeys&&(ct=ct.filter(ft=>!tt.excludeKeys(ft)),dt=dt.filter(ft=>!tt.excludeKeys(ft))),st("object:"+(ct.length+dt.length)+":");const ht=ft=>{this.dispatch(ft),st(":"),tt.excludeValues||this.dispatch(nt[ft]),st(",")};for(const ft of ct)ht(ft);for(const ft of dt)ht(ft)}},array(nt,ot){if(ot=ot===void 0?tt.unorderedArrays!==!1:ot,st("array:"+nt.length+":"),!ot||nt.length<=1){for(const ut of nt)this.dispatch(ut);return}const at=new Map,lt=nt.map(ut=>{const ct=createHasher(tt);ct.dispatch(ut);for(const[dt,ht]of ct.getContext())at.set(dt,ht);return ct.toString()});return rt=at,lt.sort(),this.array(lt,!1)},date(nt){return st("date:"+nt.toJSON())},symbol(nt){return st("symbol:"+nt.toString())},unkown(nt,ot){if(st(ot),!!nt&&(st(":"),nt&&typeof nt.entries=="function"))return this.array(Array.from(nt.entries()),!0)},error(nt){return st("error:"+nt.toString())},boolean(nt){return st("bool:"+nt)},string(nt){st("string:"+nt.length+":"),st(nt)},function(nt){st("fn:"),isNativeFunction(nt)?this.dispatch("[native]"):this.dispatch(nt.toString()),tt.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(nt.name)),tt.respectFunctionProperties&&this.object(nt)},number(nt){return st("number:"+nt)},xml(nt){return st("xml:"+nt.toString())},null(){return st("Null")},undefined(){return st("Undefined")},regexp(nt){return st("regex:"+nt.toString())},uint8array(nt){return st("uint8array:"),this.dispatch(Array.prototype.slice.call(nt))},uint8clampedarray(nt){return st("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(nt))},int8array(nt){return st("int8array:"),this.dispatch(Array.prototype.slice.call(nt))},uint16array(nt){return st("uint16array:"),this.dispatch(Array.prototype.slice.call(nt))},int16array(nt){return st("int16array:"),this.dispatch(Array.prototype.slice.call(nt))},uint32array(nt){return st("uint32array:"),this.dispatch(Array.prototype.slice.call(nt))},int32array(nt){return st("int32array:"),this.dispatch(Array.prototype.slice.call(nt))},float32array(nt){return st("float32array:"),this.dispatch(Array.prototype.slice.call(nt))},float64array(nt){return st("float64array:"),this.dispatch(Array.prototype.slice.call(nt))},arraybuffer(nt){return st("arraybuffer:"),this.dispatch(new Uint8Array(nt))},url(nt){return st("url:"+nt.toString())},map(nt){st("map:");const ot=[...nt];return this.array(ot,tt.unorderedSets!==!1)},set(nt){st("set:");const ot=[...nt];return this.array(ot,tt.unorderedSets!==!1)},file(nt){return st("file:"),this.dispatch([nt.name,nt.size,nt.type,nt.lastModfied])},blob(){if(tt.ignoreUnknown)return st("[blob]");throw new Error(`Hashing Blob objects is currently not supported
|
|
1392
1392
|
Use "options.replacer" or "options.ignoreUnknown"
|
|
1393
|
-
`)},domwindow(){return st("domwindow")},bigint(nt){return st("bigint:"+nt.toString())},process(){return st("process")},timer(){return st("timer")},pipe(){return st("pipe")},tcp(){return st("tcp")},udp(){return st("udp")},tty(){return st("tty")},statwatcher(){return st("statwatcher")},securecontext(){return st("securecontext")},connection(){return st("connection")},zlib(){return st("zlib")},context(){return st("context")},nodescript(){return st("nodescript")},httpparser(){return st("httpparser")},dataview(){return st("dataview")},signal(){return st("signal")},fsevent(){return st("fsevent")},tlswrap(){return st("tlswrap")}}}const nativeFunc="[native code] }",nativeFuncLength=nativeFunc.length;function isNativeFunction(tt){return typeof tt!="function"?!1:Function.prototype.toString.call(tt).slice(-nativeFuncLength)===nativeFunc}class WordArray{constructor(et,rt){et=this.words=et||[],this.sigBytes=rt===void 0?et.length*4:rt}toString(et){return(et||Hex).stringify(this)}concat(et){if(this.clamp(),this.sigBytes%4)for(let rt=0;rt<et.sigBytes;rt++){const st=et.words[rt>>>2]>>>24-rt%4*8&255;this.words[this.sigBytes+rt>>>2]|=st<<24-(this.sigBytes+rt)%4*8}else for(let rt=0;rt<et.sigBytes;rt+=4)this.words[this.sigBytes+rt>>>2]=et.words[rt>>>2];return this.sigBytes+=et.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new WordArray([...this.words])}}const Hex={stringify(tt){const et=[];for(let rt=0;rt<tt.sigBytes;rt++){const st=tt.words[rt>>>2]>>>24-rt%4*8&255;et.push((st>>>4).toString(16),(st&15).toString(16))}return et.join("")}},Base64={stringify(tt){const et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",rt=[];for(let st=0;st<tt.sigBytes;st+=3){const nt=tt.words[st>>>2]>>>24-st%4*8&255,ot=tt.words[st+1>>>2]>>>24-(st+1)%4*8&255,at=tt.words[st+2>>>2]>>>24-(st+2)%4*8&255,lt=nt<<16|ot<<8|at;for(let ut=0;ut<4&&st*8+ut*6<tt.sigBytes*8;ut++)rt.push(et.charAt(lt>>>6*(3-ut)&63))}return rt.join("")}},Latin1={parse(tt){const et=tt.length,rt=[];for(let st=0;st<et;st++)rt[st>>>2]|=(tt.charCodeAt(st)&255)<<24-st%4*8;return new WordArray(rt,et)}},Utf8={parse(tt){return Latin1.parse(unescape(encodeURIComponent(tt)))}};class BufferedBlockAlgorithm{constructor(){this._data=new WordArray,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=512/32}reset(){this._data=new WordArray,this._nDataBytes=0}_append(et){typeof et=="string"&&(et=Utf8.parse(et)),this._data.concat(et),this._nDataBytes+=et.sigBytes}_doProcessBlock(et,rt){}_process(et){let rt,st=this._data.sigBytes/(this.blockSize*4);et?st=Math.ceil(st):st=Math.max((st|0)-this._minBufferSize,0);const nt=st*this.blockSize,ot=Math.min(nt*4,this._data.sigBytes);if(nt){for(let at=0;at<nt;at+=this.blockSize)this._doProcessBlock(this._data.words,at);rt=this._data.words.splice(0,nt),this._data.sigBytes-=ot}return new WordArray(rt,ot)}}class Hasher extends BufferedBlockAlgorithm{update(et){return this._append(et),this._process(),this}finalize(et){et&&this._append(et)}}const H=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],K=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],W=[];class SHA256 extends Hasher{constructor(){super(...arguments),this._hash=new WordArray([...H])}reset(){super.reset(),this._hash=new WordArray([...H])}_doProcessBlock(et,rt){const st=this._hash.words;let nt=st[0],ot=st[1],at=st[2],lt=st[3],ut=st[4],ct=st[5],dt=st[6],ht=st[7];for(let ft=0;ft<64;ft++){if(ft<16)W[ft]=et[rt+ft]|0;else{const St=W[ft-15],Rt=(St<<25|St>>>7)^(St<<14|St>>>18)^St>>>3,Ct=W[ft-2],Pt=(Ct<<15|Ct>>>17)^(Ct<<13|Ct>>>19)^Ct>>>10;W[ft]=Rt+W[ft-7]+Pt+W[ft-16]}const xt=ut&ct^~ut&dt,yt=nt&ot^nt&at^ot&at,vt=(nt<<30|nt>>>2)^(nt<<19|nt>>>13)^(nt<<10|nt>>>22),Et=(ut<<26|ut>>>6)^(ut<<21|ut>>>11)^(ut<<7|ut>>>25),bt=ht+Et+xt+K[ft]+W[ft],wt=vt+yt;ht=dt,dt=ct,ct=ut,ut=lt+bt|0,lt=at,at=ot,ot=nt,nt=bt+wt|0}st[0]=st[0]+nt|0,st[1]=st[1]+ot|0,st[2]=st[2]+at|0,st[3]=st[3]+lt|0,st[4]=st[4]+ut|0,st[5]=st[5]+ct|0,st[6]=st[6]+dt|0,st[7]=st[7]+ht|0}finalize(et){super.finalize(et);const rt=this._nDataBytes*8,st=this._data.sigBytes*8;return this._data.words[st>>>5]|=128<<24-st%32,this._data.words[(st+64>>>9<<4)+14]=Math.floor(rt/4294967296),this._data.words[(st+64>>>9<<4)+15]=rt,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function sha256base64(tt){return new SHA256().finalize(tt).toString(Base64)}function hash(tt,et={}){const rt=typeof tt=="string"?tt:objectHash(tt,et);return sha256base64(rt).slice(0,10)}var slugify$1={};Object.defineProperty(slugify$1,"__esModule",{value:!0});const stripAccents=tt=>{const et="ÀÁÂÃÄÅĄĀàáâãäåąāÒÓÔÕÕÖØòóôõöøÈÉÊËĘĒèéêëðęēÇĆČçćčÐÌÍÎÏĪìíîïīÙÚÛÜŪùúûüūÑŅñņŠŚšśŸÿýŽŹŻžźżŁĻłļŃŅńņàáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîüûñçýỳỹỵỷğışĞİŞĢģĶķ",rt="AAAAAAAAaaaaaaaaOOOOOOOooooooEEEEEEeeeeeeeCCCcccDIIIIIiiiiiUUUUUuuuuuNNnnSSssYyyZZZzzzLLllNNnnaaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiuuncyyyyygisGISGgKk",st=et.split("").join("|"),nt=new RegExp(`(${st})`,"g");function ot(at){return rt[et.indexOf(at)]||""}return tt.replace(nt,ot)},getSafeRegexpString=tt=>tt.split("").map(et=>`\\${et}`).join(""),harmonize=(tt,et,rt=!1)=>{const st=stripAccents(tt).trim().toLowerCase(),nt=getSafeRegexpString(et);return rt?st.replace(/\s+/g,et):st.replace(new RegExp(`[^a-z0-9${nt}]+`,"g"),et).replace(new RegExp(`${nt}+`,"g"),et).replace(new RegExp(`^${nt}`,"g"),"").replace(new RegExp(`${nt}$`,"g"),"")},slugify=(tt,et={delimiter:"-",prefix:""})=>{if(et.delimiter||(et.delimiter="-"),et.prefix||(et.prefix=""),!tt||typeof tt=="boolean")return"";const{delimiter:rt,prefix:st}=et;if(typeof tt=="boolean")return"";if(typeof tt=="string"||typeof tt=="number"){const nt=harmonize(st,rt,!0),ot=harmonize(String(tt),rt);return nt?`${nt}${rt}${ot}`:ot}return"children"in tt?slugify(tt.children):"type"in tt?slugify(tt.props.children,et):Symbol.iterator in tt?slugify(Array.from(tt).map(nt=>slugify(nt,{delimiter:rt})).join(rt),et):""};var _default=slugify$1.default=slugify;const useSlug=({watch:tt,setValue:et,selectedResource:rt})=>{const[st,nt]=reactExports.useState(""),[ot,at]=reactExports.useState((rt==null?void 0:rt.public)||!1),lt=reactExports.useId(),ut=tt("title"),{t:ct}=useTranslation(),dt=useToast();reactExports.useEffect(()=>{if(ot){let xt="";rt?xt=rt.slug?rt.slug:`${hash({foo:`${ut}${lt}`})}-${_default(ut)}`:xt=`${hash({foo:`${ut}${lt}`})}-${_default(ut)}`,et("formSlug",xt),nt(xt)}},[ot,ut]);function ht(xt){at(xt)}function ft(xt){navigator.clipboard.writeText(`${window.location.origin}${xt||window.location.pathname}/pub/${st}`),dt.success(ct("explorer.copy.clipboard"))}return{slug:st,uniqueId:lt,isPublic:ot,resourceName:ut,onPublicChange:ht,onCopyToClipBoard:ft}},BlogPublic=({appCode:tt,isUpdating:et,resource:rt,watch:st,register:nt,setValue:ot})=>{const{t:at}=useTranslation(),{slug:lt,isPublic:ut,resourceName:ct,onPublicChange:dt,onCopyToClipBoard:ht}=useSlug({watch:st,setValue:ot,selectedResource:et?rt:void 0});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:[at("explorer.resource.editModal.heading.access"),tt]}),jsxRuntimeExports.jsx(Alert,{type:"info",children:at("explorer.resource.editModal.access.alert")}),jsxRuntimeExports.jsxs(FormControl,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[jsxRuntimeExports.jsx(FormControl.Input,{type:"checkbox",role:"switch",defaultChecked:et?rt.public:!1,...nt("enablePublic",{disabled:!ct,onChange:ft=>{const xt=ft.target.checked;dt(xt)}}),className:"form-check-input mt-0",size:"md"}),jsxRuntimeExports.jsx(FormControl.Label,{className:"form-check-label mb-0",children:at("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),ut&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FormControl,{id:"formSlug",children:jsxRuntimeExports.jsx(Input,{type:"text",hidden:!0,defaultValue:et?lt:"",...nt("formSlug"),size:"sm"})},lt),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[jsxRuntimeExports.jsxs("p",{className:"text-break",children:[window.location.origin,"/blog/pub/",lt]}),jsxRuntimeExports.jsx(Button,{color:"primary",disabled:!ut,onClick:()=>ht("/blog"),type:"button",leftIcon:jsxRuntimeExports.jsx(SvgIconCopy,{}),variant:"ghost",className:"text-nowrap",children:at("explorer.resource.editModal.access.url.button")})]})]})]})};var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(tt){return this.listeners.add(tt),this.onSubscribe(),()=>{this.listeners.delete(tt),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$1(){}function functionalUpdate(tt,et){return typeof tt=="function"?tt(et):tt}function isValidTimeout(tt){return typeof tt=="number"&&tt>=0&&tt!==1/0}function timeUntilStale(tt,et){return Math.max(tt+(et||0)-Date.now(),0)}function resolveStaleTime(tt,et){return typeof tt=="function"?tt(et):tt}function resolveEnabled(tt,et){return typeof tt=="function"?tt(et):tt}function matchQuery(tt,et){const{type:rt="all",exact:st,fetchStatus:nt,predicate:ot,queryKey:at,stale:lt}=tt;if(at){if(st){if(et.queryHash!==hashQueryKeyByOptions(at,et.options))return!1}else if(!partialMatchKey(et.queryKey,at))return!1}if(rt!=="all"){const ut=et.isActive();if(rt==="active"&&!ut||rt==="inactive"&&ut)return!1}return!(typeof lt=="boolean"&&et.isStale()!==lt||nt&&nt!==et.state.fetchStatus||ot&&!ot(et))}function matchMutation(tt,et){const{exact:rt,status:st,predicate:nt,mutationKey:ot}=tt;if(ot){if(!et.options.mutationKey)return!1;if(rt){if(hashKey(et.options.mutationKey)!==hashKey(ot))return!1}else if(!partialMatchKey(et.options.mutationKey,ot))return!1}return!(st&&et.state.status!==st||nt&&!nt(et))}function hashQueryKeyByOptions(tt,et){return((et==null?void 0:et.queryKeyHashFn)||hashKey)(tt)}function hashKey(tt){return JSON.stringify(tt,(et,rt)=>isPlainObject(rt)?Object.keys(rt).sort().reduce((st,nt)=>(st[nt]=rt[nt],st),{}):rt)}function partialMatchKey(tt,et){return tt===et?!0:typeof tt!=typeof et?!1:tt&&et&&typeof tt=="object"&&typeof et=="object"?!Object.keys(et).some(rt=>!partialMatchKey(tt[rt],et[rt])):!1}function replaceEqualDeep(tt,et){if(tt===et)return tt;const rt=isPlainArray(tt)&&isPlainArray(et);if(rt||isPlainObject(tt)&&isPlainObject(et)){const st=rt?tt:Object.keys(tt),nt=st.length,ot=rt?et:Object.keys(et),at=ot.length,lt=rt?[]:{};let ut=0;for(let ct=0;ct<at;ct++){const dt=rt?ct:ot[ct];(!rt&&st.includes(dt)||rt)&&tt[dt]===void 0&&et[dt]===void 0?(lt[dt]=void 0,ut++):(lt[dt]=replaceEqualDeep(tt[dt],et[dt]),lt[dt]===tt[dt]&&tt[dt]!==void 0&&ut++)}return nt===at&&ut===nt?tt:lt}return et}function shallowEqualObjects(tt,et){if(!et||Object.keys(tt).length!==Object.keys(et).length)return!1;for(const rt in tt)if(tt[rt]!==et[rt])return!1;return!0}function isPlainArray(tt){return Array.isArray(tt)&&tt.length===Object.keys(tt).length}function isPlainObject(tt){if(!hasObjectPrototype(tt))return!1;const et=tt.constructor;if(et===void 0)return!0;const rt=et.prototype;return!(!hasObjectPrototype(rt)||!rt.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(tt)!==Object.prototype)}function hasObjectPrototype(tt){return Object.prototype.toString.call(tt)==="[object Object]"}function sleep(tt){return new Promise(et=>{setTimeout(et,tt)})}function replaceData(tt,et,rt){return typeof rt.structuralSharing=="function"?rt.structuralSharing(tt,et):rt.structuralSharing!==!1?replaceEqualDeep(tt,et):et}function addToEnd(tt,et,rt=0){const st=[...tt,et];return rt&&st.length>rt?st.slice(1):st}function addToStart(tt,et,rt=0){const st=[et,...tt];return rt&&st.length>rt?st.slice(0,-1):st}var skipToken=Symbol();function ensureQueryFn(tt,et){return!tt.queryFn&&(et!=null&&et.initialPromise)?()=>et.initialPromise:!tt.queryFn||tt.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${tt.queryHash}'`)):tt.queryFn}var xl,Bo,Yl,Wp,FocusManager=(Wp=class extends Subscribable{constructor(){super();kr(this,xl);kr(this,Bo);kr(this,Yl);Rr(this,Yl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et();return window.addEventListener("visibilitychange",rt,!1),()=>{window.removeEventListener("visibilitychange",rt)}}})}onSubscribe(){Kt(this,Bo)||this.setEventListener(Kt(this,Yl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Bo))==null||et.call(this),Rr(this,Bo,void 0))}setEventListener(et){var rt;Rr(this,Yl,et),(rt=Kt(this,Bo))==null||rt.call(this),Rr(this,Bo,et(st=>{typeof st=="boolean"?this.setFocused(st):this.onFocus()}))}setFocused(et){Kt(this,xl)!==et&&(Rr(this,xl,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(rt=>{rt(et)})}isFocused(){var et;return typeof Kt(this,xl)=="boolean"?Kt(this,xl):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},xl=new WeakMap,Bo=new WeakMap,Yl=new WeakMap,Wp),focusManager=new FocusManager,Kl,zo,Ql,qp,OnlineManager=(qp=class extends Subscribable{constructor(){super();kr(this,Kl,!0);kr(this,zo);kr(this,Ql);Rr(this,Ql,et=>{if(!isServer&&window.addEventListener){const rt=()=>et(!0),st=()=>et(!1);return window.addEventListener("online",rt,!1),window.addEventListener("offline",st,!1),()=>{window.removeEventListener("online",rt),window.removeEventListener("offline",st)}}})}onSubscribe(){Kt(this,zo)||this.setEventListener(Kt(this,Ql))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,zo))==null||et.call(this),Rr(this,zo,void 0))}setEventListener(et){var rt;Rr(this,Ql,et),(rt=Kt(this,zo))==null||rt.call(this),Rr(this,zo,et(this.setOnline.bind(this)))}setOnline(et){Kt(this,Kl)!==et&&(Rr(this,Kl,et),this.listeners.forEach(st=>{st(et)}))}isOnline(){return Kt(this,Kl)}},Kl=new WeakMap,zo=new WeakMap,Ql=new WeakMap,qp),onlineManager=new OnlineManager;function pendingThenable(){let tt,et;const rt=new Promise((nt,ot)=>{tt=nt,et=ot});rt.status="pending",rt.catch(()=>{});function st(nt){Object.assign(rt,nt),delete rt.resolve,delete rt.reject}return rt.resolve=nt=>{st({status:"fulfilled",value:nt}),tt(nt)},rt.reject=nt=>{st({status:"rejected",reason:nt}),et(nt)},rt}function defaultRetryDelay(tt){return Math.min(1e3*2**tt,3e4)}function canFetch(tt){return(tt??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(tt){super("CancelledError"),this.revert=tt==null?void 0:tt.revert,this.silent=tt==null?void 0:tt.silent}};function isCancelledError(tt){return tt instanceof CancelledError}function createRetryer(tt){let et=!1,rt=0,st=!1,nt;const ot=pendingThenable(),at=vt=>{var Et;st||(ft(new CancelledError(vt)),(Et=tt.abort)==null||Et.call(tt))},lt=()=>{et=!0},ut=()=>{et=!1},ct=()=>focusManager.isFocused()&&(tt.networkMode==="always"||onlineManager.isOnline())&&tt.canRun(),dt=()=>canFetch(tt.networkMode)&&tt.canRun(),ht=vt=>{var Et;st||(st=!0,(Et=tt.onSuccess)==null||Et.call(tt,vt),nt==null||nt(),ot.resolve(vt))},ft=vt=>{var Et;st||(st=!0,(Et=tt.onError)==null||Et.call(tt,vt),nt==null||nt(),ot.reject(vt))},xt=()=>new Promise(vt=>{var Et;nt=bt=>{(st||ct())&&vt(bt)},(Et=tt.onPause)==null||Et.call(tt)}).then(()=>{var vt;nt=void 0,st||(vt=tt.onContinue)==null||vt.call(tt)}),yt=()=>{if(st)return;let vt;const Et=rt===0?tt.initialPromise:void 0;try{vt=Et??tt.fn()}catch(bt){vt=Promise.reject(bt)}Promise.resolve(vt).then(ht).catch(bt=>{var Pt;if(st)return;const wt=tt.retry??(isServer?0:3),St=tt.retryDelay??defaultRetryDelay,Rt=typeof St=="function"?St(rt,bt):St,Ct=wt===!0||typeof wt=="number"&&rt<wt||typeof wt=="function"&&wt(rt,bt);if(et||!Ct){ft(bt);return}rt++,(Pt=tt.onFail)==null||Pt.call(tt,rt,bt),sleep(Rt).then(()=>ct()?void 0:xt()).then(()=>{et?ft(bt):yt()})})};return{promise:ot,cancel:at,continue:()=>(nt==null||nt(),ot),cancelRetry:lt,continueRetry:ut,canStart:dt,start:()=>(dt()?yt():xt().then(yt),ot)}}function createNotifyManager(){let tt=[],et=0,rt=lt=>{lt()},st=lt=>{lt()},nt=lt=>setTimeout(lt,0);const ot=lt=>{et?tt.push(lt):nt(()=>{rt(lt)})},at=()=>{const lt=tt;tt=[],lt.length&&nt(()=>{st(()=>{lt.forEach(ut=>{rt(ut)})})})};return{batch:lt=>{let ut;et++;try{ut=lt()}finally{et--,et||at()}return ut},batchCalls:lt=>(...ut)=>{ot(()=>{lt(...ut)})},schedule:ot,setNotifyFunction:lt=>{rt=lt},setBatchNotifyFunction:lt=>{st=lt},setScheduler:lt=>{nt=lt}}}var notifyManager=createNotifyManager(),yl,Xp,Removable=(Xp=class{constructor(){kr(this,yl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&Rr(this,yl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(tt){this.gcTime=Math.max(this.gcTime||0,tt??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Kt(this,yl)&&(clearTimeout(Kt(this,yl)),Rr(this,yl,void 0))}},yl=new WeakMap,Xp),Zl,Jl,Un,Ps,Ou,El,Qn,Ro,Yp,Query=(Yp=class extends Removable{constructor(et){super();kr(this,Qn);kr(this,Zl);kr(this,Jl);kr(this,Un);kr(this,Ps);kr(this,Ou);kr(this,El);Rr(this,El,!1),Rr(this,Ou,et.defaultOptions),this.setOptions(et.options),this.observers=[],Rr(this,Un,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,Rr(this,Zl,getDefaultState$1(this.options)),this.state=et.state??Kt(this,Zl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Kt(this,Ps))==null?void 0:et.promise}setOptions(et){this.options={...Kt(this,Ou),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Kt(this,Un).remove(this)}setData(et,rt){const st=replaceData(this.state.data,et,this.options);return Nr(this,Qn,Ro).call(this,{data:st,type:"success",dataUpdatedAt:rt==null?void 0:rt.updatedAt,manual:rt==null?void 0:rt.manual}),st}setState(et,rt){Nr(this,Qn,Ro).call(this,{type:"setState",state:et,setStateOptions:rt})}cancel(et){var st,nt;const rt=(st=Kt(this,Ps))==null?void 0:st.promise;return(nt=Kt(this,Ps))==null||nt.cancel(et),rt?rt.then(noop$1).catch(noop$1):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Kt(this,Zl))}isActive(){return this.observers.some(et=>resolveEnabled(et.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(et=>et.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(et=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,et)}onFocus(){var rt;const et=this.observers.find(st=>st.shouldFetchOnWindowFocus());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,Ps))==null||rt.continue()}onOnline(){var rt;const et=this.observers.find(st=>st.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,Ps))==null||rt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Kt(this,Un).notify({type:"observerAdded",query:this,observer:et}))}removeObserver(et){this.observers.includes(et)&&(this.observers=this.observers.filter(rt=>rt!==et),this.observers.length||(Kt(this,Ps)&&(Kt(this,El)?Kt(this,Ps).cancel({revert:!0}):Kt(this,Ps).cancelRetry()),this.scheduleGc()),Kt(this,Un).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Nr(this,Qn,Ro).call(this,{type:"invalidate"})}fetch(et,rt){var ut,ct,dt;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(rt!=null&&rt.cancelRefetch))this.cancel({silent:!0});else if(Kt(this,Ps))return Kt(this,Ps).continueRetry(),Kt(this,Ps).promise}if(et&&this.setOptions(et),!this.options.queryFn){const ht=this.observers.find(ft=>ft.options.queryFn);ht&&this.setOptions(ht.options)}const st=new AbortController,nt=ht=>{Object.defineProperty(ht,"signal",{enumerable:!0,get:()=>(Rr(this,El,!0),st.signal)})},ot=()=>{const ht=ensureQueryFn(this.options,rt),ft={queryKey:this.queryKey,meta:this.meta};return nt(ft),Rr(this,El,!1),this.options.persister?this.options.persister(ht,ft,this):ht(ft)},at={fetchOptions:rt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};nt(at),(ut=this.options.behavior)==null||ut.onFetch(at,this),Rr(this,Jl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=at.fetchOptions)==null?void 0:ct.meta))&&Nr(this,Qn,Ro).call(this,{type:"fetch",meta:(dt=at.fetchOptions)==null?void 0:dt.meta});const lt=ht=>{var ft,xt,yt,vt;isCancelledError(ht)&&ht.silent||Nr(this,Qn,Ro).call(this,{type:"error",error:ht}),isCancelledError(ht)||((xt=(ft=Kt(this,Un).config).onError)==null||xt.call(ft,ht,this),(vt=(yt=Kt(this,Un).config).onSettled)==null||vt.call(yt,this.state.data,ht,this)),this.scheduleGc()};return Rr(this,Ps,createRetryer({initialPromise:rt==null?void 0:rt.initialPromise,fn:at.fetchFn,abort:st.abort.bind(st),onSuccess:ht=>{var ft,xt,yt,vt;if(ht===void 0){lt(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(ht)}catch(Et){lt(Et);return}(xt=(ft=Kt(this,Un).config).onSuccess)==null||xt.call(ft,ht,this),(vt=(yt=Kt(this,Un).config).onSettled)==null||vt.call(yt,ht,this.state.error,this),this.scheduleGc()},onError:lt,onFail:(ht,ft)=>{Nr(this,Qn,Ro).call(this,{type:"failed",failureCount:ht,error:ft})},onPause:()=>{Nr(this,Qn,Ro).call(this,{type:"pause"})},onContinue:()=>{Nr(this,Qn,Ro).call(this,{type:"continue"})},retry:at.options.retry,retryDelay:at.options.retryDelay,networkMode:at.options.networkMode,canRun:()=>!0})),Kt(this,Ps).start()}},Zl=new WeakMap,Jl=new WeakMap,Un=new WeakMap,Ps=new WeakMap,Ou=new WeakMap,El=new WeakMap,Qn=new WeakSet,Ro=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,fetchFailureCount:et.failureCount,fetchFailureReason:et.error};case"pause":return{...st,fetchStatus:"paused"};case"continue":return{...st,fetchStatus:"fetching"};case"fetch":return{...st,...fetchState(st.data,this.options),fetchMeta:et.meta??null};case"success":return{...st,data:et.data,dataUpdateCount:st.dataUpdateCount+1,dataUpdatedAt:et.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!et.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const nt=et.error;return isCancelledError(nt)&&nt.revert&&Kt(this,Jl)?{...Kt(this,Jl),fetchStatus:"idle"}:{...st,error:nt,errorUpdateCount:st.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:st.fetchFailureCount+1,fetchFailureReason:nt,fetchStatus:"idle",status:"error"};case"invalidate":return{...st,isInvalidated:!0};case"setState":return{...st,...et.state}}};this.state=rt(this.state),notifyManager.batch(()=>{this.observers.forEach(st=>{st.onQueryUpdate()}),Kt(this,Un).notify({query:this,type:"updated",action:et})})},Yp);function fetchState(tt,et){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(et.networkMode)?"fetching":"paused",...tt===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(tt){const et=typeof tt.initialData=="function"?tt.initialData():tt.initialData,rt=et!==void 0,st=rt?typeof tt.initialDataUpdatedAt=="function"?tt.initialDataUpdatedAt():tt.initialDataUpdatedAt:0;return{data:et,dataUpdateCount:0,dataUpdatedAt:rt?st??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:rt?"success":"pending",fetchStatus:"idle"}}var po,Kp,QueryCache=(Kp=class extends Subscribable{constructor(et={}){super();kr(this,po);this.config=et,Rr(this,po,new Map)}build(et,rt,st){const nt=rt.queryKey,ot=rt.queryHash??hashQueryKeyByOptions(nt,rt);let at=this.get(ot);return at||(at=new Query({cache:this,queryKey:nt,queryHash:ot,options:et.defaultQueryOptions(rt),state:st,defaultOptions:et.getQueryDefaults(nt)}),this.add(at)),at}add(et){Kt(this,po).has(et.queryHash)||(Kt(this,po).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const rt=Kt(this,po).get(et.queryHash);rt&&(et.destroy(),rt===et&&Kt(this,po).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Kt(this,po).get(et)}getAll(){return[...Kt(this,po).values()]}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchQuery(rt,st))}findAll(et={}){const rt=this.getAll();return Object.keys(et).length>0?rt.filter(st=>matchQuery(et,st)):rt}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onOnline()})})}},po=new WeakMap,Kp),mo,$s,wl,go,Fo,Qp,Mutation=(Qp=class extends Removable{constructor(et){super();kr(this,go);kr(this,mo);kr(this,$s);kr(this,wl);this.mutationId=et.mutationId,Rr(this,$s,et.mutationCache),Rr(this,mo,[]),this.state=et.state||getDefaultState(),this.setOptions(et.options),this.scheduleGc()}setOptions(et){this.options=et,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(et){Kt(this,mo).includes(et)||(Kt(this,mo).push(et),this.clearGcTimeout(),Kt(this,$s).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){Rr(this,mo,Kt(this,mo).filter(rt=>rt!==et)),this.scheduleGc(),Kt(this,$s).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Kt(this,mo).length||(this.state.status==="pending"?this.scheduleGc():Kt(this,$s).remove(this))}continue(){var et;return((et=Kt(this,wl))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var nt,ot,at,lt,ut,ct,dt,ht,ft,xt,yt,vt,Et,bt,wt,St,Rt,Ct,Pt,It;Rr(this,wl,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(jt,Dt)=>{Nr(this,go,Fo).call(this,{type:"failed",failureCount:jt,error:Dt})},onPause:()=>{Nr(this,go,Fo).call(this,{type:"pause"})},onContinue:()=>{Nr(this,go,Fo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Kt(this,$s).canRun(this)}));const rt=this.state.status==="pending",st=!Kt(this,wl).canStart();try{if(!rt){Nr(this,go,Fo).call(this,{type:"pending",variables:et,isPaused:st}),await((ot=(nt=Kt(this,$s).config).onMutate)==null?void 0:ot.call(nt,et,this));const Dt=await((lt=(at=this.options).onMutate)==null?void 0:lt.call(at,et));Dt!==this.state.context&&Nr(this,go,Fo).call(this,{type:"pending",context:Dt,variables:et,isPaused:st})}const jt=await Kt(this,wl).start();return await((ct=(ut=Kt(this,$s).config).onSuccess)==null?void 0:ct.call(ut,jt,et,this.state.context,this)),await((ht=(dt=this.options).onSuccess)==null?void 0:ht.call(dt,jt,et,this.state.context)),await((xt=(ft=Kt(this,$s).config).onSettled)==null?void 0:xt.call(ft,jt,null,this.state.variables,this.state.context,this)),await((vt=(yt=this.options).onSettled)==null?void 0:vt.call(yt,jt,null,et,this.state.context)),Nr(this,go,Fo).call(this,{type:"success",data:jt}),jt}catch(jt){try{throw await((bt=(Et=Kt(this,$s).config).onError)==null?void 0:bt.call(Et,jt,et,this.state.context,this)),await((St=(wt=this.options).onError)==null?void 0:St.call(wt,jt,et,this.state.context)),await((Ct=(Rt=Kt(this,$s).config).onSettled)==null?void 0:Ct.call(Rt,void 0,jt,this.state.variables,this.state.context,this)),await((It=(Pt=this.options).onSettled)==null?void 0:It.call(Pt,void 0,jt,et,this.state.context)),jt}finally{Nr(this,go,Fo).call(this,{type:"error",error:jt})}}finally{Kt(this,$s).runNext(this)}}},mo=new WeakMap,$s=new WeakMap,wl=new WeakMap,go=new WeakSet,Fo=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,failureCount:et.failureCount,failureReason:et.error};case"pause":return{...st,isPaused:!0};case"continue":return{...st,isPaused:!1};case"pending":return{...st,context:et.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:et.isPaused,status:"pending",variables:et.variables,submittedAt:Date.now()};case"success":return{...st,data:et.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...st,data:void 0,error:et.error,failureCount:st.failureCount+1,failureReason:et.error,isPaused:!1,status:"error"}}};this.state=rt(this.state),notifyManager.batch(()=>{Kt(this,mo).forEach(st=>{st.onMutationUpdate(et)}),Kt(this,$s).notify({mutation:this,type:"updated",action:et})})},Qp);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Xs,Du,Zp,MutationCache=(Zp=class extends Subscribable{constructor(et={}){super();kr(this,Xs);kr(this,Du);this.config=et,Rr(this,Xs,new Map),Rr(this,Du,Date.now())}build(et,rt,st){const nt=new Mutation({mutationCache:this,mutationId:++R1(this,Du)._,options:et.defaultMutationOptions(rt),state:st});return this.add(nt),nt}add(et){const rt=scopeFor(et),st=Kt(this,Xs).get(rt)??[];st.push(et),Kt(this,Xs).set(rt,st),this.notify({type:"added",mutation:et})}remove(et){var st;const rt=scopeFor(et);if(Kt(this,Xs).has(rt)){const nt=(st=Kt(this,Xs).get(rt))==null?void 0:st.filter(ot=>ot!==et);nt&&(nt.length===0?Kt(this,Xs).delete(rt):Kt(this,Xs).set(rt,nt))}this.notify({type:"removed",mutation:et})}canRun(et){var st;const rt=(st=Kt(this,Xs).get(scopeFor(et)))==null?void 0:st.find(nt=>nt.state.status==="pending");return!rt||rt===et}runNext(et){var st;const rt=(st=Kt(this,Xs).get(scopeFor(et)))==null?void 0:st.find(nt=>nt!==et&&nt.state.isPaused);return(rt==null?void 0:rt.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}getAll(){return[...Kt(this,Xs).values()].flat()}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchMutation(rt,st))}findAll(et={}){return this.getAll().filter(rt=>matchMutation(et,rt))}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}resumePausedMutations(){const et=this.getAll().filter(rt=>rt.state.isPaused);return notifyManager.batch(()=>Promise.all(et.map(rt=>rt.continue().catch(noop$1))))}},Xs=new WeakMap,Du=new WeakMap,Zp);function scopeFor(tt){var et;return((et=tt.options.scope)==null?void 0:et.id)??String(tt.mutationId)}function infiniteQueryBehavior(tt){return{onFetch:(et,rt)=>{var dt,ht,ft,xt,yt;const st=et.options,nt=(ft=(ht=(dt=et.fetchOptions)==null?void 0:dt.meta)==null?void 0:ht.fetchMore)==null?void 0:ft.direction,ot=((xt=et.state.data)==null?void 0:xt.pages)||[],at=((yt=et.state.data)==null?void 0:yt.pageParams)||[];let lt={pages:[],pageParams:[]},ut=0;const ct=async()=>{let vt=!1;const Et=St=>{Object.defineProperty(St,"signal",{enumerable:!0,get:()=>(et.signal.aborted?vt=!0:et.signal.addEventListener("abort",()=>{vt=!0}),et.signal)})},bt=ensureQueryFn(et.options,et.fetchOptions),wt=async(St,Rt,Ct)=>{if(vt)return Promise.reject();if(Rt==null&&St.pages.length)return Promise.resolve(St);const Pt={queryKey:et.queryKey,pageParam:Rt,direction:Ct?"backward":"forward",meta:et.options.meta};Et(Pt);const It=await bt(Pt),{maxPages:jt}=et.options,Dt=Ct?addToStart:addToEnd;return{pages:Dt(St.pages,It,jt),pageParams:Dt(St.pageParams,Rt,jt)}};if(nt&&ot.length){const St=nt==="backward",Rt=St?getPreviousPageParam:getNextPageParam,Ct={pages:ot,pageParams:at},Pt=Rt(st,Ct);lt=await wt(Ct,Pt,St)}else{const St=tt??ot.length;do{const Rt=ut===0?at[0]??st.initialPageParam:getNextPageParam(st,lt);if(ut>0&&Rt==null)break;lt=await wt(lt,Rt),ut++}while(ut<St)}return lt};et.options.persister?et.fetchFn=()=>{var vt,Et;return(Et=(vt=et.options).persister)==null?void 0:Et.call(vt,ct,{queryKey:et.queryKey,meta:et.options.meta,signal:et.signal},rt)}:et.fetchFn=ct}}}function getNextPageParam(tt,{pages:et,pageParams:rt}){const st=et.length-1;return et.length>0?tt.getNextPageParam(et[st],et,rt[st],rt):void 0}function getPreviousPageParam(tt,{pages:et,pageParams:rt}){var st;return et.length>0?(st=tt.getPreviousPageParam)==null?void 0:st.call(tt,et[0],et,rt[0],rt):void 0}function hasNextPage(tt,et){return et?getNextPageParam(tt,et)!=null:!1}function hasPreviousPage(tt,et){return!et||!tt.getPreviousPageParam?!1:getPreviousPageParam(tt,et)!=null}var ls,Uo,Ho,eu,tu,Vo,ru,su,Jp,QueryClient=(Jp=class{constructor(tt={}){kr(this,ls);kr(this,Uo);kr(this,Ho);kr(this,eu);kr(this,tu);kr(this,Vo);kr(this,ru);kr(this,su);Rr(this,ls,tt.queryCache||new QueryCache),Rr(this,Uo,tt.mutationCache||new MutationCache),Rr(this,Ho,tt.defaultOptions||{}),Rr(this,eu,new Map),Rr(this,tu,new Map),Rr(this,Vo,0)}mount(){R1(this,Vo)._++,Kt(this,Vo)===1&&(Rr(this,ru,focusManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,ls).onFocus())})),Rr(this,su,onlineManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,ls).onOnline())})))}unmount(){var tt,et;R1(this,Vo)._--,Kt(this,Vo)===0&&((tt=Kt(this,ru))==null||tt.call(this),Rr(this,ru,void 0),(et=Kt(this,su))==null||et.call(this),Rr(this,su,void 0))}isFetching(tt){return Kt(this,ls).findAll({...tt,fetchStatus:"fetching"}).length}isMutating(tt){return Kt(this,Uo).findAll({...tt,status:"pending"}).length}getQueryData(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,ls).get(et.queryHash))==null?void 0:rt.state.data}ensureQueryData(tt){const et=this.defaultQueryOptions(tt),rt=Kt(this,ls).build(this,et),st=rt.state.data;return st===void 0?this.fetchQuery(tt):(tt.revalidateIfStale&&rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))&&this.prefetchQuery(et),Promise.resolve(st))}getQueriesData(tt){return Kt(this,ls).findAll(tt).map(({queryKey:et,state:rt})=>{const st=rt.data;return[et,st]})}setQueryData(tt,et,rt){const st=this.defaultQueryOptions({queryKey:tt}),nt=Kt(this,ls).get(st.queryHash),ot=nt==null?void 0:nt.state.data,at=functionalUpdate(et,ot);if(at!==void 0)return Kt(this,ls).build(this,st).setData(at,{...rt,manual:!0})}setQueriesData(tt,et,rt){return notifyManager.batch(()=>Kt(this,ls).findAll(tt).map(({queryKey:st})=>[st,this.setQueryData(st,et,rt)]))}getQueryState(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,ls).get(et.queryHash))==null?void 0:rt.state}removeQueries(tt){const et=Kt(this,ls);notifyManager.batch(()=>{et.findAll(tt).forEach(rt=>{et.remove(rt)})})}resetQueries(tt,et){const rt=Kt(this,ls),st={type:"active",...tt};return notifyManager.batch(()=>(rt.findAll(tt).forEach(nt=>{nt.reset()}),this.refetchQueries(st,et)))}cancelQueries(tt,et={}){const rt={revert:!0,...et},st=notifyManager.batch(()=>Kt(this,ls).findAll(tt).map(nt=>nt.cancel(rt)));return Promise.all(st).then(noop$1).catch(noop$1)}invalidateQueries(tt,et={}){return notifyManager.batch(()=>{if(Kt(this,ls).findAll(tt).forEach(st=>{st.invalidate()}),(tt==null?void 0:tt.refetchType)==="none")return Promise.resolve();const rt={...tt,type:(tt==null?void 0:tt.refetchType)??(tt==null?void 0:tt.type)??"active"};return this.refetchQueries(rt,et)})}refetchQueries(tt,et={}){const rt={...et,cancelRefetch:et.cancelRefetch??!0},st=notifyManager.batch(()=>Kt(this,ls).findAll(tt).filter(nt=>!nt.isDisabled()).map(nt=>{let ot=nt.fetch(void 0,rt);return rt.throwOnError||(ot=ot.catch(noop$1)),nt.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(st).then(noop$1)}fetchQuery(tt){const et=this.defaultQueryOptions(tt);et.retry===void 0&&(et.retry=!1);const rt=Kt(this,ls).build(this,et);return rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))?rt.fetch(et):Promise.resolve(rt.state.data)}prefetchQuery(tt){return this.fetchQuery(tt).then(noop$1).catch(noop$1)}fetchInfiniteQuery(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.fetchQuery(tt)}prefetchInfiniteQuery(tt){return this.fetchInfiniteQuery(tt).then(noop$1).catch(noop$1)}ensureInfiniteQueryData(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.ensureQueryData(tt)}resumePausedMutations(){return onlineManager.isOnline()?Kt(this,Uo).resumePausedMutations():Promise.resolve()}getQueryCache(){return Kt(this,ls)}getMutationCache(){return Kt(this,Uo)}getDefaultOptions(){return Kt(this,Ho)}setDefaultOptions(tt){Rr(this,Ho,tt)}setQueryDefaults(tt,et){Kt(this,eu).set(hashKey(tt),{queryKey:tt,defaultOptions:et})}getQueryDefaults(tt){const et=[...Kt(this,eu).values()],rt={};return et.forEach(st=>{partialMatchKey(tt,st.queryKey)&&Object.assign(rt,st.defaultOptions)}),rt}setMutationDefaults(tt,et){Kt(this,tu).set(hashKey(tt),{mutationKey:tt,defaultOptions:et})}getMutationDefaults(tt){const et=[...Kt(this,tu).values()];let rt={};return et.forEach(st=>{partialMatchKey(tt,st.mutationKey)&&(rt={...rt,...st.defaultOptions})}),rt}defaultQueryOptions(tt){if(tt._defaulted)return tt;const et={...Kt(this,Ho).queries,...this.getQueryDefaults(tt.queryKey),...tt,_defaulted:!0};return et.queryHash||(et.queryHash=hashQueryKeyByOptions(et.queryKey,et)),et.refetchOnReconnect===void 0&&(et.refetchOnReconnect=et.networkMode!=="always"),et.throwOnError===void 0&&(et.throwOnError=!!et.suspense),!et.networkMode&&et.persister&&(et.networkMode="offlineFirst"),et.queryFn===skipToken&&(et.enabled=!1),et}defaultMutationOptions(tt){return tt!=null&&tt._defaulted?tt:{...Kt(this,Ho).mutations,...(tt==null?void 0:tt.mutationKey)&&this.getMutationDefaults(tt.mutationKey),...tt,_defaulted:!0}}clear(){Kt(this,ls).clear(),Kt(this,Uo).clear()}},ls=new WeakMap,Uo=new WeakMap,Ho=new WeakMap,eu=new WeakMap,tu=new WeakMap,Vo=new WeakMap,ru=new WeakMap,su=new WeakMap,Jp),Bs,Vr,ku,Os,Sl,nu,Go,xo,Lu,iu,ou,_l,Rl,Wo,au,Kr,$u,e2,t2,r2,s2,n2,i2,o2,um,em,QueryObserver=(em=class extends Subscribable{constructor(et,rt){super();kr(this,Kr);kr(this,Bs);kr(this,Vr);kr(this,ku);kr(this,Os);kr(this,Sl);kr(this,nu);kr(this,Go);kr(this,xo);kr(this,Lu);kr(this,iu);kr(this,ou);kr(this,_l);kr(this,Rl);kr(this,Wo);kr(this,au,new Set);this.options=rt,Rr(this,Bs,et),Rr(this,xo,null),Rr(this,Go,pendingThenable()),this.options.experimental_prefetchInRender||Kt(this,Go).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(rt)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Kt(this,Vr).addObserver(this),shouldFetchOnMount(Kt(this,Vr),this.options)?Nr(this,Kr,$u).call(this):this.updateResult(),Nr(this,Kr,s2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Kt(this,Vr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Kt(this,Vr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Nr(this,Kr,n2).call(this),Nr(this,Kr,i2).call(this),Kt(this,Vr).removeObserver(this)}setOptions(et,rt){const st=this.options,nt=Kt(this,Vr);if(this.options=Kt(this,Bs).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Kt(this,Vr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Nr(this,Kr,o2).call(this),Kt(this,Vr).setOptions(this.options),st._defaulted&&!shallowEqualObjects(this.options,st)&&Kt(this,Bs).getQueryCache().notify({type:"observerOptionsUpdated",query:Kt(this,Vr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Kt(this,Vr),nt,this.options,st)&&Nr(this,Kr,$u).call(this),this.updateResult(rt),ot&&(Kt(this,Vr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Vr))!==resolveEnabled(st.enabled,Kt(this,Vr))||resolveStaleTime(this.options.staleTime,Kt(this,Vr))!==resolveStaleTime(st.staleTime,Kt(this,Vr)))&&Nr(this,Kr,e2).call(this);const at=Nr(this,Kr,t2).call(this);ot&&(Kt(this,Vr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Vr))!==resolveEnabled(st.enabled,Kt(this,Vr))||at!==Kt(this,Wo))&&Nr(this,Kr,r2).call(this,at)}getOptimisticResult(et){const rt=Kt(this,Bs).getQueryCache().build(Kt(this,Bs),et),st=this.createResult(rt,et);return shouldAssignObserverCurrentProperties(this,st)&&(Rr(this,Os,st),Rr(this,nu,this.options),Rr(this,Sl,Kt(this,Vr).state)),st}getCurrentResult(){return Kt(this,Os)}trackResult(et,rt){const st={};return Object.keys(et).forEach(nt=>{Object.defineProperty(st,nt,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(nt),rt==null||rt(nt),et[nt])})}),st}trackProp(et){Kt(this,au).add(et)}getCurrentQuery(){return Kt(this,Vr)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const rt=Kt(this,Bs).defaultQueryOptions(et),st=Kt(this,Bs).getQueryCache().build(Kt(this,Bs),rt);return st.fetch().then(()=>this.createResult(st,rt))}fetch(et){return Nr(this,Kr,$u).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Kt(this,Os)))}createResult(et,rt){var jt;const st=Kt(this,Vr),nt=this.options,ot=Kt(this,Os),at=Kt(this,Sl),lt=Kt(this,nu),ct=et!==st?et.state:Kt(this,ku),{state:dt}=et;let ht={...dt},ft=!1,xt;if(rt._optimisticResults){const Dt=this.hasListeners(),Ht=!Dt&&shouldFetchOnMount(et,rt),Nt=Dt&&shouldFetchOptionally(et,st,rt,nt);(Ht||Nt)&&(ht={...ht,...fetchState(dt.data,et.options)}),rt._optimisticResults==="isRestoring"&&(ht.fetchStatus="idle")}let{error:yt,errorUpdatedAt:vt,status:Et}=ht;if(rt.select&&ht.data!==void 0)if(ot&&ht.data===(at==null?void 0:at.data)&&rt.select===Kt(this,Lu))xt=Kt(this,iu);else try{Rr(this,Lu,rt.select),xt=rt.select(ht.data),xt=replaceData(ot==null?void 0:ot.data,xt,rt),Rr(this,iu,xt),Rr(this,xo,null)}catch(Dt){Rr(this,xo,Dt)}else xt=ht.data;if(rt.placeholderData!==void 0&&xt===void 0&&Et==="pending"){let Dt;if(ot!=null&&ot.isPlaceholderData&&rt.placeholderData===(lt==null?void 0:lt.placeholderData))Dt=ot.data;else if(Dt=typeof rt.placeholderData=="function"?rt.placeholderData((jt=Kt(this,ou))==null?void 0:jt.state.data,Kt(this,ou)):rt.placeholderData,rt.select&&Dt!==void 0)try{Dt=rt.select(Dt),Rr(this,xo,null)}catch(Ht){Rr(this,xo,Ht)}Dt!==void 0&&(Et="success",xt=replaceData(ot==null?void 0:ot.data,Dt,rt),ft=!0)}Kt(this,xo)&&(yt=Kt(this,xo),xt=Kt(this,iu),vt=Date.now(),Et="error");const bt=ht.fetchStatus==="fetching",wt=Et==="pending",St=Et==="error",Rt=wt&&bt,Ct=xt!==void 0,It={status:Et,fetchStatus:ht.fetchStatus,isPending:wt,isSuccess:Et==="success",isError:St,isInitialLoading:Rt,isLoading:Rt,data:xt,dataUpdatedAt:ht.dataUpdatedAt,error:yt,errorUpdatedAt:vt,failureCount:ht.fetchFailureCount,failureReason:ht.fetchFailureReason,errorUpdateCount:ht.errorUpdateCount,isFetched:ht.dataUpdateCount>0||ht.errorUpdateCount>0,isFetchedAfterMount:ht.dataUpdateCount>ct.dataUpdateCount||ht.errorUpdateCount>ct.errorUpdateCount,isFetching:bt,isRefetching:bt&&!wt,isLoadingError:St&&!Ct,isPaused:ht.fetchStatus==="paused",isPlaceholderData:ft,isRefetchError:St&&Ct,isStale:isStale(et,rt),refetch:this.refetch,promise:Kt(this,Go)};if(this.options.experimental_prefetchInRender){const Dt=Ut=>{It.status==="error"?Ut.reject(It.error):It.data!==void 0&&Ut.resolve(It.data)},Ht=()=>{const Ut=Rr(this,Go,It.promise=pendingThenable());Dt(Ut)},Nt=Kt(this,Go);switch(Nt.status){case"pending":et.queryHash===st.queryHash&&Dt(Nt);break;case"fulfilled":(It.status==="error"||It.data!==Nt.value)&&Ht();break;case"rejected":(It.status!=="error"||It.error!==Nt.reason)&&Ht();break}}return It}updateResult(et){const rt=Kt(this,Os),st=this.createResult(Kt(this,Vr),this.options);if(Rr(this,Sl,Kt(this,Vr).state),Rr(this,nu,this.options),Kt(this,Sl).data!==void 0&&Rr(this,ou,Kt(this,Vr)),shallowEqualObjects(st,rt))return;Rr(this,Os,st);const nt={},ot=()=>{if(!rt)return!0;const{notifyOnChangeProps:at}=this.options,lt=typeof at=="function"?at():at;if(lt==="all"||!lt&&!Kt(this,au).size)return!0;const ut=new Set(lt??Kt(this,au));return this.options.throwOnError&&ut.add("error"),Object.keys(Kt(this,Os)).some(ct=>{const dt=ct;return Kt(this,Os)[dt]!==rt[dt]&&ut.has(dt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(nt.listeners=!0),Nr(this,Kr,um).call(this,{...nt,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Nr(this,Kr,s2).call(this)}},Bs=new WeakMap,Vr=new WeakMap,ku=new WeakMap,Os=new WeakMap,Sl=new WeakMap,nu=new WeakMap,Go=new WeakMap,xo=new WeakMap,Lu=new WeakMap,iu=new WeakMap,ou=new WeakMap,_l=new WeakMap,Rl=new WeakMap,Wo=new WeakMap,au=new WeakMap,Kr=new WeakSet,$u=function(et){Nr(this,Kr,o2).call(this);let rt=Kt(this,Vr).fetch(this.options,et);return et!=null&&et.throwOnError||(rt=rt.catch(noop$1)),rt},e2=function(){Nr(this,Kr,n2).call(this);const et=resolveStaleTime(this.options.staleTime,Kt(this,Vr));if(isServer||Kt(this,Os).isStale||!isValidTimeout(et))return;const st=timeUntilStale(Kt(this,Os).dataUpdatedAt,et)+1;Rr(this,_l,setTimeout(()=>{Kt(this,Os).isStale||this.updateResult()},st))},t2=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Kt(this,Vr)):this.options.refetchInterval)??!1},r2=function(et){Nr(this,Kr,i2).call(this),Rr(this,Wo,et),!(isServer||resolveEnabled(this.options.enabled,Kt(this,Vr))===!1||!isValidTimeout(Kt(this,Wo))||Kt(this,Wo)===0)&&Rr(this,Rl,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&Nr(this,Kr,$u).call(this)},Kt(this,Wo)))},s2=function(){Nr(this,Kr,e2).call(this),Nr(this,Kr,r2).call(this,Nr(this,Kr,t2).call(this))},n2=function(){Kt(this,_l)&&(clearTimeout(Kt(this,_l)),Rr(this,_l,void 0))},i2=function(){Kt(this,Rl)&&(clearInterval(Kt(this,Rl)),Rr(this,Rl,void 0))},o2=function(){const et=Kt(this,Bs).getQueryCache().build(Kt(this,Bs),this.options);if(et===Kt(this,Vr))return;const rt=Kt(this,Vr);Rr(this,Vr,et),Rr(this,ku,et.state),this.hasListeners()&&(rt==null||rt.removeObserver(this),et.addObserver(this))},um=function(et){notifyManager.batch(()=>{et.listeners&&this.listeners.forEach(rt=>{rt(Kt(this,Os))}),Kt(this,Bs).getQueryCache().notify({query:Kt(this,Vr),type:"observerResultsUpdated"})})},em);function shouldLoadOnMount(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.state.data===void 0&&!(tt.state.status==="error"&&et.retryOnMount===!1)}function shouldFetchOnMount(tt,et){return shouldLoadOnMount(tt,et)||tt.state.data!==void 0&&shouldFetchOn(tt,et,et.refetchOnMount)}function shouldFetchOn(tt,et,rt){if(resolveEnabled(et.enabled,tt)!==!1){const st=typeof rt=="function"?rt(tt):rt;return st==="always"||st!==!1&&isStale(tt,et)}return!1}function shouldFetchOptionally(tt,et,rt,st){return(tt!==et||resolveEnabled(st.enabled,tt)===!1)&&(!rt.suspense||tt.state.status!=="error")&&isStale(tt,rt)}function isStale(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.isStaleByTime(resolveStaleTime(et.staleTime,tt))}function shouldAssignObserverCurrentProperties(tt,et){return!shallowEqualObjects(tt.getCurrentResult(),et)}var InfiniteQueryObserver=class extends QueryObserver{constructor(tt,et){super(tt,et)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(tt,et){super.setOptions({...tt,behavior:infiniteQueryBehavior()},et)}getOptimisticResult(tt){return tt.behavior=infiniteQueryBehavior(),super.getOptimisticResult(tt)}fetchNextPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"backward"}}})}createResult(tt,et){var yt,vt;const{state:rt}=tt,st=super.createResult(tt,et),{isFetching:nt,isRefetching:ot,isError:at,isRefetchError:lt}=st,ut=(vt=(yt=rt.fetchMeta)==null?void 0:yt.fetchMore)==null?void 0:vt.direction,ct=at&&ut==="forward",dt=nt&&ut==="forward",ht=at&&ut==="backward",ft=nt&&ut==="backward";return{...st,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hasNextPage(et,rt.data),hasPreviousPage:hasPreviousPage(et,rt.data),isFetchNextPageError:ct,isFetchingNextPage:dt,isFetchPreviousPageError:ht,isFetchingPreviousPage:ft,isRefetchError:lt&&!ct&&!ht,isRefetching:ot&&!dt&&!ft}}},qo,Xo,zs,To,Co,j1,a2,tm,MutationObserver$1=(tm=class extends Subscribable{constructor(rt,st){super();kr(this,Co);kr(this,qo);kr(this,Xo);kr(this,zs);kr(this,To);Rr(this,qo,rt),this.setOptions(st),this.bindMethods(),Nr(this,Co,j1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(rt){var nt;const st=this.options;this.options=Kt(this,qo).defaultMutationOptions(rt),shallowEqualObjects(this.options,st)||Kt(this,qo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Kt(this,zs),observer:this}),st!=null&&st.mutationKey&&this.options.mutationKey&&hashKey(st.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((nt=Kt(this,zs))==null?void 0:nt.state.status)==="pending"&&Kt(this,zs).setOptions(this.options)}onUnsubscribe(){var rt;this.hasListeners()||(rt=Kt(this,zs))==null||rt.removeObserver(this)}onMutationUpdate(rt){Nr(this,Co,j1).call(this),Nr(this,Co,a2).call(this,rt)}getCurrentResult(){return Kt(this,Xo)}reset(){var rt;(rt=Kt(this,zs))==null||rt.removeObserver(this),Rr(this,zs,void 0),Nr(this,Co,j1).call(this),Nr(this,Co,a2).call(this)}mutate(rt,st){var nt;return Rr(this,To,st),(nt=Kt(this,zs))==null||nt.removeObserver(this),Rr(this,zs,Kt(this,qo).getMutationCache().build(Kt(this,qo),this.options)),Kt(this,zs).addObserver(this),Kt(this,zs).execute(rt)}},qo=new WeakMap,Xo=new WeakMap,zs=new WeakMap,To=new WeakMap,Co=new WeakSet,j1=function(){var st;const rt=((st=Kt(this,zs))==null?void 0:st.state)??getDefaultState();Rr(this,Xo,{...rt,isPending:rt.status==="pending",isSuccess:rt.status==="success",isError:rt.status==="error",isIdle:rt.status==="idle",mutate:this.mutate,reset:this.reset})},a2=function(rt){notifyManager.batch(()=>{var st,nt,ot,at,lt,ut,ct,dt;if(Kt(this,To)&&this.hasListeners()){const ht=Kt(this,Xo).variables,ft=Kt(this,Xo).context;(rt==null?void 0:rt.type)==="success"?((nt=(st=Kt(this,To)).onSuccess)==null||nt.call(st,rt.data,ht,ft),(at=(ot=Kt(this,To)).onSettled)==null||at.call(ot,rt.data,null,ht,ft)):(rt==null?void 0:rt.type)==="error"&&((ut=(lt=Kt(this,To)).onError)==null||ut.call(lt,rt.error,ht,ft),(dt=(ct=Kt(this,To)).onSettled)==null||dt.call(ct,void 0,rt.error,ht,ft))}this.listeners.forEach(ht=>{ht(Kt(this,Xo))})})},tm),QueryClientContext=reactExports.createContext(void 0),useQueryClient=tt=>{const et=reactExports.useContext(QueryClientContext);if(!et)throw new Error("No QueryClient set, use QueryClientProvider to set one");return et},QueryClientProvider=({client:tt,children:et})=>(reactExports.useEffect(()=>(tt.mount(),()=>{tt.unmount()}),[tt]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:tt,children:et})),IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let tt=!1;return{clearReset:()=>{tt=!1},reset:()=>{tt=!0},isReset:()=>tt}}var QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(tt,et){return typeof tt=="function"?tt(...et):!!tt}function noop(){}var ensurePreventErrorBoundaryRetry=(tt,et)=>{(tt.suspense||tt.throwOnError||tt.experimental_prefetchInRender)&&(et.isReset()||(tt.retryOnMount=!1))},useClearResetErrorBoundary=tt=>{reactExports.useEffect(()=>{tt.clearReset()},[tt])},getHasError=({result:tt,errorResetBoundary:et,throwOnError:rt,query:st})=>tt.isError&&!et.isReset()&&!tt.isFetching&&st&&shouldThrowError(rt,[tt.error,st]),ensureSuspenseTimers=tt=>{tt.suspense&&(tt.staleTime===void 0&&(tt.staleTime=1e3),typeof tt.gcTime=="number"&&(tt.gcTime=Math.max(tt.gcTime,1e3)))},willFetch=(tt,et)=>tt.isLoading&&tt.isFetching&&!et,shouldSuspend=(tt,et)=>(tt==null?void 0:tt.suspense)&&et.isPending,fetchOptimistic=(tt,et,rt)=>et.fetchOptimistic(tt).catch(()=>{rt.clearReset()});function useBaseQuery(tt,et,rt){var dt,ht,ft,xt,yt;const st=useQueryClient(),nt=useIsRestoring(),ot=useQueryErrorResetBoundary(),at=st.defaultQueryOptions(tt);(ht=(dt=st.getDefaultOptions().queries)==null?void 0:dt._experimental_beforeQuery)==null||ht.call(dt,at),at._optimisticResults=nt?"isRestoring":"optimistic",ensureSuspenseTimers(at),ensurePreventErrorBoundaryRetry(at,ot),useClearResetErrorBoundary(ot);const lt=!st.getQueryCache().get(at.queryHash),[ut]=reactExports.useState(()=>new et(st,at)),ct=ut.getOptimisticResult(at);if(reactExports.useSyncExternalStore(reactExports.useCallback(vt=>{const Et=nt?noop:ut.subscribe(notifyManager.batchCalls(vt));return ut.updateResult(),Et},[ut,nt]),()=>ut.getCurrentResult(),()=>ut.getCurrentResult()),reactExports.useEffect(()=>{ut.setOptions(at,{listeners:!1})},[at,ut]),shouldSuspend(at,ct))throw fetchOptimistic(at,ut,ot);if(getHasError({result:ct,errorResetBoundary:ot,throwOnError:at.throwOnError,query:st.getQueryCache().get(at.queryHash)}))throw ct.error;if((xt=(ft=st.getDefaultOptions().queries)==null?void 0:ft._experimental_afterQuery)==null||xt.call(ft,at,ct),at.experimental_prefetchInRender&&!isServer&&willFetch(ct,nt)){const vt=lt?fetchOptimistic(at,ut,ot):(yt=st.getQueryCache().get(at.queryHash))==null?void 0:yt.promise;vt==null||vt.catch(noop).finally(()=>{ut.updateResult()})}return at.notifyOnChangeProps?ct:ut.trackResult(ct)}function useQuery(tt,et){return useBaseQuery(tt,QueryObserver)}function queryOptions(tt){return tt}function useMutation(tt,et){const rt=useQueryClient(),[st]=reactExports.useState(()=>new MutationObserver$1(rt,tt));reactExports.useEffect(()=>{st.setOptions(tt)},[st,tt]);const nt=reactExports.useSyncExternalStore(reactExports.useCallback(at=>st.subscribe(notifyManager.batchCalls(at)),[st]),()=>st.getCurrentResult(),()=>st.getCurrentResult()),ot=reactExports.useCallback((at,lt)=>{st.mutate(at,lt).catch(noop)},[st]);if(nt.error&&shouldThrowError(st.options.throwOnError,[nt.error]))throw nt.error;return{...nt,mutate:ot,mutateAsync:nt.mutate}}function useInfiniteQuery(tt,et){return useBaseQuery(tt,InfiniteQueryObserver)}const useUpdateMutation=({application:tt,options:et})=>useMutation({mutationFn:async rt=>await odeServices.resource(tt).update(rt),...et}),SvgIconBookmark=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M7 4a1 1 0 0 0-1 1v14.06l5.42-3.87a1 1 0 0 1 1.16 0L18 19.06V5a1 1 0 0 0-1-1zM4.88 2.88A3 3 0 0 1 7 2h10a3 3 0 0 1 3 3v16a1 1 0 0 1-1.58.81L12 17.23 5.58 21.8A1 1 0 0 1 4 21V5a3 3 0 0 1 .88-2.12"})]}),ShareBookmark=({bookmark:tt,refBookmark:et,onBookmarkChange:rt,onSave:st})=>{const{t:nt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"mt-16",children:jsxRuntimeExports.jsxs(FormControl,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[jsxRuntimeExports.jsx("div",{className:"flex-fill",children:jsxRuntimeExports.jsx(FormControl.Input,{ref:et,onChange:rt,placeholder:nt("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},tt.id)}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"ghost",disabled:tt.name.length===0,leftIcon:jsxRuntimeExports.jsx(SvgIconSave,{}),onClick:st,className:"text-nowrap",children:nt("explorer.modal.share.sharebookmark.save")})]})})},hasRight=(tt,et)=>tt.actions.filter(rt=>et.id===rt.id).length>0,showShareRightLine=(tt,et)=>tt.isBookmarkMember&&et||!tt.isBookmarkMember,ShareBookmarkLine=({shareRights:tt,showBookmark:et,toggleBookmark:rt,shareRightActions:st,toggleRight:nt,onDeleteRow:ot})=>{const{t:at}=useTranslation();return tt==null?void 0:tt.rights.map(lt=>{const ut={user:jsxRuntimeExports.jsx(Avatar,{alt:at("explorer.modal.share.avatar.shared.alt"),size:"xs",src:lt.avatarUrl,variant:"circle"}),group:jsxRuntimeExports.jsx("div",{className:"avatar-xs bg-primary-200 justify-content-center d-flex rounded-circle",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:16})}),sharebookmark:jsxRuntimeExports.jsx(SvgIconBookmark,{})}[lt.type]||null,ct=lt.type==="sharebookmark",dt=lt.type==="user";return showShareRightLine(lt,et)&&jsxRuntimeExports.jsxs("tr",{className:lt.isBookmarkMember?"bg-light":"",children:[jsxRuntimeExports.jsx("td",{children:ut}),jsxRuntimeExports.jsx("td",{children:jsxRuntimeExports.jsxs("div",{className:"d-flex",children:[ct&&jsxRuntimeExports.jsx(Button,{color:"tertiary",rightIcon:jsxRuntimeExports.jsx(SvgIconRafterDown,{title:at("show"),className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:et?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:rt,children:lt.displayName}),!ct&<.displayName,dt&&` (${at(lt.profile||"")})`]})}),st.map(ht=>jsxRuntimeExports.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:jsxRuntimeExports.jsx(Checkbox,{checked:hasRight(lt,ht),onChange:()=>nt(lt,ht.id)})},ht.displayName)),jsxRuntimeExports.jsx("td",{children:!lt.isBookmarkMember&&jsxRuntimeExports.jsx(IconButton,{"aria-label":at("close"),color:"tertiary",icon:jsxRuntimeExports.jsx(SvgIconClose,{}),type:"button",variant:"ghost",title:at("close"),onClick:()=>ot(lt)})})]},lt.id)})},initialState$2={searchInputValue:"",searchResults:[],searchAPIResults:[],isSearching:!1};function reducer$1(tt,et){switch(et.type){case"onChange":return{...tt,searchInputValue:et.payload};case"isSearching":return{...tt,isSearching:et.payload};case"addResult":return{...tt,searchResults:et.payload};case"addApiResult":return{...tt,searchAPIResults:et.payload};case"updateSearchResult":return{...tt,searchResults:et.payload};case"emptyResult":return{...tt,searchResults:et.payload};default:throw new Error("Unhandled action type")}}const defaultActions=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}],useSearch=({resourceId:tt,resourceCreatorId:et,shareRights:rt,shareDispatch:st})=>{const[nt,ot]=reactExports.useReducer(reducer$1,initialState$2),at=useDebounce(nt.searchInputValue,500),{isAdml:lt}=useIsAdml(),{appCode:ut}=useEdificeClient(),{t:ct}=useTranslation();reactExports.useEffect(()=>{ht(at)},[at]);const dt=ft=>{const xt=ft.target.value;ot({type:"onChange",payload:xt})},ht=async ft=>{if(tt){if(ot({type:"isSearching",payload:!0}),!lt&&ft.length>=1||lt&&ft.length>=3){const xt=await odeServices.share().searchShareSubjects(ut,tt,ft);ot({type:"addApiResult",payload:xt});const yt=xt.filter(vt=>!rt.rights.find(Et=>Et.id===vt.id)).filter(vt=>!(vt.type==="user"&&vt.id===et)).map(vt=>{let Et=vt.displayName;return vt.type==="user"&&vt.profile?Et=`${Et} (${ct(vt.profile)})`:vt.type==="group"&&vt.structureName&&(Et=`${Et} (${vt.structureName})`),{value:vt.id,label:Et,icon:vt.type==="sharebookmark"?jsxRuntimeExports.jsx(SvgIconBookmark,{}):null}});ot({type:"addResult",payload:yt})}else ot({type:"emptyResult",payload:[]}),Promise.resolve();ot({type:"isSearching",payload:!1})}};return{state:nt,showSearchAdmlHint:()=>lt&&nt.searchInputValue.length<3,showSearchLoading:()=>nt.isSearching,showSearchNoResults:()=>!nt.isSearching&&!lt&&at.length>0&&nt.searchResults.length===0||!nt.isSearching&<&&at.length>3&&nt.searchResults.length===0,getSearchMinLength:()=>lt?3:1,handleSearchInputChange:dt,handleSearchResultsChange:async ft=>{const xt=nt.searchAPIResults.find(yt=>yt.id===ft[0]);if(xt){let yt=[];if(xt.type==="sharebookmark"){const vt=await odeServices.directory().getBookMarkById(xt.id);yt.push({...vt,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:defaultActions}),vt==null||vt.users.filter(Et=>!rt.rights.find(bt=>bt.id===Et.id)).forEach(Et=>{yt.push({...Et,type:"user",avatarUrl:"",directoryUrl:"",actions:defaultActions,isBookmarkMember:!0})}),vt.groups.filter(Et=>!rt.rights.find(bt=>bt.id===Et.id)).forEach(Et=>{yt.push({...Et,type:"group",avatarUrl:"",directoryUrl:"",actions:defaultActions,isBookmarkMember:!0})})}else yt=[{...xt,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];st({type:"updateShareRights",payload:{...rt,rights:[...rt.rights,...yt]}}),ot({type:"updateSearchResult",payload:nt.searchResults.filter(vt=>vt.value!==ft[0])})}}}},initialState$1={isSharing:!1,shareRights:{rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]},shareRightActions:[]};function reducer(tt,et){switch(et.type){case"init":return{...tt,...et.payload};case"deleteRow":return{...tt,shareRights:et.payload};case"updateShareRights":return{...tt,shareRights:et.payload};case"toggleRight":return{...tt,shareRights:et.payload};case"isSharing":return{...tt,isSharing:et.payload};default:throw new Error("Unhandled action type")}}function useShare({resourceId:tt,resourceRights:et,resourceCreatorId:rt,shareResource:st,setIsLoading:nt,onSuccess:ot}){const{appCode:at}=useEdificeClient(),{user:lt,avatar:ut}=useUser(),ct=useToast(),{t:dt}=useTranslation(),[ht,ft]=reactExports.useReducer(reducer,initialState$1);reactExports.useEffect(()=>{tt&&(async()=>{try{const[vt,Et]=await Promise.all([odeServices.share().getActionsForApp(at),odeServices.share().getRightsForResource(at,tt)]);ft({type:"init",payload:{shareRightActions:vt,shareRights:Et}})}catch(vt){console.error(vt)}nt(!1)})()},[tt]);const xt=(vt,Et)=>{var bt,wt;const{rights:St,...Rt}=ht.shareRights,Ct=[...St],Pt=Ct.findIndex(jt=>jt.id===vt.id),It=ht.shareRightActions.filter(jt=>jt.id===Et)[0];if(Ct[Pt].actions.findIndex(jt=>jt.id===Et)>-1){let jt=Ct[Pt].actions.filter(Ht=>Ht.id!==Et);const Dt=ht.shareRightActions.filter(Ht=>{var Nt;return(Nt=Ht.requires)==null?void 0:Nt.includes(Et)});jt=jt.filter(Ht=>!Dt.find(Nt=>Nt.id===Ht.id)),Ct[Pt]={...Ct[Pt],actions:jt}}else{const jt=ht.shareRightActions.filter(Dt=>{var Ht;return((Ht=It.requires)==null?void 0:Ht.includes(Dt.id))&&!Ct[Pt].actions.find(Nt=>Nt.id===Dt.id)});Ct[Pt]={...Ct[Pt],actions:[...Ct[Pt].actions,It,...jt]}}vt.type==="sharebookmark"&&((bt=Ct[Pt].users)==null||bt.forEach(jt=>{const Dt=Ct.findIndex(Ht=>Ht.id===jt.id);Ct[Dt]={...Ct[Dt],actions:Ct[Pt].actions}}),(wt=Ct[Pt].groups)==null||wt.forEach(jt=>{const Dt=Ct.findIndex(Ht=>Ht.id===jt.id);Ct[Dt]={...Ct[Dt],actions:Ct[Pt].actions}})),ft({type:"toggleRight",payload:{rights:Ct,...Rt}})},yt=vt=>{Object.keys(vt)[0]==="error"?(ct.error(dt("explorer.shared.status.error")),console.error("Failed to save share",vt)):ct.success(dt("explorer.shared.status.saved"))};return{state:ht,dispatch:ft,currentIsAuthor:()=>rt===(lt==null?void 0:lt.userId),myAvatar:ut,handleDeleteRow:vt=>{ft({type:"deleteRow",payload:{...ht.shareRights,rights:ht.shareRights.rights.filter(Et=>{var bt,wt;return Et.id!==vt.id&&!((bt=vt.users)!=null&&bt.find(St=>St.id===Et.id))&&!((wt=vt.groups)!=null&&wt.find(St=>St.id===Et.id))})}})},handleShare:async()=>{ft({type:"isSharing",payload:!0});try{const vt=et.filter(bt=>lt&&bt.includes(`user:${lt.userId}`)).map(bt=>bt.split(":")[2]).filter(bt=>!!bt),Et=[...ht.shareRights.rights];if(vt.length>0){const bt=vt.map(wt=>({displayName:wt,id:wt}));Et.push({actions:bt,avatarUrl:"",directoryUrl:"",displayName:lt.username,id:lt.userId,type:"user"})}if(st){const bt=await st.mutateAsync({resourceId:tt,rights:Et});yt(bt)}else{const bt=await odeServices.share().saveRights(at,tt,Et);yt(bt)}ot()}catch(vt){typeof vt=="string"&&ct.error(dt("explorer.shared.status.error")),console.error("Failed to save share",vt)}finally{ft({type:"isSharing",payload:!1})}},toggleRight:xt}}const useShareBookmark=({shareRights:tt,shareDispatch:et})=>{const rt=useToast(),{t:st}=useTranslation(),nt=reactExports.useRef(null),[ot,at]=reactExports.useState({name:"",id:reactExports.useId()}),[lt,ut]=useToggle$1(!1),[ct,dt]=reactExports.useState(!1),ht=()=>{ut()},ft=()=>{at(yt=>{var vt;return{...yt,name:((vt=nt.current)==null?void 0:vt.value)||""}})},xt=async yt=>{try{const vt=await odeServices.directory().saveBookmarks(yt,{users:tt.rights.filter(Et=>Et.type==="user").map(Et=>Et.id),groups:tt.rights.filter(Et=>Et.type==="group").map(Et=>Et.id),bookmarks:tt.rights.filter(Et=>Et.type==="sharebookmark").map(Et=>Et.id)});rt.success(st("explorer.bookmarked.status.saved")),et({type:"updateShareRights",payload:{...tt,visibleBookmarks:[...tt.visibleBookmarks,{displayName:yt,id:vt.id}]}}),at(Et=>({...Et,bookmarkId:Et.id+new Date().getTime().toString()})),dt(!1)}catch(vt){console.error("Failed to save bookmark",vt),rt.error(st("explorer.bookmarked.status.error"))}};return{refBookmark:nt,showBookmark:lt,showBookmarkInput:ct,bookmark:ot,handleBookmarkChange:ft,setBookmark:at,handleOnSave:()=>{var yt;const vt=((yt=nt.current)==null?void 0:yt.value)||"";xt(vt)},toggleBookmark:ht,toggleBookmarkInput:dt}};function ShareResourceModal({isOpen:tt,shareOptions:et,shareResource:rt,children:st,onSuccess:nt,onCancel:ot}){const{resourceId:at,resourceCreatorId:lt,resourceRights:ut}=et,[ct,dt]=reactExports.useState(!0),{state:{isSharing:ht,shareRights:ft,shareRightActions:xt},dispatch:yt,myAvatar:vt,currentIsAuthor:Et,handleShare:bt,toggleRight:wt,handleDeleteRow:St}=useShare({resourceId:at,resourceCreatorId:lt,resourceRights:ut,shareResource:rt,setIsLoading:dt,onSuccess:nt}),{state:{searchResults:Rt,searchInputValue:Ct},showSearchAdmlHint:Pt,showSearchLoading:It,showSearchNoResults:jt,getSearchMinLength:Dt,handleSearchInputChange:Ht,handleSearchResultsChange:Nt}=useSearch({resourceId:at,resourceCreatorId:lt,shareRights:ft,shareDispatch:yt}),{refBookmark:Ut,showBookmark:Lt,handleBookmarkChange:kt,toggleBookmark:Mt,bookmark:Bt,handleOnSave:Gt,showBookmarkInput:$t,toggleBookmarkInput:zt}=useShareBookmark({shareRights:ft,shareDispatch:yt}),{t:Ft}=useTranslation(),Yt=Pt()?Ft("explorer.search.adml.hint"):Ft("explorer.modal.share.search.placeholder");return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"share_modal",size:"lg",isOpen:tt,onModalClose:ot,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:ot,children:Ft("share.title")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:Ft("explorer.modal.share.usersWithAccess")}),jsxRuntimeExports.jsx("div",{className:"table-responsive",children:ct?jsxRuntimeExports.jsx(LoadingScreen,{}):jsxRuntimeExports.jsxs("table",{className:"table border align-middle mb-0",children:[jsxRuntimeExports.jsx("thead",{className:"bg-secondary",children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("th",{scope:"col",className:"w-32",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Ft("explorer.modal.share.avatar.shared.alt")})}),jsxRuntimeExports.jsx("th",{scope:"col",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Ft("explorer.modal.share.search.placeholder")})}),xt.map(Zt=>jsxRuntimeExports.jsx("th",{scope:"col",className:"text-center text-white",children:Ft(Zt.displayName)},Zt.displayName)),jsxRuntimeExports.jsx("th",{scope:"col",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Ft("close")})})]})}),jsxRuntimeExports.jsxs("tbody",{children:[Et()&&jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("th",{scope:"row",children:jsxRuntimeExports.jsx(Avatar,{alt:Ft("explorer.modal.share.avatar.me.alt"),size:"xs",src:vt,variant:"circle"})}),jsxRuntimeExports.jsx("td",{children:Ft("share.me")}),xt.map(Zt=>jsxRuntimeExports.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:jsxRuntimeExports.jsx(Checkbox,{checked:!0,disabled:!0})},Zt.displayName)),jsxRuntimeExports.jsx("td",{})]}),jsxRuntimeExports.jsx(ShareBookmarkLine,{showBookmark:Lt,shareRightActions:xt,shareRights:ft,onDeleteRow:St,toggleRight:wt,toggleBookmark:Mt})]})]})}),jsxRuntimeExports.jsxs("div",{className:"mt-16",children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconBookmark,{}),rightIcon:jsxRuntimeExports.jsx(SvgIconRafterDown,{title:Ft("show"),className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:$t?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>zt(!$t),children:Ft("share.save.sharebookmark")}),$t&&jsxRuntimeExports.jsx(ShareBookmark,{refBookmark:Ut,bookmark:Bt,onBookmarkChange:kt,onSave:Gt})]}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsxs(Heading,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[jsxRuntimeExports.jsx("div",{className:"me-8",children:Ft("explorer.modal.share.search")}),jsxRuntimeExports.jsx(Tooltip,{message:"Vos favoris de partage s’affichent en priorité dans votre liste lorsque vous recherchez un groupe ou une personne, vous pouvez les retrouver dans l’annuaire.",placement:"top",children:jsxRuntimeExports.jsx(SvgIconInfoCircle,{className:"c-pointer",height:"18"})})]}),jsxRuntimeExports.jsx("div",{className:"row",children:jsxRuntimeExports.jsx("div",{className:"col-10",children:jsxRuntimeExports.jsx(Combobox,{value:Ct,placeholder:Yt,isLoading:It(),noResult:jt(),options:Rt,searchMinLength:Dt(),onSearchInputChange:Ht,onSearchResultsChange:Nt})})}),st]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:ot,children:Ft("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",isLoading:ht,onClick:bt,disabled:ht,children:Ft("share")})]})]}),document.getElementById("portal"))}function ShareBlog({resourceId:tt,updateResource:et}){const{appCode:rt}=useEdificeClient(),{t:st}=useTranslation(rt),nt=useResource("blog",tt),ot=nt&&nt["publish-type"],[at,lt]=reactExports.useState(ot??"RESTRAINT");reactExports.useEffect(()=>{ot&<(ot)},[ot]);const ut=async ct=>{const dt=ct.target.value,ht={description:nt.description||"",entId:nt.assetId,name:nt.name,public:!!nt.public,slug:nt.slug||"",thumbnail:nt.thumbnail,trashed:nt.trashed,"publish-type":dt};et?await et.mutateAsync(ht):await odeServices.resource("blog").update(ht),lt(dt)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:st("explorer.publication.steps")}),jsxRuntimeExports.jsx(Radio,{label:st("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:at,checked:at==="IMMEDIATE",onChange:ut}),jsxRuntimeExports.jsx(Radio,{label:st("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",checked:at==="RESTRAINT",model:at,onChange:ut})]})}const useShareMutation=({application:tt,options:et})=>useMutation({mutationFn:async({resourceId:rt,rights:st})=>await odeServices.share().saveRights(tt,rt,st),...et}),SvgIconCommunity=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M19.935 17.51q1.088 0 1.868.792.78.794.78 1.898 0 1.106-.78 1.898-.78.793-1.844.793t-1.869-.793a2.52 2.52 0 0 1-.78-1.922q0-.432.19-.936l-3.997-2.931q-1.16 1.2-2.79 1.2-1.633 0-2.791-1.176-1.16-1.177-1.183-2.86 0-.215.071-.624l-3.168-1.057a1.25 1.25 0 0 1-.852.337q-.567 0-.946-.385a1.32 1.32 0 0 1-.378-.96q0-.578.378-.938.38-.36.946-.384.474 0 .804.312.33.313.45.745l3.192 1.08a3.8 3.8 0 0 1 1.443-1.56 3.84 3.84 0 0 1 2.033-.577q1.23 0 2.27.745l4.706-4.781q-.378-.72-.378-1.321 0-1.106.78-1.898.78-.793 1.869-.793t1.844.793q.758.792.78 1.898a2.42 2.42 0 0 1-.78 1.873q-.804.77-1.868.793-.616 0-1.3-.408l-4.707 4.805q.734 1.056.733 2.306 0 .888-.402 1.753l3.997 2.907q.78-.624 1.679-.624"})]}),SvgIconDisconnect=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M22.996 13.153q0 2.09-.873 3.987a10.6 10.6 0 0 1-2.336 3.292q-1.462 1.393-3.516 2.21t-4.26.817-4.287-.817-3.49-2.21a12.3 12.3 0 0 1-2.362-3.291A8.1 8.1 0 0 1 1 13.153q0-2.451 1.155-4.589t3.234-3.627q.616-.433 1.386-.337t1.181.673q.462.553.36 1.273-.104.72-.72 1.13a7 7 0 0 0-2.155 2.426 6.38 6.38 0 0 0-.18 5.717 7 7 0 0 0 1.566 2.186q.975.913 2.335 1.466a7.5 7.5 0 0 0 2.85.552 7.3 7.3 0 0 0 2.823-.552 8.3 8.3 0 0 0 2.36-1.466 6.04 6.04 0 0 0 1.567-2.186q.538-1.274.564-2.666 0-1.635-.77-3.051T16.4 7.675a1.75 1.75 0 0 1-.719-1.129q-.128-.697.36-1.273.436-.577 1.206-.673t1.36.337q2.079 1.466 3.234 3.627a9.6 9.6 0 0 1 1.155 4.589M13.833 2.846v8.6q0 .698-.54 1.202-.538.505-1.283.505t-1.309-.505q-.564-.505-.539-1.201v-8.6q0-.697.54-1.202.538-.504 1.308-.504t1.284.504.539 1.201"})]}),SvgIconHome=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M20.584 13.536v7.458q0 .42-.294.699a1.06 1.06 0 0 1-.667.307H13.91v-5.978h-3.817V22H4.383a.85.85 0 0 1-.668-.307 1.16 1.16 0 0 1-.293-.699v-7.569l8.567-7.375 8.568 7.375q.027.027.027.111m3.31-1.09-.908 1.146a.54.54 0 0 1-.32.168h-.054a.6.6 0 0 1-.32-.084L11.989 4.682 1.687 13.676a.5.5 0 0 1-.347.084.54.54 0 0 1-.32-.168l-.935-1.145a.52.52 0 0 1-.08-.363.6.6 0 0 1 .16-.335l10.703-9.33q.48-.42 1.121-.419.64 0 1.148.419l3.63 3.156V2.56q0-.224.133-.363a.46.46 0 0 1 .347-.14h2.856q.214 0 .347.14a.5.5 0 0 1 .134.363v6.34l3.256 2.85q.16.111.16.335 0 .223-.107.363"})]}),SvgIconMyApps=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M1.898 22.555c-.072-.145-.096-1.37-.048-2.691l.048-2.402h5.261v5.26l-2.595.049c-1.994.048-2.594 0-2.666-.216m7.76 0c-.049-.145-.073-1.37-.049-2.691l.072-2.402h5.238v5.26l-2.571.049c-2.018.048-2.595 0-2.69-.216m7.759 0c-.048-.145-.072-1.37-.048-2.691l.072-2.402h5.237v5.26l-2.57.049c-1.994.048-2.595 0-2.691-.216m-15.52-7.76c-.071-.168-.095-1.37-.047-2.69l.048-2.403h5.261v5.261l-2.595.048c-1.994.048-2.594 0-2.666-.216m7.76 0c-.048-.168-.072-1.37-.048-2.69l.072-2.403h5.238v5.261l-2.571.048c-2.018.048-2.595 0-2.69-.216m7.76 0c-.048-.168-.072-1.37-.048-2.69l.072-2.403h5.237v5.261l-2.57.048c-1.994.048-2.595 0-2.691-.216M1.897 7.011c-.071-.144-.095-1.345-.047-2.666l.048-2.402h5.261V7.18l-2.595.072c-1.994.048-2.594 0-2.666-.24m7.76 0c-.048-.144-.072-1.345-.048-2.666l.072-2.402h5.238V7.18l-2.571.072c-2.018.048-2.595 0-2.69-.24m7.76 0c-.048-.144-.072-1.345-.048-2.666l.072-2.402h5.237V7.18l-2.57.072c-1.994.048-2.595 0-2.691-.24"})]}),SvgIconNeoAssistance=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12M7.123 7.667C8.276 5.958 9.745 5 12.013 5 14.425 5 17 6.941 17 9.5c0 2.113-1.377 2.932-2.418 3.552-.633.376-1.142.68-1.142 1.154v.169a.693.693 0 0 1-.682.703h-2.06a.693.693 0 0 1-.681-.703v-.287c0-1.768 1.269-2.5 2.266-3.075l.073-.042c.863-.499 1.392-.838 1.392-1.499 0-.874-1.082-1.454-1.956-1.454-1.112 0-1.64.53-2.351 1.449a.67.67 0 0 1-.945.121L7.27 8.63a.72.72 0 0 1-.147-.963M9.76 17.97c0-1.12.883-2.03 1.969-2.03 1.085 0 1.968.91 1.968 2.03S12.814 20 11.73 20c-1.086 0-1.969-.91-1.969-2.03",clipRule:"evenodd"})]}),SvgIconNeoMessaging=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"m.5 21.257 7.46-8.216 4.052 2.403 4.052-2.403 7.46 8.216zm0-2.738V8.573l5.848 3.531zm0-12.084V3.048h23.024v3.387l-11.512 6.847zm17.176 5.67 5.848-3.532v9.946z"})]}),SvgIconNewRelease=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M13.07 13.07V6.54h-2.14v6.53zm0 4.4v-2.2h-2.14v2.2zM24 12l-2.65 3.01.35 4.04-3.93.86-2.04 3.48L12 21.8l-3.73 1.6-2.04-3.42-3.93-.92.35-4.04L0 12l2.65-3.06-.35-3.99 3.93-.86L8.27.6 12 2.2 15.73.6l2.04 3.48 3.93.86L21.34 9z"})]}),SvgIconOneAssistance=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M11.685 2C8.66 2 6.7 3.277 5.164 5.556A.96.96 0 0 0 5.36 6.84l1.634 1.278a.89.89 0 0 0 1.26-.162c.95-1.226 1.653-1.932 3.136-1.932 1.165 0 2.607.773 2.607 1.939 0 .88-.705 1.333-1.856 1.998-1.342.776-3.118 1.742-3.118 4.157v.382c0 .518.407.938.909.938h2.746c.502 0 .91-.42.91-.938v-.226c0-1.674 4.745-1.743 4.745-6.274 0-3.412-3.432-6-6.648-6m-.38 14.588c-1.447 0-2.625 1.214-2.625 2.706S9.858 22 11.305 22s2.624-1.214 2.624-2.706-1.177-2.706-2.624-2.706"})]}),SvgIconOneMessaging=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.051 12.366a456 456 0 0 1-2.746-1.822A6.5 6.5 0 0 1 .74 9.067q-.737-.94-.737-1.745a2.7 2.7 0 0 1 .141-.905c.098-.286.242-.542.424-.752Q1.12 5 2.15 5h19.7c.541-.016 1.071.195 1.507.6q.636.6.636 1.446 0 1.01-.657 1.93a6.2 6.2 0 0 1-1.632 1.567q-5.037 3.338-6.267 4.156l-.242.167-.323.222q-.436.303-.724.487-.288.183-.696.415a4 4 0 0 1-.77.345 2.2 2.2 0 0 1-.67.115h-.026a2.2 2.2 0 0 1-.67-.116 4 4 0 0 1-.77-.344q-.41-.23-.697-.415a30 30 0 0 1-.723-.487q-.433-.3-.565-.389-1.215-.817-3.51-2.334m10.943 3.962q2.276-1.578 6.667-4.416c.478-.306.927-.68 1.339-1.113v10.16q0 .845-.63 1.446c-.437.405-.97.614-1.512.594H2.149c-.545.02-1.08-.192-1.52-.601C.21 21.996 0 21.52 0 20.95V10.8c.416.437.871.81 1.356 1.113q4.848 3.148 6.656 4.416.768.537 1.243.837a7.7 7.7 0 0 0 1.265.614c.475.198.97.303 1.47.313h.026c.5-.01.995-.115 1.47-.313a7.7 7.7 0 0 0 1.265-.614q.48-.3 1.243-.837",clipRule:"evenodd"})]}),SvgIconUserbook=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M0 24.58V.53h24.05v4.28h-2.62V7.1h2.62v4.28h-2.62v2.35h2.62V18h-2.62v2.3h2.62v4.29H0zm4.64-6.85h12.12V14l-4.5-2.67q.9-.46 1.4-1.3t.53-1.85q0-1.4-1.01-2.43T10.7 4.72 8.25 5.75 7.24 8.18q0 1.03.53 1.85t1.4 1.3L4.63 14v3.73z"})]});function useHeader({user:tt,avatar:et}){const{appCode:rt}=useEdificeClient(),{t:st}=useTranslation(),{theme:nt}=useEdificeTheme(),ot=st(rt),[at,lt]=reactExports.useState(!0),[ut,ct]=useHover$1(),dt=reactExports.useId(),ht=reactExports.useId(),ft=et,xt=tt==null?void 0:tt.username,yt=st("welcome",{username:tt==null?void 0:tt.firstName}),vt=useBookmark(),Et=useHasWorkflow("net.atos.entng.community.controllers.CommunityController|view"),bt=useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"),wt=useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"),St=reactExports.useCallback(()=>{lt(!at)},[at]),Rt=async()=>{await odeServices.session().logout(),window.location.href=(nt==null?void 0:nt.logoutCallback)??"/auth/login"};return reactExports.useMemo(()=>({title:ot,bookmarkedApps:vt,appsRef:ut,isAppsHovered:ct,popoverAppsId:dt,popoverSearchId:ht,userAvatar:ft,userName:xt,welcomeUser:yt,communityWorkflow:Et,conversationWorflow:bt,searchWorkflow:wt,isCollapsed:at,toggleCollapsedNav:St,handleLogout:Rt}),[ut,vt,Et,bt,Rt,ct,at,dt,ht,wt,ot,St,ft,xt,yt])}function Help({isHelpOpen:tt,setIsHelpOpen:et,parsedHeadline:rt,parsedContent:st,error:nt}){const{t:ot}=useTranslation(),at=()=>{et(!1)};return tt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"help-modal",isOpen:tt,onModalClose:at,scrollable:!0,size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:at,children:ot("navbar.help")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:nt?ot("help.notfound.title"):rt}),jsxRuntimeExports.jsx(Modal.Body,{className:nt?"d-flex":null,children:nt?ot("help.notfound.text"):st})]}),document.getElementById("portal")):null}function Navbar({children:tt,className:et,...rt}){const st=clsx("navbar",et);return jsxRuntimeExports.jsx("nav",{className:st,...rt,children:tt})}function NavBarNav({children:tt,className:et,...rt}){const st=clsx("navbar-nav",et);return jsxRuntimeExports.jsx("ul",{className:st,...rt,children:tt})}const NavItem=reactExports.forwardRef(({children:tt,className:et,...rt},st)=>{const nt=clsx("nav-item",et);return jsxRuntimeExports.jsx("li",{ref:st,className:nt,...rt,children:tt})});function NavLink({link:tt,className:et,children:rt,translate:st,...nt}){const ot=clsx("nav-link",et);return jsxRuntimeExports.jsxs("a",{href:tt,className:ot,...nt,children:[rt,st&&jsxRuntimeExports.jsx(VisuallyHidden,{children:jsxRuntimeExports.jsx("span",{className:"nav-text",children:st})})]})}const SvgIconSearch=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M1.27 11.552a7.75 7.75 0 0 1 0-4.156Q1.84 5.33 3.42 3.792a7.9 7.9 0 0 1 2.716-1.777q1.53-.6 3.161-.6 1.605 0 3.136.6 1.53.6 2.716 1.777a7.9 7.9 0 0 1 1.902 2.86 7.8 7.8 0 0 1 .518 3.29 7.65 7.65 0 0 1-.889 3.171q.692.192 1.21.697l4.297 4.156q.864.84.864 2.042t-.864 2.042-2.099.841-2.099-.84l-4.272-4.18a2.42 2.42 0 0 1-.74-1.178 8.3 8.3 0 0 1-3.68.84q-1.63 0-3.16-.6a8.1 8.1 0 0 1-2.717-1.753 7.85 7.85 0 0 1-2.149-3.628m2.495-2.066q0 2.235 1.605 3.796 1.63 1.56 3.926 1.561 2.272 0 3.877-1.561 1.605-1.562 1.63-3.796t-1.63-3.796q-1.63-1.585-3.877-1.585-2.272 0-3.926 1.585-1.605 1.561-1.605 3.796"})]}),PopoverBody=({children:tt,className:et})=>{const rt=clsx("popover-body",et);return jsxRuntimeExports.jsx("div",{className:rt,children:tt})},PopoverFooter=({children:tt,className:et})=>{const rt=clsx("popover-footer p-8",et);return jsxRuntimeExports.jsx("div",{className:rt,children:tt})},Popover=reactExports.forwardRef(({children:tt,className:et,id:rt,isVisible:st,...nt},ot)=>{const at=clsx("popover d-block position-absolute top-100 start-50 translate-middle-x",et);return useTransition(st,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((lt,ut)=>ut&&jsxRuntimeExports.jsx(animated.div,{ref:ot,"aria-labelledby":rt,className:at,role:"tooltip",style:lt,...nt,children:tt}))}),SearchEngine=()=>{const[tt,et]=useHover(),rt=reactExports.useRef(null),st=reactExports.useId(),{t:nt}=useTranslation();function ot(){if(rt.current){const at=rt.current.value;window.location.href=`/searchengine#/${at}`}}return jsxRuntimeExports.jsxs(NavItem,{id:st,ref:tt,className:"position-relative","aria-haspopup":"true","aria-expanded":et,children:[jsxRuntimeExports.jsxs("a",{href:"/searchengine",className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(SvgIconSearch,{className:"icon search"}),jsxRuntimeExports.jsx("span",{className:"nav-text",children:nt("navbar.search")})]}),jsxRuntimeExports.jsx(Popover,{id:st,isVisible:et,className:"d-none d-md-flex",children:jsxRuntimeExports.jsxs(FormControl,{id:"my-search-input",className:"search-text input-group py-8 px-12",children:[jsxRuntimeExports.jsx(FormControl.Input,{ref:rt,size:"sm",type:"text",name:"my-search-input",placeholder:"Rechercher"}),jsxRuntimeExports.jsx(SearchButton,{type:"submit",size:"sm",onClick:ot,"aria-label":nt("navbar.search")})]})})]})},WidgetAppsFooter=()=>{const{t:tt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"widget-footer",children:jsxRuntimeExports.jsx("div",{className:"widget-footer-action",children:jsxRuntimeExports.jsx("a",{href:"/welcome",className:"link",children:tt("plus")})})})},WidgetAppsBody=({bookmarkedApps:tt})=>{const{t:et}=useTranslation();return jsxRuntimeExports.jsxs("div",{className:"widget-body d-flex flex-wrap",children:[!tt.length&&jsxRuntimeExports.jsx("div",{className:"text-dark",children:et("navbar.myapps.more")}),tt.slice(0,6).map((rt,st)=>jsxRuntimeExports.jsx("a",{href:rt.address,className:"bookmarked-app",children:jsxRuntimeExports.jsx(AppIcon,{app:rt,size:"32"})},st))]})};var lib$2={},lib$1={};(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.Doctype=tt.CDATA=tt.Tag=tt.Style=tt.Script=tt.Comment=tt.Directive=tt.Text=tt.Root=tt.isTag=tt.ElementType=void 0;var et;(function(st){st.Root="root",st.Text="text",st.Directive="directive",st.Comment="comment",st.Script="script",st.Style="style",st.Tag="tag",st.CDATA="cdata",st.Doctype="doctype"})(et=tt.ElementType||(tt.ElementType={}));function rt(st){return st.type===et.Tag||st.type===et.Script||st.type===et.Style}tt.isTag=rt,tt.Root=et.Root,tt.Text=et.Text,tt.Directive=et.Directive,tt.Comment=et.Comment,tt.Script=et.Script,tt.Style=et.Style,tt.Tag=et.Tag,tt.CDATA=et.CDATA,tt.Doctype=et.Doctype})(lib$1);var node={},__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var tt=function(et,rt){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(st,nt){st.__proto__=nt}||function(st,nt){for(var ot in nt)Object.prototype.hasOwnProperty.call(nt,ot)&&(st[ot]=nt[ot])},tt(et,rt)};return function(et,rt){if(typeof rt!="function"&&rt!==null)throw new TypeError("Class extends value "+String(rt)+" is not a constructor or null");tt(et,rt);function st(){this.constructor=et}et.prototype=rt===null?Object.create(rt):(st.prototype=rt.prototype,new st)}}(),__assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function(tt){for(var et,rt=1,st=arguments.length;rt<st;rt++){et=arguments[rt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(tt[nt]=et[nt])}return tt},__assign.apply(this,arguments)};Object.defineProperty(node,"__esModule",{value:!0});node.cloneNode=node.hasChildren=node.isDocument=node.isDirective=node.isComment=node.isText=node.isCDATA=node.isTag=node.Element=node.Document=node.CDATA=node.NodeWithChildren=node.ProcessingInstruction=node.Comment=node.Text=node.DataNode=node.Node=void 0;var domelementtype_1=lib$1,Node$1=function(){function tt(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(tt.prototype,"parentNode",{get:function(){return this.parent},set:function(et){this.parent=et},enumerable:!1,configurable:!0}),Object.defineProperty(tt.prototype,"previousSibling",{get:function(){return this.prev},set:function(et){this.prev=et},enumerable:!1,configurable:!0}),Object.defineProperty(tt.prototype,"nextSibling",{get:function(){return this.next},set:function(et){this.next=et},enumerable:!1,configurable:!0}),tt.prototype.cloneNode=function(et){return et===void 0&&(et=!1),cloneNode(this,et)},tt}();node.Node=Node$1;var DataNode=function(tt){__extends(et,tt);function et(rt){var st=tt.call(this)||this;return st.data=rt,st}return Object.defineProperty(et.prototype,"nodeValue",{get:function(){return this.data},set:function(rt){this.data=rt},enumerable:!1,configurable:!0}),et}(Node$1);node.DataNode=DataNode;var Text$1=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Text,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),et}(DataNode);node.Text=Text$1;var Comment$1=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Comment,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),et}(DataNode);node.Comment=Comment$1;var ProcessingInstruction$1=function(tt){__extends(et,tt);function et(rt,st){var nt=tt.call(this,st)||this;return nt.name=rt,nt.type=domelementtype_1.ElementType.Directive,nt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),et}(DataNode);node.ProcessingInstruction=ProcessingInstruction$1;var NodeWithChildren=function(tt){__extends(et,tt);function et(rt){var st=tt.call(this)||this;return st.children=rt,st}return Object.defineProperty(et.prototype,"firstChild",{get:function(){var rt;return(rt=this.children[0])!==null&&rt!==void 0?rt:null},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"childNodes",{get:function(){return this.children},set:function(rt){this.children=rt},enumerable:!1,configurable:!0}),et}(Node$1);node.NodeWithChildren=NodeWithChildren;var CDATA=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.CDATA,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.CDATA=CDATA;var Document=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Root,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.Document=Document;var Element$2=function(tt){__extends(et,tt);function et(rt,st,nt,ot){nt===void 0&&(nt=[]),ot===void 0&&(ot=rt==="script"?domelementtype_1.ElementType.Script:rt==="style"?domelementtype_1.ElementType.Style:domelementtype_1.ElementType.Tag);var at=tt.call(this,nt)||this;return at.name=rt,at.attribs=st,at.type=ot,at}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"tagName",{get:function(){return this.name},set:function(rt){this.name=rt},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"attributes",{get:function(){var rt=this;return Object.keys(this.attribs).map(function(st){var nt,ot;return{name:st,value:rt.attribs[st],namespace:(nt=rt["x-attribsNamespace"])===null||nt===void 0?void 0:nt[st],prefix:(ot=rt["x-attribsPrefix"])===null||ot===void 0?void 0:ot[st]}})},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.Element=Element$2;function isTag(tt){return(0,domelementtype_1.isTag)(tt)}node.isTag=isTag;function isCDATA(tt){return tt.type===domelementtype_1.ElementType.CDATA}node.isCDATA=isCDATA;function isText(tt){return tt.type===domelementtype_1.ElementType.Text}node.isText=isText;function isComment(tt){return tt.type===domelementtype_1.ElementType.Comment}node.isComment=isComment;function isDirective(tt){return tt.type===domelementtype_1.ElementType.Directive}node.isDirective=isDirective;function isDocument(tt){return tt.type===domelementtype_1.ElementType.Root}node.isDocument=isDocument;function hasChildren(tt){return Object.prototype.hasOwnProperty.call(tt,"children")}node.hasChildren=hasChildren;function cloneNode(tt,et){et===void 0&&(et=!1);var rt;if(isText(tt))rt=new Text$1(tt.data);else if(isComment(tt))rt=new Comment$1(tt.data);else if(isTag(tt)){var st=et?cloneChildren(tt.children):[],nt=new Element$2(tt.name,__assign({},tt.attribs),st);st.forEach(function(ut){return ut.parent=nt}),tt.namespace!=null&&(nt.namespace=tt.namespace),tt["x-attribsNamespace"]&&(nt["x-attribsNamespace"]=__assign({},tt["x-attribsNamespace"])),tt["x-attribsPrefix"]&&(nt["x-attribsPrefix"]=__assign({},tt["x-attribsPrefix"])),rt=nt}else if(isCDATA(tt)){var st=et?cloneChildren(tt.children):[],ot=new CDATA(st);st.forEach(function(ct){return ct.parent=ot}),rt=ot}else if(isDocument(tt)){var st=et?cloneChildren(tt.children):[],at=new Document(st);st.forEach(function(ct){return ct.parent=at}),tt["x-mode"]&&(at["x-mode"]=tt["x-mode"]),rt=at}else if(isDirective(tt)){var lt=new ProcessingInstruction$1(tt.name,tt.data);tt["x-name"]!=null&&(lt["x-name"]=tt["x-name"],lt["x-publicId"]=tt["x-publicId"],lt["x-systemId"]=tt["x-systemId"]),rt=lt}else throw new Error("Not implemented yet: ".concat(tt.type));return rt.startIndex=tt.startIndex,rt.endIndex=tt.endIndex,tt.sourceCodeLocation!=null&&(rt.sourceCodeLocation=tt.sourceCodeLocation),rt}node.cloneNode=cloneNode;function cloneChildren(tt){for(var et=tt.map(function(st){return cloneNode(st,!0)}),rt=1;rt<et.length;rt++)et[rt].prev=et[rt-1],et[rt-1].next=et[rt];return et}(function(tt){var et=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(lt,ut,ct,dt){dt===void 0&&(dt=ct);var ht=Object.getOwnPropertyDescriptor(ut,ct);(!ht||("get"in ht?!ut.__esModule:ht.writable||ht.configurable))&&(ht={enumerable:!0,get:function(){return ut[ct]}}),Object.defineProperty(lt,dt,ht)}:function(lt,ut,ct,dt){dt===void 0&&(dt=ct),lt[dt]=ut[ct]}),rt=commonjsGlobal&&commonjsGlobal.__exportStar||function(lt,ut){for(var ct in lt)ct!=="default"&&!Object.prototype.hasOwnProperty.call(ut,ct)&&et(ut,lt,ct)};Object.defineProperty(tt,"__esModule",{value:!0}),tt.DomHandler=void 0;var st=lib$1,nt=node;rt(node,tt);var ot={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},at=function(){function lt(ut,ct,dt){this.dom=[],this.root=new nt.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof ct=="function"&&(dt=ct,ct=ot),typeof ut=="object"&&(ct=ut,ut=void 0),this.callback=ut??null,this.options=ct??ot,this.elementCB=dt??null}return lt.prototype.onparserinit=function(ut){this.parser=ut},lt.prototype.onreset=function(){this.dom=[],this.root=new nt.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},lt.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},lt.prototype.onerror=function(ut){this.handleCallback(ut)},lt.prototype.onclosetag=function(){this.lastNode=null;var ut=this.tagStack.pop();this.options.withEndIndices&&(ut.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(ut)},lt.prototype.onopentag=function(ut,ct){var dt=this.options.xmlMode?st.ElementType.Tag:void 0,ht=new nt.Element(ut,ct,void 0,dt);this.addNode(ht),this.tagStack.push(ht)},lt.prototype.ontext=function(ut){var ct=this.lastNode;if(ct&&ct.type===st.ElementType.Text)ct.data+=ut,this.options.withEndIndices&&(ct.endIndex=this.parser.endIndex);else{var dt=new nt.Text(ut);this.addNode(dt),this.lastNode=dt}},lt.prototype.oncomment=function(ut){if(this.lastNode&&this.lastNode.type===st.ElementType.Comment){this.lastNode.data+=ut;return}var ct=new nt.Comment(ut);this.addNode(ct),this.lastNode=ct},lt.prototype.oncommentend=function(){this.lastNode=null},lt.prototype.oncdatastart=function(){var ut=new nt.Text(""),ct=new nt.CDATA([ut]);this.addNode(ct),ut.parent=ct,this.lastNode=ut},lt.prototype.oncdataend=function(){this.lastNode=null},lt.prototype.onprocessinginstruction=function(ut,ct){var dt=new nt.ProcessingInstruction(ut,ct);this.addNode(dt)},lt.prototype.handleCallback=function(ut){if(typeof this.callback=="function")this.callback(ut,this.dom);else if(ut)throw ut},lt.prototype.addNode=function(ut){var ct=this.tagStack[this.tagStack.length-1],dt=ct.children[ct.children.length-1];this.options.withStartIndices&&(ut.startIndex=this.parser.startIndex),this.options.withEndIndices&&(ut.endIndex=this.parser.endIndex),ct.children.push(ut),dt&&(ut.prev=dt,dt.next=ut),ut.parent=ct,this.lastNode=null},lt}();tt.DomHandler=at,tt.default=at})(lib$2);var HTML="html",HEAD="head",BODY="body",FIRST_TAG_REGEX=/<([a-zA-Z]+[0-9]?)/,HEAD_TAG_REGEX=/<head[^]*>/i,BODY_TAG_REGEX=/<body[^]*>/i,parseFromDocument=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},parseFromString=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},DOMParser$1=typeof window=="object"&&window.DOMParser;if(typeof DOMParser$1=="function"){var domParser=new DOMParser$1,mimeType="text/html";parseFromString=function(tt,et){return et&&(tt="<"+et+">"+tt+"</"+et+">"),domParser.parseFromString(tt,mimeType)},parseFromDocument=parseFromString}if(typeof document=="object"&&document.implementation){var doc=document.implementation.createHTMLDocument();parseFromDocument=function(tt,et){if(et){var rt=doc.documentElement.querySelector(et);return rt.innerHTML=tt,doc}return doc.documentElement.innerHTML=tt,doc}}var template=typeof document=="object"?document.createElement("template"):{},parseFromTemplate;template.content&&(parseFromTemplate=function(tt){return template.innerHTML=tt,template.content.childNodes});function domparser$1(tt){var et,rt=tt.match(FIRST_TAG_REGEX);rt&&rt[1]&&(et=rt[1].toLowerCase());var st,nt,ot;switch(et){case HTML:return st=parseFromString(tt),HEAD_TAG_REGEX.test(tt)||(nt=st.querySelector(HEAD),nt&&nt.parentNode.removeChild(nt)),BODY_TAG_REGEX.test(tt)||(nt=st.querySelector(BODY),nt&&nt.parentNode.removeChild(nt)),st.querySelectorAll(HTML);case HEAD:case BODY:return st=parseFromDocument(tt),ot=st.querySelectorAll(et),BODY_TAG_REGEX.test(tt)&&HEAD_TAG_REGEX.test(tt)?ot[0].parentNode.childNodes:ot;default:return parseFromTemplate?parseFromTemplate(tt):(nt=parseFromDocument(tt,BODY).querySelector(BODY),nt.childNodes)}}var domparser_1=domparser$1,utilities$5={},constants$1={};constants$1.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"];var domhandler$1=lib$2,constants=constants$1,CASE_SENSITIVE_TAG_NAMES=constants.CASE_SENSITIVE_TAG_NAMES,Comment=domhandler$1.Comment,Element$1=domhandler$1.Element,ProcessingInstruction=domhandler$1.ProcessingInstruction,Text=domhandler$1.Text,caseSensitiveTagNamesMap={},tagName;for(var i=0,len=CASE_SENSITIVE_TAG_NAMES.length;i<len;i++)tagName=CASE_SENSITIVE_TAG_NAMES[i],caseSensitiveTagNamesMap[tagName.toLowerCase()]=tagName;function getCaseSensitiveTagName(tt){return caseSensitiveTagNamesMap[tt]}function formatAttributes(tt){for(var et={},rt,st=0,nt=tt.length;st<nt;st++)rt=tt[st],et[rt.name]=rt.value;return et}function formatTagName(tt){tt=tt.toLowerCase();var et=getCaseSensitiveTagName(tt);return et||tt}function formatDOM$1(tt,et,rt){et=et||null;for(var st=[],nt,ot=0,at=tt.length;ot<at;ot++){var lt=tt[ot],ut;switch(lt.nodeType){case 1:nt=formatTagName(lt.nodeName),ut=new Element$1(nt,formatAttributes(lt.attributes)),ut.children=formatDOM$1(nt==="template"?lt.content.childNodes:lt.childNodes,ut);break;case 3:ut=new Text(lt.nodeValue);break;case 8:ut=new Comment(lt.nodeValue);break;default:continue}var ct=st[ot-1]||null;ct&&(ct.next=ut),ut.parent=et,ut.prev=ct,ut.next=null,st.push(ut)}return rt&&(ut=new ProcessingInstruction(rt.substring(0,rt.indexOf(" ")).toLowerCase(),rt),ut.next=st[0]||null,ut.parent=et,st.unshift(ut),st[1]&&(st[1].prev=st[0])),st}utilities$5.formatAttributes=formatAttributes;utilities$5.formatDOM=formatDOM$1;var domparser=domparser_1,utilities$4=utilities$5,formatDOM=utilities$4.formatDOM,DIRECTIVE_REGEX=/<(![a-zA-Z\s]+)>/;function HTMLDOMParser(tt){if(typeof tt!="string")throw new TypeError("First argument must be a string");if(tt==="")return[];var et=tt.match(DIRECTIVE_REGEX),rt;return et&&et[1]&&(rt=et[1]),formatDOM(domparser(tt),null,rt)}var htmlToDom=HTMLDOMParser,lib={},possibleStandardNamesOptimized$1={},SAME$1=0;possibleStandardNamesOptimized$1.SAME=SAME$1;var CAMELCASE$1=1;possibleStandardNamesOptimized$1.CAMELCASE=CAMELCASE$1;possibleStandardNamesOptimized$1.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};Object.defineProperty(lib,"__esModule",{value:!0});function _slicedToArray(tt,et){return _arrayWithHoles(tt)||_iterableToArrayLimit(tt,et)||_unsupportedIterableToArray(tt,et)||_nonIterableRest()}function _arrayWithHoles(tt){if(Array.isArray(tt))return tt}function _iterableToArrayLimit(tt,et){var rt=tt==null?null:typeof Symbol<"u"&&tt[Symbol.iterator]||tt["@@iterator"];if(rt!=null){var st=[],nt=!0,ot=!1,at,lt;try{for(rt=rt.call(tt);!(nt=(at=rt.next()).done)&&(st.push(at.value),!(et&&st.length===et));nt=!0);}catch(ut){ot=!0,lt=ut}finally{try{!nt&&rt.return!=null&&rt.return()}finally{if(ot)throw lt}}return st}}function _unsupportedIterableToArray(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray(tt,et);var rt=Object.prototype.toString.call(tt).slice(8,-1);if(rt==="Object"&&tt.constructor&&(rt=tt.constructor.name),rt==="Map"||rt==="Set")return Array.from(tt);if(rt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(rt))return _arrayLikeToArray(tt,et)}}function _arrayLikeToArray(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var rt=0,st=new Array(et);rt<et;rt++)st[rt]=tt[rt];return st}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1393
|
+
`)},domwindow(){return st("domwindow")},bigint(nt){return st("bigint:"+nt.toString())},process(){return st("process")},timer(){return st("timer")},pipe(){return st("pipe")},tcp(){return st("tcp")},udp(){return st("udp")},tty(){return st("tty")},statwatcher(){return st("statwatcher")},securecontext(){return st("securecontext")},connection(){return st("connection")},zlib(){return st("zlib")},context(){return st("context")},nodescript(){return st("nodescript")},httpparser(){return st("httpparser")},dataview(){return st("dataview")},signal(){return st("signal")},fsevent(){return st("fsevent")},tlswrap(){return st("tlswrap")}}}const nativeFunc="[native code] }",nativeFuncLength=nativeFunc.length;function isNativeFunction(tt){return typeof tt!="function"?!1:Function.prototype.toString.call(tt).slice(-nativeFuncLength)===nativeFunc}class WordArray{constructor(et,rt){et=this.words=et||[],this.sigBytes=rt===void 0?et.length*4:rt}toString(et){return(et||Hex).stringify(this)}concat(et){if(this.clamp(),this.sigBytes%4)for(let rt=0;rt<et.sigBytes;rt++){const st=et.words[rt>>>2]>>>24-rt%4*8&255;this.words[this.sigBytes+rt>>>2]|=st<<24-(this.sigBytes+rt)%4*8}else for(let rt=0;rt<et.sigBytes;rt+=4)this.words[this.sigBytes+rt>>>2]=et.words[rt>>>2];return this.sigBytes+=et.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new WordArray([...this.words])}}const Hex={stringify(tt){const et=[];for(let rt=0;rt<tt.sigBytes;rt++){const st=tt.words[rt>>>2]>>>24-rt%4*8&255;et.push((st>>>4).toString(16),(st&15).toString(16))}return et.join("")}},Base64={stringify(tt){const et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",rt=[];for(let st=0;st<tt.sigBytes;st+=3){const nt=tt.words[st>>>2]>>>24-st%4*8&255,ot=tt.words[st+1>>>2]>>>24-(st+1)%4*8&255,at=tt.words[st+2>>>2]>>>24-(st+2)%4*8&255,lt=nt<<16|ot<<8|at;for(let ut=0;ut<4&&st*8+ut*6<tt.sigBytes*8;ut++)rt.push(et.charAt(lt>>>6*(3-ut)&63))}return rt.join("")}},Latin1={parse(tt){const et=tt.length,rt=[];for(let st=0;st<et;st++)rt[st>>>2]|=(tt.charCodeAt(st)&255)<<24-st%4*8;return new WordArray(rt,et)}},Utf8={parse(tt){return Latin1.parse(unescape(encodeURIComponent(tt)))}};class BufferedBlockAlgorithm{constructor(){this._data=new WordArray,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=512/32}reset(){this._data=new WordArray,this._nDataBytes=0}_append(et){typeof et=="string"&&(et=Utf8.parse(et)),this._data.concat(et),this._nDataBytes+=et.sigBytes}_doProcessBlock(et,rt){}_process(et){let rt,st=this._data.sigBytes/(this.blockSize*4);et?st=Math.ceil(st):st=Math.max((st|0)-this._minBufferSize,0);const nt=st*this.blockSize,ot=Math.min(nt*4,this._data.sigBytes);if(nt){for(let at=0;at<nt;at+=this.blockSize)this._doProcessBlock(this._data.words,at);rt=this._data.words.splice(0,nt),this._data.sigBytes-=ot}return new WordArray(rt,ot)}}class Hasher extends BufferedBlockAlgorithm{update(et){return this._append(et),this._process(),this}finalize(et){et&&this._append(et)}}const H=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],K=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],W=[];class SHA256 extends Hasher{constructor(){super(...arguments),this._hash=new WordArray([...H])}reset(){super.reset(),this._hash=new WordArray([...H])}_doProcessBlock(et,rt){const st=this._hash.words;let nt=st[0],ot=st[1],at=st[2],lt=st[3],ut=st[4],ct=st[5],dt=st[6],ht=st[7];for(let ft=0;ft<64;ft++){if(ft<16)W[ft]=et[rt+ft]|0;else{const St=W[ft-15],Rt=(St<<25|St>>>7)^(St<<14|St>>>18)^St>>>3,Ct=W[ft-2],Pt=(Ct<<15|Ct>>>17)^(Ct<<13|Ct>>>19)^Ct>>>10;W[ft]=Rt+W[ft-7]+Pt+W[ft-16]}const xt=ut&ct^~ut&dt,yt=nt&ot^nt&at^ot&at,vt=(nt<<30|nt>>>2)^(nt<<19|nt>>>13)^(nt<<10|nt>>>22),Et=(ut<<26|ut>>>6)^(ut<<21|ut>>>11)^(ut<<7|ut>>>25),bt=ht+Et+xt+K[ft]+W[ft],wt=vt+yt;ht=dt,dt=ct,ct=ut,ut=lt+bt|0,lt=at,at=ot,ot=nt,nt=bt+wt|0}st[0]=st[0]+nt|0,st[1]=st[1]+ot|0,st[2]=st[2]+at|0,st[3]=st[3]+lt|0,st[4]=st[4]+ut|0,st[5]=st[5]+ct|0,st[6]=st[6]+dt|0,st[7]=st[7]+ht|0}finalize(et){super.finalize(et);const rt=this._nDataBytes*8,st=this._data.sigBytes*8;return this._data.words[st>>>5]|=128<<24-st%32,this._data.words[(st+64>>>9<<4)+14]=Math.floor(rt/4294967296),this._data.words[(st+64>>>9<<4)+15]=rt,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function sha256base64(tt){return new SHA256().finalize(tt).toString(Base64)}function hash(tt,et={}){const rt=typeof tt=="string"?tt:objectHash(tt,et);return sha256base64(rt).slice(0,10)}var slugify$1={};Object.defineProperty(slugify$1,"__esModule",{value:!0});const stripAccents=tt=>{const et="ÀÁÂÃÄÅĄĀàáâãäåąāÒÓÔÕÕÖØòóôõöøÈÉÊËĘĒèéêëðęēÇĆČçćčÐÌÍÎÏĪìíîïīÙÚÛÜŪùúûüūÑŅñņŠŚšśŸÿýŽŹŻžźżŁĻłļŃŅńņàáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîüûñçýỳỹỵỷğışĞİŞĢģĶķ",rt="AAAAAAAAaaaaaaaaOOOOOOOooooooEEEEEEeeeeeeeCCCcccDIIIIIiiiiiUUUUUuuuuuNNnnSSssYyyZZZzzzLLllNNnnaaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiuuncyyyyygisGISGgKk",st=et.split("").join("|"),nt=new RegExp(`(${st})`,"g");function ot(at){return rt[et.indexOf(at)]||""}return tt.replace(nt,ot)},getSafeRegexpString=tt=>tt.split("").map(et=>`\\${et}`).join(""),harmonize=(tt,et,rt=!1)=>{const st=stripAccents(tt).trim().toLowerCase(),nt=getSafeRegexpString(et);return rt?st.replace(/\s+/g,et):st.replace(new RegExp(`[^a-z0-9${nt}]+`,"g"),et).replace(new RegExp(`${nt}+`,"g"),et).replace(new RegExp(`^${nt}`,"g"),"").replace(new RegExp(`${nt}$`,"g"),"")},slugify=(tt,et={delimiter:"-",prefix:""})=>{if(et.delimiter||(et.delimiter="-"),et.prefix||(et.prefix=""),!tt||typeof tt=="boolean")return"";const{delimiter:rt,prefix:st}=et;if(typeof tt=="boolean")return"";if(typeof tt=="string"||typeof tt=="number"){const nt=harmonize(st,rt,!0),ot=harmonize(String(tt),rt);return nt?`${nt}${rt}${ot}`:ot}return"children"in tt?slugify(tt.children):"type"in tt?slugify(tt.props.children,et):Symbol.iterator in tt?slugify(Array.from(tt).map(nt=>slugify(nt,{delimiter:rt})).join(rt),et):""};var _default=slugify$1.default=slugify;const useSlug=({watch:tt,setValue:et,selectedResource:rt})=>{const[st,nt]=reactExports.useState(""),[ot,at]=reactExports.useState((rt==null?void 0:rt.public)||!1),lt=reactExports.useId(),ut=tt("title"),{t:ct}=useTranslation(),dt=useToast();reactExports.useEffect(()=>{if(ot){let xt="";rt?xt=rt.slug?rt.slug:`${hash({foo:`${ut}${lt}`})}-${_default(ut)}`:xt=`${hash({foo:`${ut}${lt}`})}-${_default(ut)}`,et("formSlug",xt),nt(xt)}},[ot,ut]);function ht(xt){at(xt)}function ft(xt){navigator.clipboard.writeText(`${window.location.origin}${xt||window.location.pathname}/pub/${st}`),dt.success(ct("explorer.copy.clipboard"))}return{slug:st,uniqueId:lt,isPublic:ot,resourceName:ut,onPublicChange:ht,onCopyToClipBoard:ft}},BlogPublic=({appCode:tt,isUpdating:et,resource:rt,watch:st,register:nt,setValue:ot})=>{const{t:at}=useTranslation(),{slug:lt,isPublic:ut,resourceName:ct,onPublicChange:dt,onCopyToClipBoard:ht}=useSlug({watch:st,setValue:ot,selectedResource:et?rt:void 0});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:[at("explorer.resource.editModal.heading.access"),tt]}),jsxRuntimeExports.jsx(Alert,{type:"info",children:at("explorer.resource.editModal.access.alert")}),jsxRuntimeExports.jsxs(FormControl,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[jsxRuntimeExports.jsx(FormControl.Input,{type:"checkbox",role:"switch",defaultChecked:et?rt.public:!1,...nt("enablePublic",{disabled:!ct,onChange:ft=>{const xt=ft.target.checked;dt(xt)}}),className:"form-check-input mt-0",size:"md"}),jsxRuntimeExports.jsx(FormControl.Label,{className:"form-check-label mb-0",children:at("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),ut&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FormControl,{id:"formSlug",children:jsxRuntimeExports.jsx(Input,{type:"text",hidden:!0,defaultValue:et?lt:"",...nt("formSlug"),size:"sm"})},lt),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[jsxRuntimeExports.jsxs("p",{className:"text-break",children:[window.location.origin,"/blog/pub/",lt]}),jsxRuntimeExports.jsx(Button,{color:"primary",disabled:!ut,onClick:()=>ht("/blog"),type:"button",leftIcon:jsxRuntimeExports.jsx(SvgIconCopy,{}),variant:"ghost",className:"text-nowrap",children:at("explorer.resource.editModal.access.url.button")})]})]})]})};var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(tt){return this.listeners.add(tt),this.onSubscribe(),()=>{this.listeners.delete(tt),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$1(){}function functionalUpdate(tt,et){return typeof tt=="function"?tt(et):tt}function isValidTimeout(tt){return typeof tt=="number"&&tt>=0&&tt!==1/0}function timeUntilStale(tt,et){return Math.max(tt+(et||0)-Date.now(),0)}function resolveStaleTime(tt,et){return typeof tt=="function"?tt(et):tt}function resolveEnabled(tt,et){return typeof tt=="function"?tt(et):tt}function matchQuery(tt,et){const{type:rt="all",exact:st,fetchStatus:nt,predicate:ot,queryKey:at,stale:lt}=tt;if(at){if(st){if(et.queryHash!==hashQueryKeyByOptions(at,et.options))return!1}else if(!partialMatchKey(et.queryKey,at))return!1}if(rt!=="all"){const ut=et.isActive();if(rt==="active"&&!ut||rt==="inactive"&&ut)return!1}return!(typeof lt=="boolean"&&et.isStale()!==lt||nt&&nt!==et.state.fetchStatus||ot&&!ot(et))}function matchMutation(tt,et){const{exact:rt,status:st,predicate:nt,mutationKey:ot}=tt;if(ot){if(!et.options.mutationKey)return!1;if(rt){if(hashKey(et.options.mutationKey)!==hashKey(ot))return!1}else if(!partialMatchKey(et.options.mutationKey,ot))return!1}return!(st&&et.state.status!==st||nt&&!nt(et))}function hashQueryKeyByOptions(tt,et){return((et==null?void 0:et.queryKeyHashFn)||hashKey)(tt)}function hashKey(tt){return JSON.stringify(tt,(et,rt)=>isPlainObject(rt)?Object.keys(rt).sort().reduce((st,nt)=>(st[nt]=rt[nt],st),{}):rt)}function partialMatchKey(tt,et){return tt===et?!0:typeof tt!=typeof et?!1:tt&&et&&typeof tt=="object"&&typeof et=="object"?!Object.keys(et).some(rt=>!partialMatchKey(tt[rt],et[rt])):!1}function replaceEqualDeep(tt,et){if(tt===et)return tt;const rt=isPlainArray(tt)&&isPlainArray(et);if(rt||isPlainObject(tt)&&isPlainObject(et)){const st=rt?tt:Object.keys(tt),nt=st.length,ot=rt?et:Object.keys(et),at=ot.length,lt=rt?[]:{};let ut=0;for(let ct=0;ct<at;ct++){const dt=rt?ct:ot[ct];(!rt&&st.includes(dt)||rt)&&tt[dt]===void 0&&et[dt]===void 0?(lt[dt]=void 0,ut++):(lt[dt]=replaceEqualDeep(tt[dt],et[dt]),lt[dt]===tt[dt]&&tt[dt]!==void 0&&ut++)}return nt===at&&ut===nt?tt:lt}return et}function shallowEqualObjects(tt,et){if(!et||Object.keys(tt).length!==Object.keys(et).length)return!1;for(const rt in tt)if(tt[rt]!==et[rt])return!1;return!0}function isPlainArray(tt){return Array.isArray(tt)&&tt.length===Object.keys(tt).length}function isPlainObject(tt){if(!hasObjectPrototype(tt))return!1;const et=tt.constructor;if(et===void 0)return!0;const rt=et.prototype;return!(!hasObjectPrototype(rt)||!rt.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(tt)!==Object.prototype)}function hasObjectPrototype(tt){return Object.prototype.toString.call(tt)==="[object Object]"}function sleep(tt){return new Promise(et=>{setTimeout(et,tt)})}function replaceData(tt,et,rt){return typeof rt.structuralSharing=="function"?rt.structuralSharing(tt,et):rt.structuralSharing!==!1?replaceEqualDeep(tt,et):et}function addToEnd(tt,et,rt=0){const st=[...tt,et];return rt&&st.length>rt?st.slice(1):st}function addToStart(tt,et,rt=0){const st=[et,...tt];return rt&&st.length>rt?st.slice(0,-1):st}var skipToken=Symbol();function ensureQueryFn(tt,et){return!tt.queryFn&&(et!=null&&et.initialPromise)?()=>et.initialPromise:!tt.queryFn||tt.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${tt.queryHash}'`)):tt.queryFn}var xl,Bo,Yl,Wp,FocusManager=(Wp=class extends Subscribable{constructor(){super();kr(this,xl);kr(this,Bo);kr(this,Yl);Rr(this,Yl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et();return window.addEventListener("visibilitychange",rt,!1),()=>{window.removeEventListener("visibilitychange",rt)}}})}onSubscribe(){Kt(this,Bo)||this.setEventListener(Kt(this,Yl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Bo))==null||et.call(this),Rr(this,Bo,void 0))}setEventListener(et){var rt;Rr(this,Yl,et),(rt=Kt(this,Bo))==null||rt.call(this),Rr(this,Bo,et(st=>{typeof st=="boolean"?this.setFocused(st):this.onFocus()}))}setFocused(et){Kt(this,xl)!==et&&(Rr(this,xl,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(rt=>{rt(et)})}isFocused(){var et;return typeof Kt(this,xl)=="boolean"?Kt(this,xl):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},xl=new WeakMap,Bo=new WeakMap,Yl=new WeakMap,Wp),focusManager=new FocusManager,Kl,zo,Ql,qp,OnlineManager=(qp=class extends Subscribable{constructor(){super();kr(this,Kl,!0);kr(this,zo);kr(this,Ql);Rr(this,Ql,et=>{if(!isServer&&window.addEventListener){const rt=()=>et(!0),st=()=>et(!1);return window.addEventListener("online",rt,!1),window.addEventListener("offline",st,!1),()=>{window.removeEventListener("online",rt),window.removeEventListener("offline",st)}}})}onSubscribe(){Kt(this,zo)||this.setEventListener(Kt(this,Ql))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,zo))==null||et.call(this),Rr(this,zo,void 0))}setEventListener(et){var rt;Rr(this,Ql,et),(rt=Kt(this,zo))==null||rt.call(this),Rr(this,zo,et(this.setOnline.bind(this)))}setOnline(et){Kt(this,Kl)!==et&&(Rr(this,Kl,et),this.listeners.forEach(st=>{st(et)}))}isOnline(){return Kt(this,Kl)}},Kl=new WeakMap,zo=new WeakMap,Ql=new WeakMap,qp),onlineManager=new OnlineManager;function pendingThenable(){let tt,et;const rt=new Promise((nt,ot)=>{tt=nt,et=ot});rt.status="pending",rt.catch(()=>{});function st(nt){Object.assign(rt,nt),delete rt.resolve,delete rt.reject}return rt.resolve=nt=>{st({status:"fulfilled",value:nt}),tt(nt)},rt.reject=nt=>{st({status:"rejected",reason:nt}),et(nt)},rt}function defaultRetryDelay(tt){return Math.min(1e3*2**tt,3e4)}function canFetch(tt){return(tt??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(tt){super("CancelledError"),this.revert=tt==null?void 0:tt.revert,this.silent=tt==null?void 0:tt.silent}};function isCancelledError(tt){return tt instanceof CancelledError}function createRetryer(tt){let et=!1,rt=0,st=!1,nt;const ot=pendingThenable(),at=vt=>{var Et;st||(ft(new CancelledError(vt)),(Et=tt.abort)==null||Et.call(tt))},lt=()=>{et=!0},ut=()=>{et=!1},ct=()=>focusManager.isFocused()&&(tt.networkMode==="always"||onlineManager.isOnline())&&tt.canRun(),dt=()=>canFetch(tt.networkMode)&&tt.canRun(),ht=vt=>{var Et;st||(st=!0,(Et=tt.onSuccess)==null||Et.call(tt,vt),nt==null||nt(),ot.resolve(vt))},ft=vt=>{var Et;st||(st=!0,(Et=tt.onError)==null||Et.call(tt,vt),nt==null||nt(),ot.reject(vt))},xt=()=>new Promise(vt=>{var Et;nt=bt=>{(st||ct())&&vt(bt)},(Et=tt.onPause)==null||Et.call(tt)}).then(()=>{var vt;nt=void 0,st||(vt=tt.onContinue)==null||vt.call(tt)}),yt=()=>{if(st)return;let vt;const Et=rt===0?tt.initialPromise:void 0;try{vt=Et??tt.fn()}catch(bt){vt=Promise.reject(bt)}Promise.resolve(vt).then(ht).catch(bt=>{var Pt;if(st)return;const wt=tt.retry??(isServer?0:3),St=tt.retryDelay??defaultRetryDelay,Rt=typeof St=="function"?St(rt,bt):St,Ct=wt===!0||typeof wt=="number"&&rt<wt||typeof wt=="function"&&wt(rt,bt);if(et||!Ct){ft(bt);return}rt++,(Pt=tt.onFail)==null||Pt.call(tt,rt,bt),sleep(Rt).then(()=>ct()?void 0:xt()).then(()=>{et?ft(bt):yt()})})};return{promise:ot,cancel:at,continue:()=>(nt==null||nt(),ot),cancelRetry:lt,continueRetry:ut,canStart:dt,start:()=>(dt()?yt():xt().then(yt),ot)}}function createNotifyManager(){let tt=[],et=0,rt=lt=>{lt()},st=lt=>{lt()},nt=lt=>setTimeout(lt,0);const ot=lt=>{et?tt.push(lt):nt(()=>{rt(lt)})},at=()=>{const lt=tt;tt=[],lt.length&&nt(()=>{st(()=>{lt.forEach(ut=>{rt(ut)})})})};return{batch:lt=>{let ut;et++;try{ut=lt()}finally{et--,et||at()}return ut},batchCalls:lt=>(...ut)=>{ot(()=>{lt(...ut)})},schedule:ot,setNotifyFunction:lt=>{rt=lt},setBatchNotifyFunction:lt=>{st=lt},setScheduler:lt=>{nt=lt}}}var notifyManager=createNotifyManager(),yl,Xp,Removable=(Xp=class{constructor(){kr(this,yl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&Rr(this,yl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(tt){this.gcTime=Math.max(this.gcTime||0,tt??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Kt(this,yl)&&(clearTimeout(Kt(this,yl)),Rr(this,yl,void 0))}},yl=new WeakMap,Xp),Zl,Jl,Un,Ps,Ou,El,Qn,Ro,Yp,Query=(Yp=class extends Removable{constructor(et){super();kr(this,Qn);kr(this,Zl);kr(this,Jl);kr(this,Un);kr(this,Ps);kr(this,Ou);kr(this,El);Rr(this,El,!1),Rr(this,Ou,et.defaultOptions),this.setOptions(et.options),this.observers=[],Rr(this,Un,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,Rr(this,Zl,getDefaultState$1(this.options)),this.state=et.state??Kt(this,Zl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Kt(this,Ps))==null?void 0:et.promise}setOptions(et){this.options={...Kt(this,Ou),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Kt(this,Un).remove(this)}setData(et,rt){const st=replaceData(this.state.data,et,this.options);return Nr(this,Qn,Ro).call(this,{data:st,type:"success",dataUpdatedAt:rt==null?void 0:rt.updatedAt,manual:rt==null?void 0:rt.manual}),st}setState(et,rt){Nr(this,Qn,Ro).call(this,{type:"setState",state:et,setStateOptions:rt})}cancel(et){var st,nt;const rt=(st=Kt(this,Ps))==null?void 0:st.promise;return(nt=Kt(this,Ps))==null||nt.cancel(et),rt?rt.then(noop$1).catch(noop$1):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Kt(this,Zl))}isActive(){return this.observers.some(et=>resolveEnabled(et.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(et=>et.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(et=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,et)}onFocus(){var rt;const et=this.observers.find(st=>st.shouldFetchOnWindowFocus());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,Ps))==null||rt.continue()}onOnline(){var rt;const et=this.observers.find(st=>st.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,Ps))==null||rt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Kt(this,Un).notify({type:"observerAdded",query:this,observer:et}))}removeObserver(et){this.observers.includes(et)&&(this.observers=this.observers.filter(rt=>rt!==et),this.observers.length||(Kt(this,Ps)&&(Kt(this,El)?Kt(this,Ps).cancel({revert:!0}):Kt(this,Ps).cancelRetry()),this.scheduleGc()),Kt(this,Un).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Nr(this,Qn,Ro).call(this,{type:"invalidate"})}fetch(et,rt){var ut,ct,dt;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(rt!=null&&rt.cancelRefetch))this.cancel({silent:!0});else if(Kt(this,Ps))return Kt(this,Ps).continueRetry(),Kt(this,Ps).promise}if(et&&this.setOptions(et),!this.options.queryFn){const ht=this.observers.find(ft=>ft.options.queryFn);ht&&this.setOptions(ht.options)}const st=new AbortController,nt=ht=>{Object.defineProperty(ht,"signal",{enumerable:!0,get:()=>(Rr(this,El,!0),st.signal)})},ot=()=>{const ht=ensureQueryFn(this.options,rt),ft={queryKey:this.queryKey,meta:this.meta};return nt(ft),Rr(this,El,!1),this.options.persister?this.options.persister(ht,ft,this):ht(ft)},at={fetchOptions:rt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};nt(at),(ut=this.options.behavior)==null||ut.onFetch(at,this),Rr(this,Jl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=at.fetchOptions)==null?void 0:ct.meta))&&Nr(this,Qn,Ro).call(this,{type:"fetch",meta:(dt=at.fetchOptions)==null?void 0:dt.meta});const lt=ht=>{var ft,xt,yt,vt;isCancelledError(ht)&&ht.silent||Nr(this,Qn,Ro).call(this,{type:"error",error:ht}),isCancelledError(ht)||((xt=(ft=Kt(this,Un).config).onError)==null||xt.call(ft,ht,this),(vt=(yt=Kt(this,Un).config).onSettled)==null||vt.call(yt,this.state.data,ht,this)),this.scheduleGc()};return Rr(this,Ps,createRetryer({initialPromise:rt==null?void 0:rt.initialPromise,fn:at.fetchFn,abort:st.abort.bind(st),onSuccess:ht=>{var ft,xt,yt,vt;if(ht===void 0){lt(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(ht)}catch(Et){lt(Et);return}(xt=(ft=Kt(this,Un).config).onSuccess)==null||xt.call(ft,ht,this),(vt=(yt=Kt(this,Un).config).onSettled)==null||vt.call(yt,ht,this.state.error,this),this.scheduleGc()},onError:lt,onFail:(ht,ft)=>{Nr(this,Qn,Ro).call(this,{type:"failed",failureCount:ht,error:ft})},onPause:()=>{Nr(this,Qn,Ro).call(this,{type:"pause"})},onContinue:()=>{Nr(this,Qn,Ro).call(this,{type:"continue"})},retry:at.options.retry,retryDelay:at.options.retryDelay,networkMode:at.options.networkMode,canRun:()=>!0})),Kt(this,Ps).start()}},Zl=new WeakMap,Jl=new WeakMap,Un=new WeakMap,Ps=new WeakMap,Ou=new WeakMap,El=new WeakMap,Qn=new WeakSet,Ro=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,fetchFailureCount:et.failureCount,fetchFailureReason:et.error};case"pause":return{...st,fetchStatus:"paused"};case"continue":return{...st,fetchStatus:"fetching"};case"fetch":return{...st,...fetchState(st.data,this.options),fetchMeta:et.meta??null};case"success":return{...st,data:et.data,dataUpdateCount:st.dataUpdateCount+1,dataUpdatedAt:et.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!et.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const nt=et.error;return isCancelledError(nt)&&nt.revert&&Kt(this,Jl)?{...Kt(this,Jl),fetchStatus:"idle"}:{...st,error:nt,errorUpdateCount:st.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:st.fetchFailureCount+1,fetchFailureReason:nt,fetchStatus:"idle",status:"error"};case"invalidate":return{...st,isInvalidated:!0};case"setState":return{...st,...et.state}}};this.state=rt(this.state),notifyManager.batch(()=>{this.observers.forEach(st=>{st.onQueryUpdate()}),Kt(this,Un).notify({query:this,type:"updated",action:et})})},Yp);function fetchState(tt,et){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(et.networkMode)?"fetching":"paused",...tt===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(tt){const et=typeof tt.initialData=="function"?tt.initialData():tt.initialData,rt=et!==void 0,st=rt?typeof tt.initialDataUpdatedAt=="function"?tt.initialDataUpdatedAt():tt.initialDataUpdatedAt:0;return{data:et,dataUpdateCount:0,dataUpdatedAt:rt?st??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:rt?"success":"pending",fetchStatus:"idle"}}var po,Kp,QueryCache=(Kp=class extends Subscribable{constructor(et={}){super();kr(this,po);this.config=et,Rr(this,po,new Map)}build(et,rt,st){const nt=rt.queryKey,ot=rt.queryHash??hashQueryKeyByOptions(nt,rt);let at=this.get(ot);return at||(at=new Query({cache:this,queryKey:nt,queryHash:ot,options:et.defaultQueryOptions(rt),state:st,defaultOptions:et.getQueryDefaults(nt)}),this.add(at)),at}add(et){Kt(this,po).has(et.queryHash)||(Kt(this,po).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const rt=Kt(this,po).get(et.queryHash);rt&&(et.destroy(),rt===et&&Kt(this,po).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Kt(this,po).get(et)}getAll(){return[...Kt(this,po).values()]}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchQuery(rt,st))}findAll(et={}){const rt=this.getAll();return Object.keys(et).length>0?rt.filter(st=>matchQuery(et,st)):rt}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onOnline()})})}},po=new WeakMap,Kp),mo,$s,wl,go,Fo,Qp,Mutation=(Qp=class extends Removable{constructor(et){super();kr(this,go);kr(this,mo);kr(this,$s);kr(this,wl);this.mutationId=et.mutationId,Rr(this,$s,et.mutationCache),Rr(this,mo,[]),this.state=et.state||getDefaultState(),this.setOptions(et.options),this.scheduleGc()}setOptions(et){this.options=et,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(et){Kt(this,mo).includes(et)||(Kt(this,mo).push(et),this.clearGcTimeout(),Kt(this,$s).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){Rr(this,mo,Kt(this,mo).filter(rt=>rt!==et)),this.scheduleGc(),Kt(this,$s).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Kt(this,mo).length||(this.state.status==="pending"?this.scheduleGc():Kt(this,$s).remove(this))}continue(){var et;return((et=Kt(this,wl))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var nt,ot,at,lt,ut,ct,dt,ht,ft,xt,yt,vt,Et,bt,wt,St,Rt,Ct,Pt,It;Rr(this,wl,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(jt,Dt)=>{Nr(this,go,Fo).call(this,{type:"failed",failureCount:jt,error:Dt})},onPause:()=>{Nr(this,go,Fo).call(this,{type:"pause"})},onContinue:()=>{Nr(this,go,Fo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Kt(this,$s).canRun(this)}));const rt=this.state.status==="pending",st=!Kt(this,wl).canStart();try{if(!rt){Nr(this,go,Fo).call(this,{type:"pending",variables:et,isPaused:st}),await((ot=(nt=Kt(this,$s).config).onMutate)==null?void 0:ot.call(nt,et,this));const Dt=await((lt=(at=this.options).onMutate)==null?void 0:lt.call(at,et));Dt!==this.state.context&&Nr(this,go,Fo).call(this,{type:"pending",context:Dt,variables:et,isPaused:st})}const jt=await Kt(this,wl).start();return await((ct=(ut=Kt(this,$s).config).onSuccess)==null?void 0:ct.call(ut,jt,et,this.state.context,this)),await((ht=(dt=this.options).onSuccess)==null?void 0:ht.call(dt,jt,et,this.state.context)),await((xt=(ft=Kt(this,$s).config).onSettled)==null?void 0:xt.call(ft,jt,null,this.state.variables,this.state.context,this)),await((vt=(yt=this.options).onSettled)==null?void 0:vt.call(yt,jt,null,et,this.state.context)),Nr(this,go,Fo).call(this,{type:"success",data:jt}),jt}catch(jt){try{throw await((bt=(Et=Kt(this,$s).config).onError)==null?void 0:bt.call(Et,jt,et,this.state.context,this)),await((St=(wt=this.options).onError)==null?void 0:St.call(wt,jt,et,this.state.context)),await((Ct=(Rt=Kt(this,$s).config).onSettled)==null?void 0:Ct.call(Rt,void 0,jt,this.state.variables,this.state.context,this)),await((It=(Pt=this.options).onSettled)==null?void 0:It.call(Pt,void 0,jt,et,this.state.context)),jt}finally{Nr(this,go,Fo).call(this,{type:"error",error:jt})}}finally{Kt(this,$s).runNext(this)}}},mo=new WeakMap,$s=new WeakMap,wl=new WeakMap,go=new WeakSet,Fo=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,failureCount:et.failureCount,failureReason:et.error};case"pause":return{...st,isPaused:!0};case"continue":return{...st,isPaused:!1};case"pending":return{...st,context:et.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:et.isPaused,status:"pending",variables:et.variables,submittedAt:Date.now()};case"success":return{...st,data:et.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...st,data:void 0,error:et.error,failureCount:st.failureCount+1,failureReason:et.error,isPaused:!1,status:"error"}}};this.state=rt(this.state),notifyManager.batch(()=>{Kt(this,mo).forEach(st=>{st.onMutationUpdate(et)}),Kt(this,$s).notify({mutation:this,type:"updated",action:et})})},Qp);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Xs,Du,Zp,MutationCache=(Zp=class extends Subscribable{constructor(et={}){super();kr(this,Xs);kr(this,Du);this.config=et,Rr(this,Xs,new Map),Rr(this,Du,Date.now())}build(et,rt,st){const nt=new Mutation({mutationCache:this,mutationId:++R1(this,Du)._,options:et.defaultMutationOptions(rt),state:st});return this.add(nt),nt}add(et){const rt=scopeFor(et),st=Kt(this,Xs).get(rt)??[];st.push(et),Kt(this,Xs).set(rt,st),this.notify({type:"added",mutation:et})}remove(et){var st;const rt=scopeFor(et);if(Kt(this,Xs).has(rt)){const nt=(st=Kt(this,Xs).get(rt))==null?void 0:st.filter(ot=>ot!==et);nt&&(nt.length===0?Kt(this,Xs).delete(rt):Kt(this,Xs).set(rt,nt))}this.notify({type:"removed",mutation:et})}canRun(et){var st;const rt=(st=Kt(this,Xs).get(scopeFor(et)))==null?void 0:st.find(nt=>nt.state.status==="pending");return!rt||rt===et}runNext(et){var st;const rt=(st=Kt(this,Xs).get(scopeFor(et)))==null?void 0:st.find(nt=>nt!==et&&nt.state.isPaused);return(rt==null?void 0:rt.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}getAll(){return[...Kt(this,Xs).values()].flat()}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchMutation(rt,st))}findAll(et={}){return this.getAll().filter(rt=>matchMutation(et,rt))}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}resumePausedMutations(){const et=this.getAll().filter(rt=>rt.state.isPaused);return notifyManager.batch(()=>Promise.all(et.map(rt=>rt.continue().catch(noop$1))))}},Xs=new WeakMap,Du=new WeakMap,Zp);function scopeFor(tt){var et;return((et=tt.options.scope)==null?void 0:et.id)??String(tt.mutationId)}function infiniteQueryBehavior(tt){return{onFetch:(et,rt)=>{var dt,ht,ft,xt,yt;const st=et.options,nt=(ft=(ht=(dt=et.fetchOptions)==null?void 0:dt.meta)==null?void 0:ht.fetchMore)==null?void 0:ft.direction,ot=((xt=et.state.data)==null?void 0:xt.pages)||[],at=((yt=et.state.data)==null?void 0:yt.pageParams)||[];let lt={pages:[],pageParams:[]},ut=0;const ct=async()=>{let vt=!1;const Et=St=>{Object.defineProperty(St,"signal",{enumerable:!0,get:()=>(et.signal.aborted?vt=!0:et.signal.addEventListener("abort",()=>{vt=!0}),et.signal)})},bt=ensureQueryFn(et.options,et.fetchOptions),wt=async(St,Rt,Ct)=>{if(vt)return Promise.reject();if(Rt==null&&St.pages.length)return Promise.resolve(St);const Pt={queryKey:et.queryKey,pageParam:Rt,direction:Ct?"backward":"forward",meta:et.options.meta};Et(Pt);const It=await bt(Pt),{maxPages:jt}=et.options,Dt=Ct?addToStart:addToEnd;return{pages:Dt(St.pages,It,jt),pageParams:Dt(St.pageParams,Rt,jt)}};if(nt&&ot.length){const St=nt==="backward",Rt=St?getPreviousPageParam:getNextPageParam,Ct={pages:ot,pageParams:at},Pt=Rt(st,Ct);lt=await wt(Ct,Pt,St)}else{const St=tt??ot.length;do{const Rt=ut===0?at[0]??st.initialPageParam:getNextPageParam(st,lt);if(ut>0&&Rt==null)break;lt=await wt(lt,Rt),ut++}while(ut<St)}return lt};et.options.persister?et.fetchFn=()=>{var vt,Et;return(Et=(vt=et.options).persister)==null?void 0:Et.call(vt,ct,{queryKey:et.queryKey,meta:et.options.meta,signal:et.signal},rt)}:et.fetchFn=ct}}}function getNextPageParam(tt,{pages:et,pageParams:rt}){const st=et.length-1;return et.length>0?tt.getNextPageParam(et[st],et,rt[st],rt):void 0}function getPreviousPageParam(tt,{pages:et,pageParams:rt}){var st;return et.length>0?(st=tt.getPreviousPageParam)==null?void 0:st.call(tt,et[0],et,rt[0],rt):void 0}function hasNextPage(tt,et){return et?getNextPageParam(tt,et)!=null:!1}function hasPreviousPage(tt,et){return!et||!tt.getPreviousPageParam?!1:getPreviousPageParam(tt,et)!=null}var ls,Uo,Ho,eu,tu,Vo,ru,su,Jp,QueryClient=(Jp=class{constructor(tt={}){kr(this,ls);kr(this,Uo);kr(this,Ho);kr(this,eu);kr(this,tu);kr(this,Vo);kr(this,ru);kr(this,su);Rr(this,ls,tt.queryCache||new QueryCache),Rr(this,Uo,tt.mutationCache||new MutationCache),Rr(this,Ho,tt.defaultOptions||{}),Rr(this,eu,new Map),Rr(this,tu,new Map),Rr(this,Vo,0)}mount(){R1(this,Vo)._++,Kt(this,Vo)===1&&(Rr(this,ru,focusManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,ls).onFocus())})),Rr(this,su,onlineManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,ls).onOnline())})))}unmount(){var tt,et;R1(this,Vo)._--,Kt(this,Vo)===0&&((tt=Kt(this,ru))==null||tt.call(this),Rr(this,ru,void 0),(et=Kt(this,su))==null||et.call(this),Rr(this,su,void 0))}isFetching(tt){return Kt(this,ls).findAll({...tt,fetchStatus:"fetching"}).length}isMutating(tt){return Kt(this,Uo).findAll({...tt,status:"pending"}).length}getQueryData(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,ls).get(et.queryHash))==null?void 0:rt.state.data}ensureQueryData(tt){const et=this.defaultQueryOptions(tt),rt=Kt(this,ls).build(this,et),st=rt.state.data;return st===void 0?this.fetchQuery(tt):(tt.revalidateIfStale&&rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))&&this.prefetchQuery(et),Promise.resolve(st))}getQueriesData(tt){return Kt(this,ls).findAll(tt).map(({queryKey:et,state:rt})=>{const st=rt.data;return[et,st]})}setQueryData(tt,et,rt){const st=this.defaultQueryOptions({queryKey:tt}),nt=Kt(this,ls).get(st.queryHash),ot=nt==null?void 0:nt.state.data,at=functionalUpdate(et,ot);if(at!==void 0)return Kt(this,ls).build(this,st).setData(at,{...rt,manual:!0})}setQueriesData(tt,et,rt){return notifyManager.batch(()=>Kt(this,ls).findAll(tt).map(({queryKey:st})=>[st,this.setQueryData(st,et,rt)]))}getQueryState(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,ls).get(et.queryHash))==null?void 0:rt.state}removeQueries(tt){const et=Kt(this,ls);notifyManager.batch(()=>{et.findAll(tt).forEach(rt=>{et.remove(rt)})})}resetQueries(tt,et){const rt=Kt(this,ls),st={type:"active",...tt};return notifyManager.batch(()=>(rt.findAll(tt).forEach(nt=>{nt.reset()}),this.refetchQueries(st,et)))}cancelQueries(tt,et={}){const rt={revert:!0,...et},st=notifyManager.batch(()=>Kt(this,ls).findAll(tt).map(nt=>nt.cancel(rt)));return Promise.all(st).then(noop$1).catch(noop$1)}invalidateQueries(tt,et={}){return notifyManager.batch(()=>{if(Kt(this,ls).findAll(tt).forEach(st=>{st.invalidate()}),(tt==null?void 0:tt.refetchType)==="none")return Promise.resolve();const rt={...tt,type:(tt==null?void 0:tt.refetchType)??(tt==null?void 0:tt.type)??"active"};return this.refetchQueries(rt,et)})}refetchQueries(tt,et={}){const rt={...et,cancelRefetch:et.cancelRefetch??!0},st=notifyManager.batch(()=>Kt(this,ls).findAll(tt).filter(nt=>!nt.isDisabled()).map(nt=>{let ot=nt.fetch(void 0,rt);return rt.throwOnError||(ot=ot.catch(noop$1)),nt.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(st).then(noop$1)}fetchQuery(tt){const et=this.defaultQueryOptions(tt);et.retry===void 0&&(et.retry=!1);const rt=Kt(this,ls).build(this,et);return rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))?rt.fetch(et):Promise.resolve(rt.state.data)}prefetchQuery(tt){return this.fetchQuery(tt).then(noop$1).catch(noop$1)}fetchInfiniteQuery(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.fetchQuery(tt)}prefetchInfiniteQuery(tt){return this.fetchInfiniteQuery(tt).then(noop$1).catch(noop$1)}ensureInfiniteQueryData(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.ensureQueryData(tt)}resumePausedMutations(){return onlineManager.isOnline()?Kt(this,Uo).resumePausedMutations():Promise.resolve()}getQueryCache(){return Kt(this,ls)}getMutationCache(){return Kt(this,Uo)}getDefaultOptions(){return Kt(this,Ho)}setDefaultOptions(tt){Rr(this,Ho,tt)}setQueryDefaults(tt,et){Kt(this,eu).set(hashKey(tt),{queryKey:tt,defaultOptions:et})}getQueryDefaults(tt){const et=[...Kt(this,eu).values()],rt={};return et.forEach(st=>{partialMatchKey(tt,st.queryKey)&&Object.assign(rt,st.defaultOptions)}),rt}setMutationDefaults(tt,et){Kt(this,tu).set(hashKey(tt),{mutationKey:tt,defaultOptions:et})}getMutationDefaults(tt){const et=[...Kt(this,tu).values()];let rt={};return et.forEach(st=>{partialMatchKey(tt,st.mutationKey)&&(rt={...rt,...st.defaultOptions})}),rt}defaultQueryOptions(tt){if(tt._defaulted)return tt;const et={...Kt(this,Ho).queries,...this.getQueryDefaults(tt.queryKey),...tt,_defaulted:!0};return et.queryHash||(et.queryHash=hashQueryKeyByOptions(et.queryKey,et)),et.refetchOnReconnect===void 0&&(et.refetchOnReconnect=et.networkMode!=="always"),et.throwOnError===void 0&&(et.throwOnError=!!et.suspense),!et.networkMode&&et.persister&&(et.networkMode="offlineFirst"),et.queryFn===skipToken&&(et.enabled=!1),et}defaultMutationOptions(tt){return tt!=null&&tt._defaulted?tt:{...Kt(this,Ho).mutations,...(tt==null?void 0:tt.mutationKey)&&this.getMutationDefaults(tt.mutationKey),...tt,_defaulted:!0}}clear(){Kt(this,ls).clear(),Kt(this,Uo).clear()}},ls=new WeakMap,Uo=new WeakMap,Ho=new WeakMap,eu=new WeakMap,tu=new WeakMap,Vo=new WeakMap,ru=new WeakMap,su=new WeakMap,Jp),Bs,Vr,ku,Os,Sl,nu,Go,xo,Lu,iu,ou,_l,Rl,Wo,au,Kr,$u,e2,t2,r2,s2,n2,i2,o2,um,em,QueryObserver=(em=class extends Subscribable{constructor(et,rt){super();kr(this,Kr);kr(this,Bs);kr(this,Vr);kr(this,ku);kr(this,Os);kr(this,Sl);kr(this,nu);kr(this,Go);kr(this,xo);kr(this,Lu);kr(this,iu);kr(this,ou);kr(this,_l);kr(this,Rl);kr(this,Wo);kr(this,au,new Set);this.options=rt,Rr(this,Bs,et),Rr(this,xo,null),Rr(this,Go,pendingThenable()),this.options.experimental_prefetchInRender||Kt(this,Go).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(rt)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Kt(this,Vr).addObserver(this),shouldFetchOnMount(Kt(this,Vr),this.options)?Nr(this,Kr,$u).call(this):this.updateResult(),Nr(this,Kr,s2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Kt(this,Vr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Kt(this,Vr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Nr(this,Kr,n2).call(this),Nr(this,Kr,i2).call(this),Kt(this,Vr).removeObserver(this)}setOptions(et,rt){const st=this.options,nt=Kt(this,Vr);if(this.options=Kt(this,Bs).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Kt(this,Vr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Nr(this,Kr,o2).call(this),Kt(this,Vr).setOptions(this.options),st._defaulted&&!shallowEqualObjects(this.options,st)&&Kt(this,Bs).getQueryCache().notify({type:"observerOptionsUpdated",query:Kt(this,Vr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Kt(this,Vr),nt,this.options,st)&&Nr(this,Kr,$u).call(this),this.updateResult(rt),ot&&(Kt(this,Vr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Vr))!==resolveEnabled(st.enabled,Kt(this,Vr))||resolveStaleTime(this.options.staleTime,Kt(this,Vr))!==resolveStaleTime(st.staleTime,Kt(this,Vr)))&&Nr(this,Kr,e2).call(this);const at=Nr(this,Kr,t2).call(this);ot&&(Kt(this,Vr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Vr))!==resolveEnabled(st.enabled,Kt(this,Vr))||at!==Kt(this,Wo))&&Nr(this,Kr,r2).call(this,at)}getOptimisticResult(et){const rt=Kt(this,Bs).getQueryCache().build(Kt(this,Bs),et),st=this.createResult(rt,et);return shouldAssignObserverCurrentProperties(this,st)&&(Rr(this,Os,st),Rr(this,nu,this.options),Rr(this,Sl,Kt(this,Vr).state)),st}getCurrentResult(){return Kt(this,Os)}trackResult(et,rt){const st={};return Object.keys(et).forEach(nt=>{Object.defineProperty(st,nt,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(nt),rt==null||rt(nt),et[nt])})}),st}trackProp(et){Kt(this,au).add(et)}getCurrentQuery(){return Kt(this,Vr)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const rt=Kt(this,Bs).defaultQueryOptions(et),st=Kt(this,Bs).getQueryCache().build(Kt(this,Bs),rt);return st.fetch().then(()=>this.createResult(st,rt))}fetch(et){return Nr(this,Kr,$u).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Kt(this,Os)))}createResult(et,rt){var jt;const st=Kt(this,Vr),nt=this.options,ot=Kt(this,Os),at=Kt(this,Sl),lt=Kt(this,nu),ct=et!==st?et.state:Kt(this,ku),{state:dt}=et;let ht={...dt},ft=!1,xt;if(rt._optimisticResults){const Dt=this.hasListeners(),Ht=!Dt&&shouldFetchOnMount(et,rt),Nt=Dt&&shouldFetchOptionally(et,st,rt,nt);(Ht||Nt)&&(ht={...ht,...fetchState(dt.data,et.options)}),rt._optimisticResults==="isRestoring"&&(ht.fetchStatus="idle")}let{error:yt,errorUpdatedAt:vt,status:Et}=ht;if(rt.select&&ht.data!==void 0)if(ot&&ht.data===(at==null?void 0:at.data)&&rt.select===Kt(this,Lu))xt=Kt(this,iu);else try{Rr(this,Lu,rt.select),xt=rt.select(ht.data),xt=replaceData(ot==null?void 0:ot.data,xt,rt),Rr(this,iu,xt),Rr(this,xo,null)}catch(Dt){Rr(this,xo,Dt)}else xt=ht.data;if(rt.placeholderData!==void 0&&xt===void 0&&Et==="pending"){let Dt;if(ot!=null&&ot.isPlaceholderData&&rt.placeholderData===(lt==null?void 0:lt.placeholderData))Dt=ot.data;else if(Dt=typeof rt.placeholderData=="function"?rt.placeholderData((jt=Kt(this,ou))==null?void 0:jt.state.data,Kt(this,ou)):rt.placeholderData,rt.select&&Dt!==void 0)try{Dt=rt.select(Dt),Rr(this,xo,null)}catch(Ht){Rr(this,xo,Ht)}Dt!==void 0&&(Et="success",xt=replaceData(ot==null?void 0:ot.data,Dt,rt),ft=!0)}Kt(this,xo)&&(yt=Kt(this,xo),xt=Kt(this,iu),vt=Date.now(),Et="error");const bt=ht.fetchStatus==="fetching",wt=Et==="pending",St=Et==="error",Rt=wt&&bt,Ct=xt!==void 0,It={status:Et,fetchStatus:ht.fetchStatus,isPending:wt,isSuccess:Et==="success",isError:St,isInitialLoading:Rt,isLoading:Rt,data:xt,dataUpdatedAt:ht.dataUpdatedAt,error:yt,errorUpdatedAt:vt,failureCount:ht.fetchFailureCount,failureReason:ht.fetchFailureReason,errorUpdateCount:ht.errorUpdateCount,isFetched:ht.dataUpdateCount>0||ht.errorUpdateCount>0,isFetchedAfterMount:ht.dataUpdateCount>ct.dataUpdateCount||ht.errorUpdateCount>ct.errorUpdateCount,isFetching:bt,isRefetching:bt&&!wt,isLoadingError:St&&!Ct,isPaused:ht.fetchStatus==="paused",isPlaceholderData:ft,isRefetchError:St&&Ct,isStale:isStale(et,rt),refetch:this.refetch,promise:Kt(this,Go)};if(this.options.experimental_prefetchInRender){const Dt=Ut=>{It.status==="error"?Ut.reject(It.error):It.data!==void 0&&Ut.resolve(It.data)},Ht=()=>{const Ut=Rr(this,Go,It.promise=pendingThenable());Dt(Ut)},Nt=Kt(this,Go);switch(Nt.status){case"pending":et.queryHash===st.queryHash&&Dt(Nt);break;case"fulfilled":(It.status==="error"||It.data!==Nt.value)&&Ht();break;case"rejected":(It.status!=="error"||It.error!==Nt.reason)&&Ht();break}}return It}updateResult(et){const rt=Kt(this,Os),st=this.createResult(Kt(this,Vr),this.options);if(Rr(this,Sl,Kt(this,Vr).state),Rr(this,nu,this.options),Kt(this,Sl).data!==void 0&&Rr(this,ou,Kt(this,Vr)),shallowEqualObjects(st,rt))return;Rr(this,Os,st);const nt={},ot=()=>{if(!rt)return!0;const{notifyOnChangeProps:at}=this.options,lt=typeof at=="function"?at():at;if(lt==="all"||!lt&&!Kt(this,au).size)return!0;const ut=new Set(lt??Kt(this,au));return this.options.throwOnError&&ut.add("error"),Object.keys(Kt(this,Os)).some(ct=>{const dt=ct;return Kt(this,Os)[dt]!==rt[dt]&&ut.has(dt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(nt.listeners=!0),Nr(this,Kr,um).call(this,{...nt,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Nr(this,Kr,s2).call(this)}},Bs=new WeakMap,Vr=new WeakMap,ku=new WeakMap,Os=new WeakMap,Sl=new WeakMap,nu=new WeakMap,Go=new WeakMap,xo=new WeakMap,Lu=new WeakMap,iu=new WeakMap,ou=new WeakMap,_l=new WeakMap,Rl=new WeakMap,Wo=new WeakMap,au=new WeakMap,Kr=new WeakSet,$u=function(et){Nr(this,Kr,o2).call(this);let rt=Kt(this,Vr).fetch(this.options,et);return et!=null&&et.throwOnError||(rt=rt.catch(noop$1)),rt},e2=function(){Nr(this,Kr,n2).call(this);const et=resolveStaleTime(this.options.staleTime,Kt(this,Vr));if(isServer||Kt(this,Os).isStale||!isValidTimeout(et))return;const st=timeUntilStale(Kt(this,Os).dataUpdatedAt,et)+1;Rr(this,_l,setTimeout(()=>{Kt(this,Os).isStale||this.updateResult()},st))},t2=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Kt(this,Vr)):this.options.refetchInterval)??!1},r2=function(et){Nr(this,Kr,i2).call(this),Rr(this,Wo,et),!(isServer||resolveEnabled(this.options.enabled,Kt(this,Vr))===!1||!isValidTimeout(Kt(this,Wo))||Kt(this,Wo)===0)&&Rr(this,Rl,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&Nr(this,Kr,$u).call(this)},Kt(this,Wo)))},s2=function(){Nr(this,Kr,e2).call(this),Nr(this,Kr,r2).call(this,Nr(this,Kr,t2).call(this))},n2=function(){Kt(this,_l)&&(clearTimeout(Kt(this,_l)),Rr(this,_l,void 0))},i2=function(){Kt(this,Rl)&&(clearInterval(Kt(this,Rl)),Rr(this,Rl,void 0))},o2=function(){const et=Kt(this,Bs).getQueryCache().build(Kt(this,Bs),this.options);if(et===Kt(this,Vr))return;const rt=Kt(this,Vr);Rr(this,Vr,et),Rr(this,ku,et.state),this.hasListeners()&&(rt==null||rt.removeObserver(this),et.addObserver(this))},um=function(et){notifyManager.batch(()=>{et.listeners&&this.listeners.forEach(rt=>{rt(Kt(this,Os))}),Kt(this,Bs).getQueryCache().notify({query:Kt(this,Vr),type:"observerResultsUpdated"})})},em);function shouldLoadOnMount(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.state.data===void 0&&!(tt.state.status==="error"&&et.retryOnMount===!1)}function shouldFetchOnMount(tt,et){return shouldLoadOnMount(tt,et)||tt.state.data!==void 0&&shouldFetchOn(tt,et,et.refetchOnMount)}function shouldFetchOn(tt,et,rt){if(resolveEnabled(et.enabled,tt)!==!1){const st=typeof rt=="function"?rt(tt):rt;return st==="always"||st!==!1&&isStale(tt,et)}return!1}function shouldFetchOptionally(tt,et,rt,st){return(tt!==et||resolveEnabled(st.enabled,tt)===!1)&&(!rt.suspense||tt.state.status!=="error")&&isStale(tt,rt)}function isStale(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.isStaleByTime(resolveStaleTime(et.staleTime,tt))}function shouldAssignObserverCurrentProperties(tt,et){return!shallowEqualObjects(tt.getCurrentResult(),et)}var InfiniteQueryObserver=class extends QueryObserver{constructor(tt,et){super(tt,et)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(tt,et){super.setOptions({...tt,behavior:infiniteQueryBehavior()},et)}getOptimisticResult(tt){return tt.behavior=infiniteQueryBehavior(),super.getOptimisticResult(tt)}fetchNextPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"backward"}}})}createResult(tt,et){var yt,vt;const{state:rt}=tt,st=super.createResult(tt,et),{isFetching:nt,isRefetching:ot,isError:at,isRefetchError:lt}=st,ut=(vt=(yt=rt.fetchMeta)==null?void 0:yt.fetchMore)==null?void 0:vt.direction,ct=at&&ut==="forward",dt=nt&&ut==="forward",ht=at&&ut==="backward",ft=nt&&ut==="backward";return{...st,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hasNextPage(et,rt.data),hasPreviousPage:hasPreviousPage(et,rt.data),isFetchNextPageError:ct,isFetchingNextPage:dt,isFetchPreviousPageError:ht,isFetchingPreviousPage:ft,isRefetchError:lt&&!ct&&!ht,isRefetching:ot&&!dt&&!ft}}},qo,Xo,zs,To,Co,j1,a2,tm,MutationObserver$1=(tm=class extends Subscribable{constructor(rt,st){super();kr(this,Co);kr(this,qo);kr(this,Xo);kr(this,zs);kr(this,To);Rr(this,qo,rt),this.setOptions(st),this.bindMethods(),Nr(this,Co,j1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(rt){var nt;const st=this.options;this.options=Kt(this,qo).defaultMutationOptions(rt),shallowEqualObjects(this.options,st)||Kt(this,qo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Kt(this,zs),observer:this}),st!=null&&st.mutationKey&&this.options.mutationKey&&hashKey(st.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((nt=Kt(this,zs))==null?void 0:nt.state.status)==="pending"&&Kt(this,zs).setOptions(this.options)}onUnsubscribe(){var rt;this.hasListeners()||(rt=Kt(this,zs))==null||rt.removeObserver(this)}onMutationUpdate(rt){Nr(this,Co,j1).call(this),Nr(this,Co,a2).call(this,rt)}getCurrentResult(){return Kt(this,Xo)}reset(){var rt;(rt=Kt(this,zs))==null||rt.removeObserver(this),Rr(this,zs,void 0),Nr(this,Co,j1).call(this),Nr(this,Co,a2).call(this)}mutate(rt,st){var nt;return Rr(this,To,st),(nt=Kt(this,zs))==null||nt.removeObserver(this),Rr(this,zs,Kt(this,qo).getMutationCache().build(Kt(this,qo),this.options)),Kt(this,zs).addObserver(this),Kt(this,zs).execute(rt)}},qo=new WeakMap,Xo=new WeakMap,zs=new WeakMap,To=new WeakMap,Co=new WeakSet,j1=function(){var st;const rt=((st=Kt(this,zs))==null?void 0:st.state)??getDefaultState();Rr(this,Xo,{...rt,isPending:rt.status==="pending",isSuccess:rt.status==="success",isError:rt.status==="error",isIdle:rt.status==="idle",mutate:this.mutate,reset:this.reset})},a2=function(rt){notifyManager.batch(()=>{var st,nt,ot,at,lt,ut,ct,dt;if(Kt(this,To)&&this.hasListeners()){const ht=Kt(this,Xo).variables,ft=Kt(this,Xo).context;(rt==null?void 0:rt.type)==="success"?((nt=(st=Kt(this,To)).onSuccess)==null||nt.call(st,rt.data,ht,ft),(at=(ot=Kt(this,To)).onSettled)==null||at.call(ot,rt.data,null,ht,ft)):(rt==null?void 0:rt.type)==="error"&&((ut=(lt=Kt(this,To)).onError)==null||ut.call(lt,rt.error,ht,ft),(dt=(ct=Kt(this,To)).onSettled)==null||dt.call(ct,void 0,rt.error,ht,ft))}this.listeners.forEach(ht=>{ht(Kt(this,Xo))})})},tm),QueryClientContext=reactExports.createContext(void 0),useQueryClient=tt=>{const et=reactExports.useContext(QueryClientContext);if(!et)throw new Error("No QueryClient set, use QueryClientProvider to set one");return et},QueryClientProvider=({client:tt,children:et})=>(reactExports.useEffect(()=>(tt.mount(),()=>{tt.unmount()}),[tt]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:tt,children:et})),IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let tt=!1;return{clearReset:()=>{tt=!1},reset:()=>{tt=!0},isReset:()=>tt}}var QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(tt,et){return typeof tt=="function"?tt(...et):!!tt}function noop(){}var ensurePreventErrorBoundaryRetry=(tt,et)=>{(tt.suspense||tt.throwOnError||tt.experimental_prefetchInRender)&&(et.isReset()||(tt.retryOnMount=!1))},useClearResetErrorBoundary=tt=>{reactExports.useEffect(()=>{tt.clearReset()},[tt])},getHasError=({result:tt,errorResetBoundary:et,throwOnError:rt,query:st})=>tt.isError&&!et.isReset()&&!tt.isFetching&&st&&shouldThrowError(rt,[tt.error,st]),ensureSuspenseTimers=tt=>{tt.suspense&&(tt.staleTime===void 0&&(tt.staleTime=1e3),typeof tt.gcTime=="number"&&(tt.gcTime=Math.max(tt.gcTime,1e3)))},willFetch=(tt,et)=>tt.isLoading&&tt.isFetching&&!et,shouldSuspend=(tt,et)=>(tt==null?void 0:tt.suspense)&&et.isPending,fetchOptimistic=(tt,et,rt)=>et.fetchOptimistic(tt).catch(()=>{rt.clearReset()});function useBaseQuery(tt,et,rt){var dt,ht,ft,xt,yt;const st=useQueryClient(),nt=useIsRestoring(),ot=useQueryErrorResetBoundary(),at=st.defaultQueryOptions(tt);(ht=(dt=st.getDefaultOptions().queries)==null?void 0:dt._experimental_beforeQuery)==null||ht.call(dt,at),at._optimisticResults=nt?"isRestoring":"optimistic",ensureSuspenseTimers(at),ensurePreventErrorBoundaryRetry(at,ot),useClearResetErrorBoundary(ot);const lt=!st.getQueryCache().get(at.queryHash),[ut]=reactExports.useState(()=>new et(st,at)),ct=ut.getOptimisticResult(at);if(reactExports.useSyncExternalStore(reactExports.useCallback(vt=>{const Et=nt?noop:ut.subscribe(notifyManager.batchCalls(vt));return ut.updateResult(),Et},[ut,nt]),()=>ut.getCurrentResult(),()=>ut.getCurrentResult()),reactExports.useEffect(()=>{ut.setOptions(at,{listeners:!1})},[at,ut]),shouldSuspend(at,ct))throw fetchOptimistic(at,ut,ot);if(getHasError({result:ct,errorResetBoundary:ot,throwOnError:at.throwOnError,query:st.getQueryCache().get(at.queryHash)}))throw ct.error;if((xt=(ft=st.getDefaultOptions().queries)==null?void 0:ft._experimental_afterQuery)==null||xt.call(ft,at,ct),at.experimental_prefetchInRender&&!isServer&&willFetch(ct,nt)){const vt=lt?fetchOptimistic(at,ut,ot):(yt=st.getQueryCache().get(at.queryHash))==null?void 0:yt.promise;vt==null||vt.catch(noop).finally(()=>{ut.updateResult()})}return at.notifyOnChangeProps?ct:ut.trackResult(ct)}function useQuery(tt,et){return useBaseQuery(tt,QueryObserver)}function queryOptions(tt){return tt}function useMutation(tt,et){const rt=useQueryClient(),[st]=reactExports.useState(()=>new MutationObserver$1(rt,tt));reactExports.useEffect(()=>{st.setOptions(tt)},[st,tt]);const nt=reactExports.useSyncExternalStore(reactExports.useCallback(at=>st.subscribe(notifyManager.batchCalls(at)),[st]),()=>st.getCurrentResult(),()=>st.getCurrentResult()),ot=reactExports.useCallback((at,lt)=>{st.mutate(at,lt).catch(noop)},[st]);if(nt.error&&shouldThrowError(st.options.throwOnError,[nt.error]))throw nt.error;return{...nt,mutate:ot,mutateAsync:nt.mutate}}function useInfiniteQuery(tt,et){return useBaseQuery(tt,InfiniteQueryObserver)}const useUpdateMutation=({application:tt,options:et})=>useMutation({mutationFn:async rt=>await odeServices.resource(tt).update(rt),...et}),SvgIconBookmark=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M7 4a1 1 0 0 0-1 1v14.06l5.42-3.87a1 1 0 0 1 1.16 0L18 19.06V5a1 1 0 0 0-1-1zM4.88 2.88A3 3 0 0 1 7 2h10a3 3 0 0 1 3 3v16a1 1 0 0 1-1.58.81L12 17.23 5.58 21.8A1 1 0 0 1 4 21V5a3 3 0 0 1 .88-2.12"})]}),ShareBookmark=({bookmark:tt,refBookmark:et,onBookmarkChange:rt,onSave:st})=>{const{t:nt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"mt-16",children:jsxRuntimeExports.jsxs(FormControl,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[jsxRuntimeExports.jsx("div",{className:"flex-fill",children:jsxRuntimeExports.jsx(FormControl.Input,{ref:et,onChange:rt,placeholder:nt("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},tt.id)}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"ghost",disabled:tt.name.length===0,leftIcon:jsxRuntimeExports.jsx(SvgIconSave,{}),onClick:st,className:"text-nowrap",children:nt("explorer.modal.share.sharebookmark.save")})]})})},hasRight=(tt,et)=>tt.actions.filter(rt=>et.id===rt.id).length>0,showShareRightLine=(tt,et)=>tt.isBookmarkMember&&et||!tt.isBookmarkMember,ShareBookmarkLine=({shareRights:tt,showBookmark:et,toggleBookmark:rt,shareRightActions:st,toggleRight:nt,onDeleteRow:ot})=>{const{t:at}=useTranslation();return tt==null?void 0:tt.rights.map(lt=>{const ut={user:jsxRuntimeExports.jsx(Avatar,{alt:at("explorer.modal.share.avatar.shared.alt"),size:"xs",src:lt.avatarUrl,variant:"circle"}),group:jsxRuntimeExports.jsx("div",{className:"avatar-xs bg-primary-200 justify-content-center d-flex rounded-circle",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:16})}),sharebookmark:jsxRuntimeExports.jsx(SvgIconBookmark,{})}[lt.type]||null,ct=lt.type==="sharebookmark",dt=lt.type==="user";return showShareRightLine(lt,et)&&jsxRuntimeExports.jsxs("tr",{className:lt.isBookmarkMember?"bg-light":"",children:[jsxRuntimeExports.jsx("td",{children:ut}),jsxRuntimeExports.jsx("td",{children:jsxRuntimeExports.jsxs("div",{className:"d-flex",children:[ct&&jsxRuntimeExports.jsx(Button,{color:"tertiary",rightIcon:jsxRuntimeExports.jsx(SvgIconRafterDown,{title:at("show"),className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:et?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:rt,children:lt.displayName}),!ct&<.displayName,dt&&` (${at(lt.profile||"")})`]})}),st.map(ht=>jsxRuntimeExports.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:jsxRuntimeExports.jsx(Checkbox,{checked:hasRight(lt,ht),onChange:()=>nt(lt,ht.id)})},ht.displayName)),jsxRuntimeExports.jsx("td",{children:!lt.isBookmarkMember&&jsxRuntimeExports.jsx(IconButton,{"aria-label":at("close"),color:"tertiary",icon:jsxRuntimeExports.jsx(SvgIconClose,{}),type:"button",variant:"ghost",title:at("close"),onClick:()=>ot(lt)})})]},lt.id)})},initialState$2={searchInputValue:"",searchResults:[],searchAPIResults:[],isSearching:!1};function reducer$1(tt,et){switch(et.type){case"onChange":return{...tt,searchInputValue:et.payload};case"isSearching":return{...tt,isSearching:et.payload};case"addResult":return{...tt,searchResults:et.payload};case"addApiResult":return{...tt,searchAPIResults:et.payload};case"updateSearchResult":return{...tt,searchResults:et.payload};case"emptyResult":return{...tt,searchResults:et.payload};default:throw new Error("Unhandled action type")}}const defaultActions=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}],useSearch=({resourceId:tt,resourceCreatorId:et,shareRights:rt,shareDispatch:st})=>{const[nt,ot]=reactExports.useReducer(reducer$1,initialState$2),at=useDebounce(nt.searchInputValue,500),{isAdml:lt}=useIsAdml(),{appCode:ut}=useEdificeClient(),{t:ct}=useTranslation();reactExports.useEffect(()=>{ht(at)},[at]);const dt=ft=>{const xt=ft.target.value;ot({type:"onChange",payload:xt})},ht=async ft=>{if(tt){if(ot({type:"isSearching",payload:!0}),!lt&&ft.length>=1||lt&&ft.length>=3){const xt=await odeServices.share().searchShareSubjects(ut,tt,ft);ot({type:"addApiResult",payload:xt});const yt=xt.filter(vt=>!rt.rights.find(Et=>Et.id===vt.id)).filter(vt=>!(vt.type==="user"&&vt.id===et)).map(vt=>{let Et=vt.displayName;return vt.type==="user"&&vt.profile?Et=`${Et} (${ct(vt.profile)})`:vt.type==="group"&&vt.structureName&&(Et=`${Et} (${vt.structureName})`),{value:vt.id,label:Et,icon:vt.type==="sharebookmark"?jsxRuntimeExports.jsx(SvgIconBookmark,{}):null}});ot({type:"addResult",payload:yt})}else ot({type:"emptyResult",payload:[]}),Promise.resolve();ot({type:"isSearching",payload:!1})}};return{state:nt,showSearchAdmlHint:()=>lt&&nt.searchInputValue.length<3,showSearchLoading:()=>nt.isSearching,showSearchNoResults:()=>!nt.isSearching&&!lt&&at.length>0&&nt.searchResults.length===0||!nt.isSearching&<&&at.length>3&&nt.searchResults.length===0,getSearchMinLength:()=>lt?3:1,handleSearchInputChange:dt,handleSearchResultsChange:async ft=>{const xt=nt.searchAPIResults.find(yt=>yt.id===ft[0]);if(xt){let yt=[];if(xt.type==="sharebookmark"){const vt=await odeServices.directory().getBookMarkById(xt.id);yt.push({...vt,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:defaultActions}),vt==null||vt.users.filter(Et=>!rt.rights.find(bt=>bt.id===Et.id)).forEach(Et=>{yt.push({...Et,type:"user",avatarUrl:"",directoryUrl:"",actions:defaultActions,isBookmarkMember:!0})}),vt.groups.filter(Et=>!rt.rights.find(bt=>bt.id===Et.id)).forEach(Et=>{yt.push({...Et,type:"group",avatarUrl:"",directoryUrl:"",actions:defaultActions,isBookmarkMember:!0})})}else yt=[{...xt,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];st({type:"updateShareRights",payload:{...rt,rights:[...rt.rights,...yt]}}),ot({type:"updateSearchResult",payload:nt.searchResults.filter(vt=>vt.value!==ft[0])})}}}},initialState$1={isSharing:!1,shareRights:{rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]},shareRightActions:[]};function reducer(tt,et){switch(et.type){case"init":return{...tt,...et.payload};case"deleteRow":return{...tt,shareRights:et.payload};case"updateShareRights":return{...tt,shareRights:et.payload};case"toggleRight":return{...tt,shareRights:et.payload};case"isSharing":return{...tt,isSharing:et.payload};default:throw new Error("Unhandled action type")}}function useShare({resourceId:tt,resourceRights:et,resourceCreatorId:rt,shareResource:st,setIsLoading:nt,onSuccess:ot}){const{appCode:at}=useEdificeClient(),{user:lt,avatar:ut}=useUser(),ct=useToast(),{t:dt}=useTranslation(),[ht,ft]=reactExports.useReducer(reducer,initialState$1);reactExports.useEffect(()=>{tt&&(async()=>{try{const[vt,Et]=await Promise.all([odeServices.share().getActionsForApp(at),odeServices.share().getRightsForResource(at,tt)]);ft({type:"init",payload:{shareRightActions:vt,shareRights:Et}})}catch(vt){console.error(vt)}nt(!1)})()},[tt]);const xt=(vt,Et)=>{var bt,wt;const{rights:St,...Rt}=ht.shareRights,Ct=[...St],Pt=Ct.findIndex(jt=>jt.id===vt.id),It=ht.shareRightActions.filter(jt=>jt.id===Et)[0];if(Ct[Pt].actions.findIndex(jt=>jt.id===Et)>-1){let jt=Ct[Pt].actions.filter(Ht=>Ht.id!==Et);const Dt=ht.shareRightActions.filter(Ht=>{var Nt;return(Nt=Ht.requires)==null?void 0:Nt.includes(Et)});jt=jt.filter(Ht=>!Dt.find(Nt=>Nt.id===Ht.id)),Ct[Pt]={...Ct[Pt],actions:jt}}else{const jt=ht.shareRightActions.filter(Dt=>{var Ht;return((Ht=It.requires)==null?void 0:Ht.includes(Dt.id))&&!Ct[Pt].actions.find(Nt=>Nt.id===Dt.id)});Ct[Pt]={...Ct[Pt],actions:[...Ct[Pt].actions,It,...jt]}}vt.type==="sharebookmark"&&((bt=Ct[Pt].users)==null||bt.forEach(jt=>{const Dt=Ct.findIndex(Ht=>Ht.id===jt.id);Ct[Dt]={...Ct[Dt],actions:Ct[Pt].actions}}),(wt=Ct[Pt].groups)==null||wt.forEach(jt=>{const Dt=Ct.findIndex(Ht=>Ht.id===jt.id);Ct[Dt]={...Ct[Dt],actions:Ct[Pt].actions}})),ft({type:"toggleRight",payload:{rights:Ct,...Rt}})},yt=vt=>{Object.keys(vt)[0]==="error"?(ct.error(dt("explorer.shared.status.error")),console.error("Failed to save share",vt)):ct.success(dt("explorer.shared.status.saved"))};return{state:ht,dispatch:ft,currentIsAuthor:()=>rt===(lt==null?void 0:lt.userId),myAvatar:ut,handleDeleteRow:vt=>{ft({type:"deleteRow",payload:{...ht.shareRights,rights:ht.shareRights.rights.filter(Et=>{var bt,wt;return Et.id!==vt.id&&!((bt=vt.users)!=null&&bt.find(St=>St.id===Et.id))&&!((wt=vt.groups)!=null&&wt.find(St=>St.id===Et.id))})}})},handleShare:async()=>{ft({type:"isSharing",payload:!0});try{const vt=et.filter(bt=>lt&&bt.includes(`user:${lt.userId}`)).map(bt=>bt.split(":")[2]).filter(bt=>!!bt),Et=[...ht.shareRights.rights];if(vt.length>0){const bt=vt.map(wt=>({displayName:wt,id:wt}));Et.push({actions:bt,avatarUrl:"",directoryUrl:"",displayName:lt.username,id:lt.userId,type:"user"})}if(st){const bt=await st.mutateAsync({resourceId:tt,rights:Et});yt(bt)}else{const bt=await odeServices.share().saveRights(at,tt,Et);yt(bt)}ot()}catch(vt){typeof vt=="string"&&ct.error(dt("explorer.shared.status.error")),typeof vt=="object"&&ct.error(dt((vt==null?void 0:vt.error)||"explorer.shared.status.error")),console.error("Failed to save share",vt)}finally{ft({type:"isSharing",payload:!1})}},toggleRight:xt}}const useShareBookmark=({shareRights:tt,shareDispatch:et})=>{const rt=useToast(),{t:st}=useTranslation(),nt=reactExports.useRef(null),[ot,at]=reactExports.useState({name:"",id:reactExports.useId()}),[lt,ut]=useToggle$1(!1),[ct,dt]=reactExports.useState(!1),ht=()=>{ut()},ft=()=>{at(yt=>{var vt;return{...yt,name:((vt=nt.current)==null?void 0:vt.value)||""}})},xt=async yt=>{try{const vt=await odeServices.directory().saveBookmarks(yt,{users:tt.rights.filter(Et=>Et.type==="user").map(Et=>Et.id),groups:tt.rights.filter(Et=>Et.type==="group").map(Et=>Et.id),bookmarks:tt.rights.filter(Et=>Et.type==="sharebookmark").map(Et=>Et.id)});rt.success(st("explorer.bookmarked.status.saved")),et({type:"updateShareRights",payload:{...tt,visibleBookmarks:[...tt.visibleBookmarks,{displayName:yt,id:vt.id}]}}),at(Et=>({...Et,bookmarkId:Et.id+new Date().getTime().toString()})),dt(!1)}catch(vt){console.error("Failed to save bookmark",vt),rt.error(st("explorer.bookmarked.status.error"))}};return{refBookmark:nt,showBookmark:lt,showBookmarkInput:ct,bookmark:ot,handleBookmarkChange:ft,setBookmark:at,handleOnSave:()=>{var yt;const vt=((yt=nt.current)==null?void 0:yt.value)||"";xt(vt)},toggleBookmark:ht,toggleBookmarkInput:dt}};function ShareResourceModal({isOpen:tt,shareOptions:et,shareResource:rt,children:st,onSuccess:nt,onCancel:ot}){const{resourceId:at,resourceCreatorId:lt,resourceRights:ut}=et,[ct,dt]=reactExports.useState(!0),{state:{isSharing:ht,shareRights:ft,shareRightActions:xt},dispatch:yt,myAvatar:vt,currentIsAuthor:Et,handleShare:bt,toggleRight:wt,handleDeleteRow:St}=useShare({resourceId:at,resourceCreatorId:lt,resourceRights:ut,shareResource:rt,setIsLoading:dt,onSuccess:nt}),{state:{searchResults:Rt,searchInputValue:Ct},showSearchAdmlHint:Pt,showSearchLoading:It,showSearchNoResults:jt,getSearchMinLength:Dt,handleSearchInputChange:Ht,handleSearchResultsChange:Nt}=useSearch({resourceId:at,resourceCreatorId:lt,shareRights:ft,shareDispatch:yt}),{refBookmark:Ut,showBookmark:Lt,handleBookmarkChange:kt,toggleBookmark:Mt,bookmark:Bt,handleOnSave:Gt,showBookmarkInput:$t,toggleBookmarkInput:zt}=useShareBookmark({shareRights:ft,shareDispatch:yt}),{t:Ft}=useTranslation(),Yt=Pt()?Ft("explorer.search.adml.hint"):Ft("explorer.modal.share.search.placeholder");return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"share_modal",size:"lg",isOpen:tt,onModalClose:ot,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:ot,children:Ft("share.title")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:Ft("explorer.modal.share.usersWithAccess")}),jsxRuntimeExports.jsx("div",{className:"table-responsive",children:ct?jsxRuntimeExports.jsx(LoadingScreen,{}):jsxRuntimeExports.jsxs("table",{className:"table border align-middle mb-0",children:[jsxRuntimeExports.jsx("thead",{className:"bg-secondary",children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("th",{scope:"col",className:"w-32",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Ft("explorer.modal.share.avatar.shared.alt")})}),jsxRuntimeExports.jsx("th",{scope:"col",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Ft("explorer.modal.share.search.placeholder")})}),xt.map(Zt=>jsxRuntimeExports.jsx("th",{scope:"col",className:"text-center text-white",children:Ft(Zt.displayName)},Zt.displayName)),jsxRuntimeExports.jsx("th",{scope:"col",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Ft("close")})})]})}),jsxRuntimeExports.jsxs("tbody",{children:[Et()&&jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("th",{scope:"row",children:jsxRuntimeExports.jsx(Avatar,{alt:Ft("explorer.modal.share.avatar.me.alt"),size:"xs",src:vt,variant:"circle"})}),jsxRuntimeExports.jsx("td",{children:Ft("share.me")}),xt.map(Zt=>jsxRuntimeExports.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:jsxRuntimeExports.jsx(Checkbox,{checked:!0,disabled:!0})},Zt.displayName)),jsxRuntimeExports.jsx("td",{})]}),jsxRuntimeExports.jsx(ShareBookmarkLine,{showBookmark:Lt,shareRightActions:xt,shareRights:ft,onDeleteRow:St,toggleRight:wt,toggleBookmark:Mt})]})]})}),jsxRuntimeExports.jsxs("div",{className:"mt-16",children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconBookmark,{}),rightIcon:jsxRuntimeExports.jsx(SvgIconRafterDown,{title:Ft("show"),className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:$t?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>zt(!$t),children:Ft("share.save.sharebookmark")}),$t&&jsxRuntimeExports.jsx(ShareBookmark,{refBookmark:Ut,bookmark:Bt,onBookmarkChange:kt,onSave:Gt})]}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsxs(Heading,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[jsxRuntimeExports.jsx("div",{className:"me-8",children:Ft("explorer.modal.share.search")}),jsxRuntimeExports.jsx(Tooltip,{message:"Vos favoris de partage s’affichent en priorité dans votre liste lorsque vous recherchez un groupe ou une personne, vous pouvez les retrouver dans l’annuaire.",placement:"top",children:jsxRuntimeExports.jsx(SvgIconInfoCircle,{className:"c-pointer",height:"18"})})]}),jsxRuntimeExports.jsx("div",{className:"row",children:jsxRuntimeExports.jsx("div",{className:"col-10",children:jsxRuntimeExports.jsx(Combobox,{value:Ct,placeholder:Yt,isLoading:It(),noResult:jt(),options:Rt,searchMinLength:Dt(),onSearchInputChange:Ht,onSearchResultsChange:Nt})})}),st]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:ot,children:Ft("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",isLoading:ht,onClick:bt,disabled:ht,children:Ft("share")})]})]}),document.getElementById("portal"))}function ShareBlog({resourceId:tt,updateResource:et}){const{appCode:rt}=useEdificeClient(),{t:st}=useTranslation(rt),nt=useResource("blog",tt),ot=nt&&nt["publish-type"],[at,lt]=reactExports.useState(ot??"RESTRAINT");reactExports.useEffect(()=>{ot&<(ot)},[ot]);const ut=async ct=>{const dt=ct.target.value,ht={description:nt.description||"",entId:nt.assetId,name:nt.name,public:!!nt.public,slug:nt.slug||"",thumbnail:nt.thumbnail,trashed:nt.trashed,"publish-type":dt};et?await et.mutateAsync(ht):await odeServices.resource("blog").update(ht),lt(dt)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:st("explorer.publication.steps")}),jsxRuntimeExports.jsx(Radio,{label:st("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:at,checked:at==="IMMEDIATE",onChange:ut}),jsxRuntimeExports.jsx(Radio,{label:st("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",checked:at==="RESTRAINT",model:at,onChange:ut})]})}const useShareMutation=({application:tt,options:et})=>useMutation({mutationFn:async({resourceId:rt,rights:st})=>await odeServices.share().saveRights(tt,rt,st),...et}),SvgIconCommunity=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M19.935 17.51q1.088 0 1.868.792.78.794.78 1.898 0 1.106-.78 1.898-.78.793-1.844.793t-1.869-.793a2.52 2.52 0 0 1-.78-1.922q0-.432.19-.936l-3.997-2.931q-1.16 1.2-2.79 1.2-1.633 0-2.791-1.176-1.16-1.177-1.183-2.86 0-.215.071-.624l-3.168-1.057a1.25 1.25 0 0 1-.852.337q-.567 0-.946-.385a1.32 1.32 0 0 1-.378-.96q0-.578.378-.938.38-.36.946-.384.474 0 .804.312.33.313.45.745l3.192 1.08a3.8 3.8 0 0 1 1.443-1.56 3.84 3.84 0 0 1 2.033-.577q1.23 0 2.27.745l4.706-4.781q-.378-.72-.378-1.321 0-1.106.78-1.898.78-.793 1.869-.793t1.844.793q.758.792.78 1.898a2.42 2.42 0 0 1-.78 1.873q-.804.77-1.868.793-.616 0-1.3-.408l-4.707 4.805q.734 1.056.733 2.306 0 .888-.402 1.753l3.997 2.907q.78-.624 1.679-.624"})]}),SvgIconDisconnect=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M22.996 13.153q0 2.09-.873 3.987a10.6 10.6 0 0 1-2.336 3.292q-1.462 1.393-3.516 2.21t-4.26.817-4.287-.817-3.49-2.21a12.3 12.3 0 0 1-2.362-3.291A8.1 8.1 0 0 1 1 13.153q0-2.451 1.155-4.589t3.234-3.627q.616-.433 1.386-.337t1.181.673q.462.553.36 1.273-.104.72-.72 1.13a7 7 0 0 0-2.155 2.426 6.38 6.38 0 0 0-.18 5.717 7 7 0 0 0 1.566 2.186q.975.913 2.335 1.466a7.5 7.5 0 0 0 2.85.552 7.3 7.3 0 0 0 2.823-.552 8.3 8.3 0 0 0 2.36-1.466 6.04 6.04 0 0 0 1.567-2.186q.538-1.274.564-2.666 0-1.635-.77-3.051T16.4 7.675a1.75 1.75 0 0 1-.719-1.129q-.128-.697.36-1.273.436-.577 1.206-.673t1.36.337q2.079 1.466 3.234 3.627a9.6 9.6 0 0 1 1.155 4.589M13.833 2.846v8.6q0 .698-.54 1.202-.538.505-1.283.505t-1.309-.505q-.564-.505-.539-1.201v-8.6q0-.697.54-1.202.538-.504 1.308-.504t1.284.504.539 1.201"})]}),SvgIconHome=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M20.584 13.536v7.458q0 .42-.294.699a1.06 1.06 0 0 1-.667.307H13.91v-5.978h-3.817V22H4.383a.85.85 0 0 1-.668-.307 1.16 1.16 0 0 1-.293-.699v-7.569l8.567-7.375 8.568 7.375q.027.027.027.111m3.31-1.09-.908 1.146a.54.54 0 0 1-.32.168h-.054a.6.6 0 0 1-.32-.084L11.989 4.682 1.687 13.676a.5.5 0 0 1-.347.084.54.54 0 0 1-.32-.168l-.935-1.145a.52.52 0 0 1-.08-.363.6.6 0 0 1 .16-.335l10.703-9.33q.48-.42 1.121-.419.64 0 1.148.419l3.63 3.156V2.56q0-.224.133-.363a.46.46 0 0 1 .347-.14h2.856q.214 0 .347.14a.5.5 0 0 1 .134.363v6.34l3.256 2.85q.16.111.16.335 0 .223-.107.363"})]}),SvgIconMyApps=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M1.898 22.555c-.072-.145-.096-1.37-.048-2.691l.048-2.402h5.261v5.26l-2.595.049c-1.994.048-2.594 0-2.666-.216m7.76 0c-.049-.145-.073-1.37-.049-2.691l.072-2.402h5.238v5.26l-2.571.049c-2.018.048-2.595 0-2.69-.216m7.759 0c-.048-.145-.072-1.37-.048-2.691l.072-2.402h5.237v5.26l-2.57.049c-1.994.048-2.595 0-2.691-.216m-15.52-7.76c-.071-.168-.095-1.37-.047-2.69l.048-2.403h5.261v5.261l-2.595.048c-1.994.048-2.594 0-2.666-.216m7.76 0c-.048-.168-.072-1.37-.048-2.69l.072-2.403h5.238v5.261l-2.571.048c-2.018.048-2.595 0-2.69-.216m7.76 0c-.048-.168-.072-1.37-.048-2.69l.072-2.403h5.237v5.261l-2.57.048c-1.994.048-2.595 0-2.691-.216M1.897 7.011c-.071-.144-.095-1.345-.047-2.666l.048-2.402h5.261V7.18l-2.595.072c-1.994.048-2.594 0-2.666-.24m7.76 0c-.048-.144-.072-1.345-.048-2.666l.072-2.402h5.238V7.18l-2.571.072c-2.018.048-2.595 0-2.69-.24m7.76 0c-.048-.144-.072-1.345-.048-2.666l.072-2.402h5.237V7.18l-2.57.072c-1.994.048-2.595 0-2.691-.24"})]}),SvgIconNeoAssistance=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12M7.123 7.667C8.276 5.958 9.745 5 12.013 5 14.425 5 17 6.941 17 9.5c0 2.113-1.377 2.932-2.418 3.552-.633.376-1.142.68-1.142 1.154v.169a.693.693 0 0 1-.682.703h-2.06a.693.693 0 0 1-.681-.703v-.287c0-1.768 1.269-2.5 2.266-3.075l.073-.042c.863-.499 1.392-.838 1.392-1.499 0-.874-1.082-1.454-1.956-1.454-1.112 0-1.64.53-2.351 1.449a.67.67 0 0 1-.945.121L7.27 8.63a.72.72 0 0 1-.147-.963M9.76 17.97c0-1.12.883-2.03 1.969-2.03 1.085 0 1.968.91 1.968 2.03S12.814 20 11.73 20c-1.086 0-1.969-.91-1.969-2.03",clipRule:"evenodd"})]}),SvgIconNeoMessaging=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"m.5 21.257 7.46-8.216 4.052 2.403 4.052-2.403 7.46 8.216zm0-2.738V8.573l5.848 3.531zm0-12.084V3.048h23.024v3.387l-11.512 6.847zm17.176 5.67 5.848-3.532v9.946z"})]}),SvgIconNewRelease=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M13.07 13.07V6.54h-2.14v6.53zm0 4.4v-2.2h-2.14v2.2zM24 12l-2.65 3.01.35 4.04-3.93.86-2.04 3.48L12 21.8l-3.73 1.6-2.04-3.42-3.93-.92.35-4.04L0 12l2.65-3.06-.35-3.99 3.93-.86L8.27.6 12 2.2 15.73.6l2.04 3.48 3.93.86L21.34 9z"})]}),SvgIconOneAssistance=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M11.685 2C8.66 2 6.7 3.277 5.164 5.556A.96.96 0 0 0 5.36 6.84l1.634 1.278a.89.89 0 0 0 1.26-.162c.95-1.226 1.653-1.932 3.136-1.932 1.165 0 2.607.773 2.607 1.939 0 .88-.705 1.333-1.856 1.998-1.342.776-3.118 1.742-3.118 4.157v.382c0 .518.407.938.909.938h2.746c.502 0 .91-.42.91-.938v-.226c0-1.674 4.745-1.743 4.745-6.274 0-3.412-3.432-6-6.648-6m-.38 14.588c-1.447 0-2.625 1.214-2.625 2.706S9.858 22 11.305 22s2.624-1.214 2.624-2.706-1.177-2.706-2.624-2.706"})]}),SvgIconOneMessaging=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.051 12.366a456 456 0 0 1-2.746-1.822A6.5 6.5 0 0 1 .74 9.067q-.737-.94-.737-1.745a2.7 2.7 0 0 1 .141-.905c.098-.286.242-.542.424-.752Q1.12 5 2.15 5h19.7c.541-.016 1.071.195 1.507.6q.636.6.636 1.446 0 1.01-.657 1.93a6.2 6.2 0 0 1-1.632 1.567q-5.037 3.338-6.267 4.156l-.242.167-.323.222q-.436.303-.724.487-.288.183-.696.415a4 4 0 0 1-.77.345 2.2 2.2 0 0 1-.67.115h-.026a2.2 2.2 0 0 1-.67-.116 4 4 0 0 1-.77-.344q-.41-.23-.697-.415a30 30 0 0 1-.723-.487q-.433-.3-.565-.389-1.215-.817-3.51-2.334m10.943 3.962q2.276-1.578 6.667-4.416c.478-.306.927-.68 1.339-1.113v10.16q0 .845-.63 1.446c-.437.405-.97.614-1.512.594H2.149c-.545.02-1.08-.192-1.52-.601C.21 21.996 0 21.52 0 20.95V10.8c.416.437.871.81 1.356 1.113q4.848 3.148 6.656 4.416.768.537 1.243.837a7.7 7.7 0 0 0 1.265.614c.475.198.97.303 1.47.313h.026c.5-.01.995-.115 1.47-.313a7.7 7.7 0 0 0 1.265-.614q.48-.3 1.243-.837",clipRule:"evenodd"})]}),SvgIconUserbook=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M0 24.58V.53h24.05v4.28h-2.62V7.1h2.62v4.28h-2.62v2.35h2.62V18h-2.62v2.3h2.62v4.29H0zm4.64-6.85h12.12V14l-4.5-2.67q.9-.46 1.4-1.3t.53-1.85q0-1.4-1.01-2.43T10.7 4.72 8.25 5.75 7.24 8.18q0 1.03.53 1.85t1.4 1.3L4.63 14v3.73z"})]});function useHeader({user:tt,avatar:et}){const{appCode:rt}=useEdificeClient(),{t:st}=useTranslation(),{theme:nt}=useEdificeTheme(),ot=st(rt),[at,lt]=reactExports.useState(!0),[ut,ct]=useHover$1(),dt=reactExports.useId(),ht=reactExports.useId(),ft=et,xt=tt==null?void 0:tt.username,yt=st("welcome",{username:tt==null?void 0:tt.firstName}),vt=useBookmark(),Et=useHasWorkflow("net.atos.entng.community.controllers.CommunityController|view"),bt=useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"),wt=useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"),St=reactExports.useCallback(()=>{lt(!at)},[at]),Rt=async()=>{await odeServices.session().logout(),window.location.href=(nt==null?void 0:nt.logoutCallback)??"/auth/login"};return reactExports.useMemo(()=>({title:ot,bookmarkedApps:vt,appsRef:ut,isAppsHovered:ct,popoverAppsId:dt,popoverSearchId:ht,userAvatar:ft,userName:xt,welcomeUser:yt,communityWorkflow:Et,conversationWorflow:bt,searchWorkflow:wt,isCollapsed:at,toggleCollapsedNav:St,handleLogout:Rt}),[ut,vt,Et,bt,Rt,ct,at,dt,ht,wt,ot,St,ft,xt,yt])}function Help({isHelpOpen:tt,setIsHelpOpen:et,parsedHeadline:rt,parsedContent:st,error:nt}){const{t:ot}=useTranslation(),at=()=>{et(!1)};return tt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"help-modal",isOpen:tt,onModalClose:at,scrollable:!0,size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:at,children:ot("navbar.help")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:nt?ot("help.notfound.title"):rt}),jsxRuntimeExports.jsx(Modal.Body,{className:nt?"d-flex":null,children:nt?ot("help.notfound.text"):st})]}),document.getElementById("portal")):null}function Navbar({children:tt,className:et,...rt}){const st=clsx("navbar",et);return jsxRuntimeExports.jsx("nav",{className:st,...rt,children:tt})}function NavBarNav({children:tt,className:et,...rt}){const st=clsx("navbar-nav",et);return jsxRuntimeExports.jsx("ul",{className:st,...rt,children:tt})}const NavItem=reactExports.forwardRef(({children:tt,className:et,...rt},st)=>{const nt=clsx("nav-item",et);return jsxRuntimeExports.jsx("li",{ref:st,className:nt,...rt,children:tt})});function NavLink({link:tt,className:et,children:rt,translate:st,...nt}){const ot=clsx("nav-link",et);return jsxRuntimeExports.jsxs("a",{href:tt,className:ot,...nt,children:[rt,st&&jsxRuntimeExports.jsx(VisuallyHidden,{children:jsxRuntimeExports.jsx("span",{className:"nav-text",children:st})})]})}const SvgIconSearch=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M1.27 11.552a7.75 7.75 0 0 1 0-4.156Q1.84 5.33 3.42 3.792a7.9 7.9 0 0 1 2.716-1.777q1.53-.6 3.161-.6 1.605 0 3.136.6 1.53.6 2.716 1.777a7.9 7.9 0 0 1 1.902 2.86 7.8 7.8 0 0 1 .518 3.29 7.65 7.65 0 0 1-.889 3.171q.692.192 1.21.697l4.297 4.156q.864.84.864 2.042t-.864 2.042-2.099.841-2.099-.84l-4.272-4.18a2.42 2.42 0 0 1-.74-1.178 8.3 8.3 0 0 1-3.68.84q-1.63 0-3.16-.6a8.1 8.1 0 0 1-2.717-1.753 7.85 7.85 0 0 1-2.149-3.628m2.495-2.066q0 2.235 1.605 3.796 1.63 1.56 3.926 1.561 2.272 0 3.877-1.561 1.605-1.562 1.63-3.796t-1.63-3.796q-1.63-1.585-3.877-1.585-2.272 0-3.926 1.585-1.605 1.561-1.605 3.796"})]}),PopoverBody=({children:tt,className:et})=>{const rt=clsx("popover-body",et);return jsxRuntimeExports.jsx("div",{className:rt,children:tt})},PopoverFooter=({children:tt,className:et})=>{const rt=clsx("popover-footer p-8",et);return jsxRuntimeExports.jsx("div",{className:rt,children:tt})},Popover=reactExports.forwardRef(({children:tt,className:et,id:rt,isVisible:st,...nt},ot)=>{const at=clsx("popover d-block position-absolute top-100 start-50 translate-middle-x",et);return useTransition(st,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((lt,ut)=>ut&&jsxRuntimeExports.jsx(animated.div,{ref:ot,"aria-labelledby":rt,className:at,role:"tooltip",style:lt,...nt,children:tt}))}),SearchEngine=()=>{const[tt,et]=useHover(),rt=reactExports.useRef(null),st=reactExports.useId(),{t:nt}=useTranslation();function ot(){if(rt.current){const at=rt.current.value;window.location.href=`/searchengine#/${at}`}}return jsxRuntimeExports.jsxs(NavItem,{id:st,ref:tt,className:"position-relative","aria-haspopup":"true","aria-expanded":et,children:[jsxRuntimeExports.jsxs("a",{href:"/searchengine",className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(SvgIconSearch,{className:"icon search"}),jsxRuntimeExports.jsx("span",{className:"nav-text",children:nt("navbar.search")})]}),jsxRuntimeExports.jsx(Popover,{id:st,isVisible:et,className:"d-none d-md-flex",children:jsxRuntimeExports.jsxs(FormControl,{id:"my-search-input",className:"search-text input-group py-8 px-12",children:[jsxRuntimeExports.jsx(FormControl.Input,{ref:rt,size:"sm",type:"text",name:"my-search-input",placeholder:"Rechercher"}),jsxRuntimeExports.jsx(SearchButton,{type:"submit",size:"sm",onClick:ot,"aria-label":nt("navbar.search")})]})})]})},WidgetAppsFooter=()=>{const{t:tt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"widget-footer",children:jsxRuntimeExports.jsx("div",{className:"widget-footer-action",children:jsxRuntimeExports.jsx("a",{href:"/welcome",className:"link",children:tt("plus")})})})},WidgetAppsBody=({bookmarkedApps:tt})=>{const{t:et}=useTranslation();return jsxRuntimeExports.jsxs("div",{className:"widget-body d-flex flex-wrap",children:[!tt.length&&jsxRuntimeExports.jsx("div",{className:"text-dark",children:et("navbar.myapps.more")}),tt.slice(0,6).map((rt,st)=>jsxRuntimeExports.jsx("a",{href:rt.address,className:"bookmarked-app",children:jsxRuntimeExports.jsx(AppIcon,{app:rt,size:"32"})},st))]})};var lib$2={},lib$1={};(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.Doctype=tt.CDATA=tt.Tag=tt.Style=tt.Script=tt.Comment=tt.Directive=tt.Text=tt.Root=tt.isTag=tt.ElementType=void 0;var et;(function(st){st.Root="root",st.Text="text",st.Directive="directive",st.Comment="comment",st.Script="script",st.Style="style",st.Tag="tag",st.CDATA="cdata",st.Doctype="doctype"})(et=tt.ElementType||(tt.ElementType={}));function rt(st){return st.type===et.Tag||st.type===et.Script||st.type===et.Style}tt.isTag=rt,tt.Root=et.Root,tt.Text=et.Text,tt.Directive=et.Directive,tt.Comment=et.Comment,tt.Script=et.Script,tt.Style=et.Style,tt.Tag=et.Tag,tt.CDATA=et.CDATA,tt.Doctype=et.Doctype})(lib$1);var node={},__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var tt=function(et,rt){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(st,nt){st.__proto__=nt}||function(st,nt){for(var ot in nt)Object.prototype.hasOwnProperty.call(nt,ot)&&(st[ot]=nt[ot])},tt(et,rt)};return function(et,rt){if(typeof rt!="function"&&rt!==null)throw new TypeError("Class extends value "+String(rt)+" is not a constructor or null");tt(et,rt);function st(){this.constructor=et}et.prototype=rt===null?Object.create(rt):(st.prototype=rt.prototype,new st)}}(),__assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function(tt){for(var et,rt=1,st=arguments.length;rt<st;rt++){et=arguments[rt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(tt[nt]=et[nt])}return tt},__assign.apply(this,arguments)};Object.defineProperty(node,"__esModule",{value:!0});node.cloneNode=node.hasChildren=node.isDocument=node.isDirective=node.isComment=node.isText=node.isCDATA=node.isTag=node.Element=node.Document=node.CDATA=node.NodeWithChildren=node.ProcessingInstruction=node.Comment=node.Text=node.DataNode=node.Node=void 0;var domelementtype_1=lib$1,Node$1=function(){function tt(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(tt.prototype,"parentNode",{get:function(){return this.parent},set:function(et){this.parent=et},enumerable:!1,configurable:!0}),Object.defineProperty(tt.prototype,"previousSibling",{get:function(){return this.prev},set:function(et){this.prev=et},enumerable:!1,configurable:!0}),Object.defineProperty(tt.prototype,"nextSibling",{get:function(){return this.next},set:function(et){this.next=et},enumerable:!1,configurable:!0}),tt.prototype.cloneNode=function(et){return et===void 0&&(et=!1),cloneNode(this,et)},tt}();node.Node=Node$1;var DataNode=function(tt){__extends(et,tt);function et(rt){var st=tt.call(this)||this;return st.data=rt,st}return Object.defineProperty(et.prototype,"nodeValue",{get:function(){return this.data},set:function(rt){this.data=rt},enumerable:!1,configurable:!0}),et}(Node$1);node.DataNode=DataNode;var Text$1=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Text,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),et}(DataNode);node.Text=Text$1;var Comment$1=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Comment,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),et}(DataNode);node.Comment=Comment$1;var ProcessingInstruction$1=function(tt){__extends(et,tt);function et(rt,st){var nt=tt.call(this,st)||this;return nt.name=rt,nt.type=domelementtype_1.ElementType.Directive,nt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),et}(DataNode);node.ProcessingInstruction=ProcessingInstruction$1;var NodeWithChildren=function(tt){__extends(et,tt);function et(rt){var st=tt.call(this)||this;return st.children=rt,st}return Object.defineProperty(et.prototype,"firstChild",{get:function(){var rt;return(rt=this.children[0])!==null&&rt!==void 0?rt:null},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"childNodes",{get:function(){return this.children},set:function(rt){this.children=rt},enumerable:!1,configurable:!0}),et}(Node$1);node.NodeWithChildren=NodeWithChildren;var CDATA=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.CDATA,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.CDATA=CDATA;var Document=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Root,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.Document=Document;var Element$2=function(tt){__extends(et,tt);function et(rt,st,nt,ot){nt===void 0&&(nt=[]),ot===void 0&&(ot=rt==="script"?domelementtype_1.ElementType.Script:rt==="style"?domelementtype_1.ElementType.Style:domelementtype_1.ElementType.Tag);var at=tt.call(this,nt)||this;return at.name=rt,at.attribs=st,at.type=ot,at}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"tagName",{get:function(){return this.name},set:function(rt){this.name=rt},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"attributes",{get:function(){var rt=this;return Object.keys(this.attribs).map(function(st){var nt,ot;return{name:st,value:rt.attribs[st],namespace:(nt=rt["x-attribsNamespace"])===null||nt===void 0?void 0:nt[st],prefix:(ot=rt["x-attribsPrefix"])===null||ot===void 0?void 0:ot[st]}})},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.Element=Element$2;function isTag(tt){return(0,domelementtype_1.isTag)(tt)}node.isTag=isTag;function isCDATA(tt){return tt.type===domelementtype_1.ElementType.CDATA}node.isCDATA=isCDATA;function isText(tt){return tt.type===domelementtype_1.ElementType.Text}node.isText=isText;function isComment(tt){return tt.type===domelementtype_1.ElementType.Comment}node.isComment=isComment;function isDirective(tt){return tt.type===domelementtype_1.ElementType.Directive}node.isDirective=isDirective;function isDocument(tt){return tt.type===domelementtype_1.ElementType.Root}node.isDocument=isDocument;function hasChildren(tt){return Object.prototype.hasOwnProperty.call(tt,"children")}node.hasChildren=hasChildren;function cloneNode(tt,et){et===void 0&&(et=!1);var rt;if(isText(tt))rt=new Text$1(tt.data);else if(isComment(tt))rt=new Comment$1(tt.data);else if(isTag(tt)){var st=et?cloneChildren(tt.children):[],nt=new Element$2(tt.name,__assign({},tt.attribs),st);st.forEach(function(ut){return ut.parent=nt}),tt.namespace!=null&&(nt.namespace=tt.namespace),tt["x-attribsNamespace"]&&(nt["x-attribsNamespace"]=__assign({},tt["x-attribsNamespace"])),tt["x-attribsPrefix"]&&(nt["x-attribsPrefix"]=__assign({},tt["x-attribsPrefix"])),rt=nt}else if(isCDATA(tt)){var st=et?cloneChildren(tt.children):[],ot=new CDATA(st);st.forEach(function(ct){return ct.parent=ot}),rt=ot}else if(isDocument(tt)){var st=et?cloneChildren(tt.children):[],at=new Document(st);st.forEach(function(ct){return ct.parent=at}),tt["x-mode"]&&(at["x-mode"]=tt["x-mode"]),rt=at}else if(isDirective(tt)){var lt=new ProcessingInstruction$1(tt.name,tt.data);tt["x-name"]!=null&&(lt["x-name"]=tt["x-name"],lt["x-publicId"]=tt["x-publicId"],lt["x-systemId"]=tt["x-systemId"]),rt=lt}else throw new Error("Not implemented yet: ".concat(tt.type));return rt.startIndex=tt.startIndex,rt.endIndex=tt.endIndex,tt.sourceCodeLocation!=null&&(rt.sourceCodeLocation=tt.sourceCodeLocation),rt}node.cloneNode=cloneNode;function cloneChildren(tt){for(var et=tt.map(function(st){return cloneNode(st,!0)}),rt=1;rt<et.length;rt++)et[rt].prev=et[rt-1],et[rt-1].next=et[rt];return et}(function(tt){var et=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(lt,ut,ct,dt){dt===void 0&&(dt=ct);var ht=Object.getOwnPropertyDescriptor(ut,ct);(!ht||("get"in ht?!ut.__esModule:ht.writable||ht.configurable))&&(ht={enumerable:!0,get:function(){return ut[ct]}}),Object.defineProperty(lt,dt,ht)}:function(lt,ut,ct,dt){dt===void 0&&(dt=ct),lt[dt]=ut[ct]}),rt=commonjsGlobal&&commonjsGlobal.__exportStar||function(lt,ut){for(var ct in lt)ct!=="default"&&!Object.prototype.hasOwnProperty.call(ut,ct)&&et(ut,lt,ct)};Object.defineProperty(tt,"__esModule",{value:!0}),tt.DomHandler=void 0;var st=lib$1,nt=node;rt(node,tt);var ot={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},at=function(){function lt(ut,ct,dt){this.dom=[],this.root=new nt.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof ct=="function"&&(dt=ct,ct=ot),typeof ut=="object"&&(ct=ut,ut=void 0),this.callback=ut??null,this.options=ct??ot,this.elementCB=dt??null}return lt.prototype.onparserinit=function(ut){this.parser=ut},lt.prototype.onreset=function(){this.dom=[],this.root=new nt.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},lt.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},lt.prototype.onerror=function(ut){this.handleCallback(ut)},lt.prototype.onclosetag=function(){this.lastNode=null;var ut=this.tagStack.pop();this.options.withEndIndices&&(ut.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(ut)},lt.prototype.onopentag=function(ut,ct){var dt=this.options.xmlMode?st.ElementType.Tag:void 0,ht=new nt.Element(ut,ct,void 0,dt);this.addNode(ht),this.tagStack.push(ht)},lt.prototype.ontext=function(ut){var ct=this.lastNode;if(ct&&ct.type===st.ElementType.Text)ct.data+=ut,this.options.withEndIndices&&(ct.endIndex=this.parser.endIndex);else{var dt=new nt.Text(ut);this.addNode(dt),this.lastNode=dt}},lt.prototype.oncomment=function(ut){if(this.lastNode&&this.lastNode.type===st.ElementType.Comment){this.lastNode.data+=ut;return}var ct=new nt.Comment(ut);this.addNode(ct),this.lastNode=ct},lt.prototype.oncommentend=function(){this.lastNode=null},lt.prototype.oncdatastart=function(){var ut=new nt.Text(""),ct=new nt.CDATA([ut]);this.addNode(ct),ut.parent=ct,this.lastNode=ut},lt.prototype.oncdataend=function(){this.lastNode=null},lt.prototype.onprocessinginstruction=function(ut,ct){var dt=new nt.ProcessingInstruction(ut,ct);this.addNode(dt)},lt.prototype.handleCallback=function(ut){if(typeof this.callback=="function")this.callback(ut,this.dom);else if(ut)throw ut},lt.prototype.addNode=function(ut){var ct=this.tagStack[this.tagStack.length-1],dt=ct.children[ct.children.length-1];this.options.withStartIndices&&(ut.startIndex=this.parser.startIndex),this.options.withEndIndices&&(ut.endIndex=this.parser.endIndex),ct.children.push(ut),dt&&(ut.prev=dt,dt.next=ut),ut.parent=ct,this.lastNode=null},lt}();tt.DomHandler=at,tt.default=at})(lib$2);var HTML="html",HEAD="head",BODY="body",FIRST_TAG_REGEX=/<([a-zA-Z]+[0-9]?)/,HEAD_TAG_REGEX=/<head[^]*>/i,BODY_TAG_REGEX=/<body[^]*>/i,parseFromDocument=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},parseFromString=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},DOMParser$1=typeof window=="object"&&window.DOMParser;if(typeof DOMParser$1=="function"){var domParser=new DOMParser$1,mimeType="text/html";parseFromString=function(tt,et){return et&&(tt="<"+et+">"+tt+"</"+et+">"),domParser.parseFromString(tt,mimeType)},parseFromDocument=parseFromString}if(typeof document=="object"&&document.implementation){var doc=document.implementation.createHTMLDocument();parseFromDocument=function(tt,et){if(et){var rt=doc.documentElement.querySelector(et);return rt.innerHTML=tt,doc}return doc.documentElement.innerHTML=tt,doc}}var template=typeof document=="object"?document.createElement("template"):{},parseFromTemplate;template.content&&(parseFromTemplate=function(tt){return template.innerHTML=tt,template.content.childNodes});function domparser$1(tt){var et,rt=tt.match(FIRST_TAG_REGEX);rt&&rt[1]&&(et=rt[1].toLowerCase());var st,nt,ot;switch(et){case HTML:return st=parseFromString(tt),HEAD_TAG_REGEX.test(tt)||(nt=st.querySelector(HEAD),nt&&nt.parentNode.removeChild(nt)),BODY_TAG_REGEX.test(tt)||(nt=st.querySelector(BODY),nt&&nt.parentNode.removeChild(nt)),st.querySelectorAll(HTML);case HEAD:case BODY:return st=parseFromDocument(tt),ot=st.querySelectorAll(et),BODY_TAG_REGEX.test(tt)&&HEAD_TAG_REGEX.test(tt)?ot[0].parentNode.childNodes:ot;default:return parseFromTemplate?parseFromTemplate(tt):(nt=parseFromDocument(tt,BODY).querySelector(BODY),nt.childNodes)}}var domparser_1=domparser$1,utilities$5={},constants$1={};constants$1.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"];var domhandler$1=lib$2,constants=constants$1,CASE_SENSITIVE_TAG_NAMES=constants.CASE_SENSITIVE_TAG_NAMES,Comment=domhandler$1.Comment,Element$1=domhandler$1.Element,ProcessingInstruction=domhandler$1.ProcessingInstruction,Text=domhandler$1.Text,caseSensitiveTagNamesMap={},tagName;for(var i=0,len=CASE_SENSITIVE_TAG_NAMES.length;i<len;i++)tagName=CASE_SENSITIVE_TAG_NAMES[i],caseSensitiveTagNamesMap[tagName.toLowerCase()]=tagName;function getCaseSensitiveTagName(tt){return caseSensitiveTagNamesMap[tt]}function formatAttributes(tt){for(var et={},rt,st=0,nt=tt.length;st<nt;st++)rt=tt[st],et[rt.name]=rt.value;return et}function formatTagName(tt){tt=tt.toLowerCase();var et=getCaseSensitiveTagName(tt);return et||tt}function formatDOM$1(tt,et,rt){et=et||null;for(var st=[],nt,ot=0,at=tt.length;ot<at;ot++){var lt=tt[ot],ut;switch(lt.nodeType){case 1:nt=formatTagName(lt.nodeName),ut=new Element$1(nt,formatAttributes(lt.attributes)),ut.children=formatDOM$1(nt==="template"?lt.content.childNodes:lt.childNodes,ut);break;case 3:ut=new Text(lt.nodeValue);break;case 8:ut=new Comment(lt.nodeValue);break;default:continue}var ct=st[ot-1]||null;ct&&(ct.next=ut),ut.parent=et,ut.prev=ct,ut.next=null,st.push(ut)}return rt&&(ut=new ProcessingInstruction(rt.substring(0,rt.indexOf(" ")).toLowerCase(),rt),ut.next=st[0]||null,ut.parent=et,st.unshift(ut),st[1]&&(st[1].prev=st[0])),st}utilities$5.formatAttributes=formatAttributes;utilities$5.formatDOM=formatDOM$1;var domparser=domparser_1,utilities$4=utilities$5,formatDOM=utilities$4.formatDOM,DIRECTIVE_REGEX=/<(![a-zA-Z\s]+)>/;function HTMLDOMParser(tt){if(typeof tt!="string")throw new TypeError("First argument must be a string");if(tt==="")return[];var et=tt.match(DIRECTIVE_REGEX),rt;return et&&et[1]&&(rt=et[1]),formatDOM(domparser(tt),null,rt)}var htmlToDom=HTMLDOMParser,lib={},possibleStandardNamesOptimized$1={},SAME$1=0;possibleStandardNamesOptimized$1.SAME=SAME$1;var CAMELCASE$1=1;possibleStandardNamesOptimized$1.CAMELCASE=CAMELCASE$1;possibleStandardNamesOptimized$1.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};Object.defineProperty(lib,"__esModule",{value:!0});function _slicedToArray(tt,et){return _arrayWithHoles(tt)||_iterableToArrayLimit(tt,et)||_unsupportedIterableToArray(tt,et)||_nonIterableRest()}function _arrayWithHoles(tt){if(Array.isArray(tt))return tt}function _iterableToArrayLimit(tt,et){var rt=tt==null?null:typeof Symbol<"u"&&tt[Symbol.iterator]||tt["@@iterator"];if(rt!=null){var st=[],nt=!0,ot=!1,at,lt;try{for(rt=rt.call(tt);!(nt=(at=rt.next()).done)&&(st.push(at.value),!(et&&st.length===et));nt=!0);}catch(ut){ot=!0,lt=ut}finally{try{!nt&&rt.return!=null&&rt.return()}finally{if(ot)throw lt}}return st}}function _unsupportedIterableToArray(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray(tt,et);var rt=Object.prototype.toString.call(tt).slice(8,-1);if(rt==="Object"&&tt.constructor&&(rt=tt.constructor.name),rt==="Map"||rt==="Set")return Array.from(tt);if(rt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(rt))return _arrayLikeToArray(tt,et)}}function _arrayLikeToArray(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var rt=0,st=new Array(et);rt<et;rt++)st[rt]=tt[rt];return st}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1394
1394
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var RESERVED=0,STRING=1,BOOLEANISH_STRING=2,BOOLEAN=3,OVERLOADED_BOOLEAN=4,NUMERIC=5,POSITIVE_NUMERIC=6;function getPropertyInfo(tt){return properties.hasOwnProperty(tt)?properties[tt]:null}function PropertyInfoRecord(tt,et,rt,st,nt,ot,at){this.acceptsBooleans=et===BOOLEANISH_STRING||et===BOOLEAN||et===OVERLOADED_BOOLEAN,this.attributeName=st,this.attributeNamespace=nt,this.mustUseProperty=rt,this.propertyName=tt,this.type=et,this.sanitizeURL=ot,this.removeEmptyString=at}var properties={},reservedProps=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];reservedProps.forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,RESERVED,!1,tt,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(tt){var et=_slicedToArray(tt,2),rt=et[0],st=et[1];properties[rt]=new PropertyInfoRecord(rt,STRING,!1,st,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEANISH_STRING,!1,tt.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEANISH_STRING,!1,tt,null,!1,!1)});["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEAN,!1,tt.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEAN,!0,tt,null,!1,!1)});["capture","download"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,OVERLOADED_BOOLEAN,!1,tt,null,!1,!1)});["cols","rows","size","span"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,POSITIVE_NUMERIC,!1,tt,null,!1,!1)});["rowSpan","start"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,NUMERIC,!1,tt.toLowerCase(),null,!1,!1)});var CAMELIZE=/[\-\:]([a-z])/g,capitalize$1=function tt(et){return et[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(tt){var et=tt.replace(CAMELIZE,capitalize$1);properties[et]=new PropertyInfoRecord(et,STRING,!1,tt,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(tt){var et=tt.replace(CAMELIZE,capitalize$1);properties[et]=new PropertyInfoRecord(et,STRING,!1,tt,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(tt){var et=tt.replace(CAMELIZE,capitalize$1);properties[et]=new PropertyInfoRecord(et,STRING,!1,tt,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,STRING,!1,tt.toLowerCase(),null,!1,!1)});var xlinkHref="xlinkHref";properties[xlinkHref]=new PropertyInfoRecord("xlinkHref",STRING,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,STRING,!1,tt.toLowerCase(),null,!0,!0)});var _require=possibleStandardNamesOptimized$1,CAMELCASE=_require.CAMELCASE,SAME=_require.SAME,possibleStandardNamesOptimized=_require.possibleStandardNames,ATTRIBUTE_NAME_START_CHAR=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ATTRIBUTE_NAME_CHAR=ATTRIBUTE_NAME_START_CHAR+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",isCustomAttribute=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+ATTRIBUTE_NAME_CHAR+"]*$")),possibleStandardNames=Object.keys(possibleStandardNamesOptimized).reduce(function(tt,et){var rt=possibleStandardNamesOptimized[et];return rt===SAME?tt[et]=et:rt===CAMELCASE?tt[et.toLowerCase()]=et:tt[et]=rt,tt},{});lib.BOOLEAN=BOOLEAN;lib.BOOLEANISH_STRING=BOOLEANISH_STRING;lib.NUMERIC=NUMERIC;lib.OVERLOADED_BOOLEAN=OVERLOADED_BOOLEAN;lib.POSITIVE_NUMERIC=POSITIVE_NUMERIC;lib.RESERVED=RESERVED;lib.STRING=STRING;lib.getPropertyInfo=getPropertyInfo;lib.isCustomAttribute=isCustomAttribute;lib.possibleStandardNames=possibleStandardNames;var cjs={},styleToObject={exports:{}},COMMENT_REGEX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NEWLINE_REGEX=/\n/g,WHITESPACE_REGEX=/^\s*/,PROPERTY_REGEX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,COLON_REGEX=/^:\s*/,VALUE_REGEX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SEMICOLON_REGEX=/^[;\s]*/,TRIM_REGEX=/^\s+|\s+$/g,NEWLINE=`
|
|
1395
1395
|
`,FORWARD_SLASH="/",ASTERISK="*",EMPTY_STRING="",TYPE_COMMENT="comment",TYPE_DECLARATION="declaration",inlineStyleParser=function(tt,et){if(typeof tt!="string")throw new TypeError("First argument must be a string");if(!tt)return[];et=et||{};var rt=1,st=1;function nt(yt){var vt=yt.match(NEWLINE_REGEX);vt&&(rt+=vt.length);var Et=yt.lastIndexOf(NEWLINE);st=~Et?yt.length-Et:st+yt.length}function ot(){var yt={line:rt,column:st};return function(vt){return vt.position=new at(yt),ct(),vt}}function at(yt){this.start=yt,this.end={line:rt,column:st},this.source=et.source}at.prototype.content=tt;function lt(yt){var vt=new Error(et.source+":"+rt+":"+st+": "+yt);if(vt.reason=yt,vt.filename=et.source,vt.line=rt,vt.column=st,vt.source=tt,!et.silent)throw vt}function ut(yt){var vt=yt.exec(tt);if(vt){var Et=vt[0];return nt(Et),tt=tt.slice(Et.length),vt}}function ct(){ut(WHITESPACE_REGEX)}function dt(yt){var vt;for(yt=yt||[];vt=ht();)vt!==!1&&yt.push(vt);return yt}function ht(){var yt=ot();if(!(FORWARD_SLASH!=tt.charAt(0)||ASTERISK!=tt.charAt(1))){for(var vt=2;EMPTY_STRING!=tt.charAt(vt)&&(ASTERISK!=tt.charAt(vt)||FORWARD_SLASH!=tt.charAt(vt+1));)++vt;if(vt+=2,EMPTY_STRING===tt.charAt(vt-1))return lt("End of comment missing");var Et=tt.slice(2,vt-2);return st+=2,nt(Et),tt=tt.slice(vt),st+=2,yt({type:TYPE_COMMENT,comment:Et})}}function ft(){var yt=ot(),vt=ut(PROPERTY_REGEX);if(vt){if(ht(),!ut(COLON_REGEX))return lt("property missing ':'");var Et=ut(VALUE_REGEX),bt=yt({type:TYPE_DECLARATION,property:trim(vt[0].replace(COMMENT_REGEX,EMPTY_STRING)),value:Et?trim(Et[0].replace(COMMENT_REGEX,EMPTY_STRING)):EMPTY_STRING});return ut(SEMICOLON_REGEX),bt}}function xt(){var yt=[];dt(yt);for(var vt;vt=ft();)vt!==!1&&(yt.push(vt),dt(yt));return yt}return ct(),xt()};function trim(tt){return tt?tt.replace(TRIM_REGEX,EMPTY_STRING):EMPTY_STRING}var parse=inlineStyleParser;function StyleToObject(tt,et){var rt=null;if(!tt||typeof tt!="string")return rt;for(var st,nt=parse(tt),ot=typeof et=="function",at,lt,ut=0,ct=nt.length;ut<ct;ut++)st=nt[ut],at=st.property,lt=st.value,ot?et(at,lt,st):lt&&(rt||(rt={}),rt[at]=lt);return rt}styleToObject.exports=StyleToObject;styleToObject.exports.default=StyleToObject;var styleToObjectExports=styleToObject.exports,utilities$3={};utilities$3.__esModule=!0;utilities$3.camelCase=void 0;var CUSTOM_PROPERTY_REGEX=/^--[a-zA-Z0-9-]+$/,HYPHEN_REGEX=/-([a-z])/g,NO_HYPHEN_REGEX=/^[^-]+$/,VENDOR_PREFIX_REGEX=/^-(webkit|moz|ms|o|khtml)-/,MS_VENDOR_PREFIX_REGEX=/^-(ms)-/,skipCamelCase=function(tt){return!tt||NO_HYPHEN_REGEX.test(tt)||CUSTOM_PROPERTY_REGEX.test(tt)},capitalize=function(tt,et){return et.toUpperCase()},trimHyphen=function(tt,et){return"".concat(et,"-")},camelCase=function(tt,et){return et===void 0&&(et={}),skipCamelCase(tt)?tt:(tt=tt.toLowerCase(),et.reactCompat?tt=tt.replace(MS_VENDOR_PREFIX_REGEX,trimHyphen):tt=tt.replace(VENDOR_PREFIX_REGEX,trimHyphen),tt.replace(HYPHEN_REGEX,capitalize))};utilities$3.camelCase=camelCase;(function(tt){var et=commonjsGlobal&&commonjsGlobal.__importDefault||function(ot){return ot&&ot.__esModule?ot:{default:ot}};tt.__esModule=!0;var rt=et(styleToObjectExports),st=utilities$3;function nt(ot,at){var lt={};return!ot||typeof ot!="string"||(0,rt.default)(ot,function(ut,ct){ut&&ct&&(lt[(0,st.camelCase)(ut,at)]=ct)}),lt}tt.default=nt})(cjs);var React$3=reactExports,styleToJS=cjs.default;function invertObject(tt,et){if(!tt||typeof tt!="object")throw new TypeError("First argument must be an object");var rt=typeof et=="function",st={},nt={};for(var ot in tt){var at=tt[ot];if(rt&&(st=et(ot,at),st&&st.length===2)){nt[st[0]]=st[1];continue}typeof at=="string"&&(nt[at]=ot)}return nt}var RESERVED_SVG_MATHML_ELEMENTS=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function isCustomComponent(tt,et){return tt.indexOf("-")===-1?et&&typeof et.is=="string":!RESERVED_SVG_MATHML_ELEMENTS.has(tt)}var STYLE_TO_JS_OPTIONS={reactCompat:!0};function setStyleProp$1(tt,et){if(tt!=null)try{et.style=styleToJS(tt,STYLE_TO_JS_OPTIONS)}catch{et.style={}}}var PRESERVE_CUSTOM_ATTRIBUTES=React$3.version.split(".")[0]>=16,ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);function canTextBeChildOfNode$1(tt){return!ELEMENTS_WITH_NO_TEXT_CHILDREN.has(tt.name)}function returnFirstArg(tt){return tt}var utilities$2={PRESERVE_CUSTOM_ATTRIBUTES,ELEMENTS_WITH_NO_TEXT_CHILDREN,invertObject,isCustomComponent,setStyleProp:setStyleProp$1,canTextBeChildOfNode:canTextBeChildOfNode$1,returnFirstArg},reactProperty=lib,utilities$1=utilities$2,UNCONTROLLED_COMPONENT_ATTRIBUTES=["checked","value"],UNCONTROLLED_COMPONENT_NAMES=["input","select","textarea"],VALUE_ONLY_INPUTS={reset:!0,submit:!0},attributesToProps$3=function tt(et,rt){et=et||{};var st,nt,ot,at,lt,ut={},ct=et.type&&VALUE_ONLY_INPUTS[et.type];for(st in et){if(ot=et[st],reactProperty.isCustomAttribute(st)){ut[st]=ot;continue}if(nt=st.toLowerCase(),at=getPropName(nt),at){switch(lt=reactProperty.getPropertyInfo(at),UNCONTROLLED_COMPONENT_ATTRIBUTES.indexOf(at)!==-1&&UNCONTROLLED_COMPONENT_NAMES.indexOf(rt)!==-1&&!ct&&(at=getPropName("default"+nt)),ut[at]=ot,lt&<.type){case reactProperty.BOOLEAN:ut[at]=!0;break;case reactProperty.OVERLOADED_BOOLEAN:ot===""&&(ut[at]=!0);break}continue}utilities$1.PRESERVE_CUSTOM_ATTRIBUTES&&(ut[st]=ot)}return utilities$1.setStyleProp(et.style,ut),ut};function getPropName(tt){return reactProperty.possibleStandardNames[tt]}var React$2=reactExports,attributesToProps$2=attributesToProps$3,utilities=utilities$2,setStyleProp=utilities.setStyleProp,canTextBeChildOfNode=utilities.canTextBeChildOfNode;function domToReact$2(tt,et){et=et||{};for(var rt=et.library||React$2,st=rt.cloneElement,nt=rt.createElement,ot=rt.isValidElement,at=[],lt,ut,ct=typeof et.replace=="function",dt=et.transform||utilities.returnFirstArg,ht,ft,xt,yt=et.trim,vt=0,Et=tt.length;vt<Et;vt++){if(lt=tt[vt],ct&&(ht=et.replace(lt),ot(ht))){Et>1&&(ht=st(ht,{key:ht.key||vt})),at.push(dt(ht,lt,vt));continue}if(lt.type==="text"){if(ut=!lt.data.trim().length,ut&<.parent&&!canTextBeChildOfNode(lt.parent)||yt&&ut)continue;at.push(dt(lt.data,lt,vt));continue}switch(ft=lt.attribs,skipAttributesToProps(lt)?setStyleProp(ft.style,ft):ft&&(ft=attributesToProps$2(ft,lt.name)),xt=null,lt.type){case"script":case"style":lt.children[0]&&(ft.dangerouslySetInnerHTML={__html:lt.children[0].data});break;case"tag":lt.name==="textarea"&<.children[0]?ft.defaultValue=lt.children[0].data:lt.children&<.children.length&&(xt=domToReact$2(lt.children,et));break;default:continue}Et>1&&(ft.key=vt),at.push(dt(nt(lt.name,ft,xt),lt,vt))}return at.length===1?at[0]:at}function skipAttributesToProps(tt){return utilities.PRESERVE_CUSTOM_ATTRIBUTES&&tt.type==="tag"&&utilities.isCustomComponent(tt.name,tt.attribs)}var domToReact_1=domToReact$2,domhandler=lib$2,htmlToDOM=htmlToDom,attributesToProps$1=attributesToProps$3,domToReact$1=domToReact_1;htmlToDOM=typeof htmlToDOM.default=="function"?htmlToDOM.default:htmlToDOM;var domParserOptions={lowerCaseAttributeNames:!1};function HTMLReactParser(tt,et){if(typeof tt!="string")throw new TypeError("First argument must be a string");return tt===""?[]:(et=et||{},domToReact$1(htmlToDOM(tt,et.htmlparser2||domParserOptions),et))}HTMLReactParser.domToReact=domToReact$1;HTMLReactParser.htmlToDOM=htmlToDOM;HTMLReactParser.attributesToProps=attributesToProps$1;HTMLReactParser.Comment=domhandler.Comment;HTMLReactParser.Element=domhandler.Element;HTMLReactParser.ProcessingInstruction=domhandler.ProcessingInstruction;HTMLReactParser.Text=domhandler.Text;var htmlReactParser=HTMLReactParser;HTMLReactParser.default=HTMLReactParser;const HTMLReactParser$1=getDefaultExportFromCjs(htmlReactParser);var domToReact=HTMLReactParser$1.domToReact;HTMLReactParser$1.htmlToDOM;var attributesToProps=HTMLReactParser$1.attributesToProps;HTMLReactParser$1.Comment;HTMLReactParser$1.Element;HTMLReactParser$1.ProcessingInstruction;HTMLReactParser$1.Text;const SvgIconBurgerMenu=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M21 5c0 .828-.711 1.5-1.588 1.5H4.588C3.711 6.5 3 5.828 3 5s.711-1.5 1.588-1.5h14.824C20.289 3.5 21 4.172 21 5M21 12c0 .828-.711 1.5-1.588 1.5H4.588C3.711 13.5 3 12.828 3 12s.711-1.5 1.588-1.5h14.824c.877 0 1.588.672 1.588 1.5M21 19c0 .828-.711 1.5-1.588 1.5H4.588C3.711 20.5 3 19.828 3 19s.711-1.5 1.588-1.5h14.824c.877 0 1.588.672 1.588 1.5",clipRule:"evenodd"})]});function useHelp(tt){var et,rt,st,nt,ot;const{appCode:at}=useEdificeClient(),{theme:lt}=useEdificeTheme(),[ut,ct]=reactExports.useState(""),[dt,ht]=reactExports.useState(!0),[ft,xt]=reactExports.useState("présentation"),[yt,vt]=reactExports.useState(!1),[Et,bt]=reactExports.useState(!1),wt=lt!=null&<.is1d?"/help-1d":"/help-2d";reactExports.useEffect(()=>{tt&&(async()=>{let Pt="";Pt=wt+"/application/"+at+"/",!at&&window.location.pathname!=="/adapter"?Pt=wt+"/application/portal/":window.location.pathname==="/adapter"?Pt=wt+"/application/"+window.location.search.split("eliot=")[1].split("&")[0]+"/":window.location.pathname.includes("/directory/class-admin")?Pt=wt+"/application/parametrage-de-la-classe/":(window.location.pathname.includes("/userbook/mon-compte")||window.location.pathname.includes("/timeline/preferencesView")||window.location.pathname.includes("/timeline/historyView"))&&(Pt=wt+"/application/userbook/");try{const It=await fetch(Pt),jt=await It.text();if(It.status===404){bt(!0);return}ct(jt),bt(!1)}catch(It){bt(!0),console.error(It)}})()},[at,wt]);const St=HTMLReactParser$1(ut,{replace:Pt=>{var It;const jt=Pt,Dt=((It=jt.attribs)==null?void 0:It.id)===ft;if(jt.attribs&&jt.attribs.id==="TOC")return jsxRuntimeExports.jsxs("nav",{id:"TOC",children:[jsxRuntimeExports.jsx(Button,{onClick:()=>{ht(!dt)},children:jsxRuntimeExports.jsx(SvgIconBurgerMenu,{})}),domToReact(jt.children,{replace:Ht=>{const Nt=Ht;if(Nt.attribs&&Nt.name==="ul")return jsxRuntimeExports.jsx("ul",{id:"TOC-list",style:{display:dt?"block":"none"},children:domToReact(Nt.children,{replace:Ut=>{const Lt=Ut;if(Lt.attribs&&Lt.name==="a"){const kt=Lt.attribs.href.replace("#","");return jsxRuntimeExports.jsx("span",{onClick:Mt=>{Mt.preventDefault(),xt(kt),ht(!1)},children:domToReact(Lt.children)})}}})})}})]});if(jt.attribs&&jt.attribs.class==="section level2"){const Ht=attributesToProps(Pt.attribs);return jsxRuntimeExports.jsx("div",{...Ht,className:"section level2",hidden:!Dt,children:domToReact(jt.children,{replace:Nt=>{const Ut=Nt;if(Ut.attribs&&Ut.name==="img"){const Lt=Nt.attribs.src;return jsxRuntimeExports.jsx("img",{...attributesToProps(Ut.attribs),src:`${wt}/${Lt}`,alt:""})}}})})}}}),Rt=(st=(rt=(et=St==null?void 0:St.props)==null?void 0:et.children.find(Pt=>Pt.type==="body"))==null?void 0:rt.props)==null?void 0:st.children,Ct=(ot=(nt=Rt==null?void 0:Rt.find(Pt=>Pt.type==="p"))==null?void 0:nt.props)==null?void 0:ot.children;return{html:ut,visibility:dt,isModalOpen:yt,setIsModalOpen:vt,parsedContent:Rt,parsedHeadline:Ct,error:Et}}const Header=({is1d:tt=!1,src:et=""})=>{const{t:rt}=useTranslation(),{messages:st,msgLink:nt,zimbraWorkflow:ot}=useConversation(),{user:at,avatar:lt}=useUser(),{currentLanguage:ut,currentApp:ct}=useEdificeClient(),dt=useHasWorkflow("org.entcore.portal.controllers.PortalController|oldHelpEnable")||!1,{isModalOpen:ht,setIsModalOpen:ft,parsedContent:xt,parsedHeadline:yt,error:vt}=useHelp(dt),Et=clsx("header",{"no-2d":tt,"no-1d":!tt}),{title:bt,bookmarkedApps:wt,appsRef:St,isAppsHovered:Rt,popoverAppsId:Ct,userAvatar:Pt,userName:It,welcomeUser:jt,communityWorkflow:Dt,conversationWorflow:Ht,searchWorkflow:Nt,isCollapsed:Ut,toggleCollapsedNav:Lt,handleLogout:kt}=useHeader({user:at,avatar:lt}),Mt=st>0,{theme:Bt}=useEdificeTheme();return jsxRuntimeExports.jsx("header",{className:Et,children:tt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"container-fluid",children:jsxRuntimeExports.jsxs(Navbar,{children:[jsxRuntimeExports.jsx("a",{className:"navbar-title d-md-none text-truncate h4",href:ct?ct.address:"/timeline/timeline",children:bt}),jsxRuntimeExports.jsxs("div",{className:"d-none d-md-inline-flex gap-12 align-items-center",children:[jsxRuntimeExports.jsx(Avatar,{alt:It,size:"sm",src:Pt,variant:"circle",width:"32",height:"32"}),jsxRuntimeExports.jsx("span",{className:"navbar-text",children:jt})]}),jsxRuntimeExports.jsxs(NavBarNav,{className:"gap-8","aria-hidden":"false","aria-label":rt("navbar.main.navigation"),children:[Ht&&jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/conversation/conversation",className:"nav-link",children:[jsxRuntimeExports.jsx(SvgIconOneMessaging,{className:"icon notification"}),Mt&&jsxRuntimeExports.jsx(Badge,{variant:{type:"notification",level:"danger"},className:"position-absolute",children:st}),jsxRuntimeExports.jsx(VisuallyHidden,{children:rt("navbar.messages")})]})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsx(NavLink,{link:"/userbook/mon-compte",className:"dropdown-item",translate:rt("navbar.myaccount"),children:jsxRuntimeExports.jsx(SvgIconOneProfile,{className:"icon user"})})}),ut==="fr"&&dt?jsxRuntimeExports.jsxs(NavItem,{children:[jsxRuntimeExports.jsxs("button",{className:"nav-link",onClick:()=>{ft(!0)},children:[jsxRuntimeExports.jsx(SvgIconOneAssistance,{className:"icon help"}),jsxRuntimeExports.jsx(VisuallyHidden,{children:rt("navbar.help")})]}),jsxRuntimeExports.jsx(Help,{isHelpOpen:ht,setIsHelpOpen:ft,parsedContent:xt,parsedHeadline:yt,error:vt})]}):null,jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("button",{className:"nav-link",onClick:kt,children:[jsxRuntimeExports.jsx(SvgIconDisconnect,{className:"icon logout"}),jsxRuntimeExports.jsx(VisuallyHidden,{children:rt("navbar.disconnect")})]})}),jsxRuntimeExports.jsx(NavItem,{className:"d-md-none",children:jsxRuntimeExports.jsx("button",{className:"nav-link btn btn-naked",type:"button","aria-controls":"navbarCollapsed","aria-expanded":!Ut,"aria-label":rt("navbar.secondary.navigation"),onClick:Lt,children:jsxRuntimeExports.jsx(SvgIconRafterDown,{className:"icon rafter-down",width:"20",height:"20"})})})]})]})}),jsxRuntimeExports.jsx(Navbar,{className:"no-2d navbar-secondary navbar-expand-md","aria-label":rt("navbar.secondary.navigation"),children:jsxRuntimeExports.jsx("div",{className:"container-fluid",children:jsxRuntimeExports.jsxs("div",{className:`collapse navbar-collapse ${Ut?"":"show"}`,id:"navbarCollapsed",children:[jsxRuntimeExports.jsx(Logo,{is1d:!0,src:`${et}/img/illustrations/logo.png`,translate:rt("navbar.home")}),jsxRuntimeExports.jsxs(NavBarNav,{className:"gap-8",children:[jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/timeline/timeline",className:"button",children:[jsxRuntimeExports.jsx(SvgIconNewRelease,{color:"#fff",className:"d-md-none"}),jsxRuntimeExports.jsx("span",{className:"d-inline-block",children:rt("portal.header.navigation.whatsnew")})]})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/userbook/annuaire",className:"button",children:[jsxRuntimeExports.jsx(SvgIconUserbook,{color:"#fff",className:"d-md-none"}),jsxRuntimeExports.jsx("span",{className:"d-inline-block",children:rt("portal.header.navigation.classMembers")})]})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/welcome",className:"button",children:[jsxRuntimeExports.jsx(SvgIconMyApps,{color:"#fff",className:"d-md-none"}),jsxRuntimeExports.jsx("span",{className:"d-inline-block",children:rt("portal.header.navigation.myapps")})]})})]})]})})})]}):jsxRuntimeExports.jsx(Navbar,{className:"navbar-expand-md",children:jsxRuntimeExports.jsxs("div",{className:"container-fluid",children:[jsxRuntimeExports.jsx(Logo,{src:`${et}/img/illustrations/logo.png`}),jsxRuntimeExports.jsx("a",{href:ct?ct.address:"/timeline/timeline",className:"navbar-title text-truncate d-md-none",children:bt}),jsxRuntimeExports.jsxs("ul",{className:"navbar-nav",children:[jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsx(NavLink,{link:"/timeline/timeline",translate:rt("navbar.home"),children:jsxRuntimeExports.jsx(SvgIconHome,{color:"#fff"})})}),jsxRuntimeExports.jsxs(NavItem,{className:"position-relative",ref:St,id:Ct,"aria-haspopup":"true","aria-expanded":Rt,children:[jsxRuntimeExports.jsx(NavLink,{link:"/welcome",translate:rt("navbar.applications"),children:jsxRuntimeExports.jsx(SvgIconMyApps,{color:"#fff"})}),jsxRuntimeExports.jsxs(Popover,{className:"top-100 widget",id:Ct,isVisible:Rt,children:[jsxRuntimeExports.jsx(PopoverBody,{children:jsxRuntimeExports.jsx(WidgetAppsBody,{bookmarkedApps:wt})}),jsxRuntimeExports.jsx(PopoverFooter,{className:"widget-footer border-top border-ghost",children:jsxRuntimeExports.jsx(WidgetAppsFooter,{})})]})]}),Ht&&jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs(NavLink,{className:"position-relative",link:"/conversation/conversation",translate:rt("conversation"),children:[jsxRuntimeExports.jsx(SvgIconNeoMessaging,{color:"#fff"}),Mt&&jsxRuntimeExports.jsx(Badge,{variant:{type:"notification",level:"warning"},className:"position-absolute",children:st})]})}),ot&&jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs(NavLink,{className:"position-relative",link:nt,translate:rt("conversation"),children:[jsxRuntimeExports.jsx(SvgIconNeoMessaging,{color:"#fff"}),Mt&&jsxRuntimeExports.jsx(Badge,{variant:{type:"notification",level:"warning"},className:"position-absolute",children:st})]})}),ut==="fr"&&dt?jsxRuntimeExports.jsxs(NavItem,{children:[jsxRuntimeExports.jsxs("button",{className:"nav-link btn btn-naked",onClick:()=>{ft(!0)},children:[jsxRuntimeExports.jsx(SvgIconNeoAssistance,{color:"#fff"}),jsxRuntimeExports.jsx(VisuallyHidden,{children:rt("support")})]}),jsxRuntimeExports.jsx(Help,{isHelpOpen:ht,setIsHelpOpen:ft,parsedContent:xt,parsedHeadline:yt,error:vt})]}):null,jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("div",{className:"dropdown",children:[jsxRuntimeExports.jsx("button",{className:"nav-link btn btn-naked d-md-none",type:"button","aria-controls":"dropdown-navbar","aria-expanded":!Ut,"aria-label":rt("navbar.open.menu"),onClick:Lt,children:jsxRuntimeExports.jsx(SvgIconRafterDown,{className:"icon rafter-down",width:"20",height:"20",color:"#fff"})}),jsxRuntimeExports.jsxs("ul",{className:`dropdown-menu dropdown-menu-end ${Ut?"":"show"}`,id:"dropdown-navbar",children:[Dt&&jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/community",className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(SvgIconCommunity,{className:"icon community"}),jsxRuntimeExports.jsx("span",{className:"nav-text",children:rt("navbar.community")})]})}),Nt?jsxRuntimeExports.jsx(SearchEngine,{}):null,jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/userbook/mon-compte",className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(Avatar,{alt:It,size:"sm",src:Pt,variant:"circle",className:"bg-white",width:"32",height:"32"}),jsxRuntimeExports.jsx("span",{className:"nav-text",children:rt("navbar.myaccount")})]})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsx("hr",{className:"dropdown-divider"})}),jsxRuntimeExports.jsx(NavItem,{children:jsxRuntimeExports.jsxs("a",{href:"/auth/logout?callback="+((Bt==null?void 0:Bt.logoutCallback)??"/"),className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(SvgIconDisconnect,{className:"icon logout"}),jsxRuntimeExports.jsx("span",{id:"logout-label",className:"nav-text",children:rt("navbar.disconnect")})]})})]})]})})]})]})})})};function usePreferences(tt){return{getPreference:async()=>await odeServices.conf().getPreference(tt),savePreference:async et=>await odeServices.conf().savePreference(tt,JSON.stringify(et))}}function useCookiesConsent(){const[tt,et]=reactExports.useState(!1),{getPreference:rt,savePreference:st}=usePreferences("rgpdCookies");return reactExports.useEffect(()=>{(async()=>{const nt=await rt();et(nt===null?!0:nt.showInfoTip)})()},[]),{showCookiesConsent:tt,handleConsultCookies:()=>{document.location.href="/userbook/mon-compte",st({showInfoTip:!1}),et(!1)},handleCloseCookiesConsent:()=>{st({showInfoTip:!1}),et(!1)}}}const Layout=({children:tt,headless:et=!1,...rt})=>{const{theme:st}=useEdificeTheme(),{t:nt}=useTranslation(),{showCookiesConsent:ot,handleConsultCookies:at,handleCloseCookiesConsent:lt}=useCookiesConsent();useZendeskGuide(),useCantoo();const ut=clsx("d-flex flex-column bg-white",{"container-fluid":!et,"rounded-4 border":(st==null?void 0:st.is1d)&&!et,"mt-24":(st==null?void 0:st.is1d)&&!et}),ct=et?null:jsxRuntimeExports.jsx(Header,{is1d:st==null?void 0:st.is1d,src:st==null?void 0:st.basePath}),dt=ot&&jsxRuntimeExports.jsx(Alert,{type:"info",className:"m-12 rgpd",isConfirm:!0,position:"bottom-right",button:jsxRuntimeExports.jsx(Button,{color:"tertiary",variant:"ghost",onClick:at,children:nt("rgpd.cookies.banner.button.consult")}),onClose:lt,children:nt("rgpd.cookies.banner.text1")}),ht=jsxRuntimeExports.jsx(Oe$1,{containerClassName:"toaster-container",toastOptions:{position:"top-right"}});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[ct,jsxRuntimeExports.jsx("main",{className:ut,...rt,children:tt}),ht,dt]})},TextareaCounter=({content:tt,maxLength:et})=>jsxRuntimeExports.jsx("p",{className:"small text-gray-700 p-2 text-end",children:tt?`${tt.length} / ${et}`:""}),useThumb=({isUpdating:tt,selectedResource:et})=>{const[rt,st]=reactExports.useState(tt&&(et==null?void 0:et.thumbnail)||"");return reactExports.useEffect(()=>{st((et==null?void 0:et.thumbnail)||"")},[et]),{thumbnail:rt,handleDeleteImage:()=>st(""),handleUploadImage:nt=>st(nt)}},DEFAULT_INPUT_MAX_LENGTH=60,DEFAULT_TEXTAREA_MAX_LENGTH=400,ResourceModal$1=({isOpen:tt,onCancel:et,onSuccess:rt,children:st,inputMaxLength:nt=DEFAULT_INPUT_MAX_LENGTH,textareaMaxLength:ot=DEFAULT_TEXTAREA_MAX_LENGTH,...at})=>{const{appCode:lt,currentApp:ut}=useEdificeClient(),{t:ct}=useTranslation(),{mode:dt}=at,ht=useToast(),ft=reactExports.useId(),xt=dt==="create",yt=dt==="update",vt=useResource(lt,yt?at.resourceId:""),{watch:Et,register:bt,handleSubmit:wt,setValue:St,formState:{isSubmitting:Rt,isValid:Ct}}=useForm({mode:"onChange",defaultValues:{description:yt?vt==null?void 0:vt.description:"",enablePublic:yt?vt==null?void 0:vt.public:!1,title:yt?vt==null?void 0:vt.name:"",formSlug:yt?vt==null?void 0:vt.slug:""}}),{ref:Pt,libraryMedia:It,...jt}=useMediaLibrary(),{thumbnail:Dt,handleDeleteImage:Ht,handleUploadImage:Nt}=useThumb({isUpdating:yt,selectedResource:yt?vt:void 0}),Ut=Et("description"),Lt=async function(kt){var Mt,Bt;try{const Gt={description:kt.description||"",name:kt.title,public:kt.enablePublic,slug:kt.enablePublic&&kt.formSlug||"",thumbnail:Dt};if(xt){const $t={...Gt,folder:at.currentFolder===void 0||((Mt=at.currentFolder)==null?void 0:Mt.id)==="default"?void 0:parseInt(((Bt=at.currentFolder)==null?void 0:Bt.id)||""),application:lt};at.createResource?await at.createResource.mutateAsync($t):await odeServices.resource(lt).create($t)}else{const $t={...Gt,entId:vt.assetId,trashed:vt.trashed};at.updateResource?await at.updateResource.mutateAsync($t):await odeServices.resource(lt).update($t)}ht.success(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("strong",{children:ct(xt?"explorer.resource.created":"explorer.resource.updated")}),jsxRuntimeExports.jsxs("p",{children:[ct("title")," : ",kt.title]}),jsxRuntimeExports.jsxs("p",{children:[ct("description")," : ",kt.description]}),lt==="blog"&&jsxRuntimeExports.jsxs("p",{children:["Public:",kt.enablePublic?ct("explorer.enable.public.yes"):ct("explorer.enable.public.no")]})]})),rt()}catch(Gt){console.error(Gt)}};return yt&&!vt?jsxRuntimeExports.jsx(LoadingScreen,{}):reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:`${dt}-resource`,size:"lg",isOpen:tt,onModalClose:et,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:et,children:ct(`explorer.resource.editModal.header.${xt?"create":"edit"}`)}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("explorer.resource.editModal.heading.general")}),jsxRuntimeExports.jsxs("form",{id:ft,onSubmit:wt(Lt),children:[jsxRuntimeExports.jsxs("div",{className:"d-block d-md-flex gap-16 mb-24",children:[jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(ImagePicker,{app:ut,src:yt&&(vt==null?void 0:vt.thumbnail)||"",addButtonLabel:ct("explorer.imagepicker.button.add"),deleteButtonLabel:ct("explorer.imagepicker.button.delete"),onUploadImage:Nt,onDeleteImage:Ht,className:"align-self-center mt-8",libraryMedia:It,mediaLibraryRef:Pt})}),jsxRuntimeExports.jsxs("div",{className:"col",children:[jsxRuntimeExports.jsxs(FormControl,{id:"title",className:"mb-16",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("title")}),jsxRuntimeExports.jsx(Input,{type:"text",defaultValue:yt?vt==null?void 0:vt.name:"",...bt("title",{required:!0,maxLength:nt,pattern:{value:/[^ ]/,message:"invalid title"}}),placeholder:ct("explorer.resource.editModal.title.placeholder"),size:"md","aria-required":!0,maxLength:nt})]}),jsxRuntimeExports.jsxs(FormControl,{id:"description",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("description")}),jsxRuntimeExports.jsx(TextArea,{defaultValue:(vt==null?void 0:vt.description)||"",...bt("description",{required:!1,maxLength:ot}),placeholder:ct("explorer.resource.editModal.description.placeholder"),size:"md",maxLength:ot}),Ut&&jsxRuntimeExports.jsx(TextareaCounter,{content:Ut,maxLength:ot})]})]})]}),typeof st=="function"?st(vt,yt,Et,St,bt):st]})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:et,type:"button",variant:"ghost",children:ct("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{form:ft,type:"submit",color:"primary",isLoading:Rt,variant:"filled",disabled:!Ct||Rt,children:ct(xt?"explorer.create":"save")})]}),jsxRuntimeExports.jsx(MediaLibrary,{appCode:lt,ref:Pt,multiple:!1,visibility:"protected",...jt})]}),document.getElementById("portal"))};function useSession(){return useQuery({queryKey:["session"],queryFn:async()=>await odeServices.session().getSession()})}function useConf({appCode:tt}){return useQuery({queryKey:["conf"],queryFn:async()=>await odeServices.conf().getConf(tt)})}function EdificeClientProvider({children:tt,params:et}){var rt;const st=et.app,{t:nt}=useTranslation(),ot=nt(st),at=useSession(),lt=useConf({appCode:st}),ut=(lt==null?void 0:lt.isSuccess)&&(at==null?void 0:at.isSuccess),ct=((rt=at==null?void 0:at.data)==null?void 0:rt.currentLanguage)??"fr";reactExports.useEffect(()=>{[{data:"html",value:ct},{data:"translate",value:"no"}].forEach(ht=>{var ft;return(ft=document.querySelector("html"))==null?void 0:ft.setAttribute(ht.data,ht.value)})},[ct,at.data]),reactExports.useEffect(()=>{document.title=`${ot}`},[st,at.data,ot]);const dt=reactExports.useMemo(()=>{var ht,ft,xt,yt,vt;return{appCode:st,applications:(ht=lt==null?void 0:lt.data)==null?void 0:ht.applications,confQuery:lt,currentApp:(ft=lt==null?void 0:lt.data)==null?void 0:ft.currentApp,currentLanguage:ct,init:ut,sessionQuery:at,user:(xt=at==null?void 0:at.data)==null?void 0:xt.user,userDescription:(yt=at==null?void 0:at.data)==null?void 0:yt.userDescription,userProfile:(vt=at==null?void 0:at.data)==null?void 0:vt.userProfile}},[st,lt,ct,ut,at]);return jsxRuntimeExports.jsx(EdificeClientContext.Provider,{value:dt,children:tt})}function EdificeThemeProvider({defaultTheme:tt,children:et}){var rt;const{appCode:st}=useEdificeClient(),nt=useConf({appCode:st});reactExports.useEffect(()=>{var at,lt,ut,ct,dt,ht,ft,xt,yt,vt,Et;const bt=document.getElementById("favicon");bt.href=`${(lt=(at=nt==null?void 0:nt.data)==null?void 0:at.theme)==null?void 0:lt.basePath}/img/illustrations/favicon.ico`;const wt=(dt=(ct=(ut=nt==null?void 0:nt.data)==null?void 0:ut.theme)==null?void 0:ct.bootstrapVersion)==null?void 0:dt.split("-"),St=wt?wt[wt.length-1]:void 0;[{data:"data-skin",value:(ft=(ht=nt==null?void 0:nt.data)==null?void 0:ht.theme)==null?void 0:ft.skinName},{data:"data-theme",value:((yt=(xt=nt==null?void 0:nt.data)==null?void 0:xt.theme)==null?void 0:yt.npmTheme)??((Et=(vt=nt==null?void 0:nt.data)==null?void 0:vt.theme)==null?void 0:Et.themeName)},{data:"data-product",value:tt==="none"?"":tt??St}].forEach(Rt=>{var Ct;return(Ct=document.querySelector("html"))==null?void 0:Ct.setAttribute(Rt.data,Rt.value)})},[nt==null?void 0:nt.data,tt]);const ot=reactExports.useMemo(()=>{var at;return{theme:(at=nt==null?void 0:nt.data)==null?void 0:at.theme}},[(rt=nt==null?void 0:nt.data)==null?void 0:rt.theme]);return jsxRuntimeExports.jsx(EdificeThemeContext.Provider,{value:ot,children:et})}const scriptRel="modulepreload",assetsURL=function(tt){return"/"+tt},seen={},__vitePreload=function tt(et,rt,st){let nt=Promise.resolve();if(rt&&rt.length>0){document.getElementsByTagName("link");const ot=document.querySelector("meta[property=csp-nonce]"),at=(ot==null?void 0:ot.nonce)||(ot==null?void 0:ot.getAttribute("nonce"));nt=Promise.all(rt.map(lt=>{if(lt=assetsURL(lt),lt in seen)return;seen[lt]=!0;const ut=lt.endsWith(".css"),ct=ut?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${lt}"]${ct}`))return;const dt=document.createElement("link");if(dt.rel=ut?"stylesheet":scriptRel,ut||(dt.as="script",dt.crossOrigin=""),dt.href=lt,at&&dt.setAttribute("nonce",at),document.head.appendChild(dt),ut)return new Promise((ht,ft)=>{dt.addEventListener("load",ht),dt.addEventListener("error",()=>ft(new Error(`Unable to preload CSS for ${lt}`)))})}))}return nt.then(()=>et()).catch(ot=>{const at=new Event("vite:preloadError",{cancelable:!0});if(at.payload=ot,window.dispatchEvent(at),!at.defaultPrevented)throw ot})},snapCenterToCursor=tt=>{let{activatorEvent:et,draggingNodeRect:rt,transform:st}=tt;if(rt&&et){const nt=getEventCoordinates(et);if(!nt)return st;const ot=nt.x-rt.left,at=nt.y-rt.top;return{...st,x:st.x+ot-rt.width/2,y:st.y+at-rt.height/2}}return st},__vite_import_meta_env__={},createStoreImpl=tt=>{let et;const rt=new Set,st=(dt,ht)=>{const ft=typeof dt=="function"?dt(et):dt;if(!Object.is(ft,et)){const xt=et;et=ht??(typeof ft!="object"||ft===null)?ft:Object.assign({},et,ft),rt.forEach(yt=>yt(et,xt))}},nt=()=>et,ut={setState:st,getState:nt,getInitialState:()=>ct,subscribe:dt=>(rt.add(dt),()=>rt.delete(dt)),destroy:()=>{(__vite_import_meta_env__?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),rt.clear()}},ct=et=tt(st,nt,ut);return ut},createStore=tt=>createStoreImpl;var withSelector={exports:{}},withSelector_production={},shim$2={exports:{}},useSyncExternalStoreShim_production={};/**
|
|
1396
1396
|
* @license React
|