dbf-mirador-annotation-editor 1.5.2 → 1.5.3
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.
|
@@ -36,7 +36,7 @@ Passer en vue simple simplement ?`,switch_view_h2:"Changer le type de vue en vue
|
|
|
36
36
|
stroke-dasharray='${JB}'
|
|
37
37
|
/>
|
|
38
38
|
</g></g>
|
|
39
|
-
</svg>`},$B=n=>{const[e,t,r,i]=n.value.replace("xywh=","").split(",").map(parseFloat),a={id:Ja(),rotation:0,scaleX:1,scaleY:1,x:e,y:t,width:r,height:i,type:Vt.RECTANGLE,fill:Fs.fillColor,stroke:Fs.strokeColor,strokeWidth:Fs.strokeWidth};return{drawingState:JSON.stringify({currentShape:a,shapes:[a],isDrawing:!1}),svg:YB({x:e,y:t,w:r,h:i})}},QB=(n,e)=>{const t=gO(n),r={fill:_m.fill,id:Ja(),radius:Math.max(t.width,t.height)/2,rotation:0,scaleX:1,scaleY:1,stroke:_m.stroke,strokeWidth:_m.strokeWidth,type:Vt.POI,x:t.x+t.width/2,y:t.y+t.height/2},i={drawingState:JSON.stringify({currentShape:r,isDrawing:!1,shapes:[r]}),svg:e},a=n.querySelector("svg").getAttribute("width")||void 0,s=n.querySelector("svg").getAttribute("height")||void 0;return a&&s&&(i.fullCanvaXYWH=`0,0,${a},${s}`),i},eG=(n,e)=>{const r=new DOMParser().parseFromString(n.value,"image/svg+xml");if(e===gn.POI_TYPE||e===gn.NESTED_MAP_TYPE)return QB(r,n.value);const i=gO(r),a=r.querySelector("svg").getAttribute("width")||void 0,s=r.querySelector("svg").getAttribute("height")||void 0,u={id:Ja(),rotation:0,scaleX:1,scaleY:1,x:i.x,y:i.y,width:i.width,height:i.height,type:Vt.RECTANGLE,fill:r.querySelector("path[fill]")?.getAttribute("fill")||Fs.fillColor,stroke:r.querySelector("path[stroke]")?.getAttribute("stroke")||Fs.strokeColor,strokeWidth:r.querySelector("path[stroke-width]")?.getAttribute("stroke-width")||Fs.strokeWidth},c={drawingState:JSON.stringify({currentShape:u,shapes:[u],isDrawing:!1}),svg:n.value};return a&&s&&(c.fullCanvaXYWH=`0,0,${a},${s}`),c},tG=(n,e,t)=>{const r=["SvgSelector","FragmentSelector"],i=Array.isArray(n.selector)?n.selector:[n.selector];for(const a of i)try{if(a.type==="SvgSelector")return eG(a,t);if(a.type==="FragmentSelector")return $B(a)}catch(s){console.error(`Error generating maeData from selector ${a.type}, attempting to fallback to other selector`,s)}return console.error(`On annotation '${e}': none of the selector types in the annotation are unsupported: ${i.map(a=>a.type)}. Supported selectors are: [${r}].`),{}};function w5(n){if(!n.maeData||Object.keys(n.maeData||{}).length===0)try{const e={target:{},templateType:"",tags:[],textBody:{}},[t,r]=XB(n);return e.templateType=t,e.textBody=r,e.target=tG(n.target,n.id,t),n.maeData=e,n}catch(e){return console.error("Error generating maeData from annotation",e),n}return n}const sp=n=>{if(!n)return!0;const e=n.trim();return e===""?!0:e.replace(/<[^>]*>/g,"").trim()===""},Z1=()=>`${new Date().toLocaleString()}`,nG=[gn.TAGGING_TYPE,gn.TEXT_TYPE,gn.MULTIPLE_BODY_TYPE,gn.POI_TYPE,gn.NESTED_MAP_TYPE],Um=async(n,e,t,r)=>{const i=n;return i.maeData.target={drawingState:i.maeData.target.drawingState,fullCanvaXYWH:i.maeData.target.fullCanvaXYWH,scale:i.maeData.target.scale,tend:i.maeData.target.tend,tstart:i.maeData.target.tstart},console.info("Annotation state target",i.maeData.target),nG.includes(i.maeData.templateType)&&i.maeData.target.drawingState.shapes.length>0&&(i.maeData.target.svg=await LB(t)),GB(i.maeData),i.maeData.target.scale=r.getMediaTrueHeight()/r.getDisplayedMediaHeight()*r.getZoom(),i.target=WB(i.maeData,e.id,t,r.getScale()),i.maeData.target.drawingState=JSON.stringify(i.maeData.target.drawingState),i},mO=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=n;return i.body&&!Array.isArray(i.body)&&sp(i.body.value)&&(i.body.value=Z1()),Um(i,e,t,r)},vO=n=>{const e=n;return e.maeData?.textBody&&sp(e.maeData.textBody.value)&&(e.maeData.textBody.value=Z1()),e.body=[e.maeData.textBody],e.body.push(...e.maeData.tags.map(t=>({id:t.value,purpose:"tagging",type:"TextualBody",value:t.value}))),e},rG=async(n,e,t,r)=>{const i=n;return n.maeData.templateType===gn.IIIF_TYPE?n:(i.body&&!Array.isArray(i.body)&&sp(i.body.value)&&(i.body.value=Z1()),i.maeData.templateType===gn.MULTIPLE_BODY_TYPE?vO(i):i.maeData?.textBody&&sp(i.maeData.textBody.value)&&(i.maeData.textBody.value=Z1()),Um(i,e,t,r))};function vA(n){const e={chars:n.value};return n.purpose==="tagging"?e["@type"]="oa:Tag":e["@type"]="dctypes:Text",n.format&&(e.format=n.format),n.language&&(e.language=n.language),n.purpose&&(e.motivation=n.purpose),e}function yA(n){switch(n.type){case"SvgSelector":return{"@type":"oa:SvgSelector",value:n.value};case"FragmentSelector":return{"@type":"oa:FragmentSelector",value:n.value};default:return null}}function iG(n){const e={"@context":"https://iiif.io/api/presentation/2/context.json","@type":"oa:Annotation",maeData:n.maeData||{},motivation:"oa:commenting"};if(n.id?.startsWith("http")&&(e["@id"]=n.id),Array.isArray(n.body)?e.resource=n.body.map(t=>vA(t)):e.resource=vA(n.body),typeof n.target=="object"&&!Array.isArray(n.target)&&n.target!==null?e.on={"@type":"oa:SpecificResource",full:n.target.source?.id||n.target.id||n.target.source}:e.on=n.target,n.target.selector){if(Array.isArray(n.target.selector)){const t=n.target.selector.map(r=>yA(r));e.on.selector={"@type":"oa:Choice",default:t[0],item:t[1]}}else e.on.selector=yA(n.target.selector);n.target.source?.partOf&&(e.on.within={"@id":n.target.source.partOf.id,"@type":"sc:Manifest"})}return e}function bA(n){const e={type:"TextualBody",value:n.chars};return n.motivation&&(e.purpose=n.motivation),n.format&&(e.format=n.format),n.language&&(e.language=n.language),n["@type"]==="oa:Tag"&&(e.purpose="tagging"),e}function SE(n){switch(n["@type"]){case"oa:SvgSelector":return{type:"SvgSelector",value:n.value};case"oa:FragmentSelector":return{type:"FragmentSelector",value:n.value};case"oa:Choice":return[SE(n.default),SE(n.item)];default:return null}}function aG(n){const e={id:n["@id"],maeData:n.maeData||{},motivation:"commenting",type:"Annotation"};Array.isArray(n.resource)?e.body=n.resource.map(r=>bA(r)):n.resource?e.body=bA(n.resource):e.body={};let t=n.on;return Array.isArray(t)&&([t]=t),e.target={selector:SE(t.selector),source:t.full},t.within&&(e.target.source={id:t.full,partOf:{id:t.within["@id"],type:"Manifest"},type:"Canvas"}),e}function sG(n,e){if(Array.isArray(n)){const t=n.map(r=>aG(r));return{id:e,items:t,type:"AnnotationPage"}}return n}const oG=n=>n.maeData?.target?n:w5({...n}),lG=n=>{const t=oG(n).maeData?.target;if(!t?.drawingState||!t?.fullCanvaXYWH)return null;const i=(typeof t.drawingState=="string"?JSON.parse(t.drawingState):t.drawingState)?.shapes?.[0];return typeof i?.x!="number"||typeof i?.y!="number"?null:{fullCanvaXYWH:t.fullCanvaXYWH,x:i.x,y:i.y}},uG=n=>typeof n.target=="string"?n.target:n.target?.source,CE=(n,e)=>{const t=lO(e).find(h=>h.kind==="Journey"&&h.id===n);if(!t)return null;const r=uG(t.item),i=[];let a;if(t.pois.forEach(h=>{const g=lG(h);g&&(i.push({x:g.x,y:g.y}),a??=g.fullCanvaXYWH)}),i.length<2||!a||!r)return{...t.item,target:r??t.item.target};const[,,s,u]=a.split(","),c=KB({fullH:u,fullW:s,points:i});return{...t.item,target:pO({svg:c},r)}},Cy=D.forwardRef((n,e)=>{const t=xs.useTheme(),[r,i]=D.useState(!1),[a,s]=D.useState(null),u=D.useContext(aO),{currentJourneyId:c,journeys:h,onMoveToJourney:g,...v}=n,y=D.useMemo(()=>{const{annotationid:G}=n,{canvases:V,annotationsOnCanvases:Z}=u;let X;return V.some(k=>(Z[k.id]&&Object.entries(Z[k.id]).forEach(([z,q])=>{if(q.json&&q.json.items&&(X=q.json.items.find(te=>te.id===G),X))return X}),X)),X},[n.annotationid,u.canvases,u.annotationsOnCanvases]),S=()=>{const{canvases:G,receiveAnnotation:V,storageAdapter:Z}=u,{annotationid:X}=n,k=y?.["dbf:journey"]?.id??null;G.forEach(z=>{const q=Z(z.id);q.delete(X).then(te=>{if(V(z.id,q.annotationPageId,te),!k||!te?.items)return;const ee=CE(k,te.items);ee&&q.update(ee).then($=>{V(z.id,q.annotationPageId,$)})})})},E=()=>{const{annotationsOnCanvases:G,canvases:V,receiveAnnotation:Z,storageAdapter:X}=u,{annotationid:k}=n;V.forEach(z=>{const q=G[z.id];q&&Object.values(q).forEach(te=>{const ee=te?.json?.items;if(!ee?.some(K=>K.id===k))return;const $=CE(k,ee);if(!$)return;const ie=X(z.id);ie.update($).then(K=>{Z(z.id,ie.annotationPageId,K)})})})},O=()=>{const{addCompanionWindow:G}=u,{annotationid:V}=n;G("annotationCreation",{annotationid:V,position:"right"})},_=()=>{const{addCompanionWindow:G}=u,{annotationid:V}=n;G("mapsPoiPreview",{annotationid:V,position:"right"})},w=()=>{u.config?.annotation?.openLinkedMap?.(y?.["dbf:linkedMap"])},N=()=>{const{annotationsOnCanvases:G,canvases:V}=u,{annotationid:Z}=n,X=V.map(k=>G[k.id]?lA(Object.entries(G[k.id]).map(([z,q])=>q.json&&q.json.items?q.json.items.filter(te=>te.maeData).map(te=>te.id):[])):[]);return lA(X).includes(Z)},L=G=>{s(G.currentTarget)},P=()=>s(null),H=G=>{g?.(G),P()},{t:B}=Gs.useTranslation();return A.jsxs("div",{onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:"mirador-annotation-list-item","data-testid":"mirador-annotation-list-item",ref:e,children:[r&&N()&&A.jsx("div",{children:A.jsxs(xy,{"aria-label":"annotation tools",size:"small",sx:{bgcolor:t.palette.background.paper,borderRadius:t.shape.borderRadius,boxShadow:t.shadows[2],position:"absolute",right:0,zIndex:t.zIndex.modal+1},children:[u.config?.annotation.debug&&A.jsx(ue.Tooltip,{title:B("debugAnnotation"),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Debug",onClick:()=>console.log(y),value:"debug",children:A.jsx(hB,{})})})}),!!y?.creator&&A.jsx(ue.Tooltip,{title:A.jsx(E5,{creator:y.creator,creationDate:y.creationDate,lastEditor:y.lastEditor,lastSavedDate:y.lastSavedDate,displayMode:sO,t:B}),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Metadata",value:"metadata",children:A.jsx(SB,{})})})}),!!y?.["dbf:linkedMap"]&&A.jsx(ue.Tooltip,{title:B("openNestedMap"),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Open nested map",onClick:w,value:"open-nested-map",children:A.jsx(tO,{})})})}),!y?.["dbf:linkedMap"]&&!!y?.["dbf:kind"]&&A.jsx(ue.Tooltip,{title:B("previewAnnotation"),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Preview",onClick:_,value:"preview",disabled:!u.annotationPreviewCompanionWindowIsOpened,children:A.jsx(fB,{})})})}),u.config?.annotation?.readonly!==!0&&y?.["dbf:kind"]==="Journey"&&A.jsx(ue.Tooltip,{title:B("refresh_journey_path"),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Refresh path",onClick:E,value:"refresh-path",disabled:!u.annotationEditCompanionWindowIsOpened,children:A.jsx(CB,{})})})}),u.config?.annotation?.readonly!==!0&&!!h&&(h.length>0||!!c)&&A.jsx(ue.Tooltip,{title:B("move_to_journey"),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Move to journey",onClick:L,value:"move-to-journey",disabled:!u.annotationEditCompanionWindowIsOpened,children:A.jsx(iO,{})})})}),u.config?.annotation?.readonly!==!0&&[A.jsx(ue.Tooltip,{title:B("edit_annotation"),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Edit",onClick:u.windowViewType==="single"?O:u.toggleSingleCanvasDialogOpen,value:"edit",disabled:!u.annotationEditCompanionWindowIsOpened,children:A.jsx(dB,{})})})},"edit"),A.jsx(ue.Tooltip,{title:A.jsx(Ic,{label:B("deleteAnnotation"),action:"delete"}),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Delete",onClick:S,value:"delete",disabled:!u.annotationEditCompanionWindowIsOpened,children:A.jsx(eO,{})})})},"delete")]]})}),!!h&&A.jsxs(UF,{anchorEl:a,onClose:P,open:!!a,children:[!!c&&[A.jsx(X1,{onClick:()=>H(null),children:B("remove_from_journey")},"none"),A.jsx(VF,{},"divider")],h.map(G=>A.jsx(X1,{onClick:()=>H(G.id),selected:G.id===c,children:G.title},G.id))]}),A.jsx("li",{...v,children:n.children})]})});Cy.propTypes={annotationEditCompanionWindowIsOpened:C.bool.isRequired,annotationid:C.string.isRequired,children:C.oneOfType([C.func,C.node]).isRequired,currentJourneyId:C.string,journeys:C.arrayOf(C.shape({id:C.string.isRequired,title:C.string.isRequired})),onMoveToJourney:C.func};Cy.defaultProps={currentJourneyId:null,journeys:void 0,onMoveToJourney:void 0};var Ox={exports:{}};function _E(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function cG(n){if(Array.isArray(n))return _E(n)}function dG(n,e,t){return(e=yG(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Po(){return Po=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Po.apply(null,arguments)}function fG(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function hG(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
39
|
+
</svg>`},$B=n=>{const[e,t,r,i]=n.value.replace("xywh=","").split(",").map(parseFloat),a={id:Ja(),rotation:0,scaleX:1,scaleY:1,x:e,y:t,width:r,height:i,type:Vt.RECTANGLE,fill:Fs.fillColor,stroke:Fs.strokeColor,strokeWidth:Fs.strokeWidth};return{drawingState:JSON.stringify({currentShape:a,shapes:[a],isDrawing:!1}),svg:YB({x:e,y:t,w:r,h:i})}},QB=(n,e)=>{const t=gO(n),r={fill:_m.fill,id:Ja(),radius:Math.max(t.width,t.height)/2,rotation:0,scaleX:1,scaleY:1,stroke:_m.stroke,strokeWidth:_m.strokeWidth,type:Vt.POI,x:t.x+t.width/2,y:t.y+t.height/2},i={drawingState:JSON.stringify({currentShape:r,isDrawing:!1,shapes:[r]}),svg:e},a=n.querySelector("svg").getAttribute("width")||void 0,s=n.querySelector("svg").getAttribute("height")||void 0;return a&&s&&(i.fullCanvaXYWH=`0,0,${a},${s}`),i},eG=(n,e)=>{const r=new DOMParser().parseFromString(n.value,"image/svg+xml");if(e===gn.POI_TYPE||e===gn.NESTED_MAP_TYPE)return QB(r,n.value);const i=gO(r),a=r.querySelector("svg").getAttribute("width")||void 0,s=r.querySelector("svg").getAttribute("height")||void 0,u={id:Ja(),rotation:0,scaleX:1,scaleY:1,x:i.x,y:i.y,width:i.width,height:i.height,type:Vt.RECTANGLE,fill:r.querySelector("path[fill]")?.getAttribute("fill")||Fs.fillColor,stroke:r.querySelector("path[stroke]")?.getAttribute("stroke")||Fs.strokeColor,strokeWidth:r.querySelector("path[stroke-width]")?.getAttribute("stroke-width")||Fs.strokeWidth},c={drawingState:JSON.stringify({currentShape:u,shapes:[u],isDrawing:!1}),svg:n.value};return a&&s&&(c.fullCanvaXYWH=`0,0,${a},${s}`),c},tG=(n,e,t)=>{const r=["SvgSelector","FragmentSelector"],i=Array.isArray(n.selector)?n.selector:[n.selector];for(const a of i)try{if(a.type==="SvgSelector")return eG(a,t);if(a.type==="FragmentSelector")return $B(a)}catch(s){console.error(`Error generating maeData from selector ${a.type}, attempting to fallback to other selector`,s)}return console.error(`On annotation '${e}': none of the selector types in the annotation are unsupported: ${i.map(a=>a.type)}. Supported selectors are: [${r}].`),{}};function w5(n){if(!n.maeData||Object.keys(n.maeData||{}).length===0)try{const e={target:{},templateType:"",tags:[],textBody:{}},[t,r]=XB(n);return e.templateType=t,e.textBody=r,e.target=tG(n.target,n.id,t),n.maeData=e,n}catch(e){return console.error("Error generating maeData from annotation",e),n}return n}const sp=n=>{if(!n)return!0;const e=n.trim();return e===""?!0:e.replace(/<[^>]*>/g,"").trim()===""},Z1=()=>`${new Date().toLocaleString()}`,nG=[gn.TAGGING_TYPE,gn.TEXT_TYPE,gn.MULTIPLE_BODY_TYPE,gn.POI_TYPE,gn.NESTED_MAP_TYPE],Um=async(n,e,t,r)=>{const i=n;return i.maeData.target={drawingState:i.maeData.target.drawingState,fullCanvaXYWH:i.maeData.target.fullCanvaXYWH,scale:i.maeData.target.scale,tend:i.maeData.target.tend,tstart:i.maeData.target.tstart},console.info("Annotation state target",i.maeData.target),nG.includes(i.maeData.templateType)&&i.maeData.target.drawingState.shapes.length>0&&(i.maeData.target.svg=await LB(t)),GB(i.maeData),i.maeData.target.scale=r.getMediaTrueHeight()/r.getDisplayedMediaHeight()*r.getZoom(),i.target=WB(i.maeData,e.id,t,r.getScale()),i.maeData.target.drawingState=JSON.stringify(i.maeData.target.drawingState),i},mO=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=n;return i.body&&!Array.isArray(i.body)&&sp(i.body.value)&&(i.body.value=Z1()),Um(i,e,t,r)},vO=n=>{const e=n;return e.maeData?.textBody&&sp(e.maeData.textBody.value)&&(e.maeData.textBody.value=Z1()),e.body=[e.maeData.textBody],e.body.push(...e.maeData.tags.map(t=>({id:t.value,purpose:"tagging",type:"TextualBody",value:t.value}))),e},rG=async(n,e,t,r)=>{const i=n;return n.maeData.templateType===gn.IIIF_TYPE?n:(i.body&&!Array.isArray(i.body)&&sp(i.body.value)&&(i.body.value=Z1()),i.maeData.templateType===gn.MULTIPLE_BODY_TYPE?vO(i):i.maeData?.textBody&&sp(i.maeData.textBody.value)&&(i.maeData.textBody.value=Z1()),Um(i,e,t,r))};function vA(n){const e={chars:n.value};return n.purpose==="tagging"?e["@type"]="oa:Tag":e["@type"]="dctypes:Text",n.format&&(e.format=n.format),n.language&&(e.language=n.language),n.purpose&&(e.motivation=n.purpose),e}function yA(n){switch(n.type){case"SvgSelector":return{"@type":"oa:SvgSelector",value:n.value};case"FragmentSelector":return{"@type":"oa:FragmentSelector",value:n.value};default:return null}}function iG(n){const e={"@context":"https://iiif.io/api/presentation/2/context.json","@type":"oa:Annotation",maeData:n.maeData||{},motivation:"oa:commenting"};if(n.id?.startsWith("http")&&(e["@id"]=n.id),Array.isArray(n.body)?e.resource=n.body.map(t=>vA(t)):e.resource=vA(n.body),typeof n.target=="object"&&!Array.isArray(n.target)&&n.target!==null?e.on={"@type":"oa:SpecificResource",full:n.target.source?.id||n.target.id||n.target.source}:e.on=n.target,n.target.selector){if(Array.isArray(n.target.selector)){const t=n.target.selector.map(r=>yA(r));e.on.selector={"@type":"oa:Choice",default:t[0],item:t[1]}}else e.on.selector=yA(n.target.selector);n.target.source?.partOf&&(e.on.within={"@id":n.target.source.partOf.id,"@type":"sc:Manifest"})}return e}function bA(n){const e={type:"TextualBody",value:n.chars};return n.motivation&&(e.purpose=n.motivation),n.format&&(e.format=n.format),n.language&&(e.language=n.language),n["@type"]==="oa:Tag"&&(e.purpose="tagging"),e}function SE(n){switch(n["@type"]){case"oa:SvgSelector":return{type:"SvgSelector",value:n.value};case"oa:FragmentSelector":return{type:"FragmentSelector",value:n.value};case"oa:Choice":return[SE(n.default),SE(n.item)];default:return null}}function aG(n){const e={id:n["@id"],maeData:n.maeData||{},motivation:"commenting",type:"Annotation"};Array.isArray(n.resource)?e.body=n.resource.map(r=>bA(r)):n.resource?e.body=bA(n.resource):e.body={};let t=n.on;return Array.isArray(t)&&([t]=t),e.target={selector:SE(t.selector),source:t.full},t.within&&(e.target.source={id:t.full,partOf:{id:t.within["@id"],type:"Manifest"},type:"Canvas"}),e}function sG(n,e){if(Array.isArray(n)){const t=n.map(r=>aG(r));return{id:e,items:t,type:"AnnotationPage"}}return n}const oG=n=>n.maeData?.target?n:w5({...n}),lG=n=>{const t=oG(n).maeData?.target;if(!t?.drawingState||!t?.fullCanvaXYWH)return null;const i=(typeof t.drawingState=="string"?JSON.parse(t.drawingState):t.drawingState)?.shapes?.[0];return typeof i?.x!="number"||typeof i?.y!="number"?null:{fullCanvaXYWH:t.fullCanvaXYWH,x:i.x,y:i.y}},uG=n=>typeof n.target=="string"?n.target:n.target?.source,CE=(n,e,t)=>{const r=lO(e).find(g=>g.kind==="Journey"&&g.id===n);if(!r)return null;const i=t??uG(r.item),a=[];let s;if(r.pois.forEach(g=>{const v=lG(g);v&&(a.push({x:v.x,y:v.y}),s??=v.fullCanvaXYWH)}),a.length<2||!s||!i)return{...r.item,target:i??r.item.target};const[,,u,c]=s.split(","),h=KB({fullH:c,fullW:u,points:a});return{...r.item,target:pO({svg:h},i)}},Cy=D.forwardRef((n,e)=>{const t=xs.useTheme(),[r,i]=D.useState(!1),[a,s]=D.useState(null),u=D.useContext(aO),{currentJourneyId:c,journeys:h,onMoveToJourney:g,...v}=n,y=D.useMemo(()=>{const{annotationid:G}=n,{canvases:V,annotationsOnCanvases:Z}=u;let X;return V.some(k=>(Z[k.id]&&Object.entries(Z[k.id]).forEach(([z,q])=>{if(q.json&&q.json.items&&(X=q.json.items.find(te=>te.id===G),X))return X}),X)),X},[n.annotationid,u.canvases,u.annotationsOnCanvases]),S=()=>{const{canvases:G,receiveAnnotation:V,storageAdapter:Z}=u,{annotationid:X}=n,k=y?.["dbf:journey"]?.id??null;G.forEach(z=>{const q=Z(z.id);q.delete(X).then(te=>{if(V(z.id,q.annotationPageId,te),!k||!te?.items)return;const ee=CE(k,te.items,z.id);ee&&q.update(ee).then($=>{V(z.id,q.annotationPageId,$)})})})},E=()=>{const{annotationsOnCanvases:G,canvases:V,receiveAnnotation:Z,storageAdapter:X}=u,{annotationid:k}=n;V.forEach(z=>{const q=G[z.id];q&&Object.values(q).forEach(te=>{const ee=te?.json?.items;if(!ee?.some(K=>K.id===k))return;const $=CE(k,ee,z.id);if(!$)return;const ie=X(z.id);ie.update($).then(K=>{Z(z.id,ie.annotationPageId,K)})})})},O=()=>{const{addCompanionWindow:G}=u,{annotationid:V}=n;G("annotationCreation",{annotationid:V,position:"right"})},_=()=>{const{addCompanionWindow:G}=u,{annotationid:V}=n;G("mapsPoiPreview",{annotationid:V,position:"right"})},w=()=>{u.config?.annotation?.openLinkedMap?.(y?.["dbf:linkedMap"])},N=()=>{const{annotationsOnCanvases:G,canvases:V}=u,{annotationid:Z}=n,X=V.map(k=>G[k.id]?lA(Object.entries(G[k.id]).map(([z,q])=>q.json&&q.json.items?q.json.items.filter(te=>te.maeData).map(te=>te.id):[])):[]);return lA(X).includes(Z)},L=G=>{s(G.currentTarget)},P=()=>s(null),H=G=>{g?.(G),P()},{t:B}=Gs.useTranslation();return A.jsxs("div",{onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:"mirador-annotation-list-item","data-testid":"mirador-annotation-list-item",ref:e,children:[r&&N()&&A.jsx("div",{children:A.jsxs(xy,{"aria-label":"annotation tools",size:"small",sx:{bgcolor:t.palette.background.paper,borderRadius:t.shape.borderRadius,boxShadow:t.shadows[2],position:"absolute",right:0,zIndex:t.zIndex.modal+1},children:[u.config?.annotation.debug&&A.jsx(ue.Tooltip,{title:B("debugAnnotation"),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Debug",onClick:()=>console.log(y),value:"debug",children:A.jsx(hB,{})})})}),!!y?.creator&&A.jsx(ue.Tooltip,{title:A.jsx(E5,{creator:y.creator,creationDate:y.creationDate,lastEditor:y.lastEditor,lastSavedDate:y.lastSavedDate,displayMode:sO,t:B}),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Metadata",value:"metadata",children:A.jsx(SB,{})})})}),!!y?.["dbf:linkedMap"]&&A.jsx(ue.Tooltip,{title:B("openNestedMap"),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Open nested map",onClick:w,value:"open-nested-map",children:A.jsx(tO,{})})})}),!y?.["dbf:linkedMap"]&&!!y?.["dbf:kind"]&&A.jsx(ue.Tooltip,{title:B("previewAnnotation"),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Preview",onClick:_,value:"preview",disabled:!u.annotationPreviewCompanionWindowIsOpened,children:A.jsx(fB,{})})})}),u.config?.annotation?.readonly!==!0&&y?.["dbf:kind"]==="Journey"&&A.jsx(ue.Tooltip,{title:B("refresh_journey_path"),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Refresh path",onClick:E,value:"refresh-path",disabled:!u.annotationEditCompanionWindowIsOpened,children:A.jsx(CB,{})})})}),u.config?.annotation?.readonly!==!0&&!!h&&(h.length>0||!!c)&&A.jsx(ue.Tooltip,{title:B("move_to_journey"),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Move to journey",onClick:L,value:"move-to-journey",disabled:!u.annotationEditCompanionWindowIsOpened,children:A.jsx(iO,{})})})}),u.config?.annotation?.readonly!==!0&&[A.jsx(ue.Tooltip,{title:B("edit_annotation"),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Edit",onClick:u.windowViewType==="single"?O:u.toggleSingleCanvasDialogOpen,value:"edit",disabled:!u.annotationEditCompanionWindowIsOpened,children:A.jsx(dB,{})})})},"edit"),A.jsx(ue.Tooltip,{title:A.jsx(Ic,{label:B("deleteAnnotation"),action:"delete"}),children:A.jsx("span",{children:A.jsx(Si,{"aria-label":"Delete",onClick:S,value:"delete",disabled:!u.annotationEditCompanionWindowIsOpened,children:A.jsx(eO,{})})})},"delete")]]})}),!!h&&A.jsxs(UF,{anchorEl:a,onClose:P,open:!!a,children:[!!c&&[A.jsx(X1,{onClick:()=>H(null),children:B("remove_from_journey")},"none"),A.jsx(VF,{},"divider")],h.map(G=>A.jsx(X1,{onClick:()=>H(G.id),selected:G.id===c,children:G.title},G.id))]}),A.jsx("li",{...v,children:n.children})]})});Cy.propTypes={annotationEditCompanionWindowIsOpened:C.bool.isRequired,annotationid:C.string.isRequired,children:C.oneOfType([C.func,C.node]).isRequired,currentJourneyId:C.string,journeys:C.arrayOf(C.shape({id:C.string.isRequired,title:C.string.isRequired})),onMoveToJourney:C.func};Cy.defaultProps={currentJourneyId:null,journeys:void 0,onMoveToJourney:void 0};var Ox={exports:{}};function _E(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function cG(n){if(Array.isArray(n))return _E(n)}function dG(n,e,t){return(e=yG(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Po(){return Po=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Po.apply(null,arguments)}function fG(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function hG(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
40
40
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xA(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Wl(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xA(Object(t),!0).forEach(function(r){dG(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xA(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function pG(n,e){if(n==null)return{};var t,r,i=gG(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function gG(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function mG(n){return cG(n)||fG(n)||bG(n)||hG()}function vG(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function yG(n){var e=vG(n,"string");return typeof e=="symbol"?e:e+""}function EE(n){"@babel/helpers - typeof";return EE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},EE(n)}function bG(n,e){if(n){if(typeof n=="string")return _E(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_E(n,e):void 0}}var xG="1.15.7";function Iu(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var Mu=Iu(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Vm=Iu(/Edge/i),SA=Iu(/firefox/i),Em=Iu(/safari/i)&&!Iu(/chrome/i)&&!Iu(/android/i),A5=Iu(/iP(ad|od|hone)/i),yO=Iu(/chrome/i)&&Iu(/android/i),bO={capture:!1,passive:!1};function Tn(n,e,t){n.addEventListener(e,t,!Mu&&bO)}function _n(n,e,t){n.removeEventListener(e,t,!Mu&&bO)}function J1(n,e){if(e){if(e[0]===">"&&(e=e.substring(1)),n)try{if(n.matches)return n.matches(e);if(n.msMatchesSelector)return n.msMatchesSelector(e);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(e)}catch{return!1}return!1}}function xO(n){return n.host&&n!==document&&n.host.nodeType&&n.host!==n?n.host:n.parentNode}function js(n,e,t,r){if(n){t=t||document;do{if(e!=null&&(e[0]===">"?n.parentNode===t&&J1(n,e):J1(n,e))||r&&n===t)return n;if(n===t)break}while(n=xO(n))}return null}var CA=/\s+/g;function si(n,e,t){if(n&&e)if(n.classList)n.classList[t?"add":"remove"](e);else{var r=(" "+n.className+" ").replace(CA," ").replace(" "+e+" "," ");n.className=(r+(t?" "+e:"")).replace(CA," ")}}function wt(n,e,t){var r=n&&n.style;if(r){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(t=n.currentStyle),e===void 0?t:t[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=t+(typeof t=="string"?"":"px")}}function Rd(n,e){var t="";if(typeof n=="string")t=n;else do{var r=wt(n,"transform");r&&r!=="none"&&(t=r+" "+t)}while(!e&&(n=n.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(t)}function SO(n,e,t){if(n){var r=n.getElementsByTagName(e),i=0,a=r.length;if(t)for(;i<a;i++)t(r[i],i);return r}return[]}function Vl(){var n=document.scrollingElement;return n||document.documentElement}function qr(n,e,t,r,i){if(!(!n.getBoundingClientRect&&n!==window)){var a,s,u,c,h,g,v;if(n!==window&&n.parentNode&&n!==Vl()?(a=n.getBoundingClientRect(),s=a.top,u=a.left,c=a.bottom,h=a.right,g=a.height,v=a.width):(s=0,u=0,c=window.innerHeight,h=window.innerWidth,g=window.innerHeight,v=window.innerWidth),(e||t)&&n!==window&&(i=i||n.parentNode,!Mu))do if(i&&i.getBoundingClientRect&&(wt(i,"transform")!=="none"||t&&wt(i,"position")!=="static")){var y=i.getBoundingClientRect();s-=y.top+parseInt(wt(i,"border-top-width")),u-=y.left+parseInt(wt(i,"border-left-width")),c=s+a.height,h=u+a.width;break}while(i=i.parentNode);if(r&&n!==window){var S=Rd(i||n),E=S&&S.a,O=S&&S.d;S&&(s/=O,u/=E,v/=E,g/=O,c=s+g,h=u+v)}return{top:s,left:u,bottom:c,right:h,width:v,height:g}}}function _A(n,e,t){for(var r=Tc(n,!0),i=qr(n)[e];r;){var a=qr(r)[t],s=void 0;if(s=i>=a,!s)return r;if(r===Vl())break;r=Tc(r,!1)}return!1}function op(n,e,t,r){for(var i=0,a=0,s=n.children;a<s.length;){if(s[a].style.display!=="none"&&s[a]!==nn.ghost&&(r||s[a]!==nn.dragged)&&js(s[a],t.draggable,n,!1)){if(i===e)return s[a];i++}a++}return null}function R5(n,e){for(var t=n.lastElementChild;t&&(t===nn.ghost||wt(t,"display")==="none"||e&&!J1(t,e));)t=t.previousElementSibling;return t||null}function xi(n,e){var t=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==nn.clone&&(!e||J1(n,e))&&t++;return t}function EA(n){var e=0,t=0,r=Vl();if(n)do{var i=Rd(n),a=i.a,s=i.d;e+=n.scrollLeft*a,t+=n.scrollTop*s}while(n!==r&&(n=n.parentNode));return[e,t]}function SG(n,e){for(var t in n)if(n.hasOwnProperty(t)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===n[t][r])return Number(t)}return-1}function Tc(n,e){if(!n||!n.getBoundingClientRect)return Vl();var t=n,r=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var i=wt(t);if(t.clientWidth<t.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return Vl();if(r||e)return t;r=!0}}while(t=t.parentNode);return Vl()}function CG(n,e){if(n&&e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function Dx(n,e){return Math.round(n.top)===Math.round(e.top)&&Math.round(n.left)===Math.round(e.left)&&Math.round(n.height)===Math.round(e.height)&&Math.round(n.width)===Math.round(e.width)}var Tm;function CO(n,e){return function(){if(!Tm){var t=arguments,r=this;t.length===1?n.call(r,t[0]):n.apply(r,t),Tm=setTimeout(function(){Tm=void 0},e)}}}function _G(){clearTimeout(Tm),Tm=void 0}function _O(n,e,t){n.scrollLeft+=e,n.scrollTop+=t}function I5(n){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(n).cloneNode(!0):t?t(n).clone(!0)[0]:n.cloneNode(!0)}function TA(n,e){wt(n,"position","absolute"),wt(n,"top",e.top),wt(n,"left",e.left),wt(n,"width",e.width),wt(n,"height",e.height)}function Nx(n){wt(n,"position",""),wt(n,"top",""),wt(n,"left",""),wt(n,"width",""),wt(n,"height","")}function EO(n,e,t){var r={};return Array.from(n.children).forEach(function(i){var a,s,u,c;if(!(!js(i,e.draggable,n,!1)||i.animated||i===t)){var h=qr(i);r.left=Math.min((a=r.left)!==null&&a!==void 0?a:1/0,h.left),r.top=Math.min((s=r.top)!==null&&s!==void 0?s:1/0,h.top),r.right=Math.max((u=r.right)!==null&&u!==void 0?u:-1/0,h.right),r.bottom=Math.max((c=r.bottom)!==null&&c!==void 0?c:-1/0,h.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var Na="Sortable"+new Date().getTime();function EG(){var n=[],e;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(i){if(!(wt(i,"display")==="none"||i===nn.ghost)){n.push({target:i,rect:qr(i)});var a=Wl({},n[n.length-1].rect);if(i.thisAnimationDuration){var s=Rd(i,!0);s&&(a.top-=s.f,a.left-=s.e)}i.fromRect=a}})}},addAnimationState:function(r){n.push(r)},removeAnimationState:function(r){n.splice(SG(n,{target:r}),1)},animateAll:function(r){var i=this;if(!this.options.animation){clearTimeout(e),typeof r=="function"&&r();return}var a=!1,s=0;n.forEach(function(u){var c=0,h=u.target,g=h.fromRect,v=qr(h),y=h.prevFromRect,S=h.prevToRect,E=u.rect,O=Rd(h,!0);O&&(v.top-=O.f,v.left-=O.e),h.toRect=v,h.thisAnimationDuration&&Dx(y,v)&&!Dx(g,v)&&(E.top-v.top)/(E.left-v.left)===(g.top-v.top)/(g.left-v.left)&&(c=wG(E,y,S,i.options)),Dx(v,g)||(h.prevFromRect=g,h.prevToRect=v,c||(c=i.options.animation),i.animate(h,E,v,c)),c&&(a=!0,s=Math.max(s,c),clearTimeout(h.animationResetTimer),h.animationResetTimer=setTimeout(function(){h.animationTime=0,h.prevFromRect=null,h.fromRect=null,h.prevToRect=null,h.thisAnimationDuration=null},c),h.thisAnimationDuration=c)}),clearTimeout(e),a?e=setTimeout(function(){typeof r=="function"&&r()},s):typeof r=="function"&&r(),n=[]},animate:function(r,i,a,s){if(s){wt(r,"transition",""),wt(r,"transform","");var u=Rd(this.el),c=u&&u.a,h=u&&u.d,g=(i.left-a.left)/(c||1),v=(i.top-a.top)/(h||1);r.animatingX=!!g,r.animatingY=!!v,wt(r,"transform","translate3d("+g+"px,"+v+"px,0)"),this.forRepaintDummy=TG(r),wt(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),wt(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){wt(r,"transition",""),wt(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function TG(n){return n.offsetWidth}function wG(n,e,t,r){return Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*r.animation}var vh=[],Mx={initializeByDefault:!0},Wm={mount:function(e){for(var t in Mx)Mx.hasOwnProperty(t)&&!(t in e)&&(e[t]=Mx[t]);vh.forEach(function(r){if(r.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),vh.push(e)},pluginEvent:function(e,t,r){var i=this;this.eventCanceled=!1,r.cancel=function(){i.eventCanceled=!0};var a=e+"Global";vh.forEach(function(s){t[s.pluginName]&&(t[s.pluginName][a]&&t[s.pluginName][a](Wl({sortable:t},r)),t.options[s.pluginName]&&t[s.pluginName][e]&&t[s.pluginName][e](Wl({sortable:t},r)))})},initializePlugins:function(e,t,r,i){vh.forEach(function(u){var c=u.pluginName;if(!(!e.options[c]&&!u.initializeByDefault)){var h=new u(e,t,e.options);h.sortable=e,h.options=e.options,e[c]=h,Po(r,h.defaults)}});for(var a in e.options)if(e.options.hasOwnProperty(a)){var s=this.modifyOption(e,a,e.options[a]);typeof s<"u"&&(e.options[a]=s)}},getEventProperties:function(e,t){var r={};return vh.forEach(function(i){typeof i.eventProperties=="function"&&Po(r,i.eventProperties.call(t[i.pluginName],e))}),r},modifyOption:function(e,t,r){var i;return vh.forEach(function(a){e[a.pluginName]&&a.optionListeners&&typeof a.optionListeners[t]=="function"&&(i=a.optionListeners[t].call(e[a.pluginName],r))}),i}};function Qg(n){var e=n.sortable,t=n.rootEl,r=n.name,i=n.targetEl,a=n.cloneEl,s=n.toEl,u=n.fromEl,c=n.oldIndex,h=n.newIndex,g=n.oldDraggableIndex,v=n.newDraggableIndex,y=n.originalEvent,S=n.putSortable,E=n.extraEventProperties;if(e=e||t&&t[Na],!!e){var O,_=e.options,w="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Mu&&!Vm?O=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(O=document.createEvent("Event"),O.initEvent(r,!0,!0)),O.to=s||t,O.from=u||t,O.item=i||t,O.clone=a,O.oldIndex=c,O.newIndex=h,O.oldDraggableIndex=g,O.newDraggableIndex=v,O.originalEvent=y,O.pullMode=S?S.lastPutMode:void 0;var N=Wl(Wl({},E),Wm.getEventProperties(r,e));for(var L in N)O[L]=N[L];t&&t.dispatchEvent(O),_[w]&&_[w].call(e,O)}}var AG=["evt"],Ms=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,a=pG(r,AG);Wm.pluginEvent.bind(nn)(e,t,Wl({dragEl:Je,parentEl:bi,ghostEl:dn,rootEl:Zr,nextEl:Sd,lastDownEl:F1,cloneEl:ai,cloneHidden:Cc,dragStarted:em,putSortable:Da,activeSortable:nn.active,originalEvent:i,oldIndex:Qh,oldDraggableIndex:wm,newIndex:ao,newDraggableIndex:Sc,hideGhostForTarget:RO,unhideGhostForTarget:IO,cloneNowHidden:function(){Cc=!0},cloneNowShown:function(){Cc=!1},dispatchSortableEvent:function(u){ys({sortable:t,name:u,originalEvent:i})}},a))};function ys(n){Qg(Wl({putSortable:Da,cloneEl:ai,targetEl:Je,rootEl:Zr,oldIndex:Qh,oldDraggableIndex:wm,newIndex:ao,newDraggableIndex:Sc},n))}var Je,bi,dn,Zr,Sd,F1,ai,Cc,Qh,ao,wm,Sc,Qv,Da,Rh=!1,K1=!1,$1=[],pd,tl,Lx,kx,wA,AA,em,yh,Am,Rm=!1,e1=!1,B1,Ya,Px=[],TE=!1,Q1=[],_y=typeof document<"u",t1=A5,RA=Vm||Mu?"cssFloat":"float",RG=_y&&!yO&&!A5&&"draggable"in document.createElement("div"),TO=(function(){if(_y){if(Mu)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}})(),wO=function(e,t){var r=wt(e),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),a=op(e,0,t),s=op(e,1,t),u=a&&wt(a),c=s&&wt(s),h=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+qr(a).width,g=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+qr(s).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&u.float&&u.float!=="none"){var v=u.float==="left"?"left":"right";return s&&(c.clear==="both"||c.clear===v)?"vertical":"horizontal"}return a&&(u.display==="block"||u.display==="flex"||u.display==="table"||u.display==="grid"||h>=i&&r[RA]==="none"||s&&r[RA]==="none"&&h+g>i)?"vertical":"horizontal"},IG=function(e,t,r){var i=r?e.left:e.top,a=r?e.right:e.bottom,s=r?e.width:e.height,u=r?t.left:t.top,c=r?t.right:t.bottom,h=r?t.width:t.height;return i===u||a===c||i+s/2===u+h/2},OG=function(e,t){var r;return $1.some(function(i){var a=i[Na].options.emptyInsertThreshold;if(!(!a||R5(i))){var s=qr(i),u=e>=s.left-a&&e<=s.right+a,c=t>=s.top-a&&t<=s.bottom+a;if(u&&c)return r=i}}),r},AO=function(e){function t(a,s){return function(u,c,h,g){var v=u.options.group.name&&c.options.group.name&&u.options.group.name===c.options.group.name;if(a==null&&(s||v))return!0;if(a==null||a===!1)return!1;if(s&&a==="clone")return a;if(typeof a=="function")return t(a(u,c,h,g),s)(u,c,h,g);var y=(s?u:c).options.group.name;return a===!0||typeof a=="string"&&a===y||a.join&&a.indexOf(y)>-1}}var r={},i=e.group;(!i||EE(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=t(i.pull,!0),r.checkPut=t(i.put),r.revertClone=i.revertClone,e.group=r},RO=function(){!TO&&dn&&wt(dn,"display","none")},IO=function(){!TO&&dn&&wt(dn,"display","")};_y&&!yO&&document.addEventListener("click",function(n){if(K1)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),K1=!1,!1},!0);var gd=function(e){if(Je){e=e.touches?e.touches[0]:e;var t=OG(e.clientX,e.clientY);if(t){var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);r.target=r.rootEl=t,r.preventDefault=void 0,r.stopPropagation=void 0,t[Na]._onDragOver(r)}}},DG=function(e){Je&&Je.parentNode[Na]._isOutsideThisEl(e.target)};function nn(n,e){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=e=Po({},e),n[Na]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return wO(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,u){s.setData("Text",u.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:nn.supportPointer!==!1&&"PointerEvent"in window&&(!Em||A5),emptyInsertThreshold:5};Wm.initializePlugins(this,n,t);for(var r in t)!(r in e)&&(e[r]=t[r]);AO(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:RG,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Tn(n,"pointerdown",this._onTapStart):(Tn(n,"mousedown",this._onTapStart),Tn(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(Tn(n,"dragover",this),Tn(n,"dragenter",this)),$1.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Po(this,EG())}nn.prototype={constructor:nn,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(yh=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,Je):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,r=this.el,i=this.options,a=i.preventOnFilter,s=e.type,u=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,c=(u||e).target,h=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||c,g=i.filter;if(BG(r),!Je&&!(/mousedown|pointerdown/.test(s)&&e.button!==0||i.disabled)&&!h.isContentEditable&&!(!this.nativeDraggable&&Em&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=js(c,i.draggable,r,!1),!(c&&c.animated)&&F1!==c)){if(Qh=xi(c),wm=xi(c,i.draggable),typeof g=="function"){if(g.call(this,e,c,this)){ys({sortable:t,rootEl:h,name:"filter",targetEl:c,toEl:r,fromEl:r}),Ms("filter",t,{evt:e}),a&&e.preventDefault();return}}else if(g&&(g=g.split(",").some(function(v){if(v=js(h,v.trim(),r,!1),v)return ys({sortable:t,rootEl:v,name:"filter",targetEl:c,fromEl:r,toEl:r}),Ms("filter",t,{evt:e}),!0}),g)){a&&e.preventDefault();return}i.handle&&!js(h,i.handle,r,!1)||this._prepareDragStart(e,u,c)}}},_prepareDragStart:function(e,t,r){var i=this,a=i.el,s=i.options,u=a.ownerDocument,c;if(r&&!Je&&r.parentNode===a){var h=qr(r);if(Zr=a,Je=r,bi=Je.parentNode,Sd=Je.nextSibling,F1=r,Qv=s.group,nn.dragged=Je,pd={target:Je,clientX:(t||e).clientX,clientY:(t||e).clientY},wA=pd.clientX-h.left,AA=pd.clientY-h.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Je.style["will-change"]="all",c=function(){if(Ms("delayEnded",i,{evt:e}),nn.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!SA&&i.nativeDraggable&&(Je.draggable=!0),i._triggerDragStart(e,t),ys({sortable:i,name:"choose",originalEvent:e}),si(Je,s.chosenClass,!0)},s.ignore.split(",").forEach(function(g){SO(Je,g.trim(),jx)}),Tn(u,"dragover",gd),Tn(u,"mousemove",gd),Tn(u,"touchmove",gd),s.supportPointer?(Tn(u,"pointerup",i._onDrop),!this.nativeDraggable&&Tn(u,"pointercancel",i._onDrop)):(Tn(u,"mouseup",i._onDrop),Tn(u,"touchend",i._onDrop),Tn(u,"touchcancel",i._onDrop)),SA&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Je.draggable=!0),Ms("delayStart",this,{evt:e}),s.delay&&(!s.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Vm||Mu))){if(nn.eventCanceled){this._onDrop();return}s.supportPointer?(Tn(u,"pointerup",i._disableDelayedDrag),Tn(u,"pointercancel",i._disableDelayedDrag)):(Tn(u,"mouseup",i._disableDelayedDrag),Tn(u,"touchend",i._disableDelayedDrag),Tn(u,"touchcancel",i._disableDelayedDrag)),Tn(u,"mousemove",i._delayedDragTouchMoveHandler),Tn(u,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&Tn(u,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(c,s.delay)}else c()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Je&&jx(Je),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;_n(e,"mouseup",this._disableDelayedDrag),_n(e,"touchend",this._disableDelayedDrag),_n(e,"touchcancel",this._disableDelayedDrag),_n(e,"pointerup",this._disableDelayedDrag),_n(e,"pointercancel",this._disableDelayedDrag),_n(e,"mousemove",this._delayedDragTouchMoveHandler),_n(e,"touchmove",this._delayedDragTouchMoveHandler),_n(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?Tn(document,"pointermove",this._onTouchMove):t?Tn(document,"touchmove",this._onTouchMove):Tn(document,"mousemove",this._onTouchMove):(Tn(Je,"dragend",this),Tn(Zr,"dragstart",this._onDragStart));try{document.selection?G1(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Rh=!1,Zr&&Je){Ms("dragStarted",this,{evt:t}),this.nativeDraggable&&Tn(document,"dragover",DG);var r=this.options;!e&&si(Je,r.dragClass,!1),si(Je,r.ghostClass,!0),nn.active=this,e&&this._appendGhost(),ys({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(tl){this._lastX=tl.clientX,this._lastY=tl.clientY,RO();for(var e=document.elementFromPoint(tl.clientX,tl.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(tl.clientX,tl.clientY),e!==t);)t=e;if(Je.parentNode[Na]._isOutsideThisEl(e),t)do{if(t[Na]){var r=void 0;if(r=t[Na]._onDragOver({clientX:tl.clientX,clientY:tl.clientY,target:e,rootEl:t}),r&&!this.options.dragoverBubble)break}e=t}while(t=xO(t));IO()}},_onTouchMove:function(e){if(pd){var t=this.options,r=t.fallbackTolerance,i=t.fallbackOffset,a=e.touches?e.touches[0]:e,s=dn&&Rd(dn,!0),u=dn&&s&&s.a,c=dn&&s&&s.d,h=t1&&Ya&&EA(Ya),g=(a.clientX-pd.clientX+i.x)/(u||1)+(h?h[0]-Px[0]:0)/(u||1),v=(a.clientY-pd.clientY+i.y)/(c||1)+(h?h[1]-Px[1]:0)/(c||1);if(!nn.active&&!Rh){if(r&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))<r)return;this._onDragStart(e,!0)}if(dn){s?(s.e+=g-(Lx||0),s.f+=v-(kx||0)):s={a:1,b:0,c:0,d:1,e:g,f:v};var y="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");wt(dn,"webkitTransform",y),wt(dn,"mozTransform",y),wt(dn,"msTransform",y),wt(dn,"transform",y),Lx=g,kx=v,tl=a}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!dn){var e=this.options.fallbackOnBody?document.body:Zr,t=qr(Je,!0,t1,!0,e),r=this.options;if(t1){for(Ya=e;wt(Ya,"position")==="static"&&wt(Ya,"transform")==="none"&&Ya!==document;)Ya=Ya.parentNode;Ya!==document.body&&Ya!==document.documentElement?(Ya===document&&(Ya=Vl()),t.top+=Ya.scrollTop,t.left+=Ya.scrollLeft):Ya=Vl(),Px=EA(Ya)}dn=Je.cloneNode(!0),si(dn,r.ghostClass,!1),si(dn,r.fallbackClass,!0),si(dn,r.dragClass,!0),wt(dn,"transition",""),wt(dn,"transform",""),wt(dn,"box-sizing","border-box"),wt(dn,"margin",0),wt(dn,"top",t.top),wt(dn,"left",t.left),wt(dn,"width",t.width),wt(dn,"height",t.height),wt(dn,"opacity","0.8"),wt(dn,"position",t1?"absolute":"fixed"),wt(dn,"zIndex","100000"),wt(dn,"pointerEvents","none"),nn.ghost=dn,e.appendChild(dn),wt(dn,"transform-origin",wA/parseInt(dn.style.width)*100+"% "+AA/parseInt(dn.style.height)*100+"%")}},_onDragStart:function(e,t){var r=this,i=e.dataTransfer,a=r.options;if(Ms("dragStart",this,{evt:e}),nn.eventCanceled){this._onDrop();return}Ms("setupClone",this),nn.eventCanceled||(ai=I5(Je),ai.removeAttribute("id"),ai.draggable=!1,ai.style["will-change"]="",this._hideClone(),si(ai,this.options.chosenClass,!1),nn.clone=ai),r.cloneId=G1(function(){Ms("clone",r),!nn.eventCanceled&&(r.options.removeCloneOnHide||Zr.insertBefore(ai,Je),r._hideClone(),ys({sortable:r,name:"clone"}))}),!t&&si(Je,a.dragClass,!0),t?(K1=!0,r._loopId=setInterval(r._emulateDragOver,50)):(_n(document,"mouseup",r._onDrop),_n(document,"touchend",r._onDrop),_n(document,"touchcancel",r._onDrop),i&&(i.effectAllowed="move",a.setData&&a.setData.call(r,i,Je)),Tn(document,"drop",r),wt(Je,"transform","translateZ(0)")),Rh=!0,r._dragStartId=G1(r._dragStarted.bind(r,t,e)),Tn(document,"selectstart",r),em=!0,window.getSelection().removeAllRanges(),Em&&wt(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,r=e.target,i,a,s,u=this.options,c=u.group,h=nn.active,g=Qv===c,v=u.sort,y=Da||h,S,E=this,O=!1;if(TE)return;function _(K,oe){Ms(K,E,Wl({evt:e,isOwner:g,axis:S?"vertical":"horizontal",revert:s,dragRect:i,targetRect:a,canSort:v,fromSortable:y,target:r,completed:N,onMove:function(ge,pe){return n1(Zr,t,Je,i,ge,qr(ge),e,pe)},changed:L},oe))}function w(){_("dragOverAnimationCapture"),E.captureAnimationState(),E!==y&&y.captureAnimationState()}function N(K){return _("dragOverCompleted",{insertion:K}),K&&(g?h._hideClone():h._showClone(E),E!==y&&(si(Je,Da?Da.options.ghostClass:h.options.ghostClass,!1),si(Je,u.ghostClass,!0)),Da!==E&&E!==nn.active?Da=E:E===nn.active&&Da&&(Da=null),y===E&&(E._ignoreWhileAnimating=r),E.animateAll(function(){_("dragOverAnimationComplete"),E._ignoreWhileAnimating=null}),E!==y&&(y.animateAll(),y._ignoreWhileAnimating=null)),(r===Je&&!Je.animated||r===t&&!r.animated)&&(yh=null),!u.dragoverBubble&&!e.rootEl&&r!==document&&(Je.parentNode[Na]._isOutsideThisEl(e.target),!K&&gd(e)),!u.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),O=!0}function L(){ao=xi(Je),Sc=xi(Je,u.draggable),ys({sortable:E,name:"change",toEl:t,newIndex:ao,newDraggableIndex:Sc,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),r=js(r,u.draggable,t,!0),_("dragOver"),nn.eventCanceled)return O;if(Je.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||E._ignoreWhileAnimating===r)return N(!1);if(K1=!1,h&&!u.disabled&&(g?v||(s=bi!==Zr):Da===this||(this.lastPutMode=Qv.checkPull(this,h,Je,e))&&c.checkPut(this,h,Je,e))){if(S=this._getDirection(e,r)==="vertical",i=qr(Je),_("dragOverValid"),nn.eventCanceled)return O;if(s)return bi=Zr,w(),this._hideClone(),_("revert"),nn.eventCanceled||(Sd?Zr.insertBefore(Je,Sd):Zr.appendChild(Je)),N(!0);var P=R5(t,u.draggable);if(!P||kG(e,S,this)&&!P.animated){if(P===Je)return N(!1);if(P&&t===e.target&&(r=P),r&&(a=qr(r)),n1(Zr,t,Je,i,r,a,e,!!r)!==!1)return w(),P&&P.nextSibling?t.insertBefore(Je,P.nextSibling):t.appendChild(Je),bi=t,L(),N(!0)}else if(P&&LG(e,S,this)){var H=op(t,0,u,!0);if(H===Je)return N(!1);if(r=H,a=qr(r),n1(Zr,t,Je,i,r,a,e,!1)!==!1)return w(),t.insertBefore(Je,H),bi=t,L(),N(!0)}else if(r.parentNode===t){a=qr(r);var B=0,G,V=Je.parentNode!==t,Z=!IG(Je.animated&&Je.toRect||i,r.animated&&r.toRect||a,S),X=S?"top":"left",k=_A(r,"top","top")||_A(Je,"top","top"),z=k?k.scrollTop:void 0;yh!==r&&(G=a[X],Rm=!1,e1=!Z&&u.invertSwap||V),B=PG(e,r,a,S,Z?1:u.swapThreshold,u.invertedSwapThreshold==null?u.swapThreshold:u.invertedSwapThreshold,e1,yh===r);var q;if(B!==0){var te=xi(Je);do te-=B,q=bi.children[te];while(q&&(wt(q,"display")==="none"||q===dn))}if(B===0||q===r)return N(!1);yh=r,Am=B;var ee=r.nextElementSibling,$=!1;$=B===1;var ie=n1(Zr,t,Je,i,r,a,e,$);if(ie!==!1)return(ie===1||ie===-1)&&($=ie===1),TE=!0,setTimeout(MG,30),w(),$&&!ee?t.appendChild(Je):r.parentNode.insertBefore(Je,$?ee:r),k&&_O(k,0,z-k.scrollTop),bi=Je.parentNode,G!==void 0&&!e1&&(B1=Math.abs(G-qr(r)[X])),L(),N(!0)}if(t.contains(Je))return N(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){_n(document,"mousemove",this._onTouchMove),_n(document,"touchmove",this._onTouchMove),_n(document,"pointermove",this._onTouchMove),_n(document,"dragover",gd),_n(document,"mousemove",gd),_n(document,"touchmove",gd)},_offUpEvents:function(){var e=this.el.ownerDocument;_n(e,"mouseup",this._onDrop),_n(e,"touchend",this._onDrop),_n(e,"pointerup",this._onDrop),_n(e,"pointercancel",this._onDrop),_n(e,"touchcancel",this._onDrop),_n(document,"selectstart",this)},_onDrop:function(e){var t=this.el,r=this.options;if(ao=xi(Je),Sc=xi(Je,r.draggable),Ms("drop",this,{evt:e}),bi=Je&&Je.parentNode,ao=xi(Je),Sc=xi(Je,r.draggable),nn.eventCanceled){this._nulling();return}Rh=!1,e1=!1,Rm=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),wE(this.cloneId),wE(this._dragStartId),this.nativeDraggable&&(_n(document,"drop",this),_n(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Em&&wt(document.body,"user-select",""),wt(Je,"transform",""),e&&(em&&(e.cancelable&&e.preventDefault(),!r.dropBubble&&e.stopPropagation()),dn&&dn.parentNode&&dn.parentNode.removeChild(dn),(Zr===bi||Da&&Da.lastPutMode!=="clone")&&ai&&ai.parentNode&&ai.parentNode.removeChild(ai),Je&&(this.nativeDraggable&&_n(Je,"dragend",this),jx(Je),Je.style["will-change"]="",em&&!Rh&&si(Je,Da?Da.options.ghostClass:this.options.ghostClass,!1),si(Je,this.options.chosenClass,!1),ys({sortable:this,name:"unchoose",toEl:bi,newIndex:null,newDraggableIndex:null,originalEvent:e}),Zr!==bi?(ao>=0&&(ys({rootEl:bi,name:"add",toEl:bi,fromEl:Zr,originalEvent:e}),ys({sortable:this,name:"remove",toEl:bi,originalEvent:e}),ys({rootEl:bi,name:"sort",toEl:bi,fromEl:Zr,originalEvent:e}),ys({sortable:this,name:"sort",toEl:bi,originalEvent:e})),Da&&Da.save()):ao!==Qh&&ao>=0&&(ys({sortable:this,name:"update",toEl:bi,originalEvent:e}),ys({sortable:this,name:"sort",toEl:bi,originalEvent:e})),nn.active&&((ao==null||ao===-1)&&(ao=Qh,Sc=wm),ys({sortable:this,name:"end",toEl:bi,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Ms("nulling",this),Zr=Je=bi=dn=Sd=ai=F1=Cc=pd=tl=em=ao=Sc=Qh=wm=yh=Am=Da=Qv=nn.dragged=nn.ghost=nn.clone=nn.active=null;var e=this.el;Q1.forEach(function(t){e.contains(t)&&(t.checked=!0)}),Q1.length=Lx=kx=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Je&&(this._onDragOver(e),NG(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,r=this.el.children,i=0,a=r.length,s=this.options;i<a;i++)t=r[i],js(t,s.draggable,this.el,!1)&&e.push(t.getAttribute(s.dataIdAttr)||FG(t));return e},sort:function(e,t){var r={},i=this.el;this.toArray().forEach(function(a,s){var u=i.children[s];js(u,this.options.draggable,i,!1)&&(r[a]=u)},this),t&&this.captureAnimationState(),e.forEach(function(a){r[a]&&(i.removeChild(r[a]),i.appendChild(r[a]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return js(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var r=this.options;if(t===void 0)return r[e];var i=Wm.modifyOption(this,e,t);typeof i<"u"?r[e]=i:r[e]=t,e==="group"&&AO(r)},destroy:function(){Ms("destroy",this);var e=this.el;e[Na]=null,_n(e,"mousedown",this._onTapStart),_n(e,"touchstart",this._onTapStart),_n(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(_n(e,"dragover",this),_n(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),$1.splice($1.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Cc){if(Ms("hideClone",this),nn.eventCanceled)return;wt(ai,"display","none"),this.options.removeCloneOnHide&&ai.parentNode&&ai.parentNode.removeChild(ai),Cc=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Cc){if(Ms("showClone",this),nn.eventCanceled)return;Je.parentNode==Zr&&!this.options.group.revertClone?Zr.insertBefore(ai,Je):Sd?Zr.insertBefore(ai,Sd):Zr.appendChild(ai),this.options.group.revertClone&&this.animate(Je,ai),wt(ai,"display",""),Cc=!1}}};function NG(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function n1(n,e,t,r,i,a,s,u){var c,h=n[Na],g=h.options.onMove,v;return window.CustomEvent&&!Mu&&!Vm?c=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(c=document.createEvent("Event"),c.initEvent("move",!0,!0)),c.to=e,c.from=n,c.dragged=t,c.draggedRect=r,c.related=i||e,c.relatedRect=a||qr(e),c.willInsertAfter=u,c.originalEvent=s,n.dispatchEvent(c),g&&(v=g.call(h,c,s)),v}function jx(n){n.draggable=!1}function MG(){TE=!1}function LG(n,e,t){var r=qr(op(t.el,0,t.options,!0)),i=EO(t.el,t.options,dn),a=10;return e?n.clientX<i.left-a||n.clientY<r.top&&n.clientX<r.right:n.clientY<i.top-a||n.clientY<r.bottom&&n.clientX<r.left}function kG(n,e,t){var r=qr(R5(t.el,t.options.draggable)),i=EO(t.el,t.options,dn),a=10;return e?n.clientX>i.right+a||n.clientY>r.bottom&&n.clientX>r.left:n.clientY>i.bottom+a||n.clientX>r.right&&n.clientY>r.top}function PG(n,e,t,r,i,a,s,u){var c=r?n.clientY:n.clientX,h=r?t.height:t.width,g=r?t.top:t.left,v=r?t.bottom:t.right,y=!1;if(!s){if(u&&B1<h*i){if(!Rm&&(Am===1?c>g+h*a/2:c<v-h*a/2)&&(Rm=!0),Rm)y=!0;else if(Am===1?c<g+B1:c>v-B1)return-Am}else if(c>g+h*(1-i)/2&&c<v-h*(1-i)/2)return jG(e)}return y=y||s,y&&(c<g+h*a/2||c>v-h*a/2)?c>g+h/2?1:-1:0}function jG(n){return xi(Je)<xi(n)?1:-1}function FG(n){for(var e=n.tagName+n.className+n.src+n.href+n.textContent,t=e.length,r=0;t--;)r+=e.charCodeAt(t);return r.toString(36)}function BG(n){Q1.length=0;for(var e=n.getElementsByTagName("input"),t=e.length;t--;){var r=e[t];r.checked&&Q1.push(r)}}function G1(n){return setTimeout(n,0)}function wE(n){return clearTimeout(n)}_y&&Tn(document,"touchmove",function(n){(nn.active||Rh)&&n.cancelable&&n.preventDefault()});nn.utils={on:Tn,off:_n,css:wt,find:SO,is:function(e,t){return!!js(e,t,e,!1)},extend:CG,throttle:CO,closest:js,toggleClass:si,clone:I5,index:xi,nextTick:G1,cancelNextTick:wE,detectDirection:wO,getChild:op,expando:Na};nn.get=function(n){return n[Na]};nn.mount=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(nn.utils=Wl(Wl({},nn.utils),r.utils)),Wm.mount(r)})};nn.create=function(n,e){return new nn(n,e)};nn.version=xG;var Bi=[],tm,AE,RE=!1,Fx,Bx,ey,nm;function GG(){function n(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return n.prototype={dragStarted:function(t){var r=t.originalEvent;this.sortable.nativeDraggable?Tn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Tn(document,"pointermove",this._handleFallbackAutoScroll):r.touches?Tn(document,"touchmove",this._handleFallbackAutoScroll):Tn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var r=t.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?_n(document,"dragover",this._handleAutoScroll):(_n(document,"pointermove",this._handleFallbackAutoScroll),_n(document,"touchmove",this._handleFallbackAutoScroll),_n(document,"mousemove",this._handleFallbackAutoScroll)),IA(),H1(),_G()},nulling:function(){ey=AE=tm=RE=nm=Fx=Bx=null,Bi.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,r){var i=this,a=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,u=document.elementFromPoint(a,s);if(ey=t,r||this.options.forceAutoScrollFallback||Vm||Mu||Em){Gx(t,this.options,u,r);var c=Tc(u,!0);RE&&(!nm||a!==Fx||s!==Bx)&&(nm&&IA(),nm=setInterval(function(){var h=Tc(document.elementFromPoint(a,s),!0);h!==c&&(c=h,H1()),Gx(t,i.options,h,r)},10),Fx=a,Bx=s)}else{if(!this.options.bubbleScroll||Tc(u,!0)===Vl()){H1();return}Gx(t,this.options,Tc(u,!1),!1)}}},Po(n,{pluginName:"scroll",initializeByDefault:!0})}function H1(){Bi.forEach(function(n){clearInterval(n.pid)}),Bi=[]}function IA(){clearInterval(nm)}var Gx=CO(function(n,e,t,r){if(e.scroll){var i=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,s=e.scrollSensitivity,u=e.scrollSpeed,c=Vl(),h=!1,g;AE!==t&&(AE=t,H1(),tm=e.scroll,g=e.scrollFn,tm===!0&&(tm=Tc(t,!0)));var v=0,y=tm;do{var S=y,E=qr(S),O=E.top,_=E.bottom,w=E.left,N=E.right,L=E.width,P=E.height,H=void 0,B=void 0,G=S.scrollWidth,V=S.scrollHeight,Z=wt(S),X=S.scrollLeft,k=S.scrollTop;S===c?(H=L<G&&(Z.overflowX==="auto"||Z.overflowX==="scroll"||Z.overflowX==="visible"),B=P<V&&(Z.overflowY==="auto"||Z.overflowY==="scroll"||Z.overflowY==="visible")):(H=L<G&&(Z.overflowX==="auto"||Z.overflowX==="scroll"),B=P<V&&(Z.overflowY==="auto"||Z.overflowY==="scroll"));var z=H&&(Math.abs(N-i)<=s&&X+L<G)-(Math.abs(w-i)<=s&&!!X),q=B&&(Math.abs(_-a)<=s&&k+P<V)-(Math.abs(O-a)<=s&&!!k);if(!Bi[v])for(var te=0;te<=v;te++)Bi[te]||(Bi[te]={});(Bi[v].vx!=z||Bi[v].vy!=q||Bi[v].el!==S)&&(Bi[v].el=S,Bi[v].vx=z,Bi[v].vy=q,clearInterval(Bi[v].pid),(z!=0||q!=0)&&(h=!0,Bi[v].pid=setInterval((function(){r&&this.layer===0&&nn.active._onTouchMove(ey);var ee=Bi[this.layer].vy?Bi[this.layer].vy*u:0,$=Bi[this.layer].vx?Bi[this.layer].vx*u:0;typeof g=="function"&&g.call(nn.dragged.parentNode[Na],$,ee,n,ey,Bi[this.layer].el)!=="continue"||_O(Bi[this.layer].el,$,ee)}).bind({layer:v}),24))),v++}while(e.bubbleScroll&&y!==c&&(y=Tc(y,!1)));RE=h}},30),OO=function(e){var t=e.originalEvent,r=e.putSortable,i=e.dragEl,a=e.activeSortable,s=e.dispatchSortableEvent,u=e.hideGhostForTarget,c=e.unhideGhostForTarget;if(t){var h=r||a;u();var g=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,v=document.elementFromPoint(g.clientX,g.clientY);c(),h&&!h.el.contains(v)&&(s("spill"),this.onSpill({dragEl:i,putSortable:r}))}};function O5(){}O5.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,r=e.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var i=op(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),r&&r.animateAll()},drop:OO};Po(O5,{pluginName:"revertOnSpill"});function D5(){}D5.prototype={onSpill:function(e){var t=e.dragEl,r=e.putSortable,i=r||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:OO};Po(D5,{pluginName:"removeOnSpill"});var Io;function HG(){function n(){this.defaults={swapClass:"sortable-swap-highlight"}}return n.prototype={dragStart:function(t){var r=t.dragEl;Io=r},dragOverValid:function(t){var r=t.completed,i=t.target,a=t.onMove,s=t.activeSortable,u=t.changed,c=t.cancel;if(s.options.swap){var h=this.sortable.el,g=this.options;if(i&&i!==h){var v=Io;a(i)!==!1?(si(i,g.swapClass,!0),Io=i):Io=null,v&&v!==Io&&si(v,g.swapClass,!1)}u(),r(!0),c()}},drop:function(t){var r=t.activeSortable,i=t.putSortable,a=t.dragEl,s=i||this.sortable,u=this.options;Io&&si(Io,u.swapClass,!1),Io&&(u.swap||i&&i.options.swap)&&a!==Io&&(s.captureAnimationState(),s!==r&&r.captureAnimationState(),zG(a,Io),s.animateAll(),s!==r&&r.animateAll())},nulling:function(){Io=null}},Po(n,{pluginName:"swap",eventProperties:function(){return{swapItem:Io}}})}function zG(n,e){var t=n.parentNode,r=e.parentNode,i,a;!t||!r||t.isEqualNode(e)||r.isEqualNode(n)||(i=xi(n),a=xi(e),t.isEqualNode(r)&&i<a&&a++,t.insertBefore(e,t.children[i]),r.insertBefore(n,r.children[a]))}var cn=[],ro=[],Ng,nl,Mg=!1,Ls=!1,bh=!1,Mr,Lg,r1;function qG(){function n(e){for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this));e.options.avoidImplicitDeselect||(e.options.supportPointer?Tn(document,"pointerup",this._deselectMultiDrag):(Tn(document,"mouseup",this._deselectMultiDrag),Tn(document,"touchend",this._deselectMultiDrag))),Tn(document,"keydown",this._checkKeyDown),Tn(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(i,a){var s="";cn.length&&nl===e?cn.forEach(function(u,c){s+=(c?", ":"")+u.textContent}):s=a.textContent,i.setData("Text",s)}}}return n.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){var r=t.dragEl;Mr=r},delayEnded:function(){this.isMultiDrag=~cn.indexOf(Mr)},setupClone:function(t){var r=t.sortable,i=t.cancel;if(this.isMultiDrag){for(var a=0;a<cn.length;a++)ro.push(I5(cn[a])),ro[a].sortableIndex=cn[a].sortableIndex,ro[a].draggable=!1,ro[a].style["will-change"]="",si(ro[a],this.options.selectedClass,!1),cn[a]===Mr&&si(ro[a],this.options.chosenClass,!1);r._hideClone(),i()}},clone:function(t){var r=t.sortable,i=t.rootEl,a=t.dispatchSortableEvent,s=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||cn.length&&nl===r&&(OA(!0,i),a("clone"),s()))},showClone:function(t){var r=t.cloneNowShown,i=t.rootEl,a=t.cancel;this.isMultiDrag&&(OA(!1,i),ro.forEach(function(s){wt(s,"display","")}),r(),r1=!1,a())},hideClone:function(t){var r=this;t.sortable;var i=t.cloneNowHidden,a=t.cancel;this.isMultiDrag&&(ro.forEach(function(s){wt(s,"display","none"),r.options.removeCloneOnHide&&s.parentNode&&s.parentNode.removeChild(s)}),i(),r1=!0,a())},dragStartGlobal:function(t){t.sortable,!this.isMultiDrag&&nl&&nl.multiDrag._deselectMultiDrag(),cn.forEach(function(r){r.sortableIndex=xi(r)}),cn=cn.sort(function(r,i){return r.sortableIndex-i.sortableIndex}),bh=!0},dragStarted:function(t){var r=this,i=t.sortable;if(this.isMultiDrag){if(this.options.sort&&(i.captureAnimationState(),this.options.animation)){cn.forEach(function(s){s!==Mr&&wt(s,"position","absolute")});var a=qr(Mr,!1,!0,!0);cn.forEach(function(s){s!==Mr&&TA(s,a)}),Ls=!0,Mg=!0}i.animateAll(function(){Ls=!1,Mg=!1,r.options.animation&&cn.forEach(function(s){Nx(s)}),r.options.sort&&i1()})}},dragOver:function(t){var r=t.target,i=t.completed,a=t.cancel;Ls&&~cn.indexOf(r)&&(i(!1),a())},revert:function(t){var r=t.fromSortable,i=t.rootEl,a=t.sortable,s=t.dragRect;cn.length>1&&(cn.forEach(function(u){a.addAnimationState({target:u,rect:Ls?qr(u):s}),Nx(u),u.fromRect=s,r.removeAnimationState(u)}),Ls=!1,UG(!this.options.removeCloneOnHide,i))},dragOverCompleted:function(t){var r=t.sortable,i=t.isOwner,a=t.insertion,s=t.activeSortable,u=t.parentEl,c=t.putSortable,h=this.options;if(a){if(i&&s._hideClone(),Mg=!1,h.animation&&cn.length>1&&(Ls||!i&&!s.options.sort&&!c)){var g=qr(Mr,!1,!0,!0);cn.forEach(function(y){y!==Mr&&(TA(y,g),u.appendChild(y))}),Ls=!0}if(!i)if(Ls||i1(),cn.length>1){var v=r1;s._showClone(r),s.options.animation&&!r1&&v&&ro.forEach(function(y){s.addAnimationState({target:y,rect:Lg}),y.fromRect=Lg,y.thisAnimationDuration=null})}else s._showClone(r)}},dragOverAnimationCapture:function(t){var r=t.dragRect,i=t.isOwner,a=t.activeSortable;if(cn.forEach(function(u){u.thisAnimationDuration=null}),a.options.animation&&!i&&a.multiDrag.isMultiDrag){Lg=Po({},r);var s=Rd(Mr,!0);Lg.top-=s.f,Lg.left-=s.e}},dragOverAnimationComplete:function(){Ls&&(Ls=!1,i1())},drop:function(t){var r=t.originalEvent,i=t.rootEl,a=t.parentEl,s=t.sortable,u=t.dispatchSortableEvent,c=t.oldIndex,h=t.putSortable,g=h||this.sortable;if(r){var v=this.options,y=a.children;if(!bh)if(v.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),si(Mr,v.selectedClass,!~cn.indexOf(Mr)),~cn.indexOf(Mr))cn.splice(cn.indexOf(Mr),1),Ng=null,Qg({sortable:s,rootEl:i,name:"deselect",targetEl:Mr,originalEvent:r});else{if(cn.push(Mr),Qg({sortable:s,rootEl:i,name:"select",targetEl:Mr,originalEvent:r}),r.shiftKey&&Ng&&s.el.contains(Ng)){var S=xi(Ng),E=xi(Mr);~S&&~E&&S!==E&&(function(){var N,L;E>S?(L=S,N=E):(L=E,N=S+1);for(var P=v.filter;L<N;L++)if(!~cn.indexOf(y[L])&&js(y[L],v.draggable,a,!1)){var H=P&&(typeof P=="function"?P.call(s,r,y[L],s):P.split(",").some(function(B){return js(y[L],B.trim(),a,!1)}));H||(si(y[L],v.selectedClass,!0),cn.push(y[L]),Qg({sortable:s,rootEl:i,name:"select",targetEl:y[L],originalEvent:r}))}})()}else Ng=Mr;nl=g}if(bh&&this.isMultiDrag){if(Ls=!1,(a[Na].options.sort||a!==i)&&cn.length>1){var O=qr(Mr),_=xi(Mr,":not(."+this.options.selectedClass+")");if(!Mg&&v.animation&&(Mr.thisAnimationDuration=null),g.captureAnimationState(),!Mg&&(v.animation&&(Mr.fromRect=O,cn.forEach(function(N){if(N.thisAnimationDuration=null,N!==Mr){var L=Ls?qr(N):O;N.fromRect=L,g.addAnimationState({target:N,rect:L})}})),i1(),cn.forEach(function(N){y[_]?a.insertBefore(N,y[_]):a.appendChild(N),_++}),c===xi(Mr))){var w=!1;cn.forEach(function(N){if(N.sortableIndex!==xi(N)){w=!0;return}}),w&&(u("update"),u("sort"))}cn.forEach(function(N){Nx(N)}),g.animateAll()}nl=g}(i===a||h&&h.lastPutMode!=="clone")&&ro.forEach(function(N){N.parentNode&&N.parentNode.removeChild(N)})}},nullingGlobal:function(){this.isMultiDrag=bh=!1,ro.length=0},destroyGlobal:function(){this._deselectMultiDrag(),_n(document,"pointerup",this._deselectMultiDrag),_n(document,"mouseup",this._deselectMultiDrag),_n(document,"touchend",this._deselectMultiDrag),_n(document,"keydown",this._checkKeyDown),_n(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(typeof bh<"u"&&bh)&&nl===this.sortable&&!(t&&js(t.target,this.options.draggable,this.sortable.el,!1))&&!(t&&t.button!==0))for(;cn.length;){var r=cn[0];si(r,this.options.selectedClass,!1),cn.shift(),Qg({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:r,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},Po(n,{pluginName:"multiDrag",utils:{select:function(t){var r=t.parentNode[Na];!r||!r.options.multiDrag||~cn.indexOf(t)||(nl&&nl!==r&&(nl.multiDrag._deselectMultiDrag(),nl=r),si(t,r.options.selectedClass,!0),cn.push(t))},deselect:function(t){var r=t.parentNode[Na],i=cn.indexOf(t);!r||!r.options.multiDrag||!~i||(si(t,r.options.selectedClass,!1),cn.splice(i,1))}},eventProperties:function(){var t=this,r=[],i=[];return cn.forEach(function(a){r.push({multiDragElement:a,index:a.sortableIndex});var s;Ls&&a!==Mr?s=-1:Ls?s=xi(a,":not(."+t.options.selectedClass+")"):s=xi(a),i.push({multiDragElement:a,index:s})}),{items:mG(cn),clones:[].concat(ro),oldIndicies:r,newIndicies:i}},optionListeners:{multiDragKey:function(t){return t=t.toLowerCase(),t==="ctrl"?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function UG(n,e){cn.forEach(function(t,r){var i=e.children[t.sortableIndex+(n?Number(r):0)];i?e.insertBefore(t,i):e.appendChild(t)})}function OA(n,e){ro.forEach(function(t,r){var i=e.children[t.sortableIndex+(n?Number(r):0)];i?e.insertBefore(t,i):e.appendChild(t)})}function i1(){cn.forEach(function(n){n!==Mr&&n.parentNode&&n.parentNode.removeChild(n)})}nn.mount(new GG);nn.mount(D5,O5);const VG=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:qG,Sortable:nn,Swap:HG,default:nn},Symbol.toStringTag,{value:"Module"})),WG=nO(VG);var Hx={exports:{}};var DA;function XG(){return DA||(DA=1,(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var r=[],i=0;i<arguments.length;i++){var a=arguments[i];if(a){var s=typeof a;if(s==="string"||s==="number")r.push(a);else if(Array.isArray(a)){if(a.length){var u=t.apply(null,a);u&&r.push(u)}}else if(s==="object")if(a.toString===Object.prototype.toString)for(var c in a)e.call(a,c)&&a[c]&&r.push(c);else r.push(a.toString())}}return r.join(" ")}n.exports?(t.default=t,n.exports=t):window.classNames=t})()})(Hx)),Hx.exports}var YG=process.env.NODE_ENV==="production",zx="Invariant failed";function ZG(n,e){if(!n){if(YG)throw new Error(zx);var t=typeof e=="function"?e():e,r=t?zx+": "+t:zx;throw new Error(r)}}const JG=Object.freeze(Object.defineProperty({__proto__:null,default:ZG},Symbol.toStringTag,{value:"Module"})),KG=nO(JG);var NA;function $G(){return NA||(NA=1,(function(n){var e=WG,t=XG(),r=D,i=KG;function a(B){return B&&B.__esModule?B.default:B}function s(B,G,V,Z){Object.defineProperty(B,G,{get:V,set:Z,enumerable:!0,configurable:!0})}function u(B,G){return Object.keys(G).forEach(function(V){V==="default"||V==="__esModule"||B.hasOwnProperty(V)||Object.defineProperty(B,V,{enumerable:!0,get:function(){return G[V]}})}),B}s(n.exports,"Sortable",()=>$882b6d93070905b3$re_export$Sortable),s(n.exports,"Direction",()=>$882b6d93070905b3$re_export$Direction),s(n.exports,"DOMRect",()=>$882b6d93070905b3$re_export$DOMRect),s(n.exports,"GroupOptions",()=>$882b6d93070905b3$re_export$GroupOptions),s(n.exports,"MoveEvent",()=>$882b6d93070905b3$re_export$MoveEvent),s(n.exports,"Options",()=>$882b6d93070905b3$re_export$Options),s(n.exports,"PullResult",()=>$882b6d93070905b3$re_export$PullResult),s(n.exports,"PutResult",()=>$882b6d93070905b3$re_export$PutResult),s(n.exports,"SortableEvent",()=>$882b6d93070905b3$re_export$SortableEvent),s(n.exports,"SortableOptions",()=>$882b6d93070905b3$re_export$SortableOptions),s(n.exports,"Utils",()=>$882b6d93070905b3$re_export$Utils),s(n.exports,"ReactSortable",()=>P);function c(B){B.parentElement!==null&&B.parentElement.removeChild(B)}function h(B,G,V){const Z=B.children[V]||null;B.insertBefore(G,Z)}function g(B){B.forEach(G=>c(G.element))}function v(B){B.forEach(G=>{h(G.parentElement,G.element,G.oldIndex)})}function y(B,G){const V=_(B),Z={parentElement:B.from};let X=[];switch(V){case"normal":X=[{element:B.item,newIndex:B.newIndex,oldIndex:B.oldIndex,parentElement:B.from}];break;case"swap":const q={element:B.item,oldIndex:B.oldIndex,newIndex:B.newIndex,...Z},te={element:B.swapItem,oldIndex:B.newIndex,newIndex:B.oldIndex,...Z};X=[q,te];break;case"multidrag":X=B.oldIndicies.map((ee,$)=>({element:ee.multiDragElement,oldIndex:ee.index,newIndex:B.newIndicies[$].index,...Z}));break}return w(X,G)}function S(B,G){const V=E(B,G);return O(B,V)}function E(B,G){const V=[...G];return B.concat().reverse().forEach(Z=>V.splice(Z.oldIndex,1)),V}function O(B,G,V,Z){const X=[...G];return B.forEach(k=>{const z=Z&&V&&Z(k.item,V);X.splice(k.newIndex,0,z||k.item)}),X}function _(B){return B.oldIndicies&&B.oldIndicies.length>0?"multidrag":B.swapItem?"swap":"normal"}function w(B,G){return B.map(Z=>({...Z,item:G[Z.oldIndex]})).sort((Z,X)=>Z.oldIndex-X.oldIndex)}function N(B){const{list:G,setList:V,children:Z,tag:X,style:k,className:z,clone:q,onAdd:te,onChange:ee,onChoose:$,onClone:ie,onEnd:K,onFilter:oe,onRemove:se,onSort:ge,onStart:pe,onUnchoose:Ae,onUpdate:we,onMove:xe,onSpill:Pe,onSelect:Ke,onDeselect:$e,...pt}=B;return pt}const L={dragging:null};class P extends r.Component{static defaultProps={clone:G=>G};constructor(G){super(G),this.ref=(0,r.createRef)();const V=[...G.list].map(Z=>Object.assign(Z,{chosen:!1,selected:!1}));G.setList(V,this.sortable,L),a(i)(!G.plugins,`
|
|
41
41
|
Plugins prop is no longer supported.
|
|
42
42
|
Instead, mount it with "Sortable.mount(new MultiDrag())"
|
|
@@ -279,5 +279,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
279
279
|
40% { opacity: 1; }
|
|
280
280
|
`]))),Uie=function(e,t){var r=e.isFocused,i=e.size,a=e.theme,s=a.colors,u=a.spacing.baseUnit;return qt({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:r?s.neutral60:s.neutral20,padding:u*2})},nE=function(e){var t=e.delay,r=e.offset;return Gt.jsx("span",{css:Gt.css({animation:"".concat(qie," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},process.env.NODE_ENV==="production"?"":";label:LoadingDot;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWUsXG4gIENTU09iamVjdFdpdGhMYWJlbCxcbiAgR3JvdXBCYXNlLFxufSBmcm9tICcuLi90eXBlcyc7XG5pbXBvcnQgeyBnZXRTdHlsZVByb3BzIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgSWNvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBTdmcgPSAoe1xuICBzaXplLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZTogbnVtYmVyIH0pID0+IChcbiAgPHN2Z1xuICAgIGhlaWdodD17c2l6ZX1cbiAgICB3aWR0aD17c2l6ZX1cbiAgICB2aWV3Qm94PVwiMCAwIDIwIDIwXCJcbiAgICBhcmlhLWhpZGRlbj1cInRydWVcIlxuICAgIGZvY3VzYWJsZT1cImZhbHNlXCJcbiAgICBjc3M9e3tcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgZmlsbDogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBsaW5lSGVpZ2h0OiAxLFxuICAgICAgc3Ryb2tlOiAnY3VycmVudENvbG9yJyxcbiAgICAgIHN0cm9rZVdpZHRoOiAwLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IHR5cGUgQ3Jvc3NJY29uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgQ3Jvc3NJY29uID0gKHByb3BzOiBDcm9zc0ljb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNMTQuMzQ4IDE0Ljg0OWMtMC40NjkgMC40NjktMS4yMjkgMC40NjktMS42OTcgMGwtMi42NTEtMy4wMzAtMi42NTEgMy4wMjljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDAtMC40NjktMC40NjktMC40NjktMS4yMjkgMC0xLjY5N2wyLjc1OC0zLjE1LTIuNzU5LTMuMTUyYy0wLjQ2OS0wLjQ2OS0wLjQ2OS0xLjIyOCAwLTEuNjk3czEuMjI4LTAuNDY5IDEuNjk3IDBsMi42NTIgMy4wMzEgMi42NTEtMy4wMzFjMC40NjktMC40NjkgMS4yMjgtMC40NjkgMS42OTcgMHMwLjQ2OSAxLjIyOSAwIDEuNjk3bC0yLjc1OCAzLjE1MiAyLjc1OCAzLjE1YzAuNDY5IDAuNDY5IDAuNDY5IDEuMjI5IDAgMS42OTh6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuZXhwb3J0IHR5cGUgRG93bkNoZXZyb25Qcm9wcyA9IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU/OiBudW1iZXIgfTtcbmV4cG9ydCBjb25zdCBEb3duQ2hldnJvbiA9IChwcm9wczogRG93bkNoZXZyb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNNC41MTYgNy41NDhjMC40MzYtMC40NDYgMS4wNDMtMC40ODEgMS41NzYgMGwzLjkwOCAzLjc0NyAzLjkwOC0zLjc0N2MwLjUzMy0wLjQ4MSAxLjE0MS0wLjQ0NiAxLjU3NCAwIDAuNDM2IDAuNDQ1IDAuNDA4IDEuMTk3IDAgMS42MTUtMC40MDYgMC40MTgtNC42OTUgNC41MDItNC42OTUgNC41MDItMC4yMTcgMC4yMjMtMC41MDIgMC4zMzUtMC43ODcgMC4zMzVzLTAuNTctMC4xMTItMC43ODktMC4zMzVjMCAwLTQuMjg3LTQuMDg0LTQuNjk1LTQuNTAycy0wLjQzNi0xLjE3IDAtMS42MTV6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgQnV0dG9uc1xuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbmV4cG9ydCBpbnRlcmZhY2UgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBUaGUgY2hpbGRyZW4gdG8gYmUgcmVuZGVyZWQgaW5zaWRlIHRoZSBpbmRpY2F0b3IuICovXG4gIGNoaWxkcmVuPzogUmVhY3ROb2RlO1xuICAvKiogUHJvcHMgdGhhdCB3aWxsIGJlIHBhc3NlZCBvbiB0byB0aGUgY2hpbGRyZW4uICovXG4gIGlubmVyUHJvcHM6IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snZGl2J107XG4gIC8qKiBUaGUgZm9jdXNlZCBzdGF0ZSBvZiB0aGUgc2VsZWN0LiAqL1xuICBpc0ZvY3VzZWQ6IGJvb2xlYW47XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG59XG5cbmNvbnN0IGJhc2VDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgdGhlbWU6IHtcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICAgIGNvbG9ycyxcbiAgICB9LFxuICB9OlxuICAgIHwgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuICAgIHwgQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2luZGljYXRvckNvbnRhaW5lcicsXG4gIGRpc3BsYXk6ICdmbGV4JyxcbiAgdHJhbnNpdGlvbjogJ2NvbG9yIDE1MG1zJyxcbiAgLi4uKHVuc3R5bGVkXG4gICAgPyB7fVxuICAgIDoge1xuICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw2MCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIHBhZGRpbmc6IGJhc2VVbml0ICogMixcbiAgICAgICAgJzpob3Zlcic6IHtcbiAgICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw4MCA6IGNvbG9ycy5uZXV0cmFsNDAsXG4gICAgICAgIH0sXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgZHJvcGRvd25JbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IERyb3Bkb3duSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnZHJvcGRvd25JbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2Ryb3Bkb3duLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8RG93bkNoZXZyb24gLz59XG4gICAgPC9kaXY+XG4gICk7XG59O1xuXG5leHBvcnQgaW50ZXJmYWNlIENsZWFySW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xufVxuXG5leHBvcnQgY29uc3QgY2xlYXJJbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IENsZWFySW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnY2xlYXJJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2NsZWFyLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8Q3Jvc3NJY29uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBTZXBhcmF0b3Jcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIEluZGljYXRvclNlcGFyYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpbm5lclByb3BzPzogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ107XG59XG5cbmV4cG9ydCBjb25zdCBpbmRpY2F0b3JTZXBhcmF0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0Rpc2FibGVkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JTZXBhcmF0b3InLFxuICBhbGlnblNlbGY6ICdzdHJldGNoJyxcbiAgd2lkdGg6IDEsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgYmFja2dyb3VuZENvbG9yOiBpc0Rpc2FibGVkID8gY29sb3JzLm5ldXRyYWwxMCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIG1hcmdpbkJvdHRvbTogYmFzZVVuaXQgKiAyLFxuICAgICAgICBtYXJnaW5Ub3A6IGJhc2VVbml0ICogMixcbiAgICAgIH0pLFxufSk7XG5cbmV4cG9ydCBjb25zdCBJbmRpY2F0b3JTZXBhcmF0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHByb3BzOiBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgaW5uZXJQcm9wcyB9ID0gcHJvcHM7XG4gIHJldHVybiAoXG4gICAgPHNwYW5cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgICAgey4uLmdldFN0eWxlUHJvcHMocHJvcHMsICdpbmRpY2F0b3JTZXBhcmF0b3InLCB7XG4gICAgICAgICdpbmRpY2F0b3Itc2VwYXJhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgIC8+XG4gICk7XG59O1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIExvYWRpbmdcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBsb2FkaW5nRG90QW5pbWF0aW9ucyA9IGtleWZyYW1lc2BcbiAgMCUsIDgwJSwgMTAwJSB7IG9wYWNpdHk6IDA7IH1cbiAgNDAlIHsgb3BhY2l0eTogMTsgfVxuYDtcblxuZXhwb3J0IGNvbnN0IGxvYWRpbmdJbmRpY2F0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgc2l6ZSxcbiAgICB0aGVtZToge1xuICAgICAgY29sb3JzLFxuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgIH0sXG4gIH06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2xvYWRpbmdJbmRpY2F0b3InLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIGFsaWduU2VsZjogJ2NlbnRlcicsXG4gIGZvbnRTaXplOiBzaXplLFxuICBsaW5lSGVpZ2h0OiAxLFxuICBtYXJnaW5SaWdodDogc2l6ZSxcbiAgdGV4dEFsaWduOiAnY2VudGVyJyxcbiAgdmVydGljYWxBbGlnbjogJ21pZGRsZScsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5pbnRlcmZhY2UgTG9hZGluZ0RvdFByb3BzIHtcbiAgZGVsYXk6IG51bWJlcjtcbiAgb2Zmc2V0OiBib29sZWFuO1xufVxuY29uc3QgTG9hZGluZ0RvdCA9ICh7IGRlbGF5LCBvZmZzZXQgfTogTG9hZGluZ0RvdFByb3BzKSA9PiAoXG4gIDxzcGFuXG4gICAgY3NzPXt7XG4gICAgICBhbmltYXRpb246IGAke2xvYWRpbmdEb3RBbmltYXRpb25zfSAxcyBlYXNlLWluLW91dCAke2RlbGF5fW1zIGluZmluaXRlO2AsXG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6ICdjdXJyZW50Q29sb3InLFxuICAgICAgYm9yZGVyUmFkaXVzOiAnMWVtJyxcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgbWFyZ2luTGVmdDogb2Zmc2V0ID8gJzFlbScgOiB1bmRlZmluZWQsXG4gICAgICBoZWlnaHQ6ICcxZW0nLFxuICAgICAgdmVydGljYWxBbGlnbjogJ3RvcCcsXG4gICAgICB3aWR0aDogJzFlbScsXG4gICAgfX1cbiAgLz5cbik7XG5cbmV4cG9ydCBpbnRlcmZhY2UgTG9hZGluZ0luZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xuICAvKiogU2V0IHNpemUgb2YgdGhlIGNvbnRhaW5lci4gKi9cbiAgc2l6ZTogbnVtYmVyO1xufVxuZXhwb3J0IGNvbnN0IExvYWRpbmdJbmRpY2F0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oe1xuICBpbm5lclByb3BzLFxuICBpc1J0bCxcbiAgc2l6ZSA9IDQsXG4gIC4uLnJlc3RQcm9wc1xufTogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+KSA9PiB7XG4gIHJldHVybiAoXG4gICAgPGRpdlxuICAgICAgey4uLmdldFN0eWxlUHJvcHMoXG4gICAgICAgIHsgLi4ucmVzdFByb3BzLCBpbm5lclByb3BzLCBpc1J0bCwgc2l6ZSB9LFxuICAgICAgICAnbG9hZGluZ0luZGljYXRvcicsXG4gICAgICAgIHtcbiAgICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgICAgfVxuICAgICAgKX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXswfSBvZmZzZXQ9e2lzUnRsfSAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezE2MH0gb2Zmc2V0IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MzIwfSBvZmZzZXQ9eyFpc1J0bH0gLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG4iXX0= */")})},Vie=function(e){var t=e.innerProps,r=e.isRtl,i=e.size,a=i===void 0?4:i,s=eu(e,Lie);return Gt.jsx("div",Kt({},_i(qt(qt({},s),{},{innerProps:t,isRtl:r,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Gt.jsx(nE,{delay:0,offset:r}),Gt.jsx(nE,{delay:160,offset:!0}),Gt.jsx(nE,{delay:320,offset:!r}))},Wie=function(e,t){var r=e.isDisabled,i=e.isFocused,a=e.theme,s=a.colors,u=a.borderRadius,c=a.spacing;return qt({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:i?s.primary:s.neutral20,borderRadius:u,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:i?s.primary:s.neutral30}})},Xie=function(e){var t=e.children,r=e.isDisabled,i=e.isFocused,a=e.innerRef,s=e.innerProps,u=e.menuIsOpen;return Gt.jsx("div",Kt({ref:a},_i(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":u}),s,{"aria-disabled":r||void 0}),t)},Yie=Xie,Zie=["data"],Jie=function(e,t){var r=e.theme.spacing;return t?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},Kie=function(e){var t=e.children,r=e.cx,i=e.getStyles,a=e.getClassNames,s=e.Heading,u=e.headingProps,c=e.innerProps,h=e.label,g=e.theme,v=e.selectProps;return Gt.jsx("div",Kt({},_i(e,"group",{group:!0}),c),Gt.jsx(s,Kt({},u,{selectProps:v,theme:g,getStyles:i,getClassNames:a,cx:r}),h),Gt.jsx("div",null,t))},$ie=function(e,t){var r=e.theme,i=r.colors,a=r.spacing;return qt({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:a.baseUnit*3,paddingRight:a.baseUnit*3,textTransform:"uppercase"})},Qie=function(e){var t=KM(e);t.data;var r=eu(t,Zie);return Gt.jsx("div",Kt({},_i(e,"groupHeading",{"group-heading":!0}),r))},eae=Kie,tae=["innerRef","isDisabled","isHidden","inputClassName"],nae=function(e,t){var r=e.isDisabled,i=e.value,a=e.theme,s=a.spacing,u=a.colors;return qt(qt({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},rae),t?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:u.neutral80})},sL={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},rae={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":qt({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},sL)},iae=function(e){return qt({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},sL)},aae=function(e){var t=e.cx,r=e.value,i=KM(e),a=i.innerRef,s=i.isDisabled,u=i.isHidden,c=i.inputClassName,h=eu(i,tae);return Gt.jsx("div",Kt({},_i(e,"input",{"input-container":!0}),{"data-value":r||""}),Gt.jsx("input",Kt({className:t({input:!0},c),ref:a,style:iae(u),disabled:s},h)))},sae=aae,oae=function(e,t){var r=e.theme,i=r.spacing,a=r.borderRadius,s=r.colors;return qt({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:s.neutral10,borderRadius:a/2,margin:i.baseUnit/2})},lae=function(e,t){var r=e.theme,i=r.borderRadius,a=r.colors,s=e.cropWithEllipsis;return qt({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},uae=function(e,t){var r=e.theme,i=r.spacing,a=r.borderRadius,s=r.colors,u=e.isFocused;return qt({alignItems:"center",display:"flex"},t?{}:{borderRadius:a/2,backgroundColor:u?s.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},oL=function(e){var t=e.children,r=e.innerProps;return Gt.jsx("div",r,t)},cae=oL,dae=oL;function fae(n){var e=n.children,t=n.innerProps;return Gt.jsx("div",Kt({role:"button"},t),e||Gt.jsx(Q4,{size:14}))}var hae=function(e){var t=e.children,r=e.components,i=e.data,a=e.innerProps,s=e.isDisabled,u=e.removeProps,c=e.selectProps,h=r.Container,g=r.Label,v=r.Remove;return Gt.jsx(h,{data:i,innerProps:qt(qt({},_i(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),a),selectProps:c},Gt.jsx(g,{data:i,innerProps:qt({},_i(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},t),Gt.jsx(v,{data:i,innerProps:qt(qt({},_i(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},u),selectProps:c}))},pae=hae,gae=function(e,t){var r=e.isDisabled,i=e.isFocused,a=e.isSelected,s=e.theme,u=s.spacing,c=s.colors;return qt({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:a?c.primary:i?c.primary25:"transparent",color:r?c.neutral20:a?c.neutral0:"inherit",padding:"".concat(u.baseUnit*2,"px ").concat(u.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:a?c.primary:c.primary50}})},mae=function(e){var t=e.children,r=e.isDisabled,i=e.isFocused,a=e.isSelected,s=e.innerRef,u=e.innerProps;return Gt.jsx("div",Kt({},_i(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":a}),{ref:s,"aria-disabled":r},u),t)},vae=mae,yae=function(e,t){var r=e.theme,i=r.spacing,a=r.colors;return qt({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:a.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},bae=function(e){var t=e.children,r=e.innerProps;return Gt.jsx("div",Kt({},_i(e,"placeholder",{placeholder:!0}),r),t)},xae=bae,Sae=function(e,t){var r=e.isDisabled,i=e.theme,a=i.spacing,s=i.colors;return qt({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:r?s.neutral40:s.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},Cae=function(e){var t=e.children,r=e.isDisabled,i=e.innerProps;return Gt.jsx("div",Kt({},_i(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),t)},_ae=Cae,Eae={ClearIndicator:Gie,Control:Yie,DropdownIndicator:Fie,DownChevron:iL,CrossIcon:Q4,Group:eae,GroupHeading:Qie,IndicatorsContainer:Nie,IndicatorSeparator:zie,Input:sae,LoadingIndicator:Vie,Menu:yie,MenuList:xie,MenuPortal:wie,LoadingMessage:Eie,NoOptionsMessage:_ie,MultiValue:pae,MultiValueContainer:cae,MultiValueLabel:dae,MultiValueRemove:fae,Option:vae,Placeholder:xae,SelectContainer:Rie,SingleValue:_ae,ValueContainer:Oie},Tae=function(e){return qt(qt({},Eae),e.components)},u7=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function wae(n,e){return!!(n===e||u7(n)&&u7(e))}function Aae(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!wae(n[t],e[t]))return!1;return!0}function Rae(n,e){e===void 0&&(e=Aae);var t=null;function r(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];if(t&&t.lastThis===this&&e(i,t.lastArgs))return t.lastResult;var s=n.apply(this,i);return t={lastResult:s,lastArgs:i,lastThis:this},s}return r.clear=function(){t=null},r}function Iae(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Oae=process.env.NODE_ENV==="production"?{name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"}:{name:"1f43avz-a11yText-A11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IEpTWCB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",toString:Iae},Dae=function(e){return Gt.jsx("span",Kt({css:Oae},e))},c7=Dae,Nae={guidance:function(e){var t=e.isSearchable,r=e.isMulti,i=e.tabSelectsValue,a=e.context,s=e.isInitialFocus;switch(a){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return s?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,r=e.label,i=r===void 0?"":r,a=e.labels,s=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(a.length>1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return s?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(e){var t=e.context,r=e.focused,i=e.options,a=e.label,s=a===void 0?"":a,u=e.selectValue,c=e.isDisabled,h=e.isSelected,g=e.isAppleDevice,v=function(O,_){return O&&O.length?"".concat(O.indexOf(_)+1," of ").concat(O.length):""};if(t==="value"&&u)return"value ".concat(s," focused, ").concat(v(u,r),".");if(t==="menu"&&g){var y=c?" disabled":"",S="".concat(h?" selected":"").concat(y);return"".concat(s).concat(S,", ").concat(v(i,r),".")}return""},onFilter:function(e){var t=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(t?" for search term "+t:"",".")}},Mae=function(e){var t=e.ariaSelection,r=e.focusedOption,i=e.focusedValue,a=e.focusableOptions,s=e.isFocused,u=e.selectValue,c=e.selectProps,h=e.id,g=e.isAppleDevice,v=c.ariaLiveMessages,y=c.getOptionLabel,S=c.inputValue,E=c.isMulti,O=c.isOptionDisabled,_=c.isSearchable,w=c.menuIsOpen,N=c.options,L=c.screenReaderStatus,P=c.tabSelectsValue,H=c.isLoading,B=c["aria-label"],G=c["aria-live"],V=D.useMemo(function(){return qt(qt({},Nae),v||{})},[v]),Z=D.useMemo(function(){var ee="";if(t&&V.onChange){var $=t.option,ie=t.options,K=t.removedValue,oe=t.removedValues,se=t.value,ge=function($e){return Array.isArray($e)?null:$e},pe=K||$||ge(se),Ae=pe?y(pe):"",we=ie||oe||void 0,xe=we?we.map(y):[],Pe=qt({isDisabled:pe&&O(pe,u),label:Ae,labels:xe},t);ee=V.onChange(Pe)}return ee},[t,V,O,u,y]),X=D.useMemo(function(){var ee="",$=r||i,ie=!!(r&&u&&u.includes(r));if($&&V.onFocus){var K={focused:$,label:y($),isDisabled:O($,u),isSelected:ie,options:a,context:$===r?"menu":"value",selectValue:u,isAppleDevice:g};ee=V.onFocus(K)}return ee},[r,i,y,O,V,a,u,g]),k=D.useMemo(function(){var ee="";if(w&&N.length&&!H&&V.onFilter){var $=L({count:a.length});ee=V.onFilter({inputValue:S,resultsMessage:$})}return ee},[a,S,w,V,N,L,H]),z=t?.action==="initial-input-focus",q=D.useMemo(function(){var ee="";if(V.guidance){var $=i?"value":w?"menu":"input";ee=V.guidance({"aria-label":B,context:$,isDisabled:r&&O(r,u),isMulti:E,isSearchable:_,tabSelectsValue:P,isInitialFocus:z})}return ee},[B,r,i,E,O,_,w,V,u,P,z]),te=Gt.jsx(D.Fragment,null,Gt.jsx("span",{id:"aria-selection"},Z),Gt.jsx("span",{id:"aria-focused"},X),Gt.jsx("span",{id:"aria-results"},k),Gt.jsx("span",{id:"aria-guidance"},q));return Gt.jsx(D.Fragment,null,Gt.jsx(c7,{id:h},z&&te),Gt.jsx(c7,{"aria-live":G,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!z&&te))},Lae=Mae,f5=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],kae=new RegExp("["+f5.map(function(n){return n.letters}).join("")+"]","g"),lL={};for(var rE=0;rE<f5.length;rE++)for(var iE=f5[rE],aE=0;aE<iE.letters.length;aE++)lL[iE.letters[aE]]=iE.base;var uL=function(e){return e.replace(kae,function(t){return lL[t]})},Pae=Rae(uL),d7=function(e){return e.replace(/^\s+|\s+$/g,"")},jae=function(e){return"".concat(e.label," ").concat(e.value)},Fae=function(e){return function(t,r){if(t.data.__isNew__)return!0;var i=qt({ignoreCase:!0,ignoreAccents:!0,stringify:jae,trim:!0,matchFrom:"any"},e),a=i.ignoreCase,s=i.ignoreAccents,u=i.stringify,c=i.trim,h=i.matchFrom,g=c?d7(r):r,v=c?d7(u(t)):u(t);return a&&(g=g.toLowerCase(),v=v.toLowerCase()),s&&(g=Pae(g),v=uL(v)),h==="start"?v.substr(0,g.length)===g:v.indexOf(g)>-1}},Bae=["innerRef"];function Gae(n){var e=n.innerRef,t=eu(n,Bae),r=cie(t,"onExited","in","enter","exit","appear");return Gt.jsx("input",Kt({ref:e},r,{css:Gt.css({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},process.env.NODE_ENV==="production"?"":";label:DummyInput;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWYgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyByZW1vdmVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gRHVtbXlJbnB1dCh7XG4gIGlubmVyUmVmLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydpbnB1dCddICYge1xuICByZWFkb25seSBpbm5lclJlZjogUmVmPEhUTUxJbnB1dEVsZW1lbnQ+O1xufSkge1xuICAvLyBSZW1vdmUgYW5pbWF0aW9uIHByb3BzIG5vdCBtZWFudCBmb3IgSFRNTCBlbGVtZW50c1xuICBjb25zdCBmaWx0ZXJlZFByb3BzID0gcmVtb3ZlUHJvcHMoXG4gICAgcHJvcHMsXG4gICAgJ29uRXhpdGVkJyxcbiAgICAnaW4nLFxuICAgICdlbnRlcicsXG4gICAgJ2V4aXQnLFxuICAgICdhcHBlYXInXG4gICk7XG5cbiAgcmV0dXJuIChcbiAgICA8aW5wdXRcbiAgICAgIHJlZj17aW5uZXJSZWZ9XG4gICAgICB7Li4uZmlsdGVyZWRQcm9wc31cbiAgICAgIGNzcz17e1xuICAgICAgICBsYWJlbDogJ2R1bW15SW5wdXQnLFxuICAgICAgICAvLyBnZXQgcmlkIG9mIGFueSBkZWZhdWx0IHN0eWxlc1xuICAgICAgICBiYWNrZ3JvdW5kOiAwLFxuICAgICAgICBib3JkZXI6IDAsXG4gICAgICAgIC8vIGltcG9ydGFudCEgdGhpcyBoaWRlcyB0aGUgZmxhc2hpbmcgY3Vyc29yXG4gICAgICAgIGNhcmV0Q29sb3I6ICd0cmFuc3BhcmVudCcsXG4gICAgICAgIGZvbnRTaXplOiAnaW5oZXJpdCcsXG4gICAgICAgIGdyaWRBcmVhOiAnMSAvIDEgLyAyIC8gMycsXG4gICAgICAgIG91dGxpbmU6IDAsXG4gICAgICAgIHBhZGRpbmc6IDAsXG4gICAgICAgIC8vIGltcG9ydGFudCEgd2l0aG91dCBgd2lkdGhgIGJyb3dzZXJzIHdvbid0IGFsbG93IGZvY3VzXG4gICAgICAgIHdpZHRoOiAxLFxuXG4gICAgICAgIC8vIHJlbW92ZSBjdXJzb3Igb24gZGVza3RvcFxuICAgICAgICBjb2xvcjogJ3RyYW5zcGFyZW50JyxcblxuICAgICAgICAvLyByZW1vdmUgY3Vyc29yIG9uIG1vYmlsZSB3aGlsc3QgbWFpbnRhaW5pbmcgXCJzY3JvbGwgaW50byB2aWV3XCIgYmVoYXZpb3VyXG4gICAgICAgIGxlZnQ6IC0xMDAsXG4gICAgICAgIG9wYWNpdHk6IDAsXG4gICAgICAgIHBvc2l0aW9uOiAncmVsYXRpdmUnLFxuICAgICAgICB0cmFuc2Zvcm06ICdzY2FsZSguMDEpJyxcbiAgICAgIH19XG4gICAgLz5cbiAgKTtcbn1cbiJdfQ== */")}))}var Hae=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function zae(n){var e=n.isEnabled,t=n.onBottomArrive,r=n.onBottomLeave,i=n.onTopArrive,a=n.onTopLeave,s=D.useRef(!1),u=D.useRef(!1),c=D.useRef(0),h=D.useRef(null),g=D.useCallback(function(_,w){if(h.current!==null){var N=h.current,L=N.scrollTop,P=N.scrollHeight,H=N.clientHeight,B=h.current,G=w>0,V=P-H-L,Z=!1;V>w&&s.current&&(r&&r(_),s.current=!1),G&&u.current&&(a&&a(_),u.current=!1),G&&w>V?(t&&!s.current&&t(_),B.scrollTop=P,Z=!0,s.current=!0):!G&&-w>L&&(i&&!u.current&&i(_),B.scrollTop=0,Z=!0,u.current=!0),Z&&Hae(_)}},[t,r,i,a]),v=D.useCallback(function(_){g(_,_.deltaY)},[g]),y=D.useCallback(function(_){c.current=_.changedTouches[0].clientY},[]),S=D.useCallback(function(_){var w=c.current-_.changedTouches[0].clientY;g(_,w)},[g]),E=D.useCallback(function(_){if(_){var w=oie?{passive:!1}:!1;_.addEventListener("wheel",v,w),_.addEventListener("touchstart",y,w),_.addEventListener("touchmove",S,w)}},[S,y,v]),O=D.useCallback(function(_){_&&(_.removeEventListener("wheel",v,!1),_.removeEventListener("touchstart",y,!1),_.removeEventListener("touchmove",S,!1))},[S,y,v]);return D.useEffect(function(){if(e){var _=h.current;return E(_),function(){O(_)}}},[e,E,O]),function(_){h.current=_}}var f7=["boxSizing","height","overflow","paddingRight","position"],h7={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function p7(n){n.cancelable&&n.preventDefault()}function g7(n){n.stopPropagation()}function m7(){var n=this.scrollTop,e=this.scrollHeight,t=n+this.offsetHeight;n===0?this.scrollTop=1:t===e&&(this.scrollTop=n-1)}function v7(){return"ontouchstart"in window||navigator.maxTouchPoints}var y7=!!(typeof window<"u"&&window.document&&window.document.createElement),Yg=0,Ah={capture:!1,passive:!1};function qae(n){var e=n.isEnabled,t=n.accountForScrollbars,r=t===void 0?!0:t,i=D.useRef({}),a=D.useRef(null),s=D.useCallback(function(c){if(y7){var h=document.body,g=h&&h.style;if(r&&f7.forEach(function(E){var O=g&&g[E];i.current[E]=O}),r&&Yg<1){var v=parseInt(i.current.paddingRight,10)||0,y=document.body?document.body.clientWidth:0,S=window.innerWidth-y+v||0;Object.keys(h7).forEach(function(E){var O=h7[E];g&&(g[E]=O)}),g&&(g.paddingRight="".concat(S,"px"))}h&&v7()&&(h.addEventListener("touchmove",p7,Ah),c&&(c.addEventListener("touchstart",m7,Ah),c.addEventListener("touchmove",g7,Ah))),Yg+=1}},[r]),u=D.useCallback(function(c){if(y7){var h=document.body,g=h&&h.style;Yg=Math.max(Yg-1,0),r&&Yg<1&&f7.forEach(function(v){var y=i.current[v];g&&(g[v]=y)}),h&&v7()&&(h.removeEventListener("touchmove",p7,Ah),c&&(c.removeEventListener("touchstart",m7,Ah),c.removeEventListener("touchmove",g7,Ah)))}},[r]);return D.useEffect(function(){if(e){var c=a.current;return s(c),function(){u(c)}}},[e,s,u]),function(c){a.current=c}}function Uae(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Vae=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Wae=process.env.NODE_ENV==="production"?{name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"}:{name:"bp8cua-ScrollManager",styles:"position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9EVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIFJlYWN0RWxlbWVudCwgUmVmQ2FsbGJhY2ssIE1vdXNlRXZlbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgdXNlU2Nyb2xsQ2FwdHVyZSBmcm9tICcuL3VzZVNjcm9sbENhcHR1cmUnO1xuaW1wb3J0IHVzZVNjcm9sbExvY2sgZnJvbSAnLi91c2VTY3JvbGxMb2NrJztcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgcmVhZG9ubHkgY2hpbGRyZW46IChyZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PikgPT4gUmVhY3RFbGVtZW50O1xuICByZWFkb25seSBsb2NrRW5hYmxlZDogYm9vbGVhbjtcbiAgcmVhZG9ubHkgY2FwdHVyZUVuYWJsZWQ6IGJvb2xlYW47XG4gIHJlYWRvbmx5IG9uQm90dG9tQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Cb3R0b21MZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG4gIHJlYWRvbmx5IG9uVG9wQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Ub3BMZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG59XG5cbmNvbnN0IGJsdXJTZWxlY3RJbnB1dCA9IChldmVudDogTW91c2VFdmVudDxIVE1MRGl2RWxlbWVudD4pID0+IHtcbiAgY29uc3QgZWxlbWVudCA9IGV2ZW50LnRhcmdldCBhcyBIVE1MRGl2RWxlbWVudDtcbiAgcmV0dXJuIChcbiAgICBlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCAmJlxuICAgIChlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCBhcyBIVE1MRWxlbWVudCkuYmx1cigpXG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBTY3JvbGxNYW5hZ2VyKHtcbiAgY2hpbGRyZW4sXG4gIGxvY2tFbmFibGVkLFxuICBjYXB0dXJlRW5hYmxlZCA9IHRydWUsXG4gIG9uQm90dG9tQXJyaXZlLFxuICBvbkJvdHRvbUxlYXZlLFxuICBvblRvcEFycml2ZSxcbiAgb25Ub3BMZWF2ZSxcbn06IFByb3BzKSB7XG4gIGNvbnN0IHNldFNjcm9sbENhcHR1cmVUYXJnZXQgPSB1c2VTY3JvbGxDYXB0dXJlKHtcbiAgICBpc0VuYWJsZWQ6IGNhcHR1cmVFbmFibGVkLFxuICAgIG9uQm90dG9tQXJyaXZlLFxuICAgIG9uQm90dG9tTGVhdmUsXG4gICAgb25Ub3BBcnJpdmUsXG4gICAgb25Ub3BMZWF2ZSxcbiAgfSk7XG4gIGNvbnN0IHNldFNjcm9sbExvY2tUYXJnZXQgPSB1c2VTY3JvbGxMb2NrKHsgaXNFbmFibGVkOiBsb2NrRW5hYmxlZCB9KTtcblxuICBjb25zdCB0YXJnZXRSZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PiA9IChlbGVtZW50KSA9PiB7XG4gICAgc2V0U2Nyb2xsQ2FwdHVyZVRhcmdldChlbGVtZW50KTtcbiAgICBzZXRTY3JvbGxMb2NrVGFyZ2V0KGVsZW1lbnQpO1xuICB9O1xuXG4gIHJldHVybiAoXG4gICAgPEZyYWdtZW50PlxuICAgICAge2xvY2tFbmFibGVkICYmIChcbiAgICAgICAgPGRpdlxuICAgICAgICAgIG9uQ2xpY2s9e2JsdXJTZWxlY3RJbnB1dH1cbiAgICAgICAgICBjc3M9e3sgcG9zaXRpb246ICdmaXhlZCcsIGxlZnQ6IDAsIGJvdHRvbTogMCwgcmlnaHQ6IDAsIHRvcDogMCB9fVxuICAgICAgICAvPlxuICAgICAgKX1cbiAgICAgIHtjaGlsZHJlbih0YXJnZXRSZWYpfVxuICAgIDwvRnJhZ21lbnQ+XG4gICk7XG59XG4iXX0= */",toString:Uae};function Xae(n){var e=n.children,t=n.lockEnabled,r=n.captureEnabled,i=r===void 0?!0:r,a=n.onBottomArrive,s=n.onBottomLeave,u=n.onTopArrive,c=n.onTopLeave,h=zae({isEnabled:i,onBottomArrive:a,onBottomLeave:s,onTopArrive:u,onTopLeave:c}),g=qae({isEnabled:t}),v=function(S){h(S),g(S)};return Gt.jsx(D.Fragment,null,t&&Gt.jsx("div",{onClick:Vae,css:Wae}),e(v))}function Yae(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}var Zae=process.env.NODE_ENV==="production"?{name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"}:{name:"5kkxb2-requiredInput-RequiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZT86IHN0cmluZztcbiAgcmVhZG9ubHkgb25Gb2N1czogRm9jdXNFdmVudEhhbmRsZXI8SFRNTElucHV0RWxlbWVudD47XG59PiA9ICh7IG5hbWUsIG9uRm9jdXMgfSkgPT4gKFxuICA8aW5wdXRcbiAgICByZXF1aXJlZFxuICAgIG5hbWU9e25hbWV9XG4gICAgdGFiSW5kZXg9ey0xfVxuICAgIGFyaWEtaGlkZGVuPVwidHJ1ZVwiXG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",toString:Yae},Jae=function(e){var t=e.name,r=e.onFocus;return Gt.jsx("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Zae,value:"",onChange:function(){}})},Kae=Jae;function e3(n){var e;return typeof window<"u"&&window.navigator!=null?n.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function $ae(){return e3(/^iPhone/i)}function cL(){return e3(/^Mac/i)}function Qae(){return e3(/^iPad/i)||cL()&&navigator.maxTouchPoints>1}function ese(){return $ae()||Qae()}function tse(){return cL()||ese()}var nse=function(e){return e.label},dL=function(e){return e.label},fL=function(e){return e.value},rse=function(e){return!!e.isDisabled},ise={clearIndicator:Bie,container:Aie,control:Wie,dropdownIndicator:jie,group:Jie,groupHeading:$ie,indicatorsContainer:Die,indicatorSeparator:Hie,input:nae,loadingIndicator:Uie,loadingMessage:Cie,menu:gie,menuList:bie,menuPortal:Tie,multiValue:oae,multiValueLabel:lae,multiValueRemove:uae,noOptionsMessage:Sie,option:gae,placeholder:yae,singleValue:Sae,valueContainer:Iie},ase={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},sse=4,hL=4,ose=38,lse=hL*2,use={baseUnit:hL,controlHeight:ose,menuGutter:lse},sE={borderRadius:sse,colors:ase,spacing:use},cse={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:o7(),captureMenuScroll:!o7(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Fae(),formatGroupLabel:nse,getOptionLabel:dL,getOptionValue:fL,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:rse,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!aie(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function b7(n,e,t,r){var i=mL(n,e,t),a=vL(n,e,t),s=gL(n,e),u=yy(n,e);return{type:"option",data:e,isDisabled:i,isSelected:a,label:s,value:u,index:r}}function W1(n,e){return n.options.map(function(t,r){if("options"in t){var i=t.options.map(function(s,u){return b7(n,s,e,u)}).filter(function(s){return S7(n,s)});return i.length>0?{type:"group",data:t,options:i,index:r}:void 0}var a=b7(n,t,e,r);return S7(n,a)?a:void 0}).filter(lie)}function pL(n){return n.reduce(function(e,t){return t.type==="group"?e.push.apply(e,ip(t.options.map(function(r){return r.data}))):e.push(t.data),e},[])}function x7(n,e){return n.reduce(function(t,r){return r.type==="group"?t.push.apply(t,ip(r.options.map(function(i){return{data:i.data,id:"".concat(e,"-").concat(r.index,"-").concat(i.index)}}))):t.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),t},[])}function dse(n,e){return pL(W1(n,e))}function S7(n,e){var t=n.inputValue,r=t===void 0?"":t,i=e.data,a=e.isSelected,s=e.label,u=e.value;return(!bL(n)||!a)&&yL(n,{label:s,value:u,data:i},r)}function fse(n,e){var t=n.focusedValue,r=n.selectValue,i=r.indexOf(t);if(i>-1){var a=e.indexOf(t);if(a>-1)return t;if(i<e.length)return e[i]}return null}function hse(n,e){var t=n.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}var oE=function(e,t){var r,i=(r=e.find(function(a){return a.data===t}))===null||r===void 0?void 0:r.id;return i||null},gL=function(e,t){return e.getOptionLabel(t)},yy=function(e,t){return e.getOptionValue(t)};function mL(n,e,t){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,t):!1}function vL(n,e,t){if(t.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,t);var r=yy(n,e);return t.some(function(i){return yy(n,i)===r})}function yL(n,e,t){return n.filterOption?n.filterOption(e,t):!0}var bL=function(e){var t=e.hideSelectedOptions,r=e.isMulti;return t===void 0?r:t},pse=1,xL=(function(n){Ire(t,n);var e=Nre(t);function t(r){var i;if(Are(this,t),i=e.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(c){i.controlRef=c},i.focusedOptionRef=null,i.getFocusedOptionRef=function(c){i.focusedOptionRef=c},i.menuListRef=null,i.getMenuListRef=function(c){i.menuListRef=c},i.inputRef=null,i.getInputRef=function(c){i.inputRef=c},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(c,h){var g=i.props,v=g.onChange,y=g.name;h.name=y,i.ariaOnChange(c,h),v(c,h)},i.setValue=function(c,h,g){var v=i.props,y=v.closeMenuOnSelect,S=v.isMulti,E=v.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:E}),y&&(i.setState({inputIsHiddenAfterUpdate:!S}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(c,{action:h,option:g})},i.selectOption=function(c){var h=i.props,g=h.blurInputOnSelect,v=h.isMulti,y=h.name,S=i.state.selectValue,E=v&&i.isOptionSelected(c,S),O=i.isOptionDisabled(c,S);if(E){var _=i.getOptionValue(c);i.setValue(S.filter(function(w){return i.getOptionValue(w)!==_}),"deselect-option",c)}else if(!O)v?i.setValue([].concat(ip(S),[c]),"select-option",c):i.setValue(c,"select-option");else{i.ariaOnChange(c,{action:"select-option",option:c,name:y});return}g&&i.blurInput()},i.removeValue=function(c){var h=i.props.isMulti,g=i.state.selectValue,v=i.getOptionValue(c),y=g.filter(function(E){return i.getOptionValue(E)!==v}),S=Sm(h,y,y[0]||null);i.onChange(S,{action:"remove-value",removedValue:c}),i.focusInput()},i.clearValue=function(){var c=i.state.selectValue;i.onChange(Sm(i.props.isMulti,[],null),{action:"clear",removedValues:c})},i.popValue=function(){var c=i.props.isMulti,h=i.state.selectValue,g=h[h.length-1],v=h.slice(0,h.length-1),y=Sm(c,v,v[0]||null);g&&i.onChange(y,{action:"pop-value",removedValue:g})},i.getFocusedOptionId=function(c){return oE(i.state.focusableOptionsWithIds,c)},i.getFocusableOptionsWithIds=function(){return x7(W1(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return eie.apply(void 0,[i.props.classNamePrefix].concat(h))},i.getOptionLabel=function(c){return gL(i.props,c)},i.getOptionValue=function(c){return yy(i.props,c)},i.getStyles=function(c,h){var g=i.props.unstyled,v=ise[c](h,g);v.boxSizing="border-box";var y=i.props.styles[c];return y?y(v,h):v},i.getClassNames=function(c,h){var g,v;return(g=(v=i.props.classNames)[c])===null||g===void 0?void 0:g.call(v,h)},i.getElementId=function(c){return"".concat(i.state.instancePrefix,"-").concat(c)},i.getComponents=function(){return Tae(i.props)},i.buildCategorizedOptions=function(){return W1(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return pL(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(c,h){i.setState({ariaSelection:qt({value:c},h)})},i.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(c){i.blockOptionHover=!1},i.onControlMouseDown=function(c){if(!c.defaultPrevented){var h=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&i.onMenuClose():h&&i.openMenu("first"):(h&&(i.openAfterFocus=!0),i.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},i.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!i.props.isDisabled){var h=i.props,g=h.isMulti,v=h.menuIsOpen;i.focusInput(),v?(i.setState({inputIsHiddenAfterUpdate:!g}),i.onMenuClose()):i.openMenu("first"),c.preventDefault()}},i.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(i.clearValue(),c.preventDefault(),i.openAfterFocus=!1,c.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(c){typeof i.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&Ky(c.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(c)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(c){var h=c.touches,g=h&&h.item(0);g&&(i.initialTouchX=g.clientX,i.initialTouchY=g.clientY,i.userIsDragging=!1)},i.onTouchMove=function(c){var h=c.touches,g=h&&h.item(0);if(g){var v=Math.abs(g.clientX-i.initialTouchX),y=Math.abs(g.clientY-i.initialTouchY),S=5;i.userIsDragging=v>S||y>S}},i.onTouchEnd=function(c){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(c.target)&&i.menuListRef&&!i.menuListRef.contains(c.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(c){i.userIsDragging||i.onControlMouseDown(c)},i.onClearIndicatorTouchEnd=function(c){i.userIsDragging||i.onClearIndicatorMouseDown(c)},i.onDropdownIndicatorTouchEnd=function(c){i.userIsDragging||i.onDropdownIndicatorMouseDown(c)},i.handleInputChange=function(c){var h=i.props.inputValue,g=c.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(g,{action:"input-change",prevInputValue:h}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(c){i.props.onFocus&&i.props.onFocus(c),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(c){var h=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(c),i.onInputChange("",{action:"input-blur",prevInputValue:h}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(c){if(!(i.blockOptionHover||i.state.focusedOption===c)){var h=i.getFocusableOptions(),g=h.indexOf(c);i.setState({focusedOption:c,focusedOptionId:g>-1?i.getFocusedOptionId(c):null})}},i.shouldHideSelectedOptions=function(){return bL(i.props)},i.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),i.focus()},i.onKeyDown=function(c){var h=i.props,g=h.isMulti,v=h.backspaceRemovesValue,y=h.escapeClearsValue,S=h.inputValue,E=h.isClearable,O=h.isDisabled,_=h.menuIsOpen,w=h.onKeyDown,N=h.tabSelectsValue,L=h.openMenuOnFocus,P=i.state,H=P.focusedOption,B=P.focusedValue,G=P.selectValue;if(!O&&!(typeof w=="function"&&(w(c),c.defaultPrevented))){switch(i.blockOptionHover=!0,c.key){case"ArrowLeft":if(!g||S)return;i.focusValue("previous");break;case"ArrowRight":if(!g||S)return;i.focusValue("next");break;case"Delete":case"Backspace":if(S)return;if(B)i.removeValue(B);else{if(!v)return;g?i.popValue():E&&i.clearValue()}break;case"Tab":if(i.isComposing||c.shiftKey||!_||!N||!H||L&&i.isOptionSelected(H,G))return;i.selectOption(H);break;case"Enter":if(c.keyCode===229)break;if(_){if(!H||i.isComposing)return;i.selectOption(H);break}return;case"Escape":_?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:S}),i.onMenuClose()):E&&y&&i.clearValue();break;case" ":if(S)return;if(!_){i.openMenu("first");break}if(!H)return;i.selectOption(H);break;case"ArrowUp":_?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":_?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!_)return;i.focusOption("pageup");break;case"PageDown":if(!_)return;i.focusOption("pagedown");break;case"Home":if(!_)return;i.focusOption("first");break;case"End":if(!_)return;i.focusOption("last");break;default:return}c.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++pse),i.state.selectValue=my(r.value),r.menuIsOpen&&i.state.selectValue.length){var a=i.getFocusableOptionsWithIds(),s=i.buildFocusableOptions(),u=s.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=a,i.state.focusedOption=s[u],i.state.focusedOptionId=oE(a,s[u])}return i}return Rre(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&s7(this.menuListRef,this.focusedOptionRef),tse()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(i){var a=this.props,s=a.isDisabled,u=a.menuIsOpen,c=this.state.isFocused;(c&&!s&&i.isDisabled||c&&u&&!i.menuIsOpen)&&this.focusInput(),c&&s&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!s&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(s7(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,a){this.props.onInputChange(i,a)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var a=this,s=this.state,u=s.selectValue,c=s.isFocused,h=this.buildFocusableOptions(),g=i==="first"?0:h.length-1;if(!this.props.isMulti){var v=h.indexOf(u[0]);v>-1&&(g=v)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:h[g],focusedOptionId:this.getFocusedOptionId(h[g])},function(){return a.onMenuOpen()})}},{key:"focusValue",value:function(i){var a=this.state,s=a.selectValue,u=a.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=s.indexOf(u);u||(c=-1);var h=s.length-1,g=-1;if(s.length){switch(i){case"previous":c===0?g=0:c===-1?g=h:g=c-1;break;case"next":c>-1&&c<h&&(g=c+1);break}this.setState({inputIsHidden:g!==-1,focusedValue:s[g]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",a=this.props.pageSize,s=this.state.focusedOption,u=this.getFocusableOptions();if(u.length){var c=0,h=u.indexOf(s);s||(h=-1),i==="up"?c=h>0?h-1:u.length-1:i==="down"?c=(h+1)%u.length:i==="pageup"?(c=h-a,c<0&&(c=0)):i==="pagedown"?(c=h+a,c>u.length-1&&(c=u.length-1)):i==="last"&&(c=u.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:u[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(u[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(sE):qt(qt({},sE),this.props.theme):sE}},{key:"getCommonProps",value:function(){var i=this.clearValue,a=this.cx,s=this.getStyles,u=this.getClassNames,c=this.getValue,h=this.selectOption,g=this.setValue,v=this.props,y=v.isMulti,S=v.isRtl,E=v.options,O=this.hasValue();return{clearValue:i,cx:a,getStyles:s,getClassNames:u,getValue:c,hasValue:O,isMulti:y,isRtl:S,options:E,selectOption:h,selectProps:v,setValue:g,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,a=i.isClearable,s=i.isMulti;return a===void 0?s:a}},{key:"isOptionDisabled",value:function(i,a){return mL(this.props,i,a)}},{key:"isOptionSelected",value:function(i,a){return vL(this.props,i,a)}},{key:"filterOption",value:function(i,a){return yL(this.props,i,a)}},{key:"formatOptionLabel",value:function(i,a){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,u=this.state.selectValue;return this.props.formatOptionLabel(i,{context:a,inputValue:s,selectValue:u})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,a=i.isDisabled,s=i.isSearchable,u=i.inputId,c=i.inputValue,h=i.tabIndex,g=i.form,v=i.menuIsOpen,y=i.required,S=this.getComponents(),E=S.Input,O=this.state,_=O.inputIsHidden,w=O.ariaSelection,N=this.commonProps,L=u||this.getElementId("input"),P=qt(qt(qt({"aria-autocomplete":"list","aria-expanded":v,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":y,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},v&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?w?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?fn.createElement(E,Kt({},N,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:L,innerRef:this.getInputRef,isDisabled:a,isHidden:_,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:h,form:g,type:"text",value:c},P)):fn.createElement(Gae,Kt({id:L,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:gy,onFocus:this.onInputFocus,disabled:a,tabIndex:h,inputMode:"none",form:g,value:""},P))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,a=this.getComponents(),s=a.MultiValue,u=a.MultiValueContainer,c=a.MultiValueLabel,h=a.MultiValueRemove,g=a.SingleValue,v=a.Placeholder,y=this.commonProps,S=this.props,E=S.controlShouldRenderValue,O=S.isDisabled,_=S.isMulti,w=S.inputValue,N=S.placeholder,L=this.state,P=L.selectValue,H=L.focusedValue,B=L.isFocused;if(!this.hasValue()||!E)return w?null:fn.createElement(v,Kt({},y,{key:"placeholder",isDisabled:O,isFocused:B,innerProps:{id:this.getElementId("placeholder")}}),N);if(_)return P.map(function(V,Z){var X=V===H,k="".concat(i.getOptionLabel(V),"-").concat(i.getOptionValue(V));return fn.createElement(s,Kt({},y,{components:{Container:u,Label:c,Remove:h},isFocused:X,isDisabled:O,key:k,index:Z,removeProps:{onClick:function(){return i.removeValue(V)},onTouchEnd:function(){return i.removeValue(V)},onMouseDown:function(q){q.preventDefault()}},data:V}),i.formatOptionLabel(V,"value"))});if(w)return null;var G=P[0];return fn.createElement(g,Kt({},y,{data:G,isDisabled:O}),this.formatOptionLabel(G,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),a=i.ClearIndicator,s=this.commonProps,u=this.props,c=u.isDisabled,h=u.isLoading,g=this.state.isFocused;if(!this.isClearable()||!a||c||!this.hasValue()||h)return null;var v={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return fn.createElement(a,Kt({},s,{innerProps:v,isFocused:g}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),a=i.LoadingIndicator,s=this.commonProps,u=this.props,c=u.isDisabled,h=u.isLoading,g=this.state.isFocused;if(!a||!h)return null;var v={"aria-hidden":"true"};return fn.createElement(a,Kt({},s,{innerProps:v,isDisabled:c,isFocused:g}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator,s=i.IndicatorSeparator;if(!a||!s)return null;var u=this.commonProps,c=this.props.isDisabled,h=this.state.isFocused;return fn.createElement(s,Kt({},u,{isDisabled:c,isFocused:h}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),a=i.DropdownIndicator;if(!a)return null;var s=this.commonProps,u=this.props.isDisabled,c=this.state.isFocused,h={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return fn.createElement(a,Kt({},s,{innerProps:h,isDisabled:u,isFocused:c}))}},{key:"renderMenu",value:function(){var i=this,a=this.getComponents(),s=a.Group,u=a.GroupHeading,c=a.Menu,h=a.MenuList,g=a.MenuPortal,v=a.LoadingMessage,y=a.NoOptionsMessage,S=a.Option,E=this.commonProps,O=this.state.focusedOption,_=this.props,w=_.captureMenuScroll,N=_.inputValue,L=_.isLoading,P=_.loadingMessage,H=_.minMenuHeight,B=_.maxMenuHeight,G=_.menuIsOpen,V=_.menuPlacement,Z=_.menuPosition,X=_.menuPortalTarget,k=_.menuShouldBlockScroll,z=_.menuShouldScrollIntoView,q=_.noOptionsMessage,te=_.onMenuScrollToTop,ee=_.onMenuScrollToBottom;if(!G)return null;var $=function(Ae,we){var xe=Ae.type,Pe=Ae.data,Ke=Ae.isDisabled,$e=Ae.isSelected,pt=Ae.label,_t=Ae.value,ht=O===Pe,Rt=Ke?void 0:function(){return i.onOptionHover(Pe)},yt=Ke?void 0:function(){return i.selectOption(Pe)},gt="".concat(i.getElementId("option"),"-").concat(we),lt={id:gt,onClick:yt,onMouseMove:Rt,onMouseOver:Rt,tabIndex:-1,role:"option","aria-selected":i.state.isAppleDevice?void 0:$e};return fn.createElement(S,Kt({},E,{innerProps:lt,data:Pe,isDisabled:Ke,isSelected:$e,key:gt,label:pt,type:xe,value:_t,isFocused:ht,innerRef:ht?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(Ae.data,"menu"))},ie;if(this.hasOptions())ie=this.getCategorizedOptions().map(function(pe){if(pe.type==="group"){var Ae=pe.data,we=pe.options,xe=pe.index,Pe="".concat(i.getElementId("group"),"-").concat(xe),Ke="".concat(Pe,"-heading");return fn.createElement(s,Kt({},E,{key:Pe,data:Ae,options:we,Heading:u,headingProps:{id:Ke,data:pe.data},label:i.formatGroupLabel(pe.data)}),pe.options.map(function($e){return $($e,"".concat(xe,"-").concat($e.index))}))}else if(pe.type==="option")return $(pe,"".concat(pe.index))});else if(L){var K=P({inputValue:N});if(K===null)return null;ie=fn.createElement(v,E,K)}else{var oe=q({inputValue:N});if(oe===null)return null;ie=fn.createElement(y,E,oe)}var se={minMenuHeight:H,maxMenuHeight:B,menuPlacement:V,menuPosition:Z,menuShouldScrollIntoView:z},ge=fn.createElement(mie,Kt({},E,se),function(pe){var Ae=pe.ref,we=pe.placerProps,xe=we.placement,Pe=we.maxHeight;return fn.createElement(c,Kt({},E,se,{innerRef:Ae,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:L,placement:xe}),fn.createElement(Xae,{captureEnabled:w,onTopArrive:te,onBottomArrive:ee,lockEnabled:k},function(Ke){return fn.createElement(h,Kt({},E,{innerRef:function(pt){i.getMenuListRef(pt),Ke(pt)},innerProps:{role:"listbox","aria-multiselectable":E.isMulti,id:i.getElementId("listbox")},isLoading:L,maxHeight:Pe,focusedOption:O}),ie)}))});return X||Z==="fixed"?fn.createElement(g,Kt({},E,{appendTo:X,controlElement:this.controlRef,menuPlacement:V,menuPosition:Z}),ge):ge}},{key:"renderFormField",value:function(){var i=this,a=this.props,s=a.delimiter,u=a.isDisabled,c=a.isMulti,h=a.name,g=a.required,v=this.state.selectValue;if(g&&!this.hasValue()&&!u)return fn.createElement(Kae,{name:h,onFocus:this.onValueInputFocus});if(!(!h||u))if(c)if(s){var y=v.map(function(O){return i.getOptionValue(O)}).join(s);return fn.createElement("input",{name:h,type:"hidden",value:y})}else{var S=v.length>0?v.map(function(O,_){return fn.createElement("input",{key:"i-".concat(_),name:h,type:"hidden",value:i.getOptionValue(O)})}):fn.createElement("input",{name:h,type:"hidden",value:""});return fn.createElement("div",null,S)}else{var E=v[0]?this.getOptionValue(v[0]):"";return fn.createElement("input",{name:h,type:"hidden",value:E})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,a=this.state,s=a.ariaSelection,u=a.focusedOption,c=a.focusedValue,h=a.isFocused,g=a.selectValue,v=this.getFocusableOptions();return fn.createElement(Lae,Kt({},i,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:u,focusedValue:c,isFocused:h,selectValue:g,focusableOptions:v,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),a=i.Control,s=i.IndicatorsContainer,u=i.SelectContainer,c=i.ValueContainer,h=this.props,g=h.className,v=h.id,y=h.isDisabled,S=h.menuIsOpen,E=this.state.isFocused,O=this.commonProps=this.getCommonProps();return fn.createElement(u,Kt({},O,{className:g,innerProps:{id:v,onKeyDown:this.onKeyDown},isDisabled:y,isFocused:E}),this.renderLiveRegion(),fn.createElement(a,Kt({},O,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:y,isFocused:E,menuIsOpen:S}),fn.createElement(c,Kt({},O,{isDisabled:y}),this.renderPlaceholderOrValue(),this.renderInput()),fn.createElement(s,Kt({},O,{isDisabled:y}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,a){var s=a.prevProps,u=a.clearFocusValueOnUpdate,c=a.inputIsHiddenAfterUpdate,h=a.ariaSelection,g=a.isFocused,v=a.prevWasFocused,y=a.instancePrefix,S=i.options,E=i.value,O=i.menuIsOpen,_=i.inputValue,w=i.isMulti,N=my(E),L={};if(s&&(E!==s.value||S!==s.options||O!==s.menuIsOpen||_!==s.inputValue)){var P=O?dse(i,N):[],H=O?x7(W1(i,N),"".concat(y,"-option")):[],B=u?fse(a,N):null,G=hse(a,P),V=oE(H,G);L={selectValue:N,focusedOption:G,focusedOptionId:V,focusableOptionsWithIds:H,focusedValue:B,clearFocusValueOnUpdate:!1}}var Z=c!=null&&i!==s?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},X=h,k=g&&v;return g&&!k&&(X={value:Sm(w,N,N[0]||null),options:N,action:"initial-input-focus"},k=!v),h?.action==="initial-input-focus"&&(X=null),qt(qt(qt({},L),Z),{},{prevProps:i,ariaSelection:X,prevWasFocused:k})}}]),t})(D.Component);xL.defaultProps=cse;var gse=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function mse(n){var e=n.defaultInputValue,t=e===void 0?"":e,r=n.defaultMenuIsOpen,i=r===void 0?!1:r,a=n.defaultValue,s=a===void 0?null:a,u=n.inputValue,c=n.menuIsOpen,h=n.onChange,g=n.onInputChange,v=n.onMenuClose,y=n.onMenuOpen,S=n.value,E=eu(n,gse),O=D.useState(u!==void 0?u:t),_=Ou(O,2),w=_[0],N=_[1],L=D.useState(c!==void 0?c:i),P=Ou(L,2),H=P[0],B=P[1],G=D.useState(S!==void 0?S:s),V=Ou(G,2),Z=V[0],X=V[1],k=D.useCallback(function(K,oe){typeof h=="function"&&h(K,oe),X(K)},[h]),z=D.useCallback(function(K,oe){var se;typeof g=="function"&&(se=g(K,oe)),N(se!==void 0?se:K)},[g]),q=D.useCallback(function(){typeof y=="function"&&y(),B(!0)},[y]),te=D.useCallback(function(){typeof v=="function"&&v(),B(!1)},[v]),ee=u!==void 0?u:w,$=c!==void 0?c:H,ie=S!==void 0?S:Z;return qt(qt({},E),{},{inputValue:ee,menuIsOpen:$,onChange:k,onInputChange:z,onMenuClose:te,onMenuOpen:q,value:ie})}var vse=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],C7=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(e).toLowerCase(),a=String(r.getOptionValue(t)).toLowerCase(),s=String(r.getOptionLabel(t)).toLowerCase();return a===i||s===i},lE={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,r,i){return!(!e||t.some(function(a){return C7(e,a,i)})||r.some(function(a){return C7(e,a,i)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function yse(n){var e=n.allowCreateWhileLoading,t=e===void 0?!1:e,r=n.createOptionPosition,i=r===void 0?"last":r,a=n.formatCreateLabel,s=a===void 0?lE.formatCreateLabel:a,u=n.isValidNewOption,c=u===void 0?lE.isValidNewOption:u,h=n.getNewOptionData,g=h===void 0?lE.getNewOptionData:h,v=n.onCreateOption,y=n.options,S=y===void 0?[]:y,E=n.onChange,O=eu(n,vse),_=O.getOptionValue,w=_===void 0?fL:_,N=O.getOptionLabel,L=N===void 0?dL:N,P=O.inputValue,H=O.isLoading,B=O.isMulti,G=O.value,V=O.name,Z=D.useMemo(function(){return c(P,my(G),S,{getOptionValue:w,getOptionLabel:L})?g(P,s(P)):void 0},[s,g,L,w,P,c,S,G]),X=D.useMemo(function(){return(t||!H)&&Z?i==="first"?[Z].concat(ip(S)):[].concat(ip(S),[Z]):S},[t,i,H,Z,S]),k=D.useCallback(function(z,q){if(q.action!=="select-option")return E(z,q);var te=Array.isArray(z)?z:[z];if(te[te.length-1]===Z){if(v)v(P);else{var ee=g(P,P),$={action:"create-option",name:V,option:ee};E(Sm(B,[].concat(ip(my(G)),[ee]),ee),$)}return}E(z,q)},[g,P,B,V,Z,v,E,G]);return qt(qt({},O),{},{options:X,onChange:k})}var bse=D.forwardRef(function(n,e){var t=mse(n),r=yse(t);return fn.createElement(xL,Kt({ref:e},r))}),SL=bse;function _7(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function xse(n){if(Array.isArray(n))return n}function Sse(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,a,s,u=[],c=!0,h=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(g){h=!0,i=g}finally{try{if(!c&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(h)throw i}}return u}}function Cse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
281
281
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _se(n,e){return xse(n)||Sse(n,e)||Ese(n,e)||Cse()}function Ese(n,e){if(n){if(typeof n=="string")return _7(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_7(n,e):void 0}}const CL=Object.entries,E7=Object.setPrototypeOf,Tse=Object.isFrozen,wse=Object.getPrototypeOf,Ase=Object.getOwnPropertyDescriptor;let la=Object.freeze,ya=Object.seal,$h=Object.create,_L=typeof Reflect<"u"&&Reflect,h5=_L.apply,p5=_L.construct;la||(la=function(e){return e});ya||(ya=function(e){return e});h5||(h5=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];return e.apply(t,i)});p5||(p5=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return new e(...r)});const _d=Hi(Array.prototype.forEach),Rse=Hi(Array.prototype.lastIndexOf),T7=Hi(Array.prototype.pop),Zg=Hi(Array.prototype.push),Ise=Hi(Array.prototype.splice),ap=Array.isArray,Cm=Hi(String.prototype.toLowerCase),uE=Hi(String.prototype.toString),w7=Hi(String.prototype.match),Jg=Hi(String.prototype.replace),A7=Hi(String.prototype.indexOf),Ose=Hi(String.prototype.trim),Dse=Hi(Number.prototype.toString),Nse=Hi(Boolean.prototype.toString),R7=typeof BigInt>"u"?null:Hi(BigInt.prototype.toString),I7=typeof Symbol>"u"?null:Hi(Symbol.prototype.toString),Ps=Hi(Object.prototype.hasOwnProperty),Kg=Hi(Object.prototype.toString),Za=Hi(RegExp.prototype.test),bd=Mse(TypeError);function Hi(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return h5(n,e,r)}}function Mse(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return p5(n,t)}}function er(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Cm;if(E7&&E7(n,null),!ap(e))return n;let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const a=t(i);a!==i&&(Tse(e)||(e[r]=a),i=a)}n[i]=!0}return n}function Lse(n){for(let e=0;e<n.length;e++)Ps(n,e)||(n[e]=null);return n}function so(n){const e=$h(null);for(const r of CL(n)){var t=_se(r,2);const i=t[0],a=t[1];Ps(n,i)&&(ap(a)?e[i]=Lse(a):a&&typeof a=="object"&&a.constructor===Object?e[i]=so(a):e[i]=a)}return e}function kse(n){switch(typeof n){case"string":return n;case"number":return Dse(n);case"boolean":return Nse(n);case"bigint":return R7?R7(n):"0";case"symbol":return I7?I7(n):"Symbol()";case"undefined":return Kg(n);case"function":case"object":{if(n===null)return Kg(n);const e=n,t=al(e,"toString");if(typeof t=="function"){const r=t(e);return typeof r=="string"?r:Kg(r)}return Kg(n)}default:return Kg(n)}}function al(n,e){for(;n!==null;){const r=Ase(n,e);if(r){if(r.get)return Hi(r.get);if(typeof r.value=="function")return Hi(r.value)}n=wse(n)}function t(){return null}return t}function Pse(n){try{return Za(n,""),!0}catch{return!1}}const O7=la(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),cE=la(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),dE=la(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),jse=la(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fE=la(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Fse=la(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),D7=la(["#text"]),N7=la(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),hE=la(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),M7=la(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),j1=la(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Bse=ya(/{{[\w\W]*|^[\w\W]*}}/g),Gse=ya(/<%[\w\W]*|^[\w\W]*%>/g),Hse=ya(/\${[\w\W]*/g),zse=ya(/^data-[\-\w.\u00B7-\uFFFF]+$/),qse=ya(/^aria-[\-\w]+$/),L7=ya(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Use=ya(/^(?:\w+script|data):/i),Vse=ya(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Wse=ya(/^html$/i),Xse=ya(/^[a-z][.\w]*(-[.\w]+)+$/i),k7=ya(/<[/\w!]/g),P7=ya(/<[/\w]/g),Yse=ya(/<\/no(script|embed|frames)/i),Zse=ya(/\/>/i),no={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},EL=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Jse=la(er({},EL)),Kse=(function(){const n={};return _d(EL,e=>{n[e]=ya(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),la(n)})(),$se=function(){return typeof window>"u"?null:window},Qse=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(r=t.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return e.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},j7=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},yc=function(e,t,r,i){return Ps(e,t)&&ap(e[t])?er(i.base?so(i.base):{},e[t],i.transform):r},pE=function(e,t,r){const i=Ps(e,t)?e[t]:void 0;return i&&typeof i=="object"?so(i):r()};function TL(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$se();const e=ke=>TL(ke);if(e.version="3.4.14",e.removed=[],!n||!n.document||n.document.nodeType!==no.document||!n.Element)return e.isSupported=!1,e;let t=n.document;const r=t,i=r.currentScript;n.DocumentFragment;const a=n.HTMLTemplateElement,s=n.Node,u=n.Element,c=n.NodeFilter,h=n.NamedNodeMap;h===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const g=n.DOMParser,v=n.trustedTypes,y=u.prototype,S=al(y,"cloneNode"),E=al(y,"remove"),O=al(y,"nextSibling"),_=al(y,"childNodes"),w=al(y,"parentNode"),N=al(y,"shadowRoot"),L=al(y,"attributes"),P=s&&s.prototype?al(s.prototype,"nodeType"):null,H=s&&s.prototype?al(s.prototype,"nodeName"):null,B=s&&s.prototype?al(s.prototype,"ownerDocument"):null,G=function(Q){return P?P(Q):Q.nodeType},V=function(Q){return H?H(Q):Q.nodeName};if(typeof a=="function"){const ke=t.createElement("template");ke.content&&ke.content.ownerDocument&&(t=ke.content.ownerDocument)}let Z,X="",k,z=!1,q=0;const te=function(){if(q>0)throw bd('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ee=function(Q){te(),q++;try{return Z.createHTML(Q)}finally{q--}},$=function(Q){te(),q++;try{return Z.createScriptURL(Q)}finally{q--}},ie=function(){return z||(k=Qse(v,i),z=!0),k},K=t,oe=K.implementation,se=K.createNodeIterator,ge=K.createDocumentFragment,pe=K.getElementsByTagName,Ae=r.importNode;let we=j7();e.isSupported=typeof CL=="function"&&typeof w=="function"&&oe&&oe.createHTMLDocument!==void 0;const xe=Bse,Pe=Gse,Ke=Hse,$e=zse,pt=qse,_t=Use,ht=Vse,Rt=Xse;let yt=L7,gt=null;const lt=er({},[...O7,...cE,...dE,...fE,...D7]);let jt=null;const Et=er({},[...N7,...hE,...M7,...j1]);let mn=Object.seal($h(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),It=null,Yt=null;const Nt=Object.seal($h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Un=!0,yn=!0,On=!1,ar=!0,fr=!1,Jn=!0,Dn=!1,Kn=!1,Le=null,tt=null,Lt=!1,Ze=!1,Ut=!1,Vn=!1,ot=!0,We=!1;const Wt="user-content-";let Xt=!0,ze=!1,ut={},Tt=null;const hn=er({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let et=null;const Be=er({},["audio","video","img","source","image","track"]);let bt=null;const $t=er({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bn="http://www.w3.org/1998/Math/MathML",vn="http://www.w3.org/2000/svg",sn="http://www.w3.org/1999/xhtml";let Vr=sn,qi=!1,Ui=null;const sr=er({},[bn,vn,sn],uE),Ei=la(["mi","mo","mn","ms","mtext"]);let hr=er({},Ei);const ua=la(["annotation-xml"]);let li=er({},ua);const La=er({},["title","style","font","a","script"]);let ui=null;const ba=["application/xhtml+xml","text/html"],Cr="text/html";let Wn=null,Oi=null;const ka=t.createElement("form"),ci=function(Q){return Q instanceof RegExp||Q instanceof Function},Cs=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Oi&&Oi===Q)return;(!Q||typeof Q!="object")&&(Q={}),Q=so(Q),ui=ba.indexOf(Q.PARSER_MEDIA_TYPE)===-1?Cr:Q.PARSER_MEDIA_TYPE,Wn=ui==="application/xhtml+xml"?uE:Cm,gt=yc(Q,"ALLOWED_TAGS",lt,{transform:Wn}),jt=yc(Q,"ALLOWED_ATTR",Et,{transform:Wn}),Ui=yc(Q,"ALLOWED_NAMESPACES",sr,{transform:uE}),bt=yc(Q,"ADD_URI_SAFE_ATTR",$t,{transform:Wn,base:$t}),et=yc(Q,"ADD_DATA_URI_TAGS",Be,{transform:Wn,base:Be}),Tt=yc(Q,"FORBID_CONTENTS",hn,{transform:Wn}),It=yc(Q,"FORBID_TAGS",so({}),{transform:Wn}),Yt=yc(Q,"FORBID_ATTR",so({}),{transform:Wn}),ut=Ps(Q,"USE_PROFILES")?Q.USE_PROFILES&&typeof Q.USE_PROFILES=="object"?so(Q.USE_PROFILES):Q.USE_PROFILES:!1,Un=Q.ALLOW_ARIA_ATTR!==!1,yn=Q.ALLOW_DATA_ATTR!==!1,On=Q.ALLOW_UNKNOWN_PROTOCOLS||!1,ar=Q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,fr=Q.SAFE_FOR_TEMPLATES||!1,Jn=Q.SAFE_FOR_XML!==!1,Dn=Q.WHOLE_DOCUMENT||!1,Ze=Q.RETURN_DOM||!1,Ut=Q.RETURN_DOM_FRAGMENT||!1,Vn=Q.RETURN_TRUSTED_TYPE||!1,Lt=Q.FORCE_BODY||!1,ot=Q.SANITIZE_DOM!==!1,We=Q.SANITIZE_NAMED_PROPS||!1,Xt=Q.KEEP_CONTENT!==!1,ze=Q.IN_PLACE||!1,yt=Pse(Q.ALLOWED_URI_REGEXP)?Q.ALLOWED_URI_REGEXP:L7,Vr=typeof Q.NAMESPACE=="string"?Q.NAMESPACE:sn,hr=pE(Q,"MATHML_TEXT_INTEGRATION_POINTS",()=>er({},Ei)),li=pE(Q,"HTML_INTEGRATION_POINTS",()=>er({},ua));const fe=pE(Q,"CUSTOM_ELEMENT_HANDLING",()=>$h(null));if(mn=$h(null),Ps(fe,"tagNameCheck")&&ci(fe.tagNameCheck)&&(mn.tagNameCheck=fe.tagNameCheck),Ps(fe,"attributeNameCheck")&&ci(fe.attributeNameCheck)&&(mn.attributeNameCheck=fe.attributeNameCheck),Ps(fe,"allowCustomizedBuiltInElements")&&typeof fe.allowCustomizedBuiltInElements=="boolean"&&(mn.allowCustomizedBuiltInElements=fe.allowCustomizedBuiltInElements),ya(mn),fr&&(yn=!1),Ut&&(Ze=!0),ut&&(gt=er({},D7),jt=$h(null),ut.html===!0&&(er(gt,O7),er(jt,N7)),ut.svg===!0&&(er(gt,cE),er(jt,hE),er(jt,j1)),ut.svgFilters===!0&&(er(gt,dE),er(jt,hE),er(jt,j1)),ut.mathMl===!0&&(er(gt,fE),er(jt,M7),er(jt,j1))),Nt.tagCheck=null,Nt.attributeCheck=null,Ps(Q,"ADD_TAGS")&&(typeof Q.ADD_TAGS=="function"?Nt.tagCheck=Q.ADD_TAGS:ap(Q.ADD_TAGS)&&(gt===lt&&(gt=so(gt)),er(gt,Q.ADD_TAGS,Wn))),Ps(Q,"ADD_ATTR")&&(typeof Q.ADD_ATTR=="function"?Nt.attributeCheck=Q.ADD_ATTR:ap(Q.ADD_ATTR)&&(jt===Et&&(jt=so(jt)),er(jt,Q.ADD_ATTR,Wn))),Ps(Q,"ADD_FORBID_CONTENTS")&&ap(Q.ADD_FORBID_CONTENTS)&&(Tt===hn&&(Tt=so(Tt)),er(Tt,Q.ADD_FORBID_CONTENTS,Wn)),Xt&&(gt["#text"]=!0),Dn&&er(gt,["html","head","body"]),gt.table&&(er(gt,["tbody"]),delete It.tbody),Q.TRUSTED_TYPES_POLICY){if(typeof Q.TRUSTED_TYPES_POLICY.createHTML!="function")throw bd('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw bd('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Te=Z;Z=Q.TRUSTED_TYPES_POLICY;try{X=ee("")}catch(Ye){throw Z=Te,Ye}}else Q.TRUSTED_TYPES_POLICY===null?(Z=void 0,X=""):(Z===void 0&&(Z=ie()),Z&&typeof X=="string"&&(X=ee("")));la&&la(Q),Oi=Q},xr=er({},[...cE,...dE,...jse]),zs=er({},[...fE,...Fse]),Fo=function(Q,fe,Te){return fe.namespaceURI===sn?Q==="svg":fe.namespaceURI===bn?Q==="svg"&&(Te==="annotation-xml"||hr[Te]):!!xr[Q]},qs=function(Q,fe,Te){return fe.namespaceURI===sn?Q==="math":fe.namespaceURI===vn?Q==="math"&&li[Te]:!!zs[Q]},Qa=function(Q,fe,Te){return fe.namespaceURI===vn&&!li[Te]||fe.namespaceURI===bn&&!hr[Te]?!1:!zs[Q]&&(La[Q]||!xr[Q])},ca=function(Q){let fe=w(Q);(!fe||!fe.tagName)&&(fe={namespaceURI:Vr,tagName:"template"});const Te=Cm(Q.tagName),Ye=Cm(fe.tagName);return Ui[Q.namespaceURI]?Q.namespaceURI===vn?Fo(Te,fe,Ye):Q.namespaceURI===bn?qs(Te,fe,Ye):Q.namespaceURI===sn?Qa(Te,fe,Ye):!!(ui==="application/xhtml+xml"&&Ui[Q.namespaceURI]):!1},st=function(Q){Zg(e.removed,{element:Q});try{w(Q).removeChild(Q)}catch{if(E(Q),!w(Q))throw bd("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},xn=function(Q,fe,Te){try{Q.removeAttributeNode(fe)}catch{try{Q.removeAttribute(Te)}catch{}}},Sr=function(Q){Kr(Q);const fe=_(Q);if(fe){const Ye=[];_d(fe,Fe=>{Zg(Ye,Fe)}),_d(Ye,Fe=>{try{E(Fe)}catch{}})}const Te=L(Q);if(Te)for(let Ye=Te.length-1;Ye>=0;--Ye){const Fe=Te[Ye],Mt=Fe&&Fe.name;typeof Mt=="string"&&xn(Q,Fe,Mt)}},Fn=function(Q,fe,Te){if(!Te)try{Te=fe.getAttributeNode(Q)}catch{Te=null}Zg(e.removed,{attribute:Te||null,from:fe});try{Te?fe.removeAttributeNode(Te):fe.removeAttribute(Q)}catch{try{fe.removeAttribute(Q)}catch{}}if(Q==="is")if(Ze||Ut)try{st(fe)}catch{}else try{fe.setAttribute(Q,"")}catch{}},wn=function(Q){const fe=L(Q);if(fe)for(let Te=fe.length-1;Te>=0;--Te){const Ye=fe[Te],Fe=Ye&&Ye.name;typeof Fe!="string"||jt[Wn(Fe)]||xn(Q,Ye,Fe)}},Kr=function(Q){const fe=[Q];for(;fe.length>0;){const Te=fe.pop();G(Te)===no.element&&wn(Te);const Fe=_(Te);if(Fe)for(let Mt=Fe.length-1;Mt>=0;--Mt)fe.push(Fe[Mt])}},An=function(Q,fe){return Jn?Q==="patchsrc"?!0:Q==="for"&&fe!=="label"&&fe!=="output":!1},Rn=function(Q){if(!Jn)return;const fe=[Q];for(;fe.length>0;){const Te=fe.pop(),Ye=G(Te);if(Ye===no.processingInstruction||Ye===no.comment&&Za(P7,Te.data)){try{E(Te)}catch{}continue}if(Ye===no.element){const Mt=Te,Nn=Wn(V(Te));try{Mt.hasAttribute&&Mt.hasAttribute("patchsrc")&&Mt.removeAttribute("patchsrc"),Mt.hasAttribute&&Mt.hasAttribute("for")&&An("for",Nn)&&Mt.removeAttribute("for")}catch{}}const Fe=_(Te);if(Fe)for(let Mt=Fe.length-1;Mt>=0;--Mt)fe.push(Fe[Mt])}},Vi=function(Q){let fe=null,Te=null;if(Lt)Q="<remove></remove>"+Q;else{const Mt=w7(Q,/^[\r\n\t ]+/);Te=Mt&&Mt[0]}ui==="application/xhtml+xml"&&Vr===sn&&(Q='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Q+"</body></html>");const Ye=Z?ee(Q):Q;if(Vr===sn)try{fe=new g().parseFromString(Ye,ui)}catch{}if(!fe||!fe.documentElement){fe=oe.createDocument(Vr,"template",null);try{fe.documentElement.innerHTML=qi?X:Ye}catch{}}const Fe=fe.body||fe.documentElement;return Q&&Te&&Fe.insertBefore(t.createTextNode(Te),Fe.childNodes[0]||null),Vr===sn?pe.call(fe,Dn?"html":"body")[0]:Dn?fe.documentElement:Fe},vr=function(Q){const fe=B?B(Q):Q.ownerDocument;return se.call(fe||Q,Q,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},tr=function(Q){return Q=Jg(Q,xe," "),Q=Jg(Q,Pe," "),Q=Jg(Q,Ke," "),Q},Wr=function(Q){var fe;Q.normalize();const Te=B?B(Q):Q.ownerDocument,Ye=se.call(Te||Q,Q,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let Fe=Ye.nextNode();for(;Fe;)Fe.data=tr(Fe.data),Fe=Ye.nextNode();const Mt=(fe=Q.querySelectorAll)===null||fe===void 0?void 0:fe.call(Q,"template");Mt&&_d(Mt,Nn=>{or(Nn.content)&&Wr(Nn.content)})},jr=function(Q){const fe=H?H(Q):null;return typeof fe!="string"||Wn(fe)!=="form"?!1:typeof Q.nodeName!="string"||typeof Q.textContent!="string"||typeof Q.removeChild!="function"||Q.attributes!==L(Q)||typeof Q.removeAttribute!="function"||typeof Q.setAttribute!="function"||typeof Q.namespaceURI!="string"||typeof Q.insertBefore!="function"||typeof Q.hasChildNodes!="function"||Q.nodeType!==P(Q)||Q.childNodes!==_(Q)},or=function(Q){if(!P||typeof Q!="object"||Q===null)return!1;try{return P(Q)===no.documentFragment}catch{return!1}},Ti=function(Q){if(!P||typeof Q!="object"||Q===null)return!1;try{return typeof P(Q)=="number"}catch{return!1}};function Xr(ke,Q,fe){ke.length!==0&&_d(ke,Te=>{Te.call(e,Q,fe,Oi)})}const es=function(Q,fe){return!!(Jn&&Q.hasChildNodes()&&!Ti(Q.firstElementChild)&&Za(k7,Q.textContent)&&Za(k7,Q.innerHTML)||Jn&&Q.namespaceURI===sn&&Jse[fe]&&(Ti(Q.firstElementChild)||typeof Q.textContent=="string"&&Za(Kse[fe],Q.textContent))||Q.nodeType===no.processingInstruction||Jn&&Q.nodeType===no.comment&&Za(P7,Q.data))},Wi=function(Q,fe){if(Q instanceof RegExp)return Za(Q,fe);if(Q instanceof Function){for(var Te=arguments.length,Ye=new Array(Te>2?Te-2:0),Fe=2;Fe<Te;Fe++)Ye[Fe-2]=arguments[Fe];return!!Q(fe,...Ye)}return!1},ts=function(Q,fe,Te){if(!It[fe]&&Xi(fe)&&Wi(mn.tagNameCheck,fe))return!1;if(Xt&&!Tt[fe]){const Ye=w(Q),Fe=_(Q);if(Fe&&Ye){const Mt=Fe.length;for(let Nn=Mt-1;Nn>=0;--Nn){const Xn=Q===Te?S(Fe[Nn],!0):Fe[Nn];Ye.insertBefore(Xn,O(Q))}}}return st(Q),!0},Fr=function(Q,fe,Te,Ye){return Q.length===0?fe:fe===Te||fe===Ye?so(fe):fe},yl=function(Q,fe){return Q===fe||w(Q)!==null?!1:(ze&&Kr(Q),!0)},di=function(Q,fe){if(Xr(we.beforeSanitizeElements,Q,null),yl(Q,fe))return!0;if(jr(Q))return st(Q),!0;const Te=Wn(V(Q));if(gt=Fr(we.uponSanitizeElement,gt,lt,Le),Xr(we.uponSanitizeElement,Q,{tagName:Te,allowedTags:gt}),yl(Q,fe))return!0;if(es(Q,Te))return st(Q),!0;if(It[Te]||!(Nt.tagCheck instanceof Function&&Nt.tagCheck(Te))&&!gt[Te]){const Fe=ts(Q,Te,fe);return Fe===!1&&Xr(we.afterSanitizeElements,Q,null),Fe}if(G(Q)===no.element&&!ca(Q)||(Te==="noscript"||Te==="noembed"||Te==="noframes")&&Za(Yse,Q.innerHTML))return st(Q),!0;if(fr&&Q.nodeType===no.text){const Fe=tr(Q.textContent);Q.textContent!==Fe&&(Zg(e.removed,{element:Q.cloneNode()}),Q.textContent=Fe)}return Xr(we.afterSanitizeElements,Q,null),!1},xa=function(Q,fe,Te){if(Yt[fe]||An(fe,Q)||ot&&(fe==="id"||fe==="name")&&(Te in t||Te in ka))return!1;const Ye=jt[fe]||Nt.attributeCheck instanceof Function&&Nt.attributeCheck(fe,Q);return yn&&Za($e,fe)||Un&&Za(pt,fe)?!0:Ye?bt[fe]||Za(yt,Jg(Te,ht,""))||(fe==="src"||fe==="xlink:href"||fe==="href")&&Q!=="script"&&A7(Te,"data:")===0&&et[Q]||On&&!Za(_t,Jg(Te,ht,""))?!0:!Te:Xi(Q)&&Wi(mn.tagNameCheck,Q)&&Wi(mn.attributeNameCheck,fe,Q)||fe==="is"&&mn.allowCustomizedBuiltInElements&&Wi(mn.tagNameCheck,Te)},lr=er({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Xi=function(Q){return!lr[Cm(Q)]&&Za(Rt,Q)},Yi=function(Q,fe,Te,Ye){if(Z&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!Te)switch(v.getAttributeType(Q,fe)){case"TrustedHTML":return ee(Ye);case"TrustedScriptURL":return $(Ye)}return Ye},fo=function(Q,fe,Te,Ye){try{Te?Q.setAttributeNS(Te,fe,Ye):Q.setAttribute(fe,Ye),jr(Q)?st(Q):T7(e.removed)}catch{Fn(fe,Q)}},Sa=function(Q){Xr(we.beforeSanitizeAttributes,Q,null);const fe=Q.attributes;if(!fe||jr(Q))return;jt=Fr(we.uponSanitizeAttribute,jt,Et,tt);const Te={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:jt,forceKeepAttr:void 0};let Ye=fe.length;const Fe=Wn(Q.nodeName);for(;Ye--;){const Mt=fe[Ye],Nn=Mt.name,Xn=Mt.namespaceURI,fi=Mt.value,$r=Wn(Nn),pr=fi;let Rr=Nn==="value"?pr:Ose(pr);if(Te.attrName=$r,Te.attrValue=Rr,Te.keepAttr=!0,Te.forceKeepAttr=void 0,Xr(we.uponSanitizeAttribute,Q,Te),Rr=Te.attrValue,We&&($r==="id"||$r==="name")&&A7(Rr,Wt)!==0&&(Fn(Nn,Q,Mt),Rr=Wt+Rr),Jn&&Za(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Rr)){Fn(Nn,Q,Mt);continue}if($r==="attributename"&&w7(Rr,"href")){Fn(Nn,Q,Mt);continue}if(!Te.forceKeepAttr){if(!Te.keepAttr){Fn(Nn,Q,Mt);continue}if(!ar&&Za(Zse,Rr)){Fn(Nn,Q,Mt);continue}if(fr&&(Rr=tr(Rr)),!xa(Fe,$r,Rr)){Fn(Nn,Q,Mt);continue}Rr=Yi(Fe,$r,Xn,Rr),Rr!==pr&&fo(Q,Nn,Xn,Rr)}}Xr(we.afterSanitizeAttributes,Q,null)},ho=function(Q){let fe=null;const Te=vr(Q);for(Xr(we.beforeSanitizeShadowDOM,Q,null);fe=Te.nextNode();)if(Xr(we.uponSanitizeShadowNode,fe,null),di(fe,Q),Sa(fe),or(fe.content)&&ho(fe.content),G(fe)===no.element){const Ye=N(fe);or(Ye)&&(Us(Ye),ho(Ye))}Xr(we.afterSanitizeShadowDOM,Q,null)},Us=function(Q){const fe=[{node:Q,shadow:null}];for(;fe.length>0;){const Te=fe.pop();if(Te.shadow){ho(Te.shadow);continue}const Ye=Te.node,Mt=G(Ye)===no.element,Nn=_(Ye);if(Nn)for(let Xn=Nn.length-1;Xn>=0;--Xn)fe.push({node:Nn[Xn],shadow:null});if(Mt){const Xn=H?H(Ye):null;if(typeof Xn=="string"&&Wn(Xn)==="template"){const fi=Ye.content;or(fi)&&fe.push({node:fi,shadow:null})}}if(Mt){const Xn=N(Ye);or(Xn)&&fe.push({node:null,shadow:Xn},{node:Xn,shadow:null})}}};return e.sanitize=function(ke){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},fe=null,Te=null,Ye=null,Fe=null;if(qi=!ke,qi&&(ke="<!-->"),typeof ke!="string"&&!Ti(ke)&&(ke=kse(ke),typeof ke!="string"))throw bd("dirty is not a string, aborting");if(!e.isSupported)return ke;Kn?(gt=Le,jt=tt):Cs(Q),(we.uponSanitizeElement.length>0||we.uponSanitizeAttribute.length>0)&&(gt=so(gt)),we.uponSanitizeAttribute.length>0&&(jt=so(jt)),e.removed=[];const Mt=ze&&typeof ke!="string"&&Ti(ke);if(Mt){Rn(ke);const fi=V(ke);if(typeof fi=="string"){const $r=Wn(fi);if(!gt[$r]||It[$r])throw Sr(ke),bd("root node is forbidden and cannot be sanitized in-place")}if(jr(ke))throw Sr(ke),bd("root node is clobbered and cannot be sanitized in-place");try{Us(ke)}catch($r){throw Sr(ke),$r}}else if(Ti(ke))fe=Vi("<!---->"),Te=fe.ownerDocument.importNode(ke,!0),Te.nodeType===no.element&&Te.nodeName==="BODY"||Te.nodeName==="HTML"?fe=Te:fe.appendChild(Te),Us(Te);else{if(!Ze&&!fr&&!Dn&&ke.indexOf("<")===-1)return Z&&Vn?ee(ke):ke;if(fe=Vi(ke),!fe)return Ze?null:Vn?X:""}fe&&Lt&&st(fe.firstChild);const Nn=Mt?ke:fe;try{const fi=vr(Nn);for(;Ye=fi.nextNode();)di(Ye,Nn),Sa(Ye),or(Ye.content)&&ho(Ye.content)}catch(fi){throw Mt&&(Sr(ke),_d(e.removed,$r=>{$r.element&&Kr($r.element)})),fi}if(Mt)return _d(e.removed,fi=>{fi.element&&Kr(fi.element)}),fr&&Wr(ke),ke;if(Ze){if(fr&&Wr(fe),Ut)for(Fe=ge.call(fe.ownerDocument);fe.firstChild;)Fe.appendChild(fe.firstChild);else Fe=fe;return(jt.shadowroot||jt.shadowrootmode)&&(Fe=Ae.call(r,Fe,!0)),Fe}let Xn=Dn?fe.outerHTML:fe.innerHTML;return Dn&>["!doctype"]&&fe.ownerDocument&&fe.ownerDocument.doctype&&fe.ownerDocument.doctype.name&&Za(Wse,fe.ownerDocument.doctype.name)&&(Xn="<!DOCTYPE "+fe.ownerDocument.doctype.name+`>
|
|
282
|
-
`+Xn),fr&&(Xn=tr(Xn)),Z&&Vn?ee(Xn):Xn},e.setConfig=function(){let ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Cs(ke),Kn=!0,Le=gt,tt=jt},e.clearConfig=function(){Oi=null,Kn=!1,Le=null,tt=null,Z=k,X=""},e.isValidAttribute=function(ke,Q,fe){Oi||Cs({});const Te=Wn(ke),Ye=Wn(Q);return xa(Te,Ye,fe)},e.addHook=function(ke,Q){typeof Q=="function"&&Ps(we,ke)&&Zg(we[ke],Q)},e.removeHook=function(ke,Q){if(Ps(we,ke)){if(Q!==void 0){const fe=Rse(we[ke],Q);return fe===-1?void 0:Ise(we[ke],fe,1)[0]}return T7(we[ke])}},e.removeHooks=function(ke){Ps(we,ke)&&(we[ke]=[])},e.removeAllHooks=function(){we=j7()},e}var eoe=TL();const toe=n=>eoe.sanitize(n);function wL({comment:n,onChangeTemplate:e,setComment:t,t:r}){const i=_=>A.jsx("div",{title:_.title,children:_.label}),s=$a.useSelector(_=>Pt.getConfig(_)).annotation.commentTemplates??[],[u,c]=D.useState(null),[h,g]=D.useState(""),[v,y]=D.useState(0),S=_=>{if(_){if(n.trim().length>0){c(_),g(n);return}e(_.value)}},E=()=>{e({...u.value,content:h}),c(null),g("")},O=()=>{c(null),g(""),y(_=>_+1)};return A.jsxs(A.Fragment,{children:[A.jsx(ue.Grid,{container:!0,children:A.jsx(ue.Typography,{variant:"formSectionTitle",children:r("note")})}),s.length>0&&A.jsx(ue.Grid,{style:{marginBottom:"10px"},children:A.jsx(SL,{options:s.map(_=>({label:_.title,title:_.content,value:_})),placeholder:r("useTemplate"),onChange:S,isClearable:!0,isSearchable:!0,formatOptionLabel:i,styles:{marginBottom:"20px"}},v)}),A.jsx(ue.Grid,{container:!0,children:A.jsx(dy,{text:n,setText:t})}),A.jsxs(ue.Dialog,{"aria-labelledby":"confirm-template-selection-title",fullWidth:!0,maxWidth:"sm",onClose:O,open:u!==null,children:[A.jsx(ue.DialogTitle,{id:"confirm-template-selection-title",children:A.jsx(ue.Typography,{variant:"h2",component:"span",children:r("confirmTemplateSelectionTitle")})}),A.jsxs(ue.DialogContent,{children:[A.jsx(ue.DialogContentText,{variant:"body1",color:"inherit",children:r("confirmTemplateSelectionContent")}),A.jsx(ue.Typography,{variant:"subtitle2",sx:{marginTop:"16px"},children:r("selectedTemplateContent")}),A.jsx(ue.Box,{sx:{border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:"4px",marginBottom:"16px",maxHeight:"150px",overflowY:"auto",padding:"8px 12px"},dangerouslySetInnerHTML:{__html:toe(u?.value.content??"")}}),A.jsx(ue.Typography,{variant:"subtitle2",children:r("currentNoteContent")}),A.jsx(dy,{text:h,setText:g})]}),A.jsxs(ue.DialogActions,{children:[A.jsx(ue.Button,{onClick:O,children:r("cancel")}),A.jsx(ue.Button,{color:"primary",onClick:E,variant:"contained",children:r("applyMerge")})]})]})]})}wL.propTypes={comment:C.string.isRequired,onChangeTemplate:C.func.isRequired,setComment:C.func.isRequired,t:C.func.isRequired};function AL({setTags:n,t:e,tags:t,tagsSuggestions:r}){return A.jsxs(A.Fragment,{children:[A.jsx(ue.Typography,{variant:"formSectionTitle",children:e("tags")}),A.jsx(SL,{isMulti:!0,options:r,value:t,onChange:n,closeMenuOnSelect:!1,placeholder:e("tagsPlaceholder")}),A.jsx(ue.Divider,{spacing:2})]})}AL.propTypes={setTags:C.func.isRequired,t:C.func.isRequired,tags:C.any.isRequired,tagsSuggestions:C.arrayOf(C.shape({label:C.string,value:C.string})).isRequired};const Fc={AnnotationFormFooter:k5,MultiTagsInput:AL,TargetFormSection:j4,TextCommentInput:wL,TextFormSection:GM},{AnnotationFormFooter:noe}=Fc,roe=async n=>n;function RL({annotation:n,canvases:e,closeFormCompanionWindow:t,saveAnnotation:r,t:i}){const[a,s]=D.useState(n),u=()=>{e.forEach(async c=>{r(a.newData,c.id)}),t()};return A.jsxs(A.Fragment,{children:[A.jsx(ue.Paper,{elevation:0,style:{minHeight:"300px"},children:A.jsx(jH,{data:a,onUpdate:s})}),A.jsx(noe,{closeFormCompanionWindow:t,saveAnnotation:u,t:i,annotationState:a})]})}RL.propTypes={annotation:C.shape({body:C.shape({format:C.string,id:C.string,type:C.string,value:C.string}),drawingState:C.string,id:C.string,maeData:C.object,manifestNetwork:C.string,motivation:C.string,target:C.string}).isRequired,canvases:C.arrayOf(C.object).isRequired,closeFormCompanionWindow:C.func.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired};function n0({contentLocales:n,label:e,onChange:t,value:r}){return n.length<2?null:A.jsx(xy,{"aria-label":e,exclusive:!0,onChange:(i,a)=>{a!==null&&t(a)},size:"small",value:r??null,children:n.map(({code:i,name:a})=>A.jsx(Si,{"aria-label":a??i,value:i,children:i.toUpperCase()},i))})}n0.propTypes={contentLocales:C.arrayOf(C.shape({code:C.string.isRequired,name:C.string})),label:C.string.isRequired,onChange:C.func.isRequired,value:C.string};n0.defaultProps={contentLocales:[],value:null};const ioe=dr.createSvgIcon(A.jsx("path",{d:"M12 3v9.28c-.47-.17-.97-.28-1.5-.28C8.01 12 6 14.01 6 16.5S8.01 21 10.5 21c2.31 0 4.2-1.75 4.45-4H15V6h4V3z"}),"Audiotrack"),aoe=dr.createSvgIcon(A.jsx("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"}),"InsertDriveFile"),F7=dr.createSvgIcon(A.jsx("path",{d:"m18 4 2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4z"}),"Movie"),soe=dr.createSvgIcon(A.jsx("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5zm4-3H19v1h1.5V11H19v2h-1.5V7h3zM9 9.5h1v-1H9zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm10 5.5h1v-3h-1z"}),"PictureAsPdf"),ooe=300,loe={audio:ioe,"research-pdf":soe,"uploaded-video":F7,"youtube-video":F7},B7={borderRadius:1,flexShrink:0,height:40,objectFit:"cover",width:40};function g5({media:n}){if(n.thumbnailUrl)return A.jsx(ue.Box,{component:"img",src:n.thumbnailUrl,alt:"","data-testid":"media-selection-thumbnail",sx:B7});const e=n.source==="media-item"&&loe[n.mediaType]||(n.source==="upload"?ZD:aoe);return A.jsx(ue.Box,{sx:{...B7,alignItems:"center",bgcolor:"action.hover",color:"action.active",display:"flex",justifyContent:"center"},children:A.jsx(e,{fontSize:"small"})})}g5.propTypes={media:C.shape({mediaType:C.string,source:C.string,thumbnailUrl:C.string}).isRequired};const gE={"iiif-image":{normalize:n=>({id:n.documentId,source:"iiif-image",thumbnailUrl:n.thumbnailUrl??null,title:n.displayTitle}),titleKey:"poi_media_source_iiif_image"},upload:{normalize:n=>({id:String(n.id),source:"upload",thumbnailUrl:n.thumbnailUrl??null,title:n.name}),titleKey:"poi_media_source_upload"},"media-item":{normalize:n=>({id:n.documentId,mediaType:n.mediaType??null,source:"media-item",thumbnailUrl:n.thumbnailUrl??null,title:n.titleEn}),titleKey:"poi_media_source_media_item"}};function zm({dialogContainer:n,label:e,onChange:t,onSearchIiifImages:r,onSearchMediaItems:i,onSearchUploads:a,t:s,value:u}){const c=D.useMemo(()=>({"iiif-image":r,"media-item":i,upload:a}),[r,i,a]),h=D.useMemo(()=>Object.keys(gE).filter(G=>typeof c[G]=="function"),[c]),[g,v]=D.useState((u&&h.includes(u.source)?u.source:h[0])??null),[y,S]=D.useState(u?.title??""),[E,O]=D.useState(u?[u]:[]),[_,w]=D.useState(!1),N=D.useRef(null),L=D.useRef(0);D.useEffect(()=>()=>{clearTimeout(N.current),L.current+=1},[]);const P=(G,V)=>{const Z=c[G];if(typeof Z!="function")return;const X=L.current+1;L.current=X,w(!0),Promise.resolve(Z(V)).then(k=>{L.current===X&&O(k.map(gE[G].normalize))}).finally(()=>{L.current===X&&w(!1)})},H=(G,V)=>{clearTimeout(N.current),N.current=setTimeout(()=>P(G,V),ooe)},B=(G,V)=>{V&&(L.current+=1,clearTimeout(N.current),v(V),S(""),O([]),w(!1))};return h.length===0?null:A.jsxs(ue.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[h.length>1&&A.jsx(ue.ToggleButtonGroup,{value:g,exclusive:!0,onChange:B,size:"small",color:"primary",children:h.map(G=>A.jsx(ue.ToggleButton,{value:G,children:s(gE[G].titleKey)},G))}),A.jsx(ue.Autocomplete,{filterOptions:G=>G,getOptionKey:G=>G.id,getOptionLabel:G=>G.title,inputValue:y,isOptionEqualToValue:(G,V)=>G.source===V.source&&G.id===V.id,loading:_,noOptionsText:s(y?"poi_media_no_results":"poi_media_search_prompt"),onChange:(G,V)=>t(V),onInputChange:(G,V)=>{S(V),H(g,V)},onOpen:()=>P(g,y),options:E,renderInput:G=>A.jsx(ue.TextField,{...G,label:e,variant:"outlined",InputProps:{...G.InputProps,endAdornment:A.jsxs(A.Fragment,{children:[_?A.jsx(ue.CircularProgress,{color:"inherit",size:16}):null,G.InputProps.endAdornment]})}}),renderOption:(G,V)=>D.createElement(ue.Box,{component:"li",...G,key:V.id,sx:{alignItems:"center",display:"flex",gap:1}},A.jsx(g5,{media:{...V,source:g}}),V.title),slotProps:{popper:{container:n}},value:u&&u.source===g?u:null}),u&&A.jsxs(ue.Box,{sx:{alignItems:"center",display:"flex",gap:1},children:[A.jsx(g5,{media:u}),A.jsx(ue.Typography,{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:u.title})]})]})}zm.propTypes={dialogContainer:C.func.isRequired,label:C.string.isRequired,onChange:C.func.isRequired,onSearchIiifImages:C.func,onSearchMediaItems:C.func,onSearchUploads:C.func,t:C.func.isRequired,value:C.shape({id:C.string.isRequired,mediaType:C.string,source:C.oneOf(["upload","iiif-image","media-item"]).isRequired,thumbnailUrl:C.string,title:C.string})};zm.defaultProps={onSearchIiifImages:void 0,onSearchMediaItems:void 0,onSearchUploads:void 0,value:null};const uoe=(n,e)=>!n&&!e?!0:!n||!e?!1:n.source===e.source&&n.id===e.id;function $y({activeLocaleIsRtl:n,dialogContainer:e,keepSameLabel:t,labelAr:r,labelEn:i,mediaAr:a,mediaEn:s,onChangeAr:u,onChangeEn:c,onSearchIiifImages:h,onSearchMediaItems:g,onSearchUploads:v,t:y}){const[S,E]=D.useState(()=>uoe(s,a)),O=w=>{n?(u(w),S&&c(w)):(c(w),S&&u(w))},_=w=>{const{checked:N}=w.target;E(N),N&&(n?c(a):u(s))};return A.jsxs(A.Fragment,{children:[A.jsx(zm,{dialogContainer:e,label:n?r:i,onChange:O,onSearchIiifImages:h,onSearchMediaItems:g,onSearchUploads:v,t:y,value:n?a:s},n?"ar":"en"),A.jsx(ue.FormControlLabel,{control:A.jsx(ue.Checkbox,{checked:S,onChange:_}),label:t})]})}$y.propTypes={activeLocaleIsRtl:C.bool,dialogContainer:C.func.isRequired,keepSameLabel:C.string.isRequired,labelAr:C.string.isRequired,labelEn:C.string.isRequired,mediaAr:zm.propTypes.value,mediaEn:zm.propTypes.value,onChangeAr:C.func.isRequired,onChangeEn:C.func.isRequired,onSearchIiifImages:C.func,onSearchMediaItems:C.func,onSearchUploads:C.func,t:C.func.isRequired};$y.defaultProps={activeLocaleIsRtl:!1,mediaAr:null,mediaEn:null,onSearchIiifImages:void 0,onSearchMediaItems:void 0,onSearchUploads:void 0};const coe=["showBlocks","|","heading","|","superscript","bold","italic","underline","strikethrough","|","bulletedList","numberedList","link","insertTable","codeBlock","specialCharacters","horizontalLine","subscript","|","undo","redo"],doe=[{class:"ck-heading_paragraph",model:"paragraph",title:"Paragraph"},{class:"ck-heading_heading2",model:"heading2",title:"Heading 2",view:"h2"},{class:"ck-heading_heading3",model:"heading3",title:"Heading 3",view:"h3"},{class:"ck-heading_heading4",model:"heading4",title:"Heading 4",view:"h4"},{class:"ck-heading_heading5",model:"heading5",title:"Heading 5",view:"h5"},{class:"ck-heading_heading6",model:"heading6",title:"Heading 6",view:"h6"}],foe=[Fi.Autoformat,Fi.Bold,Fi.CodeBlock,Fi.Essentials,Fi.Heading,Fi.HorizontalLine,Fi.Italic,Fi.Link,Fi.List,Fi.Paragraph,Fi.ShowBlocks,Fi.SpecialCharacters,Fi.SpecialCharactersEssentials,Fi.Strikethrough,Fi.Subscript,Fi.Superscript,Fi.Table,Fi.TableToolbar,Fi.Underline];function r0({onChange:n,placeholder:e,rtl:t,value:r}){return A.jsx(ue.Box,{sx:{"& .ck-content":{overflowWrap:"break-word"},"& .ck-content *":t?{direction:"rtl",textAlign:"right"}:void 0,"& .ck-content img, & .ck-content table":{maxWidth:"100%"},"& .ck-editor, & .ck-editor__editable":{maxWidth:"100%"},"& .ck-editor__editable":{minHeight:"150px"},"& .ck-editor__editable, & .ck-content":t?{direction:"rtl",textAlign:"right",unicodeBidi:"plaintext"}:void 0,maxWidth:"100%",minWidth:0},children:A.jsx(WF.CKEditor,{config:{heading:{options:doe},language:{content:t?"ar":"en",ui:"en"},licenseKey:"GPL",placeholder:e,plugins:foe,toolbar:{items:coe,shouldNotGroupWhenFull:!0}},data:r,editor:Fi.ClassicEditor,onChange:(i,a)=>n(a.getData())})})}r0.propTypes={onChange:C.func.isRequired,placeholder:C.string,rtl:C.bool,value:C.string};r0.defaultProps={placeholder:void 0,rtl:!1,value:""};const{AnnotationFormFooter:hoe,TargetFormSection:poe}=Fc,m5="TextualBody",IL=n=>typeof n=="string"&&n.toLowerCase().startsWith("ar"),t3=(n,e)=>Object.keys(n)[0]??(e.some(({code:t})=>t==="en")?"en":e[0]?.code),goe={description:"",title:""},n3=(n,e)=>n[e]??goe,r3=n=>{const e={},t=new Set;return n.forEach(r=>{const i=r.language;if(!i)return;const a=e[i]??{description:"",title:""};r.purpose==="identifying"?a.title=r.value??"":r.purpose==="describing"&&r.type===m5&&!t.has(i)&&(a.description=r.value??"",t.add(i)),e[i]=a}),e},OL=n=>{const e=n?.target?.drawingState?.shapes;return Array.isArray(e)&&e.length===1&&e[0].type===Vt.POI},DL=n=>n==null||Number.isFinite(n)&&n>=-90&&n<=90,NL=n=>n==null||Number.isFinite(n)&&n>=-180&&n<=180,by=n=>{const e=n.trim();return e===""?null:Number(e.replace(",","."))},i3=(n,e)=>e.every(({code:t})=>!sp(n3(n,t).title)),a3=n=>{const e=n,{contentByLocale:t}=e.maeData;return e.body=Object.entries(t).flatMap(([r,i])=>{const{description:a,title:s}=i;return[{language:r,purpose:"identifying",type:m5,value:s},...sp(a)?[]:[{language:r,purpose:"describing",type:m5,value:a}]]}),e},moe=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=a3(n);return Um(i,e,t,r)};function ML({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const{contentLocales:s=[],searchMediaItems:u,searchIiifImages:c,searchUploads:h}=$a.useSelector(xe=>Pt.getConfig(xe)).annotation??{};let g=n;g.id?(g.maeData.target.drawingState&&typeof g.maeData.target.drawingState=="string"&&(g.maeData.target.drawingState={...JSON.parse(g.maeData.target.drawingState),currentShape:null}),g.maeData.contentByLocale=r3(g.body)):g={body:[],"dbf:kind":"POI","dbf:latitude":null,"dbf:longitude":null,"dbf:mediaAr":null,"dbf:mediaEn":null,maeData:{contentByLocale:{},target:null,templateType:gn.POI_TYPE},motivation:"identifying",target:null};const[v,y]=D.useState(g),[S,E]=D.useState(!1),[O,_]=D.useState(!1),[w,N]=D.useState(!1),[L,P]=D.useState(!1),[H,B]=D.useState(g["dbf:latitude"]!=null?String(g["dbf:latitude"]):""),[G,V]=D.useState(g["dbf:longitude"]!=null?String(g["dbf:longitude"]):""),[Z,X]=D.useState(!1),[k,z]=D.useState(t3(v.maeData.contentByLocale,s)),q=D.useRef(null),te=()=>q.current?.closest('[role="dialog"]')??document.body,ee=n3(v.maeData.contentByLocale,k),$=IL(k),ie=xe=>{y({...v,maeData:{...v.maeData,...xe}})},K=xe=>{ie({target:xe})},oe=xe=>{ie({contentByLocale:{...v.maeData.contentByLocale,[k]:{...ee,...xe}}})},se=xe=>{y(Pe=>({...Pe,"dbf:mediaEn":xe}))},ge=xe=>{y(Pe=>({...Pe,"dbf:mediaAr":xe}))},pe=xe=>{const{value:Pe}=xe.target;B(Pe),y(Ke=>({...Ke,"dbf:latitude":by(Pe)}))},Ae=xe=>{const{value:Pe}=xe.target;V(Pe),y(Ke=>({...Ke,"dbf:longitude":by(Pe)}))},we=async()=>{const xe=OL(v.maeData),Pe=i3(v.maeData.contentByLocale,s),Ke=DL(v["dbf:latitude"]),$e=NL(v["dbf:longitude"]);if(E(!xe),_(!Pe),N(!Ke),P(!$e),!(!xe||!Pe||!Ke||!$e)){qm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),X(!0);try{await r(v)}finally{X(!1)}}};return A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:2,ref:q,children:[A.jsxs(ue.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:i("poi")})}),A.jsx(ue.Grid,{children:A.jsx(n0,{contentLocales:s,label:i("poi_language"),onChange:z,value:k})})]}),A.jsxs(ue.Grid,{children:[A.jsx(ue.TextField,{fullWidth:!0,error:O,label:i("poi_title"),value:ee.title,variant:"outlined",onChange:xe=>oe({title:xe.target.value}),slotProps:{htmlInput:{dir:$?"rtl":"ltr",style:{textAlign:$?"right":"left"}}}}),O&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_title_required")})]}),(u||c||h)&&A.jsx(ue.Grid,{children:A.jsx($y,{activeLocaleIsRtl:$,dialogContainer:te,keepSameLabel:i("poi_media_keep_same"),labelAr:i("poi_media_ar"),labelEn:i("poi_media_en"),mediaAr:v["dbf:mediaAr"]??null,mediaEn:v["dbf:mediaEn"]??null,onChangeAr:ge,onChangeEn:se,onSearchIiifImages:c,onSearchMediaItems:u,onSearchUploads:h,t:i})}),A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:i("poi_description_section")})}),A.jsx(ue.Grid,{children:A.jsx(r0,{onChange:xe=>oe({description:xe}),placeholder:i("poi_description_placeholder"),rtl:$,value:ee.description},k)}),A.jsxs(ue.Grid,{container:!0,direction:"row",spacing:2,children:[A.jsxs(ue.Grid,{size:6,children:[A.jsx(ue.TextField,{fullWidth:!0,error:w,label:i("poi_latitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:H,variant:"outlined",onChange:pe}),w&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_latitude_invalid")})]}),A.jsxs(ue.Grid,{size:6,children:[A.jsx(ue.TextField,{fullWidth:!0,error:L,label:i("poi_longitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:G,variant:"outlined",onChange:Ae}),L&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_longitude_invalid")})]})]}),A.jsxs(ue.Grid,{children:[A.jsx(poe,{onChangeTarget:K,playerReferences:t,pointOnly:!0,spatialTarget:!0,target:v.maeData.target,windowId:a}),S&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_target_must_be_point")})]}),A.jsx(ue.Grid,{children:A.jsx(hoe,{closeFormCompanionWindow:e,saveAnnotation:we,saving:Z,t:i,annotationState:v})})]})}ML.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const{AnnotationFormFooter:voe}=Fc,yoe=n=>typeof n=="string"&&n.toLowerCase().startsWith("ar"),boe={description:"",title:""},xoe=(n,e)=>n[e]??boe,Soe=async(n,{canvas:e})=>{const t=a3(n);return t.target=e.id,t};function LL({annotation:n,closeFormCompanionWindow:e,saveAnnotation:t,t:r}){const{contentLocales:i=[],searchMediaItems:a,searchIiifImages:s,searchUploads:u}=$a.useSelector(X=>Pt.getConfig(X)).annotation??{};let c=n;c.id?c.maeData.contentByLocale=r3(c.body):c={body:[],"dbf:kind":"Journey","dbf:mediaAr":null,"dbf:mediaEn":null,maeData:{contentByLocale:{},target:{},templateType:gn.JOURNEY_TYPE},motivation:"identifying",target:null};const[h,g]=D.useState(c),[v,y]=D.useState(!1),[S,E]=D.useState(!1),[O,_]=D.useState(t3(h.maeData.contentByLocale,i)),w=D.useRef(null),N=()=>w.current?.closest('[role="dialog"]')??document.body,L=xoe(h.maeData.contentByLocale,O),P=yoe(O),H=X=>{g({...h,maeData:{...h.maeData,...X}})},B=X=>{H({contentByLocale:{...h.maeData.contentByLocale,[O]:{...L,...X}}})},G=X=>{g(k=>({...k,"dbf:mediaEn":X}))},V=X=>{g(k=>({...k,"dbf:mediaAr":X}))},Z=async()=>{const X=i3(h.maeData.contentByLocale,i);if(y(!X),!!X){E(!0);try{await t(h)}finally{E(!1)}}};return A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:2,ref:w,children:[A.jsxs(ue.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:r("journey")})}),A.jsx(ue.Grid,{children:A.jsx(n0,{contentLocales:i,label:r("journey_language"),onChange:_,value:O})})]}),A.jsxs(ue.Grid,{children:[A.jsx(ue.TextField,{fullWidth:!0,error:v,label:r("journey_title"),value:L.title,variant:"outlined",onChange:X=>B({title:X.target.value}),slotProps:{htmlInput:{dir:P?"rtl":"ltr",style:{textAlign:P?"right":"left"}}}}),v&&A.jsx(rn,{color:"error",variant:"caption",children:r("journey_title_required")})]}),(a||s||u)&&A.jsx(ue.Grid,{children:A.jsx($y,{activeLocaleIsRtl:P,dialogContainer:N,keepSameLabel:r("journey_media_keep_same"),labelAr:r("journey_media_ar"),labelEn:r("journey_media_en"),mediaAr:h["dbf:mediaAr"]??null,mediaEn:h["dbf:mediaEn"]??null,onChangeAr:V,onChangeEn:G,onSearchIiifImages:s,onSearchMediaItems:a,onSearchUploads:u,t:r})}),A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:r("journey_description_section")})}),A.jsx(ue.Grid,{children:A.jsx(r0,{onChange:X=>B({description:X}),placeholder:r("journey_description_placeholder"),rtl:P,value:L.description},O)}),A.jsx(ue.Grid,{children:A.jsx(voe,{closeFormCompanionWindow:e,saveAnnotation:Z,saving:S,t:r,annotationState:h})}),A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"subFormSectionTitle",children:r("journey_hint")})})]})}LL.propTypes={annotation:C.shape({body:C.arrayOf(C.shape({type:C.string})),id:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired};const{AnnotationFormFooter:Coe,MultiTagsInput:_oe,TargetFormSection:Eoe,TextCommentInput:Toe}=Fc,woe=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=vO(n);return Um(i,e,t,r)};function kL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const s=$a.useSelector(N=>Pt.getConfig(N)),c=s.annotation.tagsSuggestions??[];let h=n;if(h.id)h.maeData.target.drawingState&&typeof h.maeData.target.drawingState=="string"&&(h.maeData.target.drawingState=JSON.parse(h.maeData.target.drawingState),console.debug("Parsed drawingState:",h.maeData.target.drawingState),h.maeData.target.drawingState={...h.maeData.target.drawingState,currentShape:null}),h.maeData.textBody=h.body.find(N=>N.purpose==="describing"),h.maeData.tags=h.body.filter(N=>N.purpose==="tagging").map(N=>({label:N.value,value:N.value})),h.maeData.textBody===void 0&&(h.maeData.textBody={purpose:"describing",type:"TextualBody",value:""});else{const{defaultTags:N}=Ym(s),L=N.map(P=>({label:P,value:P}));h={body:[],maeData:{tags:L,target:null,templateType:gn.MULTIPLE_BODY_TYPE,textBody:{purpose:"describing",type:"TextualBody",value:""}},motivation:"commenting",target:null}}const[g,v]=D.useState(h),y=N=>{v({...g,maeData:{...g.maeData,textBody:{...g.maeData.textBody,value:N}}})},S=N=>{v({...g,maeData:{...g.maeData,tags:N}})},E=N=>{const L=g.maeData;L.target=N,v({...g,maeData:L})},O=async()=>{qm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),r(g)},_=c.map(N=>({label:N,value:N})),w=N=>{const L=_.find(P=>P.value===N.title);if(L&&!g.maeData.tags.find(P=>P.value===L.value)){v({...g,maeData:{...g.maeData,tags:[...g.maeData.tags,L],textBody:{...g.maeData.textBody,value:N.content}}});return}y(N.content)};return A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:2,children:[A.jsx(ue.Grid,{children:A.jsx(Toe,{comment:g.maeData.textBody.value,setComment:y,onChangeTemplate:w,t:i})}),A.jsx(ue.Grid,{children:A.jsx(_oe,{t:i,tags:g.maeData.tags,setTags:S,tagsSuggestions:_})}),A.jsx(ue.Grid,{children:A.jsx(Eoe,{onChangeTarget:E,playerReferences:t,spatialTarget:!0,t:i,target:g.maeData.target,timeTarget:!0,windowId:a})}),A.jsx(ue.Grid,{children:A.jsx(Coe,{closeFormCompanionWindow:e,saveAnnotation:O,t:i,annotationState:g})})]})}kL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const Aoe=300;function s3({dialogContainer:n,label:e,onChange:t,onSearch:r,t:i,value:a}){const[s,u]=D.useState(a?.titleEn??""),[c,h]=D.useState(a?[a]:[]),[g,v]=D.useState(!1),y=D.useRef(null),S=D.useRef(0);D.useEffect(()=>()=>{clearTimeout(y.current),S.current+=1},[]);const E=_=>{const w=S.current+1;S.current=w,v(!0),Promise.resolve(r(_)).then(N=>{S.current===w&&h(N)}).finally(()=>{S.current===w&&v(!1)})},O=_=>{clearTimeout(y.current),y.current=setTimeout(()=>E(_),Aoe)};return A.jsx(ue.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:A.jsx(ue.Autocomplete,{filterOptions:_=>_,getOptionKey:_=>_.documentId,getOptionLabel:_=>_.titleEn,inputValue:s,isOptionEqualToValue:(_,w)=>_.documentId===w.documentId,loading:g,noOptionsText:i(s?"map_relation_no_results":"map_relation_search_prompt"),onChange:(_,w)=>t(w),onInputChange:(_,w)=>{u(w),O(w)},onOpen:()=>E(s),options:c,renderInput:_=>A.jsx(ue.TextField,{..._,label:e,variant:"outlined",InputProps:{..._.InputProps,endAdornment:A.jsxs(A.Fragment,{children:[g?A.jsx(ue.CircularProgress,{color:"inherit",size:16}):null,_.InputProps.endAdornment]})}}),slotProps:{popper:{container:n}},value:a})})}s3.propTypes={dialogContainer:C.func.isRequired,label:C.string.isRequired,onChange:C.func.isRequired,onSearch:C.func.isRequired,t:C.func.isRequired,value:C.shape({documentId:C.string.isRequired,titleEn:C.string.isRequired})};s3.defaultProps={value:null};const{AnnotationFormFooter:Roe,TargetFormSection:Ioe}=Fc,Ooe=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=a3(n);return Um(i,e,t,r)};function PL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const{contentLocales:s=[],searchMaps:u}=$a.useSelector(xe=>Pt.getConfig(xe)).annotation??{};let c=n;c.id?(c.maeData.target.drawingState&&typeof c.maeData.target.drawingState=="string"&&(c.maeData.target.drawingState={...JSON.parse(c.maeData.target.drawingState),currentShape:null}),c.maeData.contentByLocale=r3(c.body)):c={body:[],"dbf:kind":"POI","dbf:latitude":null,"dbf:linkedMap":null,"dbf:longitude":null,"dbf:mediaAr":null,"dbf:mediaEn":null,maeData:{contentByLocale:{},target:null,templateType:gn.NESTED_MAP_TYPE},motivation:"identifying",target:null};const[h,g]=D.useState(c),[v,y]=D.useState(!1),[S,E]=D.useState(!1),[O,_]=D.useState(!1),[w,N]=D.useState(!1),[L,P]=D.useState(!1),[H,B]=D.useState(c["dbf:latitude"]!=null?String(c["dbf:latitude"]):""),[G,V]=D.useState(c["dbf:longitude"]!=null?String(c["dbf:longitude"]):""),[Z,X]=D.useState(!1),[k,z]=D.useState(t3(h.maeData.contentByLocale,s)),q=D.useRef(null),te=()=>q.current?.closest('[role="dialog"]')??document.body,ee=n3(h.maeData.contentByLocale,k),$=IL(k),ie=h["dbf:linkedMap"]??null,K=xe=>{g({...h,maeData:{...h.maeData,...xe}})},oe=xe=>{K({target:xe})},se=xe=>{K({contentByLocale:{...h.maeData.contentByLocale,[k]:{...ee,...xe}}})},ge=xe=>{g({...h,"dbf:linkedMap":xe?{id:xe.documentId,titleEn:xe.titleEn}:null})},pe=xe=>{const{value:Pe}=xe.target;B(Pe),g(Ke=>({...Ke,"dbf:latitude":by(Pe)}))},Ae=xe=>{const{value:Pe}=xe.target;V(Pe),g(Ke=>({...Ke,"dbf:longitude":by(Pe)}))},we=async()=>{const xe=OL(h.maeData),Pe=!!h["dbf:linkedMap"],Ke=i3(h.maeData.contentByLocale,s),$e=DL(h["dbf:latitude"]),pt=NL(h["dbf:longitude"]);if(y(!xe),E(!Pe),_(!Ke),N(!$e),P(!pt),!(!xe||!Pe||!Ke||!$e||!pt)){qm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),X(!0);try{await r(h)}finally{X(!1)}}};return A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:2,ref:q,children:[A.jsxs(ue.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:i("nested_map")})}),A.jsx(ue.Grid,{children:A.jsx(n0,{contentLocales:s,label:i("poi_language"),onChange:z,value:k})})]}),A.jsxs(ue.Grid,{children:[A.jsx(ue.TextField,{fullWidth:!0,error:O,label:i("poi_title"),value:ee.title,variant:"outlined",onChange:xe=>se({title:xe.target.value}),slotProps:{htmlInput:{dir:$?"rtl":"ltr",style:{textAlign:$?"right":"left"}}}}),O&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_title_required")})]}),A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:i("nested_map_linked_map")})}),typeof u=="function"&&A.jsxs(ue.Grid,{children:[A.jsx(s3,{dialogContainer:te,label:i("nested_map_linked_map"),onChange:ge,onSearch:u,t:i,value:ie?{documentId:ie.id,titleEn:ie.titleEn}:null}),S&&A.jsx(rn,{color:"error",variant:"caption",children:i("nested_map_linked_map_required")})]}),A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:i("poi_description_section")})}),A.jsx(ue.Grid,{children:A.jsx(r0,{onChange:xe=>se({description:xe}),placeholder:i("poi_description_placeholder"),rtl:$,value:ee.description},k)}),A.jsxs(ue.Grid,{container:!0,direction:"row",spacing:2,children:[A.jsxs(ue.Grid,{size:6,children:[A.jsx(ue.TextField,{fullWidth:!0,error:w,label:i("poi_latitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:H,variant:"outlined",onChange:pe}),w&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_latitude_invalid")})]}),A.jsxs(ue.Grid,{size:6,children:[A.jsx(ue.TextField,{fullWidth:!0,error:L,label:i("poi_longitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:G,variant:"outlined",onChange:Ae}),L&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_longitude_invalid")})]})]}),A.jsxs(ue.Grid,{children:[A.jsx(Ioe,{onChangeTarget:oe,playerReferences:t,pointOnly:!0,spatialTarget:!0,target:h.maeData.target,windowId:a}),v&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_target_must_be_point")})]}),A.jsx(ue.Grid,{children:A.jsx(Roe,{closeFormCompanionWindow:e,saveAnnotation:we,saving:Z,t:i,annotationState:h})})]})}PL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const{AnnotationFormFooter:Doe,TargetFormSection:Noe}=Fc,Moe=mO;function jL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const s=$a.useSelector(S=>Pt.getConfig(S));let u=n;if(u.id)u.maeData.target.drawingState&&typeof u.maeData.target.drawingState=="string"&&(u.maeData.target.drawingState=JSON.parse(u.maeData.target.drawingState));else{const{defaultTags:S}=Ym(s);u={body:{type:"Image",value:S.length>0?S[0]:""},maeData:{target:null,templateType:gn.TAGGING_TYPE},motivation:"tagging",target:null}}const[c,h]=D.useState(u),g=S=>{const E=c.body;E.value=S,h({...c,body:E})},v=S=>{const E=c.maeData;E.target=S,h({...c,maeData:E})},y=async()=>{qm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),r(c)};return A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:2,children:[A.jsx(ue.Grid,{children:A.jsxs(rn,{variant:"formSectionTitle",children:[i("tag")," "]})}),A.jsx(ue.Grid,{children:A.jsx(ue.TextField,{id:"outlined-basic",label:i("your_tag_here"),value:c.body.value,variant:"outlined",onChange:S=>g(S.target.value)})}),A.jsx(ue.Grid,{children:A.jsx(Noe,{onChangeTarget:v,playerReferences:t,spatialTarget:!0,target:c.maeData.target,windowId:a})}),A.jsx(ue.Grid,{children:A.jsx(Doe,{closeFormCompanionWindow:e,saveAnnotation:y,t:i,annotationState:c})})]})}jL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const{AnnotationFormFooter:Loe,TargetFormSection:koe,TextCommentInput:Poe}=Fc,joe="Annotation",Foe=mO;function FL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){let s=n;s.id?s.maeData.target.drawingState&&typeof s.maeData.target.drawingState=="string"&&(s.maeData.target.drawingState=JSON.parse(s.maeData.target.drawingState)):s={body:{id:Ja(),type:"TextualBody",value:""},maeData:{target:null,templateType:gn.TEXT_TYPE},motivation:"commenting",target:null};const[u,c]=D.useState(s),h=S=>{const E=u.body;E.value=S,c({...u,body:E})},g=S=>{h(S.content)},v=S=>{const E=u.maeData;E.target=S,c({...u,maeData:E})},y=()=>{qm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),u.body.value===void 0&&(u.body.value=joe),r(u)};return D.useEffect(()=>{},[u.maeData.target]),A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:2,children:[A.jsx(ue.Grid,{children:A.jsx(Poe,{comment:u.body.value,setComment:h,onChangeTemplate:g,t:i})}),A.jsx(ue.Grid,{children:A.jsx(koe,{onChangeTarget:v,playerReferences:t,spatialTarget:!0,target:u.maeData.target,windowId:a})}),A.jsx(ue.Grid,{children:A.jsx(Loe,{closeFormCompanionWindow:e,saveAnnotation:y,t:i,annotationState:u})})]})}FL.propTypes={annotation:C.object.isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const xd=n=>n===Gi.IMAGE,Qy=(n,e=[])=>{const t=[{Component:kL,convertToAnnotation:woe,description:n("textual_note_with_target"),icon:A.jsx(QG,{}),id:gn.MULTIPLE_BODY_TYPE,isCompatibleWithMediaType:xd,label:n("note"),selectable:!0},{Component:jL,convertToAnnotation:Moe,description:n("tag_with_target"),icon:A.jsx(eH,{fontSize:"small"}),id:gn.TAGGING_TYPE,isCompatibleWithMediaType:xd,label:n("tag"),selectable:!0},{Component:ML,convertToAnnotation:moe,description:n("poi_description"),icon:A.jsx(nH,{fontSize:"small"}),id:gn.POI_TYPE,isCompatibleWithMediaType:xd,label:n("poi"),selectable:!0},{Component:PL,convertToAnnotation:Ooe,description:n("nested_map_description"),icon:A.jsx(tO,{fontSize:"small"}),id:gn.NESTED_MAP_TYPE,isCompatibleWithMediaType:xd,label:n("nested_map"),selectable:!0},{Component:LL,convertToAnnotation:Soe,description:n("journey_description"),icon:A.jsx(iO,{fontSize:"small"}),id:gn.JOURNEY_TYPE,isCompatibleWithMediaType:xd,label:n("journey"),selectable:!0},{Component:RL,convertToAnnotation:roe,description:n("edit_iiif_json_code"),icon:A.jsx(tH,{fontSize:"small"}),id:gn.IIIF_TYPE,isCompatibleWithMediaType:xd,label:n("expert_mode"),selectable:!0},{Component:FL,convertToAnnotation:Foe,description:"",icon:null,id:gn.TEXT_TYPE,isCompatibleWithMediaType:xd,label:"",selectable:!1}],r=new Set(t.map(a=>a.id)),i=e.filter(a=>r.has(a.id)?(console.warn(`Ignoring external annotation template with id "${a.id}": it collides with a built-in template id.`),!1):typeof a.id!="string"||typeof a.Component!="function"||typeof a.convertToAnnotation!="function"||typeof a.isCompatibleWithMediaType!="function"?(console.warn(`Ignoring external annotation template with id "${a.id}": it does not follow the TEMPLATE_REGISTRY contract (id: string, Component/convertToAnnotation/isCompatibleWithMediaType: function are all required).`),!1):!0);return[...t,...i]},BL=(n,e=[],t=null)=>Qy(n,e).filter(r=>r.selectable).filter(r=>!Array.isArray(t)||t.length===0?!0:t.includes(r.id)),$g=(n,e,t=[])=>Qy(n,t).find(r=>r.id===e),Boe=n=>n["dbf:kind"]==="Journey"?gn.JOURNEY_TYPE:n["dbf:linkedMap"]?gn.NESTED_MAP_TYPE:gn.POI_TYPE,GL="maps-annotation-list",Goe={name:GL,put:!0},Hoe={name:GL,put:(n,e,t)=>t.getAttribute("data-kind")==="POI"};function HL({journeyId:n,persist:e,pois:t,recomputeAndPersistJourney:r,renderRow:i}){const a=D.useRef(!1),s=D.useRef(0),[u,c]=D.useState(t);D.useEffect(()=>{a.current||s.current>0||c(t)},[t]);const h=D.useCallback(()=>{a.current=!0},[]),g=D.useCallback(()=>{a.current=!1},[]),v=D.useCallback(y=>{const S=y.map((O,_)=>uO(O,n,_));c(S),s.current+=1;let E;S.reduce((O,_)=>O.then(()=>e(_).then(w=>{E=w})),Promise.resolve()).then(()=>E?r(n,E.items):void 0).finally(()=>{s.current-=1})},[n,e,r]);return A.jsx(DO.ReactSortable,{animation:150,forceFallback:!0,group:Hoe,list:u,onEnd:g,onStart:h,setList:v,tag:"ul",style:{listStyle:"none",margin:0,paddingInlineStart:24},children:u.map(y=>A.jsx("li",{style:{listStyle:"none"},"data-kind":"POI",children:i(y)},y.id))})}HL.propTypes={journeyId:C.string.isRequired,persist:C.func.isRequired,pois:C.arrayOf(C.object).isRequired,recomputeAndPersistJourney:C.func.isRequired,renderRow:C.func.isRequired};function o3({canvasId:n,deselectAnnotation:e,hoverAnnotation:t,hoveredAnnotationIds:r=[],index:i,items:a=[],label:s,receiveAnnotation:u,selectAnnotation:c,selectedAnnotationId:h,storageAdapter:g,totalSize:v,windowId:y}){const{i18n:S,t:E}=Gs.useTranslation(),O=D.useMemo(()=>{const ie=new Map;return Qy(E).forEach(K=>ie.set(K.id,K)),ie},[E]),_=D.useMemo(()=>lO(a),[a]),w=D.useMemo(()=>_.map(ie=>ie.item),[_]),N=D.useMemo(()=>{const ie=new Map;return _.forEach(K=>{K.kind==="Journey"&&ie.set(K.id,K.pois)}),ie},[_]),L=D.useRef(!1),P=D.useRef(0),[H,B]=D.useState(w);D.useEffect(()=>{L.current||P.current>0||B(w)},[w]);const G=D.useCallback(()=>{L.current=!0},[]),V=D.useCallback(()=>{L.current=!1},[]),Z=D.useRef(Promise.resolve()),X=D.useCallback(ie=>{const K=g(n),oe=()=>K.update(ie).then(ge=>(u(n,K.annotationPageId,ge),ge)),se=Z.current.then(oe,oe);return Z.current=se.catch(()=>{}),se},[g,n,u]),k=D.useCallback((ie,K)=>{if(!ie)return Promise.resolve();const oe=CE(ie,K);if(!oe)return Promise.resolve();const se=(K??[]).find(ge=>ge.id===ie);return se&&JSON.stringify(se.target)===JSON.stringify(oe.target)?Promise.resolve():X(oe)},[X]),z=D.useCallback(ie=>{const K=new Set(ie.map(ge=>ge["dbf:journey"]?.id).filter(Boolean)),oe=ie.map((ge,pe)=>dA(ge,pe));B(oe),P.current+=1;let se;oe.reduce((ge,pe)=>ge.then(()=>X(pe).then(Ae=>{se=Ae})),Promise.resolve()).then(()=>{if(se)return Promise.all([...K].map(ge=>k(ge,se.items)))}).finally(()=>{P.current-=1})},[X,k]),q=D.useCallback(ie=>{window.getSelection()?.toString()||(h===ie?e(y,ie):c(y,ie))},[y,e,c,h]),te=D.useMemo(()=>_.filter(ie=>ie.kind==="Journey").map(ie=>({id:ie.id,title:cA(ie.item,S.language)||"—"})),[_,S.language]),ee=D.useCallback((ie,K)=>{const oe=ie["dbf:journey"]?.id??null,se=K?uO(ie,K,(N.get(K)??[]).length):dA(ie,H.length);X(se).then(ge=>{if(!ge)return;const pe=new Set([K,oe].filter(Boolean));return Promise.all([...pe].map(Ae=>k(Ae,ge.items)))})},[N,X,H.length,k]),$=ie=>{const K=cA(ie,S.language)||"—",oe=r.includes(ie.id)||h===ie.id,se=ie["dbf:kind"]==="Journey",ge=O.get(Boe(ie))?.icon;let pe;return oe?pe="rgba(0, 0, 0, 0.04)":se&&(pe="rgba(0, 0, 0, 0.02)"),A.jsxs(Cy,{annotationid:ie.id,currentJourneyId:se?void 0:ie["dbf:journey"]?.id??null,"data-kind":ie["dbf:kind"],journeys:se?void 0:te,onClick:()=>q(ie.id),onMoveToJourney:se?void 0:Ae=>ee(ie,Ae),onMouseEnter:()=>t(y,[ie.id]),onMouseLeave:()=>t(y,[]),style:{alignItems:"center",backgroundColor:pe,cursor:"pointer",display:"flex",gap:8,listStyle:"none",padding:"8px 16px"},children:[ge&&A.jsx("span",{style:{display:"inline-flex",flexShrink:0},children:ge}),A.jsx(rn,{variant:se?"subtitle2":"body2",children:K})]},ie.id)};return H.length===0?null:A.jsxs(A.Fragment,{children:[A.jsx(rn,{sx:{paddingLeft:2,paddingRight:1,paddingTop:2},variant:"overline",children:E("annotationCanvasLabel",{context:`${i+1}/${v}`,label:s})}),A.jsx(DO.ReactSortable,{animation:150,forceFallback:!0,group:Goe,list:H,onEnd:V,onStart:G,setList:z,tag:"ul",style:{listStyle:"none",margin:0,padding:0},children:H.map(ie=>ie["dbf:kind"]==="Journey"?A.jsxs("li",{style:{listStyle:"none"},"data-kind":"Journey",children:[$(ie),A.jsx(HL,{journeyId:ie.id,persist:X,pois:N.get(ie.id)??[],recomputeAndPersistJourney:k,renderRow:$})]},ie.id):A.jsx("li",{style:{listStyle:"none"},"data-kind":"POI",children:$(ie)},ie.id))})]})}o3.propTypes={canvasId:C.string.isRequired,deselectAnnotation:C.func.isRequired,hoverAnnotation:C.func.isRequired,hoveredAnnotationIds:C.arrayOf(C.string),index:C.number.isRequired,items:C.arrayOf(C.object),label:C.string.isRequired,receiveAnnotation:C.func.isRequired,selectAnnotation:C.func.isRequired,selectedAnnotationId:C.string,storageAdapter:C.func.isRequired,totalSize:C.number.isRequired,windowId:C.string.isRequired};o3.defaultProps={hoveredAnnotationIds:[],items:[],selectedAnnotationId:void 0};const v5=n=>{if(!n)return!1;const e=getComputedStyle(n),t=e.overflowY||e.overflow||"";return/(auto|scroll|overlay)/.test(t)&&n.scrollHeight>n.clientHeight},zoe=n=>{let e=n?.parentElement||null;for(;e;){if(v5(e))return e;e=e.parentElement}return null},qoe=()=>document.scrollingElement||document.documentElement;function Uoe(n,e,t){const r=n.getBoundingClientRect(),i=e.getBoundingClientRect(),a=i.top-r.top+n.scrollTop,s=i.bottom-r.top+n.scrollTop,u=n.scrollTop+t,c=n.scrollTop+n.clientHeight,h=a<u,g=s>c;return!h&&!g?null:h?a-t:Math.max(s-n.clientHeight,a-t)}function Voe(n,e){const t=n.getBoundingClientRect(),r=t.top+window.scrollY,i=t.bottom+window.scrollY,a=window.scrollY+e,s=window.scrollY+window.innerHeight,u=r<a,c=i>s;return!u&&!c?null:u?r-e:Math.max(i-window.innerHeight,r-e)}const Woe=(n,e,t)=>new Promise(r=>{const i="smooth";requestAnimationFrame(()=>{requestAnimationFrame(()=>{let s=e.current;if(v5(s)||(s=zoe(n)),v5(s)||(s=qoe()),s===document.body||s===document.documentElement||s===document.scrollingElement){const g=Voe(n,96);if(g==null)return r(!0);const v=window.scrollY;window.scrollTo({behavior:i,top:g}),setTimeout(()=>{const y=window.scrollY;r(Math.abs(y-v)>.5)},t);return}const c=Uoe(s,n,96);if(c==null)return r(!0);const h=s.scrollTop;typeof s.scrollTo=="function"&&s.scrollTo({behavior:i,top:c}),setTimeout(()=>{const g=s.scrollTop;r(Math.abs(g-h)>.5)},t)})})}),Xoe=async(n,e)=>{for(let i=0;i<=3&&!await Woe(n,e,24);i++)i<3&&await new Promise(s=>{setTimeout(s,24)})};function zL({addCompanionWindow:n,annotationsOnCanvases:e={},canvases:t=[],config:r,deselectAnnotation:i,highlightAllAnnotations:a,receiveAnnotation:s,switchToSingleCanvasView:u,TargetComponent:c,targetProps:h,updateWindow:g,windowViewType:v,annotationEditCompanionWindowIsOpened:y,annotationPreviewCompanionWindowIsOpened:S}){const[E,O]=D.useState(!1),{t:_}=Gs.useTranslation(),w=D.useRef(null),N=D.useRef(null);D.useEffect(()=>{const z=h?.selectedAnnotationId;if(!z)return;const q=w.current?.querySelector(`li[annotationid="${z}"]`)||w.current?.querySelector("li.MuiMenuItem-root.Mui-selected");q&&Xoe(q,N)},[h?.selectedAnnotationId]);const L=D.useCallback(()=>{O(z=>!z)});D.useEffect(()=>{px.isInitialized&&r.translations&&(Object.keys(r.translations).forEach(z=>{px.addResourceBundle(z,"translation",r.translations[z],!0,!0)}),r.language&&px.changeLanguage(r.language))},[r.translations,r.language]);const{editMode:P}=RV(r);D.useEffect(()=>{P&&!a&&g({highlightAllAnnotations:!0})},[P,a,g]);const H=D.useCallback(z=>z?t.some(q=>{const te=e[q.id];return te?Object.values(te).some(ee=>ee.json&&ee.json.items?ee.json.items.some($=>$.id===z&&$.maeData):!1):!1}):!1,[t,e]),B=D.useRef(y);D.useEffect(()=>{const z=!B.current,q=y;B.current=y,P&&z&&q&&i()},[P,y,i]);const G=D.useRef(null);D.useEffect(()=>{if(!P)return;const z=h?.selectedAnnotationId;z!==G.current&&(G.current=z,z&&y&&H(z)&&n("annotationCreation",{annotationid:z,position:"right"}))},[P,h?.selectedAnnotationId,y,H,n]);const V={containerRef:N,...h,listContainerComponent:Cy},Z=D.useMemo(()=>{const z=h?.canvasId;return!z||!e[z]?[]:Object.values(e[z]).flatMap(q=>q?.json?.items??[])},[h?.canvasId,e]),X=Z.some(z=>z["dbf:kind"]==="POI"||z["dbf:kind"]==="Journey"),k=D.useMemo(()=>({addCompanionWindow:n,annotationEditCompanionWindowIsOpened:y,annotationPreviewCompanionWindowIsOpened:S,annotationsOnCanvases:e,canvases:t,config:r,receiveAnnotation:s,storageAdapter:r.annotation.adapter,t:_,toggleSingleCanvasDialogOpen:L,windowId:h.windowId,windowViewType:v}),[n,y,S,e,t,r,s,_,L,h.windowId,v]);return A.jsxs(aO.Provider,{value:k,children:[A.jsx("div",{ref:w,style:{height:"100%",position:"relative"},children:X?A.jsx(o3,{canvasId:h.canvasId,deselectAnnotation:h.deselectAnnotation,hoverAnnotation:h.hoverAnnotation,hoveredAnnotationIds:h.hoveredAnnotationIds,index:h.index,items:Z,label:h.label,receiveAnnotation:s,selectAnnotation:h.selectAnnotation,selectedAnnotationId:h.selectedAnnotationId,storageAdapter:r.annotation.adapter,totalSize:h.totalSize,windowId:h.windowId}):A.jsx(c,{...V})}),v!=="single"&&A.jsx(x5,{handleClose:L,open:E,switchToSingleCanvasView:u})]})}zL.propTypes={addCompanionWindow:C.func.isRequired,annotationEditCompanionWindowIsOpened:C.bool.isRequired,annotationPreviewCompanionWindowIsOpened:C.bool.isRequired,annotationsOnCanvases:C.shape({id:C.string,isFetching:C.bool,json:C.shape({id:C.string,items:C.arrayOf(C.shape({body:C.shape({format:C.string,id:C.string,value:C.string}),drawingState:C.string,id:C.string,manifestNetwork:C.string,motivation:C.string,target:C.string,type:C.string})),type:C.string})}).isRequired,canvases:C.arrayOf(C.shape({id:C.string,index:C.number})).isRequired,config:C.shape({annotation:C.shape({adapter:C.func,editMode:C.bool}),language:C.string,translations:C.objectOf(C.object)}).isRequired,deselectAnnotation:C.func.isRequired,highlightAllAnnotations:C.bool.isRequired,receiveAnnotation:C.func.isRequired,switchToSingleCanvasView:C.func.isRequired,t:C.func.isRequired,TargetComponent:C.oneOfType([C.func,C.node]).isRequired,targetProps:C.object.isRequired,updateWindow:C.func.isRequired,windowViewType:C.string.isRequired};function Yoe(n,{targetProps:{windowId:e}}){const t=Pt.getVisibleCanvases(n,{windowId:e}),r={},i=Pt.getCompanionWindowsForContent(n,{content:"annotationCreation",windowId:e}),a=Object.keys(i).length===0,s=Pt.getCompanionWindowsForContent(n,{content:"mapsPoiPreview",windowId:e}),u=Object.keys(s).length===0;return t.forEach(c=>{const h=n.annotations[c.id];h&&(r[c.id]=h)}),{annotationEditCompanionWindowIsOpened:a,annotationPreviewCompanionWindowIsOpened:u,annotationsOnCanvases:r,canvases:t,config:{...n.config,translations:S5},highlightAllAnnotations:Pt.getWindow(n,{windowId:e}).highlightAllAnnotations,windowViewType:Pt.getWindowViewType(n,{windowId:e})}}const Zoe=(n,e)=>({addCompanionWindow:(t,r)=>n(Pt.addCompanionWindow(e.targetProps.windowId,{content:t,...r})),deselectAnnotation:()=>n(Pt.deselectAnnotation(e.targetProps.windowId)),receiveAnnotation:(t,r,i)=>n(Pt.receiveAnnotation(t,r,i)),switchToSingleCanvasView:()=>n(Pt.setWindowViewType(e.targetProps.windowId,"single")),updateWindow:t=>n(Pt.updateWindow(e.targetProps.windowId,t))}),qL={component:zL,mapDispatchToProps:Zoe,mapStateToProps:Yoe,mode:"wrap",target:"CanvasAnnotations"};function UL({mediaType:n,setCommentingType:e}){const{t}=Gs.useTranslation(),r=u=>e(u),{enabledTemplateTypes:i,externalTemplates:a}=$a.useSelector(u=>Pt.getConfig(u)).annotation,s=BL(t,a,i);return A.jsx(Joe,{children:n===Gi.AUDIO?A.jsx(ue.Grid,{container:!0,spacing:1,direction:"column",children:A.jsx(ue.Grid,{children:A.jsx(rn,{children:t("audio_not_supported")})})}):s.map(u=>u.isCompatibleWithMediaType(n)&&A.jsx(Koe,{children:A.jsx($oe,{id:u.id,onClick:()=>r(u),children:A.jsxs(ue.CardContent,{children:[A.jsxs(Qoe,{component:"div",children:[t(u.label),u.icon]}),A.jsx(ele,{component:"div",variant:"body2",children:t(u.description)})]})})},u.id))})}const Joe=xs.styled("div")(({theme:n})=>({display:"flex",flexDirection:"column",gap:n.spacing(3.75),margin:n.spacing(1.25)})),Koe=xs.styled(ue.Card)(({theme:n})=>({borderRadius:n.shape.borderRadius,boxShadow:n.shadows[1],border:`1px solid ${xs.alpha(n.palette.primary?.main??"#5A8264",.25)}`,transition:"box-shadow 120ms ease, transform 120ms ease, border-color 120ms ease","&:hover":{boxShadow:n.shadows[3],borderColor:xs.alpha(n.palette.primary?.main??"#5A8264",.5),transform:"translateY(-1px)"}})),$oe=xs.styled(ue.CardActionArea)(({theme:n})=>({borderRadius:n.shape.borderRadius,"&:hover":{backgroundColor:xs.alpha(n.palette.primary?.main??"#5A8264",.06)}})),Qoe=xs.styled(rn)(({theme:n})=>{const e=n.typography.formSectionTitle??{};return{display:"flex",justifyContent:"space-between",alignItems:"center",gap:n.spacing(1),color:e.color??n.palette.primary?.main??"#5A8264",fontSize:e.fontSize??n.typography.h6.fontSize,fontWeight:e.fontWeight??600,letterSpacing:e.letterSpacing??"0.02em",textTransform:e.textTransform??"none",lineHeight:1.25,marginBottom:n.spacing(.5)}}),ele=xs.styled(rn)(({theme:n})=>{const e=n.typography.subFormSectionTitle??{};return{color:n.palette.text.secondary,fontSize:e.fontSize??n.typography.body2.fontSize,fontWeight:e.fontWeight??300,letterSpacing:e.letterSpacing??0,lineHeight:e.lineHeight??n.typography.body2.lineHeight,textTransform:e.textTransform??"none"}});UL.propTypes={mediaType:C.string.isRequired,setCommentingType:C.func.isRequired};const tle=dr.createSvgIcon(A.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");function VL({templateType:n,setCommentingType:e,annotation:t}){const r=()=>{e(null)};return A.jsxs(ue.Grid,{container:!0,direction:"row",alignItems:"center",justifyContent:"space-between",sx:{marginRight:"10px"},spacing:2,children:[A.jsx(ue.Grid,{children:t.id==null&&A.jsx(Pt.MiradorMenuButton,{"aria-label":"back",TooltipProps:{title:"back"},children:A.jsx(tle,{onClick:r})})}),A.jsx(ue.Grid,{children:n.icon})]})}VL.propTypes={annotation:C.oneOfType([C.shape({body:C.shape({format:C.string,id:C.string,type:C.string,value:C.string}),drawingState:C.string,id:C.string,manifestNetwork:C.string,motivation:C.string,target:C.string}),C.string]).isRequired,setCommentingType:C.func.isRequired,templateType:C.shape({description:C.string,icon:C.element,id:C.string,label:C.string}).isRequired};function WL({playerReferences:n,t:e}){return A.jsxs(A.Fragment,{children:[A.jsx("h4",{children:"Debug info "}),A.jsx("p",{children:"Only visible in debug mode"}),A.jsx(rn,{children:n.getMediaType()}),A.jsxs(rn,{children:[e("scale"),":",n.getScale()]}),A.jsxs(rn,{children:[e("zoom"),":",n.getZoom()]}),A.jsxs(rn,{children:[e("image_true_size"),":",n.getMediaTrueWidth()," ","x",n.getMediaTrueHeight()]}),A.jsxs(rn,{children:[e("container_size"),":",n.getContainerWidth()," ","x",n.getContainerHeight()]}),A.jsxs(rn,{children:[e("image_displayed"),":",n.getDisplayedMediaWidth()," ","x",n.getDisplayedMediaHeight()]})]})}WL.propTypes={playerReferences:C.any.isRequired,t:C.func.isRequired};function XL({annotation:n,canvases:e,closeFormCompanionWindow:t,playerReferences:r,saveAnnotation:i,templateType:a,windowId:s}){const{t:u}=Gs.useTranslation(),c=$a.useSelector(y=>Pt.getConfig(y)).annotation,h=c.debug??!1,{externalTemplates:g}=c,v=D.useMemo(()=>Qy(u,g).find(y=>y.id===a.id)?.Component,[u,a.id,g]);return A.jsxs(ue.Grid,{container:!0,direction:"column",children:[A.jsx(nle,{children:v&&A.jsx(v,{annotation:n,canvases:e,closeFormCompanionWindow:t,playerReferences:r,saveAnnotation:i,t:u,windowId:s})}),h&&A.jsx(WL,{playerReferences:r,t:u})]})}const nle=xs.styled(ue.Grid)({margin:"0 10px"});XL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,canvases:C.arrayOf(C.shape({id:C.string,index:C.number})).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,templateType:C.shape({description:C.string,icon:C.element,id:C.string,label:C.string}).isRequired,windowId:C.string.isRequired};function YL({id:n,windowId:e,mediaType:t}){const{t:r}=Gs.useTranslation();return A.jsx(Pt.CompanionWindow,{title:r("media_not_supported"),windowId:e,id:n,children:A.jsxs(ue.Grid,{container:!0,padding:1,spacing:1,children:[A.jsx(ue.Grid,{children:A.jsx(rn,{children:r("media_not_supported")})}),A.jsx(ue.Grid,{children:A.jsx(rn,{children:r("detected_media_type",{mediaType:t})})})]})})}YL.propTypes={id:C.string.isRequired,mediaType:C.string.isRequired,windowId:C.string.isRequired};function ZL({annotation:n,canvases:e,closeCompanionWindow:t,config:r,id:i,playerReferences:a,receiveAnnotation:s,windowId:u}){const{t:c}=Gs.useTranslation(),{enabledTemplateTypes:h,externalTemplates:g}=r.annotation,[v,y]=D.useState(null),[S,E]=D.useState(a.getMediaType()),[O,_]=D.useState(0),[,w]=D.useReducer(G=>G+1,0);!a.isInitializedCorrectly()&&O<10&&(console.log("AnnotationForm.js: retryCount",O),setTimeout(()=>{_(O+1),w()},100));const[N,L]=D.useState({height:window.innerHeight,width:window.innerWidth});if(!v)if(n.id)n.maeData&&n.maeData.templateType?y($g(c,n.maeData.templateType,g)??$g(c,gn.IIIF_TYPE)):y($g(c,gn.IIIF_TYPE));else{const{defaultForm:G}=Ym(r),V=BL(c,g,h).filter(Z=>Z.isCompatibleWithMediaType(S));G&&gA[G]?y($g(c,gA[G])):V.length===1&&y(V[0])}if(D.useEffect(()=>{y(null),E(a.getMediaType())},[e[0].index]),D.useEffect(()=>{const G=()=>{L({height:window.innerHeight,width:window.innerWidth})};return window.addEventListener("resize",G),()=>{window.removeEventListener("resize",G)}},[]),a.isInitCorrectly||a.isInitializedCorrectly(),!a.isInitCorrectly)return A.jsx(YL,{id:i,mediaType:S,windowId:u});const P=D.useCallback(()=>{t("annotationCreation",{id:i,position:"right"})},[t,i]),H=D.useRef(n);H.current=n;const B=G=>{const V=G,Z=V?.maeData?.templateType?$g(c,V.maeData.templateType,g):void 0,X=a.getCanvases().map(async k=>{let z;V?.maeData&&V.maeData.templateType?z=Z?await Z.convertToAnnotation(V,{canvas:k,playerReferences:a,windowId:u}):await rG(V,k,u,a):z=V;const q=r.annotation.adapter(k.id);return BB(k.id,q,s,z)});return Promise.all(X).then(()=>{P()})};return A.jsx(Pt.ConnectedCompanionWindow,{title:n.id?c("edit_annotation"):c("new_annotation"),windowId:u,id:i,children:v===null?A.jsx(UL,{setCommentingType:y,mediaType:S}):A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:1,children:[A.jsx(ue.Grid,{container:!0,children:A.jsx(VL,{setCommentingType:y,templateType:v,annotation:n})}),A.jsx(ue.Grid,{children:A.jsx(XL,{annotation:n,canvases:e,closeFormCompanionWindow:P,playerReferences:a,saveAnnotation:B,templateType:v,windowId:u})})]})})}ZL.propTypes={annotation:C.oneOfType([C.shape({body:C.shape({format:C.string,id:C.string,type:C.string,value:C.string}),drawingState:C.string,id:C.string,manifestNetwork:C.string,motivation:C.string,target:C.string}),C.string]).isRequired,canvases:C.arrayOf(C.shape({id:C.string})).isRequired,closeCompanionWindow:C.func.isRequired,config:C.shape({annotation:C.shape({adapter:C.func,debug:C.bool,defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),enabledTemplateTypes:C.arrayOf(C.string),externalTemplates:C.arrayOf(C.object)}),language:C.string,translations:C.objectOf(C.object)}).isRequired,id:C.string.isRequired,playerReferences:C.object.isRequired,receiveAnnotation:C.func.isRequired,windowId:C.string.isRequired};class rle{actions;mediaType;canvases;windowId;overlay;isInitCorrectly;constructor(e,t,r,i){this.actions=i,this.media=r,this.mediaType=ile(e,t),this.canvases=Pt.getVisibleCanvases(e,{windowId:t}),this.windowId=t,this.isInitCorrectly=!1,this.isInitializedCorrectly()&&(this.mediaType===Gi.IMAGE?this.overlay={canvasHeight:this.media.current.canvas.clientHeight,canvasWidth:this.media.current.canvas.clientWidth,containerHeight:this.media.current.canvas.clientHeight,containerWidth:this.media.current.canvas.clientWidth}:console.error("Unknown media type"))}sleep(e){return new Promise(t=>{setTimeout(t,e)})}isInitializedCorrectly(){return this.isInitCorrectly=this.media&&(this.mediaType===Gi.IMAGE&&this.media.current&&this.media.current.canvas||this.mediaType===Gi.VIDEO&&this.media.video)&&this.mediaType!==Gi.UNKNOWN&&this.mediaType!==Gi.AUDIO,this.isInitCorrectly}getMediaType(){return this.mediaType}getCanvases(){return this.canvases}getAudioElement(){return this.mediaType===Gi.AUDIO?document.querySelector("audio"):(console.error("Something is wrong with audio ressource"),null)}getWindowId(){return this.windowId}getCanvasHeight(){return this.overlay.canvasHeight}getCanvasWidth(){return this.overlay.canvasWidth}getContainer(){return this.mediaType===Gi.IMAGE?this.media.current.container:null}getContainerHeight(){return this.overlay.containerHeight}getContainerWidth(){return this.overlay.containerWidth}getDisplayedMediaHeight(){if(this.mediaType===Gi.IMAGE){const e=this.media.current;if(e){const t=this.getMediaTrueHeight()*e.viewport.getZoom(),r=e.container.clientWidth;return Math.round(r*t)}}}getDisplayedMediaWidth(){if(this.mediaType===Gi.IMAGE){const e=this.media.current;if(e&&e.world.getItemCount()>0){const t=this.getMediaTrueWidth()*e.viewport.getZoom(),r=e.container.clientWidth;return Math.round(r*t)}}}getMediaTrueHeight(){if(this.mediaType===Gi.IMAGE)return this.canvases[0].__jsonld.height;console.error("Unknown media type")}getMediaTrueWidth(){if(this.mediaType===Gi.IMAGE)return this.canvases[0].__jsonld.width}getScale(){return this.isInitializedCorrectly()?this.getDisplayedMediaWidth()/this.getMediaTrueWidth():null}getZoom(){if(this.mediaType===Gi.IMAGE){const e=this.media.current.viewport.getZoom(),t=this.media.current.viewport.getMaxZoom();let r=e/t;return r=Math.round(r*100)/100,r}}getImagePosition(){if(this.mediaType===Gi.IMAGE){const e=this.media.current;if(e){const r=e.world.getItemAt(0).getBounds(),i=e.viewport.viewportToViewerElementCoordinates(r.getTopLeft());return{x:Math.round(i.x),y:Math.round(i.y)}}}}getTargetStrokeWidth(){return Math.max(this.getDisplayedMediaWidth()/500,3)}}function ile(n,e){const t=Pt.getVisibleCanvasAudioResources(n,{windowId:e})||[];return(Pt.getVisibleCanvasVideoResources(n,{windowId:e})||[]).length>0?Gi.VIDEO:t.length>0?Gi.AUDIO:Gi.IMAGE}const ale=(n,{id:e,windowId:t})=>({closeCompanionWindow:()=>n(Pt.removeCompanionWindow(t,e)),receiveAnnotation:(r,i,a)=>n(Pt.receiveAnnotation(r,i,a))});function sle(n,{id:e,windowId:t}){const i=Pt.getCompanionWindow(n,{companionWindowId:e,windowId:t}),{annotationid:a}=i,s=Pt.OSDReferences.get(t),u=new rle(n,t,s,XF),c=Pt.getVisibleCanvases(n,{windowId:t});let h=Pt.getPresentAnnotationsOnSelectedCanvases(n,{windowId:t}).flatMap(g=>g.json.items||[]).find(g=>g.id===a);return h||(h={id:null,maeData:{templateType:null}}),{annotation:h,canvases:c,config:{...n.config,translations:S5},currentTime:null,playerReferences:u}}const JL={companionWindowKey:"annotationCreation",component:ZL,mapDispatchToProps:ale,mapStateToProps:sle};function KL({PluginComponents:n=[],TargetComponent:e,targetProps:t}){return t.hasAnyAnnotations=!0,A.jsx(e,{...t,PluginComponents:n})}KL.propTypes={PluginComponents:C.array.isRequired,TargetComponent:C.oneOfType([C.func,C.node]).isRequired,targetProps:C.object.isRequired};const $L={component:KL,mode:"wrap",target:"WindowSideBarButtons"};var QL=function(e){return"@@redux-saga/"+e},ole=QL("IO"),lle=QL("MULTICAST"),ule=function(e){return e==null},cle=function(e){return e!==void 0},kd=function(e){return typeof e=="function"},ek=function(e){return typeof e=="string"},tk=Array.isArray,y5=function(e){return e&&(ek(e)||fle(e)||kd(e)||tk(e)&&e.every(y5))},l3=function(e){return e&&kd(e.take)&&kd(e.close)},dle=function(e){return kd(e)&&e.hasOwnProperty("toString")},fle=function(e){return!!e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype},hle=function(e){return l3(e)&&e[lle]},ple=function(e){return e},gle=function(e){throw e},mle=function(e){return{value:e,done:!0}};function vle(n,e,t){e===void 0&&(e=gle),t===void 0&&(t="iterator");var r={meta:{name:t},next:n,throw:e,return:mle,isSagaIterator:!0};return typeof Symbol<"u"&&(r[Symbol.iterator]=function(){return r}),r}var mE="TAKE",yle="PUT",ble="ALL",xle="CALL",Sle="FORK",Cle="SELECT",Rc=function(e,t){var r;return r={},r[ole]=!0,r.combinator=!1,r.type=e,r.payload=t,r};function _le(n,e){if(n===void 0&&(n="*"),y5(n))return Rc(mE,{pattern:n});if(hle(n)&&cle(e)&&y5(e))return Rc(mE,{channel:n,pattern:e});if(l3(n))return Rc(mE,{channel:n})}function Ele(n,e){return ule(e)&&(e=n,n=void 0),Rc(yle,{channel:n,action:e})}function Tle(n){var e=Rc(ble,n);return e.combinator=!0,e}function nk(n,e){var t=null,r;return kd(n)?r=n:(tk(n)?(t=n[0],r=n[1]):(t=n.context,r=n.fn),t&&ek(r)&&kd(t[r])&&(r=t[r])),{context:t,fn:r,args:e}}function rk(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Rc(xle,nk(n,t))}function ik(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Rc(Sle,nk(n,t))}function wle(n){n===void 0&&(n=ple);for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Rc(Cle,{selector:n,args:t})}var G7=function(e){return{done:!0,value:e}},vE={};function Ale(n){return l3(n)?"channel":dle(n)?String(n):kd(n)?n.name:String(n)}function Rle(n,e,t){var r,i,a,s=e;function u(c,h){if(s===vE)return G7(c);if(h&&!i)throw s=vE,h;r&&r(c);var g=h?n[i](h):n[s]();return s=g.nextState,a=g.effect,r=g.stateUpdater,i=g.errorState,s===vE?G7(c):a}return vle(u,function(c){return u(null,c)},t)}function Ile(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];var a={done:!1,value:_le(n)},s=function(g){return{done:!1,value:ik.apply(void 0,[e].concat(r,[g]))}},u,c=function(g){return u=g};return Rle({q1:function(){return{nextState:"q2",effect:a,stateUpdater:c}},q2:function(){return{nextState:"q1",effect:s(u)}}},"q1","takeEvery("+Ale(n)+", "+e.name+")")}function Ole(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];return ik.apply(void 0,[Ile,n,e].concat(r))}function*Dle(n){const e=yield wle(Pt.getConfig);if(e&&e.annotation.adapter){const t=e.annotation.adapter(n),r=yield rk([t,t.all]);r&&(yield Ele(Pt.receiveAnnotation(n,t.annotationPageId,r)))}}function*Nle(n){const{canvasId:e}=n;yield rk(Dle,e)}function*Mle(){yield Tle([Ole(Pt.ActionTypes.SET_CANVAS,Nle)])}const Lle={saga:Mle},kle=(n,e)=>{console.error(`AiinotateAdapter.${n} error: `,e)},Ple=async n=>{if(!n.ok)throw new Error(`Fetch error: response ${n.status} on url: ${n.url}`)};class jle{constructor(e,t,r,i){if(![2,3].includes(t))throw new Error(`AiiinotateAdapter: unrecognized value for 'iiifPresentationVersion'. expected one of [2,3], got '${t}'`);this.user=i||Y1,this.canvasId=r,this.iiifPresentationVersion=t,this.endpointUrl=e,this.endpointUrlAnnotations=`${this.endpointUrl}/annotations/${t}`,this.endpointUrlManifests=`${this.endpointUrl}/manifests/${t}`}getStorageAdapterUser(){return this.user}get annotationPageId(){return`${this.endpointUrlAnnotations}/search?canvasUri=${this.canvasId}`}maybeConvert(e){return this.iiifPresentationVersion===2?iG(e):e}handleResponse=async(e,t)=>(await Ple(t),this.all());handleError=(e,t)=>(kle(e,t),this.all());async create(e){return e=this.maybeConvert(e),fetch(`${this.endpointUrlAnnotations}/create`,{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async t=>await this.handleResponse("create",t)).catch(t=>this.handleError("create",t))}async update(e){return e=this.maybeConvert(e),fetch(`${this.endpointUrlAnnotations}/update`,{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async t=>await this.handleResponse("update",t)).catch(t=>this.handleError("update",t))}async delete(e){return fetch(`${this.endpointUrlAnnotations}/delete?uri=${e}`,{method:"DELETE"}).then(async t=>await this.handleResponse("delete",t)).catch(t=>this.handleError("delete",t))}async get(e){return await fetch(e)}async all(){let e=[],t=this.annotationPageId,r,i;for(;t&&t.length;)r=await fetch(this.annotationPageId),i=await r.json(),e=[...e,...i.resources],t=i.next;const a=await this.iiifPresentationVersion===2?sG(e,this.annotationPageId):e;return a.items=a.items.map(w5),a}}const Fle={AiiinotateAdapter:jle,LocalStorageAdapter:Z7},Ble=[K7,Q7,qL,JL,$L,Lle];exports.annotationAdapters=Fle;exports.annotationCreationCompanionWindowPlugin=JL;exports.canvasAnnotationsPlugin=qL;exports.convertIIIFAnnoToMaeData=w5;exports.default=Ble;exports.externalStorageAnnotationPlugin=Q7;exports.miradorAnnotationPlugin=K7;exports.templateKit=Fc;exports.windowSideBarButtonsPlugin=$L;
|
|
282
|
+
`+Xn),fr&&(Xn=tr(Xn)),Z&&Vn?ee(Xn):Xn},e.setConfig=function(){let ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Cs(ke),Kn=!0,Le=gt,tt=jt},e.clearConfig=function(){Oi=null,Kn=!1,Le=null,tt=null,Z=k,X=""},e.isValidAttribute=function(ke,Q,fe){Oi||Cs({});const Te=Wn(ke),Ye=Wn(Q);return xa(Te,Ye,fe)},e.addHook=function(ke,Q){typeof Q=="function"&&Ps(we,ke)&&Zg(we[ke],Q)},e.removeHook=function(ke,Q){if(Ps(we,ke)){if(Q!==void 0){const fe=Rse(we[ke],Q);return fe===-1?void 0:Ise(we[ke],fe,1)[0]}return T7(we[ke])}},e.removeHooks=function(ke){Ps(we,ke)&&(we[ke]=[])},e.removeAllHooks=function(){we=j7()},e}var eoe=TL();const toe=n=>eoe.sanitize(n);function wL({comment:n,onChangeTemplate:e,setComment:t,t:r}){const i=_=>A.jsx("div",{title:_.title,children:_.label}),s=$a.useSelector(_=>Pt.getConfig(_)).annotation.commentTemplates??[],[u,c]=D.useState(null),[h,g]=D.useState(""),[v,y]=D.useState(0),S=_=>{if(_){if(n.trim().length>0){c(_),g(n);return}e(_.value)}},E=()=>{e({...u.value,content:h}),c(null),g("")},O=()=>{c(null),g(""),y(_=>_+1)};return A.jsxs(A.Fragment,{children:[A.jsx(ue.Grid,{container:!0,children:A.jsx(ue.Typography,{variant:"formSectionTitle",children:r("note")})}),s.length>0&&A.jsx(ue.Grid,{style:{marginBottom:"10px"},children:A.jsx(SL,{options:s.map(_=>({label:_.title,title:_.content,value:_})),placeholder:r("useTemplate"),onChange:S,isClearable:!0,isSearchable:!0,formatOptionLabel:i,styles:{marginBottom:"20px"}},v)}),A.jsx(ue.Grid,{container:!0,children:A.jsx(dy,{text:n,setText:t})}),A.jsxs(ue.Dialog,{"aria-labelledby":"confirm-template-selection-title",fullWidth:!0,maxWidth:"sm",onClose:O,open:u!==null,children:[A.jsx(ue.DialogTitle,{id:"confirm-template-selection-title",children:A.jsx(ue.Typography,{variant:"h2",component:"span",children:r("confirmTemplateSelectionTitle")})}),A.jsxs(ue.DialogContent,{children:[A.jsx(ue.DialogContentText,{variant:"body1",color:"inherit",children:r("confirmTemplateSelectionContent")}),A.jsx(ue.Typography,{variant:"subtitle2",sx:{marginTop:"16px"},children:r("selectedTemplateContent")}),A.jsx(ue.Box,{sx:{border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:"4px",marginBottom:"16px",maxHeight:"150px",overflowY:"auto",padding:"8px 12px"},dangerouslySetInnerHTML:{__html:toe(u?.value.content??"")}}),A.jsx(ue.Typography,{variant:"subtitle2",children:r("currentNoteContent")}),A.jsx(dy,{text:h,setText:g})]}),A.jsxs(ue.DialogActions,{children:[A.jsx(ue.Button,{onClick:O,children:r("cancel")}),A.jsx(ue.Button,{color:"primary",onClick:E,variant:"contained",children:r("applyMerge")})]})]})]})}wL.propTypes={comment:C.string.isRequired,onChangeTemplate:C.func.isRequired,setComment:C.func.isRequired,t:C.func.isRequired};function AL({setTags:n,t:e,tags:t,tagsSuggestions:r}){return A.jsxs(A.Fragment,{children:[A.jsx(ue.Typography,{variant:"formSectionTitle",children:e("tags")}),A.jsx(SL,{isMulti:!0,options:r,value:t,onChange:n,closeMenuOnSelect:!1,placeholder:e("tagsPlaceholder")}),A.jsx(ue.Divider,{spacing:2})]})}AL.propTypes={setTags:C.func.isRequired,t:C.func.isRequired,tags:C.any.isRequired,tagsSuggestions:C.arrayOf(C.shape({label:C.string,value:C.string})).isRequired};const Fc={AnnotationFormFooter:k5,MultiTagsInput:AL,TargetFormSection:j4,TextCommentInput:wL,TextFormSection:GM},{AnnotationFormFooter:noe}=Fc,roe=async n=>n;function RL({annotation:n,canvases:e,closeFormCompanionWindow:t,saveAnnotation:r,t:i}){const[a,s]=D.useState(n),u=()=>{e.forEach(async c=>{r(a.newData,c.id)}),t()};return A.jsxs(A.Fragment,{children:[A.jsx(ue.Paper,{elevation:0,style:{minHeight:"300px"},children:A.jsx(jH,{data:a,onUpdate:s})}),A.jsx(noe,{closeFormCompanionWindow:t,saveAnnotation:u,t:i,annotationState:a})]})}RL.propTypes={annotation:C.shape({body:C.shape({format:C.string,id:C.string,type:C.string,value:C.string}),drawingState:C.string,id:C.string,maeData:C.object,manifestNetwork:C.string,motivation:C.string,target:C.string}).isRequired,canvases:C.arrayOf(C.object).isRequired,closeFormCompanionWindow:C.func.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired};function n0({contentLocales:n,label:e,onChange:t,value:r}){return n.length<2?null:A.jsx(xy,{"aria-label":e,exclusive:!0,onChange:(i,a)=>{a!==null&&t(a)},size:"small",value:r??null,children:n.map(({code:i,name:a})=>A.jsx(Si,{"aria-label":a??i,value:i,children:i.toUpperCase()},i))})}n0.propTypes={contentLocales:C.arrayOf(C.shape({code:C.string.isRequired,name:C.string})),label:C.string.isRequired,onChange:C.func.isRequired,value:C.string};n0.defaultProps={contentLocales:[],value:null};const ioe=dr.createSvgIcon(A.jsx("path",{d:"M12 3v9.28c-.47-.17-.97-.28-1.5-.28C8.01 12 6 14.01 6 16.5S8.01 21 10.5 21c2.31 0 4.2-1.75 4.45-4H15V6h4V3z"}),"Audiotrack"),aoe=dr.createSvgIcon(A.jsx("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"}),"InsertDriveFile"),F7=dr.createSvgIcon(A.jsx("path",{d:"m18 4 2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4z"}),"Movie"),soe=dr.createSvgIcon(A.jsx("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5zm4-3H19v1h1.5V11H19v2h-1.5V7h3zM9 9.5h1v-1H9zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm10 5.5h1v-3h-1z"}),"PictureAsPdf"),ooe=300,loe={audio:ioe,"research-pdf":soe,"uploaded-video":F7,"youtube-video":F7},B7={borderRadius:1,flexShrink:0,height:40,objectFit:"cover",width:40};function g5({media:n}){if(n.thumbnailUrl)return A.jsx(ue.Box,{component:"img",src:n.thumbnailUrl,alt:"","data-testid":"media-selection-thumbnail",sx:B7});const e=n.source==="media-item"&&loe[n.mediaType]||(n.source==="upload"?ZD:aoe);return A.jsx(ue.Box,{sx:{...B7,alignItems:"center",bgcolor:"action.hover",color:"action.active",display:"flex",justifyContent:"center"},children:A.jsx(e,{fontSize:"small"})})}g5.propTypes={media:C.shape({mediaType:C.string,source:C.string,thumbnailUrl:C.string}).isRequired};const gE={"iiif-image":{normalize:n=>({id:n.documentId,source:"iiif-image",thumbnailUrl:n.thumbnailUrl??null,title:n.displayTitle}),titleKey:"poi_media_source_iiif_image"},upload:{normalize:n=>({id:String(n.id),source:"upload",thumbnailUrl:n.thumbnailUrl??null,title:n.name}),titleKey:"poi_media_source_upload"},"media-item":{normalize:n=>({id:n.documentId,mediaType:n.mediaType??null,source:"media-item",thumbnailUrl:n.thumbnailUrl??null,title:n.titleEn}),titleKey:"poi_media_source_media_item"}};function zm({dialogContainer:n,label:e,onChange:t,onSearchIiifImages:r,onSearchMediaItems:i,onSearchUploads:a,t:s,value:u}){const c=D.useMemo(()=>({"iiif-image":r,"media-item":i,upload:a}),[r,i,a]),h=D.useMemo(()=>Object.keys(gE).filter(G=>typeof c[G]=="function"),[c]),[g,v]=D.useState((u&&h.includes(u.source)?u.source:h[0])??null),[y,S]=D.useState(u?.title??""),[E,O]=D.useState(u?[u]:[]),[_,w]=D.useState(!1),N=D.useRef(null),L=D.useRef(0);D.useEffect(()=>()=>{clearTimeout(N.current),L.current+=1},[]);const P=(G,V)=>{const Z=c[G];if(typeof Z!="function")return;const X=L.current+1;L.current=X,w(!0),Promise.resolve(Z(V)).then(k=>{L.current===X&&O(k.map(gE[G].normalize))}).finally(()=>{L.current===X&&w(!1)})},H=(G,V)=>{clearTimeout(N.current),N.current=setTimeout(()=>P(G,V),ooe)},B=(G,V)=>{V&&(L.current+=1,clearTimeout(N.current),v(V),S(""),O([]),w(!1))};return h.length===0?null:A.jsxs(ue.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[h.length>1&&A.jsx(ue.ToggleButtonGroup,{value:g,exclusive:!0,onChange:B,size:"small",color:"primary",children:h.map(G=>A.jsx(ue.ToggleButton,{value:G,children:s(gE[G].titleKey)},G))}),A.jsx(ue.Autocomplete,{filterOptions:G=>G,getOptionKey:G=>G.id,getOptionLabel:G=>G.title,inputValue:y,isOptionEqualToValue:(G,V)=>G.source===V.source&&G.id===V.id,loading:_,noOptionsText:s(y?"poi_media_no_results":"poi_media_search_prompt"),onChange:(G,V)=>t(V),onInputChange:(G,V)=>{S(V),H(g,V)},onOpen:()=>P(g,y),options:E,renderInput:G=>A.jsx(ue.TextField,{...G,label:e,variant:"outlined",InputProps:{...G.InputProps,endAdornment:A.jsxs(A.Fragment,{children:[_?A.jsx(ue.CircularProgress,{color:"inherit",size:16}):null,G.InputProps.endAdornment]})}}),renderOption:(G,V)=>D.createElement(ue.Box,{component:"li",...G,key:V.id,sx:{alignItems:"center",display:"flex",gap:1}},A.jsx(g5,{media:{...V,source:g}}),V.title),slotProps:{popper:{container:n}},value:u&&u.source===g?u:null}),u&&A.jsxs(ue.Box,{sx:{alignItems:"center",display:"flex",gap:1},children:[A.jsx(g5,{media:u}),A.jsx(ue.Typography,{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:u.title})]})]})}zm.propTypes={dialogContainer:C.func.isRequired,label:C.string.isRequired,onChange:C.func.isRequired,onSearchIiifImages:C.func,onSearchMediaItems:C.func,onSearchUploads:C.func,t:C.func.isRequired,value:C.shape({id:C.string.isRequired,mediaType:C.string,source:C.oneOf(["upload","iiif-image","media-item"]).isRequired,thumbnailUrl:C.string,title:C.string})};zm.defaultProps={onSearchIiifImages:void 0,onSearchMediaItems:void 0,onSearchUploads:void 0,value:null};const uoe=(n,e)=>!n&&!e?!0:!n||!e?!1:n.source===e.source&&n.id===e.id;function $y({activeLocaleIsRtl:n,dialogContainer:e,keepSameLabel:t,labelAr:r,labelEn:i,mediaAr:a,mediaEn:s,onChangeAr:u,onChangeEn:c,onSearchIiifImages:h,onSearchMediaItems:g,onSearchUploads:v,t:y}){const[S,E]=D.useState(()=>uoe(s,a)),O=w=>{n?(u(w),S&&c(w)):(c(w),S&&u(w))},_=w=>{const{checked:N}=w.target;E(N),N&&(n?c(a):u(s))};return A.jsxs(A.Fragment,{children:[A.jsx(zm,{dialogContainer:e,label:n?r:i,onChange:O,onSearchIiifImages:h,onSearchMediaItems:g,onSearchUploads:v,t:y,value:n?a:s},n?"ar":"en"),A.jsx(ue.FormControlLabel,{control:A.jsx(ue.Checkbox,{checked:S,onChange:_}),label:t})]})}$y.propTypes={activeLocaleIsRtl:C.bool,dialogContainer:C.func.isRequired,keepSameLabel:C.string.isRequired,labelAr:C.string.isRequired,labelEn:C.string.isRequired,mediaAr:zm.propTypes.value,mediaEn:zm.propTypes.value,onChangeAr:C.func.isRequired,onChangeEn:C.func.isRequired,onSearchIiifImages:C.func,onSearchMediaItems:C.func,onSearchUploads:C.func,t:C.func.isRequired};$y.defaultProps={activeLocaleIsRtl:!1,mediaAr:null,mediaEn:null,onSearchIiifImages:void 0,onSearchMediaItems:void 0,onSearchUploads:void 0};const coe=["showBlocks","|","heading","|","superscript","bold","italic","underline","strikethrough","|","bulletedList","numberedList","link","insertTable","codeBlock","specialCharacters","horizontalLine","subscript","|","undo","redo"],doe=[{class:"ck-heading_paragraph",model:"paragraph",title:"Paragraph"},{class:"ck-heading_heading2",model:"heading2",title:"Heading 2",view:"h2"},{class:"ck-heading_heading3",model:"heading3",title:"Heading 3",view:"h3"},{class:"ck-heading_heading4",model:"heading4",title:"Heading 4",view:"h4"},{class:"ck-heading_heading5",model:"heading5",title:"Heading 5",view:"h5"},{class:"ck-heading_heading6",model:"heading6",title:"Heading 6",view:"h6"}],foe=[Fi.Autoformat,Fi.Bold,Fi.CodeBlock,Fi.Essentials,Fi.Heading,Fi.HorizontalLine,Fi.Italic,Fi.Link,Fi.List,Fi.Paragraph,Fi.ShowBlocks,Fi.SpecialCharacters,Fi.SpecialCharactersEssentials,Fi.Strikethrough,Fi.Subscript,Fi.Superscript,Fi.Table,Fi.TableToolbar,Fi.Underline];function r0({onChange:n,placeholder:e,rtl:t,value:r}){return A.jsx(ue.Box,{sx:{"& .ck-content":{overflowWrap:"break-word"},"& .ck-content *":t?{direction:"rtl",textAlign:"right"}:void 0,"& .ck-content img, & .ck-content table":{maxWidth:"100%"},"& .ck-editor, & .ck-editor__editable":{maxWidth:"100%"},"& .ck-editor__editable":{minHeight:"150px"},"& .ck-editor__editable, & .ck-content":t?{direction:"rtl",textAlign:"right",unicodeBidi:"plaintext"}:void 0,maxWidth:"100%",minWidth:0},children:A.jsx(WF.CKEditor,{config:{heading:{options:doe},language:{content:t?"ar":"en",ui:"en"},licenseKey:"GPL",placeholder:e,plugins:foe,toolbar:{items:coe,shouldNotGroupWhenFull:!0}},data:r,editor:Fi.ClassicEditor,onChange:(i,a)=>n(a.getData())})})}r0.propTypes={onChange:C.func.isRequired,placeholder:C.string,rtl:C.bool,value:C.string};r0.defaultProps={placeholder:void 0,rtl:!1,value:""};const{AnnotationFormFooter:hoe,TargetFormSection:poe}=Fc,m5="TextualBody",IL=n=>typeof n=="string"&&n.toLowerCase().startsWith("ar"),t3=(n,e)=>Object.keys(n)[0]??(e.some(({code:t})=>t==="en")?"en":e[0]?.code),goe={description:"",title:""},n3=(n,e)=>n[e]??goe,r3=n=>{const e={},t=new Set;return n.forEach(r=>{const i=r.language;if(!i)return;const a=e[i]??{description:"",title:""};r.purpose==="identifying"?a.title=r.value??"":r.purpose==="describing"&&r.type===m5&&!t.has(i)&&(a.description=r.value??"",t.add(i)),e[i]=a}),e},OL=n=>{const e=n?.target?.drawingState?.shapes;return Array.isArray(e)&&e.length===1&&e[0].type===Vt.POI},DL=n=>n==null||Number.isFinite(n)&&n>=-90&&n<=90,NL=n=>n==null||Number.isFinite(n)&&n>=-180&&n<=180,by=n=>{const e=n.trim();return e===""?null:Number(e.replace(",","."))},i3=(n,e)=>e.every(({code:t})=>!sp(n3(n,t).title)),a3=n=>{const e=n,{contentByLocale:t}=e.maeData;return e.body=Object.entries(t).flatMap(([r,i])=>{const{description:a,title:s}=i;return[{language:r,purpose:"identifying",type:m5,value:s},...sp(a)?[]:[{language:r,purpose:"describing",type:m5,value:a}]]}),e},moe=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=a3(n);return Um(i,e,t,r)};function ML({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const{contentLocales:s=[],searchMediaItems:u,searchIiifImages:c,searchUploads:h}=$a.useSelector(xe=>Pt.getConfig(xe)).annotation??{};let g=n;g.id?(g.maeData.target.drawingState&&typeof g.maeData.target.drawingState=="string"&&(g.maeData.target.drawingState={...JSON.parse(g.maeData.target.drawingState),currentShape:null}),g.maeData.contentByLocale=r3(g.body)):g={body:[],"dbf:kind":"POI","dbf:latitude":null,"dbf:longitude":null,"dbf:mediaAr":null,"dbf:mediaEn":null,maeData:{contentByLocale:{},target:null,templateType:gn.POI_TYPE},motivation:"identifying",target:null};const[v,y]=D.useState(g),[S,E]=D.useState(!1),[O,_]=D.useState(!1),[w,N]=D.useState(!1),[L,P]=D.useState(!1),[H,B]=D.useState(g["dbf:latitude"]!=null?String(g["dbf:latitude"]):""),[G,V]=D.useState(g["dbf:longitude"]!=null?String(g["dbf:longitude"]):""),[Z,X]=D.useState(!1),[k,z]=D.useState(t3(v.maeData.contentByLocale,s)),q=D.useRef(null),te=()=>q.current?.closest('[role="dialog"]')??document.body,ee=n3(v.maeData.contentByLocale,k),$=IL(k),ie=xe=>{y({...v,maeData:{...v.maeData,...xe}})},K=xe=>{ie({target:xe})},oe=xe=>{ie({contentByLocale:{...v.maeData.contentByLocale,[k]:{...ee,...xe}}})},se=xe=>{y(Pe=>({...Pe,"dbf:mediaEn":xe}))},ge=xe=>{y(Pe=>({...Pe,"dbf:mediaAr":xe}))},pe=xe=>{const{value:Pe}=xe.target;B(Pe),y(Ke=>({...Ke,"dbf:latitude":by(Pe)}))},Ae=xe=>{const{value:Pe}=xe.target;V(Pe),y(Ke=>({...Ke,"dbf:longitude":by(Pe)}))},we=async()=>{const xe=OL(v.maeData),Pe=i3(v.maeData.contentByLocale,s),Ke=DL(v["dbf:latitude"]),$e=NL(v["dbf:longitude"]);if(E(!xe),_(!Pe),N(!Ke),P(!$e),!(!xe||!Pe||!Ke||!$e)){qm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),X(!0);try{await r(v)}finally{X(!1)}}};return A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:2,ref:q,children:[A.jsxs(ue.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:i("poi")})}),A.jsx(ue.Grid,{children:A.jsx(n0,{contentLocales:s,label:i("poi_language"),onChange:z,value:k})})]}),A.jsxs(ue.Grid,{children:[A.jsx(ue.TextField,{fullWidth:!0,error:O,label:i("poi_title"),value:ee.title,variant:"outlined",onChange:xe=>oe({title:xe.target.value}),slotProps:{htmlInput:{dir:$?"rtl":"ltr",style:{textAlign:$?"right":"left"}}}}),O&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_title_required")})]}),(u||c||h)&&A.jsx(ue.Grid,{children:A.jsx($y,{activeLocaleIsRtl:$,dialogContainer:te,keepSameLabel:i("poi_media_keep_same"),labelAr:i("poi_media_ar"),labelEn:i("poi_media_en"),mediaAr:v["dbf:mediaAr"]??null,mediaEn:v["dbf:mediaEn"]??null,onChangeAr:ge,onChangeEn:se,onSearchIiifImages:c,onSearchMediaItems:u,onSearchUploads:h,t:i})}),A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:i("poi_description_section")})}),A.jsx(ue.Grid,{children:A.jsx(r0,{onChange:xe=>oe({description:xe}),placeholder:i("poi_description_placeholder"),rtl:$,value:ee.description},k)}),A.jsxs(ue.Grid,{container:!0,direction:"row",spacing:2,children:[A.jsxs(ue.Grid,{size:6,children:[A.jsx(ue.TextField,{fullWidth:!0,error:w,label:i("poi_latitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:H,variant:"outlined",onChange:pe}),w&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_latitude_invalid")})]}),A.jsxs(ue.Grid,{size:6,children:[A.jsx(ue.TextField,{fullWidth:!0,error:L,label:i("poi_longitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:G,variant:"outlined",onChange:Ae}),L&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_longitude_invalid")})]})]}),A.jsxs(ue.Grid,{children:[A.jsx(poe,{onChangeTarget:K,playerReferences:t,pointOnly:!0,spatialTarget:!0,target:v.maeData.target,windowId:a}),S&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_target_must_be_point")})]}),A.jsx(ue.Grid,{children:A.jsx(hoe,{closeFormCompanionWindow:e,saveAnnotation:we,saving:Z,t:i,annotationState:v})})]})}ML.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const{AnnotationFormFooter:voe}=Fc,yoe=n=>typeof n=="string"&&n.toLowerCase().startsWith("ar"),boe={description:"",title:""},xoe=(n,e)=>n[e]??boe,Soe=async(n,{canvas:e})=>{const t=a3(n);return t.target=e.id,t};function LL({annotation:n,closeFormCompanionWindow:e,saveAnnotation:t,t:r}){const{contentLocales:i=[],searchMediaItems:a,searchIiifImages:s,searchUploads:u}=$a.useSelector(X=>Pt.getConfig(X)).annotation??{};let c=n;c.id?c.maeData.contentByLocale=r3(c.body):c={body:[],"dbf:kind":"Journey","dbf:mediaAr":null,"dbf:mediaEn":null,maeData:{contentByLocale:{},target:{},templateType:gn.JOURNEY_TYPE},motivation:"identifying",target:null};const[h,g]=D.useState(c),[v,y]=D.useState(!1),[S,E]=D.useState(!1),[O,_]=D.useState(t3(h.maeData.contentByLocale,i)),w=D.useRef(null),N=()=>w.current?.closest('[role="dialog"]')??document.body,L=xoe(h.maeData.contentByLocale,O),P=yoe(O),H=X=>{g({...h,maeData:{...h.maeData,...X}})},B=X=>{H({contentByLocale:{...h.maeData.contentByLocale,[O]:{...L,...X}}})},G=X=>{g(k=>({...k,"dbf:mediaEn":X}))},V=X=>{g(k=>({...k,"dbf:mediaAr":X}))},Z=async()=>{const X=i3(h.maeData.contentByLocale,i);if(y(!X),!!X){E(!0);try{await t(h)}finally{E(!1)}}};return A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:2,ref:w,children:[A.jsxs(ue.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:r("journey")})}),A.jsx(ue.Grid,{children:A.jsx(n0,{contentLocales:i,label:r("journey_language"),onChange:_,value:O})})]}),A.jsxs(ue.Grid,{children:[A.jsx(ue.TextField,{fullWidth:!0,error:v,label:r("journey_title"),value:L.title,variant:"outlined",onChange:X=>B({title:X.target.value}),slotProps:{htmlInput:{dir:P?"rtl":"ltr",style:{textAlign:P?"right":"left"}}}}),v&&A.jsx(rn,{color:"error",variant:"caption",children:r("journey_title_required")})]}),(a||s||u)&&A.jsx(ue.Grid,{children:A.jsx($y,{activeLocaleIsRtl:P,dialogContainer:N,keepSameLabel:r("journey_media_keep_same"),labelAr:r("journey_media_ar"),labelEn:r("journey_media_en"),mediaAr:h["dbf:mediaAr"]??null,mediaEn:h["dbf:mediaEn"]??null,onChangeAr:V,onChangeEn:G,onSearchIiifImages:s,onSearchMediaItems:a,onSearchUploads:u,t:r})}),A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:r("journey_description_section")})}),A.jsx(ue.Grid,{children:A.jsx(r0,{onChange:X=>B({description:X}),placeholder:r("journey_description_placeholder"),rtl:P,value:L.description},O)}),A.jsx(ue.Grid,{children:A.jsx(voe,{closeFormCompanionWindow:e,saveAnnotation:Z,saving:S,t:r,annotationState:h})}),A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"subFormSectionTitle",children:r("journey_hint")})})]})}LL.propTypes={annotation:C.shape({body:C.arrayOf(C.shape({type:C.string})),id:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired};const{AnnotationFormFooter:Coe,MultiTagsInput:_oe,TargetFormSection:Eoe,TextCommentInput:Toe}=Fc,woe=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=vO(n);return Um(i,e,t,r)};function kL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const s=$a.useSelector(N=>Pt.getConfig(N)),c=s.annotation.tagsSuggestions??[];let h=n;if(h.id)h.maeData.target.drawingState&&typeof h.maeData.target.drawingState=="string"&&(h.maeData.target.drawingState=JSON.parse(h.maeData.target.drawingState),console.debug("Parsed drawingState:",h.maeData.target.drawingState),h.maeData.target.drawingState={...h.maeData.target.drawingState,currentShape:null}),h.maeData.textBody=h.body.find(N=>N.purpose==="describing"),h.maeData.tags=h.body.filter(N=>N.purpose==="tagging").map(N=>({label:N.value,value:N.value})),h.maeData.textBody===void 0&&(h.maeData.textBody={purpose:"describing",type:"TextualBody",value:""});else{const{defaultTags:N}=Ym(s),L=N.map(P=>({label:P,value:P}));h={body:[],maeData:{tags:L,target:null,templateType:gn.MULTIPLE_BODY_TYPE,textBody:{purpose:"describing",type:"TextualBody",value:""}},motivation:"commenting",target:null}}const[g,v]=D.useState(h),y=N=>{v({...g,maeData:{...g.maeData,textBody:{...g.maeData.textBody,value:N}}})},S=N=>{v({...g,maeData:{...g.maeData,tags:N}})},E=N=>{const L=g.maeData;L.target=N,v({...g,maeData:L})},O=async()=>{qm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),r(g)},_=c.map(N=>({label:N,value:N})),w=N=>{const L=_.find(P=>P.value===N.title);if(L&&!g.maeData.tags.find(P=>P.value===L.value)){v({...g,maeData:{...g.maeData,tags:[...g.maeData.tags,L],textBody:{...g.maeData.textBody,value:N.content}}});return}y(N.content)};return A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:2,children:[A.jsx(ue.Grid,{children:A.jsx(Toe,{comment:g.maeData.textBody.value,setComment:y,onChangeTemplate:w,t:i})}),A.jsx(ue.Grid,{children:A.jsx(_oe,{t:i,tags:g.maeData.tags,setTags:S,tagsSuggestions:_})}),A.jsx(ue.Grid,{children:A.jsx(Eoe,{onChangeTarget:E,playerReferences:t,spatialTarget:!0,t:i,target:g.maeData.target,timeTarget:!0,windowId:a})}),A.jsx(ue.Grid,{children:A.jsx(Coe,{closeFormCompanionWindow:e,saveAnnotation:O,t:i,annotationState:g})})]})}kL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const Aoe=300;function s3({dialogContainer:n,label:e,onChange:t,onSearch:r,t:i,value:a}){const[s,u]=D.useState(a?.titleEn??""),[c,h]=D.useState(a?[a]:[]),[g,v]=D.useState(!1),y=D.useRef(null),S=D.useRef(0);D.useEffect(()=>()=>{clearTimeout(y.current),S.current+=1},[]);const E=_=>{const w=S.current+1;S.current=w,v(!0),Promise.resolve(r(_)).then(N=>{S.current===w&&h(N)}).finally(()=>{S.current===w&&v(!1)})},O=_=>{clearTimeout(y.current),y.current=setTimeout(()=>E(_),Aoe)};return A.jsx(ue.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:A.jsx(ue.Autocomplete,{filterOptions:_=>_,getOptionKey:_=>_.documentId,getOptionLabel:_=>_.titleEn,inputValue:s,isOptionEqualToValue:(_,w)=>_.documentId===w.documentId,loading:g,noOptionsText:i(s?"map_relation_no_results":"map_relation_search_prompt"),onChange:(_,w)=>t(w),onInputChange:(_,w)=>{u(w),O(w)},onOpen:()=>E(s),options:c,renderInput:_=>A.jsx(ue.TextField,{..._,label:e,variant:"outlined",InputProps:{..._.InputProps,endAdornment:A.jsxs(A.Fragment,{children:[g?A.jsx(ue.CircularProgress,{color:"inherit",size:16}):null,_.InputProps.endAdornment]})}}),slotProps:{popper:{container:n}},value:a})})}s3.propTypes={dialogContainer:C.func.isRequired,label:C.string.isRequired,onChange:C.func.isRequired,onSearch:C.func.isRequired,t:C.func.isRequired,value:C.shape({documentId:C.string.isRequired,titleEn:C.string.isRequired})};s3.defaultProps={value:null};const{AnnotationFormFooter:Roe,TargetFormSection:Ioe}=Fc,Ooe=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=a3(n);return Um(i,e,t,r)};function PL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const{contentLocales:s=[],searchMaps:u}=$a.useSelector(xe=>Pt.getConfig(xe)).annotation??{};let c=n;c.id?(c.maeData.target.drawingState&&typeof c.maeData.target.drawingState=="string"&&(c.maeData.target.drawingState={...JSON.parse(c.maeData.target.drawingState),currentShape:null}),c.maeData.contentByLocale=r3(c.body)):c={body:[],"dbf:kind":"POI","dbf:latitude":null,"dbf:linkedMap":null,"dbf:longitude":null,"dbf:mediaAr":null,"dbf:mediaEn":null,maeData:{contentByLocale:{},target:null,templateType:gn.NESTED_MAP_TYPE},motivation:"identifying",target:null};const[h,g]=D.useState(c),[v,y]=D.useState(!1),[S,E]=D.useState(!1),[O,_]=D.useState(!1),[w,N]=D.useState(!1),[L,P]=D.useState(!1),[H,B]=D.useState(c["dbf:latitude"]!=null?String(c["dbf:latitude"]):""),[G,V]=D.useState(c["dbf:longitude"]!=null?String(c["dbf:longitude"]):""),[Z,X]=D.useState(!1),[k,z]=D.useState(t3(h.maeData.contentByLocale,s)),q=D.useRef(null),te=()=>q.current?.closest('[role="dialog"]')??document.body,ee=n3(h.maeData.contentByLocale,k),$=IL(k),ie=h["dbf:linkedMap"]??null,K=xe=>{g({...h,maeData:{...h.maeData,...xe}})},oe=xe=>{K({target:xe})},se=xe=>{K({contentByLocale:{...h.maeData.contentByLocale,[k]:{...ee,...xe}}})},ge=xe=>{g({...h,"dbf:linkedMap":xe?{id:xe.documentId,titleEn:xe.titleEn}:null})},pe=xe=>{const{value:Pe}=xe.target;B(Pe),g(Ke=>({...Ke,"dbf:latitude":by(Pe)}))},Ae=xe=>{const{value:Pe}=xe.target;V(Pe),g(Ke=>({...Ke,"dbf:longitude":by(Pe)}))},we=async()=>{const xe=OL(h.maeData),Pe=!!h["dbf:linkedMap"],Ke=i3(h.maeData.contentByLocale,s),$e=DL(h["dbf:latitude"]),pt=NL(h["dbf:longitude"]);if(y(!xe),E(!Pe),_(!Ke),N(!$e),P(!pt),!(!xe||!Pe||!Ke||!$e||!pt)){qm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),X(!0);try{await r(h)}finally{X(!1)}}};return A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:2,ref:q,children:[A.jsxs(ue.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:i("nested_map")})}),A.jsx(ue.Grid,{children:A.jsx(n0,{contentLocales:s,label:i("poi_language"),onChange:z,value:k})})]}),A.jsxs(ue.Grid,{children:[A.jsx(ue.TextField,{fullWidth:!0,error:O,label:i("poi_title"),value:ee.title,variant:"outlined",onChange:xe=>se({title:xe.target.value}),slotProps:{htmlInput:{dir:$?"rtl":"ltr",style:{textAlign:$?"right":"left"}}}}),O&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_title_required")})]}),A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:i("nested_map_linked_map")})}),typeof u=="function"&&A.jsxs(ue.Grid,{children:[A.jsx(s3,{dialogContainer:te,label:i("nested_map_linked_map"),onChange:ge,onSearch:u,t:i,value:ie?{documentId:ie.id,titleEn:ie.titleEn}:null}),S&&A.jsx(rn,{color:"error",variant:"caption",children:i("nested_map_linked_map_required")})]}),A.jsx(ue.Grid,{children:A.jsx(rn,{variant:"formSectionTitle",children:i("poi_description_section")})}),A.jsx(ue.Grid,{children:A.jsx(r0,{onChange:xe=>se({description:xe}),placeholder:i("poi_description_placeholder"),rtl:$,value:ee.description},k)}),A.jsxs(ue.Grid,{container:!0,direction:"row",spacing:2,children:[A.jsxs(ue.Grid,{size:6,children:[A.jsx(ue.TextField,{fullWidth:!0,error:w,label:i("poi_latitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:H,variant:"outlined",onChange:pe}),w&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_latitude_invalid")})]}),A.jsxs(ue.Grid,{size:6,children:[A.jsx(ue.TextField,{fullWidth:!0,error:L,label:i("poi_longitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:G,variant:"outlined",onChange:Ae}),L&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_longitude_invalid")})]})]}),A.jsxs(ue.Grid,{children:[A.jsx(Ioe,{onChangeTarget:oe,playerReferences:t,pointOnly:!0,spatialTarget:!0,target:h.maeData.target,windowId:a}),v&&A.jsx(rn,{color:"error",variant:"caption",children:i("poi_target_must_be_point")})]}),A.jsx(ue.Grid,{children:A.jsx(Roe,{closeFormCompanionWindow:e,saveAnnotation:we,saving:Z,t:i,annotationState:h})})]})}PL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const{AnnotationFormFooter:Doe,TargetFormSection:Noe}=Fc,Moe=mO;function jL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){const s=$a.useSelector(S=>Pt.getConfig(S));let u=n;if(u.id)u.maeData.target.drawingState&&typeof u.maeData.target.drawingState=="string"&&(u.maeData.target.drawingState=JSON.parse(u.maeData.target.drawingState));else{const{defaultTags:S}=Ym(s);u={body:{type:"Image",value:S.length>0?S[0]:""},maeData:{target:null,templateType:gn.TAGGING_TYPE},motivation:"tagging",target:null}}const[c,h]=D.useState(u),g=S=>{const E=c.body;E.value=S,h({...c,body:E})},v=S=>{const E=c.maeData;E.target=S,h({...c,maeData:E})},y=async()=>{qm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),r(c)};return A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:2,children:[A.jsx(ue.Grid,{children:A.jsxs(rn,{variant:"formSectionTitle",children:[i("tag")," "]})}),A.jsx(ue.Grid,{children:A.jsx(ue.TextField,{id:"outlined-basic",label:i("your_tag_here"),value:c.body.value,variant:"outlined",onChange:S=>g(S.target.value)})}),A.jsx(ue.Grid,{children:A.jsx(Noe,{onChangeTarget:v,playerReferences:t,spatialTarget:!0,target:c.maeData.target,windowId:a})}),A.jsx(ue.Grid,{children:A.jsx(Doe,{closeFormCompanionWindow:e,saveAnnotation:y,t:i,annotationState:c})})]})}jL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const{AnnotationFormFooter:Loe,TargetFormSection:koe,TextCommentInput:Poe}=Fc,joe="Annotation",Foe=mO;function FL({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:a}){let s=n;s.id?s.maeData.target.drawingState&&typeof s.maeData.target.drawingState=="string"&&(s.maeData.target.drawingState=JSON.parse(s.maeData.target.drawingState)):s={body:{id:Ja(),type:"TextualBody",value:""},maeData:{target:null,templateType:gn.TEXT_TYPE},motivation:"commenting",target:null};const[u,c]=D.useState(s),h=S=>{const E=u.body;E.value=S,c({...u,body:E})},g=S=>{h(S.content)},v=S=>{const E=u.maeData;E.target=S,c({...u,maeData:E})},y=()=>{qm(a,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),u.body.value===void 0&&(u.body.value=joe),r(u)};return D.useEffect(()=>{},[u.maeData.target]),A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:2,children:[A.jsx(ue.Grid,{children:A.jsx(Poe,{comment:u.body.value,setComment:h,onChangeTemplate:g,t:i})}),A.jsx(ue.Grid,{children:A.jsx(koe,{onChangeTarget:v,playerReferences:t,spatialTarget:!0,target:u.maeData.target,windowId:a})}),A.jsx(ue.Grid,{children:A.jsx(Loe,{closeFormCompanionWindow:e,saveAnnotation:y,t:i,annotationState:u})})]})}FL.propTypes={annotation:C.object.isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,t:C.func.isRequired,windowId:C.string.isRequired};const xd=n=>n===Gi.IMAGE,Qy=(n,e=[])=>{const t=[{Component:kL,convertToAnnotation:woe,description:n("textual_note_with_target"),icon:A.jsx(QG,{}),id:gn.MULTIPLE_BODY_TYPE,isCompatibleWithMediaType:xd,label:n("note"),selectable:!0},{Component:jL,convertToAnnotation:Moe,description:n("tag_with_target"),icon:A.jsx(eH,{fontSize:"small"}),id:gn.TAGGING_TYPE,isCompatibleWithMediaType:xd,label:n("tag"),selectable:!0},{Component:ML,convertToAnnotation:moe,description:n("poi_description"),icon:A.jsx(nH,{fontSize:"small"}),id:gn.POI_TYPE,isCompatibleWithMediaType:xd,label:n("poi"),selectable:!0},{Component:PL,convertToAnnotation:Ooe,description:n("nested_map_description"),icon:A.jsx(tO,{fontSize:"small"}),id:gn.NESTED_MAP_TYPE,isCompatibleWithMediaType:xd,label:n("nested_map"),selectable:!0},{Component:LL,convertToAnnotation:Soe,description:n("journey_description"),icon:A.jsx(iO,{fontSize:"small"}),id:gn.JOURNEY_TYPE,isCompatibleWithMediaType:xd,label:n("journey"),selectable:!0},{Component:RL,convertToAnnotation:roe,description:n("edit_iiif_json_code"),icon:A.jsx(tH,{fontSize:"small"}),id:gn.IIIF_TYPE,isCompatibleWithMediaType:xd,label:n("expert_mode"),selectable:!0},{Component:FL,convertToAnnotation:Foe,description:"",icon:null,id:gn.TEXT_TYPE,isCompatibleWithMediaType:xd,label:"",selectable:!1}],r=new Set(t.map(a=>a.id)),i=e.filter(a=>r.has(a.id)?(console.warn(`Ignoring external annotation template with id "${a.id}": it collides with a built-in template id.`),!1):typeof a.id!="string"||typeof a.Component!="function"||typeof a.convertToAnnotation!="function"||typeof a.isCompatibleWithMediaType!="function"?(console.warn(`Ignoring external annotation template with id "${a.id}": it does not follow the TEMPLATE_REGISTRY contract (id: string, Component/convertToAnnotation/isCompatibleWithMediaType: function are all required).`),!1):!0);return[...t,...i]},BL=(n,e=[],t=null)=>Qy(n,e).filter(r=>r.selectable).filter(r=>!Array.isArray(t)||t.length===0?!0:t.includes(r.id)),$g=(n,e,t=[])=>Qy(n,t).find(r=>r.id===e),Boe=n=>n["dbf:kind"]==="Journey"?gn.JOURNEY_TYPE:n["dbf:linkedMap"]?gn.NESTED_MAP_TYPE:gn.POI_TYPE,GL="maps-annotation-list",Goe={name:GL,put:!0},Hoe={name:GL,put:(n,e,t)=>t.getAttribute("data-kind")==="POI"};function HL({journeyId:n,persist:e,pois:t,recomputeAndPersistJourney:r,renderRow:i}){const a=D.useRef(!1),s=D.useRef(0),[u,c]=D.useState(t);D.useEffect(()=>{a.current||s.current>0||c(t)},[t]);const h=D.useCallback(()=>{a.current=!0},[]),g=D.useCallback(()=>{a.current=!1},[]),v=D.useCallback(y=>{const S=y.map((O,_)=>uO(O,n,_));c(S),s.current+=1;let E;S.reduce((O,_)=>O.then(()=>e(_).then(w=>{E=w})),Promise.resolve()).then(()=>E?r(n,E.items):void 0).finally(()=>{s.current-=1})},[n,e,r]);return A.jsx(DO.ReactSortable,{animation:150,forceFallback:!0,group:Hoe,list:u,onEnd:g,onStart:h,setList:v,tag:"ul",style:{listStyle:"none",margin:0,paddingInlineStart:24},children:u.map(y=>A.jsx("li",{style:{listStyle:"none"},"data-kind":"POI",children:i(y)},y.id))})}HL.propTypes={journeyId:C.string.isRequired,persist:C.func.isRequired,pois:C.arrayOf(C.object).isRequired,recomputeAndPersistJourney:C.func.isRequired,renderRow:C.func.isRequired};function o3({canvasId:n,deselectAnnotation:e,hoverAnnotation:t,hoveredAnnotationIds:r=[],index:i,items:a=[],label:s,receiveAnnotation:u,selectAnnotation:c,selectedAnnotationId:h,storageAdapter:g,totalSize:v,windowId:y}){const{i18n:S,t:E}=Gs.useTranslation(),O=D.useMemo(()=>{const ie=new Map;return Qy(E).forEach(K=>ie.set(K.id,K)),ie},[E]),_=D.useMemo(()=>lO(a),[a]),w=D.useMemo(()=>_.map(ie=>ie.item),[_]),N=D.useMemo(()=>{const ie=new Map;return _.forEach(K=>{K.kind==="Journey"&&ie.set(K.id,K.pois)}),ie},[_]),L=D.useRef(!1),P=D.useRef(0),[H,B]=D.useState(w);D.useEffect(()=>{L.current||P.current>0||B(w)},[w]);const G=D.useCallback(()=>{L.current=!0},[]),V=D.useCallback(()=>{L.current=!1},[]),Z=D.useRef(Promise.resolve()),X=D.useCallback(ie=>{const K=g(n),oe=()=>K.update(ie).then(ge=>(u(n,K.annotationPageId,ge),ge)),se=Z.current.then(oe,oe);return Z.current=se.catch(()=>{}),se},[g,n,u]),k=D.useCallback((ie,K)=>{if(!ie)return Promise.resolve();const oe=CE(ie,K,n);if(!oe)return Promise.resolve();const se=(K??[]).find(ge=>ge.id===ie);return se&&JSON.stringify(se.target)===JSON.stringify(oe.target)?Promise.resolve():X(oe)},[X]),z=D.useCallback(ie=>{const K=new Set(ie.map(ge=>ge["dbf:journey"]?.id).filter(Boolean)),oe=ie.map((ge,pe)=>dA(ge,pe));B(oe),P.current+=1;let se;oe.reduce((ge,pe)=>ge.then(()=>X(pe).then(Ae=>{se=Ae})),Promise.resolve()).then(()=>{if(se)return Promise.all([...K].map(ge=>k(ge,se.items)))}).finally(()=>{P.current-=1})},[X,k]),q=D.useCallback(ie=>{window.getSelection()?.toString()||(h===ie?e(y,ie):c(y,ie))},[y,e,c,h]),te=D.useMemo(()=>_.filter(ie=>ie.kind==="Journey").map(ie=>({id:ie.id,title:cA(ie.item,S.language)||"—"})),[_,S.language]),ee=D.useCallback((ie,K)=>{const oe=ie["dbf:journey"]?.id??null,se=K?uO(ie,K,(N.get(K)??[]).length):dA(ie,H.length);X(se).then(ge=>{if(!ge)return;const pe=new Set([K,oe].filter(Boolean));return Promise.all([...pe].map(Ae=>k(Ae,ge.items)))})},[N,X,H.length,k]),$=ie=>{const K=cA(ie,S.language)||"—",oe=r.includes(ie.id)||h===ie.id,se=ie["dbf:kind"]==="Journey",ge=O.get(Boe(ie))?.icon;let pe;return oe?pe="rgba(0, 0, 0, 0.04)":se&&(pe="rgba(0, 0, 0, 0.02)"),A.jsxs(Cy,{annotationid:ie.id,currentJourneyId:se?void 0:ie["dbf:journey"]?.id??null,"data-kind":ie["dbf:kind"],journeys:se?void 0:te,onClick:()=>q(ie.id),onMoveToJourney:se?void 0:Ae=>ee(ie,Ae),onMouseEnter:()=>t(y,[ie.id]),onMouseLeave:()=>t(y,[]),style:{alignItems:"center",backgroundColor:pe,cursor:"pointer",display:"flex",gap:8,listStyle:"none",padding:"8px 16px"},children:[ge&&A.jsx("span",{style:{display:"inline-flex",flexShrink:0},children:ge}),A.jsx(rn,{variant:se?"subtitle2":"body2",children:K})]},ie.id)};return H.length===0?null:A.jsxs(A.Fragment,{children:[A.jsx(rn,{sx:{paddingLeft:2,paddingRight:1,paddingTop:2},variant:"overline",children:E("annotationCanvasLabel",{context:`${i+1}/${v}`,label:s})}),A.jsx(DO.ReactSortable,{animation:150,forceFallback:!0,group:Goe,list:H,onEnd:V,onStart:G,setList:z,tag:"ul",style:{listStyle:"none",margin:0,padding:0},children:H.map(ie=>ie["dbf:kind"]==="Journey"?A.jsxs("li",{style:{listStyle:"none"},"data-kind":"Journey",children:[$(ie),A.jsx(HL,{journeyId:ie.id,persist:X,pois:N.get(ie.id)??[],recomputeAndPersistJourney:k,renderRow:$})]},ie.id):A.jsx("li",{style:{listStyle:"none"},"data-kind":"POI",children:$(ie)},ie.id))})]})}o3.propTypes={canvasId:C.string.isRequired,deselectAnnotation:C.func.isRequired,hoverAnnotation:C.func.isRequired,hoveredAnnotationIds:C.arrayOf(C.string),index:C.number.isRequired,items:C.arrayOf(C.object),label:C.string.isRequired,receiveAnnotation:C.func.isRequired,selectAnnotation:C.func.isRequired,selectedAnnotationId:C.string,storageAdapter:C.func.isRequired,totalSize:C.number.isRequired,windowId:C.string.isRequired};o3.defaultProps={hoveredAnnotationIds:[],items:[],selectedAnnotationId:void 0};const v5=n=>{if(!n)return!1;const e=getComputedStyle(n),t=e.overflowY||e.overflow||"";return/(auto|scroll|overlay)/.test(t)&&n.scrollHeight>n.clientHeight},zoe=n=>{let e=n?.parentElement||null;for(;e;){if(v5(e))return e;e=e.parentElement}return null},qoe=()=>document.scrollingElement||document.documentElement;function Uoe(n,e,t){const r=n.getBoundingClientRect(),i=e.getBoundingClientRect(),a=i.top-r.top+n.scrollTop,s=i.bottom-r.top+n.scrollTop,u=n.scrollTop+t,c=n.scrollTop+n.clientHeight,h=a<u,g=s>c;return!h&&!g?null:h?a-t:Math.max(s-n.clientHeight,a-t)}function Voe(n,e){const t=n.getBoundingClientRect(),r=t.top+window.scrollY,i=t.bottom+window.scrollY,a=window.scrollY+e,s=window.scrollY+window.innerHeight,u=r<a,c=i>s;return!u&&!c?null:u?r-e:Math.max(i-window.innerHeight,r-e)}const Woe=(n,e,t)=>new Promise(r=>{const i="smooth";requestAnimationFrame(()=>{requestAnimationFrame(()=>{let s=e.current;if(v5(s)||(s=zoe(n)),v5(s)||(s=qoe()),s===document.body||s===document.documentElement||s===document.scrollingElement){const g=Voe(n,96);if(g==null)return r(!0);const v=window.scrollY;window.scrollTo({behavior:i,top:g}),setTimeout(()=>{const y=window.scrollY;r(Math.abs(y-v)>.5)},t);return}const c=Uoe(s,n,96);if(c==null)return r(!0);const h=s.scrollTop;typeof s.scrollTo=="function"&&s.scrollTo({behavior:i,top:c}),setTimeout(()=>{const g=s.scrollTop;r(Math.abs(g-h)>.5)},t)})})}),Xoe=async(n,e)=>{for(let i=0;i<=3&&!await Woe(n,e,24);i++)i<3&&await new Promise(s=>{setTimeout(s,24)})};function zL({addCompanionWindow:n,annotationsOnCanvases:e={},canvases:t=[],config:r,deselectAnnotation:i,highlightAllAnnotations:a,receiveAnnotation:s,switchToSingleCanvasView:u,TargetComponent:c,targetProps:h,updateWindow:g,windowViewType:v,annotationEditCompanionWindowIsOpened:y,annotationPreviewCompanionWindowIsOpened:S}){const[E,O]=D.useState(!1),{t:_}=Gs.useTranslation(),w=D.useRef(null),N=D.useRef(null);D.useEffect(()=>{const z=h?.selectedAnnotationId;if(!z)return;const q=w.current?.querySelector(`li[annotationid="${z}"]`)||w.current?.querySelector("li.MuiMenuItem-root.Mui-selected");q&&Xoe(q,N)},[h?.selectedAnnotationId]);const L=D.useCallback(()=>{O(z=>!z)});D.useEffect(()=>{px.isInitialized&&r.translations&&(Object.keys(r.translations).forEach(z=>{px.addResourceBundle(z,"translation",r.translations[z],!0,!0)}),r.language&&px.changeLanguage(r.language))},[r.translations,r.language]);const{editMode:P}=RV(r);D.useEffect(()=>{P&&!a&&g({highlightAllAnnotations:!0})},[P,a,g]);const H=D.useCallback(z=>z?t.some(q=>{const te=e[q.id];return te?Object.values(te).some(ee=>ee.json&&ee.json.items?ee.json.items.some($=>$.id===z&&$.maeData):!1):!1}):!1,[t,e]),B=D.useRef(y);D.useEffect(()=>{const z=!B.current,q=y;B.current=y,P&&z&&q&&i()},[P,y,i]);const G=D.useRef(null);D.useEffect(()=>{if(!P)return;const z=h?.selectedAnnotationId;z!==G.current&&(G.current=z,z&&y&&H(z)&&n("annotationCreation",{annotationid:z,position:"right"}))},[P,h?.selectedAnnotationId,y,H,n]);const V={containerRef:N,...h,listContainerComponent:Cy},Z=D.useMemo(()=>{const z=h?.canvasId;return!z||!e[z]?[]:Object.values(e[z]).flatMap(q=>q?.json?.items??[])},[h?.canvasId,e]),X=Z.some(z=>z["dbf:kind"]==="POI"||z["dbf:kind"]==="Journey"),k=D.useMemo(()=>({addCompanionWindow:n,annotationEditCompanionWindowIsOpened:y,annotationPreviewCompanionWindowIsOpened:S,annotationsOnCanvases:e,canvases:t,config:r,receiveAnnotation:s,storageAdapter:r.annotation.adapter,t:_,toggleSingleCanvasDialogOpen:L,windowId:h.windowId,windowViewType:v}),[n,y,S,e,t,r,s,_,L,h.windowId,v]);return A.jsxs(aO.Provider,{value:k,children:[A.jsx("div",{ref:w,style:{height:"100%",position:"relative"},children:X?A.jsx(o3,{canvasId:h.canvasId,deselectAnnotation:h.deselectAnnotation,hoverAnnotation:h.hoverAnnotation,hoveredAnnotationIds:h.hoveredAnnotationIds,index:h.index,items:Z,label:h.label,receiveAnnotation:s,selectAnnotation:h.selectAnnotation,selectedAnnotationId:h.selectedAnnotationId,storageAdapter:r.annotation.adapter,totalSize:h.totalSize,windowId:h.windowId}):A.jsx(c,{...V})}),v!=="single"&&A.jsx(x5,{handleClose:L,open:E,switchToSingleCanvasView:u})]})}zL.propTypes={addCompanionWindow:C.func.isRequired,annotationEditCompanionWindowIsOpened:C.bool.isRequired,annotationPreviewCompanionWindowIsOpened:C.bool.isRequired,annotationsOnCanvases:C.shape({id:C.string,isFetching:C.bool,json:C.shape({id:C.string,items:C.arrayOf(C.shape({body:C.shape({format:C.string,id:C.string,value:C.string}),drawingState:C.string,id:C.string,manifestNetwork:C.string,motivation:C.string,target:C.string,type:C.string})),type:C.string})}).isRequired,canvases:C.arrayOf(C.shape({id:C.string,index:C.number})).isRequired,config:C.shape({annotation:C.shape({adapter:C.func,editMode:C.bool}),language:C.string,translations:C.objectOf(C.object)}).isRequired,deselectAnnotation:C.func.isRequired,highlightAllAnnotations:C.bool.isRequired,receiveAnnotation:C.func.isRequired,switchToSingleCanvasView:C.func.isRequired,t:C.func.isRequired,TargetComponent:C.oneOfType([C.func,C.node]).isRequired,targetProps:C.object.isRequired,updateWindow:C.func.isRequired,windowViewType:C.string.isRequired};function Yoe(n,{targetProps:{windowId:e}}){const t=Pt.getVisibleCanvases(n,{windowId:e}),r={},i=Pt.getCompanionWindowsForContent(n,{content:"annotationCreation",windowId:e}),a=Object.keys(i).length===0,s=Pt.getCompanionWindowsForContent(n,{content:"mapsPoiPreview",windowId:e}),u=Object.keys(s).length===0;return t.forEach(c=>{const h=n.annotations[c.id];h&&(r[c.id]=h)}),{annotationEditCompanionWindowIsOpened:a,annotationPreviewCompanionWindowIsOpened:u,annotationsOnCanvases:r,canvases:t,config:{...n.config,translations:S5},highlightAllAnnotations:Pt.getWindow(n,{windowId:e}).highlightAllAnnotations,windowViewType:Pt.getWindowViewType(n,{windowId:e})}}const Zoe=(n,e)=>({addCompanionWindow:(t,r)=>n(Pt.addCompanionWindow(e.targetProps.windowId,{content:t,...r})),deselectAnnotation:()=>n(Pt.deselectAnnotation(e.targetProps.windowId)),receiveAnnotation:(t,r,i)=>n(Pt.receiveAnnotation(t,r,i)),switchToSingleCanvasView:()=>n(Pt.setWindowViewType(e.targetProps.windowId,"single")),updateWindow:t=>n(Pt.updateWindow(e.targetProps.windowId,t))}),qL={component:zL,mapDispatchToProps:Zoe,mapStateToProps:Yoe,mode:"wrap",target:"CanvasAnnotations"};function UL({mediaType:n,setCommentingType:e}){const{t}=Gs.useTranslation(),r=u=>e(u),{enabledTemplateTypes:i,externalTemplates:a}=$a.useSelector(u=>Pt.getConfig(u)).annotation,s=BL(t,a,i);return A.jsx(Joe,{children:n===Gi.AUDIO?A.jsx(ue.Grid,{container:!0,spacing:1,direction:"column",children:A.jsx(ue.Grid,{children:A.jsx(rn,{children:t("audio_not_supported")})})}):s.map(u=>u.isCompatibleWithMediaType(n)&&A.jsx(Koe,{children:A.jsx($oe,{id:u.id,onClick:()=>r(u),children:A.jsxs(ue.CardContent,{children:[A.jsxs(Qoe,{component:"div",children:[t(u.label),u.icon]}),A.jsx(ele,{component:"div",variant:"body2",children:t(u.description)})]})})},u.id))})}const Joe=xs.styled("div")(({theme:n})=>({display:"flex",flexDirection:"column",gap:n.spacing(3.75),margin:n.spacing(1.25)})),Koe=xs.styled(ue.Card)(({theme:n})=>({borderRadius:n.shape.borderRadius,boxShadow:n.shadows[1],border:`1px solid ${xs.alpha(n.palette.primary?.main??"#5A8264",.25)}`,transition:"box-shadow 120ms ease, transform 120ms ease, border-color 120ms ease","&:hover":{boxShadow:n.shadows[3],borderColor:xs.alpha(n.palette.primary?.main??"#5A8264",.5),transform:"translateY(-1px)"}})),$oe=xs.styled(ue.CardActionArea)(({theme:n})=>({borderRadius:n.shape.borderRadius,"&:hover":{backgroundColor:xs.alpha(n.palette.primary?.main??"#5A8264",.06)}})),Qoe=xs.styled(rn)(({theme:n})=>{const e=n.typography.formSectionTitle??{};return{display:"flex",justifyContent:"space-between",alignItems:"center",gap:n.spacing(1),color:e.color??n.palette.primary?.main??"#5A8264",fontSize:e.fontSize??n.typography.h6.fontSize,fontWeight:e.fontWeight??600,letterSpacing:e.letterSpacing??"0.02em",textTransform:e.textTransform??"none",lineHeight:1.25,marginBottom:n.spacing(.5)}}),ele=xs.styled(rn)(({theme:n})=>{const e=n.typography.subFormSectionTitle??{};return{color:n.palette.text.secondary,fontSize:e.fontSize??n.typography.body2.fontSize,fontWeight:e.fontWeight??300,letterSpacing:e.letterSpacing??0,lineHeight:e.lineHeight??n.typography.body2.lineHeight,textTransform:e.textTransform??"none"}});UL.propTypes={mediaType:C.string.isRequired,setCommentingType:C.func.isRequired};const tle=dr.createSvgIcon(A.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");function VL({templateType:n,setCommentingType:e,annotation:t}){const r=()=>{e(null)};return A.jsxs(ue.Grid,{container:!0,direction:"row",alignItems:"center",justifyContent:"space-between",sx:{marginRight:"10px"},spacing:2,children:[A.jsx(ue.Grid,{children:t.id==null&&A.jsx(Pt.MiradorMenuButton,{"aria-label":"back",TooltipProps:{title:"back"},children:A.jsx(tle,{onClick:r})})}),A.jsx(ue.Grid,{children:n.icon})]})}VL.propTypes={annotation:C.oneOfType([C.shape({body:C.shape({format:C.string,id:C.string,type:C.string,value:C.string}),drawingState:C.string,id:C.string,manifestNetwork:C.string,motivation:C.string,target:C.string}),C.string]).isRequired,setCommentingType:C.func.isRequired,templateType:C.shape({description:C.string,icon:C.element,id:C.string,label:C.string}).isRequired};function WL({playerReferences:n,t:e}){return A.jsxs(A.Fragment,{children:[A.jsx("h4",{children:"Debug info "}),A.jsx("p",{children:"Only visible in debug mode"}),A.jsx(rn,{children:n.getMediaType()}),A.jsxs(rn,{children:[e("scale"),":",n.getScale()]}),A.jsxs(rn,{children:[e("zoom"),":",n.getZoom()]}),A.jsxs(rn,{children:[e("image_true_size"),":",n.getMediaTrueWidth()," ","x",n.getMediaTrueHeight()]}),A.jsxs(rn,{children:[e("container_size"),":",n.getContainerWidth()," ","x",n.getContainerHeight()]}),A.jsxs(rn,{children:[e("image_displayed"),":",n.getDisplayedMediaWidth()," ","x",n.getDisplayedMediaHeight()]})]})}WL.propTypes={playerReferences:C.any.isRequired,t:C.func.isRequired};function XL({annotation:n,canvases:e,closeFormCompanionWindow:t,playerReferences:r,saveAnnotation:i,templateType:a,windowId:s}){const{t:u}=Gs.useTranslation(),c=$a.useSelector(y=>Pt.getConfig(y)).annotation,h=c.debug??!1,{externalTemplates:g}=c,v=D.useMemo(()=>Qy(u,g).find(y=>y.id===a.id)?.Component,[u,a.id,g]);return A.jsxs(ue.Grid,{container:!0,direction:"column",children:[A.jsx(nle,{children:v&&A.jsx(v,{annotation:n,canvases:e,closeFormCompanionWindow:t,playerReferences:r,saveAnnotation:i,t:u,windowId:s})}),h&&A.jsx(WL,{playerReferences:r,t:u})]})}const nle=xs.styled(ue.Grid)({margin:"0 10px"});XL.propTypes={annotation:C.shape({adapter:C.func,body:C.arrayOf(C.shape({type:C.string})),defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),drawingState:C.string,manifestNetwork:C.string,target:C.string}).isRequired,canvases:C.arrayOf(C.shape({id:C.string,index:C.number})).isRequired,closeFormCompanionWindow:C.func.isRequired,playerReferences:C.object.isRequired,saveAnnotation:C.func.isRequired,templateType:C.shape({description:C.string,icon:C.element,id:C.string,label:C.string}).isRequired,windowId:C.string.isRequired};function YL({id:n,windowId:e,mediaType:t}){const{t:r}=Gs.useTranslation();return A.jsx(Pt.CompanionWindow,{title:r("media_not_supported"),windowId:e,id:n,children:A.jsxs(ue.Grid,{container:!0,padding:1,spacing:1,children:[A.jsx(ue.Grid,{children:A.jsx(rn,{children:r("media_not_supported")})}),A.jsx(ue.Grid,{children:A.jsx(rn,{children:r("detected_media_type",{mediaType:t})})})]})})}YL.propTypes={id:C.string.isRequired,mediaType:C.string.isRequired,windowId:C.string.isRequired};function ZL({annotation:n,canvases:e,closeCompanionWindow:t,config:r,id:i,playerReferences:a,receiveAnnotation:s,windowId:u}){const{t:c}=Gs.useTranslation(),{enabledTemplateTypes:h,externalTemplates:g}=r.annotation,[v,y]=D.useState(null),[S,E]=D.useState(a.getMediaType()),[O,_]=D.useState(0),[,w]=D.useReducer(G=>G+1,0);!a.isInitializedCorrectly()&&O<10&&(console.log("AnnotationForm.js: retryCount",O),setTimeout(()=>{_(O+1),w()},100));const[N,L]=D.useState({height:window.innerHeight,width:window.innerWidth});if(!v)if(n.id)n.maeData&&n.maeData.templateType?y($g(c,n.maeData.templateType,g)??$g(c,gn.IIIF_TYPE)):y($g(c,gn.IIIF_TYPE));else{const{defaultForm:G}=Ym(r),V=BL(c,g,h).filter(Z=>Z.isCompatibleWithMediaType(S));G&&gA[G]?y($g(c,gA[G])):V.length===1&&y(V[0])}if(D.useEffect(()=>{y(null),E(a.getMediaType())},[e[0].index]),D.useEffect(()=>{const G=()=>{L({height:window.innerHeight,width:window.innerWidth})};return window.addEventListener("resize",G),()=>{window.removeEventListener("resize",G)}},[]),a.isInitCorrectly||a.isInitializedCorrectly(),!a.isInitCorrectly)return A.jsx(YL,{id:i,mediaType:S,windowId:u});const P=D.useCallback(()=>{t("annotationCreation",{id:i,position:"right"})},[t,i]),H=D.useRef(n);H.current=n;const B=G=>{const V=G,Z=V?.maeData?.templateType?$g(c,V.maeData.templateType,g):void 0,X=a.getCanvases().map(async k=>{let z;V?.maeData&&V.maeData.templateType?z=Z?await Z.convertToAnnotation(V,{canvas:k,playerReferences:a,windowId:u}):await rG(V,k,u,a):z=V;const q=r.annotation.adapter(k.id);return BB(k.id,q,s,z)});return Promise.all(X).then(()=>{P()})};return A.jsx(Pt.ConnectedCompanionWindow,{title:n.id?c("edit_annotation"):c("new_annotation"),windowId:u,id:i,children:v===null?A.jsx(UL,{setCommentingType:y,mediaType:S}):A.jsxs(ue.Grid,{container:!0,direction:"column",spacing:1,children:[A.jsx(ue.Grid,{container:!0,children:A.jsx(VL,{setCommentingType:y,templateType:v,annotation:n})}),A.jsx(ue.Grid,{children:A.jsx(XL,{annotation:n,canvases:e,closeFormCompanionWindow:P,playerReferences:a,saveAnnotation:B,templateType:v,windowId:u})})]})})}ZL.propTypes={annotation:C.oneOfType([C.shape({body:C.shape({format:C.string,id:C.string,type:C.string,value:C.string}),drawingState:C.string,id:C.string,manifestNetwork:C.string,motivation:C.string,target:C.string}),C.string]).isRequired,canvases:C.arrayOf(C.shape({id:C.string})).isRequired,closeCompanionWindow:C.func.isRequired,config:C.shape({annotation:C.shape({adapter:C.func,debug:C.bool,defaults:C.objectOf(C.oneOfType([C.bool,C.func,C.number,C.string])),enabledTemplateTypes:C.arrayOf(C.string),externalTemplates:C.arrayOf(C.object)}),language:C.string,translations:C.objectOf(C.object)}).isRequired,id:C.string.isRequired,playerReferences:C.object.isRequired,receiveAnnotation:C.func.isRequired,windowId:C.string.isRequired};class rle{actions;mediaType;canvases;windowId;overlay;isInitCorrectly;constructor(e,t,r,i){this.actions=i,this.media=r,this.mediaType=ile(e,t),this.canvases=Pt.getVisibleCanvases(e,{windowId:t}),this.windowId=t,this.isInitCorrectly=!1,this.isInitializedCorrectly()&&(this.mediaType===Gi.IMAGE?this.overlay={canvasHeight:this.media.current.canvas.clientHeight,canvasWidth:this.media.current.canvas.clientWidth,containerHeight:this.media.current.canvas.clientHeight,containerWidth:this.media.current.canvas.clientWidth}:console.error("Unknown media type"))}sleep(e){return new Promise(t=>{setTimeout(t,e)})}isInitializedCorrectly(){return this.isInitCorrectly=this.media&&(this.mediaType===Gi.IMAGE&&this.media.current&&this.media.current.canvas||this.mediaType===Gi.VIDEO&&this.media.video)&&this.mediaType!==Gi.UNKNOWN&&this.mediaType!==Gi.AUDIO,this.isInitCorrectly}getMediaType(){return this.mediaType}getCanvases(){return this.canvases}getAudioElement(){return this.mediaType===Gi.AUDIO?document.querySelector("audio"):(console.error("Something is wrong with audio ressource"),null)}getWindowId(){return this.windowId}getCanvasHeight(){return this.overlay.canvasHeight}getCanvasWidth(){return this.overlay.canvasWidth}getContainer(){return this.mediaType===Gi.IMAGE?this.media.current.container:null}getContainerHeight(){return this.overlay.containerHeight}getContainerWidth(){return this.overlay.containerWidth}getDisplayedMediaHeight(){if(this.mediaType===Gi.IMAGE){const e=this.media.current;if(e){const t=this.getMediaTrueHeight()*e.viewport.getZoom(),r=e.container.clientWidth;return Math.round(r*t)}}}getDisplayedMediaWidth(){if(this.mediaType===Gi.IMAGE){const e=this.media.current;if(e&&e.world.getItemCount()>0){const t=this.getMediaTrueWidth()*e.viewport.getZoom(),r=e.container.clientWidth;return Math.round(r*t)}}}getMediaTrueHeight(){if(this.mediaType===Gi.IMAGE)return this.canvases[0].__jsonld.height;console.error("Unknown media type")}getMediaTrueWidth(){if(this.mediaType===Gi.IMAGE)return this.canvases[0].__jsonld.width}getScale(){return this.isInitializedCorrectly()?this.getDisplayedMediaWidth()/this.getMediaTrueWidth():null}getZoom(){if(this.mediaType===Gi.IMAGE){const e=this.media.current.viewport.getZoom(),t=this.media.current.viewport.getMaxZoom();let r=e/t;return r=Math.round(r*100)/100,r}}getImagePosition(){if(this.mediaType===Gi.IMAGE){const e=this.media.current;if(e){const r=e.world.getItemAt(0).getBounds(),i=e.viewport.viewportToViewerElementCoordinates(r.getTopLeft());return{x:Math.round(i.x),y:Math.round(i.y)}}}}getTargetStrokeWidth(){return Math.max(this.getDisplayedMediaWidth()/500,3)}}function ile(n,e){const t=Pt.getVisibleCanvasAudioResources(n,{windowId:e})||[];return(Pt.getVisibleCanvasVideoResources(n,{windowId:e})||[]).length>0?Gi.VIDEO:t.length>0?Gi.AUDIO:Gi.IMAGE}const ale=(n,{id:e,windowId:t})=>({closeCompanionWindow:()=>n(Pt.removeCompanionWindow(t,e)),receiveAnnotation:(r,i,a)=>n(Pt.receiveAnnotation(r,i,a))});function sle(n,{id:e,windowId:t}){const i=Pt.getCompanionWindow(n,{companionWindowId:e,windowId:t}),{annotationid:a}=i,s=Pt.OSDReferences.get(t),u=new rle(n,t,s,XF),c=Pt.getVisibleCanvases(n,{windowId:t});let h=Pt.getPresentAnnotationsOnSelectedCanvases(n,{windowId:t}).flatMap(g=>g.json.items||[]).find(g=>g.id===a);return h||(h={id:null,maeData:{templateType:null}}),{annotation:h,canvases:c,config:{...n.config,translations:S5},currentTime:null,playerReferences:u}}const JL={companionWindowKey:"annotationCreation",component:ZL,mapDispatchToProps:ale,mapStateToProps:sle};function KL({PluginComponents:n=[],TargetComponent:e,targetProps:t}){return t.hasAnyAnnotations=!0,A.jsx(e,{...t,PluginComponents:n})}KL.propTypes={PluginComponents:C.array.isRequired,TargetComponent:C.oneOfType([C.func,C.node]).isRequired,targetProps:C.object.isRequired};const $L={component:KL,mode:"wrap",target:"WindowSideBarButtons"};var QL=function(e){return"@@redux-saga/"+e},ole=QL("IO"),lle=QL("MULTICAST"),ule=function(e){return e==null},cle=function(e){return e!==void 0},kd=function(e){return typeof e=="function"},ek=function(e){return typeof e=="string"},tk=Array.isArray,y5=function(e){return e&&(ek(e)||fle(e)||kd(e)||tk(e)&&e.every(y5))},l3=function(e){return e&&kd(e.take)&&kd(e.close)},dle=function(e){return kd(e)&&e.hasOwnProperty("toString")},fle=function(e){return!!e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype},hle=function(e){return l3(e)&&e[lle]},ple=function(e){return e},gle=function(e){throw e},mle=function(e){return{value:e,done:!0}};function vle(n,e,t){e===void 0&&(e=gle),t===void 0&&(t="iterator");var r={meta:{name:t},next:n,throw:e,return:mle,isSagaIterator:!0};return typeof Symbol<"u"&&(r[Symbol.iterator]=function(){return r}),r}var mE="TAKE",yle="PUT",ble="ALL",xle="CALL",Sle="FORK",Cle="SELECT",Rc=function(e,t){var r;return r={},r[ole]=!0,r.combinator=!1,r.type=e,r.payload=t,r};function _le(n,e){if(n===void 0&&(n="*"),y5(n))return Rc(mE,{pattern:n});if(hle(n)&&cle(e)&&y5(e))return Rc(mE,{channel:n,pattern:e});if(l3(n))return Rc(mE,{channel:n})}function Ele(n,e){return ule(e)&&(e=n,n=void 0),Rc(yle,{channel:n,action:e})}function Tle(n){var e=Rc(ble,n);return e.combinator=!0,e}function nk(n,e){var t=null,r;return kd(n)?r=n:(tk(n)?(t=n[0],r=n[1]):(t=n.context,r=n.fn),t&&ek(r)&&kd(t[r])&&(r=t[r])),{context:t,fn:r,args:e}}function rk(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Rc(xle,nk(n,t))}function ik(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Rc(Sle,nk(n,t))}function wle(n){n===void 0&&(n=ple);for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Rc(Cle,{selector:n,args:t})}var G7=function(e){return{done:!0,value:e}},vE={};function Ale(n){return l3(n)?"channel":dle(n)?String(n):kd(n)?n.name:String(n)}function Rle(n,e,t){var r,i,a,s=e;function u(c,h){if(s===vE)return G7(c);if(h&&!i)throw s=vE,h;r&&r(c);var g=h?n[i](h):n[s]();return s=g.nextState,a=g.effect,r=g.stateUpdater,i=g.errorState,s===vE?G7(c):a}return vle(u,function(c){return u(null,c)},t)}function Ile(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];var a={done:!1,value:_le(n)},s=function(g){return{done:!1,value:ik.apply(void 0,[e].concat(r,[g]))}},u,c=function(g){return u=g};return Rle({q1:function(){return{nextState:"q2",effect:a,stateUpdater:c}},q2:function(){return{nextState:"q1",effect:s(u)}}},"q1","takeEvery("+Ale(n)+", "+e.name+")")}function Ole(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];return ik.apply(void 0,[Ile,n,e].concat(r))}function*Dle(n){const e=yield wle(Pt.getConfig);if(e&&e.annotation.adapter){const t=e.annotation.adapter(n),r=yield rk([t,t.all]);r&&(yield Ele(Pt.receiveAnnotation(n,t.annotationPageId,r)))}}function*Nle(n){const{canvasId:e}=n;yield rk(Dle,e)}function*Mle(){yield Tle([Ole(Pt.ActionTypes.SET_CANVAS,Nle)])}const Lle={saga:Mle},kle=(n,e)=>{console.error(`AiinotateAdapter.${n} error: `,e)},Ple=async n=>{if(!n.ok)throw new Error(`Fetch error: response ${n.status} on url: ${n.url}`)};class jle{constructor(e,t,r,i){if(![2,3].includes(t))throw new Error(`AiiinotateAdapter: unrecognized value for 'iiifPresentationVersion'. expected one of [2,3], got '${t}'`);this.user=i||Y1,this.canvasId=r,this.iiifPresentationVersion=t,this.endpointUrl=e,this.endpointUrlAnnotations=`${this.endpointUrl}/annotations/${t}`,this.endpointUrlManifests=`${this.endpointUrl}/manifests/${t}`}getStorageAdapterUser(){return this.user}get annotationPageId(){return`${this.endpointUrlAnnotations}/search?canvasUri=${this.canvasId}`}maybeConvert(e){return this.iiifPresentationVersion===2?iG(e):e}handleResponse=async(e,t)=>(await Ple(t),this.all());handleError=(e,t)=>(kle(e,t),this.all());async create(e){return e=this.maybeConvert(e),fetch(`${this.endpointUrlAnnotations}/create`,{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async t=>await this.handleResponse("create",t)).catch(t=>this.handleError("create",t))}async update(e){return e=this.maybeConvert(e),fetch(`${this.endpointUrlAnnotations}/update`,{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async t=>await this.handleResponse("update",t)).catch(t=>this.handleError("update",t))}async delete(e){return fetch(`${this.endpointUrlAnnotations}/delete?uri=${e}`,{method:"DELETE"}).then(async t=>await this.handleResponse("delete",t)).catch(t=>this.handleError("delete",t))}async get(e){return await fetch(e)}async all(){let e=[],t=this.annotationPageId,r,i;for(;t&&t.length;)r=await fetch(this.annotationPageId),i=await r.json(),e=[...e,...i.resources],t=i.next;const a=await this.iiifPresentationVersion===2?sG(e,this.annotationPageId):e;return a.items=a.items.map(w5),a}}const Fle={AiiinotateAdapter:jle,LocalStorageAdapter:Z7},Ble=[K7,Q7,qL,JL,$L,Lle];exports.annotationAdapters=Fle;exports.annotationCreationCompanionWindowPlugin=JL;exports.canvasAnnotationsPlugin=qL;exports.convertIIIFAnnoToMaeData=w5;exports.default=Ble;exports.externalStorageAnnotationPlugin=Q7;exports.miradorAnnotationPlugin=K7;exports.templateKit=Fc;exports.windowSideBarButtonsPlugin=$L;
|
|
283
283
|
//# sourceMappingURL=mirador-annotation-editor.cjs.js.map
|