dbf-mirador-annotation-editor 1.3.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.
- package/LICENSE +202 -0
- package/README.md +229 -0
- package/dist/index.css +9 -0
- package/dist/index.d.ts +4 -0
- package/dist/mirador-annotation-editor.cjs.js +239 -0
- package/dist/mirador-annotation-editor.cjs.js.map +1 -0
- package/dist/mirador-annotation-editor.es.js +44352 -0
- package/dist/mirador-annotation-editor.es.js.map +1 -0
- package/package.json +134 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));let u=require("react"),d=l(u,1);u=l(u);let f=require("prop-types");f=l(f);let p=require("react/jsx-runtime"),m=require("dbf-mirador");m=l(m);let h=require("@mui/material"),g=require("@mui/material/styles"),_=require("react-i18next"),v=require("@mui/material/Button");v=l(v);let y=require("@mui/material/Dialog");y=l(y);let b=require("@mui/material/DialogActions");b=l(b);let x=require("@mui/material/DialogContent");x=l(x);let S=require("@mui/material/DialogContentText");S=l(S);let C=require("@mui/material/DialogTitle");C=l(C);let w=require("@mui/material/Typography");w=l(w);let T=require("@mui/material/ListItemIcon");T=l(T);let E=require("@mui/material/ListItemText");E=l(E);let D=require("@mui/material/MenuList");D=l(D);let O=require("@mui/material/MenuItem");O=l(O);let k=require("@mui/system"),A=require("i18next");A=l(A);let j=require("@mui/material/ToggleButton");j=l(j);let M=require("@mui/material/ToggleButtonGroup");M=l(M);let ee=require("react-dom");ee=l(ee);let N=require("@mui/material/SvgIcon");N=l(N);let P=require("@emotion/react"),F=require("@mui/material/utils");var I=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z`}),`AddBox`),L=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z`}),`GetApp`),te=o((e=>{var t=require("react");function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useSyncExternalStore,a=t.useRef,o=t.useEffect,s=t.useMemo,c=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,l,u){var d=a(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,a=e,e=l(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return o=t}return o=e}if(t=o,r(a,e))return t;var n=l(e);return u!==void 0&&u(t,n)?(a=e,t):(a=e,o=n)}var i=!1,a,o,s=n===void 0?null:n;return[function(){return e(t())},s===null?void 0:function(){return e(s())}]},[t,n,l,u]);var p=i(e,d[0],d[1]);return o(function(){f.hasValue=!0,f.value=p},[p]),c(p),p}})),ne=o((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=require("react"),r=typeof Object.is==`function`?Object.is:t,i=n.useSyncExternalStore,a=n.useRef,o=n.useEffect,s=n.useMemo,c=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,l,u){var d=a(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,a=e,e=l(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return o=t}return o=e}if(t=o,r(a,e))return t;var n=l(e);return u!==void 0&&u(t,n)?(a=e,t):(a=e,o=n)}var i=!1,a,o,s=n===void 0?null:n;return[function(){return e(t())},s===null?void 0:function(){return e(s())}]},[t,n,l,u]);var p=i(e,d[0],d[1]);return o(function(){f.hasValue=!0,f.value=p},[p]),c(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),re=o(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?te():ne()}))(),ie=Symbol.for(`react-redux-context`),ae=typeof globalThis<`u`?globalThis:{};function oe(){if(!d.createContext)return{};let e=ae[ie]??=new Map,t=e.get(d.createContext);return t||(t=d.createContext(null),process.env.NODE_ENV!==`production`&&(t.displayName=`ReactRedux`),e.set(d.createContext,t)),t}var se=oe();function ce(e=se){return function(){let t=d.useContext(e);if(process.env.NODE_ENV!==`production`&&!t)throw Error(`could not find react-redux context value; please ensure the component is wrapped in a <Provider>`);return t}}var le=ce();function ue(e=se){let t=e===se?le:ce(e),n=()=>{let{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var de=ue();function fe(e=se){let t=e===se?de:ue(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var pe=fe(),me=(e,t)=>e===t;function he(e=se){let t=e===se?le:ce(e),n=(e,n={})=>{let{equalityFn:r=me}=typeof n==`function`?{equalityFn:n}:n;if(process.env.NODE_ENV!==`production`){if(!e)throw Error(`You must pass a selector to useSelector`);if(typeof e!=`function`)throw Error(`You must pass a function as a selector to useSelector`);if(typeof r!=`function`)throw Error(`You must pass a function as an equality function to useSelector`)}let i=t(),{store:a,subscription:o,getServerState:s}=i,c=d.useRef(!0),l=d.useCallback({[e.name](t){let a=e(t);if(process.env.NODE_ENV!==`production`){let{devModeChecks:o={}}=typeof n==`function`?{}:n,{identityFunctionCheck:s,stabilityCheck:l}=i,{identityFunctionCheck:u,stabilityCheck:d}={stabilityCheck:l,identityFunctionCheck:s,...o};if(d===`always`||d===`once`&&c.current){let n=e(t);if(!r(a,n)){let r;try{throw Error()}catch(e){({stack:r}=e)}console.warn(`Selector `+(e.name||`unknown`)+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
|
|
2
|
+
Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,{state:t,selected:a,selected2:n,stack:r})}}if((u===`always`||u===`once`&&c.current)&&a===t){let t;try{throw Error()}catch(e){({stack:t}=e)}console.warn(`Selector `+(e.name||`unknown`)+` returned the root state when called. This can lead to unnecessary rerenders.
|
|
3
|
+
Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:t})}c.current&&=!1}return a}}[e.name],[e]),u=(0,re.useSyncExternalStoreWithSelector)(o.addNestedSub,a.getState,s||a.getState,l,r);return d.useDebugValue(u),u};return Object.assign(n,{withTypes:()=>n}),n}var ge=he(),_e=`mae-save-annotation`,ve=`mae-delete-shape`;function ye(e,t){let n=(0,m.getCompanionWindowsForContent)(e,{content:`annotationCreation`,windowId:t});return Object.values(n).filter(e=>e?.id)}function be(e,t,n){ye(e,n).forEach(e=>{t((0,m.removeCompanionWindow)(n,e.id))})}function xe({state:e,dispatch:t,windowId:n,config:r}){if(ye(e,n).length>0){document.dispatchEvent(new CustomEvent(ve));return}let i=(0,m.getSelectedAnnotationId)(e,{windowId:n});if(!i)return;let a=r?.annotation?.adapter;a&&((0,m.getVisibleCanvases)(e,{windowId:n}).forEach(e=>{let n=a(e.id);n.delete(i).then(r=>{t((0,m.receiveAnnotation)(e.id,n.annotationPageId,r))})}),t((0,m.deselectAnnotation)(n)))}function Se({state:e,windowId:t}){ye(e,t).length!==0&&document.dispatchEvent(new CustomEvent(_e))}function Ce({state:e,dispatch:t,windowId:n}){ye(e,n).length>0||t((0,m.addCompanionWindow)(n,{content:`annotationCreation`,position:`right`}))}function we({state:e,dispatch:t,windowId:n}){if((0,m.getSelectedAnnotationId)(e,{windowId:n})){t((0,m.deselectAnnotation)(n));return}be(e,t,n)}var Te={create:{description:`Create a new annotation`,handler:Ce,keys:[`a`]},delete:{description:`Delete selected shape or annotation`,handler:xe,keys:[`Delete`,`Backspace`]},escape:{description:`Deselect annotation / close companion window`,handler:we,keys:[`Escape`]},save:{description:`Save current annotation`,handler:Se,keys:[`Enter`]}},Ee={bgcolor:`rgba(255,255,255,0.15)`,border:`1px solid rgba(255,255,255,0.3)`,borderRadius:`4px`,fontSize:`0.75em`,ml:1,my:1,px:.5,py:-.25};function De(e){return Object.prototype.hasOwnProperty.call(Te,e)?Te[e].keys:null}function Oe({label:e,action:t}){let n=De(t);return n?(0,p.jsxs)(h.Typography,{variant:`body2`,component:`span`,sx:{alignItems:`center`,display:`inline-flex`},children:[e,n.map(e=>(0,p.jsx)(h.Typography,{component:`HotKey`,variant:`caption`,sx:Ee,children:e},e))]}):e}Oe.propTypes={action:f.default.string.isRequired,label:f.default.string.isRequired};function ke({handleClose:e,open:t,switchToSingleCanvasView:n}){let{t:r}=(0,_.useTranslation)(),i=(0,u.useCallback)(()=>{n(),e()},[e,n]),a=(0,u.useCallback)((t,n)=>{e()},[e]);return(0,p.jsxs)(y.default,{"aria-labelledby":`single-canvas-dialog-title`,fullWidth:!0,maxWidth:`sm`,onClose:a,open:t,children:[(0,p.jsx)(C.default,{id:`single-canvas-dialog-title`,children:(0,p.jsx)(w.default,{variant:`h2`,component:`span`,children:r(`switch_view_h2`)})}),(0,p.jsx)(x.default,{children:(0,p.jsx)(S.default,{variant:`body1`,color:`inherit`,children:r(`switch_view_content`)})}),(0,p.jsxs)(b.default,{children:[(0,p.jsx)(h.Tooltip,{title:(0,p.jsx)(Oe,{label:r(`cancel`),action:`escape`}),children:(0,p.jsx)(v.default,{onClick:e,children:r(`cancel`)})}),(0,p.jsx)(h.Tooltip,{title:r(`switch_view`),children:(0,p.jsx)(v.default,{color:`primary`,onClick:i,variant:`contained`,children:r(`switch_view`)})})]})]})}ke.propTypes={handleClose:f.default.func.isRequired,open:f.default.bool.isRequired,switchToSingleCanvasView:f.default.func.isRequired};var Ae=(0,k.styled)(O.default)(({theme:e})=>({"&:focus":{backgroundColor:e.palette.action.focus},"&:hover":{backgroundColor:e.palette.action.hover}}));function je({canvases:e,config:t,handleClose:n,open:r}){let[i,a]=(0,u.useState)([]),{t:o}=(0,_.useTranslation)();(0,u.useEffect)(()=>{r&&(async()=>{let n=async(e,n)=>{let r=t.annotation.adapter(n.id),i=await e,a=await r.all();if(!a)return i;let o=n.__jsonld&&n.__jsonld.label||n.id,s=new Blob([JSON.stringify(a)],{type:`application/json`}),c=window.URL.createObjectURL(s);return[...i,{canvasId:n.id,id:a.id||a[`@id`],label:o,url:c}]};if(e?.length>0){let t=await e.reduce(n,[]);a(t)}})()},[e,t,r]);let s=()=>{i.forEach(e=>{try{URL.revokeObjectURL(e.url)}catch{}}),a([]),n()};return(0,p.jsxs)(y.default,{"aria-labelledby":`annotation-export-dialog-title`,id:`annotation-export-dialog`,onClose:(e,t)=>{if(t===`escapeKeyDown`||t===`backdropClick`){s();return}n()},open:r,children:[(0,p.jsx)(C.default,{id:`annotation-export-dialog-title`,children:(0,p.jsx)(w.default,{variant:`h2`,component:`span`,children:o(`export_annotation`)})}),(0,p.jsx)(x.default,{children:i.length===0?(0,p.jsx)(w.default,{variant:`body1`,children:o(`no_annotation`)}):(0,p.jsx)(D.default,{children:i.map(e=>(0,p.jsxs)(Ae,{component:`a`,"aria-label":o(`export_annotation_for`,{label:e.canvasId}),href:e.url,download:`${e.id}.json`,children:[(0,p.jsx)(T.default,{children:(0,p.jsx)(L,{})}),(0,p.jsx)(E.default,{children:o(`export_annotation_for`,{label:e.canvasId})})]},e.canvasId))})})]})}je.propTypes={canvases:f.default.arrayOf(f.default.shape({id:f.default.string})).isRequired,config:f.default.shape({annotation:f.default.shape({adapter:f.default.func})}).isRequired,handleClose:f.default.func.isRequired,open:f.default.bool.isRequired};var Me=class{constructor(e,t){this.annotationPageId=e,this.user=t||R}getStorageAdapterUser(){return this.user}async create(e){let t={id:this.annotationPageId,items:[],type:`AnnotationPage`},n=await this.all()||t;return n.items.push(e),localStorage.setItem(this.annotationPageId,JSON.stringify(n)),console.log(`CREATE ANNOTATION`,n),n}async update(e){let t=await this.all();if(t){let n=t.items.findIndex(t=>t.id===e.id);return t.items.splice(n,1,e),localStorage.setItem(this.annotationPageId,JSON.stringify(t)),console.log(`UPDATE ANNOTATION`,t),t}return null}async delete(e){let t=await this.all();return t&&(t.items=t.items.filter(t=>t.id!==e)),localStorage.setItem(this.annotationPageId,JSON.stringify(t)),t}async get(e){let t=await this.all();return t?t.items.find(t=>t.id===e):null}async all(){return JSON.parse(localStorage.getItem(this.annotationPageId))}},R=`Anonymous`,Ne={en:{add_a_circle:`Add a circle`,add_a_free_hand_shape:`Add a free hand shape`,add_a_line:`Add a line`,add_a_rectangle:`Add a rectangle`,add_an_arrow_shape:`Add an arrow shape`,add_an_ellipse:`Add an ellipse`,add_image_from_url:`Add image from URL`,anonymous:`Anonymous`,applyMerge:`Apply`,arrow:`Arrow`,border_color:`Border color`,cancel:`Cancel`,circle:`Circle`,click_on_canvas_to_write:` Click on canvas to write text`,click_to_delete_shape:`Click on shape to delete it`,confirmTemplateSelectionContent:`Your note already has content. Review the template below, then edit your note to merge in what you need.`,confirmTemplateSelectionTitle:`Merge template with your note`,container_size:`Container Size`,create_annotation:`Create annotation`,createdByOn:`Created by {{creator}}, {{creationDate}}`,currentNoteContent:`Your note`,debugAnnotation:`Debug annotation in console`,delete:`Delete`,delete_all:`Delete all`,deleteAnnotation:`Delete`,detected_media_type:`We detect {{mediaType}} media type.`,document:`Document`,drawings_and_text_in_overlay:`Drawings and text in overlay`,edit:`Edit`,edit_annotation:`Edit annotation`,edit_iiif_json_code:`Edit directly the IIIF json code`,ellipse:`Ellipse`,expert_mode:`Expert mode`,export_annotation:`Export Annotations`,export_annotation_for:`Export annotation for {{label}}`,export_local_annotation:`Export local annotations for visible items`,fill_color:`Fill color`,freehand:`Freehand`,image:`Image`,image_displayed:`Image Displayed`,image_in_overlay_with_note:`Image in overlay with a note`,image_true_size:`Image True Size`,imageUrl:`Image URL`,invalid_url:`Invalid URL`,lastEditedByOn:`Last edit by {{lastEditor}}, {{lastSavedDate}}`,line:`Line`,line_weight:`Line weight`,loading_failed:`Loading failed`,maev_github_link:`https://github.com/SCENE-CE/mirador-annotation-editor-video`,manifest_link:`Manifest annotation`,manifest_link_with_note:`Manifest with note`,manifest_url:`Manifest URL`,media_not_supported:`Media not supported`,media_not_supported_text:`The media you try to annotate is not supported by this instance at the moment`,metadata:`Metadata`,new_annotation:`New annotation`,no_annotation:`No annotations stored yet.`,note:`Note`,object_list:`Object list`,onlyOneImageAllowed:`Only one image is allowed`,overlay:`Overlay`,poi:`POI`,poi_add_description_item:`Add a description element`,poi_click_to_place:`Click on the image to place the POI marker. Click again to move it.`,poi_description:`Point of interest with a target, a description and optional links`,poi_description_item_text_value:`Text`,poi_description_item_type:`Type`,poi_description_item_type_image:`Image`,poi_description_item_type_sound:`Sound`,poi_description_item_type_text:`Text`,poi_description_item_url_value:`URL`,poi_description_section:`Description`,poi_move_description_item_down:`Move down`,poi_move_description_item_up:`Move up`,poi_remove_description_item:`Remove this description element`,poi_target_must_be_point:`Click on the image to set this POI's location.`,poi_title:`Title`,polygon:`Polygon`,pressEnterOrClickFirstPointToClose:`Click first point or press "Shift" to close polygon, "Tab" to leave open`,pressEnterToAddTag:`Add your tag and press "Enter"`,pressEscapeToFinish:`Press "Esc" to finish the line`,rectangle:`Rectangle`,replace:`Replace`,save:`Save`,scale:`Scale`,select_cursor:`Select Cursor`,selected_object:`Selected object`,selectedTemplateContent:`Selected template`,shape:`Shape`,shape_selection:`Draw shapes`,shapes:`Shapes`,spatialTarget:`Shapes`,style:`Style`,style_selection:`Style selection`,switch_view:`Switch to single view`,switch_view_content:`Annotations can only be edited in single canvas view type.
|
|
4
|
+
Switch view type to single view now?`,switch_view_h2:`Switch view type to single view?`,tag:`Tag`,tag_with_target:`Tag with target`,tags:`Tags`,tagsPlaceholder:`Add tags ...`,target:`Target`,text:`Text`,textual_note_with_target:`Textual note with target`,tool_selection:`Tool Selection`,unsupported_media_message:`Your current canvas media type is not supported by the annotation editor.`,useTemplate:`Use a template`,video_annotation_instruction:`If you want to annotate video media, you must install MAEV to create and edit annotations on video:`,your_tag_here:`Your tag here:`,zoom:`Zoom`},fr:{add_a_circle:`Ajouter un cercle`,add_a_free_hand_shape:`Ajouter une forme à main levée`,add_a_line:`Ajouter une ligne`,add_a_rectangle:`Ajouter un rectangle`,add_an_arrow_shape:`Ajouter une flèche`,add_an_ellipse:`Ajouter une ellipse`,add_image_from_url:`Ajouter une image à partir d'une URL`,anonymous:`Anonyme`,applyMerge:`Appliquer`,arrow:`Flèche`,border_color:`Couleur de bordure`,cancel:`Annuler`,circle:`Cercle`,click_on_canvas_to_write:`Cliquer sur le canvas pour écrire du texte`,click_to_delete_shape:`Cliquer sur une forme pour la supprimer`,confirmTemplateSelectionContent:`Votre note contient déjà du texte. Consultez le modèle ci-dessous, puis modifiez votre note pour y fusionner ce dont vous avez besoin.`,confirmTemplateSelectionTitle:`Fusionner le modèle avec votre note`,container_size:`Taille du conteneur`,create_annotation:`Créer une annotation`,createdByOn:`Créé par {{creator}}, {{creationDate}}`,currentNoteContent:`Votre note`,debugAnnotation:`Voir l'annotation dans la console`,delete:`Supprimer`,deleteAnnotation:`Supprimer`,delete_all:`Tout supprimer`,detected_media_type:`Nous détectons un média de type {{mediaType}}.`,document:`Document`,drawings_and_text_in_overlay:`Dessins et texte en superposition`,edit:`Éditer`,edit_annotation:`Editer l'annotation`,edit_iiif_json_code:`Modifier directement le code JSON IIIF`,ellipse:`Ellipse`,expert_mode:`Mode expert`,export_annotation:`Exporter les annotations`,export_annotation_for:`Exporter les annotations pour {{label}}`,export_local_annotation:`Exporter les annotations locales pour les éléments visibles`,fill_color:`Couleur de remplissage`,freehand:`Main levée`,image:`Image`,imageUrl:`URL de l'image`,image_displayed:`Image affichée`,image_in_overlay_with_note:`Image en superposition avec une note`,image_true_size:`Taille réelle de l'image`,invalid_url:`URL invalide`,lastEditedByOn:`Dernière modification par {{lastEditor}}, {{lastSavedDate}}`,line:`Ligne`,line_weight:`Épaisseur de ligne`,loading_failed:`Échec du chargement`,maev_github_link:`https://github.com/SCENE-CE/mirador-annotation-editor-video`,manifest_link:`Lien vers un manifest`,manifest_link_with_note:`Manifest avec description`,manifest_url:`URL du manifeste`,media_not_supported:`Média non pris en charge`,media_not_supported_text:`Ce média n'est pas encore supporté par cette instance.`,metadata:`Métadonnées`,new_annotation:`Nouvelle annotation`,no_annotation:`Aucune annotation enregistrée pour le moment.`,note:`Note`,object_list:`Liste des objets`,onlyOneImageAllowed:`Une seule image par annotation`,overlay:`Dessin`,poi:`POI`,poi_add_description_item:`Ajouter un élément de description`,poi_click_to_place:`Cliquez sur l'image pour placer le marqueur du POI. Cliquez à nouveau pour le déplacer.`,poi_description:`Point d'intérêt avec une cible, une description et des liens optionnels`,poi_description_item_text_value:`Texte`,poi_description_item_type:`Type`,poi_description_item_type_image:`Image`,poi_description_item_type_sound:`Son`,poi_description_item_type_text:`Texte`,poi_description_item_url_value:`URL`,poi_description_section:`Description`,poi_move_description_item_down:`Déplacer vers le bas`,poi_move_description_item_up:`Déplacer vers le haut`,poi_remove_description_item:`Supprimer cet élément de description`,poi_target_must_be_point:`Cliquez sur l'image pour définir la position de ce POI.`,poi_title:`Titre`,polygon:`Polygone`,pressEnterOrClickFirstPointToClose:`Cliquez sur le premier point ou appuyez sur "Maj" pour fermer le polygone, "Tab" pour laisser ouvert`,pressEnterToAddTag:`Valider avec "Entrée"`,pressEscapeToFinish:`Appuyez sur "Échap" pour terminer la ligne`,rectangle:`Rectangle`,replace:`Remplacer`,save:`Sauvegarder`,scale:`Échelle`,select_cursor:`Sélectionner le curseur`,selected_object:`Objet sélectionné`,selectedTemplateContent:`Modèle sélectionné`,shape:`Forme`,shape_selection:`Dessin de forme`,shapes:`Formes`,spatialTarget:`Formes`,style:`Style`,style_selection:`Sélection du style`,switch_view:`Passer à la vue simple`,switch_view_content:`Les annotations peuvent seulement être éditées en vue simple.
|
|
5
|
+
Passer en vue simple simplement ?`,switch_view_h2:`Changer le type de vue en vue simple?`,tag:`Étiquette`,tag_with_target:`Étiquette avec cible`,tags:`Étiquettes`,tagsPlaceholder:`Ajouter une étiquette...`,target:`Cible`,text:`Texte`,textual_note_with_target:`Note textuelle avec cible`,tool_selection:`Sélection d’outil`,unsupported_media_message:`Le type de média de votre canvas actuel n'est pas pris en charge par l'éditeur d'annotations.`,useTemplate:`Utiliser un modèle`,video_annotation_instruction:`Si vous souhaitez annoter des vidéos, vous devez installer le plugin Mirador Annotation Editor Video (MAEV) pour créer et modifier des annotations sur les vidéos :`,your_tag_here:`Votre étiquette`,zoom:`Zoom`}},Pe=(0,g.styled)(`div`)(()=>({display:`flex`}));function Fe({targetProps:e,TargetComponent:t,annotationEditCompanionWindowIsOpened:n}){let{t:r}=(0,_.useTranslation)(),[i,a]=(0,u.useState)(!1),[o,s]=(0,u.useState)(!1),[c,l]=(0,u.useState)(null),d=pe(),f=(t,n)=>{l(e.windowId),d((0,m.addCompanionWindow)(e.windowId,{content:t,...n}))};(0,u.useEffect)(()=>{},[n]);let g=()=>{d((0,m.setWindowViewType)(e.windowId,`single`))},v=ge(t=>(0,m.getWindowViewType)(t,{windowId:e.windowId})),y=ge(t=>(0,m.getVisibleCanvases)(t,{windowId:e.windowId})),b=ge(e=>e.config),x=(0,u.useCallback)(e=>{f(`annotationCreation`,{position:`right`})},[e.windowId]),S=(0,u.useCallback)(()=>{s(!o)},[o]),C=(0,u.useCallback)(e=>{a(!i)},[i]),w=b?.annotation?.adapter&&b.annotation.adapter(`poke`),T=b.annotation&&w instanceof Me&&b.annotation.exportLocalStorageAnnotations;return(0,p.jsxs)(Pe,{children:[(0,p.jsx)(t,{...e}),b?.annotation?.readonly===!0?null:(0,p.jsx)(h.Tooltip,{title:(0,p.jsx)(Oe,{label:r(`create_annotation`),action:`create`}),children:(0,p.jsx)(`span`,{children:(0,p.jsx)(m.MiradorMenuButton,{"aria-label":r(`create_annotation`),onClick:v===`single`?x:S,size:`small`,disabled:!n,children:(0,p.jsx)(I,{})})})}),o&&(0,p.jsx)(ke,{open:o,handleClose:S,switchToSingleCanvasView:g,t:r}),T&&(0,p.jsx)(h.Tooltip,{title:r(`export_local_annotation`),children:(0,p.jsx)(`div`,{children:(0,p.jsx)(m.MiradorMenuButton,{"aria-label":`Export local annotations for visible items`,onClick:C,size:`small`,children:(0,p.jsx)(L,{})})})}),T&&(0,p.jsx)(je,{canvases:y,config:b,handleClose:C,open:i})]})}Fe.propTypes={annotationEditCompanionWindowIsOpened:f.default.bool.isRequired,canvases:f.default.arrayOf(f.default.shape({id:f.default.string,index:f.default.number})).isRequired,config:f.default.shape({annotation:f.default.shape({adapter:f.default.func,exportLocalStorageAnnotations:f.default.bool,readonly:f.default.bool})}).isRequired,t:f.default.func.isRequired,TargetComponent:f.default.oneOfType([f.default.func,f.default.node]).isRequired,targetProps:f.default.object.isRequired,windowViewType:f.default.string.isRequired};function Ie(e,{targetProps:{windowId:t}}){let n=(0,m.getCompanionWindowsForContent)(e,{content:`annotationCreation`,windowId:t}),r=!0;return Object.keys(n).length!==0&&(r=!1),{annotationEditCompanionWindowIsOpened:r,canvases:(0,m.getVisibleCanvases)(e,{windowId:t}),config:e.config,windowViewType:(0,m.getWindowViewType)(e,{windowId:t})}}var Le={component:Fe,config:{translations:Ne},mapStateToProps:Ie,mode:`wrap`,target:`AnnotationSettings`},Re=new Set([`INPUT`,`TEXTAREA`,`SELECT`]),ze=e=>Re.has(e?.tagName)||e?.isContentEditable,Be=null;function Ve(){let e=de();return(0,u.useEffect)(()=>{Be&&=(document.removeEventListener(`keydown`,Be),null);let t=t=>{if(ze(t.target))return;let n=Object.values(Te).find(e=>e.keys.includes(t.key));if(!n)return;let r=e.getState(),i=(0,m.getFocusedWindowId)(r);if(!i)return;let a=(0,m.getConfig)(r);a?.annotation?.readonly||(t.preventDefault(),n.handler({config:a,dispatch:e.dispatch,state:r,windowId:i}))};return Be=t,document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t),Be===t&&(Be=null)}},[e]),null}function He({PluginComponents:e=[],TargetComponent:t,targetProps:n}){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Ve,{}),(0,p.jsx)(t,{...n,PluginComponents:e})]})}He.propTypes={PluginComponents:f.default.array.isRequired,TargetComponent:f.default.oneOfType([f.default.func,f.default.node]).isRequired,targetProps:f.default.object.isRequired};var Ue={component:He,mode:`wrap`,target:`Window`},We=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14zM15.5 4l-1-1h-5l-1 1H5v2h14V4z`}),`DeleteForever`),Ge=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z`}),`Edit`),Ke=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6`}),`Settings`),qe=o(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),Je=o(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),Ye=o(((e,t)=>{var n=Je(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),Xe=o(((e,t)=>{t.exports=Ye().Symbol})),Ze=o(((e,t)=>{var n=Xe(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),Qe=o(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),$e=o(((e,t)=>{var n=Xe(),r=Ze(),i=Qe(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),et=o(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),tt=o(((e,t)=>{var n=$e(),r=et(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),nt=o(((e,t)=>{var n=tt(),r=et(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),rt=o(((e,t)=>{t.exports=Array.isArray})),it=o(((e,t)=>{var n=Xe(),r=nt(),i=rt(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),at=o(((e,t)=>{var n=qe(),r=it();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),ot=l(o(((e,t)=>{var n=at();function r(e){return e!=null&&e.length?n(e,1):[]}t.exports=r}))()),st=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z`}),`Info`),ct=u.default.createContext();function lt({creator:e,creationDate:t,lastEditor:n,lastSavedDate:r,displayMode:i,t:a}){if(!e||!t)return null;let o=e===`Anonymous`?a(`anonymous`):e,s=n===`Anonymous`?a(`anonymous`):n;return(0,p.jsxs)(p.Fragment,{children:[i===`section`&&(0,p.jsx)(w.default,{variant:`formSectionTitle`,children:a(`metadata`)}),i===`tooltip`&&(0,p.jsx)(`h1`,{children:a(`metadata`)}),(0,p.jsx)(w.default,{children:a(`createdByOn`,{creationDate:t,creator:o})}),r&&n&&(0,p.jsx)(w.default,{children:a(`lastEditedByOn`,{lastEditor:s,lastSavedDate:r})})]})}lt.propTypes={creationDate:f.default.string.isRequired,creator:f.default.string.isRequired,displayMode:f.default.string.isRequired,lastEditor:f.default.string.isRequired,lastSavedDate:f.default.string.isRequired,t:f.default.func.isRequired};var ut=(0,u.forwardRef)((e,t)=>{let n=(0,g.useTheme)(),[r,i]=(0,u.useState)(!1),a=(0,u.useContext)(ct),o=(0,u.useMemo)(()=>{let{annotationid:t}=e,{canvases:n,annotationsOnCanvases:r}=a,i;return n.some(e=>(r[e.id]&&Object.entries(r[e.id]).forEach(([e,n])=>{if(n.json&&n.json.items&&(i=n.json.items.find(e=>e.id===t),i))return i}),i)),i},[e.annotationid,a.canvases,a.annotationsOnCanvases]),s=()=>{let{canvases:t,receiveAnnotation:n,storageAdapter:r}=a,{annotationid:i}=e;t.forEach(e=>{let t=r(e.id);t.delete(i).then(r=>{n(e.id,t.annotationPageId,r)})})},c=()=>{let{addCompanionWindow:t}=a,{annotationid:n}=e;t(`annotationCreation`,{annotationid:n,position:`right`})},l=()=>{let{annotationsOnCanvases:t,canvases:n}=a,{annotationid:r}=e,i=n.map(e=>t[e.id]?(0,ot.default)(Object.entries(t[e.id]).map(([e,t])=>t.json&&t.json.items?t.json.items.filter(e=>e.maeData).map(e=>e.id):[])):[]);return(0,ot.default)(i).includes(r)},{t:d}=(0,_.useTranslation)();return(0,p.jsxs)(`div`,{onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:`mirador-annotation-list-item`,"data-testid":`mirador-annotation-list-item`,ref:t,children:[r&&l()&&(0,p.jsx)(`div`,{children:(0,p.jsxs)(M.default,{"aria-label":`annotation tools`,size:`small`,sx:{bgcolor:n.palette.background.paper,borderRadius:n.shape.borderRadius,boxShadow:n.shadows[2],position:`absolute`,right:0,zIndex:n.zIndex.modal+1},children:[a.config?.annotation.debug&&(0,p.jsx)(h.Tooltip,{title:d(`debugAnnotation`),children:(0,p.jsx)(`span`,{children:(0,p.jsx)(j.default,{"aria-label":`Debug`,onClick:()=>console.log(o),value:`debug`,children:(0,p.jsx)(Ke,{})})})}),!!o?.creator&&(0,p.jsx)(h.Tooltip,{title:(0,p.jsx)(lt,{creator:o.creator,creationDate:o.creationDate,lastEditor:o.lastEditor,lastSavedDate:o.lastSavedDate,displayMode:`tooltip`,t:d}),children:(0,p.jsx)(`span`,{children:(0,p.jsx)(j.default,{"aria-label":`Metadata`,value:`metadata`,children:(0,p.jsx)(st,{})})})}),a.config?.annotation?.readonly!==!0&&[(0,p.jsx)(h.Tooltip,{title:d(`edit_annotation`),children:(0,p.jsx)(`span`,{children:(0,p.jsx)(j.default,{"aria-label":`Edit`,onClick:a.windowViewType===`single`?c:a.toggleSingleCanvasDialogOpen,value:`edit`,disabled:!a.annotationEditCompanionWindowIsOpened,children:(0,p.jsx)(Ge,{})})})},`edit`),(0,p.jsx)(h.Tooltip,{title:(0,p.jsx)(Oe,{label:d(`deleteAnnotation`),action:`delete`}),children:(0,p.jsx)(`span`,{children:(0,p.jsx)(j.default,{"aria-label":`Delete`,onClick:s,value:`delete`,disabled:!a.annotationEditCompanionWindowIsOpened,children:(0,p.jsx)(We,{})})})},`delete`)]]})}),(0,p.jsx)(`li`,{...e,children:e.children})]})});ut.propTypes={annotationEditCompanionWindowIsOpened:f.default.bool.isRequired,annotationid:f.default.string.isRequired,children:f.default.oneOfType([f.default.func,f.default.node]).isRequired};var dt=(0,_.withTranslation)()(ut),ft=e=>{if(!e)return!1;let t=getComputedStyle(e),n=t.overflowY||t.overflow||``;return/(auto|scroll|overlay)/.test(n)&&e.scrollHeight>e.clientHeight},pt=e=>{let t=e?.parentElement||null;for(;t;){if(ft(t))return t;t=t.parentElement}return null},mt=()=>document.scrollingElement||document.documentElement;function ht(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.top-r.top+e.scrollTop,o=i.bottom-r.top+e.scrollTop,s=e.scrollTop+n,c=e.scrollTop+e.clientHeight,l=a<s;return!l&&!(o>c)?null:l?a-n:Math.max(o-e.clientHeight,a-n)}function gt(e,t){let n=e.getBoundingClientRect(),r=n.top+window.scrollY,i=n.bottom+window.scrollY,a=window.scrollY+t,o=window.scrollY+window.innerHeight,s=r<a;return!s&&!(i>o)?null:s?r-t:Math.max(i-window.innerHeight,r-t)}var _t=(e,t,n)=>new Promise(r=>{let i=`smooth`;requestAnimationFrame(()=>{requestAnimationFrame(()=>{let a=t.current;if(ft(a)||(a=pt(e)),ft(a)||(a=mt()),a===document.body||a===document.documentElement||a===document.scrollingElement){let t=gt(e,96);if(t==null)return r(!0);let a=window.scrollY;window.scrollTo({behavior:i,top:t}),setTimeout(()=>{let e=window.scrollY;r(Math.abs(e-a)>.5)},n);return}let o=ht(a,e,96);if(o==null)return r(!0);let s=a.scrollTop;typeof a.scrollTo==`function`&&a.scrollTo({behavior:i,top:o}),setTimeout(()=>{let e=a.scrollTop;r(Math.abs(e-s)>.5)},n)})})}),vt=async(e,t)=>{for(let n=0;n<=3&&!await _t(e,t,24);n++)n<3&&await new Promise(e=>{setTimeout(e,24)})},yt={defaultForm:{default:null,type:`string`},defaultTags:{default:[],type:`array`},editMode:{default:!1,type:`boolean`}},bt={array:e=>e?e.split(`,`).map(e=>e.trim()).filter(Boolean):[],boolean:e=>e===`true`,number:e=>{let t=Number(e);return Number.isNaN(t)?null:t},string:e=>e||null},xt=null;function St(){if(!xt){let e=new URLSearchParams(window.location.search);xt={},Object.entries(yt).forEach(([t,n])=>{let r=e.get(t);r!==null&&(xt[t]=bt[n.type](r))})}return xt}function Ct(e){let t=St(),n={};return Object.entries(yt).forEach(([r,i])=>{r in t?n[r]=t[r]:e?.annotation?.[r]===void 0?n[r]=i.default:n[r]=e.annotation[r]}),n}function wt(e){return(0,u.useMemo)(()=>Ct(e),[e])}function Tt({addCompanionWindow:e,annotationsOnCanvases:t={},canvases:n=[],config:r,deselectAnnotation:i,highlightAllAnnotations:a,receiveAnnotation:o,switchToSingleCanvasView:s,TargetComponent:c,targetProps:l,updateWindow:d,windowViewType:f,annotationEditCompanionWindowIsOpened:m}){let[h,g]=(0,u.useState)(!1),{t:v}=(0,_.useTranslation)(),y=(0,u.useRef)(null),b=(0,u.useRef)(null);(0,u.useEffect)(()=>{let e=l?.selectedAnnotationId;if(!e)return;let t=y.current?.querySelector(`li[annotationid="${e}"]`)||y.current?.querySelector(`li.MuiMenuItem-root.Mui-selected`);t&&vt(t,b)},[l?.selectedAnnotationId]);let x=(0,u.useCallback)(()=>{g(e=>!e)});(0,u.useEffect)(()=>{A.default.isInitialized&&r.translations&&(Object.keys(r.translations).forEach(e=>{A.default.addResourceBundle(e,`translation`,r.translations[e],!0,!0)}),r.language&&A.default.changeLanguage(r.language))},[r.translations,r.language]);let{editMode:S}=wt(r);(0,u.useEffect)(()=>{S&&!a&&d({highlightAllAnnotations:!0})},[S,a,d]);let C=(0,u.useCallback)(e=>e?n.some(n=>{let r=t[n.id];return r?Object.values(r).some(t=>t.json&&t.json.items?t.json.items.some(t=>t.id===e&&t.maeData):!1):!1}):!1,[n,t]),w=(0,u.useRef)(m);(0,u.useEffect)(()=>{let e=!w.current,t=m;w.current=m,S&&e&&t&&i()},[S,m,i]);let T=(0,u.useRef)(null);(0,u.useEffect)(()=>{if(!S)return;let t=l?.selectedAnnotationId;t!==T.current&&(T.current=t,t&&m&&C(t)&&e(`annotationCreation`,{annotationid:t,position:`right`}))},[S,l?.selectedAnnotationId,m,C,e]);let E={containerRef:b,...l,listContainerComponent:dt},D=(0,u.useMemo)(()=>({addCompanionWindow:e,annotationEditCompanionWindowIsOpened:m,annotationsOnCanvases:t,canvases:n,config:r,receiveAnnotation:o,storageAdapter:r.annotation.adapter,t:v,toggleSingleCanvasDialogOpen:x,windowId:l.windowId,windowViewType:f}),[e,m,t,n,r,o,v,x,l.windowId,f]);return(0,p.jsxs)(ct.Provider,{value:D,children:[(0,p.jsx)(`div`,{ref:y,style:{height:`100%`,position:`relative`},children:(0,p.jsx)(c,{...E})}),f!==`single`&&(0,p.jsx)(ke,{handleClose:x,open:h,switchToSingleCanvasView:s})]})}Tt.propTypes={addCompanionWindow:f.default.func.isRequired,annotationEditCompanionWindowIsOpened:f.default.bool.isRequired,annotationsOnCanvases:f.default.shape({id:f.default.string,isFetching:f.default.bool,json:f.default.shape({id:f.default.string,items:f.default.arrayOf(f.default.shape({body:f.default.shape({format:f.default.string,id:f.default.string,value:f.default.string}),drawingState:f.default.string,id:f.default.string,manifestNetwork:f.default.string,motivation:f.default.string,target:f.default.string,type:f.default.string})),type:f.default.string})}).isRequired,canvases:f.default.arrayOf(f.default.shape({id:f.default.string,index:f.default.number})).isRequired,config:f.default.shape({annotation:f.default.shape({adapter:f.default.func,editMode:f.default.bool}),language:f.default.string,translations:f.default.objectOf(f.default.object)}).isRequired,deselectAnnotation:f.default.func.isRequired,highlightAllAnnotations:f.default.bool.isRequired,receiveAnnotation:f.default.func.isRequired,switchToSingleCanvasView:f.default.func.isRequired,t:f.default.func.isRequired,TargetComponent:f.default.oneOfType([f.default.func,f.default.node]).isRequired,targetProps:f.default.object.isRequired,updateWindow:f.default.func.isRequired,windowViewType:f.default.string.isRequired};function Et(e,{targetProps:{windowId:t}}){let n=(0,m.getVisibleCanvases)(e,{windowId:t}),r={},i=(0,m.getCompanionWindowsForContent)(e,{content:`annotationCreation`,windowId:t}),a=Object.keys(i).length===0;return n.forEach(t=>{let n=e.annotations[t.id];n&&(r[t.id]=n)}),{annotationEditCompanionWindowIsOpened:a,annotationsOnCanvases:r,canvases:n,config:{...e.config,translations:Ne},highlightAllAnnotations:(0,m.getWindow)(e,{windowId:t}).highlightAllAnnotations,windowViewType:(0,m.getWindowViewType)(e,{windowId:t})}}var Dt={component:Tt,mapDispatchToProps:(e,t)=>({addCompanionWindow:(n,r)=>e((0,m.addCompanionWindow)(t.targetProps.windowId,{content:n,...r})),deselectAnnotation:()=>e((0,m.deselectAnnotation)(t.targetProps.windowId)),receiveAnnotation:(t,n,r)=>e((0,m.receiveAnnotation)(t,n,r)),switchToSingleCanvasView:()=>e((0,m.setWindowViewType)(t.targetProps.windowId,`single`)),updateWindow:n=>e((0,m.updateWindow)(t.targetProps.windowId,n))}),mapStateToProps:Et,mode:`wrap`,target:`CanvasAnnotations`},Ot=[];for(let e=0;e<256;++e)Ot.push((e+256).toString(16).slice(1));function kt(e,t=0){return(Ot[e[t+0]]+Ot[e[t+1]]+Ot[e[t+2]]+Ot[e[t+3]]+`-`+Ot[e[t+4]]+Ot[e[t+5]]+`-`+Ot[e[t+6]]+Ot[e[t+7]]+`-`+Ot[e[t+8]]+Ot[e[t+9]]+`-`+Ot[e[t+10]]+Ot[e[t+11]]+Ot[e[t+12]]+Ot[e[t+13]]+Ot[e[t+14]]+Ot[e[t+15]]).toLowerCase()}var At,jt=new Uint8Array(16);function Mt(){if(!At){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);At=crypto.getRandomValues.bind(crypto)}return At(jt)}var Nt={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Pt(e,t,n){e||={};let r=e.random??e.rng?.()??Mt();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return kt(r)}function Ft(e,t,n){return Nt.randomUUID&&!t&&!e?Nt.randomUUID():Pt(e,t,n)}var It=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){return!e||typeof e==`string`?e:e+``}var n=new class{async svg2canvas(e,t,n){let r=await new Promise(t=>{var n=new Image;n.onload=function(){t(n)},n.src=e});var i=document.createElement(`canvas`);return i.width=t,i.height=n,i.getContext(`2d`).drawImage(r,0,0),i}toDataURL(e,t,n,r,i,a){var o=new XMLSerializer().serializeToString(e);document.documentMode&&/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(o)&&(o=o.replace(`xmlns="http://www.w3.org/2000/svg`,`xmlns:xlink="http://www.w3.org/1999/xlink`)),a||={};var s=`data:image/svg+xml;charset=utf-8,`+encodeURIComponent(o);if(r===`image/svg+xml`||!r)return a.async?Promise.resolve(s):s;if(r===`image/jpeg`||r===`image/png`){if(!a.async)throw Error(`svgcanvas: options.async must be set to true if type is image/jpeg | image/png`);return(async()=>{let e=await this.svg2canvas(s,t,n),a=e.toDataURL(r,i);return e.remove(),a})()}throw Error(`svgcanvas: Unknown type for toDataURL, please use image/jpeg | image/png | image/svg+xml.`)}getImageData(e,t,n,r,i,a,o,s){if(s||={},!s.async)throw Error(`svgcanvas: options.async must be set to true for getImageData`);let c=this.toDataURL(e,t,n,`image/svg+xml`);return(async()=>{let e=await this.svg2canvas(c,t,n),s=e.getContext(`2d`).getImageData(r,i,a,o);return e.remove(),s})()}},r=function(){var e,r,i,a,o;function s(e,t){var n=Object.keys(t),r;for(r=0;r<n.length;r++)e=e.replace(RegExp(`\\{`+n[r]+`\\}`,`gi`),t[n[r]]);return e}function c(e){var t,n,r;if(!e)throw Error(`cannot create a random attribute name for an undefined object`);t=`ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz`,n=``;do for(n=``,r=0;r<12;r++)n+=t[Math.floor(Math.random()*t.length)];while(e[n]);return n}function l(e,t){var n,r,i={},a;for(e=e.split(`,`),t||=10,n=0;n<e.length;n+=2)r=`&`+e[n+1]+`;`,a=parseInt(e[n],t),i[r]=`&#`+a+`;`;return i[`\\xa0`]=` `,i}function u(e){var t={left:`start`,right:`end`,center:`middle`,start:`start`,end:`end`};return t[e]||t.start}function d(e){var t={alphabetic:`alphabetic`,hanging:`hanging`,top:`text-before-edge`,bottom:`text-after-edge`,middle:`central`};return t[e]||t.alphabetic}o=l(`50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro`,32),e={strokeStyle:{svgAttr:`stroke`,canvas:`#000000`,svg:`none`,apply:`stroke`},fillStyle:{svgAttr:`fill`,canvas:`#000000`,svg:null,apply:`fill`},lineCap:{svgAttr:`stroke-linecap`,canvas:`butt`,svg:`butt`,apply:`stroke`},lineJoin:{svgAttr:`stroke-linejoin`,canvas:`miter`,svg:`miter`,apply:`stroke`},miterLimit:{svgAttr:`stroke-miterlimit`,canvas:10,svg:4,apply:`stroke`},lineWidth:{svgAttr:`stroke-width`,canvas:1,svg:1,apply:`stroke`},globalAlpha:{svgAttr:`opacity`,canvas:1,svg:1,apply:`fill stroke`},font:{canvas:`10px sans-serif`},shadowColor:{canvas:`#000000`},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:`start`},textBaseline:{canvas:`alphabetic`},lineDash:{svgAttr:`stroke-dasharray`,canvas:[],svg:null,apply:`stroke`}},i=function(e,t){this.__root=e,this.__ctx=t},i.prototype.addColorStop=function(e,n){var r=this.__ctx.__createElement(`stop`),i,a;r.setAttribute(`offset`,e),t(n).indexOf(`rgba`)===-1?r.setAttribute(`stop-color`,t(n)):(i=/rgba\(\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi,a=i.exec(n),r.setAttribute(`stop-color`,s(`rgb({r},{g},{b})`,{r:a[1],g:a[2],b:a[3]})),r.setAttribute(`stop-opacity`,a[4])),this.__root.appendChild(r)},a=function(e,t){this.__root=e,this.__ctx=t},r=function(e){var t={width:500,height:500,enableMirroring:!1},n;if(arguments.length>1?(n=t,n.width=arguments[0],n.height=arguments[1]):n=e||t,!(this instanceof r))return new r(n);this.width=n.width||t.width,this.height=n.height||t.height,this.enableMirroring=n.enableMirroring===void 0?t.enableMirroring:n.enableMirroring,this.canvas=this,this.__document=n.document||document,n.ctx?this.__ctx=n.ctx:(this.__canvas=this.__document.createElement(`canvas`),this.__ctx=this.__canvas.getContext(`2d`)),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__document.createElementNS(`http://www.w3.org/2000/svg`,`svg`),this.__root.setAttribute(`version`,1.1),this.__root.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),this.__root.setAttributeNS(`http://www.w3.org/2000/xmlns/`,`xmlns:xlink`,`http://www.w3.org/1999/xlink`),this.__root.setAttribute(`width`,this.width),this.__root.setAttribute(`height`,this.height),this.__ids={},this.__defs=this.__document.createElementNS(`http://www.w3.org/2000/svg`,`defs`),this.__root.appendChild(this.__defs),this.__currentElement=this.__document.createElementNS(`http://www.w3.org/2000/svg`,`g`),this.__root.appendChild(this.__currentElement),this.resetTransform(),this.__options=n,this.__id=Math.random().toString(16).substring(2,8),this.__debug(`new`,e)},r.prototype.__debug=function(...e){this.__options.debug&&console.debug(`svgcanvas#${this.__id}:`,...e)},r.prototype.__createElement=function(e,t,n){t===void 0&&(t={});var r=this.__document.createElementNS(`http://www.w3.org/2000/svg`,e),i=Object.keys(t),a,o;for(n&&(r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,`none`)),a=0;a<i.length;a++)o=i[a],r.setAttribute(o,t[o]);return r},r.prototype.__setDefaultStyles=function(){var t=Object.keys(e),n,r;for(n=0;n<t.length;n++)r=t[n],this[r]=e[r].canvas},r.prototype.__applyStyleState=function(e){var t=Object.keys(e),n,r;for(n=0;n<t.length;n++)r=t[n],this[r]=e[r]},r.prototype.__getStyleState=function(){var t,n={},r=Object.keys(e),i;for(t=0;t<r.length;t++)i=r[t],n[i]=this[i];return n},r.prototype.__applyTransformation=function(e,t){let{a:n,b:r,c:i,d:a,e:o,f:s}=t||this.getTransform();e.setAttribute(`transform`,`matrix(${n} ${r} ${i} ${a} ${o} ${s})`)},r.prototype.__applyStyleToCurrentElement=function(t){var n=this.__currentElement,r=this.__currentElementsToStyle;r&&(n.setAttribute(t,``),n=r.element,r.children.forEach(function(e){e.setAttribute(t,``)}));var o=Object.keys(e),c,l,u,d,f,p,m,h;for(c=0;c<o.length;c++)if(l=e[o[c]],u=this[o[c]],l.apply){if(u instanceof a){if(u.__ctx)for(m=0;m<u.__ctx.__defs.childNodes.length;m++)h=u.__ctx.__defs.childNodes[m],p=h.getAttribute(`id`),this.__ids[p]=p,this.__defs.appendChild(h);n.setAttribute(l.apply,s(`url(#{id})`,{id:u.__root.getAttribute(`id`)}))}else if(u instanceof i)n.setAttribute(l.apply,s(`url(#{id})`,{id:u.__root.getAttribute(`id`)}));else if(l.apply.indexOf(t)!==-1&&l.svg!==u){if((l.svgAttr===`stroke`||l.svgAttr===`fill`)&&u&&u.indexOf(`rgba`)!==-1){d=/rgba\(\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi,f=d.exec(u),n.setAttribute(l.svgAttr,s(`rgb({r},{g},{b})`,{r:f[1],g:f[2],b:f[3]}));var g=f[4],_=this.globalAlpha;_!=null&&(g*=_),n.setAttribute(l.svgAttr+`-opacity`,g)}else{var v=l.svgAttr;if(o[c]===`globalAlpha`){if(v=t+`-`+l.svgAttr,n.getAttribute(v))continue}else if(o[c]===`lineWidth`){var y=this.__getTransformScale();u*=Math.max(y.x,y.y)}n.setAttribute(v,u)}}}},r.prototype.__closestGroupOrSvg=function(e){return e||=this.__currentElement,e.nodeName===`g`||e.nodeName===`svg`?e:this.__closestGroupOrSvg(e.parentNode)},r.prototype.getSerializedSvg=function(e){var t=new XMLSerializer().serializeToString(this.__root),n,r,i,a,s;if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(t)&&(t=t.replace(`xmlns="http://www.w3.org/2000/svg`,`xmlns:xlink="http://www.w3.org/1999/xlink`)),e)for(n=Object.keys(o),r=0;r<n.length;r++)i=n[r],a=o[i],s=new RegExp(i,`gi`),s.test(t)&&(t=t.replace(s,a));return t},r.prototype.getSvg=function(){return this.__root},r.prototype.save=function(){var e=this.__createElement(`g`),t=this.__closestGroupOrSvg();this.__groupStack.push(t),t.appendChild(e),this.__currentElement=e;let n=this.__getStyleState();this.__debug(`save style`,n),this.__styleStack.push(n),this.__transformMatrixStack||=[],this.__transformMatrixStack.push(this.getTransform())},r.prototype.restore=function(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||=this.__root.childNodes[1];var e=this.__styleStack.pop();this.__debug(`restore style`,e),this.__applyStyleState(e),this.__transformMatrixStack&&this.__transformMatrixStack.length>0&&this.setTransform(this.__transformMatrixStack.pop())},r.prototype.beginPath=function(){var e,t;this.__currentDefaultPath=``,this.__currentPosition={},e=this.__createElement(`path`,{},!0),t=this.__closestGroupOrSvg(),t.appendChild(e),this.__currentElement=e},r.prototype.__applyCurrentDefaultPath=function(){var e=this.__currentElement;e.nodeName===`path`?e.setAttribute(`d`,this.__currentDefaultPath):console.error(`Attempted to apply path command to node`,e.nodeName)},r.prototype.__addPathCommand=function(e){this.__currentDefaultPath+=` `,this.__currentDefaultPath+=e},r.prototype.moveTo=function(e,t){this.__currentElement.nodeName!==`path`&&this.beginPath(),this.__currentPosition={x:e,y:t},this.__addPathCommand(s(`M {x} {y}`,{x:this.__matrixTransform(e,t).x,y:this.__matrixTransform(e,t).y}))},r.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand(`Z`)},r.prototype.lineTo=function(e,t){this.__currentPosition={x:e,y:t},this.__currentDefaultPath.indexOf(`M`)>-1?this.__addPathCommand(s(`L {x} {y}`,{x:this.__matrixTransform(e,t).x,y:this.__matrixTransform(e,t).y})):this.__addPathCommand(s(`M {x} {y}`,{x:this.__matrixTransform(e,t).x,y:this.__matrixTransform(e,t).y}))},r.prototype.bezierCurveTo=function(e,t,n,r,i,a){this.__currentPosition={x:i,y:a},this.__addPathCommand(s(`C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}`,{cp1x:this.__matrixTransform(e,t).x,cp1y:this.__matrixTransform(e,t).y,cp2x:this.__matrixTransform(n,r).x,cp2y:this.__matrixTransform(n,r).y,x:this.__matrixTransform(i,a).x,y:this.__matrixTransform(i,a).y}))},r.prototype.quadraticCurveTo=function(e,t,n,r){this.__currentPosition={x:n,y:r},this.__addPathCommand(s(`Q {cpx} {cpy} {x} {y}`,{cpx:this.__matrixTransform(e,t).x,cpy:this.__matrixTransform(e,t).y,x:this.__matrixTransform(n,r).x,y:this.__matrixTransform(n,r).y}))};var f=function(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]};return r.prototype.arcTo=function(e,t,n,r,i){var a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(a!==void 0&&o!==void 0){if(i<0)throw Error(`IndexSizeError: The radius provided (`+i+`) is negative.`);if(a===e&&o===t||e===n&&t===r||i===0){this.lineTo(e,t);return}var s=f([a-e,o-t]),c=f([n-e,r-t]);if(s[0]*c[1]===s[1]*c[0]){this.lineTo(e,t);return}var l=s[0]*c[0]+s[1]*c[1],u=Math.acos(Math.abs(l)),d=f([s[0]+c[0],s[1]+c[1]]),p=i/Math.sin(u/2),m=e+p*d[0],h=t+p*d[1],g=[-s[1],s[0]],_=[c[1],-c[0]],v=function(e){var t=e[0];return e[1]>=0?Math.acos(t):-Math.acos(t)},y=v(g),b=v(_);this.lineTo(m+g[0]*i,h+g[1]*i),this.arc(m,h,i,y,b)}},r.prototype.stroke=function(){this.__currentElement.nodeName===`path`&&this.__currentElement.setAttribute(`paint-order`,`fill stroke markers`),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement(`stroke`)},r.prototype.fill=function(){this.__currentElement.nodeName===`path`&&this.__currentElement.setAttribute(`paint-order`,`stroke fill markers`),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement(`fill`)},r.prototype.rect=function(e,t,n,r){this.__currentElement.nodeName!==`path`&&this.beginPath(),this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.lineTo(e,t),this.closePath()},r.prototype.roundRect=function(e,t,n,r,i){this.__currentElement.nodeName!==`path`&&this.beginPath();let a,o,s,c;typeof i==`number`?(a=i,o=i,s=i,c=i):[a,o,s,c]=i,this.moveTo(e+a,t),this.arcTo(e+n,t,e+n,t+r,o),this.arcTo(e+n,t+r,e,t+r,s),this.arcTo(e,t+r,e,t,c),this.arcTo(e,t,e+n,t,a),this.closePath()},r.prototype.fillRect=function(e,t,n,r){let{a:i,b:a,c:o,d:s,e:c,f:l}=this.getTransform();JSON.stringify([i,a,o,s,c,l])===JSON.stringify([1,0,0,1,0,0])&&e===0&&t===0&&n===this.width&&r===this.height&&this.__clearCanvas();var u=this.__createElement(`rect`,{x:e,y:t,width:n,height:r},!0);this.__closestGroupOrSvg().appendChild(u),this.__currentElement=u,this.__applyTransformation(u),this.__applyStyleToCurrentElement(`fill`)},r.prototype.strokeRect=function(e,t,n,r){var i=this.__createElement(`rect`,{x:e,y:t,width:n,height:r},!0);this.__closestGroupOrSvg().appendChild(i),this.__currentElement=i,this.__applyTransformation(i),this.__applyStyleToCurrentElement(`stroke`)},r.prototype.__clearCanvas=function(){var e=this.__root.childNodes[1];this.__root.removeChild(e),this.__currentElement=this.__document.createElementNS(`http://www.w3.org/2000/svg`,`g`),this.__root.appendChild(this.__currentElement),this.__groupStack=[]},r.prototype.clearRect=function(e,t,n,r){let{a:i,b:a,c:o,d:s,e:c,f:l}=this.getTransform();if(JSON.stringify([i,a,o,s,c,l])===JSON.stringify([1,0,0,1,0,0])&&e===0&&t===0&&n===this.width&&r===this.height){this.__clearCanvas();return}var u,d=this.__closestGroupOrSvg();u=this.__createElement(`rect`,{x:e,y:t,width:n,height:r,fill:`#FFFFFF`},!0),this.__applyTransformation(u),d.appendChild(u)},r.prototype.createLinearGradient=function(e,t,n,r){var a=this.__createElement(`linearGradient`,{id:c(this.__ids),x1:e+`px`,x2:n+`px`,y1:t+`px`,y2:r+`px`,gradientUnits:`userSpaceOnUse`},!1);return this.__defs.appendChild(a),new i(a,this)},r.prototype.createRadialGradient=function(e,t,n,r,a,o){var s=this.__createElement(`radialGradient`,{id:c(this.__ids),cx:r+`px`,cy:a+`px`,r:o+`px`,fx:e+`px`,fy:t+`px`,gradientUnits:`userSpaceOnUse`},!1);return this.__defs.appendChild(s),new i(s,this)},r.prototype.__applyText=function(e,t,n,r){var i=document.createElement(`span`);i.setAttribute(`style`,`font:`+this.font);var a=i.style,o=this.__closestGroupOrSvg(),s=this.__createElement(`text`,{"font-family":a.fontFamily,"font-size":a.fontSize,"font-style":a.fontStyle,"font-weight":a.fontWeight,"text-decoration":this.__fontUnderline,x:t,y:n,"text-anchor":u(this.textAlign),"dominant-baseline":d(this.textBaseline)},!0);if(s.appendChild(this.__document.createTextNode(e)),this.__currentElement=s,this.__applyTransformation(s),this.__applyStyleToCurrentElement(r),this.__fontHref){var c=this.__createElement(`a`);c.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,this.__fontHref),c.appendChild(s),s=c}o.appendChild(s)},r.prototype.fillText=function(e,t,n){this.__applyText(e,t,n,`fill`)},r.prototype.strokeText=function(e,t,n){this.__applyText(e,t,n,`stroke`)},r.prototype.measureText=function(e){return this.__ctx.font=this.font,this.__ctx.measureText(e)},r.prototype.arc=function(e,t,n,r,i,a){if(r!==i){r%=2*Math.PI,i%=2*Math.PI,r===i&&(i=(i+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));var o=e+n*Math.cos(i),c=t+n*Math.sin(i),l=e+n*Math.cos(r),u=t+n*Math.sin(r),d=+!a,f=0,p=i-r;p<0&&(p+=2*Math.PI),f=a?p>Math.PI?0:1:+(p>Math.PI);var m=Math.hypot(this.__transformMatrix.a,this.__transformMatrix.b),h=Math.hypot(this.__transformMatrix.c,this.__transformMatrix.d);this.lineTo(l,u),this.__addPathCommand(s(`A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}`,{rx:n*m,ry:n*h,xAxisRotation:0,largeArcFlag:f,sweepFlag:d,endX:this.__matrixTransform(o,c).x,endY:this.__matrixTransform(o,c).y})),this.__currentPosition={x:o,y:c}}},r.prototype.ellipse=function(e,t,n,r,i,a,o,c){if(a!==o){var l=this.__matrixTransform(e,t);e=l.x,t=l.y;var u=this.__getTransformScale();n*=u.x,r*=u.y,i+=this.__getTransformRotation(),a%=2*Math.PI,o%=2*Math.PI,a===o&&(o=(o+2*Math.PI-.001*(c?-1:1))%(2*Math.PI));var d=e+Math.cos(-i)*n*Math.cos(o)+Math.sin(-i)*r*Math.sin(o),f=t-Math.sin(-i)*n*Math.cos(o)+Math.cos(-i)*r*Math.sin(o),p=e+Math.cos(-i)*n*Math.cos(a)+Math.sin(-i)*r*Math.sin(a),m=t-Math.sin(-i)*n*Math.cos(a)+Math.cos(-i)*r*Math.sin(a),h=+!c,g=0,_=o-a;_<0&&(_+=2*Math.PI),g=c?_>Math.PI?0:1:+(_>Math.PI);var v=this.__transformMatrix;this.resetTransform(),this.lineTo(p,m),this.__transformMatrix=v,this.__addPathCommand(s(`A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}`,{rx:n,ry:r,xAxisRotation:180/Math.PI*i,largeArcFlag:g,sweepFlag:h,endX:d,endY:f})),this.__currentPosition={x:d,y:f}}},r.prototype.clip=function(){var e=this.__closestGroupOrSvg(),t=this.__createElement(`clipPath`),n=c(this.__ids),r=this.__createElement(`g`);this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),t.setAttribute(`id`,n),t.appendChild(this.__currentElement),this.__defs.appendChild(t),e.setAttribute(`clip-path`,s(`url(#{id})`,{id:n})),e.appendChild(r),this.__currentElement=r},r.prototype.drawImage=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n,i,a,o,s=0,c=0,l,u,d,f,p,m,h,g,_,v;if(e.length===3)n=e[1],i=e[2],l=t.width,u=t.height,a=l,o=u;else if(e.length===5)n=e[1],i=e[2],a=e[3],o=e[4],l=t.width,u=t.height;else if(e.length===9)s=e[1],c=e[2],l=e[3],u=e[4],n=e[5],i=e[6],a=e[7],o=e[8];else throw Error(`Invalid number of arguments passed to drawImage: `+arguments.length);d=this.__closestGroupOrSvg(),this.__currentElement;let y=this.getTransform().translate(n,i);if(t instanceof r){if(f=t.getSvg().cloneNode(!0),f.childNodes&&f.childNodes.length>1){for(p=f.childNodes[0];p.childNodes.length;)v=p.childNodes[0].getAttribute(`id`),this.__ids[v]=v,this.__defs.appendChild(p.childNodes[0]);m=f.childNodes[1],m&&(this.__applyTransformation(m,y),d.appendChild(m))}}else(t.nodeName===`CANVAS`||t.nodeName===`IMG`)&&(h=this.__createElement(`image`),h.setAttribute(`width`,a),h.setAttribute(`height`,o),h.setAttribute(`preserveAspectRatio`,`none`),(s||c||l!==t.width||u!==t.height)&&(g=this.__document.createElement(`canvas`),g.width=a,g.height=o,_=g.getContext(`2d`),_.drawImage(t,s,c,l,u,0,0,a,o),t=g),this.__applyTransformation(h,y),h.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,t.nodeName===`CANVAS`?t.toDataURL():t.getAttribute(`src`)),d.appendChild(h))},r.prototype.createPattern=function(e,t){var n=this.__document.createElementNS(`http://www.w3.org/2000/svg`,`pattern`),i=c(this.__ids),o;return n.setAttribute(`id`,i),n.setAttribute(`width`,e.width),n.setAttribute(`height`,e.height),n.setAttribute(`patternUnits`,`userSpaceOnUse`),e.nodeName===`CANVAS`||e.nodeName===`IMG`?(o=this.__document.createElementNS(`http://www.w3.org/2000/svg`,`image`),o.setAttribute(`width`,e.width),o.setAttribute(`height`,e.height),o.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,e.nodeName===`CANVAS`?e.toDataURL():e.getAttribute(`src`)),n.appendChild(o),this.__defs.appendChild(n)):e instanceof r&&(n.appendChild(e.__root.childNodes[1]),this.__defs.appendChild(n)),new a(n,this)},r.prototype.setLineDash=function(e){this.lineDash=e&&e.length>0?e.join(`,`):null},r.prototype.setTransform=function(e,t,n,r,i,a){this.__transformMatrix=e instanceof DOMMatrix?new DOMMatrix([e.a,e.b,e.c,e.d,e.e,e.f]):new DOMMatrix([e,t,n,r,i,a])},r.prototype.getTransform=function(){let{a:e,b:t,c:n,d:r,e:i,f:a}=this.__transformMatrix;return new DOMMatrix([e,t,n,r,i,a])},r.prototype.resetTransform=function(){this.setTransform(1,0,0,1,0,0)},r.prototype.scale=function(e,t){if(t===void 0&&(t=e),isNaN(e)||isNaN(t)||!isFinite(e)||!isFinite(t))return;let n=this.getTransform().scale(e,t);this.setTransform(n)},r.prototype.rotate=function(e){let t=this.getTransform().multiply(new DOMMatrix([Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]));this.setTransform(t)},r.prototype.translate=function(e,t){let n=this.getTransform().translate(e,t);this.setTransform(n)},r.prototype.transform=function(e,t,n,r,i,a){let o=this.getTransform().multiply(new DOMMatrix([e,t,n,r,i,a]));this.setTransform(o)},r.prototype.__matrixTransform=function(e,t){return new DOMPoint(e,t).matrixTransform(this.__transformMatrix)},r.prototype.__getTransformScale=function(){return{x:Math.hypot(this.__transformMatrix.a,this.__transformMatrix.b),y:Math.hypot(this.__transformMatrix.c,this.__transformMatrix.d)}},r.prototype.__getTransformRotation=function(){return Math.atan2(this.__transformMatrix.b,this.__transformMatrix.a)},r.prototype.getImageData=function(e,t,r,i,a){return n.getImageData(this.getSvg(),this.width,this.height,e,t,r,i,a)},r.prototype.drawFocusRing=function(){},r.prototype.createImageData=function(){},r.prototype.putImageData=function(){},r.prototype.globalCompositeOperation=function(){},r}();function i(e){this.ctx=new r(e),this.svg=this.ctx.__root;var t=this.svg,n=this,i=document.createElement(`div`);i.style.display=`inline-block`,i.appendChild(t),this.wrapper=i,Object.defineProperty(this,"className",{get:function(){return i.getAttribute(`class`)||``},set:function(e){return i.setAttribute(`class`,e)}}),Object.defineProperty(this,"tagName",{get:function(){return`CANVAS`},set:function(){}}),[`width`,`height`].forEach(function(e){Object.defineProperty(n,e,{get:function(){return t.getAttribute(e)|0},set:function(r){if(!(isNaN(r)||r===void 0))return n.ctx[e]=r,t.setAttribute(e,r),i[e]=r}})}),[`style`,`id`].forEach(function(e){Object.defineProperty(n,e,{get:function(){return i[e]},set:function(t){if(t!==void 0)return i[e]=t}})}),[`getBoundingClientRect`].forEach(function(e){n[e]=function(){return t[e]()}})}i.prototype.getContext=function(e){if(e!==`2d`)throw Error(`Unsupported type of context for SVGCanvas`);return this.ctx},i.prototype.toObjectURL=function(){var e=new XMLSerializer().serializeToString(this.svg),t=new Blob([e],{type:`image/svg+xml;charset=utf-8`});return URL.createObjectURL(t)},i.prototype.toDataURL=function(e,t,r){return n.toDataURL(this.svg,this.width,this.height,e,t,r)},i.prototype.addEventListener=function(){return this.svg.addEventListener.apply(this.svg,arguments)},i.prototype.getElement=function(){return this.wrapper},i.prototype.getAttribute=function(e){return this.wrapper.getAttribute(e)},i.prototype.setAttribute=function(e,t){this.wrapper.setAttribute(e,t)},e.Context=r}))(),Lt=async e=>new Promise(t=>setTimeout(t,e));async function Rt(e,t=!1,{onBefore:n,onAfter:r}={}){let i=e.getLayers()[0];n&&n([e,i]),await Lt(200);let a=i.canvas.context._context,o=i.canvas.context._context=new It.Context({height:e.height(),width:e.width(),ctx:a});e.draw();let s=o.getSerializedSvg();return s=t?new Blob([s],{type:`image/svg+xml;charset=utf-8`}):s,i.canvas.context._context=a,r&&r([e,i]),await Lt(200),e.draw(),s}function zt(e){return window.Konva.stages.find(t=>t.attrs.id===e)}function Bt(e,t,n,r,i=!0,a=!1){Vt();let o=zt(e);o.width(t),o.height(n),o.scale({x:r,y:r}),a&&(o.find(`Rect`).map(e=>{e.strokeWidth(e.strokeWidth()*r)}),o.find(`Line`).map(e=>{e.strokeWidth(e.strokeWidth()*r)}),o.find(`Circle`).map(e=>{e.strokeWidth(e.strokeWidth()*r)}),o.find(`Ellipse`).map(e=>{e.strokeWidth(e.strokeWidth()*r)})),i||Ht()}function Vt(){let e=document.getElementsByClassName(`konvajs-content`);e[0].style.visibility=`hidden`}function Ht(){let e=document.getElementsByClassName(`konvajs-content`);e[0].style.visibility=`visible`}function Ut(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`);return t.querySelectorAll(`rect`).forEach(e=>{let t=(e.getAttribute(`fill`)||``).trim().toLowerCase(),n=t===`#ffffff`||t===`#fff`||t===`white`,r=(e.getAttribute(`stroke`)||`none`).trim().toLowerCase();n&&(r===`none`||r===``)&&e.remove()}),new XMLSerializer().serializeToString(t.documentElement)}async function Wt(e){let t=zt(e);t.find(`Transformer`).forEach(e=>e.destroy());function n(e){let{r:t,g:n,b:r,a:i}=Qt(e.stroke());e.strokeScaleEnabled(!0),e.stroke(`rgb(${t},${n},${r})`),e.strokeWidth(3)}t.find(`Rect`).map(e=>{n(e)}),t.find(`Line`).map(e=>{n(e)}),t.find(`Circle`).map(e=>{n(e)}),t.find(`Ellipse`).map(e=>{n(e)});let r=await Rt(t,!1);return r=Ut(r),r=r.replaceAll(`"`,`'`),r}async function Gt(e){let t=zt(e);return t.find(`Transformer`).forEach(e=>e.visible(!1)),t.toDataURL({mimeType:`image/jpg`,quality:.2})}var Kt=[0,2,5,10,20,50],qt={DRAW:`draw`,IMAGE:`image`,POI:`poi`,TARGET:`target`},Jt={CURSOR:`cursor`,DELETE:`delete`,EDIT:`edit`,IMAGE:`image`,SHAPE:`shapes`,TEXT:`text`},z={ARROW:`arrow`,CIRCLE:`circle`,ELLIPSE:`ellipse`,FREEHAND:`freehand`,IMAGE:`image`,POI:`poi`,POLYGON:`polygon`,RECTANGLE:`rectangle`,SHAPES:`shapes`},Yt={fill:`#e53935`,stroke:`#ffffff`,strokeWidth:2};function Xt(e,t){let n=Math.min(e,t);return!Number.isFinite(n)||n<=0?10:Math.min(40,Math.max(6,n*.015))}function Zt(e){return Object.values(z).find(t=>t===e)}var Qt=(e=`rgba(255,255,255,0.5)`)=>window.Konva.Util.colorToRGBA(e),$t=(e={r:255,g:255,b:255,a:.5})=>`rgba(${e.r},${e.g},${e.b},${e.a})`,en={IIIF_TYPE:`iiif`,MULTIPLE_BODY_TYPE:`multiple_body`,POI_TYPE:`poi`,TAGGING_TYPE:`tagging`,TEXT_TYPE:`text`},tn={expert:en.IIIF_TYPE,note:en.MULTIPLE_BODY_TYPE,poi:en.POI_TYPE,tag:en.TAGGING_TYPE},nn={AUDIO:`Audio`,IMAGE:`Image`,UNKNOWN:`Unknown`,VIDEO:`Video`},rn={activeTool:Jt.SHAPE,closedMode:`closed`,fillColor:`rgba(83,162, 235, 0.5)`,image:{id:``},imageEvent:null,strokeColor:`rgba(20,82,168,1)`,strokeWidth:2};Jt.IMAGE;var an={activeTool:Jt.EDIT,closedMode:`closed`,fillColor:`rgba(100,100,100, 0)`,image:{id:null},imageEvent:null,strokeColor:`rgba(255,0, 0, 0.5)`,strokeWidth:5},on=`target`,sn=`layer`,cn=e=>{if(e===``||e==null)return!0;try{return new URL(e),!0}catch{return!1}};function ln(){return new Date().toLocaleString([navigator.language],{dateStyle:`short`,timeStyle:`short`})}async function un(e,t,n,r){r?.maeData?r.id?(r.lastSavedDate=ln(),r.lastEditor=t.getStorageAdapterUser(),console.log(`Annotation to update`,r),t.update(r).then(r=>{n(e,t.annotationPageId,r)})):(r.id=`${e}/annotation/${Ft()}`,r.creationDate=ln(),r.creator=t.getStorageAdapterUser(),r?.maeData?.manifestNetwork&&(r.id=`${r.id}#${r.maeData.manifestNetwork}`),console.log(`Annotation to create`,r),t.create(r).then(r=>{n(e,t.annotationPageId,r)})):r.id?t.update(r).then(r=>{n(e,t.annotationPageId,r)}):(r.id=`${e}/annotation/${Ft()}`,t.create(r).then(r=>{n(e,t.annotationPageId,r)}))}var dn=(0,g.styled)(M.default)(({theme:e})=>({"&:first-of-type":{borderRadius:e.shape.borderRadius},"&:not(:first-of-type)":{borderRadius:e.shape.borderRadius},border:`none`,margin:e.spacing(.5),"& .MuiToggleButton-root":{borderRadius:e.shape.borderRadius,color:e.palette.text.primary,transition:`transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease`,"&:hover":{transform:`translateY(-1px)`,boxShadow:e.shadows[1]}},"& .MuiToggleButton-root.Mui-selected":{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,boxShadow:e.shadows[3],transform:`scale(1.03)`,"&:hover":{backgroundColor:e.palette.primary.dark}}}));function fn(e){return!1}var pn=e=>e.strokeColor===an.strokeColor&&e.fillColor===an.fillColor,mn=e=>e.type===z.RECTANGLE,hn=e=>{if(e.length!==1)return!1;let t=e[0];return mn(t)&&(!t?.rotation||t.rotation===0)&&pn(t)},gn=(e,t)=>{console.info(`Implement target as string on fullSizeCanvas.`);let n=e.target;return`${t}#${n.tend?`xywh=${n.fullCanvaXYWH}&t=${n.tstart},${n.tend}`:`xywh=${n.fullCanvaXYWH}`}`},_n=(e,t,n)=>{console.info(`Implement target as string with one shape (rectangle)`);let{x:r,y:i,width:a,height:o,scaleX:s,scaleY:c}=n;return a<0&&(a=-a,r-=a),o<0&&(o=-o,i-=o),`${t}#${e.tend?`xywh=${r},${i},${a*s},${o*c}&t=${e.tstart},${e.tend}`:`xywh=${r},${i},${a*s},${o*c}`}`},vn=(e,t)=>{let n=`${e.tend?`t=${e.tstart},${e.tend}`:``}`;return{selector:[{type:`SvgSelector`,value:e.svg},{type:`FragmentSelector`,value:`${t}#${n}`}],source:t}},yn=(e,t,n=null,r=null)=>{let i=e.target,{templateType:a}=e;switch(a){case en.IIIF_TYPE:return i;case en.TAGGING_TYPE:case en.TEXT_TYPE:case en.MULTIPLE_BODY_TYPE:case en.POI_TYPE:return hn(i.drawingState.shapes)?(console.info(`Simple target detected`),_n(i,t,i.drawingState.shapes[0])):(console.info(`Implement target as SVG/Fragment with shapes`),vn(i,t));default:return gn(e,t)}},bn=e=>{let t={purpose:`describing`,type:`TextualBody`,value:``},n=e=>{let n=structuredClone(t);return n.value=e.value||``,n},r=e=>{let n=structuredClone(t);return n.value=e||``,n},i=``,a={};return e[`dbf:kind`]===`POI`?i=en.POI_TYPE:e.motivation===`tagging`||Array.isArray(e.motivation)&&e.motivation.includes(`tagging`)?i=en.TAGGING_TYPE:(i=en.MULTIPLE_BODY_TYPE,e.bodyValue?a=r(e.bodyValue):e.body&&(a=Array.isArray(e.body)?e.body.map(n):n(e.body))),[i,a]},xn=e=>{let t=e.documentElement,n=document.createElement(`div`);n.style.position=`absolute`,n.style.left=`-99999px`,n.style.width=`0`,n.style.height=`0`,n.style.overflow=`hidden`,n.style.pointerEvents=`none`,document.body.appendChild(n);let r=document.importNode(t,!0),i=`http://www.w3.org/2000/svg`,a=document.createElementNS(i,`svg`);for(let e of r.attributes||[])a.setAttribute(e.name,e.value);let o=document.createElementNS(i,`g`);for(;r.firstChild;)o.appendChild(r.firstChild);a.appendChild(o),n.appendChild(a),n.offsetWidth;let s=o.getBBox();return document.body.removeChild(n),s},Sn=({x:e,y:t,w:n,h:r,fullW:i=void 0,fullH:a=void 0})=>{e=parseFloat(e),t=parseFloat(t),n=parseFloat(n),r=parseFloat(r),a?a=parseFloat(a):i&&=parseFloat(i);let o=i&&a?`width='${i}' height='${a}'`:``;if([e,t,n,r].some(e=>typeof e!=`number`))throw Error(`xywhToSvg: x,y,w,h must be floats (got x=${e}, y=${t}, w=${n}, h=${r})`);return`<svg
|
|
6
|
+
version='1.1'
|
|
7
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
8
|
+
xmlns:xlink='http://www.w3.org/1999/xlink'
|
|
9
|
+
${o}
|
|
10
|
+
>
|
|
11
|
+
<defs/>
|
|
12
|
+
<g><g>
|
|
13
|
+
<path
|
|
14
|
+
d=' M ${e} ${t} L ${e+n} ${t} L ${e+n} ${t+r} L ${e} ${e+r} L ${e} ${t} Z Z'
|
|
15
|
+
fill='${an.fillColor}'
|
|
16
|
+
stroke='${an.strokeColor}'
|
|
17
|
+
stroke-width='${an.strokeWidth}'
|
|
18
|
+
fill-opacity='0'
|
|
19
|
+
stroke-miterlimit='10'
|
|
20
|
+
stroke-dasharray=''
|
|
21
|
+
/>
|
|
22
|
+
</g></g>
|
|
23
|
+
</svg>`},Cn=e=>{let[t,n,r,i]=e.value.replace(`xywh=`,``).split(`,`).map(parseFloat),a={id:Ft(),rotation:0,scaleX:1,scaleY:1,x:t,y:n,width:r,height:i,type:z.RECTANGLE,fill:an.fillColor,stroke:an.strokeColor,strokeWidth:an.strokeWidth};return{drawingState:JSON.stringify({currentShape:a,shapes:[a],isDrawing:!1}),svg:Sn({x:t,y:n,w:r,h:i})}},wn=e=>{let t=new DOMParser().parseFromString(e.value,`image/svg+xml`),n=xn(t),r=t.querySelector(`svg`).getAttribute(`width`)||void 0,i=t.querySelector(`svg`).getAttribute(`height`)||void 0,a={id:Ft(),rotation:0,scaleX:1,scaleY:1,x:n.x,y:n.y,width:n.width,height:n.height,type:z.RECTANGLE,fill:t.querySelector(`path[fill]`)?.getAttribute(`fill`)||an.fillColor,stroke:t.querySelector(`path[stroke]`)?.getAttribute(`stroke`)||an.strokeColor,strokeWidth:t.querySelector(`path[stroke-width]`)?.getAttribute(`stroke-width`)||an.strokeWidth},o={drawingState:JSON.stringify({currentShape:a,shapes:[a],isDrawing:!1}),svg:e.value};return r&&i&&(o.fullCanvaXYWH=`0,0,${r},${i}`),o},Tn=(e,t)=>{let n=[`SvgSelector`,`FragmentSelector`],r=Array.isArray(e.selector)?e.selector:[e.selector];for(let e of r)try{if(e.type===`SvgSelector`)return wn(e);if(e.type===`FragmentSelector`)return Cn(e)}catch(t){console.error(`Error generating maeData from selector ${e.type}, attempting to fallback to other selector`,t)}return console.error(`On annotation '${t}': none of the selector types in the annotation are unsupported: ${r.map(e=>e.type)}. Supported selectors are: [${n}].`),{}};function En(e){if(!e.maeData||Object.keys(e.maeData||{}).length===0)try{let t={target:{},templateType:``,tags:[],textBody:{}},[n,r]=bn(e);return t.templateType=n,t.textBody=r,t.target=Tn(e.target,e.id),e.maeData=t,e}catch(t){return console.error(`Error generating maeData from annotation`,t),e}return e}var Dn=e=>{if(!e)return!0;let t=e.trim();return t===``||t.replace(/<[^>]*>/g,``).trim()===``},On=()=>`${new Date().toLocaleString()}`,kn=[en.TAGGING_TYPE,en.TEXT_TYPE,en.MULTIPLE_BODY_TYPE,en.POI_TYPE],An=async(e,t,n,r)=>{let i=e;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),kn.includes(i.maeData.templateType)&&i.maeData.target.drawingState.shapes.length>0&&(i.maeData.target.svg=await Wt(n)),fn(i.maeData)&&(i.body.id=await Gt(n),i.body.format=`image/jpg`,i.type=`Annotation`),i.maeData.target.scale=r.getMediaTrueHeight()/r.getDisplayedMediaHeight()*r.getZoom(),i.target=yn(i.maeData,t.id,n,r.getScale()),i.maeData.target.drawingState=JSON.stringify(i.maeData.target.drawingState),i},jn=async(e,{canvas:t,windowId:n,playerReferences:r})=>{let i=e;return i.body&&!Array.isArray(i.body)&&Dn(i.body.value)&&(i.body.value=On()),An(i,t,n,r)},Mn=e=>{let t=e;return t.maeData?.textBody&&Dn(t.maeData.textBody.value)&&(t.maeData.textBody.value=On()),t.body=[t.maeData.textBody],t.body.push(...t.maeData.tags.map(e=>({id:e.value,purpose:`tagging`,type:`TextualBody`,value:e.value}))),t},Nn=async(e,t,n,r)=>{let i=e;return e.maeData.templateType===en.IIIF_TYPE?e:(i.body&&!Array.isArray(i.body)&&Dn(i.body.value)&&(i.body.value=On()),i.maeData.templateType===en.MULTIPLE_BODY_TYPE?Mn(i):i.maeData?.textBody&&Dn(i.maeData.textBody.value)&&(i.maeData.textBody.value=On()),An(i,t,n,r))};function Pn(e){let t={chars:e.value};return t[`@type`]=e.purpose===`tagging`?`oa:Tag`:`dctypes:Text`,e.format&&(t.format=e.format),e.language&&(t.language=e.language),e.purpose&&(t.motivation=e.purpose),t}function Fn(e){switch(e.type){case`SvgSelector`:return{"@type":`oa:SvgSelector`,value:e.value};case`FragmentSelector`:return{"@type":`oa:FragmentSelector`,value:e.value};default:return null}}function In(e){let t={"@context":`https://iiif.io/api/presentation/2/context.json`,"@type":`oa:Annotation`,maeData:e.maeData||{},motivation:`oa:commenting`};if(e.id?.startsWith(`http`)&&(t[`@id`]=e.id),t.resource=Array.isArray(e.body)?e.body.map(e=>Pn(e)):Pn(e.body),t.on=typeof e.target==`object`&&!Array.isArray(e.target)&&e.target!==null?{"@type":`oa:SpecificResource`,full:e.target.source?.id||e.target.id||e.target.source}:e.target,e.target.selector){if(Array.isArray(e.target.selector)){let n=e.target.selector.map(e=>Fn(e));t.on.selector={"@type":`oa:Choice`,default:n[0],item:n[1]}}else t.on.selector=Fn(e.target.selector);e.target.source?.partOf&&(t.on.within={"@id":e.target.source.partOf.id,"@type":`sc:Manifest`})}return t}function Ln(e){let t={type:`TextualBody`,value:e.chars};return e.motivation&&(t.purpose=e.motivation),e.format&&(t.format=e.format),e.language&&(t.language=e.language),e[`@type`]===`oa:Tag`&&(t.purpose=`tagging`),t}function Rn(e){switch(e[`@type`]){case`oa:SvgSelector`:return{type:`SvgSelector`,value:e.value};case`oa:FragmentSelector`:return{type:`FragmentSelector`,value:e.value};case`oa:Choice`:return[Rn(e.default),Rn(e.item)];default:return null}}function zn(e){let t={id:e[`@id`],maeData:e.maeData||{},motivation:`commenting`,type:`Annotation`};t.body=Array.isArray(e.resource)?e.resource.map(e=>Ln(e)):e.resource?Ln(e.resource):{};let n=e.on;return Array.isArray(n)&&([n]=n),t.target={selector:Rn(n.selector),source:n.full},n.within&&(t.target.source={id:n.full,partOf:{id:n.within[`@id`],type:`Manifest`},type:`Canvas`}),t}function Bn(e,t){return Array.isArray(e)?{id:t,items:e.map(e=>zn(e)),type:`AnnotationPage`}:e}var Vn=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z`}),`TextFields`),Hn=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`m21.41 11.58-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42M5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7`}),`LocalOffer`),Un=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7m17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4z`}),`DataObject`),Wn=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5`}),`Place`);function Gn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function Kn(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})}var qn=e=>e.split(/(\.|\[\d+\])/).filter(e=>e!==`.`&&e!==``).map(e=>{let t=/\[(\d+)\]/.exec(e);return t?Number(t[1]):e}),Jn=(e,t,n)=>{let r=Array.isArray(t)?t:qn(t);if(r.length===0)return e;let i=r[0];if(Array.isArray(e)&&typeof i!=`number`&&e.length>0)return e.map(e=>Jn(e,r,n));if(typeof e!=`object`||!e||!(i in e))return Yn(e,i,n);let a=e[i];return r.length===1?a:Jn(a,r.slice(1),n)},Yn=(e,t,n)=>{if(n===void 0)throw Error(`Unable to extract object property\nLooking for property: ${t}\nIn object: ${JSON.stringify(e)}`);return n},Xn=(e,t,n,r,i)=>{if(!r)throw Error(i??`Invalid property path: ${t}\nCouldn't access "${n}" in ${JSON.stringify(e)}`)},Zn=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Qn=e=>Array.isArray(e),$n=(e,t)=>e.filter((e,n)=>n!==t),er=(e,t,n,r={})=>{let{remove:i=!1,createNew:a=!0,noError:o=!1}=r,s=e,c=typeof(l=t)==`string`?l:typeof l==`number`?String(l):l.reduce((e,t)=>typeof t==`number`?`${e}[${t}]`:e===``?t:`${e}.${t}`,``);var l;let u=Object.assign(Object.assign({},r),{remove:i,createNew:a,noError:o,fullData:s,fullPath:c}),d=Array.isArray(t)?t:qn(t);return Qn(e)&&i&&d.length===1?$n(e,d[0]):tr(e,d,n,u)},tr=(e,t,n,r)=>{let i=Zn(e)?Object.assign({},e):null,a=Qn(e)?[...e]:null;if(t.length===0)return e;if(!i&&!a)throw Error(`Can't assign property -- invalid input object`);let{createNew:o,remove:s,noError:c,fullData:l,fullPath:u}=r,d=t[0];if(a&&typeof d==`string`)return a.map(e=>tr(e,t,n,r));if(t.length===1)return i&&typeof d==`string`?nr(i,d,n,r)??i:a&&typeof d==`number`?(rr(a,d,n,r),a):(Xn(l,u,d,c),e);let f=i||a||[];if(s&&t.length===2&&typeof t[1]==`number`){let e=f[d],n=t[1];return Qn(e)?f[d]=$n(e,n):Xn(l,u,d,c,`Trying to remove an indexed item from an object that is not an array`),f}let p=t.slice(1);if(d in e){if(m=f[d],!Qn(m)&&!Zn(m)){if(!o)return Xn(l,u,d,c),f;f[d]={}}return f[d]=tr(f[d],p,n,r),f}var m;if(o){let e=typeof p[0]==`number`?[]:{};if(i)return f[d]=e,f[d]=tr(f[d],p,n,r),f;if(a&&Array.isArray(f)){f.push(e);let t=f.length-1;return f[t]=tr(f[t],p,n,r),f}}return Xn(l,u,d,c),f},nr=(e,t,n,r)=>{let{remove:i,createNew:a,noError:o,insertAfter:s,insertBefore:c,fullData:l,fullPath:u}=r;if(c!==void 0||s!==void 0){let r=Object.entries(e),i=1/0;return i=typeof c==`number`?c:typeof s==`number`?s:r.findIndex(([e])=>e===(c??s)),s!==void 0&&i++,r.splice(i,0,[t,n]),Object.fromEntries(r)}let d=t in e;i?d?delete e[t]:Xn(l,u,t,o):a||d?e[t]=n:Xn(l,u,t,o)},rr=(e,t,n,r)=>{let{noError:i,fullData:a,fullPath:o,createNew:s,insert:c}=r;c&&e.splice(t,0,n),t in e?e[t]=n:s?e.push(n):Xn(a,o,t,i)},ir=({className:e,name:t,value:n,setValue:r,handleKeyPress:i,styles:a,textAreaRef:o})=>{if(typeof n!=`string`)return null;let s=n.slice(-1)===`
|
|
24
|
+
`?n+`.`:n;return(0,p.jsxs)(`div`,{style:{display:`grid`},children:[(0,p.jsx)(`textarea`,{id:`${t}_textarea`,ref:o,style:Object.assign({height:`auto`,gridArea:`1 / 1 / 2 / 2`,overflowY:`auto`,whiteSpace:`pre-wrap`},a),rows:1,className:e,name:`${t}_textarea`,value:n,onChange:e=>r(e.target.value),autoFocus:!0,onFocus:e=>{n.length<40&&e.target.select()},onKeyDown:i}),(0,p.jsx)(`span`,{className:e,style:Object.assign({visibility:`hidden`,height:`auto`,gridArea:`1 / 1 / 2 / 2`,color:`red`,opacity:.9,whiteSpace:`pre-wrap`,overflowY:`auto`,border:`1px solid transparent`},a),children:s})]})},ar=e=>typeof e==`object`&&!!e,or=(e,t,n,r=``)=>{if(!n&&!r)return!0;switch(e){case`collection`:if(n){if(n(t,r))return!0;if(!sr(r,t,n))return!1}if(!n&&r&&!sr(r,t))return!1;break;case`value`:if(n&&!n(t,r)||!n&&r&&!cr(t,r))return!1}return!0},sr=(e=``,t,n=cr)=>{let r=t.value;return Object.entries(r).some(([i,a])=>{let o=[...t.path,i],s=Object.assign(Object.assign({},t),{key:i,path:o,level:t.level+1,value:a,size:o.length,parentData:r});return ar(a)?sr(e,s,n):n(s,e)})},cr=(e,t=``)=>{let{value:n}=e;if(n===null&&`null`.includes(t.toLowerCase()))return!0;switch(typeof n){case`string`:return n.toLowerCase().includes(t.toLowerCase());case`number`:return!!String(n).includes(t);case`boolean`:return n?`true`.includes(t.toLowerCase())||t===`1`:`false`.includes(t.toLowerCase())||t===`0`;default:return!1}},lr=({key:e,path:t},n=``)=>!!cr({value:e},n)||!!t.some(e=>cr({value:e},n)),ur=(e,t)=>(t??``)+e.map(e=>e===``?`\0`:e).join(`.`),dr=e=>e.shiftKey?`Shift`:e.metaKey?`Meta`:e.ctrlKey?`Control`:e.altKey?`Alt`:void 0,fr=(e,t,n)=>{let r=e.key,i=dr(e);if(Array.isArray(t))return!!i&&t.includes(i);let{key:a,modifier:o}=t;return(n!==`stringLineBreak`||r!==`Enter`||i!==`Shift`||a!==`Enter`||!o?.includes(`Shift`))&&r===a&&(o===i||Array.isArray(o)&&o.includes(i))},pr={key:`Enter`},mr={confirm:pr,cancel:{key:`Escape`},objectConfirm:Object.assign(Object.assign({},pr),{modifier:[`Meta`,`Shift`,`Control`]}),objectLineBreak:pr,stringConfirm:pr,stringLineBreak:Object.assign(Object.assign({},pr),{modifier:[`Shift`]}),numberConfirm:pr,numberUp:{key:`ArrowUp`},numberDown:{key:`ArrowDown`},tabForward:{key:`Tab`},tabBack:{key:`Tab`,modifier:`Shift`},booleanConfirm:pr,booleanToggle:{key:` `},clipboardModifier:[`Meta`,`Control`],collapseModifier:[`Alt`]},hr=(e,t,n=`next`,r)=>{let i=t.slice(0,t.length-1),a=t.slice(-1)[0];if(a===void 0)return null;let o=Jn(e,i),s=_r(o);Array.isArray(o)||r(s,({key:e,value:t})=>[e,t]);let c=s[s.findIndex(e=>e.key===a)+(n===`next`?1:-1)];return c?ar(c.value)?Object.keys(c.value).length===0?hr(e,[...i,c.key],n,r):gr(e,[...i,c.key],n,r):[...i,c.key]:i.length===0?null:hr(e,i,n,r)},gr=(e,t,n=`next`,r)=>{let i=Jn(e,t);if(!ar(i))return t;let a=Array.isArray(i)?i.map((e,t)=>t):Object.keys(i);r(a,e=>[e,i]);let o=n===`next`?a[0]:a[a.length-1];return gr(e,[...t,o],n,r)},_r=e=>Array.isArray(e)?e.map((e,t)=>({index:t,value:e,key:t})):Object.entries(e).map(([e,t],n)=>({key:e,value:t,index:n})),vr=(e,t)=>{let n=e.current,r=n?.selectionStart??1/0,i=n?.selectionEnd??1/0,a=(n?.textContent)?.slice(0,r)+t+(n?.textContent)?.slice(i);return n.value=a,n?.setSelectionRange(r+1,r+1),a},yr=e=>{if(e!==br){if(Array.isArray(e))return e.map(e=>yr(e));if(e&&typeof e==`object`)for(let t in e)e[t]=yr(e[t]);return e}},br=`__undefined__`,xr={displayName:`Default`,fragments:{edit:`rgb(42, 161, 152)`},styles:{container:{backgroundColor:`#f6f6f6`,fontFamily:`monospace`},collection:{},collectionInner:{},collectionElement:{},dropZone:{},property:`#292929`,bracket:{color:`rgb(0, 43, 54)`,fontWeight:`bold`},itemCount:{color:`rgba(0, 0, 0, 0.3)`,fontStyle:`italic`},string:`rgb(203, 75, 22)`,number:`rgb(38, 139, 210)`,boolean:`green`,null:{color:`rgb(220, 50, 47)`,fontVariant:`small-caps`,fontWeight:`bold`},input:[`#292929`],inputHighlight:`#b3d8ff`,error:{fontSize:`0.8em`,color:`red`,fontWeight:`bold`},iconCollection:`rgb(0, 43, 54)`,iconEdit:`edit`,iconDelete:`rgb(203, 75, 22)`,iconAdd:`edit`,iconCopy:`rgb(38, 139, 210)`,iconOk:`green`,iconCancel:`rgb(203, 75, 22)`}},Sr=(0,u.createContext)({getStyles:()=>({}),icons:{}}),Cr=({theme:e=xr,icons:t={},docRoot:n,children:r})=>{let i=Tr(e,n);return(0,p.jsx)(Sr.Provider,{value:{getStyles:(e,t)=>typeof i[e]==`function`?i[e](t):i[e],icons:t},children:r})},wr=()=>(0,u.useContext)(Sr),Tr=(e,t)=>{var n,r;let i={},a=(Array.isArray(e)?e:[e]).map(e=>Dr(e)?Er({fragments:{},styles:e},i):Er(e,i)),o=Er(xr,{});Object.keys(o).forEach(e=>{let t=e;a.forEach(e=>{e[t]&&(o[t]=Object.assign(Object.assign({},o[t]),e[t]))})});let s=Object.assign({},o);return Object.entries(i).forEach(([e,t])=>{let n=e;s[n]=e=>{let r=t(e)||{};return Object.assign(Object.assign({},o[n]),r)}}),typeof s?.inputHighlight!=`function`&&(n=s?.inputHighlight)!=null&&n.backgroundColor&&t.style.setProperty(`--jer-highlight-color`,s?.inputHighlight?.backgroundColor),typeof s?.iconCopy!=`function`&&(r=s?.iconCopy)!=null&&r.color&&t.style.setProperty(`--jer-icon-copy-color`,s?.iconCopy?.color),s},Er=(e,t)=>{let{fragments:n,styles:r}=e,i={};return Object.entries(r).forEach(([e,r])=>{let a=(Array.isArray(r)?r:[r]).reduce((r,i)=>{if(typeof i==`function`)return t[e]=i,Object.assign({},r);if(typeof i==`string`){let t=n?.[i]??i;return typeof t==`string`?Object.assign(Object.assign({},r),{[Or[e]??`color`]:t}):Object.assign(Object.assign({},r),t)}return Object.assign(Object.assign({},r),i)},{});i[e]=a}),i},Dr=e=>!(`styles`in e),Or={container:`backgroundColor`,collection:`backgroundColor`,collectionInner:`backgroundColor`,collectionElement:`backgroundColor`,dropZone:`borderColor`,inputHighlight:`backgroundColor`},kr=(0,u.createContext)(null),Ar=({children:e,onEditEvent:t,onCollapse:n})=>{let[r,i]=(0,u.useState)(null),[a,o]=(0,u.useState)(null),[s,c]=(0,u.useState)(null),[l,d]=(0,u.useState)({path:null,pathString:null}),f=(0,u.useRef)(null),m=(0,u.useRef)(`next`),h=(0,u.useRef)(null);return(0,p.jsx)(kr.Provider,{value:{collapseState:r,setCollapseState:e=>{i(e),n&&e!==null&&(Array.isArray(e)?e.forEach(e=>n(e)):n(e)),e!==null&&setTimeout(()=>i(null),2e3)},getMatchingCollapseState:e=>{if(Array.isArray(r)){for(let t of r)if(Mr(e,t))return t;return null}return Mr(e,r)?r:null},currentlyEditingElement:a,setCurrentlyEditingElement:(e,n)=>{let r=typeof e==`string`||e===null?e:ur(e,n===`key`?`key_`:void 0);a!==null&&r!==null&&f.current!==null&&f.current(),o(r),t&&(Array.isArray(e)||e===null)&&t(e,n===`key`),f.current=typeof n==`function`?n:null},areChildrenBeingEdited:e=>a!==null&&a.includes(e),previouslyEditedElement:h.current,setPreviouslyEditedElement:e=>{h.current=e},tabDirection:m.current,setTabDirection:e=>{m.current=e},previousValue:s,setPreviousValue:c,dragSource:l,setDragSource:d},children:e})},jr=()=>{let e=(0,u.useContext)(kr);if(!e)throw Error(`Missing Context Provider`);return e},Mr=(e,t)=>{if(t===null)return!1;if(!t.includeChildren)return t.path.every((t,n)=>e[n]===t)&&t.path.length===e.length;for(let[n,r]of t.path.entries())if(r!==e[n])return!1;return!0},Nr=`**INVALID_FUNCTION**`,Pr=({nodeData:e,showStringQuotes:t=!0,stringTruncate:n=200,pathString:r,canEdit:i,setIsEditing:a,styles:o,translate:s,value:c,TextWrapper:l=({children:e})=>e})=>{let d=c??e.value,[f,m]=(0,u.useState)(!1),h=t?`"`:``,g=d.length>n,_=()=>{i?a(!0):m(!f)};return(0,p.jsxs)(`div`,{id:`${r}_display`,onDoubleClick:_,onClick:e=>{(e.getModifierState(`Control`)||e.getModifierState(`Meta`))&&_()},className:`jer-value-string`,style:o,children:[h,g?(0,p.jsxs)(p.Fragment,f?{children:[(0,p.jsx)(l,{children:(0,p.jsxs)(`span`,{children:[d,h]})}),(0,p.jsxs)(`span`,{className:`jer-string-expansion jer-show-less`,onClick:()=>m(!1),children:[` `,s(`SHOW_LESS`,e)]})]}:{children:[(0,p.jsxs)(l,{children:[(0,p.jsx)(`span`,{children:d.slice(0,n-2).trimEnd()}),` `]}),(0,p.jsx)(`span`,{className:`jer-string-expansion jer-ellipsis`,onClick:()=>m(!0),children:`...`}),h]}):(0,p.jsx)(l,{children:`${d}${h}`})]})},Fr=({styles:e,pathString:t,value:n,setValue:r,handleEdit:i,handleKeyboard:a,keyboardCommon:o})=>{let s=(0,u.useRef)(null);return(0,p.jsx)(ir,{className:`jer-input-text`,textAreaRef:s,name:t,value:n,setValue:r,handleKeyPress:e=>{a(e,Object.assign({stringConfirm:i,stringLineBreak:()=>{r(vr(s,`
|
|
25
|
+
`))}},o))},styles:e})},Ir=e=>{var{isEditing:t,path:n,enumType:r}=e,i=Gn(e,[`isEditing`,`path`,`enumType`]);let{getStyles:a}=wr(),o=ur(n),{value:s,setValue:c,nodeData:l,handleEdit:u,handleKeyboard:d,keyboardCommon:f}=i;return t&&r?(0,p.jsxs)(`div`,{className:`jer-select jer-select-enums`,children:[(0,p.jsx)(`select`,{name:`${o}-value-select`,className:`jer-select-inner`,onChange:e=>c(e.target.value),value:s,autoFocus:!0,onKeyDown:e=>{d(e,Object.assign({stringConfirm:u},f))},children:r.values.map(e=>(0,p.jsx)(`option`,{value:e,children:e},e))}),(0,p.jsx)(`span`,{className:`focus`})]}):t?(0,p.jsx)(Fr,Object.assign({styles:a(`input`,l),pathString:o},i,{setValue:i.setValue})):(0,p.jsx)(Pr,Object.assign({pathString:o,styles:a(`string`,l)},i))},Lr=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:a,nodeData:o,handleKeyboard:s,keyboardCommon:c})=>{let{getStyles:l}=wr();return n?(0,p.jsx)(`input`,{className:`jer-input-number`,type:`text`,name:ur(r),value:e,onChange:e=>t(e.target.value.replace(/[^0-9.-]/g,``)),autoFocus:!0,onFocus:e=>setTimeout(()=>e.target.select(),10),onKeyDown:n=>s(n,Object.assign({numberConfirm:a,numberUp:()=>t(Number(e)+1),numberDown:()=>t(Number(e)-1)},c)),style:Object.assign({width:String(e).length/1.5+2+`em`},l(`input`,o))}):(0,p.jsx)(`span`,{onDoubleClick:()=>i(!0),className:`jer-value-number`,style:l(`number`,o),children:e})},Rr=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:a,nodeData:o,handleKeyboard:s,keyboardCommon:c})=>{let{getStyles:l}=wr();return typeof e==`boolean`?n?(0,p.jsx)(`input`,{className:`jer-input-boolean`,type:`checkbox`,name:ur(r),checked:e,onChange:()=>t(!e),onKeyDown:n=>{n.key===` `&&n.preventDefault(),s(n,Object.assign({booleanConfirm:a,booleanToggle:()=>t(!e)},c))},autoFocus:!0}):(0,p.jsx)(`span`,{onDoubleClick:()=>i(!0),className:`jer-value-boolean`,style:l(`boolean`,o),children:String(e)}):null},zr=(e,t)=>{let n=(0,u.useRef)(void 0),r=(0,u.useRef)(t);(0,u.useEffect)(()=>{r.current=t},[t]);let i=e=>{r.current(e)};(0,u.useEffect)(()=>{if(window.clearTimeout(n.current),e)return n.current=window.setTimeout(()=>{window.addEventListener(`keydown`,i)},100),()=>{window.clearTimeout(n.current),window.removeEventListener(`keydown`,i)}},[e])},Br=({value:e,isEditing:t,setIsEditing:n,handleEdit:r,nodeData:i,handleKeyboard:a,keyboardCommon:o})=>{let{getStyles:s}=wr();return zr(t,e=>a(e,Object.assign({confirm:r},o))),(0,p.jsx)(`div`,{onDoubleClick:()=>n(!0),className:`jer-value-null`,style:s(`null`,i),children:String(e)})},Vr=({value:e})=>{let t=`Error!`;switch(typeof e){case`string`:e===Nr&&(t=`Function`);break;case`undefined`:t=`Undefined`;break;case`symbol`:t=`Symbol`}return(0,p.jsx)(`span`,{className:`jer-value-invalid`,children:t})},Hr=({size:e,style:t,className:n})=>(0,p.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,width:e,height:e,className:n,style:t,children:[(0,p.jsx)(`path`,{d:`M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z`}),(0,p.jsx)(`path`,{d:`M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z`})]}),Ur=({size:e,style:t,className:n})=>(0,p.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,width:e,height:e,className:n,style:t,transform:`translate(0, 0.5)`,children:[(0,p.jsx)(`path`,{d:`M7 17.013l4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z`}),(0,p.jsx)(`path`,{d:`M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z`})]}),Wr=({size:e,style:t,className:n})=>(0,p.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,width:e,height:e,className:n,style:t,children:(0,p.jsx)(`path`,{d:`M6 19a2 2 0 002 2h8a2 2 0 002-2V7H6v12m2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12M15.5 4l-1-1h-5l-1 1H5v2h14V4h-3.5z`})}),Gr=({size:e,style:t,className:n})=>(0,p.jsxs)(`svg`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:e,height:e,className:n,style:t,children:[(0,p.jsx)(`path`,{d:`M9 2 H15 A1 1 0 0 1 16 3 V5 A1 1 0 0 1 15 6 H9 A1 1 0 0 1 8 5 V3 A1 1 0 0 1 9 2 z`}),(0,p.jsx)(`path`,{d:`M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11`}),(0,p.jsx)(`path`,{d:`M15 10l-4 4 4 4`})]}),Kr=({size:e,style:t,className:n})=>(0,p.jsxs)(`svg`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:e,height:e,className:n,style:t,children:[(0,p.jsx)(`path`,{d:`M22 11.08V12a10 10 0 11-5.93-9.14`}),(0,p.jsx)(`path`,{d:`M22 4L12 14.01l-3-3`})]}),qr=({size:e,style:t,className:n})=>(0,p.jsx)(`svg`,{baseProfile:`tiny`,viewBox:`0 0 24 24`,fill:`currentColor`,width:e,height:e,className:n,style:t,children:(0,p.jsx)(`path`,{d:`M12 4c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8zm-5 8c0-.832.224-1.604.584-2.295l6.711 6.711A4.943 4.943 0 0112 17c-2.757 0-5-2.243-5-5zm9.416 2.295L9.705 7.584A4.943 4.943 0 0112 7c2.757 0 5 2.243 5 5 0 .832-.224 1.604-.584 2.295z`})}),Jr=({size:e,style:t,className:n})=>(0,p.jsx)(`svg`,{viewBox:`0 0 512 512`,fill:`currentColor`,width:e,height:e,className:n,style:t,children:(0,p.jsx)(`path`,{d:`M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z`})}),Yr=({name:e,nodeData:t})=>{let{getStyles:n,icons:r}=wr(),i={size:`1.4em`,className:`jer-icon`};switch(e){case`add`:return r?.add??(0,p.jsx)(Hr,Object.assign({},i,{style:n(`iconAdd`,t)}));case`edit`:return r?.edit??(0,p.jsx)(Ur,Object.assign({},i,{style:n(`iconEdit`,t)}));case`delete`:return r?.delete??(0,p.jsx)(Wr,Object.assign({},i,{style:n(`iconDelete`,t),size:`1.45em`}));case`copy`:return r?.copy??(0,p.jsx)(Gr,Object.assign({},i,{style:n(`iconCopy`,t),size:`1.2em`}));case`ok`:return r?.ok??(0,p.jsx)(Kr,Object.assign({},i,{style:Object.assign({fontSize:`90%`},n(`iconOk`,t))}));case`cancel`:return r?.cancel??(0,p.jsx)(qr,Object.assign({},i,{style:Object.assign({fontSize:`130%`},n(`iconCancel`,t))}));case`chevron`:return r?.chevron??(0,p.jsx)(Jr,{size:`1em`,style:n(`iconCollection`,t)});default:return(0,p.jsx)(p.Fragment,{})}},Xr=({startEdit:e,handleDelete:t,handleAdd:n,enableClipboard:r,type:i,customButtons:a,nodeData:o,translate:s,keyboardControls:c,handleKeyboard:l,editConfirmRef:d,getNewKeyOptions:f,jsonStringify:m,onEditEvent:h,showIconTooltips:g})=>{let{getStyles:_}=wr(),v=s(`KEY_NEW`,o),[y,b]=(0,u.useState)(v),[x,S]=(0,u.useState)(!1),{key:C,path:w,value:T}=o,E=Array.isArray(x),D=e=>{if(h&&h(e?[...w,null]:null,e),!e)return void S(!1);let t=Object.keys(Jn(o.fullData,w)),n=f?f(o)?.filter(e=>!t.includes(e)):null;n&&b(``),S(n==null||n)};return(0,p.jsxs)(`div`,{className:`jer-edit-buttons`,style:{opacity:x?1:void 0},onClick:e=>e.stopPropagation(),children:[r&&(0,p.jsx)(`div`,{onClick:e=>{var t;e.stopPropagation();let n,i,a=`value`,o=``,s=null;if(r){let l=dr(e);if(l&&c.clipboardModifier.includes(l)?(n=Qr(w),o=n,a=`path`):(n=T,o=typeof n==`object`?m(T):String(n)),!navigator.clipboard)return void(typeof r==`function`&&r({success:!1,value:n,stringValue:o,path:w,key:C,type:a,errorMessage:`Can't access clipboard API`}));(t=navigator.clipboard)==null||t.writeText(o).then(()=>i=!0).catch(e=>{i=!1,s=e.message}).finally(()=>{typeof r==`function`&&r({success:i,errorMessage:s,value:n,stringValue:o,path:w,key:C,type:a})})}},className:`jer-copy-pulse`,title:g?s(`TOOLTIP_COPY`,o):``,children:(0,p.jsx)(Yr,{name:`copy`,nodeData:o})}),e&&(0,p.jsx)(`div`,{onClick:e,title:g?s(`TOOLTIP_EDIT`,o):``,children:(0,p.jsx)(Yr,{name:`edit`,nodeData:o})}),t&&(0,p.jsx)(`div`,{onClick:t,title:g?s(`TOOLTIP_DELETE`,o):``,children:(0,p.jsx)(Yr,{name:`delete`,nodeData:o})}),n&&(0,p.jsx)(`div`,{onClick:()=>{i===`object`?D(!0):n(``)},title:g?s(`TOOLTIP_ADD`,o):``,children:(0,p.jsx)(Yr,{name:`add`,nodeData:o})}),a?.map(({Element:e,onClick:t},n)=>(0,p.jsx)(`div`,{onClick:e=>t&&t(o,e),children:(0,p.jsx)(e,{nodeData:o})},n)),x&&n&&i===`object`&&(0,p.jsxs)(p.Fragment,{children:[E?(0,p.jsxs)(`div`,{className:`jer-select jer-select-keys`,children:[(0,p.jsxs)(`select`,{name:`new-key-select`,className:`jer-select-inner`,onChange:e=>{n(e.target.value),D(!1)},defaultValue:``,autoFocus:!0,onKeyDown:e=>{l(e,{cancel:()=>D(!1)})},children:[(0,p.jsx)(`option`,{value:``,disabled:!0,children:x.length>0?s(`KEY_SELECT`,o):s(`NO_KEY_OPTIONS`,o)}),x.map(e=>(0,p.jsx)(`option`,{value:e,children:e},e))]}),(0,p.jsx)(`span`,{className:`focus`})]}):(0,p.jsx)(`input`,{className:`jer-input-new-key`,type:`text`,name:`new-object-key`,value:y,onChange:e=>b(e.target.value),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>{l(e,{stringConfirm:()=>{n&&(D(!1),n(y),b(v))},cancel:()=>{D(!1),b(v)}})},style:_(`input`,o)}),(0,p.jsx)(Zr,{onOk:()=>{E&&!y||(D(!1),n(y))},onCancel:()=>{D(!1)},nodeData:o,editConfirmRef:d,hideOk:E})]})]})},Zr=({onOk:e,onCancel:t,nodeData:n,editConfirmRef:r,hideOk:i=!1})=>(0,p.jsxs)(`div`,{className:`jer-confirm-buttons`,children:[!i&&(0,p.jsx)(`div`,{onClick:e,ref:r,children:(0,p.jsx)(Yr,{name:`ok`,nodeData:n})}),(0,p.jsx)(`div`,{onClick:t,children:(0,p.jsx)(Yr,{name:`cancel`,nodeData:n})})]}),Qr=e=>e.reduce((e,t)=>typeof t==`number`?`${e}[${t}]`:e===``?t:`${e}.${t}`,``),$r=[`string`,`number`,`boolean`,`null`,`object`,`array`],B=({props:e,collapsed:t})=>{let{data:n,nodeData:r,parentData:i,onEdit:a,onError:o,showErrorMessages:s,restrictEditFilter:c,restrictDeleteFilter:l,restrictAddFilter:d,restrictDragFilter:f,translate:p,errorMessageTimeout:m}=e,{currentlyEditingElement:h,setCurrentlyEditingElement:g}=jr(),[_,v]=(0,u.useState)(null),y=Object.assign(Object.assign({},r),{collapsed:t}),{path:b,key:x,size:S}=y,C=ur(b),w=!c(y),T=!l(y),E=!d(y),D=!f(y)&&T&&h===null,O=e=>{s&&(v(e),setTimeout(()=>v(null),m)),console.warn(`Error`,e)},k=(0,u.useCallback)((e,t)=>{O(e.message),o&&o({currentData:y.fullData,errorValue:t,currentValue:n,name:x,path:b,error:e})},[o,s]),A=h===C,j=h===`key_${C}`,M=typeof b.slice(-1)[0]==`number`;return{pathString:C,nodeData:y,path:b,name:x,size:S,canEdit:w,canDelete:T,canAdd:E,canDrag:D,error:_,showError:O,onError:k,setError:v,handleEditKey:e=>{if(g(null),x===e||!i)return;let t=b.slice(0,-1);if(Object.keys(i).includes(e))return void k({code:`KEY_EXISTS`,message:p(`ERROR_KEY_EXISTS`,y)},e);let n=Object.fromEntries(Object.entries(i).map(([t,n])=>t===x?[e,n]:[t,n]));a(n,t).then(t=>{t&&k({code:`UPDATE_ERROR`,message:t},e)})},derivedValues:{isEditing:A,isEditingKey:j,isArray:M,canEditKey:i!==null&&w&&E&&T&&!M},emptyStringKey:x===``&&b.length>0?p(`EMPTY_STRING`,y):null}},ei=({canDrag:e,canDragOnto:t,path:n,nodeData:r,onMove:i,onError:a,translate:o})=>{let{getStyles:s}=wr(),{dragSource:c,setDragSource:l}=jr(),[d,f]=(0,u.useState)(!1),m=ur(n),h=(0,u.useMemo)(()=>e?{onDragStart:e=>{e.stopPropagation(),l({path:n,pathString:m})},onDragEnd:e=>{e.stopPropagation(),l({path:null,pathString:null})}}:{},[e,m]),g=(0,u.useMemo)(()=>e=>t?{onDragOver:e=>{e.stopPropagation(),e.preventDefault()},onDrop:t=>{t.stopPropagation(),v(e),l({path:null,pathString:null}),f(!1)},onDragEnter:t=>{t.stopPropagation(),m.startsWith(c.pathString??``)||f(e)},onDragExit:e=>{e.stopPropagation(),f(!1)}}:{},[c,t,m]),_=(0,u.useMemo)(()=>t&&c.pathString!==null?(0,p.jsx)(`div`,Object.assign({className:`jer-drop-target-bottom`,style:{height:`50%`,position:`absolute`,width:`100%`,top:`50%`,zIndex:n.length}},g(`below`))):null,[c,t,n.length]),v=e=>{let t=c.path?.slice(-1)[0],s=c.path?.slice(0,-1).join(`.`),l=n.slice(0,-1).join(``),{parentData:u}=r;typeof t==`string`&&u&&!Array.isArray(u)&&Object.keys(u).includes(t)&&t in u&&s!==l?a({code:`KEY_EXISTS`,message:o(`ERROR_KEY_EXISTS`,r)},t):i(c.path,n,e).then(e=>{e&&a({code:`UPDATE_ERROR`,message:e},r.value)})};return{dragSourceProps:h,getDropTargetProps:g,BottomDropTarget:_,DropTargetPadding:({position:e,nodeData:t})=>d===e?(0,p.jsx)(`div`,{className:`jer-drag-n-drop-padding`,style:s(`dropZone`,t)}):null,handleDrop:v}},ti=(e,t,n,r)=>{if(!t.current)return 0;let i=parseInt(getComputedStyle(n.current).getPropertyValue(`line-height`)??`16px`),a=(t.current?.offsetWidth??0)/(.5*i),o=r(e).replace(/\\n/g,`
|
|
26
|
+
`).split(`
|
|
27
|
+
`).map(e=>Math.ceil(e.length/a)).reduce((e,t)=>e+t,0)*i;return Math.min(o+30,window.innerHeight-50)},ni=({isEditingKey:e,canEditKey:t,pathString:n,path:r,name:i,arrayIndexFromOne:a,handleKeyboard:o,handleEditKey:s,handleCancel:c,handleClick:l,keyValueArray:u,styles:d,getNextOrPrevious:f,emptyStringKey:m,nodeData:h,customNodeData:g,getStyles:_})=>{let{setCurrentlyEditingElement:v}=jr(),y=typeof i==`number`?String(i+ +!!a):i;if(!e){let e=Object.assign(Object.assign({},d),{minWidth:`${Math.min(y.length+1,5)}ch`,flexShrink:+(y.length>10)});if(g?.CustomKey&&h&&_){let{CustomKey:n,customNodeProps:i}=g;return(0,p.jsx)(n,{nodeData:h,name:m??y,path:r,canEditKey:t,handleEditKey:e=>{t&&s(e)},setIsEditingKey:()=>{t&&v(r,`key`)},handleClick:l,styles:e,customNodeProps:i,getStyles:_})}return(0,p.jsxs)(`span`,{className:`jer-key-text`,style:e,onDoubleClick:()=>t&&v(r,`key`),onClick:l,children:[m?(0,p.jsx)(`span`,{className:`jer-empty-string`,children:m}):y,y!==``||m?(0,p.jsx)(`span`,{className:`jer-key-colon`,children:`:`}):null]})}return(0,p.jsx)(`input`,{className:`jer-input-text jer-key-edit`,type:`text`,name:n,defaultValue:y,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>o(e,{stringConfirm:()=>s(e.target.value),cancel:c,tabForward:()=>{if(s(e.target.value),u){let e=u?.[0][0];v(e?[...r,e]:f(`next`))}else v(r)},tabBack:()=>{s(e.target.value),v(f(`prev`))}}),style:{width:y.length/1.5+.5+`em`}})},ri=e=>{let{data:t,parentData:n,onEdit:r,onDelete:i,onChange:a,onMove:o,enableClipboard:s,canDragOnto:c,restrictTypeSelection:l,searchFilter:d,searchText:f,showLabel:m,stringTruncate:h,showStringQuotes:g,arrayIndexFromOne:_,indent:v,translate:y,customNodeDefinitions:b,customNodeData:x,handleKeyboard:S,keyboardControls:C,sort:w,editConfirmRef:T,jsonStringify:E,showIconTooltips:D}=e,{getStyles:O}=wr(),{setCurrentlyEditingElement:k,setCollapseState:A,previouslyEditedElement:j,setPreviouslyEditedElement:M,tabDirection:ee,setTabDirection:N,previousValue:P,setPreviousValue:F}=jr(),[I,L]=(0,u.useState)(typeof t==`function`?Nr:t),{pathString:te,nodeData:ne,path:re,name:ie,canEdit:ae,canDelete:oe,canDrag:se,error:ce,onError:le,handleEditKey:ue,emptyStringKey:de,derivedValues:fe}=B({props:e}),{dragSourceProps:pe,getDropTargetProps:me,BottomDropTarget:he,DropTargetPadding:ge}=ei({canDrag:se,canDragOnto:c,path:re,nodeData:ne,onMove:o,onError:le,translate:y}),[_e,ve]=(0,u.useState)(ii(t,x)),ye=(0,u.useCallback)(e=>{if(!a)return void L(e);let t=a({currentData:ne.fullData,newValue:e,currentValue:I,name:ie,path:re});L(t)},[a]);(0,u.useEffect)(()=>{L(typeof t==`function`?Nr:t),ve(ii(t,x))},[t,ce]);let{CustomNode:be,customNodeProps:xe,hideKey:Se,showEditTools:Ce=!0,showOnEdit:we,showOnView:Te,passOriginalNode:Ee}=x,De=[...$r,...b.filter(({showInTypesSelector:e=!1,name:t})=>e&&!!t).map(({name:e})=>e)],Oe=(0,u.useMemo)(()=>{if(typeof l==`boolean`)return l?[]:De;if(Array.isArray(l))return l;let e=l(ne);return typeof e==`boolean`?e?[]:De:e},[ne,l]),[ke,Ae]=(0,u.useState)(((e,t)=>{if(typeof e!=`string`)return null;let n=t.filter(t=>t instanceof Object&&t.enum&&t.values.includes(e)&&t.matchPriority);return n.sort((e,t)=>(t.matchPriority??0)-(e.matchPriority??0)),n[0]??null})(I,Oe)),{isEditing:je}=fe,Me=or(`value`,ne,d,f);if(je&&(!Me||!ae)&&k(hr(ne.fullData,re,ee,w)||j),!Me)return null;let R=e=>{let t;if(k(null),F(null),e===void 0||(e=>e&&typeof e==`object`&&`type`in e&&`target`in e&&`preventDefault`in e&&typeof e.preventDefault==`function`)(e))switch(_e){case`object`:t={[y(`DEFAULT_NEW_KEY`,ne)]:I};break;case`array`:t=I??[];break;case`number`:{let e=Number(I);t=isNaN(e)?0:e;break}default:t=I}else t=e;r(t,re).then(e=>{e&&le({code:`UPDATE_ERROR`,message:e},t)})},Ne=()=>{k(null),P===null?(L(t),F(null)):r(P,re)},{isEditingKey:Pe,canEditKey:Fe}=fe,Ie=!je&&ce,Le=je&&Oe.length>1,Re=(_e!==`invalid`||be)&&!ce&&Ce,ze=m&&!Se,Be=be&&(je&&we||!je&&Te),Ve={value:I,parentData:n,setValue:ye,isEditing:je,canEdit:ae,setIsEditing:ae?()=>k(re):()=>{},handleEdit:R,handleCancel:Ne,path:re,stringTruncate:h,showStringQuotes:g,nodeData:ne,enumType:ke,translate:y,handleKeyboard:S,keyboardCommon:{cancel:Ne,tabForward:()=>{N(`next`),M(te);let e=hr(ne.fullData,re,`next`,w);e&&(R(),k(e))},tabBack:()=>{N(`prev`),M(te);let e=hr(ne.fullData,re,`prev`,w);e&&(R(),k(e))}}},He={canEditKey:Fe,isEditingKey:Pe,pathString:te,path:re,name:ie,arrayIndexFromOne:_,handleKeyboard:S,handleEditKey:ue,handleCancel:Ne,styles:O(`property`,ne),getNextOrPrevious:e=>hr(ne.fullData,re,e,w),emptyStringKey:de,nodeData:ne,customNodeData:x,getStyles:O},Ue=Be?(0,p.jsx)(be,Object.assign({},e,{value:I,customNodeProps:xe,setValue:ye,handleEdit:R,handleCancel:Ne,handleKeyPress:e=>S(e,{stringConfirm:R,cancel:Ne}),isEditing:je,setIsEditing:()=>k(re),getStyles:O,originalNode:Ee?ai(t,Ve):void 0,originalNodeKey:Ee?(0,p.jsx)(ni,Object.assign({},He,{customNodeData:void 0})):void 0,canEdit:ae,keyboardCommon:Ve.keyboardCommon,onError:le})):ai(t,Ve);return(0,p.jsxs)(`div`,Object.assign({className:`jer-component jer-value-component`,style:{marginLeft:n===null?0:v/2+`em`,position:`relative`},draggable:se},pe,me(`above`),{children:[he,(0,p.jsx)(ge,{position:`above`,nodeData:ne}),(0,p.jsxs)(`div`,{className:`jer-value-main-row`,style:{flexWrap:ie.length>10?`wrap`:`nowrap`},children:[ze&&(0,p.jsx)(ni,Object.assign({},He)),(0,p.jsxs)(`div`,{className:`jer-value-and-buttons`,children:[(0,p.jsx)(`div`,{className:`jer-input-component`,children:Ue}),je?(0,p.jsx)(Zr,{onOk:R,onCancel:Ne,nodeData:ne,editConfirmRef:T}):Re&&(0,p.jsx)(Xr,{startEdit:ae?()=>{F(P),k(re,Ne)}:void 0,handleDelete:oe?()=>{i(I,re).then(e=>{e&&le({code:`DELETE_ERROR`,message:e},I)})}:void 0,enableClipboard:s,translate:y,customButtons:e.customButtons,nodeData:ne,handleKeyboard:S,keyboardControls:C,editConfirmRef:T,jsonStringify:E,showIconTooltips:D}),Le&&(0,p.jsxs)(`div`,{className:`jer-select jer-select-types`,children:[(0,p.jsx)(`select`,{name:`${ie}-type-select`,className:`jer-select-inner`,onChange:e=>(e=>{let t=b.find(t=>t.name===e);if(t)return r(t.defaultValue,re),ve(e),Ae(null),k(null),void A({path:re,collapsed:!1,includeChildren:!1});let n=Oe.find(t=>t instanceof Object&&t.enum===e);if(n)return typeof I==`string`&&n.values.includes(I)||r(n.values[0],re).then(e=>{e&&(le({code:`UPDATE_ERROR`,message:e},i),k(null))}),void Ae(n);let i=oi(I,e,y(`DEFAULT_NEW_KEY`,ne),x?.CustomNode?y(`DEFAULT_STRING`,ne):void 0);[`string`,`number`,`boolean`].includes(e)||k(null),r(i,re).then(e=>{e?(le({code:`UPDATE_ERROR`,message:e},i),k(null)):Ae(null)})})(e.target.value),value:ke?ke.enum:_e,children:Oe.map(e=>e instanceof Object&&`enum`in e?(0,p.jsx)(`option`,{value:e.enum,children:e.enum},e.enum):(0,p.jsx)(`option`,{value:e,children:e},e))}),(0,p.jsx)(`span`,{className:`focus`})]}),Ie&&(0,p.jsx)(`span`,{className:`jer-error-slug`,style:O(`error`,ne),children:ce})]})]}),(0,p.jsx)(ge,{position:`below`,nodeData:ne})]}))},ii=(e,t)=>t?.CustomNode&&t?.name&&t.showInTypesSelector?t.name:typeof e==`string`?`string`:typeof e==`number`?`number`:typeof e==`boolean`?`boolean`:e===null?`null`:`invalid`,ai=(e,t)=>{let n=ii(e),{value:r}=t;switch(n){case`string`:return(0,p.jsx)(Ir,Object.assign({},t,{value:r}));case`number`:return(0,p.jsx)(Lr,Object.assign({},t,{value:r}));case`boolean`:return(0,p.jsx)(Rr,Object.assign({},t,{value:r}));case`null`:return(0,p.jsx)(Br,Object.assign({},t));default:return(0,p.jsx)(Vr,Object.assign({},t))}},oi=(e,t,n,r)=>{switch(t){case`string`:return r??String(e);case`number`:{let t=Number(e);return isNaN(t)?0:t}case`boolean`:return!!e;case`null`:return null;case`object`:return{[n]:e};case`array`:return[e];default:return String(e)}},si=(e=[],t)=>{let n=e.filter(({condition:e})=>e(t));if(n.length===0)return{};let r=n[0],{element:i,wrapperElement:a,customKey:o,customNodeProps:s,wrapperProps:c,hideKey:l=!1,showEditTools:u=!0,showOnEdit:d=!1,showOnView:f=!0,showCollectionWrapper:p=!0}=r,m=Gn(r,[`element`,`wrapperElement`,`customKey`,`customNodeProps`,`wrapperProps`,`hideKey`,`showEditTools`,`showOnEdit`,`showOnView`,`showCollectionWrapper`]);return Object.assign({CustomNode:i,CustomWrapper:a,CustomKey:o,customNodeProps:s,wrapperProps:c,hideKey:l,showEditTools:u,showOnEdit:d,showOnView:f,showCollectionWrapper:p},m)},ci=e=>{let{getStyles:t}=wr(),{collapseState:n,setCollapseState:r,getMatchingCollapseState:i,currentlyEditingElement:a,setCurrentlyEditingElement:o,areChildrenBeingEdited:s,previousValue:c,setPreviousValue:l}=jr(),{mainContainerRef:d,data:f,nodeData:m,parentData:h,showCollectionCount:g,onEdit:_,onAdd:v,onDelete:y,canDragOnto:b,collapseFilter:x,collapseAnimationTime:S,onMove:C,enableClipboard:w,onEditEvent:T,showIconTooltips:E,searchFilter:D,searchText:O,indent:k,sort:A,showArrayIndices:j,arrayIndexFromOne:M,defaultValue:ee,newKeyOptions:N,translate:P,customNodeDefinitions:F,customNodeData:I,jsonParse:L,jsonStringify:te,TextEditor:ne,keyboardControls:re,handleKeyboard:ie,insertAtTop:ae,onCollapse:oe,editConfirmRef:se,collapseClickZones:ce}=e,[le,ue]=(0,u.useState)(te(f)),de=x(m),{contentRef:fe,isAnimating:pe,maxHeight:me,collapsed:he,animateCollapse:ge,cssTransitionValue:_e}=((e,t,n,r,i)=>{let[a,o]=(0,u.useState)(n?0:void 0),[s,c]=(0,u.useState)(n),l=(0,u.useRef)(!1),d=(0,u.useRef)(null),f=(0,u.useRef)(0),p=(0,u.useRef)(0),m=t/1e3+`s`,h=(0,u.useCallback)(n=>{if(s!==n){switch(window.clearTimeout(p.current),l.current=!0,n){case!0:{let e=d.current?.offsetHeight??0;f.current=e,o(e),setTimeout(()=>{o(0)},5);break}case!1:o(f.current||ti(e,d,r,i))}c(!s),p.current=window.setTimeout(()=>{l.current=!1,n||o(void 0)},t)}},[t,s,e,r,i]);return{contentRef:d,isAnimating:l.current,animateCollapse:h,maxHeight:a,collapsed:s,cssTransitionValue:m}})(f,S,de,d,te),{pathString:ve,nodeData:ye,path:be,name:xe,size:Se,canEdit:Ce,canDelete:we,canAdd:Te,canDrag:Ee,error:De,setError:Oe,onError:ke,handleEditKey:Ae,emptyStringKey:je,derivedValues:Me}=B({props:e,collapsed:he}),{dragSourceProps:R,getDropTargetProps:Ne,BottomDropTarget:Pe,DropTargetPadding:Fe}=ei({canDrag:Ee,canDragOnto:b,path:be,nodeData:ye,onMove:C,onError:ke,translate:P}),Ie=(0,u.useRef)(!de),{isEditing:Le,isEditingKey:Re,isArray:ze,canEditKey:Be}=Me;(0,u.useEffect)(()=>{ue(te(f))},[f]),(0,u.useEffect)(()=>{let e=x(ye)&&!Le;Ie.current=!e,ge(e)},[x]),(0,u.useEffect)(()=>{if(n!==null){let e=i(be);e&&(Ie.current=!0,ge(e.collapsed))}},[n]);let Ve=(0,u.useRef)(null),He=(0,u.useCallback)((e,t)=>{if(typeof ee!=`function`)return ee;let n=ee(e,t);return n===void 0?null:n},[ee]),Ue=(0,u.useCallback)(e=>N?typeof N==`function`?N(e):N:null,[N]),{CustomNode:We,customNodeProps:Ge,CustomWrapper:Ke,wrapperProps:qe={},hideKey:Je,showEditTools:Ye=!0,showOnEdit:Xe,showOnView:Ze,showCollectionWrapper:Qe=!0}=I,$e=s(ve);if($e&&he&&ge(!1),!(or(`collection`,ye,D,O)||ye.level===0)&&!$e)return null;let et=Array.isArray(f)?`array`:`object`,tt=et===`array`?{open:`[`,close:`]`}:{open:`{`,close:`}`},nt=e=>{if(e.key===`Tab`&&!e.getModifierState(`Shift`)){e.preventDefault();let t=vr(Ve,` `);ue(t);return}ie(e,{objectConfirm:it,cancel:ot})},rt=e=>{e.stopPropagation();let t=dr(e);if(t&&re.collapseModifier.includes(t))return Ie.current=!0,void r({collapsed:!he,path:be,includeChildren:!0});a&&a.includes(ve)||(Ie.current=!0,r(null),oe&&oe({path:be,collapsed:!he,includeChildren:!1}),ge(!he))},it=()=>{try{let e=L(le);if(o(null),l(null),Oe(null),te(e)===te(f))return;_(e,be).then(t=>{t&&ke({code:`UPDATE_ERROR`,message:t},e)})}catch{ke({code:`INVALID_JSON`,message:P(`ERROR_INVALID_JSON`,ye)},le)}},at=be.length>0?()=>{y(f,be).then(e=>{e&&ke({code:`DELETE_ERROR`,message:e},f)})}:void 0,ot=()=>{o(null),c===null?(Oe(null),ue(te(f)),l(null)):_(c,be)},st=g===`when-closed`?he:g,ct=!Le&&Ye,lt=(j||!ze)&&!Je&&xe!==void 0,ut=We&&(Le&&Xe||!Le&&Ze),dt=Object.entries(f).map(([e,t])=>[et===`array`?Number(e):e,t]);et===`object`&&A(dt,e=>e);let ft=Ie.current?Le?(0,p.jsxs)(`div`,{className:`jer-collection-text-edit`,children:[ne?(0,p.jsx)(ne,{value:le,onChange:ue,onKeyDown:e=>ie(e,{objectConfirm:it,cancel:ot})}):(0,p.jsx)(ir,{textAreaRef:Ve,className:`jer-collection-text-area`,name:ve,value:le,setValue:ue,handleKeyPress:nt,styles:t(`input`,ye)}),(0,p.jsx)(`div`,{className:`jer-collection-input-button-row`,children:(0,p.jsx)(Zr,{onOk:it,onCancel:ot,nodeData:ye,editConfirmRef:se})})]}):dt.map(([n,r],i)=>{let a={key:n,value:r,path:[...be,n],level:be.length+1,index:i,size:ar(r)?Object.keys(r).length:null,parentData:f,fullData:ye.fullData},o=si(F,a);return(0,p.jsx)(`div`,{className:`jer-collection-element`,style:t(`collectionElement`,a),children:ar(r)&&!o?.renderCollectionAsValue?(0,p.jsx)(ci,Object.assign({},e,{data:r,parentData:f,nodeData:a,showCollectionCount:g,canDragOnto:Ce,customNodeData:o}),n):(0,p.jsx)(ri,Object.assign({},e,{data:r,parentData:f,nodeData:a,canDragOnto:Ce,showLabel:et===`object`||j,customNodeData:o}),n)},n)}):null,pt=!!Qe&&he&&!$e;pt||(Ie.current=!0);let mt=Object.assign(Object.assign({},e),{data:f,value:f,parentData:h,nodeData:ye,setValue:e=>Kn(void 0,void 0,void 0,function*(){return yield _(e,be)}),handleEdit:it,handleCancel:ot,handleKeyPress:nt,isEditing:Le,setIsEditing:()=>o(be),getStyles:t,canDragOnto:Ce,canEdit:Ce,keyboardCommon:{},onError:ke}),ht=ut?(0,p.jsx)(We,Object.assign({customNodeProps:Ge},mt,{children:ft})):ft,gt=ct&&(0,p.jsx)(Xr,{startEdit:Ce?()=>{Ie.current=!0,l(null),o(be)}:void 0,handleAdd:Te?e=>{ge(!1);let t=He(ye,e);if(et===`array`){let e=ae.array?0:f.length,n=ae.array?{insert:!0}:{};v(t,[...be,e],n).then(e=>{e&&ke({code:`ADD_ERROR`,message:e},t)})}else if(e in f)ke({code:`KEY_EXISTS`,message:P(`ERROR_KEY_EXISTS`,ye)},e);else{let n=ae.object?{insertBefore:0}:{};v(t,[...be,e],n).then(e=>{e&&ke({code:`ADD_ERROR`,message:e},t)})}}:void 0,handleDelete:we?at:void 0,enableClipboard:w,type:et,nodeData:ye,translate:P,customButtons:e.customButtons,keyboardControls:re,handleKeyboard:ie,getNewKeyOptions:Ue,editConfirmRef:se,jsonStringify:te,onEditEvent:T,showIconTooltips:E}),_t={canEditKey:Be,isEditingKey:Re,pathString:ve,path:be,name:xe,arrayIndexFromOne:M,handleKeyboard:ie,handleEditKey:Ae,handleCancel:ot,keyValueArray:dt,styles:t(`property`,ye),getNextOrPrevious:e=>hr(ye.fullData,be,e,A),handleClick:ce.includes(`property`)?rt:e=>e.stopPropagation(),emptyStringKey:je,nodeData:ye,customNodeData:I,getStyles:t},vt=(0,p.jsxs)(`div`,Object.assign({className:`jer-component jer-collection-component`,style:Object.assign(Object.assign({marginLeft:(be.length===0?0:k/2)+`em`},t(`collection`,ye)),{position:`relative`}),draggable:Ee},R,Ne(`above`),{children:[(0,p.jsx)(`div`,{className:`jer-clickzone`,style:{width:k/2+1+`em`,zIndex:10+2*ye.level},onClick:ce.includes(`left`)?rt:void 0}),!Le&&Pe,(0,p.jsx)(Fe,{position:`above`,nodeData:ye}),Qe?(0,p.jsxs)(`div`,{className:`jer-collection-header-row`,style:{position:`relative`},onClick:ce.includes(`header`)?rt:void 0,children:[(0,p.jsxs)(`div`,{className:`jer-collection-name`,children:[(0,p.jsx)(`div`,{className:`jer-collapse-icon jer-accordion-icon`+(he?` jer-rotate-90`:``),style:{zIndex:11+2*ye.level,transition:_e},onClick:rt,children:(0,p.jsx)(Yr,{name:`chevron`,rotate:he,nodeData:ye})}),lt&&(0,p.jsx)(ni,Object.assign({},_t)),!Le&&(0,p.jsx)(`span`,{className:`jer-brackets jer-bracket-open`,style:t(`bracket`,ye),children:tt.open})]}),!Le&&st&&(0,p.jsx)(`div`,{className:`jer-collection-item-count`+(st?` jer-visible`:` jer-hidden`),style:Object.assign(Object.assign({},t(`itemCount`,ye)),{transition:_e}),children:Se===1?P(`ITEM_SINGLE`,Object.assign(Object.assign({},ye),{size:1}),1):P(`ITEMS_MULTIPLE`,ye,Se)}),(0,p.jsx)(`div`,{className:`jer-brackets`+(pt?` jer-visible`:` jer-hidden`),style:Object.assign(Object.assign({},t(`bracket`,ye)),{transition:_e}),children:tt.close}),gt]}):Je?(0,p.jsx)(p.Fragment,{}):(0,p.jsxs)(`div`,{className:`jer-collection-header-row`,style:{position:`relative`},children:[(0,p.jsx)(ni,Object.assign({},_t)),gt]}),(0,p.jsxs)(`div`,{className:`jer-collection-inner`,style:Object.assign(Object.assign({overflowY:pt||pe?`clip`:`visible`,maxHeight:$e?void 0:me},t(`collectionInner`,ye)),{transition:_e}),ref:fe,children:[ht,(0,p.jsx)(`div`,{className:Le?`jer-collection-error-row`:`jer-collection-error-row-edit`,children:De&&(0,p.jsx)(`span`,{className:`jer-error-slug`,style:t(`error`,ye),children:De})}),!Le&&Qe&&(0,p.jsx)(`div`,{className:`jer-brackets jer-bracket-outside`,style:t(`bracket`,ye),children:tt.close})]}),(0,p.jsx)(Fe,{position:`below`,nodeData:ye})]}));return Ke?(0,p.jsx)(Ke,Object.assign({customNodeProps:qe},mt,{children:vt})):vt},V={ITEM_SINGLE:`{{count}} item`,ITEMS_MULTIPLE:`{{count}} items`,KEY_NEW:`Enter new key`,KEY_SELECT:`Select key`,NO_KEY_OPTIONS:`No key options`,ERROR_KEY_EXISTS:`Key already exists`,ERROR_INVALID_JSON:`Invalid JSON`,ERROR_UPDATE:`Update unsuccessful`,ERROR_DELETE:`Delete unsuccessful`,ERROR_ADD:`Adding node unsuccessful`,DEFAULT_STRING:`New data!`,DEFAULT_NEW_KEY:`key`,SHOW_LESS:`(Show less)`,EMPTY_STRING:`<empty string>`,TOOLTIP_COPY:`Copy to clipboard`,TOOLTIP_EDIT:`Edit`,TOOLTIP_DELETE:`Delete`,TOOLTIP_ADD:`Add`},li=(e,t)=>(n,r,i)=>((e,t,n,r,i)=>{if(t[r]){let e=t[r](n);if(e!==null)return e}let a=r in e?e[r]:V[r];return i===void 0?a:a?.replace(`{{count}}`,String(i))})(e,t,r,n,i),ui=[],di=[];(function(e,t){if(e&&typeof document<`u`){var n,r=!0===t.prepend?`prepend`:`append`,i=!0===t.singleTag,a=typeof t.container==`string`?document.querySelector(t.container):document.getElementsByTagName(`head`)[0];if(i){var o=ui.indexOf(a);o===-1&&(o=ui.push(a)-1,di[o]={}),n=di[o]&&di[o][r]?di[o][r]:di[o][r]=s()}else n=s();e.charCodeAt(0)===65279&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var e=document.createElement(`style`);if(e.setAttribute(`type`,`text/css`),t.attributes)for(var n=Object.keys(t.attributes),i=0;i<n.length;i++)e.setAttribute(n[i],t.attributes[n[i]]);var o=r===`prepend`?`afterbegin`:`beforeend`;return a.insertAdjacentElement(o,e),e}})(`:root{--jer-select-border:#b6b6b6;--jer-select-focus:#777;--jer-select-arrow:#777;--jer-form-border:1px solid #ededf0;--jer-form-border-focus:1px solid #e2e2e2;--jer-highlight-color:#b3d8ff}.jer-visible{opacity:1}.jer-hidden{opacity:0}.jer-select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;color:#000;cursor:inherit;font-family:inherit;font-size:.8em;line-height:inherit;margin:0;outline:none;padding:0 1em 0 0;z-index:1}select::-ms-expand{display:none}.jer-select{align-items:center;background-color:#fff;background-image:linear-gradient(0deg,#f9f9f9,#fff 33%);border:1px solid var(--jer-select-border);border-radius:.25em;cursor:pointer;display:grid;grid-template-areas:"select";line-height:1.1;max-width:15ch;min-width:12ch;padding:.25em .5em;position:relative}.jer-select select,.jer-select:after{grid-area:select}.jer-select:not(.jer-select--multiple):after{background-color:var(--jer-select-arrow);clip-path:polygon(100% 0,0 0,50% 100%);content:"";height:.5em;justify-self:end;width:.8em}select:focus+.focus{border:1px solid var(--jer-select-focus);border-radius:inherit;bottom:-1px;left:-1px;position:absolute;right:-1px;top:-1px}.jer-select-inner{text-overflow:ellipsis;width:100%}.jer-editor-container{border-radius:.5em;font-size:16px;line-height:1;padding:1em 1em 1em 2em;position:relative;text-align:left}.jer-editor-container textarea{border:var(--jer-form-border);border-radius:.3em;color:var(--jer-input-color);outline:none}.jer-editor-container textarea:focus{border:var(--jer-form-border-focus)}.jer-editor-container input{border:var(--jer-form-border);border-radius:.3em;font-family:inherit;outline:none}.jer-editor-container input:focus{border:var(--jer-form-border-focus)}.jer-editor-container ::selection{background-color:var(--jer-highlight-color)}.jer-collection-header-row,.jer-value-main-row{align-items:center;display:flex;gap:.3em;min-height:1.7em}.jer-collection-header-row{display:flex;flex-wrap:wrap}.jer-bracket-outside{padding-left:0}.jer-collapse-icon{left:-1.2em;position:absolute;top:.35em}.jer-collection-inner{position:relative}.jer-collection-text-edit{align-items:flex-start;display:flex;flex-direction:column;gap:.3em;line-height:1.1em}.jer-collection-text-area{font-family:inherit;font-size:.85em;max-height:40em;overflow:hidden;padding:.2em .5em 0;resize:both}.jer-collection-input-button-row{display:flex;font-size:150%;justify-content:flex-end;margin-top:.4em;width:100%}.jer-collection-error-row{bottom:.5em;position:absolute}.jer-error-slug{margin-left:1em}.jer-value-component{position:relative}.jer-value-main-row{display:flex;gap:0}.jer-value-and-buttons{align-items:center;display:flex;justify-content:flex-start;padding-left:.5em}.jer-value-error-row{position:absolute}.jer-value-string{line-height:1.3em;overflow-wrap:anywhere;white-space:pre-wrap;word-break:break-word}.jer-string-expansion{cursor:pointer;filter:saturate(50%);opacity:.6}.jer-show-less{font-size:80%}.jer-hyperlink{text-decoration:underline}.jer-input-text{font-family:inherit;font-size:.9em;height:1.4em;line-height:1.2em;margin:0;min-width:6em;overflow:hidden;padding:.25em .5em .2em;resize:none}.jer-input-boolean{margin-left:.3em;margin-right:.3em;transform:scale(1.5)}.jer-key-text{line-height:1.1em;white-space:pre-wrap;word-break:break-word}.jer-key-edit{font-size:inherit;font-size:.9em;padding:0 .3em}.jer-value-invalid{font-style:italic;opacity:.5}.jer-input-number{font-size:90%;min-width:3em}.jer-confirm-buttons,.jer-edit-buttons{align-items:center;cursor:pointer;display:flex;height:1em}.jer-input-buttons{gap:.4em}.jer-edit-buttons{gap:.4em;margin-left:.5em;opacity:0}.jer-confirm-buttons{gap:.2em;margin-left:.4em}.jer-edit-buttons:hover{opacity:1;position:relative}.jer-collection-header-row:hover>.jer-edit-buttons,.jer-value-and-buttons:hover>.jer-edit-buttons,.jer-value-main-row:hover>.jer-edit-buttons{opacity:1}.jer-copy-pulse{position:relative;transition:.3s}.jer-copy-pulse:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-copy-pulse:after{border-radius:50%;box-shadow:0 0 15px 5px var(--jer-icon-copy-color);content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:all .5s;width:100%}.jer-copy-pulse:active:after{border-radius:4em;box-shadow:0 0 0 0 var(--jer-icon-copy-color);left:0;opacity:1;position:absolute;top:0;transition:0s}.jer-copy-pulse:active{top:.07em}.jer-rotate-90{transform:rotate(-90deg)}.jer-icon:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-empty-string{font-size:90%;font-style:italic}.jer-drag-n-drop-padding{border:1px dashed #e0e0e0;border-radius:.3em;height:.5em}.jer-clickzone{height:calc(100% - .8em);left:-1em;position:absolute;top:1.2em}`,{});var fi=(e,t)=>JSON.stringify(e,t,2),pi=({data:e,setData:t,rootName:n=`root`,onUpdate:r=()=>{},onEdit:i=r,onDelete:a=r,onAdd:o=r,onChange:s,onError:c,onEditEvent:l,showErrorMessages:d=!0,enableClipboard:f=!0,indent:m=2,collapse:h=!1,collapseAnimationTime:g=300,showCollectionCount:_=!0,restrictEdit:v=!1,restrictDelete:y=!1,restrictAdd:b=!1,restrictTypeSelection:x=!1,restrictDrag:S=!0,viewOnly:C,searchFilter:w,searchText:T,searchDebounceTime:E=350,keySort:D=!1,showArrayIndices:O=!0,arrayIndexFromOne:k=!1,showStringQuotes:A=!0,showIconTooltips:j=!1,defaultValue:M=null,newKeyOptions:ee,minWidth:N=250,maxWidth:P=`min(600px, 90vw)`,rootFontSize:F,stringTruncate:I=250,translations:L={},className:te,id:ne,customText:re={},customNodeDefinitions:ie=[],customButtons:ae=[],jsonParse:oe=JSON.parse,jsonStringify:se=fi,TextEditor:ce,errorMessageTimeout:le=2500,keyboardControls:ue={},externalTriggers:de,insertAtTop:fe=!1,onCollapse:pe,collapseClickZones:me=[`header`,`left`]})=>{let{getStyles:he}=wr(),{setCurrentlyEditingElement:ge}=jr(),_e=(0,u.useMemo)(()=>gi(h),[h]),ve=(0,u.useMemo)(()=>li(L,re),[L,re]),[ye,be]=(0,u.useState)(T),[xe,Se]=(({setData:e,data:t})=>{let[n,r]=(0,u.useState)(e?void 0:t),i=(0,u.useCallback)(t=>{e?e(t):r(t)},[e]);return(0,u.useEffect)(()=>{e||r(t)},[t]),[e?t:n,i]})({setData:t,data:e}),Ce=(0,u.useRef)(null);(0,u.useEffect)(()=>{ge(null);let e=setTimeout(()=>be(T),E);return()=>clearTimeout(e)},[T,E]);let we={key:n,path:[],level:0,index:0,value:xe,size:typeof xe==`object`&&xe?Object.keys(xe).length:1,parentData:null,fullData:xe},Te=(e,t)=>Kn(void 0,void 0,void 0,function*(){let n=yield e(t);if(!0===n||n===void 0)return void Se(t.newData);let[r,i]=vi(n)?n:[`error`,n];if(r===`error`)return Se(t.currentData),!1===i?ve(`ERROR_UPDATE`,we):String(i);Se(i)}),Ee=(0,u.useMemo)(()=>gi(v,C),[v,C]),De=(0,u.useMemo)(()=>gi(y,C),[y,C]),Oe=(0,u.useMemo)(()=>gi(b,C),[b,C]),ke=(0,u.useMemo)(()=>gi(S,C),[S,C]),Ae=(0,u.useMemo)(()=>_i(w),[w]),je=(0,u.useMemo)(()=>(e=>{let t=Object.assign({},mr);for(let n of Object.keys(mr)){let r=n;if(e[r]){let i=e[r];t[r]=[`clipboardModifier`,`collapseModifier`].includes(n)?Array.isArray(i)?i:[i]:typeof i==`string`?{key:i}:i,[`stringConfirm`,`numberConfirm`,`booleanConfirm`].forEach(n=>{!e[n]&&e.confirm&&(t[n]=t.confirm)})}}return t})(ue),[ue]),Me=(0,u.useCallback)((e,t)=>((e,t,n)=>{let r=Object.entries(t);for(let[t,i]of r)if(fr(n,e[t],t)){n.preventDefault(),i();break}})(je,t,e),[je]),R=(0,u.useMemo)(()=>{let e=yi(ie,`stringifyReplacer`);return t=>se(t,e)},[ie,se]),Ne=(0,u.useMemo)(()=>{let e=yi(ie,`parseReviver`);return t=>yr(oe(t,e))},[ie,oe]),Pe=(0,u.useRef)(null);((e,t)=>{let{setCurrentlyEditingElement:n,currentlyEditingElement:r,setCollapseState:i}=jr();(0,u.useEffect)(()=>{if(!e)return;let{collapse:a,edit:o}=e;a&&i(a);let s=!o?.path||ur(o.path)===r;switch(o?.action){case`accept`:s&&(t.current&&t.current.click(),n(null));break;case`cancel`:s&&n(null);break;default:o!=null&&o.path&&n(o.path)}},[e])})(de,Pe);let Fe=(0,u.useCallback)((e,t)=>{!1!==D&&(typeof D==`function`?e.sort((e,n)=>D(t(e),t(n))):e.sort((e,n)=>{let r=t(e)[0],i=t(n)[0];return r<i?-1:+(r>i)}))},[D]),Ie=si(ie,we),Le={mainContainerRef:Ce,name:n,nodeData:we,onEdit:(e,t)=>Kn(void 0,void 0,void 0,function*(){let{currentData:n,newData:r,currentValue:a,newValue:o}=hi(xe,t,e,`update`);if(a!==o)return yield Te(i,{currentData:n,newData:r,currentValue:a,newValue:o,name:t.slice(-1)[0],path:t})}),onDelete:(e,t)=>Kn(void 0,void 0,void 0,function*(){let{currentData:n,newData:r,currentValue:i,newValue:o}=hi(xe,t,e,`delete`);return yield Te(a,{currentData:n,newData:r,currentValue:i,newValue:o,name:t.slice(-1)[0],path:t})}),onAdd:(e,t,n)=>Kn(void 0,void 0,void 0,function*(){let{currentData:r,newData:i,currentValue:a,newValue:s}=hi(xe,t,e,`add`,n);return yield Te(o,{currentData:r,newData:i,currentValue:a,newValue:s,name:t.slice(-1)[0],path:t})}),onChange:s,onError:c,onEditEvent:l,showErrorMessages:d,onMove:(e,t,n)=>Kn(void 0,void 0,void 0,function*(){if(e===null)return;let{currentData:r,newData:a,currentValue:o}=hi(xe,e,``,`delete`),s=e.slice(-1)[0],c=t.slice(0,-1),l=t.slice(-1)[0],u=typeof l==`number`?n===`above`?l:l+1:typeof s==`number`?`arr_${s}`:s;e.slice(0,-1).join(`.`)===t.slice(0,-1).join(`.`)&&typeof s==`number`&&typeof u==`number`&&s<u&&--u;let d=typeof u==`number`?{insert:!0}:n===`above`?{insertBefore:l}:{insertAfter:l},{newData:f,newValue:p}=hi(a,[...c,u],o,`add`,d);return yield Te(i,{currentData:r,newData:f,currentValue:o,newValue:p,name:t.slice(-1)[0],path:t})}),showCollectionCount:_,collapseFilter:_e,collapseAnimationTime:g,restrictEditFilter:Ee,restrictDeleteFilter:De,restrictAddFilter:Oe,restrictTypeSelection:x,restrictDragFilter:ke,canDragOnto:!1,searchFilter:Ae,searchText:ye,enableClipboard:f,keySort:D,sort:Fe,showArrayIndices:O,arrayIndexFromOne:k,showStringQuotes:A,showIconTooltips:j,indent:m,defaultValue:M,newKeyOptions:ee,stringTruncate:I,translate:ve,customNodeDefinitions:ie,customNodeData:Ie,customButtons:ae,parentData:null,jsonParse:Ne,jsonStringify:R,TextEditor:ce,errorMessageTimeout:le,handleKeyboard:Me,keyboardControls:je,insertAtTop:{object:!0===fe||fe===`object`,array:!0===fe||fe===`array`},onCollapse:pe,editConfirmRef:Pe,collapseClickZones:me},Re=Object.assign(Object.assign({},he(`container`,we)),{minWidth:N,maxWidth:P});return Re.fontSize=F??Re.fontSize,(0,p.jsx)(`div`,{id:ne,ref:Ce,className:`jer-editor-container ${te??``}`,style:Re,children:ar(xe)&&!Ie.renderCollectionAsValue?(0,p.jsx)(ci,Object.assign({data:xe},Le)):(0,p.jsx)(ri,Object.assign({data:xe,showLabel:!0},Le))})},mi=e=>{let[t,n]=(0,u.useState)();return(0,u.useEffect)(()=>{let e=document.documentElement;n(e)},[]),t?(0,p.jsx)(Cr,{theme:e.theme??xr,icons:e.icons,docRoot:t,children:(0,p.jsx)(Ar,{onEditEvent:e.onEditEvent,onCollapse:e.onCollapse,children:(0,p.jsx)(pi,Object.assign({},e))})}):null},hi=(e,t,n,r,i={})=>{if(t.length===0)return{currentData:e,newData:n,currentValue:e,newValue:n};let a=Object.assign({remove:r===`delete`},i),o=r===`add`?void 0:Jn(e,t);return{currentData:e,newData:er(e,t,n,a),currentValue:o,newValue:r===`delete`?void 0:n}},gi=(e,t)=>t?()=>!0:typeof e==`boolean`?()=>e:typeof e==`number`?({level:t})=>t>=e:e,_i=e=>{if(e!==void 0)return e===`value`?cr:e===`key`?lr:e===`all`?(e,t)=>cr(e,t)||lr(e,t):e},vi=e=>Array.isArray(e)&&e.length===2&&[`error`,`value`].includes(e[0]),yi=(e,t)=>{let n=t===`stringifyReplacer`?[e=>e===void 0?br:e]:[];if(n.push(...e.map(e=>e[t]).filter(e=>!!e)),n.length!==0)return(e,t)=>{let r=t;for(let e of n)r=e(r);return r}};function bi({annotationState:e,closeFormCompanionWindow:t,saveAnnotation:n,t:r}){let i=(0,u.useRef)(n);return i.current=n,(0,u.useEffect)(()=>{let e=()=>i.current();return document.addEventListener(_e,e),()=>document.removeEventListener(_e,e)},[]),(0,p.jsxs)(p.Fragment,{children:[e.creator&&e.creationDate&&(0,p.jsx)(h.Grid,{container:!0,children:(0,p.jsx)(lt,{lastSavedDate:e.lastSavedDate,lastEditor:e.lastEditor,creator:e.creator,creationDate:e.creationDate,displayMode:`section`,t:r})}),(0,p.jsx)(h.Divider,{sx:{m:1}}),(0,p.jsxs)(h.Grid,{sx:{mt:1},container:!0,spacing:1,justifyContent:`flex-end`,children:[(0,p.jsx)(h.Tooltip,{title:(0,p.jsx)(Oe,{label:r(`cancel`),action:`escape`}),children:(0,p.jsx)(h.Button,{sx:{m:1},onClick:t,children:r(`cancel`)})}),(0,p.jsx)(h.Tooltip,{title:(0,p.jsx)(Oe,{label:r(`save`),action:`save`}),children:(0,p.jsx)(h.Button,{sx:{m:1},variant:`contained`,color:`primary`,type:`submit`,onClick:n,children:r(`save`)})})]})]})}bi.propTypes={annotationState:f.default.object.isRequired,closeFormCompanionWindow:f.default.func.isRequired,saveAnnotation:f.default.func.isRequired,t:f.default.func.isRequired};var xi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;var t=Math.PI/180;function n(){return typeof window<`u`&&({}.toString.call(window)===`[object Window]`||{}.toString.call(window)===`[object global]`)}e.glob=typeof global<`u`?global:typeof window<`u`?window:typeof WorkerGlobalScope<`u`?self:{},e.Konva={_global:e.glob,version:`9.3.22`,isBrowser:n(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(n){return e.Konva.angleDeg?n*t:n},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<`u`&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){return e.Konva.Transformer?.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(t){e.glob.Konva=t}},e._registerNode=t=>{e.Konva[t.prototype.getClassName()]=t},e.Konva._injectGlobal(e.Konva)})),Si=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;var t=xi();e.Transform=class t{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new t(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){let t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,i=this.m[1]*t+this.m[3]*n,a=this.m[0]*-n+this.m[2]*t,o=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=a,this.m[3]=o,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){let n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,i=this.m[2]+this.m[0]*e,a=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=a,this}multiply(e){let t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],i=this.m[1]*e.m[2]+this.m[3]*e.m[3],a=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],o=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=a,this.m[5]=o,this}invert(){let e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,i=this.m[0]*e,a=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),o=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=a,this.m[5]=o,this}getMatrix(){return this.m}decompose(){let t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],a=this.m[4],o=this.m[5],s=t*i-n*r,c={x:a,y:o,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){let e=Math.sqrt(t*t+n*n);c.rotation=n>0?Math.acos(t/e):-Math.acos(t/e),c.scaleX=e,c.scaleY=s/e,c.skewX=(t*r+n*i)/s,c.skewY=0}else if(r!=0||i!=0){let e=Math.sqrt(r*r+i*i);c.rotation=Math.PI/2-(i>0?Math.acos(-r/e):-Math.acos(r/e)),c.scaleX=s/e,c.scaleY=e,c.skewX=0,c.skewY=(t*r+n*i)/s}return c.rotation=e.Util._getRotation(c.rotation),c}};var n=`[object Array]`,r=`[object Number]`,i=`[object String]`,a=`[object Boolean]`,o=Math.PI/180,s=180/Math.PI,c=`#`,l=``,u=`0`,d=`Konva warning: `,f=`Konva error: `,p=`rgb(`,m={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},h=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,g=[],_=typeof requestAnimationFrame<`u`&&requestAnimationFrame||function(e){setTimeout(e,60)};e.Util={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===n},_isNumber(e){return Object.prototype.toString.call(e)===r&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===i},_isBoolean(e){return Object.prototype.toString.call(e)===a},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!=`string`)return!1;let t=e[0];return t===`#`||t===`.`||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){g.push(e),g.length===1&&_(function(){let e=g;g=[],e.forEach(function(e){e()})})},createCanvasElement(){let e=document.createElement(`canvas`);try{e.style=e.style||{}}catch{}return e},createImageElement(){return document.createElement(`img`)},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(t,n){let r=e.Util.createImageElement();r.onload=function(){n(r)},r.src=t},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(c,l);let t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){let e=(Math.random()*16777215<<0).toString(16);for(;e.length<6;)e=u+e;return c+e},getRGB(e){let t;return e in m?(t=m[e],{r:t[0],g:t[1],b:t[2]}):e[0]===c?this._hexToRgb(e.substring(1)):e.substr(0,4)===p?(t=h.exec(e.replace(/ /g,``)),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(t){return t||=`black`,e.Util._namedColorToRBA(t)||e.Util._hex3ColorToRGBA(t)||e.Util._hex4ColorToRGBA(t)||e.Util._hex6ColorToRGBA(t)||e.Util._hex8ColorToRGBA(t)||e.Util._rgbColorToRGBA(t)||e.Util._rgbaColorToRGBA(t)||e.Util._hslColorToRGBA(t)},_namedColorToRBA(e){let t=m[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf(`rgb(`)===0){e=e.match(/rgb\(([^)]+)\)/)[1];let t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf(`rgba(`)===0){e=e.match(/rgba\(([^)]+)\)/)[1];let t=e.split(/ *, */).map((e,t)=>e.slice(-1)===`%`?t===3?parseInt(e)/100:parseInt(e)/100*255:Number(e));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex8ColorToRGBA(e){if(e[0]===`#`&&e.length===9)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if(e[0]===`#`&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if(e[0]===`#`&&e.length===5)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if(e[0]===`#`&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){let[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,a=Number(n[2])/100,o,s,c;if(i===0)return c=a*255,{r:Math.round(c),g:Math.round(c),b:Math.round(c),a:1};o=a<.5?a*(1+i):a+i-a*i;let l=2*a-o,u=[0,0,0];for(let e=0;e<3;e++)s=r+1/3*-(e-1),s<0&&s++,s>1&&s--,c=6*s<1?l+(o-l)*6*s:2*s<1?o:3*s<2?l+(o-l)*(2/3-s)*6:l,u[e]=c*255;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.width<e.x||t.y>e.y+e.height||t.y+t.height<e.y)},cloneObject(e){let t={};for(let n in e)t[n]=this._isPlainObject(e[n])?this.cloneObject(e[n]):this._isArray(e[n])?this.cloneArray(e[n]):e[n];return t},cloneArray(e){return e.slice(0)},degToRad(e){return e*o},radToDeg(e){return e*s},_degToRad(t){return e.Util.warn(`Util._degToRad is removed. Please use public Util.degToRad instead.`),e.Util.degToRad(t)},_radToDeg(t){return e.Util.warn(`Util._radToDeg is removed. Please use public Util.radToDeg instead.`),e.Util.radToDeg(t)},_getRotation(n){return t.Konva.angleDeg?e.Util.radToDeg(n):n},_capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)},throw(e){throw Error(f+e)},error(e){console.error(f+e)},warn(e){t.Konva.showWarnings&&console.warn(d+e)},each(e,t){for(let n in e)t(n,e[n])},_inRange(e,t,n){return t<=e&&e<n},_getProjectionToSegment(e,t,n,r,i,a){let o,s,c,l=(e-n)*(e-n)+(t-r)*(t-r);if(l==0)o=e,s=t,c=(i-n)*(i-n)+(a-r)*(a-r);else{let u=((i-e)*(n-e)+(a-t)*(r-t))/l;u<0?(o=e,s=t,c=(e-i)*(e-i)+(t-a)*(t-a)):u>1?(o=n,s=r,c=(n-i)*(n-i)+(r-a)*(r-a)):(o=e+u*(n-e),s=t+u*(r-t),c=(o-i)*(o-i)+(s-a)*(s-a))}return[o,s,c]},_getProjectionToLine(t,n,r){let i=e.Util.cloneObject(t),a=Number.MAX_VALUE;return n.forEach(function(o,s){if(!r&&s===n.length-1)return;let c=n[(s+1)%n.length],l=e.Util._getProjectionToSegment(o.x,o.y,c.x,c.y,t.x,t.y),u=l[0],d=l[1],f=l[2];f<a&&(i.x=u,i.y=d,a=f)}),i},_prepareArrayForTween(t,n,r){let i=[],a=[];if(t.length>n.length){let e=n;n=t,t=e}for(let e=0;e<t.length;e+=2)i.push({x:t[e],y:t[e+1]});for(let e=0;e<n.length;e+=2)a.push({x:n[e],y:n[e+1]});let o=[];return a.forEach(function(t){let n=e.Util._getProjectionToLine(t,i,r);o.push(n.x),o.push(n.y)}),o},_prepareToStringify(t){let n;t.visitedByCircularReferenceRemoval=!0;for(let r in t)if(t.hasOwnProperty(r)&&t[r]&&typeof t[r]==`object`){if(n=Object.getOwnPropertyDescriptor(t,r),t[r].visitedByCircularReferenceRemoval||e.Util._isElement(t[r])){if(n.configurable)delete t[r];else return null}else if(e.Util._prepareToStringify(t[r])===null){if(n.configurable)delete t[r];else return null}}return delete t.visitedByCircularReferenceRemoval,t},_assign(e,t){for(let n in t)e[n]=t[n];return e},_getFirstPointerId(e){return e.touches?e.changedTouches[0].identifier:e.pointerId||999},releaseCanvas(...e){t.Konva.releaseCanvasOnDestroy&&e.forEach(e=>{e.width=0,e.height=0})},drawRoundedRectPath(e,t,n,r){let i=0,a=0,o=0,s=0;typeof r==`number`?i=a=o=s=Math.min(r,t/2,n/2):(i=Math.min(r[0]||0,t/2,n/2),a=Math.min(r[1]||0,t/2,n/2),s=Math.min(r[2]||0,t/2,n/2),o=Math.min(r[3]||0,t/2,n/2)),e.moveTo(i,0),e.lineTo(t-a,0),e.arc(t-a,a,a,Math.PI*3/2,0,!1),e.lineTo(t,n-s),e.arc(t-s,n-s,s,0,Math.PI/2,!1),e.lineTo(o,n),e.arc(o,n-o,o,Math.PI/2,Math.PI,!1),e.lineTo(0,i),e.arc(i,i,i,Math.PI,Math.PI*3/2,!1)}}})),Ci=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HitContext=e.SceneContext=e.Context=void 0;var t=Si(),n=xi();function r(e){let n=[],r=e.length,i=t.Util;for(let t=0;t<r;t++){let r=e[t];i._isNumber(r)?r=Math.round(r*1e3)/1e3:i._isString(r)||(r+=``),n.push(r)}return n}var i=`,`,a=`(`,o=`)`,s=`([`,c=`])`,l=`;`,u=`()`,d=`=`,f=`arc.arcTo.beginPath.bezierCurveTo.clearRect.clip.closePath.createLinearGradient.createPattern.createRadialGradient.drawImage.ellipse.fill.fillText.getImageData.createImageData.lineTo.moveTo.putImageData.quadraticCurveTo.rect.roundRect.restore.rotate.save.scale.setLineDash.setTransform.stroke.strokeText.transform.translate`.split(`.`),p=[`fillStyle`,`strokeStyle`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`,`letterSpacing`,`lineCap`,`lineDashOffset`,`lineJoin`,`lineWidth`,`miterLimit`,`direction`,`font`,`textAlign`,`textBaseline`,`globalAlpha`,`globalCompositeOperation`,`imageSmoothingEnabled`],m=100,h=class{constructor(e){this.canvas=e,n.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){let r=this.traceArr,f=r.length,p=``,m,h,g,_;for(m=0;m<f;m++)h=r[m],g=h.method,g?(_=h.args,p+=g,e?p+=u:t.Util._isArray(_[0])?p+=s+_.join(i)+c:(n&&(_=_.map(e=>typeof e==`number`?Math.floor(e):e)),p+=a+_.join(i)+o)):(p+=h.property,e||(p+=d+h.val)),p+=l;return p}clearTrace(){this.traceArr=[]}_trace(e){let t=this.traceArr,n;t.push(e),n=t.length,n>=m&&t.shift()}reset(){let e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){let t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){let t=e.attrs.lineCap;t&&this.setAttr(`lineCap`,t)}_applyOpacity(e){let t=e.getAbsoluteOpacity();t!==1&&this.setAttr(`globalAlpha`,t)}_applyLineJoin(e){let t=e.attrs.lineJoin;t&&this.setAttr(`lineJoin`,t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,i,a){this._context.arc(e,t,n,r,i,a)}arcTo(e,t,n,r,i){this._context.arcTo(e,t,n,r,i)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,i,a){this._context.bezierCurveTo(e,t,n,r,i,a)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,t){let n=arguments;if(n.length===2)return this._context.createImageData(e,t);if(n.length===1)return this._context.createImageData(e)}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,i,a){return this._context.createRadialGradient(e,t,n,r,i,a)}drawImage(e,t,n,r,i,a,o,s,c){let l=arguments,u=this._context;l.length===3?u.drawImage(e,t,n):l.length===5?u.drawImage(e,t,n,r,i):l.length===9&&u.drawImage(e,t,n,r,i,a,o,s,c)}ellipse(e,t,n,r,i,a,o,s){this._context.ellipse(e,t,n,r,i,a,o,s)}isPointInPath(e,t,n,r){return n?this._context.isPointInPath(n,e,t,r):this._context.isPointInPath(e,t,r)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}roundRect(e,t,n,r,i){this._context.roundRect(e,t,n,r,i)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):`mozDash`in this._context?this._context.mozDash=e:`webkitLineDash`in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,i,a){this._context.setTransform(e,t,n,r,i,a)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,i,a){this._context.transform(e,t,n,r,i,a)}translate(e,t){this._context.translate(e,t)}_enableTrace(){let e=this,t=f.length,n=this.setAttr,i,a,o=function(t){let n=e[t],i;e[t]=function(){return a=r(Array.prototype.slice.call(arguments,0)),i=n.apply(e,arguments),e._trace({method:t,args:a}),i}};for(i=0;i<t;i++)o(f[i]);e.setAttr=function(){n.apply(e,arguments);let t=arguments[0],r=arguments[1];(t===`shadowOffsetX`||t===`shadowOffsetY`||t===`shadowBlur`)&&(r/=this.canvas.getPixelRatio()),e._trace({property:t,val:r})}}_applyGlobalCompositeOperation(e){let t=e.attrs.globalCompositeOperation;!t||t===`source-over`||this.setAttr(`globalCompositeOperation`,t)}};e.Context=h,p.forEach(function(e){Object.defineProperty(h.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})}),e.SceneContext=class extends h{constructor(e,{willReadFrequently:t=!1}={}){super(e),this._context=e._canvas.getContext(`2d`,{willReadFrequently:t})}_fillColor(e){let t=e.fill();this.setAttr(`fillStyle`,t),e._fillFunc(this)}_fillPattern(e){this.setAttr(`fillStyle`,e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){let t=e._getLinearGradient();t&&(this.setAttr(`fillStyle`,t),e._fillFunc(this))}_fillRadialGradient(e){let t=e._getRadialGradient();t&&(this.setAttr(`fillStyle`,t),e._fillFunc(this))}_fill(e){let t=e.fill(),n=e.getFillPriority();if(t&&n===`color`){this._fillColor(e);return}let r=e.getFillPatternImage();if(r&&n===`pattern`){this._fillPattern(e);return}let i=e.getFillLinearGradientColorStops();if(i&&n===`linear-gradient`){this._fillLinearGradient(e);return}let a=e.getFillRadialGradientColorStops();if(a&&n===`radial-gradient`){this._fillRadialGradient(e);return}t?this._fillColor(e):r?this._fillPattern(e):i?this._fillLinearGradient(e):a&&this._fillRadialGradient(e)}_strokeLinearGradient(e){let t=e.getStrokeLinearGradientStartPoint(),n=e.getStrokeLinearGradientEndPoint(),r=e.getStrokeLinearGradientColorStops(),i=this.createLinearGradient(t.x,t.y,n.x,n.y);if(r){for(let e=0;e<r.length;e+=2)i.addColorStop(r[e],r[e+1]);this.setAttr(`strokeStyle`,i)}}_stroke(e){let t=e.dash(),n=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!n){this.save();let e=this.getCanvas().getPixelRatio();this.setTransform(e,0,0,e,0,0)}this._applyLineCap(e),t&&e.dashEnabled()&&(this.setLineDash(t),this.setAttr(`lineDashOffset`,e.dashOffset())),this.setAttr(`lineWidth`,e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr(`shadowColor`,`rgba(0,0,0,0)`),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr(`strokeStyle`,e.stroke()),e._strokeFunc(this),n||this.restore()}}_applyShadow(e){let t=e.getShadowRGBA()??`black`,n=e.getShadowBlur()??5,r=e.getShadowOffset()??{x:0,y:0},i=e.getAbsoluteScale(),a=this.canvas.getPixelRatio(),o=i.x*a,s=i.y*a;this.setAttr(`shadowColor`,t),this.setAttr(`shadowBlur`,n*Math.min(Math.abs(o),Math.abs(s))),this.setAttr(`shadowOffsetX`,r.x*o),this.setAttr(`shadowOffsetY`,r.y*s)}},e.HitContext=class extends h{constructor(e){super(e),this._context=e._canvas.getContext(`2d`,{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr(`fillStyle`,e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){let t=e.getStrokeScaleEnabled();if(!t){this.save();let e=this.getCanvas().getPixelRatio();this.setTransform(e,0,0,e,0,0)}this._applyLineCap(e);let n=e.hitStrokeWidth(),r=n===`auto`?e.strokeWidth():n;this.setAttr(`lineWidth`,r),this.setAttr(`strokeStyle`,e.colorKey),e._strokeFuncHit(this),t||this.restore()}}}})),wi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HitCanvas=e.SceneCanvas=e.Canvas=void 0;var t=Si(),n=Ci(),r=xi(),i;function a(){if(i)return i;let e=t.Util.createCanvasElement(),n=e.getContext(`2d`);return i=(function(){return(r.Konva._global.devicePixelRatio||1)/(n.webkitBackingStorePixelRatio||n.mozBackingStorePixelRatio||n.msBackingStorePixelRatio||n.oBackingStorePixelRatio||n.backingStorePixelRatio||1)})(),t.Util.releaseCanvas(e),i}var o=class{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;let n=(e||{}).pixelRatio||r.Konva.pixelRatio||a();this.pixelRatio=n,this._canvas=t.Util.createCanvasElement(),this._canvas.style.padding=`0`,this._canvas.style.margin=`0`,this._canvas.style.border=`0`,this._canvas.style.background=`transparent`,this._canvas.style.position=`absolute`,this._canvas.style.top=`0`,this._canvas.style.left=`0`}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){let t=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/t,this.getHeight()/t)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+`px`;let t=this.pixelRatio;this.getContext()._context.scale(t,t)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+`px`;let t=this.pixelRatio;this.getContext()._context.scale(t,t)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,t){this.setWidth(e||0),this.setHeight(t||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch{try{return this._canvas.toDataURL()}catch(e){return t.Util.error(`Unable to get data URL. `+e.message+` For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html.`),``}}}};e.Canvas=o,e.SceneCanvas=class extends o{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new n.SceneContext(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}},e.HitCanvas=class extends o{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new n.HitContext(this),this.setSize(e.width,e.height)}}})),Ti=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;var t=xi(),n=Si();e.DD={get isDragging(){let t=!1;return e.DD._dragElements.forEach(e=>{e.dragStatus===`dragging`&&(t=!0)}),t},justDragged:!1,get node(){let t;return e.DD._dragElements.forEach(e=>{t=e.node}),t},_dragElements:new Map,_drag(t){let r=[];e.DD._dragElements.forEach((e,i)=>{let{node:a}=e,o=a.getStage();o.setPointersPositions(t),e.pointerId===void 0&&(e.pointerId=n.Util._getFirstPointerId(t));let s=o._changedPointerPositions.find(t=>t.id===e.pointerId);if(s){if(e.dragStatus!==`dragging`){let n=a.dragDistance();if(Math.max(Math.abs(s.x-e.startPointerPos.x),Math.abs(s.y-e.startPointerPos.y))<n||(a.startDrag({evt:t}),!a.isDragging()))return}a._setDragPosition(t,e),r.push(a)}}),r.forEach(e=>{e.fire(`dragmove`,{type:`dragmove`,target:e,evt:t},!0)})},_endDragBefore(n){let r=[];e.DD._dragElements.forEach(i=>{let{node:a}=i,o=a.getStage();if(n&&o.setPointersPositions(n),!o._changedPointerPositions.find(e=>e.id===i.pointerId))return;(i.dragStatus===`dragging`||i.dragStatus===`stopped`)&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,i.dragStatus=`stopped`);let s=i.node.getLayer()||i.node instanceof t.Konva.Stage&&i.node;s&&r.indexOf(s)===-1&&r.push(s)}),r.forEach(e=>{e.draw()})},_endDragAfter(t){e.DD._dragElements.forEach((n,r)=>{n.dragStatus===`stopped`&&n.node.fire(`dragend`,{type:`dragend`,target:n.node,evt:t},!0),n.dragStatus!==`dragging`&&e.DD._dragElements.delete(r)})}},t.Konva.isBrowser&&(window.addEventListener(`mouseup`,e.DD._endDragBefore,!0),window.addEventListener(`touchend`,e.DD._endDragBefore,!0),window.addEventListener(`touchcancel`,e.DD._endDragBefore,!0),window.addEventListener(`mousemove`,e.DD._drag),window.addEventListener(`touchmove`,e.DD._drag),window.addEventListener(`mouseup`,e.DD._endDragAfter,!1),window.addEventListener(`touchend`,e.DD._endDragAfter,!1),window.addEventListener(`touchcancel`,e.DD._endDragAfter,!1))})),Ei=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RGBComponent=i,e.alphaComponent=a,e.getNumberValidator=o,e.getNumberOrArrayOfNumbersValidator=s,e.getNumberOrAutoValidator=c,e.getStringValidator=l,e.getStringOrGradientValidator=u,e.getFunctionValidator=d,e.getNumberArrayValidator=f,e.getBooleanValidator=p,e.getComponentValidator=m;var t=xi(),n=Si();function r(e){return n.Util._isString(e)?`"`+e+`"`:Object.prototype.toString.call(e)===`[object Number]`||n.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function i(e){return e>255?255:e<0?0:Math.round(e)}function a(e){return e>1?1:e<1e-4?1e-4:e}function o(){if(t.Konva.isUnminified)return function(e,t){return n.Util._isNumber(e)||n.Util.warn(r(e)+` is a not valid value for "`+t+`" attribute. The value should be a number.`),e}}function s(e){if(t.Konva.isUnminified)return function(t,i){let a=n.Util._isNumber(t),o=n.Util._isArray(t)&&t.length==e;return!a&&!o&&n.Util.warn(r(t)+` is a not valid value for "`+i+`" attribute. The value should be a number or Array<number>(`+e+`)`),t}}function c(){if(t.Konva.isUnminified)return function(e,t){return n.Util._isNumber(e)||e===`auto`||n.Util.warn(r(e)+` is a not valid value for "`+t+`" attribute. The value should be a number or "auto".`),e}}function l(){if(t.Konva.isUnminified)return function(e,t){return n.Util._isString(e)||n.Util.warn(r(e)+` is a not valid value for "`+t+`" attribute. The value should be a string.`),e}}function u(){if(t.Konva.isUnminified)return function(e,t){let i=n.Util._isString(e),a=Object.prototype.toString.call(e)===`[object CanvasGradient]`||e&&e.addColorStop;return i||a||n.Util.warn(r(e)+` is a not valid value for "`+t+`" attribute. The value should be a string or a native gradient.`),e}}function d(){if(t.Konva.isUnminified)return function(e,t){return n.Util._isFunction(e)||n.Util.warn(r(e)+` is a not valid value for "`+t+`" attribute. The value should be a function.`),e}}function f(){if(t.Konva.isUnminified)return function(e,t){let i=Int8Array?Object.getPrototypeOf(Int8Array):null;return i&&e instanceof i||(n.Util._isArray(e)?e.forEach(function(e){n.Util._isNumber(e)||n.Util.warn(`"`+t+`" attribute has non numeric element `+e+`. Make sure that all elements are numbers.`)}):n.Util.warn(r(e)+` is a not valid value for "`+t+`" attribute. The value should be a array of numbers.`)),e}}function p(){if(t.Konva.isUnminified)return function(e,t){return e!==!0&&e!==!1&&n.Util.warn(r(e)+` is a not valid value for "`+t+`" attribute. The value should be a boolean.`),e}}function m(e){if(t.Konva.isUnminified)return function(t,i){return t==null||n.Util.isObject(t)||n.Util.warn(r(t)+` is a not valid value for "`+i+`" attribute. The value should be an object with properties `+e),t}}})),Di=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;var t=Si(),n=Ei(),r=`get`,i=`set`;e.Factory={addGetterSetter(t,n,r,i,a){e.Factory.addGetter(t,n,r),e.Factory.addSetter(t,n,i,a),e.Factory.addOverloadedGetterSetter(t,n)},addGetter(e,n,i){let a=r+t.Util._capitalize(n);e.prototype[a]=e.prototype[a]||function(){let e=this.attrs[n];return e===void 0?i:e}},addSetter(n,r,a,o){let s=i+t.Util._capitalize(r);n.prototype[s]||e.Factory.overWriteSetter(n,r,a,o)},overWriteSetter(e,n,r,a){let o=i+t.Util._capitalize(n);e.prototype[o]=function(e){return r&&e!=null&&(e=r.call(this,e,n)),this._setAttr(n,e),a&&a.call(this),this}},addComponentsGetterSetter(a,o,s,c,l){let u=s.length,d=t.Util._capitalize,f=r+d(o),p=i+d(o);a.prototype[f]=function(){let e={};for(let t=0;t<u;t++){let n=s[t];e[n]=this.getAttr(o+d(n))}return e};let m=(0,n.getComponentValidator)(s);a.prototype[p]=function(e){let t=this.attrs[o];c&&(e=c.call(this,e,o)),m&&m.call(this,e,o);for(let t in e)e.hasOwnProperty(t)&&this._setAttr(o+d(t),e[t]);return e||s.forEach(e=>{this._setAttr(o+d(e),void 0)}),this._fireChangeEvent(o,t,e),l&&l.call(this),this},e.Factory.addOverloadedGetterSetter(a,o)},addOverloadedGetterSetter(e,n){let a=t.Util._capitalize(n),o=i+a,s=r+a;e.prototype[n]=function(){return arguments.length?(this[o](arguments[0]),this):this[s]()}},addDeprecatedGetterSetter(n,i,a,o){t.Util.error(`Adding deprecated `+i);let s=r+t.Util._capitalize(i),c=i+` property is deprecated and will be removed soon. Look at Konva change log for more information.`;n.prototype[s]=function(){t.Util.error(c);let e=this.attrs[i];return e===void 0?a:e},e.Factory.addSetter(n,i,o,function(){t.Util.error(c)}),e.Factory.addOverloadedGetterSetter(n,i)},backCompat(e,n){t.Util.each(n,function(n,a){let o=e.prototype[a],s=r+t.Util._capitalize(n),c=i+t.Util._capitalize(n);function l(){o.apply(this,arguments),t.Util.error(`"`+n+`" method is deprecated and will be removed soon. Use ""`+a+`" instead.`)}e.prototype[n]=l,e.prototype[s]=l,e.prototype[c]=l})},afterSetFilter(){this._filterUpToDate=!1}}})),Oi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Node=void 0;var t=wi(),n=Ti(),r=Di(),i=xi(),a=Si(),o=Ei(),s=`absoluteOpacity`,c=`allEventListeners`,l=`absoluteTransform`,u=`absoluteScale`,d=`canvas`,f=`Change`,p=`children`,m=`konva`,h=`listening`,g=`mouseenter`,_=`mouseleave`,v=`pointerenter`,y=`pointerleave`,b=`touchenter`,x=`touchleave`,S=`set`,C=`Shape`,w=` `,T=`stage`,E=`transform`,D=`Stage`,O=`visible`,k=[`xChange.konva`,`yChange.konva`,`scaleXChange.konva`,`scaleYChange.konva`,`skewXChange.konva`,`skewYChange.konva`,`rotationChange.konva`,`offsetXChange.konva`,`offsetYChange.konva`,`transformsEnabledChange.konva`].join(w),A=1,j=class e{constructor(e){this._id=A++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===E||e===l)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,t){let n=this._cache.get(e);return(n===void 0||(e===E||e===l)&&n.dirty===!0)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){if(!this._attachedDepsListeners.get(e)){let n=t.map(e=>e+`Change.konva`).join(w);this.on(n,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(d)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===l&&this.fire(`absoluteTransformChange`)}clearCache(){if(this._cache.has(d)){let{scene:e,filter:t,hit:n,buffer:r}=this._cache.get(d);a.Util.releaseCanvas(e,t,n,r),this._cache.delete(d)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){let n=e||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),c=n.pixelRatio,l=n.x===void 0?Math.floor(r.x):n.x,f=n.y===void 0?Math.floor(r.y):n.y,p=n.offset||0,m=n.drawBorder||!1,h=n.hitCanvasPixelRatio||1;if(!i||!o){a.Util.error(`Can not cache the node. Width or height of the node equals 0. Caching is skipped.`);return}let g=+(Math.abs(Math.round(r.x)-l)>.5),_=+(Math.abs(Math.round(r.y)-f)>.5);i+=p*2+g,o+=p*2+_,l-=p,f-=p;let v=new t.SceneCanvas({pixelRatio:c,width:i,height:o}),y=new t.SceneCanvas({pixelRatio:c,width:0,height:0,willReadFrequently:!0}),b=new t.HitCanvas({pixelRatio:h,width:i,height:o}),x=v.getContext(),S=b.getContext(),C=new t.SceneCanvas({width:v.width/v.pixelRatio+Math.abs(l),height:v.height/v.pixelRatio+Math.abs(f),pixelRatio:v.pixelRatio}),w=C.getContext();return b.isCache=!0,v.isCache=!0,this._cache.delete(d),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(v.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),x.save(),S.save(),w.save(),x.translate(-l,-f),S.translate(-l,-f),w.translate(-l,-f),C.x=l,C.y=f,this._isUnderCache=!0,this._clearSelfAndDescendantCache(s),this._clearSelfAndDescendantCache(u),this.drawScene(v,this,C),this.drawHit(b,this),this._isUnderCache=!1,x.restore(),S.restore(),m&&(x.save(),x.beginPath(),x.rect(0,0,i,o),x.closePath(),x.setAttr(`strokeStyle`,`red`),x.setAttr(`lineWidth`,5),x.stroke(),x.restore()),this._cache.set(d,{scene:v,filter:y,hit:b,buffer:C,x:l,y:f}),this._requestDraw(),this}isCached(){return this._cache.has(d)}getClientRect(e){throw Error(`abstract "getClientRect" method call`)}_transformedRect(e,t){let n=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],r=1/0,i=1/0,a=-1/0,o=-1/0,s=this.getAbsoluteTransform(t);return n.forEach(function(e){let t=s.point(e);r===void 0&&(r=a=t.x,i=o=t.y),r=Math.min(r,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y)}),{x:r,y:i,width:a-r,height:o-i}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);let t=this._getCanvasCache();e.translate(t.x,t.y);let n=this._getCachedSceneCanvas(),r=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/r,n.height/r),e.restore()}_drawCachedHitCanvas(e){let t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),t=this._getCanvasCache(),n=t.scene,r=t.filter,i=r.getContext(),o,s,c,l;if(e){if(!this._filterUpToDate){let t=n.pixelRatio;r.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio);try{for(o=e.length,i.clear(),i.drawImage(n._canvas,0,0,n.getWidth()/t,n.getHeight()/t),s=i.getImageData(0,0,r.getWidth(),r.getHeight()),c=0;c<o;c++){if(l=e[c],typeof l!=`function`){a.Util.error(`Filter should be type of function, but got `+typeof l+` instead. Please check correct filters`);continue}l.call(this,s),i.putImageData(s,0,0)}}catch(e){a.Util.error(`Unable to apply filter. `+e.message+` This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.`)}this._filterUpToDate=!0}return r}return n}on(e,t){if(this._cache&&this._cache.delete(c),arguments.length===3)return this._delegate.apply(this,arguments);let n=e.split(w);for(let e=0;e<n.length;e++){let r=n[e].split(`.`),i=r[0],a=r[1]||``;this.eventListeners[i]||(this.eventListeners[i]=[]),this.eventListeners[i].push({name:a,handler:t})}return this}off(e,t){let n=(e||``).split(w),r=n.length,i,a,o,s,l,u;if(this._cache&&this._cache.delete(c),!e)for(a in this.eventListeners)this._off(a);for(i=0;i<r;i++)if(o=n[i],s=o.split(`.`),l=s[0],u=s[1],l)this.eventListeners[l]&&this._off(l,u,t);else for(a in this.eventListeners)this._off(a,u,t);return this}dispatchEvent(e){let t={target:this,type:e.type,evt:e};return this.fire(e.type,t),this}addEventListener(e,t){return this.on(e,function(e){t.call(this,e.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,t,n){let r=this;this.on(e,function(e){let i=e.target.findAncestors(t,!0,r);for(let t=0;t<i.length;t++)e=a.Util.cloneObject(e),e.currentTarget=i[t],n.call(i[t],e)})}remove(){return this.isDragging()&&this.stopDrag(),n.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(l),this._clearSelfAndDescendantCache(s),this._clearSelfAndDescendantCache(u),this._clearSelfAndDescendantCache(T),this._clearSelfAndDescendantCache(O),this._clearSelfAndDescendantCache(h)}_remove(){this._clearCaches();let e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){let t=`get`+a.Util._capitalize(e);return a.Util._isFunction(this[t])?this[t]():this.attrs[e]}getAncestors(){let e=this.getParent(),t=[];for(;e;)t.push(e),e=e.getParent();return t}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let t,n;if(!e)return this;for(t in e)t!==p&&(n=S+a.Util._capitalize(t),a.Util._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))}),this}isListening(){return this._getCache(h,this._isListening)}_isListening(e){if(!this.listening())return!1;let t=this.getParent();return t&&t!==e&&this!==e?t._isListening(e):!0}isVisible(){return this._getCache(O,this._isVisible)}_isVisible(e){if(!this.visible())return!1;let t=this.getParent();return t&&t!==e&&this!==e?t._isVisible(e):!0}shouldDrawHit(e,t=!1){if(e)return this._isVisible(e)&&this._isListening(e);let r=this.getLayer(),a=!1;n.DD._dragElements.forEach(e=>{e.dragStatus===`dragging`&&(e.node.nodeType===`Stage`||e.node.getLayer()===r)&&(a=!0)});let o=!t&&!i.Konva.hitOnDragEnabled&&(a||i.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),t=this,n=0,r,i,a,o;function s(c){for(r=[],i=c.length,a=0;a<i;a++)o=c[a],n++,o.nodeType!==C&&(r=r.concat(o.getChildren().slice())),o._id===t._id&&(a=i);r.length>0&&r[0].getDepth()<=e&&s(r)}let c=this.getStage();return t.nodeType!==D&&c&&s(c.getChildren()),n}getDepth(){let e=0,t=this.parent;for(;t;)e++,t=t.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(E),this._clearSelfAndDescendantCache(l)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){let e=this.getStage();if(!e)return null;let t=e.getPointerPosition();if(!t)return null;let n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);let r=this.getAbsoluteTransform(e).getMatrix(),i=new a.Transform,o=this.offset();return i.m=r.slice(),i.translate(o.x,o.y),i.getTranslation()}setAbsolutePosition(e){let{x:t,y:n,...r}=this._clearTransform();this.attrs.x=t,this.attrs.y=n,this._clearCache(E);let i=this._getAbsoluteTransform().copy();return i.invert(),i.translate(e.x,e.y),e={x:this.attrs.x+i.getTranslation().x,y:this.attrs.y+i.getTranslation().y},this._setTransform(r),this.setPosition({x:e.x,y:e.y}),this._clearCache(E),this._clearSelfAndDescendantCache(l),this}_setTransform(e){let t;for(t in e)this.attrs[t]=e[t]}_clearTransform(){let e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let t=e.x,n=e.y,r=this.x(),i=this.y();return t!==void 0&&(r+=t),n!==void 0&&(i+=n),this.setPosition({x:r,y:i}),this}_eachAncestorReverse(e,t){let n=[],r=this.getParent(),i,a;if(!(t&&t._id===this._id)){for(n.unshift(this);r&&(!t||r._id!==t._id);)n.unshift(r),r=r.parent;for(i=n.length,a=0;a<i;a++)e(n[a])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return a.Util.warn(`Node has no parent. moveToTop function is ignored.`),!1;let e=this.index;return e<this.parent.getChildren().length-1&&(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0)}moveUp(){if(!this.parent)return a.Util.warn(`Node has no parent. moveUp function is ignored.`),!1;let e=this.index;return e<this.parent.getChildren().length-1&&(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0)}moveDown(){if(!this.parent)return a.Util.warn(`Node has no parent. moveDown function is ignored.`),!1;let e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}moveToBottom(){if(!this.parent)return a.Util.warn(`Node has no parent. moveToBottom function is ignored.`),!1;let e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}setZIndex(e){if(!this.parent)return a.Util.warn(`Node has no parent. zIndex parameter is ignored.`),this;(e<0||e>=this.parent.children.length)&&a.Util.warn(`Unexpected value `+e+` for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to `+(this.parent.children.length-1)+`.`);let t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(s,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),t,n,r,i,o,s={attrs:{},className:this.getClassName()};for(t in e)n=e[t],o=a.Util.isObject(n)&&!a.Util._isPlainObject(n)&&!a.Util._isArray(n),!o&&(r=typeof this[t]==`function`&&this[t],delete e[t],i=r?r.call(this):null,e[t]=n,i!==n&&(s.attrs[t]=n));return a.Util._prepareToStringify(s)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){let r=[];t&&this._isMatch(e)&&r.push(this);let i=this.parent;for(;i;){if(i===n)return r;i._isMatch(e)&&r.push(i),i=i.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(!e)return!1;if(typeof e==`function`)return e(this);let t=e.replace(/ /g,``).split(`,`),n=t.length,r,i;for(r=0;r<n;r++)if(i=t[r],a.Util.isValidSelector(i)||(a.Util.warn(`Selector "`+i+`" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".`),a.Util.warn(`If you have a custom shape with such className, please change it to start with upper letter like "Triangle".`),a.Util.warn(`Konva is awesome, right?`)),i.charAt(0)===`#`){if(this.id()===i.slice(1))return!0}else if(i.charAt(0)===`.`){if(this.hasName(i.slice(1)))return!0}else if(this.className===i||this.nodeType===i)return!0;return!1}getLayer(){let e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(T,this._getStage)}_getStage(){let e=this.getParent();return e?e.getStage():null}fire(e,t={},n){return t.target=t.target||this,n?this._fireAndBubble(e,t):this._fire(e,t),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(l,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let t;if(e)return t=new a.Transform,this._eachAncestorReverse(function(e){let n=e.transformsEnabled();n===`all`?t.multiply(e.getTransform()):n===`position`&&t.translate(e.x()-e.offsetX(),e.y()-e.offsetY())},e),t;{t=this._cache.get(l)||new a.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(t):t.reset();let e=this.transformsEnabled();if(e===`all`)t.multiply(this.getTransform());else if(e===`position`){let e=this.attrs.x||0,n=this.attrs.y||0,r=this.attrs.offsetX||0,i=this.attrs.offsetY||0;t.translate(e-r,n-i)}return t.dirty=!1,t}}getAbsoluteScale(e){let t=this;for(;t;)t._isUnderCache&&(e=t),t=t.getParent();let n=this.getAbsoluteTransform(e).decompose();return{x:n.scaleX,y:n.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(E,this._getTransform)}_getTransform(){let e=this._cache.get(E)||new a.Transform;e.reset();let t=this.x(),n=this.y(),r=i.Konva.getAngle(this.rotation()),o=this.attrs.scaleX??1,s=this.attrs.scaleY??1,c=this.attrs.skewX||0,l=this.attrs.skewY||0,u=this.attrs.offsetX||0,d=this.attrs.offsetY||0;return(t!==0||n!==0)&&e.translate(t,n),r!==0&&e.rotate(r),(c!==0||l!==0)&&e.skew(c,l),(o!==1||s!==1)&&e.scale(o,s),(u!==0||d!==0)&&e.translate(-1*u,-1*d),e.dirty=!1,e}clone(e){let t=a.Util.cloneObject(this.attrs),n,r,i,o,s;for(n in e)t[n]=e[n];let c=new this.constructor(t);for(n in this.eventListeners)for(r=this.eventListeners[n],i=r.length,o=0;o<i;o++)s=r[o],s.name.indexOf(m)<0&&(c.eventListeners[n]||(c.eventListeners[n]=[]),c.eventListeners[n].push(s));return c}_toKonvaCanvas(e){e||={};let n=this.getClientRect(),r=this.getStage(),i=e.x===void 0?Math.floor(n.x):e.x,a=e.y===void 0?Math.floor(n.y):e.y,o=e.pixelRatio||1,s=new t.SceneCanvas({width:e.width||Math.ceil(n.width)||(r?r.width():0),height:e.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:o}),c=s.getContext(),l=new t.SceneCanvas({width:s.width/s.pixelRatio+Math.abs(i),height:s.height/s.pixelRatio+Math.abs(a),pixelRatio:s.pixelRatio});return e.imageSmoothingEnabled===!1&&(c._context.imageSmoothingEnabled=!1),c.save(),(i||a)&&c.translate(-1*i,-1*a),this.drawScene(s,void 0,l),c.restore(),s}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e||={};let t=e.mimeType||null,n=e.quality||null,r=this._toKonvaCanvas(e).toDataURL(t,n);return e.callback&&e.callback(r),r}toImage(e){return new Promise((t,n)=>{try{let n=e?.callback;n&&delete e.callback,a.Util._urlToImage(this.toDataURL(e),function(e){t(e),n?.(e)})}catch(e){n(e)}})}toBlob(e){return new Promise((t,n)=>{try{let n=e?.callback;n&&delete e.callback,this.toCanvas(e).toBlob(e=>{t(e),n?.(e)},e?.mimeType,e?.quality)}catch(e){n(e)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance===void 0?this.parent?this.parent.getDragDistance():i.Konva.dragDistance:this.attrs.dragDistance}_off(e,t,n){let r=this.eventListeners[e],i,a,o;for(i=0;i<r.length;i++)if(a=r[i].name,o=r[i].handler,(a!==`konva`||t===`konva`)&&(!t||a===t)&&(!n||n===o)){if(r.splice(i,1),r.length===0){delete this.eventListeners[e];break}i--}}_fireChangeEvent(e,t,n){this._fire(e+f,{oldVal:t,newVal:n})}addName(e){if(!this.hasName(e)){let t=this.name(),n=t?t+` `+e:e;this.name(n)}return this}hasName(e){if(!e)return!1;let t=this.name();return t?(t||``).split(/\s/g).indexOf(e)!==-1:!1}removeName(e){let t=(this.name()||``).split(/\s/g),n=t.indexOf(e);return n!==-1&&(t.splice(n,1),this.name(t.join(` `))),this}setAttr(e,t){let n=this[S+a.Util._capitalize(e)];return a.Util._isFunction(n)?n.call(this,t):this._setAttr(e,t),this}_requestDraw(){i.Konva.autoDrawEnabled&&(this.getLayer()||this.getStage())?.batchDraw()}_setAttr(e,t){let n=this.attrs[e];n===t&&!a.Util.isObject(t)||(t==null?delete this.attrs[e]:this.attrs[e]=t,this._shouldFireChangeEvents&&this._fireChangeEvent(e,n,t),this._requestDraw())}_setComponentAttr(e,t,n){let r;n!==void 0&&(r=this.attrs[e],r||(this.attrs[e]=this.getAttr(e)),this.attrs[e][t]=n,this._fireChangeEvent(e,r,n))}_fireAndBubble(e,t,n){t&&this.nodeType===C&&(t.target=this);let r=[g,_,v,y,b,x];if(!(r.indexOf(e)!==-1&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType===`Stage`&&!n))){this._fire(e,t);let i=r.indexOf(e)!==-1&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(t&&!t.cancelBubble||!t)&&this.parent&&this.parent.isListening()&&!i&&(n&&n.parent?this._fireAndBubble.call(this.parent,e,t,n):this._fireAndBubble.call(this.parent,e,t))}}_getProtoListeners(e){let t=this._cache.get(c)??{},n=t?.[e];if(n===void 0){n=[];let r=Object.getPrototypeOf(this);for(;r;){let t=r.eventListeners?.[e]??[];n.push(...t),r=Object.getPrototypeOf(r)}t[e]=n,this._cache.set(c,t)}return n}_fire(e,t){t||={},t.currentTarget=this,t.type=e;let n=this._getProtoListeners(e);if(n)for(let e=0;e<n.length;e++)n[e].handler.call(this,t);let r=this.eventListeners[e];if(r)for(let e=0;e<r.length;e++)r[e].handler.call(this,t)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){let t=e?e.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition();if(!r)return;let a=r._getPointerById(t)||r._changedPointerPositions[0]||i;n.DD._dragElements.set(this._id,{node:this,startPointerPos:a,offset:{x:a.x-i.x,y:a.y-i.y},dragStatus:`ready`,pointerId:t})}startDrag(e,t=!0){n.DD._dragElements.has(this._id)||this._createDragElement(e);let r=n.DD._dragElements.get(this._id);r.dragStatus=`dragging`,this.fire(`dragstart`,{type:`dragstart`,target:this,evt:e&&e.evt},t)}_setDragPosition(e,t){let n=this.getStage()._getPointerById(t.pointerId);if(!n)return;let r={x:n.x-t.offset.x,y:n.y-t.offset.y},i=this.dragBoundFunc();if(i!==void 0){let t=i.call(this,r,e);t?r=t:a.Util.warn(`dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.`)}(!this._lastPos||this._lastPos.x!==r.x||this._lastPos.y!==r.y)&&(this.setAbsolutePosition(r),this._requestDraw()),this._lastPos=r}stopDrag(e){let t=n.DD._dragElements.get(this._id);t&&(t.dragStatus=`stopped`),n.DD._endDragBefore(e),n.DD._endDragAfter(e)}setDraggable(e){this._setAttr(`draggable`,e),this._dragChange()}isDragging(){let e=n.DD._dragElements.get(this._id);return e?e.dragStatus===`dragging`:!1}_listenDrag(){this._dragCleanup(),this.on(`mousedown.konva touchstart.konva`,function(e){if(!(e.evt.button===void 0||i.Konva.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let t=!1;n.DD._dragElements.forEach(e=>{this.isAncestorOf(e.node)&&(t=!0)}),t||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;let e=n.DD._dragElements.get(this._id),t=e&&e.dragStatus===`dragging`,r=e&&e.dragStatus===`ready`;t?this.stopDrag():r&&n.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off(`mousedown.konva`),this.off(`touchstart.konva`)}isClientRectOnScreen(e={x:0,y:0}){let t=this.getStage();if(!t)return!1;let n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return a.Util.haveIntersection(n,this.getClientRect())}static create(e,t){return a.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(t,n){let r=e.prototype.getClassName.call(t),o=t.children,s,c,l;n&&(t.attrs.container=n),i.Konva[r]||(a.Util.warn(`Can not find a node with class name "`+r+`". Fallback to "Shape".`),r=`Shape`);let u=i.Konva[r];if(s=new u(t.attrs),o)for(c=o.length,l=0;l<c;l++)s.add(e._createNode(o[l]));return s}};e.Node=j,j.prototype.nodeType=`Node`,j.prototype._attrsAffectingSize=[],j.prototype.eventListeners={},j.prototype.on.call(j.prototype,k,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(E),this._clearSelfAndDescendantCache(l)}),j.prototype.on.call(j.prototype,`visibleChange.konva`,function(){this._clearSelfAndDescendantCache(O)}),j.prototype.on.call(j.prototype,`listeningChange.konva`,function(){this._clearSelfAndDescendantCache(h)}),j.prototype.on.call(j.prototype,`opacityChange.konva`,function(){this._clearSelfAndDescendantCache(s)});var M=r.Factory.addGetterSetter;M(j,`zIndex`),M(j,`absolutePosition`),M(j,`position`),M(j,`x`,0,(0,o.getNumberValidator)()),M(j,`y`,0,(0,o.getNumberValidator)()),M(j,`globalCompositeOperation`,`source-over`,(0,o.getStringValidator)()),M(j,`opacity`,1,(0,o.getNumberValidator)()),M(j,`name`,``,(0,o.getStringValidator)()),M(j,`id`,``,(0,o.getStringValidator)()),M(j,`rotation`,0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(j,`scale`,[`x`,`y`]),M(j,`scaleX`,1,(0,o.getNumberValidator)()),M(j,`scaleY`,1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(j,`skew`,[`x`,`y`]),M(j,`skewX`,0,(0,o.getNumberValidator)()),M(j,`skewY`,0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(j,`offset`,[`x`,`y`]),M(j,`offsetX`,0,(0,o.getNumberValidator)()),M(j,`offsetY`,0,(0,o.getNumberValidator)()),M(j,`dragDistance`,void 0,(0,o.getNumberValidator)()),M(j,`width`,0,(0,o.getNumberValidator)()),M(j,`height`,0,(0,o.getNumberValidator)()),M(j,`listening`,!0,(0,o.getBooleanValidator)()),M(j,`preventDefault`,!0,(0,o.getBooleanValidator)()),M(j,`filters`,void 0,function(e){return this._filterUpToDate=!1,e}),M(j,`visible`,!0,(0,o.getBooleanValidator)()),M(j,`transformsEnabled`,`all`,(0,o.getStringValidator)()),M(j,`size`),M(j,`dragBoundFunc`),M(j,`draggable`,!1,(0,o.getBooleanValidator)()),r.Factory.backCompat(j,{rotateDeg:`rotate`,setRotationDeg:`setRotation`,getRotationDeg:`getRotation`})})),ki=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Container=void 0;var t=Di(),n=Oi(),r=Ei(),i=class extends n.Node{constructor(){super(...arguments),this.children=[]}getChildren(e){let t=this.children||[];return e?t.filter(e):t}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let t=0;t<e.length;t++)this.add(e[t]);return this}let t=e[0];return t.getParent()?(t.moveTo(this),this):(this._validateAdd(t),t.index=this.getChildren().length,t.parent=this,t._clearCaches(),this.getChildren().push(t),this._fire(`add`,{child:t}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){let t=this._generalFind(e,!0);return t.length>0?t[0]:void 0}_generalFind(e,t){let n=[];return this._descendants(r=>{let i=r._isMatch(e);return i&&n.push(r),!!(i&&t)}),n}_descendants(e){let t=!1,n=this.getChildren();for(let r of n)if(t=e(r),t||r.hasChildren()&&(t=r._descendants(e),t))return!0;return!1}toObject(){let e=n.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(t=>{e.children.push(t.toObject())}),e}isAncestorOf(e){let t=e.getParent();for(;t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){let t=n.Node.prototype.clone.call(this,e);return this.getChildren().forEach(function(e){t.add(e.clone())}),t}getAllIntersections(e){let t=[];return this.find(`Shape`).forEach(n=>{n.isVisible()&&n.intersects(e)&&t.push(n)}),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),!this.isCached()&&((t=this.children)==null||t.forEach(function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)==null||e.forEach(function(e,t){e.index=t}),this._requestDraw()}drawScene(e,t,n){let r=this.getLayer(),i=e||r&&r.getCanvas(),a=i&&i.getContext(),o=this._getCanvasCache(),s=o&&o.scene,c=i&&i.isCache;if(!this.isVisible()&&!c)return this;if(s){a.save();let e=this.getAbsoluteTransform(t).getMatrix();a.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren(`drawScene`,i,t,n);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;let n=this.getLayer(),r=e||n&&n.hitCanvas,i=r&&r.getContext(),a=this._getCanvasCache();if(a&&a.hit){i.save();let e=this.getAbsoluteTransform(t).getMatrix();i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedHitCanvas(i),i.restore()}else this._drawChildren(`drawHit`,r,t);return this}_drawChildren(e,t,n,r){var i;let a=t&&t.getContext(),o=this.clipWidth(),s=this.clipHeight(),c=this.clipFunc(),l=typeof o==`number`&&typeof s==`number`||c,u=n===this;if(l){a.save();let e=this.getAbsoluteTransform(n),t=e.getMatrix();a.transform(t[0],t[1],t[2],t[3],t[4],t[5]),a.beginPath();let r;if(c)r=c.call(this,a,this);else{let e=this.clipX(),t=this.clipY();a.rect(e||0,t||0,o,s)}a.clip.apply(a,r),t=e.copy().invert().getMatrix(),a.transform(t[0],t[1],t[2],t[3],t[4],t[5])}let d=!u&&this.globalCompositeOperation()!==`source-over`&&e===`drawScene`;d&&(a.save(),a._applyGlobalCompositeOperation(this)),(i=this.children)==null||i.forEach(function(i){i[e](t,n,r)}),d&&a.restore(),l&&a.restore()}getClientRect(e={}){var t;let n=e.skipTransform,r=e.relativeTo,i,a,o,s,c={x:1/0,y:1/0,width:0,height:0},l=this;(t=this.children)==null||t.forEach(function(t){if(!t.visible())return;let n=t.getClientRect({relativeTo:l,skipShadow:e.skipShadow,skipStroke:e.skipStroke});(n.width!==0||n.height!==0)&&(i===void 0?(i=n.x,a=n.y,o=n.x+n.width,s=n.y+n.height):(i=Math.min(i,n.x),a=Math.min(a,n.y),o=Math.max(o,n.x+n.width),s=Math.max(s,n.y+n.height)))});let u=this.find(`Shape`),d=!1;for(let e=0;e<u.length;e++)if(u[e]._isVisible(this)){d=!0;break}return c=d&&i!==void 0?{x:i,y:a,width:o-i,height:s-a}:{x:0,y:0,width:0,height:0},n?c:this._transformedRect(c,r)}};e.Container=i,t.Factory.addComponentsGetterSetter(i,`clip`,[`x`,`y`,`width`,`height`]),t.Factory.addGetterSetter(i,`clipX`,void 0,(0,r.getNumberValidator)()),t.Factory.addGetterSetter(i,`clipY`,void 0,(0,r.getNumberValidator)()),t.Factory.addGetterSetter(i,`clipWidth`,void 0,(0,r.getNumberValidator)()),t.Factory.addGetterSetter(i,`clipHeight`,void 0,(0,r.getNumberValidator)()),t.Factory.addGetterSetter(i,`clipFunc`)})),Ai=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getCapturedShape=i,e.createEvent=a,e.hasPointerCapture=o,e.setPointerCapture=s,e.releaseCapture=c;var t=xi(),n=new Map,r=t.Konva._global.PointerEvent!==void 0;function i(e){return n.get(e)}function a(e){return{evt:e,pointerId:e.pointerId}}function o(e,t){return n.get(e)===t}function s(e,t){c(e),t.getStage()&&(n.set(e,t),r&&t._fire(`gotpointercapture`,a(new PointerEvent(`gotpointercapture`))))}function c(e,t){let i=n.get(e);if(!i)return;let o=i.getStage();o&&o.content,n.delete(e),r&&i._fire(`lostpointercapture`,a(new PointerEvent(`lostpointercapture`)))}})),ji=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;var t=Si(),n=Di(),r=ki(),i=xi(),a=wi(),o=Ti(),s=xi(),c=Ai(),l=`Stage`,u=`string`,d=`px`,f=`mouseout`,p=`mouseleave`,m=`mouseover`,h=`mouseenter`,g=`mousemove`,_=`mousedown`,v=`mouseup`,y=`pointermove`,b=`pointerdown`,x=`pointerup`,S=`pointercancel`,C=`lostpointercapture`,w=`pointerout`,T=`pointerleave`,E=`pointerover`,D=`pointerenter`,O=`contextmenu`,k=`touchstart`,A=`touchend`,j=`touchmove`,M=`touchcancel`,ee=`wheel`,N=5,P=[[h,`_pointerenter`],[_,`_pointerdown`],[g,`_pointermove`],[v,`_pointerup`],[p,`_pointerleave`],[k,`_pointerdown`],[j,`_pointermove`],[A,`_pointerup`],[M,`_pointercancel`],[m,`_pointerover`],[ee,`_wheel`],[O,`_contextmenu`],[b,`_pointerdown`],[y,`_pointermove`],[x,`_pointerup`],[S,`_pointercancel`],[T,`_pointerleave`],[C,`_lostpointercapture`]],F={mouse:{[w]:f,[T]:p,[E]:m,[D]:h,[y]:g,[b]:_,[x]:v,[S]:`mousecancel`,pointerclick:`click`,pointerdblclick:`dblclick`},touch:{[w]:`touchout`,[T]:`touchleave`,[E]:`touchover`,[D]:`touchenter`,[y]:j,[b]:k,[x]:A,[S]:M,pointerclick:`tap`,pointerdblclick:`dbltap`},pointer:{[w]:w,[T]:T,[E]:E,[D]:D,[y]:y,[b]:b,[x]:x,[S]:S,pointerclick:`pointerclick`,pointerdblclick:`pointerdblclick`}},I=e=>e.indexOf(`pointer`)>=0?`pointer`:e.indexOf(`touch`)>=0?`touch`:`mouse`,L=e=>{let t=I(e);if(t===`pointer`)return i.Konva.pointerEventsEnabled&&F.pointer;if(t===`touch`)return F.touch;if(t===`mouse`)return F.mouse};function te(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&t.Util.warn(`Stage does not support clipping. Please use clip for Layers or Groups.`),e}var ne=`Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);`;e.stages=[];var re=class extends r.Container{constructor(t){super(te(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on(`widthChange.konva heightChange.konva`,this._resizeDOM),this.on(`visibleChange.konva`,this._checkVisibility),this.on(`clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva`,()=>{te(this.attrs)}),this._checkVisibility()}_validateAdd(e){let n=e.getType()===`Layer`,r=e.getType()===`FastLayer`;n||r||t.Util.throw(`You may only add layers to the stage.`)}_checkVisibility(){if(!this.content)return;let e=this.visible()?``:`none`;this.content.style.display=e}setContainer(e){if(typeof e===u){let t;if(e.charAt(0)===`.`){let t=e.slice(1);e=document.getElementsByClassName(t)[0]}else t=e.charAt(0)===`#`?e.slice(1):e,e=document.getElementById(t);if(!e)throw`Can not find container in document with id `+t}return this._setAttr(`container`,e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){let e=this.children,t=e.length;for(let n=0;n<t;n++)e[n].clear();return this}clone(e){return e||={},e.container=typeof document<`u`&&document.createElement(`div`),r.Container.prototype.clone.call(this,e)}destroy(){super.destroy();let n=this.content;n&&t.Util._isInDocument(n)&&this.container().removeChild(n);let r=e.stages.indexOf(this);return r>-1&&e.stages.splice(r,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){let e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(t.Util.warn(ne),null)}_getPointerById(e){return this._pointerPositions.find(t=>t.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e||={},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();let t=new a.SceneCanvas({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach(function(t){if(!t.isVisible())return;let r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}),t}getIntersection(e){if(!e)return null;let t=this.children,n=t.length-1;for(let r=n;r>=0;r--){let n=t[r].getIntersection(e);if(n)return n}return null}_resizeDOM(){let e=this.width(),t=this.height();this.content&&(this.content.style.width=e+d,this.content.style.height=t+d),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach(n=>{n.setSize({width:e,height:t}),n.draw()})}add(e,...n){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}super.add(e);let r=this.children.length;return r>N&&t.Util.warn(`The stage has `+r+` layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group.`),e.setSize({width:this.width(),height:this.height()}),e.draw(),i.Konva.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return c.hasPointerCapture(e,this)}setPointerCapture(e){c.setPointerCapture(e,this)}releaseCapture(e){c.releaseCapture(e,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&P.forEach(([e,t])=>{this.content.addEventListener(e,e=>{this[t](e)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);let t=L(e.type);t&&this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);let t=L(e.type);t&&this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+`targetShape`];return t&&!t.getStage()&&(t=null),t}_pointerleave(e){let t=L(e.type),n=I(e.type);if(!t)return;this.setPointersPositions(e);let r=this._getTargetShape(n),a=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;r&&a?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+`targetShape`]=null):a&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){let t=L(e.type),n=I(e.type);if(!t)return;this.setPointersPositions(e);let r=!1;this._changedPointerPositions.forEach(a=>{let s=this.getIntersection(a);if(o.DD.justDragged=!1,i.Konva[`_`+n+`ListenClick`]=!0,!s||!s.isListening()){this[n+`ClickStartShape`]=void 0;return}i.Konva.capturePointerEventsEnabled&&s.setPointerCapture(a.id),this[n+`ClickStartShape`]=s,s._fireAndBubble(t.pointerdown,{evt:e,pointerId:a.id}),r=!0;let c=e.type.indexOf(`touch`)>=0;s.preventDefault()&&e.cancelable&&c&&e.preventDefault()}),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){let t=L(e.type),n=I(e.type);if(!t||(i.Konva.isDragging()&&o.DD.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!(!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled)))return;let r={},a=!1,s=this._getTargetShape(n);this._changedPointerPositions.forEach(i=>{let o=c.getCapturedShape(i.id)||this.getIntersection(i),l=i.id,u={evt:e,pointerId:l},d=s!==o;if(d&&s&&(s._fireAndBubble(t.pointerout,{...u},o),s._fireAndBubble(t.pointerleave,{...u},o)),o){if(r[o._id])return;r[o._id]=!0}o&&o.isListening()?(a=!0,d&&(o._fireAndBubble(t.pointerover,{...u},s),o._fireAndBubble(t.pointerenter,{...u},s),this[n+`targetShape`]=o),o._fireAndBubble(t.pointermove,{...u})):s&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:l}),this[n+`targetShape`]=null)}),a||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){let t=L(e.type),n=I(e.type);if(!t)return;this.setPointersPositions(e);let r=this[n+`ClickStartShape`],a=this[n+`ClickEndShape`],s={},l=!1;this._changedPointerPositions.forEach(u=>{let d=c.getCapturedShape(u.id)||this.getIntersection(u);if(d){if(d.releaseCapture(u.id),s[d._id])return;s[d._id]=!0}let f=u.id,p={evt:e,pointerId:f},m=!1;i.Konva[`_`+n+`InDblClickWindow`]?(m=!0,clearTimeout(this[n+`DblTimeout`])):o.DD.justDragged||(i.Konva[`_`+n+`InDblClickWindow`]=!0,clearTimeout(this[n+`DblTimeout`])),this[n+`DblTimeout`]=setTimeout(function(){i.Konva[`_`+n+`InDblClickWindow`]=!1},i.Konva.dblClickWindow),d&&d.isListening()?(l=!0,this[n+`ClickEndShape`]=d,d._fireAndBubble(t.pointerup,{...p}),i.Konva[`_`+n+`ListenClick`]&&r&&r===d&&(d._fireAndBubble(t.pointerclick,{...p}),m&&a&&a===d&&d._fireAndBubble(t.pointerdblclick,{...p}))):(this[n+`ClickEndShape`]=null,i.Konva[`_`+n+`ListenClick`]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:f}),m&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:f}))}),l||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva[`_`+n+`ListenClick`]=!1,e.cancelable&&n!==`touch`&&n!==`pointer`&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);let t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(O,{evt:e}):this._fire(O,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);let t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(ee,{evt:e}):this._fire(ee,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);let t=c.getCapturedShape(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(x,c.createEvent(e)),c.releaseCapture(e.pointerId)}_lostpointercapture(e){c.releaseCapture(e.pointerId)}setPointersPositions(e){let n=this._getContentPosition(),r=null,i=null;e||=window.event,e.touches===void 0?(r=(e.clientX-n.left)/n.scaleX,i=(e.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:t.Util._getFirstPointerId(e)}],this._changedPointerPositions=[{x:r,y:i,id:t.Util._getFirstPointerId(e)}]):(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-n.left)/n.scaleX,y:(e.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-n.left)/n.scaleX,y:(e.clientY-n.top)/n.scaleY})}))}_setPointerPosition(e){t.Util.warn(`Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.`),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};let e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new a.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new a.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!i.Konva.isBrowser)return;let e=this.container();if(!e)throw`Stage has no container. A container is required.`;e.innerHTML=``,this.content=document.createElement(`div`),this.content.style.position=`relative`,this.content.style.userSelect=`none`,this.content.className=`konvajs-content`,this.content.setAttribute(`role`,`presentation`),e.appendChild(this.content),this._resizeDOM()}cache(){return t.Util.warn(`Cache function is not allowed for stage. You may use cache only for layers, groups and shapes.`),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}};e.Stage=re,re.prototype.nodeType=l,(0,s._registerNode)(re),n.Factory.addGetterSetter(re,`container`),i.Konva.isBrowser&&document.addEventListener(`visibilitychange`,()=>{e.stages.forEach(e=>{e.batchDraw()})})})),Mi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;var t=xi(),n=Si(),r=Di(),i=Oi(),a=Ei(),o=xi(),s=Ai(),c=`hasShadow`,l=`shadowRGBA`,u=`patternImage`,d=`linearGradient`,f=`radialGradient`,p;function m(){return p||(p=n.Util.createCanvasElement().getContext(`2d`),p)}e.shapes={};function h(e){let t=this.attrs.fillRule;t?e.fill(t):e.fill()}function g(e){e.stroke()}function _(e){let t=this.attrs.fillRule;t?e.fill(t):e.fill()}function v(e){e.stroke()}function y(){this._clearCache(c)}function b(){this._clearCache(l)}function x(){this._clearCache(u)}function S(){this._clearCache(d)}function C(){this._clearCache(f)}var w=class extends i.Node{constructor(t){super(t);let r;for(;r=n.Util.getRandomColor(),!(r&&!(r in e.shapes)););this.colorKey=r,e.shapes[r]=this}getContext(){return n.Util.warn(`shape.getContext() method is deprecated. Please do not use it.`),this.getLayer().getContext()}getCanvas(){return n.Util.warn(`shape.getCanvas() method is deprecated. Please do not use it.`),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(c,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(u,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){let e=m().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||`repeat`);if(e&&e.setTransform){let r=new n.Transform;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(t.Konva.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());let i=r.getMatrix(),a=typeof DOMMatrix>`u`?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);e.setTransform(a)}return e}}_getLinearGradient(){return this._getCache(d,this.__getLinearGradient)}__getLinearGradient(){let e=this.fillLinearGradientColorStops();if(e){let t=m(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),i=t.createLinearGradient(n.x,n.y,r.x,r.y);for(let t=0;t<e.length;t+=2)i.addColorStop(e[t],e[t+1]);return i}}_getRadialGradient(){return this._getCache(f,this.__getRadialGradient)}__getRadialGradient(){let e=this.fillRadialGradientColorStops();if(e){let t=m(),n=this.fillRadialGradientStartPoint(),r=this.fillRadialGradientEndPoint(),i=t.createRadialGradient(n.x,n.y,this.fillRadialGradientStartRadius(),r.x,r.y,this.fillRadialGradientEndRadius());for(let t=0;t<e.length;t+=2)i.addColorStop(e[t],e[t+1]);return i}}getShadowRGBA(){return this._getCache(l,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;let e=n.Util.colorToRGBA(this.shadowColor());if(e)return`rgba(`+e.r+`,`+e.g+`,`+e.b+`,`+e.a*(this.shadowOpacity()||1)+`)`}hasFill(){return this._calculate(`hasFill`,[`fillEnabled`,`fill`,`fillPatternImage`,`fillLinearGradientColorStops`,`fillRadialGradientColorStops`],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate(`hasStroke`,[`strokeEnabled`,`strokeWidth`,`stroke`,`strokeLinearGradientColorStops`],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){let e=this.hitStrokeWidth();return e===`auto`?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){let t=this.getStage();if(!t)return!1;let n=t.bufferHitCanvas;return n.getContext().clear(),this.drawHit(n,void 0,!0),n.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){if(!(this.attrs.perfectDrawEnabled??!0))return!1;let t=e||this.hasFill(),n=this.hasStroke(),r=this.getAbsoluteOpacity()!==1;if(t&&n&&r)return!0;let i=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(t&&n&&i&&a)}setStrokeHitEnabled(e){n.Util.warn(`strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead.`),e?this.hitStrokeWidth(`auto`):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){let e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let t=!1,n=this.getParent();for(;n;){if(n.isCached()){t=!0;break}n=n.getParent()}let r=e.skipTransform,i=e.relativeTo||t&&this.getStage()||void 0,a=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=a.width+o,c=a.height+o,l=!e.skipShadow&&this.hasShadow(),u=l?this.shadowOffsetX():0,d=l?this.shadowOffsetY():0,f=s+Math.abs(u),p=c+Math.abs(d),m=l&&this.shadowBlur()||0,h={width:f+m*2,height:p+m*2,x:-(o/2+m)+Math.min(u,0)+a.x,y:-(o/2+m)+Math.min(d,0)+a.y};return r?h:this._transformedRect(h,i)}drawScene(e,t,n){let r=this.getLayer(),i=(e||r.getCanvas()).getContext(),a=this._getCanvasCache(),o=this.getSceneFunc(),s=this.hasShadow(),c,l=t===this;if(!this.isVisible()&&!l)return this;if(a){i.save();let e=this.getAbsoluteTransform(t).getMatrix();return i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedSceneCanvas(i),i.restore(),this}if(!o)return this;if(i.save(),this._useBufferCanvas()){c=this.getStage();let e=n||c.bufferCanvas,r=e.getContext();r.clear(),r.save(),r._applyLineJoin(this);let a=this.getAbsoluteTransform(t).getMatrix();r.transform(a[0],a[1],a[2],a[3],a[4],a[5]),o.call(this,r,this),r.restore();let l=e.pixelRatio;s&&i._applyShadow(this),i._applyOpacity(this),i._applyGlobalCompositeOperation(this),i.drawImage(e._canvas,e.x||0,e.y||0,e.width/l,e.height/l)}else{if(i._applyLineJoin(this),!l){let e=this.getAbsoluteTransform(t).getMatrix();i.transform(e[0],e[1],e[2],e[3],e[4],e[5]),i._applyOpacity(this),i._applyGlobalCompositeOperation(this)}s&&i._applyShadow(this),o.call(this,i,this)}return i.restore(),this}drawHit(e,t,r=!1){if(!this.shouldDrawHit(t,r))return this;let i=this.getLayer(),a=e||i.hitCanvas,o=a&&a.getContext(),s=this.hitFunc()||this.sceneFunc(),c=this._getCanvasCache(),l=c&&c.hit;if(this.colorKey||n.Util.warn(`Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()`),l){o.save();let e=this.getAbsoluteTransform(t).getMatrix();return o.transform(e[0],e[1],e[2],e[3],e[4],e[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),o._applyLineJoin(this),this!==t){let e=this.getAbsoluteTransform(t).getMatrix();o.transform(e[0],e[1],e[2],e[3],e[4],e[5])}return s.call(this,o,this),o.restore(),this}drawHitFromCache(e=0){let t=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=t.hit,a=i.getContext(),o=i.getWidth(),s=i.getHeight();a.clear(),a.drawImage(r._canvas,0,0,o,s);try{let t=a.getImageData(0,0,o,s),r=t.data,i=r.length,c=n.Util._hexToRgb(this.colorKey);for(let t=0;t<i;t+=4)r[t+3]>e?(r[t]=c.r,r[t+1]=c.g,r[t+2]=c.b,r[t+3]=255):r[t+3]=0;a.putImageData(t,0,0)}catch(e){n.Util.error(`Unable to draw hit graph from cached scene canvas. `+e.message)}return this}hasPointerCapture(e){return s.hasPointerCapture(e,this)}setPointerCapture(e){s.setPointerCapture(e,this)}releaseCapture(e){s.releaseCapture(e,this)}};e.Shape=w,w.prototype._fillFunc=h,w.prototype._strokeFunc=g,w.prototype._fillFuncHit=_,w.prototype._strokeFuncHit=v,w.prototype._centroid=!1,w.prototype.nodeType=`Shape`,(0,o._registerNode)(w),w.prototype.eventListeners={},w.prototype.on.call(w.prototype,`shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva`,y),w.prototype.on.call(w.prototype,`shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva`,b),w.prototype.on.call(w.prototype,`fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva`,x),w.prototype.on.call(w.prototype,`fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva`,S),w.prototype.on.call(w.prototype,`fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva`,C),r.Factory.addGetterSetter(w,`stroke`,void 0,(0,a.getStringOrGradientValidator)()),r.Factory.addGetterSetter(w,`strokeWidth`,2,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(w,`fillAfterStrokeEnabled`,!1),r.Factory.addGetterSetter(w,`hitStrokeWidth`,`auto`,(0,a.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(w,`strokeHitEnabled`,!0,(0,a.getBooleanValidator)()),r.Factory.addGetterSetter(w,`perfectDrawEnabled`,!0,(0,a.getBooleanValidator)()),r.Factory.addGetterSetter(w,`shadowForStrokeEnabled`,!0,(0,a.getBooleanValidator)()),r.Factory.addGetterSetter(w,`lineJoin`),r.Factory.addGetterSetter(w,`lineCap`),r.Factory.addGetterSetter(w,`sceneFunc`),r.Factory.addGetterSetter(w,`hitFunc`),r.Factory.addGetterSetter(w,`dash`),r.Factory.addGetterSetter(w,`dashOffset`,0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(w,`shadowColor`,void 0,(0,a.getStringValidator)()),r.Factory.addGetterSetter(w,`shadowBlur`,0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(w,`shadowOpacity`,1,(0,a.getNumberValidator)()),r.Factory.addComponentsGetterSetter(w,`shadowOffset`,[`x`,`y`]),r.Factory.addGetterSetter(w,`shadowOffsetX`,0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(w,`shadowOffsetY`,0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(w,`fillPatternImage`),r.Factory.addGetterSetter(w,`fill`,void 0,(0,a.getStringOrGradientValidator)()),r.Factory.addGetterSetter(w,`fillPatternX`,0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(w,`fillPatternY`,0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(w,`fillLinearGradientColorStops`),r.Factory.addGetterSetter(w,`strokeLinearGradientColorStops`),r.Factory.addGetterSetter(w,`fillRadialGradientStartRadius`,0),r.Factory.addGetterSetter(w,`fillRadialGradientEndRadius`,0),r.Factory.addGetterSetter(w,`fillRadialGradientColorStops`),r.Factory.addGetterSetter(w,`fillPatternRepeat`,`repeat`),r.Factory.addGetterSetter(w,`fillEnabled`,!0),r.Factory.addGetterSetter(w,`strokeEnabled`,!0),r.Factory.addGetterSetter(w,`shadowEnabled`,!0),r.Factory.addGetterSetter(w,`dashEnabled`,!0),r.Factory.addGetterSetter(w,`strokeScaleEnabled`,!0),r.Factory.addGetterSetter(w,`fillPriority`,`color`),r.Factory.addComponentsGetterSetter(w,`fillPatternOffset`,[`x`,`y`]),r.Factory.addGetterSetter(w,`fillPatternOffsetX`,0,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(w,`fillPatternOffsetY`,0,(0,a.getNumberValidator)()),r.Factory.addComponentsGetterSetter(w,`fillPatternScale`,[`x`,`y`]),r.Factory.addGetterSetter(w,`fillPatternScaleX`,1,(0,a.getNumberValidator)()),r.Factory.addGetterSetter(w,`fillPatternScaleY`,1,(0,a.getNumberValidator)()),r.Factory.addComponentsGetterSetter(w,`fillLinearGradientStartPoint`,[`x`,`y`]),r.Factory.addComponentsGetterSetter(w,`strokeLinearGradientStartPoint`,[`x`,`y`]),r.Factory.addGetterSetter(w,`fillLinearGradientStartPointX`,0),r.Factory.addGetterSetter(w,`strokeLinearGradientStartPointX`,0),r.Factory.addGetterSetter(w,`fillLinearGradientStartPointY`,0),r.Factory.addGetterSetter(w,`strokeLinearGradientStartPointY`,0),r.Factory.addComponentsGetterSetter(w,`fillLinearGradientEndPoint`,[`x`,`y`]),r.Factory.addComponentsGetterSetter(w,`strokeLinearGradientEndPoint`,[`x`,`y`]),r.Factory.addGetterSetter(w,`fillLinearGradientEndPointX`,0),r.Factory.addGetterSetter(w,`strokeLinearGradientEndPointX`,0),r.Factory.addGetterSetter(w,`fillLinearGradientEndPointY`,0),r.Factory.addGetterSetter(w,`strokeLinearGradientEndPointY`,0),r.Factory.addComponentsGetterSetter(w,`fillRadialGradientStartPoint`,[`x`,`y`]),r.Factory.addGetterSetter(w,`fillRadialGradientStartPointX`,0),r.Factory.addGetterSetter(w,`fillRadialGradientStartPointY`,0),r.Factory.addComponentsGetterSetter(w,`fillRadialGradientEndPoint`,[`x`,`y`]),r.Factory.addGetterSetter(w,`fillRadialGradientEndPointX`,0),r.Factory.addGetterSetter(w,`fillRadialGradientEndPointY`,0),r.Factory.addGetterSetter(w,`fillPatternRotation`,0),r.Factory.addGetterSetter(w,`fillRule`,void 0,(0,a.getStringValidator)()),r.Factory.backCompat(w,{dashArray:`dash`,getDashArray:`getDash`,setDashArray:`getDash`,drawFunc:`sceneFunc`,getDrawFunc:`getSceneFunc`,setDrawFunc:`setSceneFunc`,drawHitFunc:`hitFunc`,getDrawHitFunc:`getHitFunc`,setDrawHitFunc:`setHitFunc`})})),Ni=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Layer=void 0;var t=Si(),n=ki(),r=Oi(),i=Di(),a=wi(),o=Ei(),s=Mi(),c=xi(),l=`#`,u=`beforeDraw`,d=`draw`,f=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],p=f.length,m=class extends n.Container{constructor(e){super(e),this.canvas=new a.SceneCanvas,this.hitCanvas=new a.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on(`visibleChange.konva`,this._checkVisibility),this._checkVisibility(),this.on(`imageSmoothingEnabledChange.konva`,this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);let t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e<t.children.length-1?t.content.insertBefore(this.getNativeCanvasElement(),t.children[e+1].getCanvas()._canvas):t.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){r.Node.prototype.moveToTop.call(this);let e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!r.Node.prototype.moveUp.call(this))return!1;let e=this.getStage();return!e||!e.content?!1:(e.content.removeChild(this.getNativeCanvasElement()),this.index<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[this.index+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(r.Node.prototype.moveDown.call(this)){let e=this.getStage();if(e){let t=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),t[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(r.Node.prototype.moveToBottom.call(this)){let e=this.getStage();if(e){let t=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),t[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){let e=this.getNativeCanvasElement();return r.Node.prototype.remove.call(this),e&&e.parentNode&&t.Util._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:t}){return this.canvas.setSize(e,t),this.hitCanvas.setSize(e,t),this._setSmoothEnabled(),this}_validateAdd(e){let n=e.getType();n!==`Group`&&n!==`Shape`&&t.Util.throw(`You may only add groups and shapes to a layer.`)}_toKonvaCanvas(e){return e||={},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x===void 0?this.x():e.x,e.y=e.y===void 0?this.y():e.y,r.Node.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display=`block`:this.canvas._canvas.style.display=`none`}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){t.Util.warn(`Can not change width of layer. Use "stage.width(value)" function instead.`)}getHeight(){if(this.parent)return this.parent.height()}setHeight(){t.Util.warn(`Can not change height of layer. Use "stage.height(value)" function instead.`)}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,t.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let t=1,n=!1;for(;;){for(let r=0;r<p;r++){let i=f[r],a=this._getIntersection({x:e.x+i.x*t,y:e.y+i.y*t}),o=a.shape;if(o)return o;if(n=!!a.antialiased,!a.antialiased)break}if(n)t+=1;else return null}}_getIntersection(e){let n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,i=r[3];if(i===255){let e=t.Util._rgbToHex(r[0],r[1],r[2]),n=s.shapes[l+e];return n?{shape:n}:{antialiased:!0}}return i>0?{antialiased:!0}:{}}drawScene(e,t,r){let i=this.getLayer(),a=e||i&&i.getCanvas();return this._fire(u,{node:this}),this.clearBeforeDraw()&&a.getContext().clear(),n.Container.prototype.drawScene.call(this,a,t,r),this._fire(d,{node:this}),this}drawHit(e,t){let r=this.getLayer(),i=e||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),n.Container.prototype.drawHit.call(this,i,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){t.Util.warn(`hitGraphEnabled method is deprecated. Please use layer.listening() instead.`),this.listening(e)}getHitGraphEnabled(e){return t.Util.warn(`hitGraphEnabled method is deprecated. Please use layer.listening() instead.`),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;let e=this.parent;this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return t.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};e.Layer=m,m.prototype.nodeType=`Layer`,(0,c._registerNode)(m),i.Factory.addGetterSetter(m,`imageSmoothingEnabled`,!0),i.Factory.addGetterSetter(m,`clearBeforeDraw`,!0),i.Factory.addGetterSetter(m,`hitGraphEnabled`,!0,(0,o.getBooleanValidator)())})),Pi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FastLayer=void 0;var t=Si(),n=Ni(),r=xi(),i=class extends n.Layer{constructor(e){super(e),this.listening(!1),t.Util.warn(`Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.`)}};e.FastLayer=i,i.prototype.nodeType=`FastLayer`,(0,r._registerNode)(i)})),Fi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Group=void 0;var t=Si(),n=ki(),r=xi(),i=class extends n.Container{_validateAdd(e){let n=e.getType();n!==`Group`&&n!==`Shape`&&t.Util.throw(`You may only add groups and shapes to groups.`)}};e.Group=i,i.prototype.nodeType=`Group`,(0,r._registerNode)(i)})),Ii=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Animation=void 0;var t=xi(),n=Si(),r=(function(){return t.glob.performance&&t.glob.performance.now?function(){return t.glob.performance.now()}:function(){return new Date().getTime()}})(),i=class e{constructor(t,n){this.id=e.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:r(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(e){let t=[];return e&&(t=Array.isArray(e)?e:[e]),this.layers=t,this}getLayers(){return this.layers}addLayer(e){let t=this.layers,n=t.length;for(let r=0;r<n;r++)if(t[r]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){let t=e.animations,n=t.length;for(let e=0;e<n;e++)if(t[e].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=r(),e._addAnimation(this),this}stop(){return e._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){let t=e.id,n=this.animations,r=n.length;for(let e=0;e<r;e++)if(n[e].id===t){this.animations.splice(e,1);break}}static _runFrames(){let e={},t=this.animations;for(let n=0;n<t.length;n++){let i=t[n],a=i.layers,o=i.func;i._updateFrameObject(r());let s=a.length,c;if(c=!o||o.call(i,i.frame)!==!1,c)for(let t=0;t<s;t++){let n=a[t];n._id!==void 0&&(e[n._id]=n)}}for(let t in e)e.hasOwnProperty(t)&&e[t].batchDraw()}static _animationLoop(){let t=e;t.animations.length?(t._runFrames(),n.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,n.Util.requestAnimFrame(this._animationLoop))}};e.Animation=i,i.animations=[],i.animIdCounter=0,i.animRunning=!1})),Li=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;var t=Si(),n=Ii(),r=Oi(),i=xi(),a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,s=2,c=3,l=[`fill`,`stroke`,`shadowColor`],u=0,d=class{constructor(e,t,n,r,i,a,o){this.prop=e,this.propFunc=t,this.begin=r,this._pos=r,this.duration=a,this._change=0,this.prevPos=0,this.yoyo=o,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=n,this._change=i-this.begin,this.pause()}fire(e){let t=this[e];t&&t()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=s,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire(`onPlay`)}reverse(){this.state=c,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire(`onReverse`)}seek(e){this.pause(),this._time=e,this.update(),this.fire(`onSeek`)}reset(){this.pause(),this._time=0,this.update(),this.fire(`onReset`)}finish(){this.pause(),this._time=this.duration,this.update(),this.fire(`onFinish`)}update(){this.setPosition(this.getPosition(this._time)),this.fire(`onUpdate`)}onEnterFrame(){let e=this.getTimer()-this._startTime;this.state===s?this.setTime(e):this.state===c&&this.setTime(this.duration-e)}pause(){this.state=o,this.fire(`onPause`)}getTimer(){return new Date().getTime()}},f=class r{constructor(o){let s=this,c=o.node,l=c._id,f=o.easing||e.Easings.Linear,p=!!o.yoyo,m,h;m=o.duration===void 0?.3:o.duration===0?.001:o.duration,this.node=c,this._id=u++;let g=c.getLayer()||(c instanceof i.Konva.Stage?c.getLayers():null);for(h in g||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){s.tween.onEnterFrame()},g),this.tween=new d(h,function(e){s._tweenFunc(e)},f,0,1,m*1e3,p),this._addListeners(),r.attrs[l]||(r.attrs[l]={}),r.attrs[l][this._id]||(r.attrs[l][this._id]={}),r.tweens[l]||(r.tweens[l]={}),o)a[h]===void 0&&this._addAttr(h,o[h]);this.reset(),this.onFinish=o.onFinish,this.onReset=o.onReset,this.onUpdate=o.onUpdate}_addAttr(e,n){let i=this.node,a=i._id,o,s,c,u,d,f=r.tweens[a][e];f&&delete r.attrs[a][f][e];let p=i.getAttr(e);if(t.Util._isArray(n)){if(o=[],s=Math.max(n.length,p.length),e===`points`&&n.length!==p.length&&(n.length>p.length?(u=p,p=t.Util._prepareArrayForTween(p,n,i.closed())):(c=n,n=t.Util._prepareArrayForTween(n,p,i.closed()))),e.indexOf(`fill`)===0)for(let e=0;e<s;e++)if(e%2==0)o.push(n[e]-p[e]);else{let r=t.Util.colorToRGBA(p[e]);d=t.Util.colorToRGBA(n[e]),p[e]=r,o.push({r:d.r-r.r,g:d.g-r.g,b:d.b-r.b,a:d.a-r.a})}else for(let e=0;e<s;e++)o.push(n[e]-p[e])}else l.indexOf(e)===-1?o=n-p:(p=t.Util.colorToRGBA(p),d=t.Util.colorToRGBA(n),o={r:d.r-p.r,g:d.g-p.g,b:d.b-p.b,a:d.a-p.a});r.attrs[a][this._id][e]={start:p,diff:o,end:n,trueEnd:c,trueStart:u},r.tweens[a][e]=this._id}_tweenFunc(e){let n=this.node,i=r.attrs[n._id][this._id],a,o,s,c,u,d,f,p;for(a in i){if(o=i[a],s=o.start,c=o.diff,p=o.end,t.Util._isArray(s)){if(u=[],f=Math.max(s.length,p.length),a.indexOf(`fill`)===0)for(d=0;d<f;d++)d%2==0?u.push((s[d]||0)+c[d]*e):u.push(`rgba(`+Math.round(s[d].r+c[d].r*e)+`,`+Math.round(s[d].g+c[d].g*e)+`,`+Math.round(s[d].b+c[d].b*e)+`,`+(s[d].a+c[d].a*e)+`)`);else for(d=0;d<f;d++)u.push((s[d]||0)+c[d]*e)}else u=l.indexOf(a)===-1?s+c*e:`rgba(`+Math.round(s.r+c.r*e)+`,`+Math.round(s.g+c.g*e)+`,`+Math.round(s.b+c.b*e)+`,`+(s.a+c.a*e)+`)`;n.setAttr(a,u)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{let e=this.node,t=r.attrs[e._id][this._id];t.points&&t.points.trueEnd&&e.setAttr(`points`,t.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{let e=this.node,t=r.attrs[e._id][this._id];t.points&&t.points.trueStart&&e.points(t.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){let e=this.node._id,t=this._id,n=r.tweens[e];this.pause(),this.anim&&this.anim.stop();for(let t in n)delete r.tweens[e][t];delete r.attrs[e][t],r.tweens[e]&&(Object.keys(r.tweens[e]).length===0&&delete r.tweens[e],Object.keys(r.attrs[e]).length===0&&delete r.attrs[e])}};e.Tween=f,f.attrs={},f.tweens={},r.Node.prototype.to=function(e){let t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new f(e).play()},e.Easings={BackEaseIn(e,t,n,r){return n*(e/=r)*e*(2.70158*e-1.70158)+t},BackEaseOut(e,t,n,r){return n*((e=e/r-1)*e*(2.70158*e+1.70158)+1)+t},BackEaseInOut(e,t,n,r){let i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,a){let o=0;return e===0?t:(e/=r)===1?t+n:(a||=r*.3,!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),-(i*2**(10*--e)*Math.sin((e*r-o)*(2*Math.PI)/a))+t)},ElasticEaseOut(e,t,n,r,i,a){let o=0;return e===0?t:(e/=r)===1?t+n:(a||=r*.3,!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),i*2**(-10*e)*Math.sin((e*r-o)*(2*Math.PI)/a)+n+t)},ElasticEaseInOut(e,t,n,r,i,a){let o=0;return e===0?t:(e/=r/2)==2?t+n:(a||=.3*1.5*r,!i||i<Math.abs(n)?(i=n,o=a/4):o=a/(2*Math.PI)*Math.asin(n/i),e<1?-.5*(i*2**(10*--e)*Math.sin((e*r-o)*(2*Math.PI)/a))+t:i*2**(-10*--e)*Math.sin((e*r-o)*(2*Math.PI)/a)*.5+n+t)},BounceEaseOut(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t},BounceEaseIn(t,n,r,i){return r-e.Easings.BounceEaseOut(i-t,0,r,i)+n},BounceEaseInOut(t,n,r,i){return t<i/2?e.Easings.BounceEaseIn(t*2,0,r,i)*.5+n:e.Easings.BounceEaseOut(t*2-i,0,r,i)*.5+r*.5+n},EaseIn(e,t,n,r){return n*(e/=r)*e+t},EaseOut(e,t,n,r){return-n*(e/=r)*(e-2)+t},EaseInOut(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},StrongEaseIn(e,t,n,r){return n*(e/=r)*e*e*e*e+t},StrongEaseOut(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t},StrongEaseInOut(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t},Linear(e,t,n,r){return n*e/r+t}}})),Ri=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;var t=xi(),n=Si(),r=Oi(),i=ki(),a=ji(),o=Ni(),s=Pi(),c=Fi(),l=Ti(),u=Mi(),d=Ii(),f=Li(),p=Ci(),m=wi();e.Konva=n.Util._assign(t.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:i.Container,Stage:a.Stage,stages:a.stages,Layer:o.Layer,FastLayer:s.FastLayer,Group:c.Group,DD:l.DD,Shape:u.Shape,shapes:u.shapes,Animation:d.Animation,Tween:f.Tween,Easings:f.Easings,Context:p.Context,Canvas:m.Canvas}),e.default=e.Konva})),zi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Arc=void 0;var t=Di(),n=Mi(),r=xi(),i=Ei(),a=xi(),o=class extends n.Shape{_sceneFunc(e){let t=r.Konva.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,t,n),e.arc(0,0,this.innerRadius(),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){let e=this.innerRadius(),t=this.outerRadius(),n=this.clockwise(),i=r.Konva.getAngle(n?360-this.angle():this.angle()),a=Math.cos(Math.min(i,Math.PI)),o=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),s=Math.sin(Math.min(i,Math.PI/2)),c=a*(a>0?e:t),l=1*t,u=o*(o>0?e:t),d=s*(s>0?t:e);return{x:c,y:n?-1*d:u,width:l-c,height:d-u}}};e.Arc=o,o.prototype._centroid=!0,o.prototype.className=`Arc`,o.prototype._attrsAffectingSize=[`innerRadius`,`outerRadius`,`angle`,`clockwise`],(0,a._registerNode)(o),t.Factory.addGetterSetter(o,`innerRadius`,0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(o,`outerRadius`,0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(o,`angle`,0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(o,`clockwise`,!1,(0,i.getBooleanValidator)())})),Bi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Line=void 0;var t=Di(),n=xi(),r=Mi(),i=Ei();function a(e,t,n,r,i,a,o){let s=Math.sqrt((n-e)**2+(r-t)**2),c=Math.sqrt((i-n)**2+(a-r)**2),l=o*s/(s+c),u=o*c/(s+c);return[n-l*(i-e),r-l*(a-t),n+u*(i-e),r+u*(a-t)]}function o(e,t){let n=e.length,r=[];for(let i=2;i<n-2;i+=2){let n=a(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t);isNaN(n[0])||(r.push(n[0]),r.push(n[1]),r.push(e[i]),r.push(e[i+1]),r.push(n[2]),r.push(n[3]))}return r}var s=class extends r.Shape{constructor(e){super(e),this.on(`pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva`,function(){this._clearCache(`tensionPoints`)})}_sceneFunc(e){let t=this.points(),n=t.length,r=this.tension(),i=this.closed(),a=this.bezier();if(!n)return;let o=0;if(e.beginPath(),e.moveTo(t[0],t[1]),r!==0&&n>4){let r=this.getTensionPoints(),a=r.length;for(o=i?0:4,i||e.quadraticCurveTo(r[0],r[1],r[2],r[3]);o<a-2;)e.bezierCurveTo(r[o++],r[o++],r[o++],r[o++],r[o++],r[o++]);i||e.quadraticCurveTo(r[a-2],r[a-1],t[n-2],t[n-1])}else if(a)for(o=2;o<n;)e.bezierCurveTo(t[o++],t[o++],t[o++],t[o++],t[o++],t[o++]);else for(o=2;o<n;o+=2)e.lineTo(t[o],t[o+1]);i?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache(`tensionPoints`,this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():o(this.points(),this.tension())}_getTensionPointsClosed(){let e=this.points(),t=e.length,n=this.tension(),r=a(e[t-2],e[t-1],e[0],e[1],e[2],e[3],n),i=a(e[t-4],e[t-3],e[t-2],e[t-1],e[0],e[1],n),s=o(e,n);return[r[2],r[3]].concat(s,[i[0],i[1],e[t-2],e[t-1],i[2],i[3],r[0],r[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};e=this.tension()===0?this.points():[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]];let t=e[0],n=e[0],r=e[1],i=e[1],a,o;for(let s=0;s<e.length/2;s++)a=e[s*2],o=e[s*2+1],t=Math.min(t,a),n=Math.max(n,a),r=Math.min(r,o),i=Math.max(i,o);return{x:t,y:r,width:n-t,height:i-r}}};e.Line=s,s.prototype.className=`Line`,s.prototype._attrsAffectingSize=[`points`,`bezier`,`tension`],(0,n._registerNode)(s),t.Factory.addGetterSetter(s,`closed`,!1),t.Factory.addGetterSetter(s,`bezier`,!1),t.Factory.addGetterSetter(s,`tension`,0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(s,`points`,[],(0,i.getNumberArrayValidator)())})),Vi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]],e.getCubicArcLength=(n,r,i)=>{let a,o,s=i/2;a=0;for(let i=0;i<20;i++)o=s*e.tValues[20][i]+s,a+=e.cValues[20][i]*t(n,r,o);return s*a},e.getQuadraticArcLength=(e,t,n)=>{n===void 0&&(n=1);let r=e[0]-2*e[1]+e[2],i=t[0]-2*t[1]+t[2],a=2*e[1]-2*e[0],o=2*t[1]-2*t[0],s=4*(r*r+i*i),c=4*(r*a+i*o),l=a*a+o*o;if(s===0)return n*Math.sqrt((e[2]-e[0])**2+(t[2]-t[0])**2);let u=c/(2*s),d=l/s,f=n+u,p=d-u*u,m=f*f+p>0?Math.sqrt(f*f+p):0,h=u*u+p>0?Math.sqrt(u*u+p):0,g=u+Math.sqrt(u*u+p)===0?0:p*Math.log(Math.abs((f+m)/(u+h)));return Math.sqrt(s)/2*(f*m-u*h+g)};function t(e,t,r){let i=n(1,r,e),a=n(1,r,t),o=i*i+a*a;return Math.sqrt(o)}var n=(t,r,i)=>{let a=i.length-1,o,s;if(a===0)return 0;if(t===0){s=0;for(let t=0;t<=a;t++)s+=e.binomialCoefficients[a][t]*(1-r)**(a-t)*r**+t*i[t];return s}o=Array(a);for(let e=0;e<a;e++)o[e]=a*(i[e+1]-i[e]);return n(t-1,r,o)};e.t2length=(e,t,n)=>{let r=1,i=e/t,a=(e-n(i))/t,o=0;for(;r>.001;){let s=n(i+a),c=Math.abs(e-s)/t;if(c<r)r=c,i+=a;else{let o=n(i-a),s=Math.abs(e-o)/t;s<r?(r=s,i-=a):a/=2}if(o++,o>500)break}return i}})),Hi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Path=void 0;var t=Di(),n=xi(),r=Mi(),i=Vi(),a=class e extends r.Shape{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on(`dataChange.konva`,function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=e.parsePathData(this.data()),this.pathLength=e.getPathLength(this.dataArray)}_sceneFunc(e){let t=this.dataArray;e.beginPath();let n=!1;for(let r=0;r<t.length;r++){let i=t[r].command,a=t[r].points;switch(i){case`L`:e.lineTo(a[0],a[1]);break;case`M`:e.moveTo(a[0],a[1]);break;case`C`:e.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case`Q`:e.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case`A`:let t=a[0],r=a[1],i=a[2],o=a[3],s=a[4],c=a[5],l=a[6],u=a[7],d=i>o?i:o,f=i>o?1:i/o,p=i>o?o/i:1;e.translate(t,r),e.rotate(l),e.scale(f,p),e.arc(0,0,d,s,s+c,1-u),e.scale(1/f,1/p),e.rotate(-l),e.translate(-t,-r);break;case`z`:n=!0,e.closePath()}}!n&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let t=[];this.dataArray.forEach(function(n){if(n.command===`A`){let r=n.points[4],i=n.points[5],a=n.points[4]+i,o=Math.PI/180;if(Math.abs(r-a)<o&&(o=Math.abs(r-a)),i<0)for(let i=r-o;i>a;i-=o){let r=e.getPointOnEllipticalArc(n.points[0],n.points[1],n.points[2],n.points[3],i,0);t.push(r.x,r.y)}else for(let i=r+o;i<a;i+=o){let r=e.getPointOnEllipticalArc(n.points[0],n.points[1],n.points[2],n.points[3],i,0);t.push(r.x,r.y)}}else if(n.command===`C`)for(let r=0;r<=1;r+=.01){let i=e.getPointOnCubicBezier(r,n.start.x,n.start.y,n.points[0],n.points[1],n.points[2],n.points[3],n.points[4],n.points[5]);t.push(i.x,i.y)}else t=t.concat(n.points)});let n=t[0],r=t[0],i=t[1],a=t[1],o,s;for(let e=0;e<t.length/2;e++)o=t[e*2],s=t[e*2+1],isNaN(o)||(n=Math.min(n,o),r=Math.max(r,o)),isNaN(s)||(i=Math.min(i,s),a=Math.max(a,s));return{x:n,y:i,width:r-n,height:a-i}}getLength(){return this.pathLength}getPointAtLength(t){return e.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}static getPathLength(e){let t=0;for(let n=0;n<e.length;++n)t+=e[n].pathLength;return t}static getPointAtLengthOfDataArray(t,n){let r,a=0,o=n.length;if(!o)return null;for(;a<o&&t>n[a].pathLength;)t-=n[a].pathLength,++a;if(a===o)return r=n[a-1].points.slice(-2),{x:r[0],y:r[1]};if(t<.01)return n[a].command===`M`?(r=n[a].points.slice(0,2),{x:r[0],y:r[1]}):{x:n[a].start.x,y:n[a].start.y};let s=n[a],c=s.points;switch(s.command){case`L`:return e.getPointOnLine(t,s.start.x,s.start.y,c[0],c[1]);case`C`:return e.getPointOnCubicBezier((0,i.t2length)(t,e.getPathLength(n),e=>(0,i.getCubicArcLength)([s.start.x,c[0],c[2],c[4]],[s.start.y,c[1],c[3],c[5]],e)),s.start.x,s.start.y,c[0],c[1],c[2],c[3],c[4],c[5]);case`Q`:return e.getPointOnQuadraticBezier((0,i.t2length)(t,e.getPathLength(n),e=>(0,i.getQuadraticArcLength)([s.start.x,c[0],c[2]],[s.start.y,c[1],c[3]],e)),s.start.x,s.start.y,c[0],c[1],c[2],c[3]);case`A`:let r=c[0],a=c[1],o=c[2],l=c[3],u=c[5],d=c[6],f=c[4];return f+=u*t/s.pathLength,e.getPointOnEllipticalArc(r,a,o,l,f,d)}return null}static getPointOnLine(e,t,n,r,i,a,o){a??=t,o??=n;let s=this.getLineLength(t,n,r,i);if(s<1e-10)return{x:t,y:n};if(r===t)return{x:a,y:o+(i>n?e:-e)};let c=(i-n)/(r-t),l=Math.sqrt(e*e/(1+c*c))*(r<t?-1:1),u=c*l;if(Math.abs(o-n-c*(a-t))<1e-10)return{x:a+l,y:o+u};let d=((a-t)*(r-t)+(o-n)*(i-n))/(s*s),f=t+d*(r-t),p=n+d*(i-n),m=this.getLineLength(a,o,f,p),h=Math.sqrt(e*e-m*m),g=Math.sqrt(h*h/(1+c*c))*(r<t?-1:1),_=c*g;return{x:f+g,y:p+_}}static getPointOnCubicBezier(e,t,n,r,i,a,o,s,c){function l(e){return e*e*e}function u(e){return 3*e*e*(1-e)}function d(e){return 3*e*(1-e)*(1-e)}function f(e){return(1-e)*(1-e)*(1-e)}return{x:s*l(e)+a*u(e)+r*d(e)+t*f(e),y:c*l(e)+o*u(e)+i*d(e)+n*f(e)}}static getPointOnQuadraticBezier(e,t,n,r,i,a,o){function s(e){return e*e}function c(e){return 2*e*(1-e)}function l(e){return(1-e)*(1-e)}return{x:a*s(e)+r*c(e)+t*l(e),y:o*s(e)+i*c(e)+n*l(e)}}static getPointOnEllipticalArc(e,t,n,r,i,a){let o=Math.cos(a),s=Math.sin(a),c={x:n*Math.cos(i),y:r*Math.sin(i)};return{x:e+(c.x*o-c.y*s),y:t+(c.x*s+c.y*o)}}static parsePathData(e){if(!e)return[];let t=e,n=[`m`,`M`,`l`,`L`,`v`,`V`,`h`,`H`,`z`,`Z`,`c`,`C`,`q`,`Q`,`t`,`T`,`s`,`S`,`a`,`A`];t=t.replace(RegExp(` `,`g`),`,`);for(let e=0;e<n.length;e++)t=t.replace(new RegExp(n[e],`g`),`|`+n[e]);let r=t.split(`|`),i=[],a=[],o=0,s=0,c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,l;for(let e=1;e<r.length;e++){let t=r[e],n=t.charAt(0);for(t=t.slice(1),a.length=0;l=c.exec(t);)a.push(l[0]);let u=[];for(let e=0,t=a.length;e<t;e++){if(a[e]===`00`){u.push(0,0);continue}let t=parseFloat(a[e]);isNaN(t)?u.push(0):u.push(t)}for(;u.length>0&&!isNaN(u[0]);){let e=``,t=[],r=o,a=s,c,l,d,f,p,m,h,g,_,v;switch(n){case`l`:o+=u.shift(),s+=u.shift(),e=`L`,t.push(o,s);break;case`L`:o=u.shift(),s=u.shift(),t.push(o,s);break;case`m`:let r=u.shift(),a=u.shift();if(o+=r,s+=a,e=`M`,i.length>2&&i[i.length-1].command===`z`){for(let e=i.length-2;e>=0;e--)if(i[e].command===`M`){o=i[e].points[0]+r,s=i[e].points[1]+a;break}}t.push(o,s),n=`l`;break;case`M`:o=u.shift(),s=u.shift(),e=`M`,t.push(o,s),n=`L`;break;case`h`:o+=u.shift(),e=`L`,t.push(o,s);break;case`H`:o=u.shift(),e=`L`,t.push(o,s);break;case`v`:s+=u.shift(),e=`L`,t.push(o,s);break;case`V`:s=u.shift(),e=`L`,t.push(o,s);break;case`C`:t.push(u.shift(),u.shift(),u.shift(),u.shift()),o=u.shift(),s=u.shift(),t.push(o,s);break;case`c`:t.push(o+u.shift(),s+u.shift(),o+u.shift(),s+u.shift()),o+=u.shift(),s+=u.shift(),e=`C`,t.push(o,s);break;case`S`:l=o,d=s,c=i[i.length-1],c.command===`C`&&(l=o+(o-c.points[2]),d=s+(s-c.points[3])),t.push(l,d,u.shift(),u.shift()),o=u.shift(),s=u.shift(),e=`C`,t.push(o,s);break;case`s`:l=o,d=s,c=i[i.length-1],c.command===`C`&&(l=o+(o-c.points[2]),d=s+(s-c.points[3])),t.push(l,d,o+u.shift(),s+u.shift()),o+=u.shift(),s+=u.shift(),e=`C`,t.push(o,s);break;case`Q`:t.push(u.shift(),u.shift()),o=u.shift(),s=u.shift(),t.push(o,s);break;case`q`:t.push(o+u.shift(),s+u.shift()),o+=u.shift(),s+=u.shift(),e=`Q`,t.push(o,s);break;case`T`:l=o,d=s,c=i[i.length-1],c.command===`Q`&&(l=o+(o-c.points[0]),d=s+(s-c.points[1])),o=u.shift(),s=u.shift(),e=`Q`,t.push(l,d,o,s);break;case`t`:l=o,d=s,c=i[i.length-1],c.command===`Q`&&(l=o+(o-c.points[0]),d=s+(s-c.points[1])),o+=u.shift(),s+=u.shift(),e=`Q`,t.push(l,d,o,s);break;case`A`:f=u.shift(),p=u.shift(),m=u.shift(),h=u.shift(),g=u.shift(),_=o,v=s,o=u.shift(),s=u.shift(),e=`A`,t=this.convertEndpointToCenterParameterization(_,v,o,s,h,g,f,p,m);break;case`a`:f=u.shift(),p=u.shift(),m=u.shift(),h=u.shift(),g=u.shift(),_=o,v=s,o+=u.shift(),s+=u.shift(),e=`A`,t=this.convertEndpointToCenterParameterization(_,v,o,s,h,g,f,p,m)}i.push({command:e||n,points:t,start:{x:r,y:a},pathLength:this.calcLength(r,a,e||n,t)})}(n===`z`||n===`Z`)&&i.push({command:`z`,points:[],start:void 0,pathLength:0})}return i}static calcLength(t,n,r,a){let o,s,c,l,u=e;switch(r){case`L`:return u.getLineLength(t,n,a[0],a[1]);case`C`:return(0,i.getCubicArcLength)([t,a[0],a[2],a[4]],[n,a[1],a[3],a[5]],1);case`Q`:return(0,i.getQuadraticArcLength)([t,a[0],a[2]],[n,a[1],a[3]],1);case`A`:o=0;let e=a[4],r=a[5],d=a[4]+r,f=Math.PI/180;if(Math.abs(e-d)<f&&(f=Math.abs(e-d)),s=u.getPointOnEllipticalArc(a[0],a[1],a[2],a[3],e,0),r<0)for(l=e-f;l>d;l-=f)c=u.getPointOnEllipticalArc(a[0],a[1],a[2],a[3],l,0),o+=u.getLineLength(s.x,s.y,c.x,c.y),s=c;else for(l=e+f;l<d;l+=f)c=u.getPointOnEllipticalArc(a[0],a[1],a[2],a[3],l,0),o+=u.getLineLength(s.x,s.y,c.x,c.y),s=c;return c=u.getPointOnEllipticalArc(a[0],a[1],a[2],a[3],d,0),o+=u.getLineLength(s.x,s.y,c.x,c.y),o}return 0}static convertEndpointToCenterParameterization(e,t,n,r,i,a,o,s,c){let l=Math.PI/180*c,u=Math.cos(l)*(e-n)/2+Math.sin(l)*(t-r)/2,d=-1*Math.sin(l)*(e-n)/2+Math.cos(l)*(t-r)/2,f=u*u/(o*o)+d*d/(s*s);f>1&&(o*=Math.sqrt(f),s*=Math.sqrt(f));let p=Math.sqrt((o*o*(s*s)-o*o*(d*d)-s*s*(u*u))/(o*o*(d*d)+s*s*(u*u)));i===a&&(p*=-1),isNaN(p)&&(p=0);let m=p*o*d/s,h=p*-s*u/o,g=(e+n)/2+Math.cos(l)*m-Math.sin(l)*h,_=(t+r)/2+Math.sin(l)*m+Math.cos(l)*h,v=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},y=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(v(e)*v(t))},b=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(y(e,t))},x=b([1,0],[(u-m)/o,(d-h)/s]),S=[(u-m)/o,(d-h)/s],C=[(-1*u-m)/o,(-1*d-h)/s],w=b(S,C);return y(S,C)<=-1&&(w=Math.PI),y(S,C)>=1&&(w=0),a===0&&w>0&&(w-=2*Math.PI),a===1&&w<0&&(w+=2*Math.PI),[g,_,o,s,x,w,l,a]}};e.Path=a,a.prototype.className=`Path`,a.prototype._attrsAffectingSize=[`data`],(0,n._registerNode)(a),t.Factory.addGetterSetter(a,`data`)})),Ui=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Arrow=void 0;var t=Di(),n=Bi(),r=Ei(),i=xi(),a=Hi(),o=class extends n.Line{_sceneFunc(e){super._sceneFunc(e);let t=Math.PI*2,n=this.points(),r=n,i=this.tension()!==0&&n.length>4;i&&(r=this.getTensionPoints());let o=this.pointerLength(),s=n.length,c,l;if(i){let e=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[s-2],n[s-1]],t=a.Path.calcLength(r[r.length-4],r[r.length-3],`C`,e),i=a.Path.getPointOnQuadraticBezier(Math.min(1,1-o/t),e[0],e[1],e[2],e[3],e[4],e[5]);c=n[s-2]-i.x,l=n[s-1]-i.y}else c=n[s-2]-n[s-4],l=n[s-1]-n[s-3];let u=(Math.atan2(l,c)+t)%t,d=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[s-2],n[s-1]),e.rotate(u),e.moveTo(0,0),e.lineTo(-o,d/2),e.lineTo(-o,-d/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),i?(c=(r[0]+r[2])/2-n[0],l=(r[1]+r[3])/2-n[1]):(c=n[2]-n[0],l=n[3]-n[1]),e.rotate((Math.atan2(-l,-c)+t)%t),e.moveTo(0,0),e.lineTo(-o,d/2),e.lineTo(-o,-d/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){let t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){let e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x,y:e.y-t,width:e.width,height:e.height+t*2}}};e.Arrow=o,o.prototype.className=`Arrow`,(0,i._registerNode)(o),t.Factory.addGetterSetter(o,`pointerLength`,10,(0,r.getNumberValidator)()),t.Factory.addGetterSetter(o,`pointerWidth`,10,(0,r.getNumberValidator)()),t.Factory.addGetterSetter(o,`pointerAtBeginning`,!1),t.Factory.addGetterSetter(o,`pointerAtEnding`,!0)})),Wi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Circle=void 0;var t=Di(),n=Mi(),r=Ei(),i=xi(),a=class extends n.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};e.Circle=a,a.prototype._centroid=!0,a.prototype.className=`Circle`,a.prototype._attrsAffectingSize=[`radius`],(0,i._registerNode)(a),t.Factory.addGetterSetter(a,`radius`,0,(0,r.getNumberValidator)())})),Gi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Ellipse=void 0;var t=Di(),n=Mi(),r=Ei(),i=xi(),a=class extends n.Shape{_sceneFunc(e){let t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}};e.Ellipse=a,a.prototype.className=`Ellipse`,a.prototype._centroid=!0,a.prototype._attrsAffectingSize=[`radiusX`,`radiusY`],(0,i._registerNode)(a),t.Factory.addComponentsGetterSetter(a,`radius`,[`x`,`y`]),t.Factory.addGetterSetter(a,`radiusX`,0,(0,r.getNumberValidator)()),t.Factory.addGetterSetter(a,`radiusY`,0,(0,r.getNumberValidator)())})),Ki=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Image=void 0;var t=Si(),n=Di(),r=Mi(),i=xi(),a=Ei(),o=class e extends r.Shape{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on(`imageChange.konva`,e=>{this._removeImageLoad(e.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){let e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener(`load`,this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener(`load`,this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){let e=!!this.cornerRadius(),t=this.hasShadow();return e&&t?!0:super._useBufferCanvas(!0)}_sceneFunc(e){let n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image,o;if(a){let e=this.attrs.cropWidth,t=this.attrs.cropHeight;o=e&&t?[a,this.cropX(),this.cropY(),e,t,0,0,n,r]:[a,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?t.Util.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),a&&(i&&e.clip(),e.drawImage.apply(e,o))}_hitFunc(e){let n=this.width(),r=this.height(),i=this.cornerRadius();e.beginPath(),i?t.Util.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.attrs.width??this.image()?.width}getHeight(){return this.attrs.height??this.image()?.height}static fromURL(n,r,i=null){let a=t.Util.createImageElement();a.onload=function(){r(new e({image:a}))},a.onerror=i,a.crossOrigin=`Anonymous`,a.src=n}};e.Image=o,o.prototype.className=`Image`,(0,i._registerNode)(o),n.Factory.addGetterSetter(o,`cornerRadius`,0,(0,a.getNumberOrArrayOfNumbersValidator)(4)),n.Factory.addGetterSetter(o,`image`),n.Factory.addComponentsGetterSetter(o,`crop`,[`x`,`y`,`width`,`height`]),n.Factory.addGetterSetter(o,`cropX`,0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(o,`cropY`,0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(o,`cropWidth`,0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(o,`cropHeight`,0,(0,a.getNumberValidator)())})),qi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Tag=e.Label=void 0;var t=Di(),n=Mi(),r=Fi(),i=Ei(),a=xi(),o=[`fontFamily`,`fontSize`,`fontStyle`,`padding`,`lineHeight`,`text`,`width`,`height`,`pointerDirection`,`pointerWidth`,`pointerHeight`],s=`Change.konva`,c=`none`,l=`up`,u=`right`,d=`down`,f=`left`,p=o.length,m=class extends r.Group{constructor(e){super(e),this.on(`add.konva`,function(e){this._addListeners(e.child),this._sync()})}getText(){return this.find(`Text`)[0]}getTag(){return this.find(`Tag`)[0]}_addListeners(e){let t=this,n,r=function(){t._sync()};for(n=0;n<p;n++)e.on(o[n]+s,r)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),t=this.getTag(),n,r,i,a,o,s,c;if(e&&t){switch(n=e.width(),r=e.height(),i=t.pointerDirection(),a=t.pointerWidth(),c=t.pointerHeight(),o=0,s=0,i){case l:o=n/2,s=-1*c;break;case u:o=n+a,s=r/2;break;case d:o=n/2,s=r+c;break;case f:o=-1*a,s=r/2}t.setAttrs({x:-1*o,y:-1*s,width:n,height:r}),e.setAttrs({x:-1*o,y:-1*s})}}};e.Label=m,m.prototype.className=`Label`,(0,a._registerNode)(m);var h=class extends n.Shape{_sceneFunc(e){let t=this.width(),n=this.height(),r=this.pointerDirection(),i=this.pointerWidth(),a=this.pointerHeight(),o=this.cornerRadius(),s=0,c=0,p=0,m=0;typeof o==`number`?s=c=p=m=Math.min(o,t/2,n/2):(s=Math.min(o[0]||0,t/2,n/2),c=Math.min(o[1]||0,t/2,n/2),m=Math.min(o[2]||0,t/2,n/2),p=Math.min(o[3]||0,t/2,n/2)),e.beginPath(),e.moveTo(s,0),r===l&&(e.lineTo((t-i)/2,0),e.lineTo(t/2,-1*a),e.lineTo((t+i)/2,0)),e.lineTo(t-c,0),e.arc(t-c,c,c,Math.PI*3/2,0,!1),r===u&&(e.lineTo(t,(n-a)/2),e.lineTo(t+i,n/2),e.lineTo(t,(n+a)/2)),e.lineTo(t,n-m),e.arc(t-m,n-m,m,0,Math.PI/2,!1),r===d&&(e.lineTo((t+i)/2,n),e.lineTo(t/2,n+a),e.lineTo((t-i)/2,n)),e.lineTo(p,n),e.arc(p,n-p,p,Math.PI/2,Math.PI,!1),r===f&&(e.lineTo(0,(n+a)/2),e.lineTo(-1*i,n/2),e.lineTo(0,(n-a)/2)),e.lineTo(0,s),e.arc(s,s,s,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,t=0,n=this.pointerWidth(),r=this.pointerHeight(),i=this.pointerDirection(),a=this.width(),o=this.height();return i===l?(t-=r,o+=r):i===d?o+=r:i===f?(e-=n*1.5,a+=n):i===u&&(a+=n*1.5),{x:e,y:t,width:a,height:o}}};e.Tag=h,h.prototype.className=`Tag`,(0,a._registerNode)(h),t.Factory.addGetterSetter(h,`pointerDirection`,c),t.Factory.addGetterSetter(h,`pointerWidth`,0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(h,`pointerHeight`,0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(h,`cornerRadius`,0,(0,i.getNumberOrArrayOfNumbersValidator)(4))})),Ji=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Rect=void 0;var t=Di(),n=Mi(),r=xi(),i=Si(),a=Ei(),o=class extends n.Shape{_sceneFunc(e){let t=this.cornerRadius(),n=this.width(),r=this.height();e.beginPath(),t?i.Util.drawRoundedRectPath(e,n,r,t):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}};e.Rect=o,o.prototype.className=`Rect`,(0,r._registerNode)(o),t.Factory.addGetterSetter(o,`cornerRadius`,0,(0,a.getNumberOrArrayOfNumbersValidator)(4))})),Yi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RegularPolygon=void 0;var t=Di(),n=Mi(),r=Ei(),i=xi(),a=class extends n.Shape{_sceneFunc(e){let t=this._getPoints();e.beginPath(),e.moveTo(t[0].x,t[0].y);for(let n=1;n<t.length;n++)e.lineTo(t[n].x,t[n].y);e.closePath(),e.fillStrokeShape(this)}_getPoints(){let e=this.attrs.sides,t=this.attrs.radius||0,n=[];for(let r=0;r<e;r++)n.push({x:t*Math.sin(r*2*Math.PI/e),y:-1*t*Math.cos(r*2*Math.PI/e)});return n}getSelfRect(){let e=this._getPoints(),t=e[0].x,n=e[0].y,r=e[0].x,i=e[0].y;return e.forEach(e=>{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.y)}),{x:t,y:r,width:n-t,height:i-r}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};e.RegularPolygon=a,a.prototype.className=`RegularPolygon`,a.prototype._centroid=!0,a.prototype._attrsAffectingSize=[`radius`],(0,i._registerNode)(a),t.Factory.addGetterSetter(a,`radius`,0,(0,r.getNumberValidator)()),t.Factory.addGetterSetter(a,`sides`,0,(0,r.getNumberValidator)())})),Xi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Ring=void 0;var t=Di(),n=Mi(),r=Ei(),i=xi(),a=Math.PI*2,o=class extends n.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,a,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),a,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};e.Ring=o,o.prototype.className=`Ring`,o.prototype._centroid=!0,o.prototype._attrsAffectingSize=[`innerRadius`,`outerRadius`],(0,i._registerNode)(o),t.Factory.addGetterSetter(o,`innerRadius`,0,(0,r.getNumberValidator)()),t.Factory.addGetterSetter(o,`outerRadius`,0,(0,r.getNumberValidator)())})),Zi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Sprite=void 0;var t=Di(),n=Mi(),r=Ii(),i=Ei(),a=xi(),o=class extends n.Shape{constructor(e){super(e),this._updated=!0,this.anim=new r.Animation(()=>{let e=this._updated;return this._updated=!1,e}),this.on(`animationChange.konva`,function(){this.frameIndex(0)}),this.on(`frameIndexChange.konva`,function(){this._updated=!0}),this.on(`frameRateChange.konva`,function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){let t=this.animation(),n=this.frameIndex(),r=n*4,i=this.animations()[t],a=this.frameOffsets(),o=i[r+0],s=i[r+1],c=i[r+2],l=i[r+3],u=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,c,l),e.closePath(),e.fillStrokeShape(this)),u){if(a){let r=a[t],i=n*2;e.drawImage(u,o,s,c,l,r[i+0],r[i+1],c,l)}else e.drawImage(u,o,s,c,l,0,0,c,l)}}_hitFunc(e){let t=this.animation(),n=this.frameIndex(),r=n*4,i=this.animations()[t],a=this.frameOffsets(),o=i[r+2],s=i[r+3];if(e.beginPath(),a){let r=a[t],i=n*2;e.rect(r[i+0],r[i+1],o,s)}else e.rect(0,0,o,s);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){let e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;let e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){let e=this.frameIndex(),t=this.animation();e<this.animations()[t].length/4-1?this.frameIndex(e+1):this.frameIndex(0)}};e.Sprite=o,o.prototype.className=`Sprite`,(0,a._registerNode)(o),t.Factory.addGetterSetter(o,`animation`),t.Factory.addGetterSetter(o,`animations`),t.Factory.addGetterSetter(o,`frameOffsets`),t.Factory.addGetterSetter(o,`image`),t.Factory.addGetterSetter(o,`frameIndex`,0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(o,`frameRate`,17,(0,i.getNumberValidator)()),t.Factory.backCompat(o,{index:`frameIndex`,getIndex:`getFrameIndex`,setIndex:`setFrameIndex`})})),Qi=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Star=void 0;var t=Di(),n=Mi(),r=Ei(),i=xi(),a=class extends n.Shape{_sceneFunc(e){let t=this.innerRadius(),n=this.outerRadius(),r=this.numPoints();e.beginPath(),e.moveTo(0,0-n);for(let i=1;i<r*2;i++){let a=i%2==0?n:t,o=a*Math.sin(i*Math.PI/r),s=-1*a*Math.cos(i*Math.PI/r);e.lineTo(o,s)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}};e.Star=a,a.prototype.className=`Star`,a.prototype._centroid=!0,a.prototype._attrsAffectingSize=[`innerRadius`,`outerRadius`],(0,i._registerNode)(a),t.Factory.addGetterSetter(a,`numPoints`,5,(0,r.getNumberValidator)()),t.Factory.addGetterSetter(a,`innerRadius`,0,(0,r.getNumberValidator)()),t.Factory.addGetterSetter(a,`outerRadius`,0,(0,r.getNumberValidator)())})),$i=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Text=void 0,e.stringToArray=s;var t=Si(),n=Di(),r=Mi(),i=xi(),a=Ei(),o=xi();function s(e){return[...e].reduce((e,t,n,r)=>{if(/\p{Emoji}/u.test(t)){let i=r[n+1];i&&/\p{Emoji_Modifier}|\u200D/u.test(i)?(e.push(t+i),r[n+1]=``):e.push(t)}else/\p{Regional_Indicator}{2}/u.test(t+(r[n+1]||``))?e.push(t+r[n+1]):n>0&&/\p{Mn}|\p{Me}|\p{Mc}/u.test(t)?e[e.length-1]+=t:t&&e.push(t);return e},[])}var c=`auto`,l=`center`,u=`inherit`,d=`justify`,f=`Change.konva`,p=`2d`,m=`-`,h=`left`,g=`text`,_=`Text`,v=`top`,y=`bottom`,b=`middle`,x=`normal`,S=`px `,C=` `,w=`right`,T=`rtl`,E=`word`,D=`char`,O=`none`,k=`…`,A=[`direction`,`fontFamily`,`fontSize`,`fontStyle`,`fontVariant`,`padding`,`align`,`verticalAlign`,`lineHeight`,`text`,`width`,`height`,`wrap`,`ellipsis`,`letterSpacing`],j=A.length;function M(e){return e.split(`,`).map(e=>{e=e.trim();let t=e.indexOf(` `)>=0,n=e.indexOf(`"`)>=0||e.indexOf(`'`)>=0;return t&&!n&&(e=`"${e}"`),e}).join(`, `)}var ee;function N(){return ee||(ee=t.Util.createCanvasElement().getContext(p),ee)}function P(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function F(e){e.setAttr(`miterLimit`,2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function I(e){return e||={},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||`black`),e}var L=class extends r.Shape{constructor(e){super(I(e)),this._partialTextX=0,this._partialTextY=0;for(let e=0;e<j;e++)this.on(A[e]+f,this._setTextData);this._setTextData()}_sceneFunc(e){let t=this.textArr,n=t.length;if(!this.text())return;let r=this.padding(),a=this.fontSize(),o=this.lineHeight()*a,c=this.verticalAlign(),f=this.direction(),p=0,m=this.align(),g=this.getWidth(),_=this.letterSpacing(),v=this.fill(),x=this.textDecoration(),S=x.indexOf(`underline`)!==-1,C=x.indexOf(`line-through`)!==-1,E;f=f===u?e.direction:f;let D=o/2,O=b;if(i.Konva._fixTextRendering){let e=this.measureSize(`M`);O=`alphabetic`,D=(e.fontBoundingBoxAscent-e.fontBoundingBoxDescent)/2+o/2}for(f===T&&e.setAttr(`direction`,f),e.setAttr(`font`,this._getContextFont()),e.setAttr(`textBaseline`,O),e.setAttr(`textAlign`,h),c===b?p=(this.getHeight()-n*o-r*2)/2:c===y&&(p=this.getHeight()-n*o-r*2),e.translate(r,p+r),E=0;E<n;E++){let c=0,u=t[E],p=u.text,h=u.width,y=u.lastInParagraph;if(e.save(),m===w?c+=g-h-r*2:m===l&&(c+=(g-h-r*2)/2),S){e.save(),e.beginPath();let t=i.Konva._fixTextRendering?Math.round(a/4):Math.round(a/2),n=c,o=D+0+t;e.moveTo(n,o);let s=m===d&&!y?g-r*2:h;e.lineTo(n+Math.round(s),o),e.lineWidth=a/15,e.strokeStyle=this._getLinearGradient()||v,e.stroke(),e.restore()}if(C){e.save(),e.beginPath();let t=i.Konva._fixTextRendering?-Math.round(a/4):0;e.moveTo(c,D+0+t);let n=m===d&&!y?g-r*2:h;e.lineTo(c+Math.round(n),D+0+t),e.lineWidth=a/15,e.strokeStyle=this._getLinearGradient()||v,e.stroke(),e.restore()}if(f!==T&&(_!==0||m===d)){let t=p.split(` `).length-1,n=s(p);for(let i=0;i<n.length;i++){let a=n[i];a===` `&&!y&&m===d&&(c+=(g-r*2-h)/t),this._partialTextX=c,this._partialTextY=D+0,this._partialText=a,e.fillStrokeShape(this),c+=this.measureSize(a).width+_}}else _!==0&&e.setAttr(`letterSpacing`,`${_}px`),this._partialTextX=c,this._partialTextY=D+0,this._partialText=p,e.fillStrokeShape(this);e.restore(),n>1&&(D+=o)}}_hitFunc(e){let t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){let n=t.Util._isString(e)?e:e==null?``:e+``;return this._setAttr(g,n),this}getWidth(){return this.attrs.width===c||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===c||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return t.Util.warn(`text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.`),this.textHeight}measureSize(e){let t=N(),n=this.fontSize(),r;t.save(),t.font=this._getContextFont(),r=t.measureText(e),t.restore();let i=n/100;return{actualBoundingBoxAscent:r.actualBoundingBoxAscent??71.58203125*i,actualBoundingBoxDescent:r.actualBoundingBoxDescent??0,actualBoundingBoxLeft:r.actualBoundingBoxLeft??-7.421875*i,actualBoundingBoxRight:r.actualBoundingBoxRight??75.732421875*i,alphabeticBaseline:r.alphabeticBaseline??0,emHeightAscent:r.emHeightAscent??100*i,emHeightDescent:r.emHeightDescent??-20*i,fontBoundingBoxAscent:r.fontBoundingBoxAscent??91*i,fontBoundingBoxDescent:r.fontBoundingBoxDescent??21*i,hangingBaseline:r.hangingBaseline??72.80000305175781*i,ideographicBaseline:r.ideographicBaseline??-21*i,width:r.width,height:n}}_getContextFont(){return this.fontStyle()+C+this.fontVariant()+C+(this.fontSize()+S)+M(this.fontFamily())}_addTextLine(e){this.align()===d&&(e=e.trim());let t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){let t=this.letterSpacing(),n=e.length;return N().measureText(e).width+t*n}_setTextData(){let e=this.text().split(`
|
|
28
|
+
`),t=+this.fontSize(),n=0,r=this.lineHeight()*t,i=this.attrs.width,a=this.attrs.height,o=i!==c&&i!==void 0,l=a!==c&&a!==void 0,u=this.padding(),d=i-u*2,f=a-u*2,p=0,h=this.wrap(),g=h!==D&&h!==O,_=this.ellipsis();this.textArr=[],N().font=this._getContextFont();let v=_?this._getTextWidth(k):0;for(let t=0,i=e.length;t<i;++t){let a=e[t],c=this._getTextWidth(a);if(o&&c>d)for(;a.length>0;){let e=0,t=s(a).length,i=``,o=0;for(;e<t;){let n=e+t>>>1,c=s(a).slice(0,n+1).join(``),u=this._getTextWidth(c);(_&&l&&p+r>f?u+v:u)<=d?(e=n+1,i=c,o=u):t=n}if(i){if(g){let t=s(a),n=s(i),r=t[n.length],c=r===C||r===m,l;if(c&&o<=d)l=n.length;else{let e=n.lastIndexOf(C),t=n.lastIndexOf(m);l=Math.max(e,t)+1}l>0&&(e=l,i=t.slice(0,e).join(``),o=this._getTextWidth(i))}if(i=i.trimRight(),this._addTextLine(i),n=Math.max(n,o),p+=r,this._shouldHandleEllipsis(p)){this._tryToAddEllipsisToLastLine();break}if(a=s(a).slice(e).join(``).trimLeft(),a.length>0&&(c=this._getTextWidth(a),c<=d)){this._addTextLine(a),p+=r,n=Math.max(n,c);break}}else break}else this._addTextLine(a),p+=r,n=Math.max(n,c),this._shouldHandleEllipsis(p)&&t<i-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),l&&p+r>f)break}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){let t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,i=r!==c&&r!==void 0,a=r-this.padding()*2;return this.wrap()===O||i&&e+n>a}_tryToAddEllipsisToLastLine(){let e=this.attrs.width,t=e!==c&&e!==void 0,n=e-this.padding()*2,r=this.ellipsis(),i=this.textArr[this.textArr.length-1];!i||!r||(t&&(this._getTextWidth(i.text+k)<n||(i.text=i.text.slice(0,i.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(i.text+k))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){let e=this.textDecoration().indexOf(`underline`)!==-1||this.textDecoration().indexOf(`line-through`)!==-1,t=this.hasShadow();return e&&t?!0:super._useBufferCanvas()}};e.Text=L,L.prototype._fillFunc=P,L.prototype._strokeFunc=F,L.prototype.className=_,L.prototype._attrsAffectingSize=[`text`,`fontSize`,`padding`,`wrap`,`lineHeight`,`letterSpacing`],(0,o._registerNode)(L),n.Factory.overWriteSetter(L,`width`,(0,a.getNumberOrAutoValidator)()),n.Factory.overWriteSetter(L,`height`,(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(L,`direction`,u),n.Factory.addGetterSetter(L,`fontFamily`,`Arial`),n.Factory.addGetterSetter(L,`fontSize`,12,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,`fontStyle`,x),n.Factory.addGetterSetter(L,`fontVariant`,x),n.Factory.addGetterSetter(L,`padding`,0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,`align`,h),n.Factory.addGetterSetter(L,`verticalAlign`,v),n.Factory.addGetterSetter(L,`lineHeight`,1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,`wrap`,E),n.Factory.addGetterSetter(L,`ellipsis`,!1,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(L,`letterSpacing`,0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,`text`,``,(0,a.getStringValidator)()),n.Factory.addGetterSetter(L,`textDecoration`,``)})),ea=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextPath=void 0;var t=Si(),n=Di(),r=Mi(),i=Hi(),a=$i(),o=Ei(),s=xi(),c=``,l=`normal`;function u(e){e.fillText(this.partialText,0,0)}function d(e){e.strokeText(this.partialText,0,0)}var f=class extends r.Shape{constructor(e){super(e),this.dummyCanvas=t.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on(`dataChange.konva`,function(){this._readDataAttribute(),this._setTextData()}),this.on(`textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva`,this._setTextData),this._setTextData()}_getTextPathLength(){return i.Path.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;let t=this.pathLength;return e-1>t?null:i.Path.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=i.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr(`font`,this._getContextFont()),e.setAttr(`textBaseline`,this.textBaseline()),e.setAttr(`textAlign`,`left`),e.save();let t=this.textDecoration(),n=this.fill(),r=this.fontSize(),i=this.glyphInfo;t===`underline`&&e.beginPath();for(let n=0;n<i.length;n++){e.save();let a=i[n].p0;e.translate(a.x,a.y),e.rotate(i[n].rotation),this.partialText=i[n].text,e.fillStrokeShape(this),t===`underline`&&(n===0&&e.moveTo(0,r/2+1),e.lineTo(r,r/2+1)),e.restore()}t===`underline`&&(e.strokeStyle=n,e.lineWidth=r/20,e.stroke()),e.restore()}_hitFunc(e){e.beginPath();let t=this.glyphInfo;if(t.length>=1){let n=t[0].p0;e.moveTo(n.x,n.y)}for(let n=0;n<t.length;n++){let r=t[n].p1;e.lineTo(r.x,r.y)}e.setAttr(`lineWidth`,this.fontSize()),e.setAttr(`strokeStyle`,this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return t.Util.warn(`text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.`),this.textHeight}setText(e){return a.Text.prototype.setText.call(this,e)}_getContextFont(){return a.Text.prototype._getContextFont.call(this)}_getTextSize(e){let t=this.dummyCanvas.getContext(`2d`);t.save(),t.font=this._getContextFont();let n=t.measureText(e);return t.restore(),{width:n.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){let{width:e,height:t}=this._getTextSize(this.attrs.text);if(this.textWidth=e,this.textHeight=t,this.glyphInfo=[],!this.attrs.data)return null;let n=this.letterSpacing(),r=this.align(),o=this.kerningFunc(),s=Math.max(this.textWidth+((this.attrs.text||``).length-1)*n,0),c=0;r===`center`&&(c=Math.max(0,this.pathLength/2-s/2)),r===`right`&&(c=Math.max(0,this.pathLength-s));let l=(0,a.stringToArray)(this.text()),u=c;for(let e=0;e<l.length;e++){let t=this._getPointAtLength(u);if(!t)return;let a=this._getTextSize(l[e]).width+n;if(l[e]===` `&&r===`justify`){let e=this.text().split(` `).length-1;a+=(this.pathLength-s)/e}let c=this._getPointAtLength(u+a);if(!c)return;let d=i.Path.getLineLength(t.x,t.y,c.x,c.y),f=0;if(o)try{f=o(l[e-1],l[e])*this.fontSize()}catch{f=0}t.x+=f,c.x+=f,this.textWidth+=f;let p=i.Path.getPointOnLine(f+d/2,t.x,t.y,c.x,c.y),m=Math.atan2(c.y-t.y,c.x-t.x);this.glyphInfo.push({transposeX:p.x,transposeY:p.y,text:l[e],rotation:m,p0:t,p1:c}),u+=a}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};let e=[];this.glyphInfo.forEach(function(t){e.push(t.p0.x),e.push(t.p0.y),e.push(t.p1.x),e.push(t.p1.y)});let t=e[0]||0,n=e[0]||0,r=e[1]||0,i=e[1]||0,a,o;for(let s=0;s<e.length/2;s++)a=e[s*2],o=e[s*2+1],t=Math.min(t,a),n=Math.max(n,a),r=Math.min(r,o),i=Math.max(i,o);let s=this.fontSize();return{x:t-s/2,y:r-s/2,width:n-t+s,height:i-r+s}}destroy(){return t.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};e.TextPath=f,f.prototype._fillFunc=u,f.prototype._strokeFunc=d,f.prototype._fillFuncHit=u,f.prototype._strokeFuncHit=d,f.prototype.className=`TextPath`,f.prototype._attrsAffectingSize=[`text`,`fontSize`,`data`],(0,s._registerNode)(f),n.Factory.addGetterSetter(f,`data`),n.Factory.addGetterSetter(f,`fontFamily`,`Arial`),n.Factory.addGetterSetter(f,`fontSize`,12,(0,o.getNumberValidator)()),n.Factory.addGetterSetter(f,`fontStyle`,l),n.Factory.addGetterSetter(f,`align`,`left`),n.Factory.addGetterSetter(f,`letterSpacing`,0,(0,o.getNumberValidator)()),n.Factory.addGetterSetter(f,`textBaseline`,`middle`),n.Factory.addGetterSetter(f,`fontVariant`,l),n.Factory.addGetterSetter(f,`text`,c),n.Factory.addGetterSetter(f,`textDecoration`,``),n.Factory.addGetterSetter(f,`kerningFunc`,void 0)})),ta=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Transformer=void 0;var t=Si(),n=Di(),r=Oi(),i=Mi(),a=Ji(),o=Fi(),s=xi(),c=Ei(),l=xi(),u=`tr-konva`,d=[`resizeEnabledChange`,`rotateAnchorOffsetChange`,`rotateEnabledChange`,`enabledAnchorsChange`,`anchorSizeChange`,`borderEnabledChange`,`borderStrokeChange`,`borderStrokeWidthChange`,`borderDashChange`,`anchorStrokeChange`,`anchorStrokeWidthChange`,`anchorFillChange`,`anchorCornerRadiusChange`,`ignoreStrokeChange`,`anchorStyleFuncChange`].map(e=>e+`.${u}`).join(` `),f=`nodesRect`,p=[`widthChange`,`heightChange`,`scaleXChange`,`scaleYChange`,`skewXChange`,`skewYChange`,`rotationChange`,`offsetXChange`,`offsetYChange`,`transformsEnabledChange`,`strokeWidthChange`],m={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},h=`ontouchstart`in s.Konva._global;function g(e,n,r){if(e===`rotater`)return r;n+=t.Util.degToRad(m[e]||0);let i=(t.Util.radToDeg(n)%360+360)%360;return t.Util._inRange(i,337.5,360)||t.Util._inRange(i,0,22.5)?`ns-resize`:t.Util._inRange(i,22.5,67.5)?`nesw-resize`:t.Util._inRange(i,67.5,112.5)?`ew-resize`:t.Util._inRange(i,112.5,157.5)?`nwse-resize`:t.Util._inRange(i,157.5,202.5)?`ns-resize`:t.Util._inRange(i,202.5,247.5)?`nesw-resize`:t.Util._inRange(i,247.5,292.5)?`ew-resize`:t.Util._inRange(i,292.5,337.5)?`nwse-resize`:(t.Util.error(`Transformer has unknown angle for cursor detection: `+i),`pointer`)}var _=[`top-left`,`top-center`,`top-right`,`middle-right`,`middle-left`,`bottom-left`,`bottom-center`,`bottom-right`];function v(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function y(e,t,n){let r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:r,y:i}}function b(e,t){return y(e,t,v(e))}function x(e,t,n){let r=t;for(let i=0;i<e.length;i++){let a=s.Konva.getAngle(e[i]),o=Math.abs(a-t)%(Math.PI*2);Math.min(o,Math.PI*2-o)<n&&(r=a)}return r}var S=0,C=class extends o.Group{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(d,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return t.Util.warn(`tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead.`),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return u+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();let n=e.filter(e=>!e.isAncestorOf(this)||(t.Util.error(`Konva.Transformer cannot be an a child of the node you are trying to attach`),!1));return this._nodes=e=n,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(e=>{let t=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(e._attrsAffectingSize.length){let n=e._attrsAffectingSize.map(e=>e+`Change.`+this._getEventNamespace()).join(` `);e.on(n,t)}e.on(p.map(e=>e+`.${this._getEventNamespace()}`).join(` `),t),e.on(`absoluteTransformChange.${this._getEventNamespace()}`,t),this._proxyDrag(e)}),this._resetTransformCache(),this.findOne(`.top-left`)&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,n=>{t=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(`.back`)&&this.startDrag(n,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!t)return;let r=e.getAbsolutePosition(),i=r.x-t.x,a=r.y-t.y;this.nodes().forEach(t=>{if(t===e||t.isDragging())return;let r=t.getAbsolutePosition();t.setAbsolutePosition({x:r.x+i,y:r.y+a}),t.startDrag(n)}),t=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off(`.`+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(f),this._clearCache(`transform`),this._clearSelfAndDescendantCache(`absoluteTransform`)}_getNodeRect(){return this._getCache(f,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){let r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),i=e.getAbsoluteScale(n),a=e.getAbsolutePosition(n),o=r.x*i.x-e.offsetX()*i.x,c=r.y*i.y-e.offsetY()*i.y,l=(s.Konva.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2);return y({x:a.x+o*Math.cos(l)+c*Math.sin(-l),y:a.y+c*Math.cos(l)+o*Math.sin(l),width:r.width*i.x,height:r.height*i.y,rotation:l},-s.Konva.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};let e=[];this.nodes().map(t=>{let n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),r=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],i=t.getAbsoluteTransform();r.forEach(function(t){let n=i.point(t);e.push(n)})});let n=new t.Transform;n.rotate(-s.Konva.getAngle(this.rotation()));let r=1/0,i=1/0,a=-1/0,o=-1/0;e.forEach(function(e){let t=n.point(e);r===void 0&&(r=a=t.x,i=o=t.y),r=Math.min(r,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y)}),n.invert();let c=n.point({x:r,y:i});return{x:c.x,y:c.y,width:a-r,height:o-i,rotation:s.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),_.forEach(e=>{this._createAnchor(e)}),this._createAnchor(`rotater`)}_createAnchor(e){let t=new a.Rect({stroke:`rgb(0, 161, 255)`,fill:`white`,strokeWidth:1,name:e+` _anchor`,dragDistance:0,draggable:!0,hitStrokeWidth:h?10:`auto`}),n=this;t.on(`mousedown touchstart`,function(e){n._handleMouseDown(e)}),t.on(`dragstart`,e=>{t.stopDrag(),e.cancelBubble=!0}),t.on(`dragend`,e=>{e.cancelBubble=!0}),t.on(`mouseenter`,()=>{let n=g(e,s.Konva.getAngle(this.rotation()),this.rotateAnchorCursor());t.getStage().content&&(t.getStage().content.style.cursor=n),this._cursorChange=!0}),t.on(`mouseout`,()=>{t.getStage().content&&(t.getStage().content.style.cursor=``),this._cursorChange=!1}),this.add(t)}_createBack(){let e=new i.Shape({name:`back`,width:0,height:0,draggable:!0,sceneFunc(e,n){let r=n.getParent(),i=r.padding();e.beginPath(),e.rect(-i,-i,n.width()+i*2,n.height()+i*2),e.moveTo(n.width()/2,-i),r.rotateEnabled()&&r.rotateLineVisible()&&e.lineTo(n.width()/2,-r.rotateAnchorOffset()*t.Util._sign(n.height())-i),e.fillStrokeShape(n)},hitFunc:(e,t)=>{if(!this.shouldOverdrawWholeArea())return;let n=this.padding();e.beginPath(),e.rect(-n,-n,t.width()+n*2,t.height()+n*2),e.fillStrokeShape(t)}});this.add(e),this._proxyDrag(e),e.on(`dragstart`,e=>{e.cancelBubble=!0}),e.on(`dragmove`,e=>{e.cancelBubble=!0}),e.on(`dragend`,e=>{e.cancelBubble=!0}),this.on(`dragmove`,e=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(` `)[0];let t=this._getNodeRect(),n=t.width,r=t.height,i=Math.sqrt(n**2+r**2);this.sin=Math.abs(r/i),this.cos=Math.abs(n/i),typeof window<`u`&&(window.addEventListener(`mousemove`,this._handleMouseMove),window.addEventListener(`touchmove`,this._handleMouseMove),window.addEventListener(`mouseup`,this._handleMouseUp,!0),window.addEventListener(`touchend`,this._handleMouseUp,!0)),this._transforming=!0;let a=e.target.getAbsolutePosition(),o=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:o.x-a.x,y:o.y-a.y},S++,this._fire(`transformstart`,{evt:e.evt,target:this.getNode()}),this._nodes.forEach(t=>{t._fire(`transformstart`,{evt:e.evt,target:t})})}_handleMouseMove(e){let t,n,r,i=this.findOne(`.`+this._movingAnchorName),a=i.getStage();a.setPointersPositions(e);let o=a.getPointerPosition(),c={x:o.x-this._anchorDragOffset.x,y:o.y-this._anchorDragOffset.y},l=i.getAbsolutePosition();this.anchorDragBoundFunc()&&(c=this.anchorDragBoundFunc()(l,c,e)),i.setAbsolutePosition(c);let u=i.getAbsolutePosition();if(l.x===u.x&&l.y===u.y)return;if(this._movingAnchorName===`rotater`){let r=this._getNodeRect();t=i.x()-r.width/2,n=-i.y()+r.height/2;let a=Math.atan2(-n,t)+Math.PI/2;r.height<0&&(a-=Math.PI);let o=s.Konva.getAngle(this.rotation())+a,c=s.Konva.getAngle(this.rotationSnapTolerance()),l=b(r,x(this.rotationSnaps(),o,c)-r.rotation);this._fitNodesInto(l,e);return}let d=this.shiftBehavior(),f;f=d===`inverted`?this.keepRatio()&&!e.shiftKey:d===`none`?this.keepRatio():this.keepRatio()||e.shiftKey;let p=this.centeredScaling()||e.altKey;if(this._movingAnchorName===`top-left`){if(f){let e=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(`.bottom-right`).x(),y:this.findOne(`.bottom-right`).y()};r=Math.sqrt((e.x-i.x())**2+(e.y-i.y())**2);let a=this.findOne(`.top-left`).x()>e.x?-1:1,o=this.findOne(`.top-left`).y()>e.y?-1:1;t=r*this.cos*a,n=r*this.sin*o,this.findOne(`.top-left`).x(e.x-t),this.findOne(`.top-left`).y(e.y-n)}}else if(this._movingAnchorName===`top-center`)this.findOne(`.top-left`).y(i.y());else if(this._movingAnchorName===`top-right`){if(f){let e=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(`.bottom-left`).x(),y:this.findOne(`.bottom-left`).y()};r=Math.sqrt((i.x()-e.x)**2+(e.y-i.y())**2);let a=this.findOne(`.top-right`).x()<e.x?-1:1,o=this.findOne(`.top-right`).y()>e.y?-1:1;t=r*this.cos*a,n=r*this.sin*o,this.findOne(`.top-right`).x(e.x+t),this.findOne(`.top-right`).y(e.y-n)}var m=i.position();this.findOne(`.top-left`).y(m.y),this.findOne(`.bottom-right`).x(m.x)}else if(this._movingAnchorName===`middle-left`)this.findOne(`.top-left`).x(i.x());else if(this._movingAnchorName===`middle-right`)this.findOne(`.bottom-right`).x(i.x());else if(this._movingAnchorName===`bottom-left`){if(f){let e=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(`.top-right`).x(),y:this.findOne(`.top-right`).y()};r=Math.sqrt((e.x-i.x())**2+(i.y()-e.y)**2);let a=e.x<i.x()?-1:1,o=i.y()<e.y?-1:1;t=r*this.cos*a,n=r*this.sin*o,i.x(e.x-t),i.y(e.y+n)}m=i.position(),this.findOne(`.top-left`).x(m.x),this.findOne(`.bottom-right`).y(m.y)}else if(this._movingAnchorName===`bottom-center`)this.findOne(`.bottom-right`).y(i.y());else if(this._movingAnchorName===`bottom-right`){if(f){let e=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(`.top-left`).x(),y:this.findOne(`.top-left`).y()};r=Math.sqrt((i.x()-e.x)**2+(i.y()-e.y)**2);let a=this.findOne(`.bottom-right`).x()<e.x?-1:1,o=this.findOne(`.bottom-right`).y()<e.y?-1:1;t=r*this.cos*a,n=r*this.sin*o,this.findOne(`.bottom-right`).x(e.x+t),this.findOne(`.bottom-right`).y(e.y+n)}}else console.error(Error(`Wrong position argument of selection resizer: `+this._movingAnchorName));if(p=this.centeredScaling()||e.altKey,p){let e=this.findOne(`.top-left`),t=this.findOne(`.bottom-right`),n=e.x(),r=e.y(),i=this.getWidth()-t.x(),a=this.getHeight()-t.y();t.move({x:-n,y:-r}),e.move({x:i,y:a})}let h=this.findOne(`.top-left`).getAbsolutePosition();t=h.x,n=h.y;let g=this.findOne(`.bottom-right`).x()-this.findOne(`.top-left`).x(),_=this.findOne(`.bottom-right`).y()-this.findOne(`.top-left`).y();this._fitNodesInto({x:t,y:n,width:g,height:_,rotation:s.Konva.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var t;if(this._transforming){this._transforming=!1,typeof window<`u`&&(window.removeEventListener(`mousemove`,this._handleMouseMove),window.removeEventListener(`touchmove`,this._handleMouseMove),window.removeEventListener(`mouseup`,this._handleMouseUp,!0),window.removeEventListener(`touchend`,this._handleMouseUp,!0));let n=this.getNode();S--,this._fire(`transformend`,{evt:e,target:n}),(t=this.getLayer())==null||t.batchDraw(),n&&this._nodes.forEach(t=>{var n;t._fire(`transformend`,{evt:e,target:t}),(n=t.getLayer())==null||n.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,n){let r=this._getNodeRect();if(t.Util._inRange(e.width,-this.padding()*2-1,1)){this.update();return}if(t.Util._inRange(e.height,-this.padding()*2-1,1)){this.update();return}let i=new t.Transform;if(i.rotate(s.Konva.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf(`left`)>=0){let t=i.point({x:-this.padding()*2,y:0});e.x+=t.x,e.y+=t.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace(`left`,`right`),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf(`right`)>=0){let t=i.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace(`right`,`left`),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf(`top`)>=0){let t=i.point({x:0,y:-this.padding()*2});e.x+=t.x,e.y+=t.y,this._movingAnchorName=this._movingAnchorName.replace(`top`,`bottom`),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf(`bottom`)>=0){let t=i.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace(`bottom`,`top`),this._anchorDragOffset.x-=t.x,this._anchorDragOffset.y-=t.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){let n=this.boundBoxFunc()(r,e);n?e=n:t.Util.warn(`boundBoxFunc returned falsy. You should return new bound rect from it!`)}let a=1e7,o=new t.Transform;o.translate(r.x,r.y),o.rotate(r.rotation),o.scale(r.width/a,r.height/a);let c=new t.Transform,l=e.width/a,u=e.height/a;this.flipEnabled()===!1?(c.translate(e.x,e.y),c.rotate(e.rotation),c.translate(e.width<0?e.width:0,e.height<0?e.height:0),c.scale(Math.abs(l),Math.abs(u))):(c.translate(e.x,e.y),c.rotate(e.rotation),c.scale(l,u));let d=c.multiply(o.invert());this._nodes.forEach(e=>{var n;let r=e.getParent().getAbsoluteTransform(),i=e.getTransform().copy();i.translate(e.offsetX(),e.offsetY());let a=new t.Transform;a.multiply(r.copy().invert()).multiply(d).multiply(r).multiply(i);let o=a.decompose();e.setAttrs(o),(n=e.getLayer())==null||n.batchDraw()}),this.rotation(t.Util._getRotation(e.rotation)),this._nodes.forEach(e=>{this._fire(`transform`,{evt:n,target:e}),e._fire(`transform`,{evt:n,target:e})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e;let n=this._getNodeRect();this.rotation(t.Util._getRotation(n.rotation));let r=n.width,i=n.height,a=this.enabledAnchors(),o=this.resizeEnabled(),s=this.padding(),c=this.anchorSize(),l=this.find(`._anchor`);l.forEach(e=>{e.setAttrs({width:c,height:c,offsetX:c/2,offsetY:c/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(`.top-left`,{x:0,y:0,offsetX:c/2+s,offsetY:c/2+s,visible:o&&a.indexOf(`top-left`)>=0}),this._batchChangeChild(`.top-center`,{x:r/2,y:0,offsetY:c/2+s,visible:o&&a.indexOf(`top-center`)>=0}),this._batchChangeChild(`.top-right`,{x:r,y:0,offsetX:c/2-s,offsetY:c/2+s,visible:o&&a.indexOf(`top-right`)>=0}),this._batchChangeChild(`.middle-left`,{x:0,y:i/2,offsetX:c/2+s,visible:o&&a.indexOf(`middle-left`)>=0}),this._batchChangeChild(`.middle-right`,{x:r,y:i/2,offsetX:c/2-s,visible:o&&a.indexOf(`middle-right`)>=0}),this._batchChangeChild(`.bottom-left`,{x:0,y:i,offsetX:c/2+s,offsetY:c/2-s,visible:o&&a.indexOf(`bottom-left`)>=0}),this._batchChangeChild(`.bottom-center`,{x:r/2,y:i,offsetY:c/2-s,visible:o&&a.indexOf(`bottom-center`)>=0}),this._batchChangeChild(`.bottom-right`,{x:r,y:i,offsetX:c/2-s,offsetY:c/2-s,visible:o&&a.indexOf(`bottom-right`)>=0}),this._batchChangeChild(`.rotater`,{x:r/2,y:-this.rotateAnchorOffset()*t.Util._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(`.back`,{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});let u=this.anchorStyleFunc();u&&l.forEach(e=>{u(e)}),(e=this.getLayer())==null||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();let e=this.findOne(`.`+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=``),o.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return r.Node.prototype.toObject.call(this)}clone(e){return r.Node.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};e.Transformer=C,C.isTransforming=()=>S>0;function w(e){return e instanceof Array||t.Util.warn(`enabledAnchors value should be an array`),e instanceof Array&&e.forEach(function(e){_.indexOf(e)===-1&&t.Util.warn(`Unknown anchor name: `+e+`. Available names are: `+_.join(`, `))}),e||[]}C.prototype.className=`Transformer`,(0,l._registerNode)(C),n.Factory.addGetterSetter(C,`enabledAnchors`,_,w),n.Factory.addGetterSetter(C,`flipEnabled`,!0,(0,c.getBooleanValidator)()),n.Factory.addGetterSetter(C,`resizeEnabled`,!0),n.Factory.addGetterSetter(C,`anchorSize`,10,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(C,`rotateEnabled`,!0),n.Factory.addGetterSetter(C,`rotateLineVisible`,!0),n.Factory.addGetterSetter(C,`rotationSnaps`,[]),n.Factory.addGetterSetter(C,`rotateAnchorOffset`,50,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(C,`rotateAnchorCursor`,`crosshair`),n.Factory.addGetterSetter(C,`rotationSnapTolerance`,5,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(C,`borderEnabled`,!0),n.Factory.addGetterSetter(C,`anchorStroke`,`rgb(0, 161, 255)`),n.Factory.addGetterSetter(C,`anchorStrokeWidth`,1,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(C,`anchorFill`,`white`),n.Factory.addGetterSetter(C,`anchorCornerRadius`,0,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(C,`borderStroke`,`rgb(0, 161, 255)`),n.Factory.addGetterSetter(C,`borderStrokeWidth`,1,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(C,`borderDash`),n.Factory.addGetterSetter(C,`keepRatio`,!0),n.Factory.addGetterSetter(C,`shiftBehavior`,`default`),n.Factory.addGetterSetter(C,`centeredScaling`,!1),n.Factory.addGetterSetter(C,`ignoreStroke`,!1),n.Factory.addGetterSetter(C,`padding`,0,(0,c.getNumberValidator)()),n.Factory.addGetterSetter(C,`nodes`),n.Factory.addGetterSetter(C,`node`),n.Factory.addGetterSetter(C,`boundBoxFunc`),n.Factory.addGetterSetter(C,`anchorDragBoundFunc`),n.Factory.addGetterSetter(C,`anchorStyleFunc`),n.Factory.addGetterSetter(C,`shouldOverdrawWholeArea`,!1),n.Factory.addGetterSetter(C,`useSingleNodeRotation`,!0),n.Factory.backCompat(C,{lineEnabled:`borderEnabled`,rotateHandlerOffset:`rotateAnchorOffset`,enabledHandlers:`enabledAnchors`})})),na=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Wedge=void 0;var t=Di(),n=Mi(),r=xi(),i=Ei(),a=xi(),o=class extends n.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,r.Konva.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};e.Wedge=o,o.prototype.className=`Wedge`,o.prototype._centroid=!0,o.prototype._attrsAffectingSize=[`radius`],(0,a._registerNode)(o),t.Factory.addGetterSetter(o,`radius`,0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(o,`angle`,0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(o,`clockwise`,!1),t.Factory.backCompat(o,{angleDeg:`angle`,getAngleDeg:`getAngle`,setAngleDeg:`setAngle`})})),ra=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Blur=void 0;var t=Di(),n=Oi(),r=Ei();function i(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var a=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],o=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function s(e,t){let n=e.data,r=e.width,s=e.height,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O=t+t+1,k=r-1,A=s-1,j=t+1,M=j*(j+1)/2,ee=new i,N=a[t],P=o[t],F=null,I=ee,L=null,te=null;for(let e=1;e<O;e++)I=I.next=new i,e===j&&(F=I);I.next=ee,u=l=0;for(let e=0;e<s;e++){y=b=x=S=d=f=p=m=0,h=j*(C=n[l]),g=j*(w=n[l+1]),_=j*(T=n[l+2]),v=j*(E=n[l+3]),d+=M*C,f+=M*w,p+=M*T,m+=M*E,I=ee;for(let e=0;e<j;e++)I.r=C,I.g=w,I.b=T,I.a=E,I=I.next;for(let e=1;e<j;e++)c=l+((k<e?k:e)<<2),d+=(I.r=C=n[c])*(D=j-e),f+=(I.g=w=n[c+1])*D,p+=(I.b=T=n[c+2])*D,m+=(I.a=E=n[c+3])*D,y+=C,b+=w,x+=T,S+=E,I=I.next;L=ee,te=F;for(let e=0;e<r;e++)n[l+3]=E=m*N>>P,E===0?n[l]=n[l+1]=n[l+2]=0:(E=255/E,n[l]=(d*N>>P)*E,n[l+1]=(f*N>>P)*E,n[l+2]=(p*N>>P)*E),d-=h,f-=g,p-=_,m-=v,h-=L.r,g-=L.g,_-=L.b,v-=L.a,c=u+((c=e+t+1)<k?c:k)<<2,y+=L.r=n[c],b+=L.g=n[c+1],x+=L.b=n[c+2],S+=L.a=n[c+3],d+=y,f+=b,p+=x,m+=S,L=L.next,h+=C=te.r,g+=w=te.g,_+=T=te.b,v+=E=te.a,y-=C,b-=w,x-=T,S-=E,te=te.next,l+=4;u+=r}for(let e=0;e<r;e++){b=x=S=y=f=p=m=d=0,l=e<<2,h=j*(C=n[l]),g=j*(w=n[l+1]),_=j*(T=n[l+2]),v=j*(E=n[l+3]),d+=M*C,f+=M*w,p+=M*T,m+=M*E,I=ee;for(let e=0;e<j;e++)I.r=C,I.g=w,I.b=T,I.a=E,I=I.next;let i=r;for(let a=1;a<=t;a++)l=i+e<<2,d+=(I.r=C=n[l])*(D=j-a),f+=(I.g=w=n[l+1])*D,p+=(I.b=T=n[l+2])*D,m+=(I.a=E=n[l+3])*D,y+=C,b+=w,x+=T,S+=E,I=I.next,a<A&&(i+=r);l=e,L=ee,te=F;for(let t=0;t<s;t++)c=l<<2,n[c+3]=E=m*N>>P,E>0?(E=255/E,n[c]=(d*N>>P)*E,n[c+1]=(f*N>>P)*E,n[c+2]=(p*N>>P)*E):n[c]=n[c+1]=n[c+2]=0,d-=h,f-=g,p-=_,m-=v,h-=L.r,g-=L.g,_-=L.b,v-=L.a,c=e+((c=t+j)<A?c:A)*r<<2,d+=y+=L.r=n[c],f+=b+=L.g=n[c+1],p+=x+=L.b=n[c+2],m+=S+=L.a=n[c+3],L=L.next,h+=C=te.r,g+=w=te.g,_+=T=te.b,v+=E=te.a,y-=C,b-=w,x-=T,S-=E,te=te.next,l+=r}}e.Blur=function(e){let t=Math.round(this.blurRadius());t>0&&s(e,t)},t.Factory.addGetterSetter(n.Node,`blurRadius`,0,(0,r.getNumberValidator)(),t.Factory.afterSetFilter)})),ia=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Brighten=void 0;var t=Di(),n=Oi(),r=Ei();e.Brighten=function(e){let t=this.brightness()*255,n=e.data,r=n.length;for(let e=0;e<r;e+=4)n[e]+=t,n[e+1]+=t,n[e+2]+=t},t.Factory.addGetterSetter(n.Node,`brightness`,0,(0,r.getNumberValidator)(),t.Factory.afterSetFilter)})),aa=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Contrast=void 0;var t=Di(),n=Oi(),r=Ei();e.Contrast=function(e){let t=((this.contrast()+100)/100)**2,n=e.data,r=n.length,i=150,a=150,o=150;for(let e=0;e<r;e+=4)i=n[e],a=n[e+1],o=n[e+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,n[e]=i,n[e+1]=a,n[e+2]=o},t.Factory.addGetterSetter(n.Node,`contrast`,0,(0,r.getNumberValidator)(),t.Factory.afterSetFilter)})),oa=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emboss=void 0;var t=Di(),n=Oi(),r=Si(),i=Ei();e.Emboss=function(e){let t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,i=this.embossDirection(),a=this.embossBlend(),o=e.data,s=e.width,c=e.height,l=s*4,u=0,d=0,f=c;switch(i){case`top-left`:u=-1,d=-1;break;case`top`:u=-1,d=0;break;case`top-right`:u=-1,d=1;break;case`right`:u=0,d=1;break;case`bottom-right`:u=1,d=1;break;case`bottom`:u=1,d=0;break;case`bottom-left`:u=1,d=-1;break;case`left`:u=0,d=-1;break;default:r.Util.error(`Unknown emboss direction: `+i)}do{let e=(f-1)*l,r=u;f+r<1&&(r=0),f+r>c&&(r=0);let i=(f-1+r)*s*4,p=s;do{let r=e+(p-1)*4,c=d;p+c<1&&(c=0),p+c>s&&(c=0);let l=i+(p-1+c)*4,u=o[r]-o[l],f=o[r+1]-o[l+1],m=o[r+2]-o[l+2],h=u,g=h>0?h:-h,_=f>0?f:-f,v=m>0?m:-m;if(_>g&&(h=f),v>g&&(h=m),h*=t,a){let e=o[r]+h,t=o[r+1]+h,n=o[r+2]+h;o[r]=e>255?255:e<0?0:e,o[r+1]=t>255?255:t<0?0:t,o[r+2]=n>255?255:n<0?0:n}else{let e=n-h;e<0?e=0:e>255&&(e=255),o[r]=o[r+1]=o[r+2]=e}}while(--p)}while(--f)},t.Factory.addGetterSetter(n.Node,`embossStrength`,.5,(0,i.getNumberValidator)(),t.Factory.afterSetFilter),t.Factory.addGetterSetter(n.Node,`embossWhiteLevel`,.5,(0,i.getNumberValidator)(),t.Factory.afterSetFilter),t.Factory.addGetterSetter(n.Node,`embossDirection`,`top-left`,void 0,t.Factory.afterSetFilter),t.Factory.addGetterSetter(n.Node,`embossBlend`,!1,void 0,t.Factory.afterSetFilter)})),sa=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Enhance=void 0;var t=Di(),n=Oi(),r=Ei();function i(e,t,n,r,i){let a=n-t,o=i-r;if(a===0)return r+o/2;if(o===0)return r;let s=(e-t)/a;return s=o*s+r,s}e.Enhance=function(e){let t=e.data,n=t.length,r=t[0],a=r,o,s=t[1],c=s,l,u=t[2],d=u,f,p=this.enhance();if(p===0)return;for(let e=0;e<n;e+=4)o=t[e+0],o<r?r=o:o>a&&(a=o),l=t[e+1],l<s?s=l:l>c&&(c=l),f=t[e+2],f<u?u=f:f>d&&(d=f);a===r&&(a=255,r=0),c===s&&(c=255,s=0),d===u&&(d=255,u=0);let m,h,g,_,v,y;if(p>0)m=a+p*(255-a),h=r-p*(r-0),g=c+p*(255-c),_=s-p*(s-0),v=d+p*(255-d),y=u-p*(u-0);else{let e=(a+r)*.5;m=a+p*(a-e),h=r+p*(r-e);let t=(c+s)*.5;g=c+p*(c-t),_=s+p*(s-t);let n=(d+u)*.5;v=d+p*(d-n),y=u+p*(u-n)}for(let e=0;e<n;e+=4)t[e+0]=i(t[e+0],r,a,h,m),t[e+1]=i(t[e+1],s,c,_,g),t[e+2]=i(t[e+2],u,d,y,v)},t.Factory.addGetterSetter(n.Node,`enhance`,0,(0,r.getNumberValidator)(),t.Factory.afterSetFilter)})),ca=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Grayscale=void 0,e.Grayscale=function(e){let t=e.data,n=t.length;for(let e=0;e<n;e+=4){let n=.34*t[e]+.5*t[e+1]+.16*t[e+2];t[e]=n,t[e+1]=n,t[e+2]=n}}})),la=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HSL=void 0;var t=Di(),n=Oi(),r=Ei();t.Factory.addGetterSetter(n.Node,`hue`,0,(0,r.getNumberValidator)(),t.Factory.afterSetFilter),t.Factory.addGetterSetter(n.Node,`saturation`,0,(0,r.getNumberValidator)(),t.Factory.afterSetFilter),t.Factory.addGetterSetter(n.Node,`luminance`,0,(0,r.getNumberValidator)(),t.Factory.afterSetFilter),e.HSL=function(e){let t=e.data,n=t.length,r=2**this.saturation(),i=Math.abs(this.hue()+360)%360,a=this.luminance()*127,o=1*r*Math.cos(i*Math.PI/180),s=1*r*Math.sin(i*Math.PI/180),c=.299+.701*o+.167*s,l=.587-.587*o+.33*s,u=.114-.114*o-.497*s,d=.299-.299*o-.328*s,f=.587+.413*o+.035*s,p=.114-.114*o+.293*s,m=.299-.3*o+1.25*s,h=.587-.586*o-1.05*s,g=.114+.886*o-.2*s,_,v,y,b;for(let e=0;e<n;e+=4)_=t[e+0],v=t[e+1],y=t[e+2],b=t[e+3],t[e+0]=c*_+l*v+u*y+a,t[e+1]=d*_+f*v+p*y+a,t[e+2]=m*_+h*v+g*y+a,t[e+3]=b}})),ua=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.HSV=void 0;var t=Di(),n=Oi(),r=Ei();e.HSV=function(e){let t=e.data,n=t.length,r=2**this.value(),i=2**this.saturation(),a=Math.abs(this.hue()+360)%360,o=r*i*Math.cos(a*Math.PI/180),s=r*i*Math.sin(a*Math.PI/180),c=.299*r+.701*o+.167*s,l=.587*r-.587*o+.33*s,u=.114*r-.114*o-.497*s,d=.299*r-.299*o-.328*s,f=.587*r+.413*o+.035*s,p=.114*r-.114*o+.293*s,m=.299*r-.3*o+1.25*s,h=.587*r-.586*o-1.05*s,g=.114*r+.886*o-.2*s;for(let e=0;e<n;e+=4){let n=t[e+0],r=t[e+1],i=t[e+2],a=t[e+3];t[e+0]=c*n+l*r+u*i,t[e+1]=d*n+f*r+p*i,t[e+2]=m*n+h*r+g*i,t[e+3]=a}},t.Factory.addGetterSetter(n.Node,`hue`,0,(0,r.getNumberValidator)(),t.Factory.afterSetFilter),t.Factory.addGetterSetter(n.Node,`saturation`,0,(0,r.getNumberValidator)(),t.Factory.afterSetFilter),t.Factory.addGetterSetter(n.Node,`value`,0,(0,r.getNumberValidator)(),t.Factory.afterSetFilter)})),da=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Invert=void 0,e.Invert=function(e){let t=e.data,n=t.length;for(let e=0;e<n;e+=4)t[e]=255-t[e],t[e+1]=255-t[e+1],t[e+2]=255-t[e+2]}})),fa=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Kaleidoscope=void 0;var t=Di(),n=Oi(),r=Si(),i=Ei(),a=function(e,t,n){let r=e.data,i=t.data,a=e.width,o=e.height,s=n.polarCenterX||a/2,c=n.polarCenterY||o/2,l=Math.sqrt(s*s+c*c),u=a-s,d=o-c,f=Math.sqrt(u*u+d*d);l=f>l?f:l;let p=o,m=a,h=360/m*Math.PI/180;for(let e=0;e<m;e+=1){let t=Math.sin(e*h),n=Math.cos(e*h);for(let o=0;o<p;o+=1){u=Math.floor(s+l*o/p*n),d=Math.floor(c+l*o/p*t);let f=(d*a+u)*4,m=r[f+0],h=r[f+1],g=r[f+2],_=r[f+3];f=(e+o*a)*4,i[f+0]=m,i[f+1]=h,i[f+2]=g,i[f+3]=_}}},o=function(e,t,n){let r=e.data,i=t.data,a=e.width,o=e.height,s=n.polarCenterX||a/2,c=n.polarCenterY||o/2,l=Math.sqrt(s*s+c*c),u=a-s,d=o-c,f=Math.sqrt(u*u+d*d);l=f>l?f:l;let p=o,m=a,h=n.polarRotation||0,g,_;for(u=0;u<a;u+=1)for(d=0;d<o;d+=1){let e=u-s,t=d-c,n=Math.sqrt(e*e+t*t)*p/l,o=(Math.atan2(t,e)*180/Math.PI+360+h)%360;o=o*m/360,g=Math.floor(o),_=Math.floor(n);let f=(_*a+g)*4,v=r[f+0],y=r[f+1],b=r[f+2],x=r[f+3];f=(d*a+u)*4,i[f+0]=v,i[f+1]=y,i[f+2]=b,i[f+3]=x}};e.Kaleidoscope=function(e){let t=e.width,n=e.height,i,s,c,l,u,d,f,p,m,h,g=Math.round(this.kaleidoscopePower()),_=Math.round(this.kaleidoscopeAngle()),v=Math.floor(_%360*t/360);if(g<1)return;let y=r.Util.createCanvasElement();y.width=t,y.height=n;let b=y.getContext(`2d`).getImageData(0,0,t,n);r.Util.releaseCanvas(y),a(e,b,{polarCenterX:t/2,polarCenterY:n/2});let x=t/2**g;for(;x<=8;)x*=2,--g;x=Math.ceil(x);let S=x,C=0,w=S,T=1;for(v+x>t&&(C=S,w=0,T=-1),s=0;s<n;s+=1)for(i=C;i!==w;i+=T)c=Math.round(i+v)%t,m=(t*s+c)*4,u=b.data[m+0],d=b.data[m+1],f=b.data[m+2],p=b.data[m+3],h=(t*s+i)*4,b.data[h+0]=u,b.data[h+1]=d,b.data[h+2]=f,b.data[h+3]=p;for(s=0;s<n;s+=1)for(S=Math.floor(x),l=0;l<g;l+=1){for(i=0;i<S+1;i+=1)m=(t*s+i)*4,u=b.data[m+0],d=b.data[m+1],f=b.data[m+2],p=b.data[m+3],h=(t*s+S*2-i-1)*4,b.data[h+0]=u,b.data[h+1]=d,b.data[h+2]=f,b.data[h+3]=p;S*=2}o(b,e,{polarRotation:0})},t.Factory.addGetterSetter(n.Node,`kaleidoscopePower`,2,(0,i.getNumberValidator)(),t.Factory.afterSetFilter),t.Factory.addGetterSetter(n.Node,`kaleidoscopeAngle`,0,(0,i.getNumberValidator)(),t.Factory.afterSetFilter)})),pa=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Mask=void 0;var t=Di(),n=Oi(),r=Ei();function i(e,t,n){let r=(n*e.width+t)*4,i=[];return i.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),i}function a(e,t){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2)}function o(e){let t=[0,0,0];for(let n=0;n<e.length;n++)t[0]+=e[n][0],t[1]+=e[n][1],t[2]+=e[n][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function s(e,t){let n=i(e,0,0),r=i(e,e.width-1,0),s=i(e,0,e.height-1),c=i(e,e.width-1,e.height-1),l=t||10;if(a(n,r)<l&&a(r,c)<l&&a(c,s)<l&&a(s,n)<l){let t=o([r,n,c,s]),i=[];for(let n=0;n<e.width*e.height;n++){let r=a(t,[e.data[n*4],e.data[n*4+1],e.data[n*4+2]]);i[n]=r<l?0:255}return i}}function c(e,t){for(let n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function l(e,t,n){let r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s<n;s++)for(let c=0;c<t;c++){let l=s*t+c,u=0;for(let o=0;o<i;o++)for(let l=0;l<i;l++){let d=s+o-a,f=c+l-a;if(d>=0&&d<n&&f>=0&&f<t){let n=d*t+f,a=r[o*i+l];u+=e[n]*a}}o[l]=u===2040?255:0}return o}function u(e,t,n){let r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s<n;s++)for(let c=0;c<t;c++){let l=s*t+c,u=0;for(let o=0;o<i;o++)for(let l=0;l<i;l++){let d=s+o-a,f=c+l-a;if(d>=0&&d<n&&f>=0&&f<t){let n=d*t+f,a=r[o*i+l];u+=e[n]*a}}o[l]=u>=1020?255:0}return o}function d(e,t,n){let r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),o=[];for(let s=0;s<n;s++)for(let c=0;c<t;c++){let l=s*t+c,u=0;for(let o=0;o<i;o++)for(let l=0;l<i;l++){let d=s+o-a,f=c+l-a;if(d>=0&&d<n&&f>=0&&f<t){let n=d*t+f,a=r[o*i+l];u+=e[n]*a}}o[l]=u}return o}e.Mask=function(e){let t=s(e,this.threshold());return t&&(t=l(t,e.width,e.height),t=u(t,e.width,e.height),t=d(t,e.width,e.height),c(e,t)),e},t.Factory.addGetterSetter(n.Node,`threshold`,0,(0,r.getNumberValidator)(),t.Factory.afterSetFilter)})),ma=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Noise=void 0;var t=Di(),n=Oi(),r=Ei();e.Noise=function(e){let t=this.noise()*255,n=e.data,r=n.length,i=t/2;for(let e=0;e<r;e+=4)n[e+0]+=i-2*i*Math.random(),n[e+1]+=i-2*i*Math.random(),n[e+2]+=i-2*i*Math.random()},t.Factory.addGetterSetter(n.Node,`noise`,.2,(0,r.getNumberValidator)(),t.Factory.afterSetFilter)})),ha=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Pixelate=void 0;var t=Di(),n=Si(),r=Oi(),i=Ei();e.Pixelate=function(e){let t=Math.ceil(this.pixelSize()),r=e.width,i=e.height,a=Math.ceil(r/t),o=Math.ceil(i/t),s=e.data;if(t<=0){n.Util.error(`pixelSize value can not be <= 0`);return}for(let e=0;e<a;e+=1)for(let n=0;n<o;n+=1){let a=0,o=0,c=0,l=0,u=e*t,d=u+t,f=n*t,p=f+t,m=0;for(let e=u;e<d;e+=1)if(!(e>=r))for(let t=f;t<p;t+=1){if(t>=i)continue;let n=(r*t+e)*4;a+=s[n+0],o+=s[n+1],c+=s[n+2],l+=s[n+3],m+=1}a/=m,o/=m,c/=m,l/=m;for(let e=u;e<d;e+=1)if(!(e>=r))for(let t=f;t<p;t+=1){if(t>=i)continue;let n=(r*t+e)*4;s[n+0]=a,s[n+1]=o,s[n+2]=c,s[n+3]=l}}},t.Factory.addGetterSetter(r.Node,`pixelSize`,8,(0,i.getNumberValidator)(),t.Factory.afterSetFilter)})),ga=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Posterize=void 0;var t=Di(),n=Oi(),r=Ei();e.Posterize=function(e){let t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t;for(let e=0;e<r;e+=1)n[e]=Math.floor(n[e]/i)*i},t.Factory.addGetterSetter(n.Node,`levels`,.5,(0,r.getNumberValidator)(),t.Factory.afterSetFilter)})),_a=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RGB=void 0;var t=Di(),n=Oi(),r=Ei();e.RGB=function(e){let t=e.data,n=t.length,r=this.red(),i=this.green(),a=this.blue();for(let e=0;e<n;e+=4){let n=(.34*t[e]+.5*t[e+1]+.16*t[e+2])/255;t[e]=n*r,t[e+1]=n*i,t[e+2]=n*a,t[e+3]=t[e+3]}},t.Factory.addGetterSetter(n.Node,`red`,0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),t.Factory.addGetterSetter(n.Node,`green`,0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),t.Factory.addGetterSetter(n.Node,`blue`,0,r.RGBComponent,t.Factory.afterSetFilter)})),va=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RGBA=void 0;var t=Di(),n=Oi(),r=Ei();e.RGBA=function(e){let t=e.data,n=t.length,r=this.red(),i=this.green(),a=this.blue(),o=this.alpha();for(let e=0;e<n;e+=4){let n=1-o;t[e]=r*o+t[e]*n,t[e+1]=i*o+t[e+1]*n,t[e+2]=a*o+t[e+2]*n}},t.Factory.addGetterSetter(n.Node,`red`,0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),t.Factory.addGetterSetter(n.Node,`green`,0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),t.Factory.addGetterSetter(n.Node,`blue`,0,r.RGBComponent,t.Factory.afterSetFilter),t.Factory.addGetterSetter(n.Node,`alpha`,1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e})})),ya=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Sepia=void 0,e.Sepia=function(e){let t=e.data,n=t.length;for(let e=0;e<n;e+=4){let n=t[e+0],r=t[e+1],i=t[e+2];t[e+0]=Math.min(255,n*.393+r*.769+i*.189),t[e+1]=Math.min(255,n*.349+r*.686+i*.168),t[e+2]=Math.min(255,n*.272+r*.534+i*.131)}}})),ba=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Solarize=void 0,e.Solarize=function(e){let t=e.data,n=e.width,r=e.height,i=n*4,a=r;do{let e=(a-1)*i,r=n;do{let n=e+(r-1)*4,i=t[n],a=t[n+1],o=t[n+2];i>127&&(i=255-i),a>127&&(a=255-a),o>127&&(o=255-o),t[n]=i,t[n+1]=a,t[n+2]=o}while(--r)}while(--a)}})),xa=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Threshold=void 0;var t=Di(),n=Oi(),r=Ei();e.Threshold=function(e){let t=this.threshold()*255,n=e.data,r=n.length;for(let e=0;e<r;e+=1)n[e]=n[e]<t?0:255},t.Factory.addGetterSetter(n.Node,`threshold`,.5,(0,r.getNumberValidator)(),t.Factory.afterSetFilter)})),Sa=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;var t=Ri(),n=zi(),r=Ui(),i=Wi(),a=Gi(),o=Ki(),s=qi(),c=Bi(),l=Hi(),u=Ji(),d=Yi(),f=Xi(),p=Zi(),m=Qi(),h=$i(),g=ea(),_=ta(),v=na(),y=ra(),b=ia(),x=aa(),S=oa(),C=sa(),w=ca(),T=la(),E=ua(),D=da(),O=fa(),k=pa(),A=ma(),j=ha(),M=ga(),ee=_a(),N=va(),P=ya(),F=ba(),I=xa();e.Konva=t.Konva.Util._assign(t.Konva,{Arc:n.Arc,Arrow:r.Arrow,Circle:i.Circle,Ellipse:a.Ellipse,Image:o.Image,Label:s.Label,Tag:s.Tag,Line:c.Line,Path:l.Path,Rect:u.Rect,RegularPolygon:d.RegularPolygon,Ring:f.Ring,Sprite:p.Sprite,Star:m.Star,Text:h.Text,TextPath:g.TextPath,Transformer:_.Transformer,Wedge:v.Wedge,Filters:{Blur:y.Blur,Brighten:b.Brighten,Contrast:x.Contrast,Emboss:S.Emboss,Enhance:C.Enhance,Grayscale:w.Grayscale,HSL:T.HSL,HSV:E.HSV,Invert:D.Invert,Kaleidoscope:O.Kaleidoscope,Mask:k.Mask,Noise:A.Noise,Pixelate:j.Pixelate,Posterize:M.Posterize,RGB:ee.RGB,RGBA:N.RGBA,Sepia:P.Sepia,Solarize:F.Solarize,Threshold:I.Threshold}})})),Ca=o(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),t.exports=Sa().Konva})),wa=o(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;var n=Ri();Object.defineProperty(e,"Konva",{enumerable:!0,get:function(){return n.Konva}}),t.exports=Ri().Konva})),Ta=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&ee(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&ee(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function ee(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,ee(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Ea=o((e=>{process.env.NODE_ENV!==`production`&&(function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=5;function n(e,t){var n=e.length;e.push(t),a(e,t,n)}function r(e){return e.length===0?null:e[0]}function i(e){if(e.length===0)return null;var t=e[0],n=e.pop();return n!==t&&(e[0]=n,o(e,n,0)),t}function a(e,t,n){for(var r=n;r>0;){var i=r-1>>>1,a=e[i];if(s(a,t)>0)e[i]=t,e[r]=a,r=i;else return}}function o(e,t,n){for(var r=n,i=e.length,a=i>>>1;r<a;){var o=(r+1)*2-1,c=e[o],l=o+1,u=e[l];if(s(c,t)<0)l<i&&s(u,c)<0?(e[r]=u,e[l]=t,r=l):(e[r]=c,e[o]=t,r=o);else if(l<i&&s(u,t)<0)e[r]=u,e[l]=t,r=l;else return}}function s(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}var c=1,l=2,u=3,d=4,f=5;if(typeof performance==`object`&&typeof performance.now==`function`){var p=performance;e.unstable_now=function(){return p.now()}}else{var m=Date,h=m.now();e.unstable_now=function(){return m.now()-h}}var g=1073741823,_=-1,v=250,y=5e3,b=1e4,x=g,S=[],C=[],w=1,T=null,E=u,D=!1,O=!1,k=!1,A=typeof setTimeout==`function`?setTimeout:null,j=typeof clearTimeout==`function`?clearTimeout:null,M=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ee(e){for(var t=r(C);t!==null;){if(t.callback===null)i(C);else if(t.startTime<=e)i(C),t.sortIndex=t.expirationTime,n(S,t);else return;t=r(C)}}function N(e){if(k=!1,ee(e),!O){if(r(S)!==null)O=!0,be(P);else{var t=r(C);t!==null&&xe(N,t.startTime-e)}}}function P(e,t){O=!1,k&&(k=!1,Se()),D=!0;var n=E;try{return F(e,t)}finally{T=null,E=n,D=!1}}function F(t,n){var a=n;for(ee(a),T=r(S);T!==null&&!(T.expirationTime>a&&(!t||pe()));){var o=T.callback;if(typeof o==`function`){T.callback=null,E=T.priorityLevel;var s=o(T.expirationTime<=a);a=e.unstable_now(),typeof s==`function`?T.callback=s:T===r(S)&&i(S),ee(a)}else i(S);T=r(S)}if(T!==null)return!0;var c=r(C);return c!==null&&xe(N,c.startTime-a),!1}function I(e,t){switch(e){case c:case l:case u:case d:case f:break;default:e=u}var n=E;E=e;try{return t()}finally{E=n}}function L(e){var t;switch(E){case c:case l:case u:t=u;break;default:t=E}var n=E;E=t;try{return e()}finally{E=n}}function te(e){var t=E;return function(){var n=E;E=t;try{return e.apply(this,arguments)}finally{E=n}}}function ne(t,i,a){var o=e.unstable_now(),s;if(typeof a==`object`&&a){var p=a.delay;s=typeof p==`number`&&p>0?o+p:o}else s=o;var m;switch(t){case c:m=_;break;case l:m=v;break;case f:m=x;break;case d:m=b;break;case u:default:m=y}var h=s+m,g={id:w++,callback:i,priorityLevel:t,startTime:s,expirationTime:h,sortIndex:-1};return s>o?(g.sortIndex=s,n(C,g),r(S)===null&&g===r(C)&&(k?Se():k=!0,xe(N,s-o))):(g.sortIndex=h,n(S,g),!O&&!D&&(O=!0,be(P))),g}function re(){}function ie(){!O&&!D&&(O=!0,be(P))}function ae(){return r(S)}function oe(e){e.callback=null}function se(){return E}var ce=!1,le=null,ue=-1,de=t,fe=-1;function pe(){return!(e.unstable_now()-fe<de)}function me(){}function he(e){if(e<0||e>125){console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`);return}de=e>0?Math.floor(1e3/e):t}var ge=function(){if(le!==null){var t=e.unstable_now();fe=t;var n=!0,r=!0;try{r=le(n,t)}finally{r?_e():(ce=!1,le=null)}}else ce=!1},_e;if(typeof M==`function`)_e=function(){M(ge)};else if(typeof MessageChannel<`u`){var ve=new MessageChannel,ye=ve.port2;ve.port1.onmessage=ge,_e=function(){ye.postMessage(null)}}else _e=function(){A(ge,0)};function be(e){le=e,ce||(ce=!0,_e())}function xe(t,n){ue=A(function(){t(e.unstable_now())},n)}function Se(){j(ue),ue=-1}var Ce=me;e.unstable_IdlePriority=f,e.unstable_ImmediatePriority=c,e.unstable_LowPriority=d,e.unstable_NormalPriority=u,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=l,e.unstable_cancelCallback=oe,e.unstable_continueExecution=ie,e.unstable_forceFrameRate=he,e.unstable_getCurrentPriorityLevel=se,e.unstable_getFirstCallbackNode=ae,e.unstable_next=L,e.unstable_pauseExecution=re,e.unstable_requestPaint=Ce,e.unstable_runWithPriority=I,e.unstable_scheduleCallback=ne,e.unstable_shouldYield=pe,e.unstable_wrapCallback=te,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),Da=o(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?Ta():Ea()})),Oa=o(((e,t)=>{t.exports=function(e){var t={},n=require("react"),r=Da(),i=Object.assign;function a(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,s=Symbol.for(`react.element`),c=Symbol.for(`react.portal`),l=Symbol.for(`react.fragment`),u=Symbol.for(`react.strict_mode`),d=Symbol.for(`react.profiler`),f=Symbol.for(`react.provider`),p=Symbol.for(`react.context`),m=Symbol.for(`react.forward_ref`),h=Symbol.for(`react.suspense`),g=Symbol.for(`react.suspense_list`),_=Symbol.for(`react.memo`),v=Symbol.for(`react.lazy`),y=Symbol.for(`react.offscreen`),b=Symbol.iterator;function x(e){return typeof e!=`object`||!e?null:(e=b&&e[b]||e[`@@iterator`],typeof e==`function`?e:null)}function S(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case l:return`Fragment`;case c:return`Portal`;case d:return`Profiler`;case u:return`StrictMode`;case h:return`Suspense`;case g:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case p:return(e.displayName||`Context`)+`.Consumer`;case f:return(e._context.displayName||`Context`)+`.Provider`;case m:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case _:return t=e.displayName||null,t===null?S(e.type)||`Memo`:t;case v:t=e._payload,e=e._init;try{return S(e(t))}catch{}}return null}function C(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return S(t);case 8:return t===u?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function w(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function T(e){if(w(e)!==e)throw Error(a(188))}function E(e){var t=e.alternate;if(!t){if(t=w(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return T(i),e;if(o===r)return T(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function D(e){return e=E(e),e===null?null:O(e)}function O(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=O(e);if(t!==null)return t;e=e.sibling}return null}function k(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){if(e.tag!==4){var t=k(e);if(t!==null)return t}e=e.sibling}return null}var A=Array.isArray,j=e.getPublicInstance,M=e.getRootHostContext,ee=e.getChildHostContext,N=e.prepareForCommit,P=e.resetAfterCommit,F=e.createInstance,I=e.appendInitialChild,L=e.finalizeInitialChildren,te=e.prepareUpdate,ne=e.shouldSetTextContent,re=e.createTextInstance,ie=e.scheduleTimeout,ae=e.cancelTimeout,oe=e.noTimeout,se=e.isPrimaryRenderer,ce=e.supportsMutation,le=e.supportsPersistence,ue=e.supportsHydration,de=e.getInstanceFromNode,fe=e.preparePortalMount,pe=e.getCurrentEventPriority,me=e.detachDeletedInstance,he=e.supportsMicrotasks,ge=e.scheduleMicrotask,_e=e.supportsTestSelectors,ve=e.findFiberRoot,ye=e.getBoundingRect,be=e.getTextContent,xe=e.isHiddenSubtree,Se=e.matchAccessibilityRole,Ce=e.setFocusIfFocusable,we=e.setupIntersectionObserver,Te=e.appendChild,Ee=e.appendChildToContainer,De=e.commitTextUpdate,Oe=e.commitMount,ke=e.commitUpdate,Ae=e.insertBefore,je=e.insertInContainerBefore,Me=e.removeChild,R=e.removeChildFromContainer,Ne=e.resetTextContent,Pe=e.hideInstance,Fe=e.hideTextInstance,Ie=e.unhideInstance,Le=e.unhideTextInstance,Re=e.clearContainer,ze=e.cloneInstance,Be=e.createContainerChildSet,Ve=e.appendChildToContainerChildSet,He=e.finalizeContainerChildren,Ue=e.replaceContainerChildren,We=e.cloneHiddenInstance,Ge=e.cloneHiddenTextInstance,Ke=e.canHydrateInstance,qe=e.canHydrateTextInstance,Je=e.canHydrateSuspenseInstance,Ye=e.isSuspenseInstancePending,Xe=e.isSuspenseInstanceFallback,Ze=e.getSuspenseInstanceFallbackErrorDetails,Qe=e.registerSuspenseInstanceRetry,$e=e.getNextHydratableSibling,et=e.getFirstHydratableChild,tt=e.getFirstHydratableChildWithinContainer,nt=e.getFirstHydratableChildWithinSuspenseInstance,rt=e.hydrateInstance,it=e.hydrateTextInstance,at=e.hydrateSuspenseInstance,ot=e.getNextHydratableInstanceAfterSuspenseInstance,st=e.commitHydratedContainer,ct=e.commitHydratedSuspenseInstance,lt=e.clearSuspenseBoundary,ut=e.clearSuspenseBoundaryFromContainer,dt=e.shouldDeleteUnhydratedTailInstances,ft=e.didNotMatchHydratedContainerTextInstance,pt=e.didNotMatchHydratedTextInstance,mt;function ht(e){if(mt===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);mt=t&&t[1]||``}return`
|
|
29
|
+
`+mt+e}var gt=!1;function _t(e,t){if(!e||gt)return``;gt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t){if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
|
30
|
+
`),a=r.stack.split(`
|
|
31
|
+
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
|
32
|
+
`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{gt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ht(e):``}var vt=Object.prototype.hasOwnProperty,yt=[],bt=-1;function xt(e){return{current:e}}function St(e){0>bt||(e.current=yt[bt],yt[bt]=null,bt--)}function Ct(e,t){bt++,yt[bt]=e.current,e.current=t}var wt={},Tt=xt(wt),Et=xt(!1),Dt=wt;function Ot(e,t){var n=e.type.contextTypes;if(!n)return wt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function kt(e){return e=e.childContextTypes,e!=null}function At(){St(Et),St(Tt)}function jt(e,t,n){if(Tt.current!==wt)throw Error(a(168));Ct(Tt,t),Ct(Et,n)}function Mt(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!=`function`)return n;for(var o in r=r.getChildContext(),r)if(!(o in t))throw Error(a(108,C(e)||`Unknown`,o));return i({},n,r)}function Nt(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wt,Dt=Tt.current,Ct(Tt,e),Ct(Et,Et.current),!0}function Pt(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(e=Mt(e,t,Dt),r.__reactInternalMemoizedMergedChildContext=e,St(Et),St(Tt),Ct(Tt,e)):St(Et),Ct(Et,n)}var Ft=Math.clz32?Math.clz32:Rt,It=Math.log,Lt=Math.LN2;function Rt(e){return e>>>=0,e===0?32:31-(It(e)/Lt|0)|0}var zt=64,Bt=4194304;function Vt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ht(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Vt(a))):r=Vt(s)}else o=n&~i,o===0?a!==0&&(r=Vt(a)):r=Vt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Ft(t),i=1<<n,r|=e[n],t&=~i;return r}function Ut(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Ft(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ut(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Gt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Kt(){var e=zt;return zt<<=1,!(zt&4194240)&&(zt=64),e}function qt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Jt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ft(t),e[t]=n}function z(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Ft(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Yt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ft(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Xt=0;function Zt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Qt=r.unstable_scheduleCallback,$t=r.unstable_cancelCallback,en=r.unstable_shouldYield,tn=r.unstable_requestPaint,nn=r.unstable_now,rn=r.unstable_ImmediatePriority,an=r.unstable_UserBlockingPriority,on=r.unstable_NormalPriority,sn=r.unstable_IdlePriority,cn=null,ln=null;function un(e){if(ln&&typeof ln.onCommitFiberRoot==`function`)try{ln.onCommitFiberRoot(cn,e,void 0,(e.current.flags&128)==128)}catch{}}function dn(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var fn=typeof Object.is==`function`?Object.is:dn,pn=null,mn=!1,hn=!1;function gn(e){pn===null?pn=[e]:pn.push(e)}function _n(e){mn=!0,gn(e)}function vn(){if(!hn&&pn!==null){hn=!0;var e=0,t=Xt;try{var n=pn;for(Xt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}pn=null,mn=!1}catch(t){throw pn!==null&&(pn=pn.slice(e+1)),Qt(rn,vn),t}finally{Xt=t,hn=!1}}return null}var yn=[],bn=0,xn=null,Sn=0,Cn=[],wn=0,Tn=null,En=1,Dn=``;function On(e,t){yn[bn++]=Sn,yn[bn++]=xn,xn=e,Sn=t}function kn(e,t,n){Cn[wn++]=En,Cn[wn++]=Dn,Cn[wn++]=Tn,Tn=e;var r=En;e=Dn;var i=32-Ft(r)-1;r&=~(1<<i),n+=1;var a=32-Ft(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,En=1<<32-Ft(t)+i|n<<i|r,Dn=a+e}else En=1<<a|n<<i|r,Dn=e}function An(e){e.return!==null&&(On(e,1),kn(e,1,0))}function jn(e){for(;e===xn;)xn=yn[--bn],yn[bn]=null,Sn=yn[--bn],yn[bn]=null;for(;e===Tn;)Tn=Cn[--wn],Cn[wn]=null,Dn=Cn[--wn],Cn[wn]=null,En=Cn[--wn],Cn[wn]=null}var Mn=null,Nn=null,Pn=!1,Fn=!1,In=null;function Ln(e,t){var n=Ds(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Rn(e,t){switch(e.tag){case 5:return t=Ke(t,e.type,e.pendingProps),t!==null&&(e.stateNode=t,Mn=e,Nn=et(t),!0);case 6:return t=qe(t,e.pendingProps),t!==null&&(e.stateNode=t,Mn=e,Nn=null,!0);case 13:if(t=Je(t),t!==null){var n=Tn===null?null:{id:En,overflow:Dn};return e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ds(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Mn=e,Nn=null,!0}return!1;default:return!1}}function zn(e){return!!(e.mode&1)&&!(e.flags&128)}function Bn(e){if(Pn){var t=Nn;if(t){var n=t;if(!Rn(e,t)){if(zn(e))throw Error(a(418));t=$e(n);var r=Mn;t&&Rn(e,t)?Ln(r,n):(e.flags=e.flags&-4097|2,Pn=!1,Mn=e)}}else{if(zn(e))throw Error(a(418));e.flags=e.flags&-4097|2,Pn=!1,Mn=e}}}function Vn(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Mn=e}function Hn(e){if(!ue||e!==Mn)return!1;if(!Pn)return Vn(e),Pn=!0,!1;if(e.tag!==3&&(e.tag!==5||dt(e.type)&&!ne(e.type,e.memoizedProps))){var t=Nn;if(t){if(zn(e))throw Un(),Error(a(418));for(;t;)Ln(e,t),t=$e(t)}}if(Vn(e),e.tag===13){if(!ue)throw Error(a(316));if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Nn=ot(e)}else Nn=Mn?$e(e.stateNode):null;return!0}function Un(){for(var e=Nn;e;)e=$e(e)}function Wn(){ue&&(Nn=Mn=null,Fn=Pn=!1)}function Gn(e){In===null?In=[e]:In.push(e)}var Kn=o.ReactCurrentBatchConfig;function qn(e,t){if(fn(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!vt.call(t,i)||!fn(e[i],t[i]))return!1}return!0}function Jn(e){switch(e.tag){case 5:return ht(e.type);case 16:return ht(`Lazy`);case 13:return ht(`Suspense`);case 19:return ht(`SuspenseList`);case 0:case 2:case 15:return e=_t(e.type,!1),e;case 11:return e=_t(e.type.render,!1),e;case 1:return e=_t(e.type,!0),e;default:return``}}function Yn(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(a(309));var r=n.stateNode}if(!r)throw Error(a(147,e));var i=r,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=i.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function Xn(e,t){throw e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Zn(e){var t=e._init;return t(e._payload)}function Qn(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function i(e,t){return e=As(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function u(t){return e&&t.alternate===null&&(t.flags|=2),t}function d(e,t,n,r){return t===null||t.tag!==6?(t=Ps(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n,r){var a=n.type;return a===l?m(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===v&&Zn(a)===t.type)?(r=i(t,n.props),r.ref=Yn(e,t,n),r.return=e,r):(r=js(n.type,n.key,n.props,null,e.mode,r),r.ref=Yn(e,t,n),r.return=e,r)}function p(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Fs(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function m(e,t,n,r,a){return t===null||t.tag!==7?(t=Ms(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function h(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=Ps(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case s:return n=js(t.type,t.key,t.props,null,e.mode,n),n.ref=Yn(e,null,t),n.return=e,n;case c:return t=Fs(t,e.mode,n),t.return=e,t;case v:var r=t._init;return h(e,r(t._payload),n)}if(A(t)||x(t))return t=Ms(t,e.mode,n,null),t.return=e,t;Xn(e,t)}return null}function g(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?d(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case s:return n.key===i?f(e,t,n,r):null;case c:return n.key===i?p(e,t,n,r):null;case v:return i=n._init,g(e,t,i(n._payload),r)}if(A(n)||x(n))return i===null?m(e,t,n,r,null):null;Xn(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,d(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case s:return e=e.get(r.key===null?n:r.key)||null,f(t,e,r,i);case c:return e=e.get(r.key===null?n:r.key)||null,p(t,e,r,i);case v:var a=r._init;return _(e,t,n,a(r._payload),i)}if(A(r)||x(r))return e=e.get(n)||null,m(t,e,r,i,null);Xn(t,r)}return null}function y(i,a,s,c){for(var l=null,u=null,d=a,f=a=0,p=null;d!==null&&f<s.length;f++){d.index>f?(p=d,d=null):p=d.sibling;var m=g(i,d,s[f],c);if(m===null){d===null&&(d=p);break}e&&d&&m.alternate===null&&t(i,d),a=o(m,a,f),u===null?l=m:u.sibling=m,u=m,d=p}if(f===s.length)return n(i,d),Pn&&On(i,f),l;if(d===null){for(;f<s.length;f++)d=h(i,s[f],c),d!==null&&(a=o(d,a,f),u===null?l=d:u.sibling=d,u=d);return Pn&&On(i,f),l}for(d=r(i,d);f<s.length;f++)p=_(d,i,f,s[f],c),p!==null&&(e&&p.alternate!==null&&d.delete(p.key===null?f:p.key),a=o(p,a,f),u===null?l=p:u.sibling=p,u=p);return e&&d.forEach(function(e){return t(i,e)}),Pn&&On(i,f),l}function b(i,s,c,l){var u=x(c);if(typeof u!=`function`)throw Error(a(150));if(c=u.call(c),c==null)throw Error(a(151));for(var d=u=null,f=s,p=s=0,m=null,v=c.next();f!==null&&!v.done;p++,v=c.next()){f.index>p?(m=f,f=null):m=f.sibling;var y=g(i,f,v.value,l);if(y===null){f===null&&(f=m);break}e&&f&&y.alternate===null&&t(i,f),s=o(y,s,p),d===null?u=y:d.sibling=y,d=y,f=m}if(v.done)return n(i,f),Pn&&On(i,p),u;if(f===null){for(;!v.done;p++,v=c.next())v=h(i,v.value,l),v!==null&&(s=o(v,s,p),d===null?u=v:d.sibling=v,d=v);return Pn&&On(i,p),u}for(f=r(i,f);!v.done;p++,v=c.next())v=_(f,i,p,v.value,l),v!==null&&(e&&v.alternate!==null&&f.delete(v.key===null?p:v.key),s=o(v,s,p),d===null?u=v:d.sibling=v,d=v);return e&&f.forEach(function(e){return t(i,e)}),Pn&&On(i,p),u}function S(e,r,a,o){if(typeof a==`object`&&a&&a.type===l&&a.key===null&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case s:a:{for(var d=a.key,f=r;f!==null;){if(f.key===d){if(d=a.type,d===l){if(f.tag===7){n(e,f.sibling),r=i(f,a.props.children),r.return=e,e=r;break a}}else if(f.elementType===d||typeof d==`object`&&d&&d.$$typeof===v&&Zn(d)===f.type){n(e,f.sibling),r=i(f,a.props),r.ref=Yn(e,f,a),r.return=e,e=r;break a}n(e,f);break}t(e,f),f=f.sibling}a.type===l?(r=Ms(a.props.children,e.mode,o,a.key),r.return=e,e=r):(o=js(a.type,a.key,a.props,null,e.mode,o),o.ref=Yn(e,r,a),o.return=e,e=o)}return u(e);case c:a:{for(f=a.key;r!==null;){if(r.key===f){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),r=i(r,a.children||[]),r.return=e,e=r;break a}n(e,r);break}t(e,r),r=r.sibling}r=Fs(a,e.mode,o),r.return=e,e=r}return u(e);case v:return f=a._init,S(e,r,f(a._payload),o)}if(A(a))return y(e,r,a,o);if(x(a))return b(e,r,a,o);Xn(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),r=i(r,a),r.return=e,e=r):(n(e,r),r=Ps(a,e.mode,o),r.return=e,e=r),u(e)):n(e,r)}return S}var $n=Qn(!0),er=Qn(!1),tr=xt(null),nr=null,rr=null,ir=null;function ar(){ir=rr=nr=null}function or(e,t,n){se?(Ct(tr,t._currentValue),t._currentValue=n):(Ct(tr,t._currentValue2),t._currentValue2=n)}function sr(e){var t=tr.current;St(tr),se?e._currentValue=t:e._currentValue2=t}function cr(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function lr(e,t){nr=e,ir=rr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Xi=!0),e.firstContext=null)}function ur(e){var t=se?e._currentValue:e._currentValue2;if(ir!==e){if(e={context:e,memoizedValue:t,next:null},rr===null){if(nr===null)throw Error(a(308));rr=e,nr.dependencies={lanes:0,firstContext:e}}else rr=rr.next=e}return t}var dr=null;function fr(e){dr===null?dr=[e]:dr.push(e)}function pr(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,fr(t)):(n.next=i.next,i.next=n),t.interleaved=n,mr(e,r)}function mr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var hr=!1;function gr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _r(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function vr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,xo&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,mr(e,n)}return i=r.interleaved,i===null?(t.next=t,fr(r)):(t.next=i.next,i.next=t),r.interleaved=t,mr(e,n)}function br(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yt(e,n)}}function xr(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Sr(e,t,n,r){var a=e.updateQueue;hr=!1;var o=a.firstBaseUpdate,s=a.lastBaseUpdate,c=a.shared.pending;if(c!==null){a.shared.pending=null;var l=c,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,c=d.lastBaseUpdate,c!==s&&(c===null?d.firstBaseUpdate=u:c.next=u,d.lastBaseUpdate=l))}if(o!==null){var f=a.baseState;s=0,d=u=l=null,c=o;do{var p=c.lane,m=c.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});a:{var h=e,g=c;switch(p=t,m=n,g.tag){case 1:if(h=g.payload,typeof h==`function`){f=h.call(m,f,p);break a}f=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(m,f,p):h,p==null)break a;f=i({},f,p);break a;case 2:hr=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[c]:p.push(c))}else m={eventTime:m,lane:p,tag:c.tag,payload:c.payload,callback:c.callback,next:null},d===null?(u=d=m,l=f):d=d.next=m,s|=p;if(c=c.next,c===null){if(c=a.shared.pending,c===null)break;p=c,c=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(1);if(d===null&&(l=f),a.baseState=l,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do s|=a.lane,a=a.next;while(a!==t)}else o===null&&(a.shared.lanes=0);ko|=s,e.lanes=s,e.memoizedState=f}}function Cr(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!=`function`)throw Error(a(191,i));i.call(r)}}}var wr={},Tr=xt(wr),Er=xt(wr),Dr=xt(wr);function Or(e){if(e===wr)throw Error(a(174));return e}function kr(e,t){Ct(Dr,t),Ct(Er,e),Ct(Tr,wr),e=M(t),St(Tr),Ct(Tr,e)}function Ar(){St(Tr),St(Er),St(Dr)}function jr(e){var t=Or(Dr.current),n=Or(Tr.current);t=ee(n,e.type,t),n!==t&&(Ct(Er,e),Ct(Tr,t))}function Mr(e){Er.current===e&&(St(Tr),St(Er))}var Nr=xt(0);function Pr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ye(n)||Xe(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fr=[];function Ir(){for(var e=0;e<Fr.length;e++){var t=Fr[e];se?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}Fr.length=0}var Lr=o.ReactCurrentDispatcher,Rr=o.ReactCurrentBatchConfig,zr=0,Br=null,Vr=null,Hr=null,Ur=!1,Wr=!1,Gr=0,Kr=0;function qr(){throw Error(a(321))}function Jr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!fn(e[n],t[n]))return!1;return!0}function Yr(e,t,n,r,i,o){if(zr=o,Br=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Lr.current=e===null||e.memoizedState===null?Ai:ji,e=n(r,i),Wr){o=0;do{if(Wr=!1,Gr=0,25<=o)throw Error(a(301));o+=1,Hr=Vr=null,t.updateQueue=null,Lr.current=Mi,e=n(r,i)}while(Wr)}if(Lr.current=ki,t=Vr!==null&&Vr.next!==null,zr=0,Hr=Vr=Br=null,Ur=!1,t)throw Error(a(300));return e}function Xr(){var e=Gr!==0;return Gr=0,e}function Zr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hr===null?Br.memoizedState=Hr=e:Hr=Hr.next=e,Hr}function Qr(){if(Vr===null){var e=Br.alternate;e=e===null?null:e.memoizedState}else e=Vr.next;var t=Hr===null?Br.memoizedState:Hr.next;if(t!==null)Hr=t,Vr=e;else{if(e===null)throw Error(a(310));Vr=e,e={memoizedState:Vr.memoizedState,baseState:Vr.baseState,baseQueue:Vr.baseQueue,queue:Vr.queue,next:null},Hr===null?Br.memoizedState=Hr=e:Hr=Hr.next=e}return Hr}function $r(e,t){return typeof t==`function`?t(e):t}function B(e){var t=Qr(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=Vr,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((zr&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=r):l=l.next=f,Br.lanes|=d,ko|=d}u=u.next}while(u!==null&&u!==o);l===null?s=r:l.next=c,fn(r,t.memoizedState)||(Xi=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,Br.lanes|=o,ko|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ei(e){var t=Qr(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);fn(o,t.memoizedState)||(Xi=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ti(){}function ni(e,t){var n=Br,r=Qr(),i=t(),o=!fn(r.memoizedState,i);if(o&&(r.memoizedState=i,Xi=!0),r=r.queue,pi(ai.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Hr!==null&&Hr.memoizedState.tag&1){if(n.flags|=2048,V(9,ii.bind(null,n,r,i,t),void 0,null),So===null)throw Error(a(349));zr&30||ri(n,t,i)}return i}function ri(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Br.updateQueue,t===null?(t={lastEffect:null,stores:null},Br.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ii(e,t,n,r){t.value=n,t.getSnapshot=r,oi(t)&&si(e)}function ai(e,t,n){return n(function(){oi(t)&&si(e)})}function oi(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!fn(e,n)}catch{return!0}}function si(e){var t=mr(e,1);t!==null&&Xo(t,e,1,-1)}function ci(e){var t=Zr();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$r,lastRenderedState:e},t.queue=e,e=e.dispatch=Ti.bind(null,Br,e),[t.memoizedState,e]}function V(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Br.updateQueue,t===null?(t={lastEffect:null,stores:null},Br.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function li(){return Qr().memoizedState}function ui(e,t,n,r){var i=Zr();Br.flags|=e,i.memoizedState=V(1|t,n,void 0,r===void 0?null:r)}function di(e,t,n,r){var i=Qr();r=r===void 0?null:r;var a=void 0;if(Vr!==null){var o=Vr.memoizedState;if(a=o.destroy,r!==null&&Jr(r,o.deps)){i.memoizedState=V(t,n,a,r);return}}Br.flags|=e,i.memoizedState=V(1|t,n,a,r)}function fi(e,t){return ui(8390656,8,e,t)}function pi(e,t){return di(2048,8,e,t)}function mi(e,t){return di(4,2,e,t)}function hi(e,t){return di(4,4,e,t)}function gi(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _i(e,t,n){return n=n==null?null:n.concat([e]),di(4,4,gi.bind(null,t,e),n)}function vi(){}function yi(e,t){var n=Qr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Jr(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bi(e,t){var n=Qr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Jr(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function xi(e,t,n){return zr&21?(fn(n,t)||(n=Kt(),Br.lanes|=n,ko|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xi=!0),e.memoizedState=n)}function Si(e,t){var n=Xt;Xt=n!==0&&4>n?n:4,e(!0);var r=Rr.transition;Rr.transition={};try{e(!1),t()}finally{Xt=n,Rr.transition=r}}function Ci(){return Qr().memoizedState}function wi(e,t,n){var r=Yo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ei(e))Di(t,n);else if(n=pr(e,t,n,r),n!==null){var i=Jo();Xo(n,e,r,i),Oi(n,t,r)}}function Ti(e,t,n){var r=Yo(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ei(e))Di(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,fn(s,o)){var c=t.interleaved;c===null?(i.next=i,fr(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=pr(e,t,i,r),n!==null&&(i=Jo(),Xo(n,e,r,i),Oi(n,t,r))}}function Ei(e){var t=e.alternate;return e===Br||t!==null&&t===Br}function Di(e,t){Wr=Ur=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Oi(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yt(e,n)}}var ki={readContext:ur,useCallback:qr,useContext:qr,useEffect:qr,useImperativeHandle:qr,useInsertionEffect:qr,useLayoutEffect:qr,useMemo:qr,useReducer:qr,useRef:qr,useState:qr,useDebugValue:qr,useDeferredValue:qr,useTransition:qr,useMutableSource:qr,useSyncExternalStore:qr,useId:qr,unstable_isNewReconciler:!1},Ai={readContext:ur,useCallback:function(e,t){return Zr().memoizedState=[e,t===void 0?null:t],e},useContext:ur,useEffect:fi,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),ui(4194308,4,gi.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ui(4194308,4,e,t)},useInsertionEffect:function(e,t){return ui(4,2,e,t)},useMemo:function(e,t){var n=Zr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Zr();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=wi.bind(null,Br,e),[r.memoizedState,e]},useRef:function(e){var t=Zr();return e={current:e},t.memoizedState=e},useState:ci,useDebugValue:vi,useDeferredValue:function(e){return Zr().memoizedState=e},useTransition:function(){var e=ci(!1),t=e[0];return e=Si.bind(null,e[1]),Zr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Br,i=Zr();if(Pn){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),So===null)throw Error(a(349));zr&30||ri(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,fi(ai.bind(null,r,o,e),[e]),r.flags|=2048,V(9,ii.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Zr(),t=So.identifierPrefix;if(Pn){var n=Dn,r=En;n=(r&~(1<<32-Ft(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Gr++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Kr++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},ji={readContext:ur,useCallback:yi,useContext:ur,useEffect:pi,useImperativeHandle:_i,useInsertionEffect:mi,useLayoutEffect:hi,useMemo:bi,useReducer:B,useRef:li,useState:function(){return B($r)},useDebugValue:vi,useDeferredValue:function(e){return xi(Qr(),Vr.memoizedState,e)},useTransition:function(){return[B($r)[0],Qr().memoizedState]},useMutableSource:ti,useSyncExternalStore:ni,useId:Ci,unstable_isNewReconciler:!1},Mi={readContext:ur,useCallback:yi,useContext:ur,useEffect:pi,useImperativeHandle:_i,useInsertionEffect:mi,useLayoutEffect:hi,useMemo:bi,useReducer:ei,useRef:li,useState:function(){return ei($r)},useDebugValue:vi,useDeferredValue:function(e){var t=Qr();return Vr===null?t.memoizedState=e:xi(t,Vr.memoizedState,e)},useTransition:function(){return[ei($r)[0],Qr().memoizedState]},useMutableSource:ti,useSyncExternalStore:ni,useId:Ci,unstable_isNewReconciler:!1};function Ni(e,t){if(e&&e.defaultProps){for(var n in t=i({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Pi(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:i({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Fi={isMounted:function(e){return(e=e._reactInternals)?w(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Jo(),i=Yo(e),a=vr(r,i);a.payload=t,n!=null&&(a.callback=n),t=yr(e,a,i),t!==null&&(Xo(t,e,i,r),br(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Jo(),i=Yo(e),a=vr(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=yr(e,a,i),t!==null&&(Xo(t,e,i,r),br(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Jo(),r=Yo(e),i=vr(n,r);i.tag=2,t!=null&&(i.callback=t),t=yr(e,i,r),t!==null&&(Xo(t,e,r,n),br(t,e,r))}};function Ii(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!qn(n,r)||!qn(i,a):!0}function Li(e,t,n){var r=!1,i=wt,a=t.contextType;return typeof a==`object`&&a?a=ur(a):(i=kt(t)?Dt:Tt.current,r=t.contextTypes,a=(r=r!=null)?Ot(e,i):wt),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Fi,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Ri(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Fi.enqueueReplaceState(t,t.state,null)}function zi(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},gr(e);var a=t.contextType;typeof a==`object`&&a?i.context=ur(a):(a=kt(t)?Dt:Tt.current,i.context=Ot(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(Pi(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&Fi.enqueueReplaceState(i,i.state,null),Sr(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Bi(e,t){try{var n=``,r=t;do n+=Jn(r),r=r.return;while(r);var i=n}catch(e){i=`
|
|
33
|
+
Error generating stack: `+e.message+`
|
|
34
|
+
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function Vi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Hi(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Ui=typeof WeakMap==`function`?WeakMap:Map;function Wi(e,t,n){n=vr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ro||(Ro=!0,zo=r),Hi(e,t)},n}function Gi(e,t,n){n=vr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Hi(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Hi(e,t),typeof r!=`function`&&(Bo===null?Bo=new Set([this]):Bo.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Ki(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ui;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=bs.bind(null,e,t,n),t.then(e,e))}function qi(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null||t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Ji(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=vr(-1,1),t.tag=2,yr(n,t,1))),n.lanes|=1),e)}var Yi=o.ReactCurrentOwner,Xi=!1;function Zi(e,t,n,r){t.child=e===null?er(t,null,n,r):$n(t,e.child,n,r)}function Qi(e,t,n,r,i){n=n.render;var a=t.ref;return lr(t,i),r=Yr(e,t,n,r,a,i),n=Xr(),e!==null&&!Xi?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,va(e,t,i)):(Pn&&n&&An(t),t.flags|=1,Zi(e,t,r,i),t.child)}function $i(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Os(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,ea(e,t,a,r,i)):(e=js(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?qn:n,n(o,r)&&e.ref===t.ref)return va(e,t,i)}return t.flags|=1,e=As(a,r),e.ref=t.ref,e.return=t,t.child=e}function ea(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(qn(a,r)&&e.ref===t.ref){if(Xi=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Xi=!0);else return t.lanes=e.lanes,va(e,t,i)}}return ra(e,t,n,r,i)}function ta(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`){if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ct(Eo,To),To|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ct(Eo,To),To|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Ct(Eo,To),To|=r}}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Ct(Eo,To),To|=r;return Zi(e,t,i,n),t.child}function na(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ra(e,t,n,r,i){var a=kt(n)?Dt:Tt.current;return a=Ot(t,a),lr(t,i),n=Yr(e,t,n,r,a,i),r=Xr(),e!==null&&!Xi?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,va(e,t,i)):(Pn&&r&&An(t),t.flags|=1,Zi(e,t,n,i),t.child)}function ia(e,t,n,r,i){if(kt(n)){var a=!0;Nt(t)}else a=!1;if(lr(t,i),t.stateNode===null)_a(e,t),Li(t,n,r),zi(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=ur(l):(l=kt(n)?Dt:Tt.current,l=Ot(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Ri(t,o,r,l),hr=!1;var f=t.memoizedState;o.state=f,Sr(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Et.current||hr?(typeof u==`function`&&(Pi(t,n,u,r),c=t.memoizedState),(s=hr||Ii(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,_r(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Ni(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=ur(c):(c=kt(n)?Dt:Tt.current,c=Ot(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Ri(t,o,r,c),hr=!1,f=t.memoizedState,o.state=f,Sr(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Et.current||hr?(typeof p==`function`&&(Pi(t,n,p,r),m=t.memoizedState),(l=hr||Ii(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return aa(e,t,n,r,a,i)}function aa(e,t,n,r,i,a){na(e,t);var o=!!(t.flags&128);if(!r&&!o)return i&&Pt(t,n,!1),va(e,t,a);r=t.stateNode,Yi.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=$n(t,e.child,null,a),t.child=$n(t,null,s,a)):Zi(e,t,s,a),t.memoizedState=r.state,i&&Pt(t,n,!0),t.child}function oa(e){var t=e.stateNode;t.pendingContext?jt(e,t.pendingContext,t.pendingContext!==t.context):t.context&&jt(e,t.context,!1),kr(e,t.containerInfo)}function sa(e,t,n,r,i){return Wn(),Gn(i),t.flags|=256,Zi(e,t,n,r),t.child}var ca={dehydrated:null,treeContext:null,retryLane:0};function la(e){return{baseLanes:e,cachePool:null,transitions:null}}function ua(e,t,n){var r=t.pendingProps,i=Nr.current,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(i&2)),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ct(Nr,i&1),e===null)return Bn(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.lanes=t.mode&1?Xe(e)?8:1073741824:1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Ns(o,r,0,null),e=Ms(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=la(n),t.memoizedState=ca,e):da(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return pa(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=As(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=Ms(a,o,n,null),a.flags|=2):a=As(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?la(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=ca,r}return a=e.child,e=a.sibling,r=As(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function da(e,t){return t=Ns({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function fa(e,t,n,r){return r!==null&&Gn(r),$n(t,e.child,null,n),e=da(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function pa(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=Vi(Error(a(422))),fa(e,t,s,r)):t.memoizedState===null?(o=r.fallback,i=t.mode,r=Ns({mode:`visible`,children:r.children},i,0,null),o=Ms(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&$n(t,e.child,null,s),t.child.memoizedState=la(s),t.memoizedState=ca,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return fa(e,t,s,null);if(Xe(i))return r=Ze(i).digest,o=Error(a(419)),r=Vi(o,r,void 0),fa(e,t,s,r);if(n=(s&e.childLanes)!==0,Xi||n){if(r=So,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=(i&(r.suspendedLanes|s))===0?i:0,i!==0&&i!==o.retryLane&&(o.retryLane=i,mr(e,i),Xo(r,e,i,-1))}return ls(),r=Vi(Error(a(421))),fa(e,t,s,r)}return Ye(i)?(t.flags|=128,t.child=e.child,t=Ss.bind(null,e),Qe(i,t),null):(e=o.treeContext,ue&&(Nn=nt(i),Mn=t,Pn=!0,In=null,Fn=!1,e!==null&&(Cn[wn++]=En,Cn[wn++]=Dn,Cn[wn++]=Tn,En=e.id,Dn=e.overflow,Tn=t)),t=da(t,r.children),t.flags|=4096,t)}function ma(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),cr(e.return,t,n)}function ha(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function ga(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Zi(e,t,r.children,n),r=Nr.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ma(e,n,t);else if(e.tag===19)ma(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ct(Nr,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Pr(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ha(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Pr(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ha(t,!0,n,null,a);break;case`together`:ha(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function _a(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function va(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ko|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=As(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=As(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ya(e,t,n){switch(t.tag){case 3:oa(t),Wn();break;case 5:jr(t);break;case 1:kt(t.type)&&Nt(t);break;case 4:kr(t,t.stateNode.containerInfo);break;case 10:or(t,t.type._context,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ct(Nr,Nr.current&1),e=va(e,t,n),e===null?null:e.sibling):ua(e,t,n):(Ct(Nr,Nr.current&1),t.flags|=128,null);Ct(Nr,Nr.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ga(e,t,n);t.flags|=128}var i=t.memoizedState;if(i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ct(Nr,Nr.current),r)break;return null;case 22:case 23:return t.lanes=0,ta(e,t,n)}return va(e,t,n)}function ba(e){e.flags|=4}function xa(e,t){if(e!==null&&e.child===t.child)return!0;if(t.flags&16)return!1;for(e=t.child;e!==null;){if(e.flags&12854||e.subtreeFlags&12854)return!1;e=e.sibling}return!0}var Sa,Ca,wa,Ta;if(ce)Sa=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)I(e,n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ca=function(){},wa=function(e,t,n,r,i){if(e=e.memoizedProps,e!==r){var a=t.stateNode,o=Or(Tr.current);n=te(a,n,e,r,i,o),(t.updateQueue=n)&&ba(t)}},Ta=function(e,t,n,r){n!==r&&ba(t)};else if(le){Sa=function(e,t,n,r){for(var i=t.child;i!==null;){if(i.tag===5){var a=i.stateNode;n&&r&&(a=We(a,i.type,i.memoizedProps,i)),I(e,a)}else if(i.tag===6)a=i.stateNode,n&&r&&(a=Ge(a,i.memoizedProps,i)),I(e,a);else if(i.tag!==4){if(i.tag===22&&i.memoizedState!==null)a=i.child,a!==null&&(a.return=i),Sa(e,i,!0,!0);else if(i.child!==null){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};var Ea=function(e,t,n,r){for(var i=t.child;i!==null;){if(i.tag===5){var a=i.stateNode;n&&r&&(a=We(a,i.type,i.memoizedProps,i)),Ve(e,a)}else if(i.tag===6)a=i.stateNode,n&&r&&(a=Ge(a,i.memoizedProps,i)),Ve(e,a);else if(i.tag!==4){if(i.tag===22&&i.memoizedState!==null)a=i.child,a!==null&&(a.return=i),Ea(e,i,!0,!0);else if(i.child!==null){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};Ca=function(e,t){var n=t.stateNode;if(!xa(e,t)){e=n.containerInfo;var r=Be(e);Ea(r,t,!1,!1),n.pendingChildren=r,ba(t),He(e,r)}},wa=function(e,t,n,r,i){var a=e.stateNode,o=e.memoizedProps;if((e=xa(e,t))&&o===r)t.stateNode=a;else{var s=t.stateNode,c=Or(Tr.current),l=null;o!==r&&(l=te(s,n,o,r,i,c)),e&&l===null?t.stateNode=a:(a=ze(a,l,n,o,r,t,e,s),L(a,n,r,i,c)&&ba(t),t.stateNode=a,e?ba(t):Sa(a,t,!1,!1))}},Ta=function(e,t,n,r){n===r?t.stateNode=e.stateNode:(e=Or(Dr.current),n=Or(Tr.current),t.stateNode=re(r,e,n,t),ba(t))}}else Ca=function(){},wa=function(){},Ta=function(){};function Oa(e,t){if(!Pn)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ka(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Aa(e,t,n){var r=t.pendingProps;switch(jn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ka(t),null;case 1:return kt(t.type)&&At(),ka(t),null;case 3:return n=t.stateNode,Ar(),St(Et),St(Tt),Ir(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hn(t)?ba(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,In!==null&&(es(In),In=null))),Ca(e,t),ka(t),null;case 5:Mr(t),n=Or(Dr.current);var i=t.type;if(e!==null&&t.stateNode!=null)wa(e,t,i,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(a(166));return ka(t),null}if(e=Or(Tr.current),Hn(t)){if(!ue)throw Error(a(175));e=rt(t.stateNode,t.type,t.memoizedProps,n,e,t,!Fn),t.updateQueue=e,e!==null&&ba(t)}else{var o=F(i,r,n,e,t);Sa(o,t,!1,!1),t.stateNode=o,L(o,i,r,n,e)&&ba(t)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ka(t),null;case 6:if(e&&t.stateNode!=null)Ta(e,t,e.memoizedProps,r);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=Or(Dr.current),n=Or(Tr.current),Hn(t)){if(!ue)throw Error(a(176));if(e=t.stateNode,n=t.memoizedProps,(r=it(e,n,t,!Fn))&&(i=Mn,i!==null))switch(i.tag){case 3:ft(i.stateNode.containerInfo,e,n,!!(i.mode&1));break;case 5:pt(i.type,i.memoizedProps,i.stateNode,e,n,!!(i.mode&1))}r&&ba(t)}else t.stateNode=re(r,e,n,t)}return ka(t),null;case 13:if(St(Nr),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Pn&&Nn!==null&&t.mode&1&&!(t.flags&128))Un(),Wn(),t.flags|=98560,i=!1;else if(i=Hn(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(!ue)throw Error(a(344));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));at(i,t)}else Wn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ka(t),i=!1}else In!==null&&(es(In),In=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(n=r!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Nr.current&1?Do===0&&(Do=3):ls())),t.updateQueue!==null&&(t.flags|=4),ka(t),null);case 4:return Ar(),Ca(e,t),e===null&&fe(t.stateNode.containerInfo),ka(t),null;case 10:return sr(t.type._context),ka(t),null;case 17:return kt(t.type)&&At(),ka(t),null;case 19:if(St(Nr),i=t.memoizedState,i===null)return ka(t),null;if(r=!!(t.flags&128),o=i.rendering,o===null){if(r)Oa(i,!1);else{if(Do!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Pr(e),o!==null){for(t.flags|=128,Oa(i,!1),e=o.updateQueue,e!==null&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,n=t.child;n!==null;)r=n,i=e,r.flags&=14680066,o=r.alternate,o===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=o.childLanes,r.lanes=o.lanes,r.child=o.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=o.memoizedProps,r.memoizedState=o.memoizedState,r.updateQueue=o.updateQueue,r.type=o.type,i=o.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n=n.sibling;return Ct(Nr,Nr.current&1|2),t.child}e=e.sibling}i.tail!==null&&nn()>Fo&&(t.flags|=128,r=!0,Oa(i,!1),t.lanes=4194304)}}else{if(!r){if(e=Pr(o),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,e!==null&&(t.updateQueue=e,t.flags|=4),Oa(i,!0),i.tail===null&&i.tailMode===`hidden`&&!o.alternate&&!Pn)return ka(t),null}else 2*nn()-i.renderingStartTime>Fo&&n!==1073741824&&(t.flags|=128,r=!0,Oa(i,!1),t.lanes=4194304)}i.isBackwards?(o.sibling=t.child,t.child=o):(e=i.last,e===null?t.child=o:e.sibling=o,i.last=o)}return i.tail===null?(ka(t),null):(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=nn(),t.sibling=null,e=Nr.current,Ct(Nr,r?e&1|2:e&1),t);case 22:case 23:return as(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?To&1073741824&&(ka(t),ce&&t.subtreeFlags&6&&(t.flags|=8192)):ka(t),null;case 24:return null;case 25:return null}throw Error(a(156,t.tag))}function ja(e,t){switch(jn(t),t.tag){case 1:return kt(t.type)&&At(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ar(),St(Et),St(Tt),Ir(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Mr(t),null;case 13:if(St(Nr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Wn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return St(Nr),null;case 4:return Ar(),null;case 10:return sr(t.type._context),null;case 22:case 23:return as(),null;case 24:return null;default:return null}}var Ma=!1,Na=!1,Pa=typeof WeakSet==`function`?WeakSet:Set,H=null;function Fa(e,t){var n=e.ref;if(n!==null){if(typeof n==`function`)try{n(null)}catch(n){ys(e,t,n)}else n.current=null}}function Ia(e,t,n){try{n()}catch(n){ys(e,t,n)}}var La=!1;function Ra(e,t){for(N(e.containerInfo),H=t;H!==null;)if(e=H,t=e.child,e.subtreeFlags&1028&&t!==null)t.return=e,H=t;else for(;H!==null;){e=H;try{var n=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(n!==null){var r=n.memoizedProps,i=n.memoizedState,o=e.stateNode;o.__reactInternalSnapshotBeforeUpdate=o.getSnapshotBeforeUpdate(e.elementType===e.type?r:Ni(e.type,r),i)}break;case 3:ce&&Re(e.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(t){ys(e,e.return,t)}if(t=e.sibling,t!==null){t.return=e.return,H=t;break}H=e.return}return n=La,La=!1,n}function za(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Ia(t,n,a)}i=i.next}while(i!==r)}}function Ba(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Va(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=j(n);break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Ha(e){var t=e.alternate;t!==null&&(e.alternate=null,Ha(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&me(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ua(e){return e.tag===5||e.tag===3||e.tag===4}function Wa(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ua(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ga(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?je(n,e,t):Ee(n,e);else if(r!==4&&(e=e.child,e!==null))for(Ga(e,t,n),e=e.sibling;e!==null;)Ga(e,t,n),e=e.sibling}function Ka(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?Ae(n,e,t):Te(n,e);else if(r!==4&&(e=e.child,e!==null))for(Ka(e,t,n),e=e.sibling;e!==null;)Ka(e,t,n),e=e.sibling}var qa=null,Ja=!1;function Ya(e,t,n){for(n=n.child;n!==null;)Xa(e,t,n),n=n.sibling}function Xa(e,t,n){if(ln&&typeof ln.onCommitFiberUnmount==`function`)try{ln.onCommitFiberUnmount(cn,n)}catch{}switch(n.tag){case 5:Na||Fa(n,t);case 6:if(ce){var r=qa,i=Ja;qa=null,Ya(e,t,n),qa=r,Ja=i,qa!==null&&(Ja?R(qa,n.stateNode):Me(qa,n.stateNode))}else Ya(e,t,n);break;case 18:ce&&qa!==null&&(Ja?ut(qa,n.stateNode):lt(qa,n.stateNode));break;case 4:ce?(r=qa,i=Ja,qa=n.stateNode.containerInfo,Ja=!0,Ya(e,t,n),qa=r,Ja=i):(le&&(r=n.stateNode.containerInfo,i=Be(r),Ue(r,i)),Ya(e,t,n));break;case 0:case 11:case 14:case 15:if(!Na&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Ia(n,t,o),i=i.next}while(i!==r)}Ya(e,t,n);break;case 1:if(!Na&&(Fa(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){ys(n,t,e)}Ya(e,t,n);break;case 21:Ya(e,t,n);break;case 22:n.mode&1?(Na=(r=Na)||n.memoizedState!==null,Ya(e,t,n),Na=r):Ya(e,t,n);break;default:Ya(e,t,n)}}function Za(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Pa),t.forEach(function(t){var r=Cs.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Qa(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t;if(ce){var c=s;a:for(;c!==null;){switch(c.tag){case 5:qa=c.stateNode,Ja=!1;break a;case 3:qa=c.stateNode.containerInfo,Ja=!0;break a;case 4:qa=c.stateNode.containerInfo,Ja=!0;break a}c=c.return}if(qa===null)throw Error(a(160));Xa(o,s,i),qa=null,Ja=!1}else Xa(o,s,i);var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(e){ys(i,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$a(t,e),t=t.sibling}function $a(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Qa(t,e),eo(e),r&4){try{za(3,e,e.return),Ba(3,e)}catch(t){ys(e,e.return,t)}try{za(5,e,e.return)}catch(t){ys(e,e.return,t)}}break;case 1:Qa(t,e),eo(e),r&512&&n!==null&&Fa(n,n.return);break;case 5:if(Qa(t,e),eo(e),r&512&&n!==null&&Fa(n,n.return),ce){if(e.flags&32){var i=e.stateNode;try{Ne(i)}catch(t){ys(e,e.return,t)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps;if(n=n===null?o:n.memoizedProps,r=e.type,t=e.updateQueue,e.updateQueue=null,t!==null)try{ke(i,t,r,n,o,e)}catch(t){ys(e,e.return,t)}}}break;case 6:if(Qa(t,e),eo(e),r&4&&ce){if(e.stateNode===null)throw Error(a(162));i=e.stateNode,o=e.memoizedProps,n=n===null?o:n.memoizedProps;try{De(i,n,o)}catch(t){ys(e,e.return,t)}}break;case 3:if(Qa(t,e),eo(e),r&4){if(ce&&ue&&n!==null&&n.memoizedState.isDehydrated)try{st(t.containerInfo)}catch(t){ys(e,e.return,t)}if(le){i=t.containerInfo,o=t.pendingChildren;try{Ue(i,o)}catch(t){ys(e,e.return,t)}}}break;case 4:if(Qa(t,e),eo(e),r&4&&le){o=e.stateNode,i=o.containerInfo,o=o.pendingChildren;try{Ue(i,o)}catch(t){ys(e,e.return,t)}}break;case 13:Qa(t,e),eo(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(Po=nn())),r&4&&Za(e);break;case 22:var s=n!==null&&n.memoizedState!==null;if(e.mode&1?(Na=(n=Na)||s,Qa(t,e),Na=n):Qa(t,e),eo(e),r&8192){if(n=e.memoizedState!==null,(e.stateNode.isHidden=n)&&!s&&e.mode&1)for(H=e,r=e.child;r!==null;){for(t=H=r;H!==null;){s=H;var c=s.child;switch(s.tag){case 0:case 11:case 14:case 15:za(4,s,s.return);break;case 1:Fa(s,s.return);var l=s.stateNode;if(typeof l.componentWillUnmount==`function`){var u=s,d=s.return;try{var f=u;l.props=f.memoizedProps,l.state=f.memoizedState,l.componentWillUnmount()}catch(e){ys(u,d,e)}}break;case 5:Fa(s,s.return);break;case 22:if(s.memoizedState!==null){U(t);continue}}c===null?U(t):(c.return=s,H=c)}r=r.sibling}if(ce){a:if(r=null,ce)for(t=e;;){if(t.tag===5){if(r===null){r=t;try{i=t.stateNode,n?Pe(i):Ie(t.stateNode,t.memoizedProps)}catch(t){ys(e,e.return,t)}}}else if(t.tag===6){if(r===null)try{o=t.stateNode,n?Fe(o):Le(o,t.memoizedProps)}catch(t){ys(e,e.return,t)}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}}}break;case 19:Qa(t,e),eo(e),r&4&&Za(e);break;case 21:break;default:Qa(t,e),eo(e)}}function eo(e){var t=e.flags;if(t&2){try{if(ce){b:{for(var n=e.return;n!==null;){if(Ua(n)){var r=n;break b}n=n.return}throw Error(a(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ne(i),r.flags&=-33),Ka(e,Wa(e),i);break;case 3:case 4:var o=r.stateNode.containerInfo;Ga(e,Wa(e),o);break;default:throw Error(a(161))}}}catch(t){ys(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function to(e,t,n){H=e,no(e,t,n)}function no(e,t,n){for(var r=!!(e.mode&1);H!==null;){var i=H,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Ma;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||Na;s=Ma;var l=Na;if(Ma=o,(Na=c)&&!l)for(H=i;H!==null;)o=H,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?io(i):(c.return=o,H=c);for(;a!==null;)H=a,no(a,t,n),a=a.sibling;H=i,Ma=s,Na=l}ro(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,H=a):ro(e,t,n)}}function ro(e){for(;H!==null;){var t=H;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Na||Ba(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Na){if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Ni(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}}var o=t.updateQueue;o!==null&&Cr(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=j(t.child.stateNode);break;case 1:n=t.child.stateNode}Cr(t,s,n)}break;case 5:var c=t.stateNode;n===null&&t.flags&4&&Oe(c,t.type,t.memoizedProps,t);break;case 6:break;case 4:break;case 12:break;case 13:if(ue&&t.memoizedState===null){var l=t.alternate;if(l!==null){var u=l.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&ct(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}Na||t.flags&512&&Va(t)}catch(e){ys(t,t.return,e)}}if(t===e){H=null;break}if(n=t.sibling,n!==null){n.return=t.return,H=n;break}H=t.return}}function U(e){for(;H!==null;){var t=H;if(t===e){H=null;break}var n=t.sibling;if(n!==null){n.return=t.return,H=n;break}H=t.return}}function io(e){for(;H!==null;){var t=H;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ba(4,t)}catch(e){ys(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){ys(t,i,e)}}var a=t.return;try{Va(t)}catch(e){ys(t,a,e)}break;case 5:var o=t.return;try{Va(t)}catch(e){ys(t,o,e)}}}catch(e){ys(t,t.return,e)}if(t===e){H=null;break}var s=t.sibling;if(s!==null){s.return=t.return,H=s;break}H=t.return}}var ao=0,oo=1,so=2,co=3,lo=4;if(typeof Symbol==`function`&&Symbol.for){var uo=Symbol.for;ao=uo(`selector.component`),oo=uo(`selector.has_pseudo_class`),so=uo(`selector.role`),co=uo(`selector.test_id`),lo=uo(`selector.text`)}function fo(e){var t=de(e);if(t!=null){if(typeof t.memoizedProps[`data-testname`]!=`string`)throw Error(a(364));return t}if(e=ve(e),e===null)throw Error(a(362));return e.stateNode.current}function po(e,t){switch(t.$$typeof){case ao:if(e.type===t.value)return!0;break;case oo:a:{t=t.value,e=[e,0];for(var n=0;n<e.length;){var r=e[n++],i=e[n++],o=t[i];if(r.tag!==5||!xe(r)){for(;o!=null&&po(r,o);)i++,o=t[i];if(i===t.length){t=!0;break a}for(r=r.child;r!==null;)e.push(r,i),r=r.sibling}}t=!1}return t;case so:if(e.tag===5&&Se(e.stateNode,t.value))return!0;break;case lo:if((e.tag===5||e.tag===6)&&(e=be(e),e!==null&&0<=e.indexOf(t.value)))return!0;break;case co:if(e.tag===5&&(e=e.memoizedProps[`data-testname`],typeof e==`string`&&e.toLowerCase()===t.value.toLowerCase()))return!0;break;default:throw Error(a(365))}return!1}function mo(e){switch(e.$$typeof){case ao:return`<`+(S(e.value)||`Unknown`)+`>`;case oo:return`:has(`+(mo(e)||``)+`)`;case so:return`[role="`+e.value+`"]`;case lo:return`"`+e.value+`"`;case co:return`[data-testname="`+e.value+`"]`;default:throw Error(a(365))}}function ho(e,t){var n=[];e=[e,0];for(var r=0;r<e.length;){var i=e[r++],a=e[r++],o=t[a];if(i.tag!==5||!xe(i)){for(;o!=null&&po(i,o);)a++,o=t[a];if(a===t.length)n.push(i);else for(i=i.child;i!==null;)e.push(i,a),i=i.sibling}}return n}function go(e,t){if(!_e)throw Error(a(363));e=fo(e),e=ho(e,t),t=[],e=Array.from(e);for(var n=0;n<e.length;){var r=e[n++];if(r.tag===5)xe(r)||t.push(r.stateNode);else for(r=r.child;r!==null;)e.push(r),r=r.sibling}return t}var _o=Math.ceil,vo=o.ReactCurrentDispatcher,yo=o.ReactCurrentOwner,bo=o.ReactCurrentBatchConfig,xo=0,So=null,Co=null,wo=0,To=0,Eo=xt(0),Do=0,Oo=null,ko=0,Ao=0,jo=0,Mo=null,No=null,Po=0,Fo=1/0,Io=null;function Lo(){Fo=nn()+500}var Ro=!1,zo=null,Bo=null,Vo=!1,Ho=null,Uo=0,Wo=0,Go=null,Ko=-1,qo=0;function Jo(){return xo&6?nn():Ko===-1?Ko=nn():Ko}function Yo(e){return e.mode&1?xo&2&&wo!==0?wo&-wo:Kn.transition===null?(e=Xt,e===0?pe():e):(qo===0&&(qo=Kt()),qo):1}function Xo(e,t,n,r){if(50<Wo)throw Wo=0,Go=null,Error(a(185));Jt(e,n,r),(!(xo&2)||e!==So)&&(e===So&&(!(xo&2)&&(Ao|=n),Do===4&&ns(e,wo)),Zo(e,r),n===1&&xo===0&&!(t.mode&1)&&(Lo(),mn&&vn()))}function Zo(e,t){var n=e.callbackNode;Wt(e,t);var r=Ht(e,e===So?wo:0);if(r===0)n!==null&&$t(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&$t(n),t===1)e.tag===0?_n(rs.bind(null,e)):gn(rs.bind(null,e)),he?ge(function(){!(xo&6)&&vn()}):Qt(rn,vn),n=null;else{switch(Zt(r)){case 1:n=rn;break;case 4:n=an;break;case 16:n=on;break;case 536870912:n=sn;break;default:n=on}n=Ts(n,Qo.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Qo(e,t){if(Ko=-1,qo=0,xo&6)throw Error(a(327));var n=e.callbackNode;if(_s()&&e.callbackNode!==n)return null;var r=Ht(e,e===So?wo:0);if(r===0)return null;if(r&30||(r&e.expiredLanes)!==0||t)t=us(e,r);else{t=r;var i=xo;xo|=2;var o=cs();(So!==e||wo!==t)&&(Io=null,Lo(),os(e,t));do try{fs();break}catch(t){ss(e,t)}while(1);ar(),vo.current=o,xo=i,Co===null?(So=null,wo=0,t=Do):t=0}if(t!==0){if(t===2&&(i=Gt(e),i!==0&&(r=i,t=$o(e,i))),t===1)throw n=Oo,os(e,0),ns(e,r),Zo(e,nn()),n;if(t===6)ns(e,r);else{if(i=e.current.alternate,!(r&30)&&!ts(i)&&(t=us(e,r),t===2&&(o=Gt(e),o!==0&&(r=o,t=$o(e,o))),t===1))throw n=Oo,os(e,0),ns(e,r),Zo(e,nn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(a(345));case 2:hs(e,No,Io);break;case 3:if(ns(e,r),(r&130023424)===r&&(t=Po+500-nn(),10<t)){if(Ht(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Jo(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ie(hs.bind(null,e,No,Io),t);break}hs(e,No,Io);break;case 4:if(ns(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-Ft(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=nn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_o(r/1960))-r,10<r){e.timeoutHandle=ie(hs.bind(null,e,No,Io),r);break}hs(e,No,Io);break;case 5:hs(e,No,Io);break;default:throw Error(a(329))}}}return Zo(e,nn()),e.callbackNode===n?Qo.bind(null,e):null}function $o(e,t){var n=Mo;return e.current.memoizedState.isDehydrated&&(os(e,t).flags|=256),e=us(e,t),e!==2&&(t=No,No=n,t!==null&&es(t)),e}function es(e){No===null?No=e:No.push.apply(No,e)}function ts(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!fn(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ns(e,t){for(t&=~jo,t&=~Ao,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ft(t),r=1<<n;e[n]=-1,t&=~r}}function rs(e){if(xo&6)throw Error(a(327));_s();var t=Ht(e,0);if(!(t&1))return Zo(e,nn()),null;var n=us(e,t);if(e.tag!==0&&n===2){var r=Gt(e);r!==0&&(t=r,n=$o(e,r))}if(n===1)throw n=Oo,os(e,0),ns(e,t),Zo(e,nn()),n;if(n===6)throw Error(a(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,hs(e,No,Io),Zo(e,nn()),null}function is(e){Ho!==null&&Ho.tag===0&&!(xo&6)&&_s();var t=xo;xo|=1;var n=bo.transition,r=Xt;try{if(bo.transition=null,Xt=1,e)return e()}finally{Xt=r,bo.transition=n,xo=t,!(xo&6)&&vn()}}function as(){To=Eo.current,St(Eo)}function os(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==oe&&(e.timeoutHandle=oe,ae(n)),Co!==null)for(n=Co.return;n!==null;){var r=n;switch(jn(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&At();break;case 3:Ar(),St(Et),St(Tt),Ir();break;case 5:Mr(r);break;case 4:Ar();break;case 13:St(Nr);break;case 19:St(Nr);break;case 10:sr(r.type._context);break;case 22:case 23:as()}n=n.return}if(So=e,Co=e=As(e.current,null),wo=To=t,Do=0,Oo=null,jo=Ao=ko=0,No=Mo=null,dr!==null){for(t=0;t<dr.length;t++)if(n=dr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}dr=null}return e}function ss(e,t){do{var n=Co;try{if(ar(),Lr.current=ki,Ur){for(var r=Br.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ur=!1}if(zr=0,Hr=Vr=Br=null,Wr=!1,Gr=0,yo.current=null,n===null||n.return===null){Do=1,Oo=t,Co=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=wo,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=qi(s);if(m!==null){m.flags&=-257,Ji(m,s,c,o,t),m.mode&1&&Ki(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}if(!(t&1)){Ki(o,u,t),ls();break a}l=Error(a(426))}else if(Pn&&c.mode&1){var _=qi(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Ji(_,s,c,o,t),Gn(Bi(l,c));break a}}o=l=Bi(l,c),Do!==4&&(Do=2),Mo===null?Mo=[o]:Mo.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Wi(o,l,t);xr(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(Bo===null||!Bo.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Gi(o,c,t);xr(o,x);break a}}o=o.return}while(o!==null)}ms(n)}catch(e){t=e,Co===n&&n!==null&&(Co=n=n.return);continue}break}while(1)}function cs(){var e=vo.current;return vo.current=ki,e===null?ki:e}function ls(){(Do===0||Do===3||Do===2)&&(Do=4),So===null||!(ko&268435455)&&!(Ao&268435455)||ns(So,wo)}function us(e,t){var n=xo;xo|=2;var r=cs();(So!==e||wo!==t)&&(Io=null,os(e,t));do try{ds();break}catch(t){ss(e,t)}while(1);if(ar(),xo=n,vo.current=r,Co!==null)throw Error(a(261));return So=null,wo=0,Do}function ds(){for(;Co!==null;)ps(Co)}function fs(){for(;Co!==null&&!en();)ps(Co)}function ps(e){var t=ws(e.alternate,e,To);e.memoizedProps=e.pendingProps,t===null?ms(e):Co=t,yo.current=null}function ms(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=ja(n,t),n!==null){n.flags&=32767,Co=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Do=6,Co=null;return}}else if(n=Aa(n,t,To),n!==null){Co=n;return}if(t=t.sibling,t!==null){Co=t;return}Co=t=e}while(t!==null);Do===0&&(Do=5)}function hs(e,t,n){var r=Xt,i=bo.transition;try{bo.transition=null,Xt=1,gs(e,t,n,r)}finally{bo.transition=i,Xt=r}return null}function gs(e,t,n,r){do _s();while(Ho!==null);if(xo&6)throw Error(a(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(z(e,o),e===So&&(Co=So=null,wo=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Vo||(Vo=!0,Ts(on,function(){return _s(),null})),o=!!(n.flags&15990),n.subtreeFlags&15990||o){o=bo.transition,bo.transition=null;var s=Xt;Xt=1;var c=xo;xo|=4,yo.current=null,Ra(e,n),$a(n,e),P(e.containerInfo),e.current=n,to(n,e,i),tn(),xo=c,Xt=s,bo.transition=o}else e.current=n;if(Vo&&(Vo=!1,Ho=e,Uo=i),o=e.pendingLanes,o===0&&(Bo=null),un(n.stateNode,r),Zo(e,nn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ro)throw Ro=!1,e=zo,zo=null,e;return Uo&1&&e.tag!==0&&_s(),o=e.pendingLanes,o&1?e===Go?Wo++:(Wo=0,Go=e):Wo=0,vn(),null}function _s(){if(Ho!==null){var e=Zt(Uo),t=bo.transition,n=Xt;try{if(bo.transition=null,Xt=16>e?16:e,Ho===null)var r=!1;else{if(e=Ho,Ho=null,Uo=0,xo&6)throw Error(a(331));var i=xo;for(xo|=4,H=e.current;H!==null;){var o=H,s=o.child;if(H.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(H=u;H!==null;){var d=H;switch(d.tag){case 0:case 11:case 15:za(8,d,o)}var f=d.child;if(f!==null)f.return=d,H=f;else for(;H!==null;){d=H;var p=d.sibling,m=d.return;if(Ha(d),d===u){H=null;break}if(p!==null){p.return=m,H=p;break}H=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}H=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,H=s;else b:for(;H!==null;){if(o=H,o.flags&2048)switch(o.tag){case 0:case 11:case 15:za(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,H=v;break b}H=o.return}}var y=e.current;for(H=y;H!==null;){s=H;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,H=b;else b:for(s=y;H!==null;){if(c=H,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Ba(9,c)}}catch(e){ys(c,c.return,e)}if(c===s){H=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,H=x;break b}H=c.return}}if(xo=i,vn(),ln&&typeof ln.onPostCommitFiberRoot==`function`)try{ln.onPostCommitFiberRoot(cn,e)}catch{}r=!0}return r}finally{Xt=n,bo.transition=t}}return!1}function vs(e,t,n){t=Bi(n,t),t=Wi(e,t,1),e=yr(e,t,1),t=Jo(),e!==null&&(Jt(e,1,t),Zo(e,t))}function ys(e,t,n){if(e.tag===3)vs(e,e,n);else for(;t!==null;){if(t.tag===3){vs(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Bo===null||!Bo.has(r))){e=Bi(n,e),e=Gi(t,e,1),t=yr(t,e,1),e=Jo(),t!==null&&(Jt(t,1,e),Zo(t,e));break}}t=t.return}}function bs(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Jo(),e.pingedLanes|=e.suspendedLanes&n,So===e&&(wo&n)===n&&(Do===4||Do===3&&(wo&130023424)===wo&&500>nn()-Po?os(e,0):jo|=n),Zo(e,t)}function xs(e,t){t===0&&(e.mode&1?(t=Bt,Bt<<=1,!(Bt&130023424)&&(Bt=4194304)):t=1);var n=Jo();e=mr(e,t),e!==null&&(Jt(e,t,n),Zo(e,n))}function Ss(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xs(e,n)}function Cs(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(a(314))}r!==null&&r.delete(t),xs(e,n)}var ws=function(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps||Et.current)Xi=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Xi=!1,ya(e,t,n);Xi=!!(e.flags&131072)}}else Xi=!1,Pn&&t.flags&1048576&&kn(t,Sn,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_a(e,t),e=t.pendingProps;var i=Ot(t,Tt.current);lr(t,n),i=Yr(null,t,r,e,i,n);var o=Xr();return t.flags|=1,typeof i==`object`&&i&&typeof i.render==`function`&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kt(r)?(o=!0,Nt(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,gr(t),i.updater=Fi,t.stateNode=i,i._reactInternals=t,zi(t,r,e,n),t=aa(null,t,r,!0,o,n)):(t.tag=0,Pn&&o&&An(t),Zi(null,t,i,n),t=t.child),t;case 16:r=t.elementType;a:{switch(_a(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=ks(r),e=Ni(r,e),i){case 0:t=ra(null,t,r,e,n);break a;case 1:t=ia(null,t,r,e,n);break a;case 11:t=Qi(null,t,r,e,n);break a;case 14:t=$i(null,t,r,Ni(r.type,e),n);break a}throw Error(a(306,r,``))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ni(r,i),ra(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ni(r,i),ia(e,t,r,i,n);case 3:a:{if(oa(t),e===null)throw Error(a(387));r=t.pendingProps,o=t.memoizedState,i=o.element,_r(e,t),Sr(t,r,null,n);var s=t.memoizedState;if(r=s.element,ue&&o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Bi(Error(a(423)),t),t=sa(e,t,r,n,i);break a}if(r!==i){i=Bi(Error(a(424)),t),t=sa(e,t,r,n,i);break a}for(ue&&(Nn=tt(t.stateNode.containerInfo),Mn=t,Pn=!0,In=null,Fn=!1),n=er(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Wn(),r===i){t=va(e,t,n);break a}Zi(e,t,r,n)}t=t.child}return t;case 5:return jr(t),e===null&&Bn(t),r=t.type,i=t.pendingProps,o=e===null?null:e.memoizedProps,s=i.children,ne(r,i)?s=null:o!==null&&ne(r,o)&&(t.flags|=32),na(e,t),Zi(e,t,s,n),t.child;case 6:return e===null&&Bn(t),null;case 13:return ua(e,t,n);case 4:return kr(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=$n(t,null,r,n):Zi(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ni(r,i),Qi(e,t,r,i,n);case 7:return Zi(e,t,t.pendingProps,n),t.child;case 8:return Zi(e,t,t.pendingProps.children,n),t.child;case 12:return Zi(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,or(t,r,s),o!==null){if(fn(o.value,s)){if(o.children===i.children&&!Et.current){t=va(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=vr(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),cr(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(a(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),cr(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}}Zi(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,lr(t,n),i=ur(i),r=r(i),t.flags|=1,Zi(e,t,r,n),t.child;case 14:return r=t.type,i=Ni(r,t.pendingProps),i=Ni(r.type,i),$i(e,t,r,i,n);case 15:return ea(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ni(r,i),_a(e,t),t.tag=1,kt(r)?(e=!0,Nt(t)):e=!1,lr(t,n),Li(t,r,i),zi(t,r,i,n),aa(null,t,r,!0,e,n);case 19:return ga(e,t,n);case 22:return ta(e,t,n)}throw Error(a(156,t.tag))};function Ts(e,t){return Qt(e,t)}function Es(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ds(e,t,n,r){return new Es(e,t,n,r)}function Os(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ks(e){if(typeof e==`function`)return+!!Os(e);if(e!=null){if(e=e.$$typeof,e===m)return 11;if(e===_)return 14}return 2}function As(e,t){var n=e.alternate;return n===null?(n=Ds(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function js(e,t,n,r,i,o){var s=2;if(r=e,typeof e==`function`)Os(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case l:return Ms(n.children,i,o,t);case u:s=8,i|=8;break;case d:return e=Ds(12,n,t,i|2),e.elementType=d,e.lanes=o,e;case h:return e=Ds(13,n,t,i),e.elementType=h,e.lanes=o,e;case g:return e=Ds(19,n,t,i),e.elementType=g,e.lanes=o,e;case y:return Ns(n,i,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case f:s=10;break a;case p:s=9;break a;case m:s=11;break a;case _:s=14;break a;case v:s=16,r=null;break a}throw Error(a(130,e==null?e:typeof e,``))}return t=Ds(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Ms(e,t,n,r){return e=Ds(7,e,r,t),e.lanes=n,e}function Ns(e,t,n,r){return e=Ds(22,e,r,t),e.elementType=y,e.lanes=n,e.stateNode={isHidden:!1},e}function Ps(e,t,n){return e=Ds(6,e,null,t),e.lanes=n,e}function Fs(e,t,n){return t=Ds(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Is(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=oe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qt(0),this.expirationTimes=qt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qt(0),this.identifierPrefix=r,this.onRecoverableError=i,ue&&(this.mutableSourceEagerHydrationData=null)}function Ls(e,t,n,r,i,a,o,s,c){return e=new Is(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Ds(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},gr(a),e}function Rs(e){if(!e)return wt;e=e._reactInternals;a:{if(w(e)!==e||e.tag!==1)throw Error(a(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(kt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(a(171))}if(e.tag===1){var n=e.type;if(kt(n))return Mt(e,n,t)}return t}function zs(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=D(t),e===null?null:e.stateNode}function Bs(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Vs(e,t){Bs(e,t),(e=e.alternate)&&Bs(e,t)}function Hs(e){return e=D(e),e===null?null:e.stateNode}function Us(){return null}return t.attemptContinuousHydration=function(e){if(e.tag===13){var t=mr(e,134217728);t!==null&&Xo(t,e,134217728,Jo()),Vs(e,134217728)}},t.attemptDiscreteHydration=function(e){if(e.tag===13){var t=mr(e,1);t!==null&&Xo(t,e,1,Jo()),Vs(e,1)}},t.attemptHydrationAtCurrentPriority=function(e){if(e.tag===13){var t=Yo(e),n=mr(e,t);n!==null&&Xo(n,e,t,Jo()),Vs(e,t)}},t.attemptSynchronousHydration=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Vt(t.pendingLanes);n!==0&&(Yt(t,n|1),Zo(t,nn()),!(xo&6)&&(Lo(),vn()))}break;case 13:is(function(){var t=mr(e,1);t!==null&&Xo(t,e,1,Jo())}),Vs(e,1)}},t.batchedUpdates=function(e,t){var n=xo;xo|=1;try{return e(t)}finally{xo=n,xo===0&&(Lo(),mn&&vn())}},t.createComponentSelector=function(e){return{$$typeof:ao,value:e}},t.createContainer=function(e,t,n,r,i,a,o){return Ls(e,t,!1,null,n,r,i,a,o)},t.createHasPseudoClassSelector=function(e){return{$$typeof:oo,value:e}},t.createHydrationContainer=function(e,t,n,r,i,a,o,s,c){return e=Ls(n,r,!0,e,i,a,o,s,c),e.context=Rs(null),n=e.current,r=Jo(),i=Yo(n),a=vr(r,i),a.callback=t??null,yr(n,a,i),e.current.lanes=i,Jt(e,i,r),Zo(e,r),e},t.createPortal=function(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}},t.createRoleSelector=function(e){return{$$typeof:so,value:e}},t.createTestNameSelector=function(e){return{$$typeof:co,value:e}},t.createTextSelector=function(e){return{$$typeof:lo,value:e}},t.deferredUpdates=function(e){var t=Xt,n=bo.transition;try{return bo.transition=null,Xt=16,e()}finally{Xt=t,bo.transition=n}},t.discreteUpdates=function(e,t,n,r,i){var a=Xt,o=bo.transition;try{return bo.transition=null,Xt=1,e(t,n,r,i)}finally{Xt=a,bo.transition=o,xo===0&&Lo()}},t.findAllNodes=go,t.findBoundingRects=function(e,t){if(!_e)throw Error(a(363));t=go(e,t),e=[];for(var n=0;n<t.length;n++)e.push(ye(t[n]));for(t=e.length-1;0<t;t--){n=e[t];for(var r=n.x,i=r+n.width,o=n.y,s=o+n.height,c=t-1;0<=c;c--)if(t!==c){var l=e[c],u=l.x,d=u+l.width,f=l.y,p=f+l.height;if(r>=u&&o>=f&&i<=d&&s<=p){e.splice(t,1);break}if(!(r!==u||n.width!==l.width||p<o||f>s)){f>o&&(l.height+=f-o,l.y=o),p<s&&(l.height=s-f),e.splice(t,1);break}if(!(o!==f||n.height!==l.height||d<r||u>i)){u>r&&(l.width+=u-r,l.x=r),d<i&&(l.width=i-u),e.splice(t,1);break}}}return e},t.findHostInstance=zs,t.findHostInstanceWithNoPortals=function(e){return e=E(e),e=e===null?null:k(e),e===null?null:e.stateNode},t.findHostInstanceWithWarning=function(e){return zs(e)},t.flushControlled=function(e){var t=xo;xo|=1;var n=bo.transition,r=Xt;try{bo.transition=null,Xt=1,e()}finally{Xt=r,bo.transition=n,xo=t,xo===0&&(Lo(),vn())}},t.flushPassiveEffects=_s,t.flushSync=is,t.focusWithin=function(e,t){if(!_e)throw Error(a(363));for(e=fo(e),t=ho(e,t),t=Array.from(t),e=0;e<t.length;){var n=t[e++];if(!xe(n)){if(n.tag===5&&Ce(n.stateNode))return!0;for(n=n.child;n!==null;)t.push(n),n=n.sibling}}return!1},t.getCurrentUpdatePriority=function(){return Xt},t.getFindAllNodesFailureDescription=function(e,t){if(!_e)throw Error(a(363));var n=0,r=[];e=[fo(e),0];for(var i=0;i<e.length;){var o=e[i++],s=e[i++],c=t[s];if((o.tag!==5||!xe(o))&&(po(o,c)&&(r.push(mo(c)),s++,s>n&&(n=s)),s<t.length))for(o=o.child;o!==null;)e.push(o,s),o=o.sibling}if(n<t.length){for(e=[];n<t.length;n++)e.push(mo(t[n]));return`findAllNodes was able to match part of the selector:
|
|
35
|
+
`+(r.join(` > `)+`
|
|
36
|
+
|
|
37
|
+
No matching component was found for:
|
|
38
|
+
`)+e.join(` > `)}return null},t.getPublicRootInstance=function(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return j(e.child.stateNode);default:return e.child.stateNode}},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:Hs,findFiberByHostInstance:e.findFiberByHostInstance||Us,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1`},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{cn=t.inject(e),ln=t}catch{}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!_e)throw Error(a(363));e=go(e,t);var i=we(e,n,r).disconnect;return{disconnect:function(){i()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=Xt;try{return Xt=e,t()}finally{Xt=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var i=t.current,a=Jo(),o=Yo(i);return n=Rs(n),t.context===null?t.context=n:t.pendingContext=n,t=vr(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=yr(i,t,o),e!==null&&(Xo(e,i,o,a),br(e,i,o)),o},t}})),ka=o(((e,t)=>{process.env.NODE_ENV!==`production`&&(t.exports=function(e){var t={},n=require("react"),r=Da(),i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,a=!1;function o(e){a=e}function s(e){if(!a){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];l(`warn`,e,n)}}function c(e){if(!a){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];l(`error`,e,n)}}function l(e,t,n){var r=i.ReactDebugCurrentFrame.getStackAddendum();r!==``&&(t+=`%s`,n=n.concat([r]));var a=n.map(function(e){return String(e)});a.unshift(`Warning: `+t),Function.prototype.apply.call(console[e],console,a)}var u=Object.assign;function d(e){return e._reactInternals}function f(e,t){e._reactInternals=t}var p=!1,m=!1,h=!0,g=!0,_=!0,v=!0,y=0,b=1,x=2,S=3,C=4,w=5,T=6,E=7,D=8,O=9,k=10,A=11,j=12,M=13,ee=14,N=15,P=16,F=17,I=18,L=19,te=21,ne=22,re=23,ie=24,ae=25,oe=Symbol.for(`react.element`),se=Symbol.for(`react.portal`),ce=Symbol.for(`react.fragment`),le=Symbol.for(`react.strict_mode`),ue=Symbol.for(`react.profiler`),de=Symbol.for(`react.provider`),fe=Symbol.for(`react.context`),pe=Symbol.for(`react.forward_ref`),me=Symbol.for(`react.suspense`),he=Symbol.for(`react.suspense_list`),ge=Symbol.for(`react.memo`),_e=Symbol.for(`react.lazy`),ve=Symbol.for(`react.scope`),ye=Symbol.for(`react.debug_trace_mode`),be=Symbol.for(`react.offscreen`),xe=Symbol.for(`react.legacy_hidden`),Se=Symbol.for(`react.cache`),Ce=Symbol.for(`react.tracing_marker`),we=Symbol.iterator,Te=`@@iterator`;function Ee(e){if(typeof e!=`object`||!e)return null;var t=we&&e[we]||e[Te];return typeof t==`function`?t:null}function De(e,t,n){var r=e.displayName;if(r)return r;var i=t.displayName||t.name||``;return i===``?n:n+`(`+i+`)`}function Oe(e){return e.displayName||`Context`}function ke(e){if(e==null)return null;if(typeof e.tag==`number`&&c(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ce:return`Fragment`;case se:return`Portal`;case ue:return`Profiler`;case le:return`StrictMode`;case me:return`Suspense`;case he:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case fe:return Oe(e)+`.Consumer`;case de:return Oe(e._context)+`.Provider`;case pe:return De(e,e.render,`ForwardRef`);case ge:var t=e.displayName||null;return t===null?ke(e.type)||`Memo`:t;case _e:var n=e,r=n._payload,i=n._init;try{return ke(i(r))}catch{return null}}return null}function Ae(e,t,n){var r=t.displayName||t.name||``;return e.displayName||(r===``?n:n+`(`+r+`)`)}function je(e){return e.displayName||`Context`}function Me(e){var t=e.tag,n=e.type;switch(t){case ie:return`Cache`;case O:return je(n)+`.Consumer`;case k:return je(n._context)+`.Provider`;case I:return`DehydratedFragment`;case A:return Ae(n,n.render,`ForwardRef`);case E:return`Fragment`;case w:return n;case C:return`Portal`;case S:return`Root`;case T:return`Text`;case P:return ke(n);case D:return n===le?`StrictMode`:`Mode`;case ne:return`Offscreen`;case j:return`Profiler`;case te:return`Scope`;case M:return`Suspense`;case L:return`SuspenseList`;case ae:return`TracingMarker`;case b:case y:case F:case x:case ee:case N:if(typeof n==`function`)return n.displayName||n.name||null;if(typeof n==`string`)return n}return null}var R=0,Ne=1,Pe=2,Fe=4,Ie=16,Le=32,Re=64,ze=128,Be=256,Ve=512,He=1024,Ue=2048,We=4096,Ge=8192,Ke=16384,qe=Ue|Fe|Re|Ve|He|Ke,Je=32767,Ye=32768,Xe=65536,Ze=131072,Qe=1048576,$e=2097152,et=4194304,tt=8388608,nt=16777216,rt=33554432,it=Fe|He|0,at=Pe|Fe|Ie|Le|Ve|We|Ge,ot=Fe|Re|Ve|Ge,st=Ue|Ie,ct=et|tt|$e,lt=i.ReactCurrentOwner;function ut(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{var r=t;do t=r,(t.flags&(Pe|We))!==R&&(n=t.return),r=t.return;while(r)}return t.tag===S?n:null}function dt(e){return ut(e)===e}function ft(e){var t=lt.current;if(t!==null&&t.tag===b){var n=t,r=n.stateNode;r._warnedAboutRefsInRender||c(`%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.`,Me(n)||`A component`),r._warnedAboutRefsInRender=!0}var i=d(e);return i?ut(i)===i:!1}function pt(e){if(ut(e)!==e)throw Error(`Unable to find node on an unmounted component.`)}function mt(e){var t=e.alternate;if(!t){var n=ut(e);if(n===null)throw Error(`Unable to find node on an unmounted component.`);return n===e?e:null}for(var r=e,i=t;;){var a=r.return;if(a===null)break;var o=a.alternate;if(o===null){var s=a.return;if(s!==null){r=i=s;continue}break}if(a.child===o.child){for(var c=a.child;c;){if(c===r)return pt(a),e;if(c===i)return pt(a),t;c=c.sibling}throw Error(`Unable to find node on an unmounted component.`)}if(r.return!==i.return)r=a,i=o;else{for(var l=!1,u=a.child;u;){if(u===r){l=!0,r=a,i=o;break}if(u===i){l=!0,i=a,r=o;break}u=u.sibling}if(!l){for(u=o.child;u;){if(u===r){l=!0,r=o,i=a;break}if(u===i){l=!0,i=o,r=a;break}u=u.sibling}if(!l)throw Error(`Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.`)}}if(r.alternate!==i)throw Error(`Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.`)}if(r.tag!==S)throw Error(`Unable to find node on an unmounted component.`);return r.stateNode.current===r?e:t}function ht(e){var t=mt(e);return t===null?null:gt(t)}function gt(e){if(e.tag===w||e.tag===T)return e;for(var t=e.child;t!==null;){var n=gt(t);if(n!==null)return n;t=t.sibling}return null}function _t(e){var t=mt(e);return t===null?null:vt(t)}function vt(e){if(e.tag===w||e.tag===T)return e;for(var t=e.child;t!==null;){if(t.tag!==C){var n=vt(t);if(n!==null)return n}t=t.sibling}return null}var yt=Array.isArray;function bt(e){return yt(e)}var xt=e.getPublicInstance,St=e.getRootHostContext,Ct=e.getChildHostContext,wt=e.prepareForCommit,Tt=e.resetAfterCommit,Et=e.createInstance,Dt=e.appendInitialChild,Ot=e.finalizeInitialChildren,kt=e.prepareUpdate,At=e.shouldSetTextContent,jt=e.createTextInstance,Mt=e.scheduleTimeout,Nt=e.cancelTimeout,Pt=e.noTimeout,Ft=e.isPrimaryRenderer,It=e.warnsIfNotActing,Lt=e.supportsMutation,Rt=e.supportsPersistence,zt=e.supportsHydration,Bt=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var Vt=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Ht=e.getCurrentEventPriority,Ut=e.detachDeletedInstance,Wt=e.supportsMicrotasks,Gt=e.scheduleMicrotask,Kt=e.supportsTestSelectors,qt=e.findFiberRoot,Jt=e.getBoundingRect,z=e.getTextContent,Yt=e.isHiddenSubtree,Xt=e.matchAccessibilityRole,Zt=e.setFocusIfFocusable,Qt=e.setupIntersectionObserver,$t=e.appendChild,en=e.appendChildToContainer,tn=e.commitTextUpdate,nn=e.commitMount,rn=e.commitUpdate,an=e.insertBefore,on=e.insertInContainerBefore,sn=e.removeChild,cn=e.removeChildFromContainer,ln=e.resetTextContent,un=e.hideInstance,dn=e.hideTextInstance,fn=e.unhideInstance,pn=e.unhideTextInstance,mn=e.clearContainer,hn=e.cloneInstance,gn=e.createContainerChildSet,_n=e.appendChildToContainerChildSet,vn=e.finalizeContainerChildren,yn=e.replaceContainerChildren,bn=e.cloneHiddenInstance,xn=e.cloneHiddenTextInstance,Sn=e.canHydrateInstance,Cn=e.canHydrateTextInstance,wn=e.canHydrateSuspenseInstance,Tn=e.isSuspenseInstancePending,En=e.isSuspenseInstanceFallback,Dn=e.getSuspenseInstanceFallbackErrorDetails,On=e.registerSuspenseInstanceRetry,kn=e.getNextHydratableSibling,An=e.getFirstHydratableChild,jn=e.getFirstHydratableChildWithinContainer,Mn=e.getFirstHydratableChildWithinSuspenseInstance,Nn=e.hydrateInstance,Pn=e.hydrateTextInstance,Fn=e.hydrateSuspenseInstance,In=e.getNextHydratableInstanceAfterSuspenseInstance,Ln=e.commitHydratedContainer,Rn=e.commitHydratedSuspenseInstance,zn=e.clearSuspenseBoundary,Bn=e.clearSuspenseBoundaryFromContainer,Vn=e.shouldDeleteUnhydratedTailInstances,Hn=e.didNotMatchHydratedContainerTextInstance,Un=e.didNotMatchHydratedTextInstance,Wn=e.didNotHydrateInstanceWithinContainer,Gn=e.didNotHydrateInstanceWithinSuspenseInstance,Kn=e.didNotHydrateInstance,qn=e.didNotFindHydratableInstanceWithinContainer,Jn=e.didNotFindHydratableTextInstanceWithinContainer,Yn=e.didNotFindHydratableSuspenseInstanceWithinContainer,Xn=e.didNotFindHydratableInstanceWithinSuspenseInstance,Zn=e.didNotFindHydratableTextInstanceWithinSuspenseInstance,Qn=e.didNotFindHydratableSuspenseInstanceWithinSuspenseInstance,$n=e.didNotFindHydratableInstance,er=e.didNotFindHydratableTextInstance,tr=e.didNotFindHydratableSuspenseInstance,nr=e.errorHydratingContainer,rr=0,ir,ar,or,sr,cr,lr,ur;function dr(){}dr.__reactDisabledLog=!0;function fr(){if(rr===0){ir=console.log,ar=console.info,or=console.warn,sr=console.error,cr=console.group,lr=console.groupCollapsed,ur=console.groupEnd;var e={configurable:!0,enumerable:!0,value:dr,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}rr++}function pr(){if(rr--,rr===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:u({},e,{value:ir}),info:u({},e,{value:ar}),warn:u({},e,{value:or}),error:u({},e,{value:sr}),group:u({},e,{value:cr}),groupCollapsed:u({},e,{value:lr}),groupEnd:u({},e,{value:ur})})}rr<0&&c(`disabledDepth fell below zero. This is a bug in React. Please file an issue.`)}var mr=i.ReactCurrentDispatcher,hr;function gr(e,t,n){if(hr===void 0)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);hr=r&&r[1]||``}return`
|
|
39
|
+
`+hr+e}var _r=!1,vr=new(typeof WeakMap==`function`?WeakMap:Map);function yr(e,t){if(!e||_r)return``;var n=vr.get(e);if(n!==void 0)return n;var r;_r=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var a=mr.current;mr.current=null,fr();try{if(t){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(o,[])}catch(e){r=e}Reflect.construct(e,[],o)}else{try{o.call()}catch(e){r=e}e.call(o.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var s=t.stack.split(`
|
|
40
|
+
`),c=r.stack.split(`
|
|
41
|
+
`),l=s.length-1,u=c.length-1;l>=1&&u>=0&&s[l]!==c[u];)u--;for(;l>=1&&u>=0;l--,u--)if(s[l]!==c[u]){if(l!==1||u!==1)do if(l--,u--,u<0||s[l]!==c[u]){var d=`
|
|
42
|
+
`+s[l].replace(` at new `,` at `);return e.displayName&&d.includes(`<anonymous>`)&&(d=d.replace(`<anonymous>`,e.displayName)),typeof e==`function`&&vr.set(e,d),d}while(l>=1&&u>=0);break}}}finally{_r=!1,mr.current=a,pr(),Error.prepareStackTrace=i}var f=e?e.displayName||e.name:``,p=f?gr(f):``;return typeof e==`function`&&vr.set(e,p),p}function br(e,t,n){return yr(e,!0)}function xr(e,t,n){return yr(e,!1)}function Sr(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function Cr(e,t,n){if(e==null)return``;if(typeof e==`function`)return yr(e,Sr(e));if(typeof e==`string`)return gr(e);switch(e){case me:return gr(`Suspense`);case he:return gr(`SuspenseList`)}if(typeof e==`object`)switch(e.$$typeof){case pe:return xr(e.render);case ge:return Cr(e.type,t,n);case _e:var r=e,i=r._payload,a=r._init;try{return Cr(a(i),t,n)}catch{}}return``}var wr=Object.prototype.hasOwnProperty,Tr={},Er=i.ReactDebugCurrentFrame;function Dr(e){if(e){var t=e._owner,n=Cr(e.type,e._source,t?t.type:null);Er.setExtraStackFrame(n)}else Er.setExtraStackFrame(null)}function Or(e,t,n,r,i){var a=Function.call.bind(wr);for(var o in e)if(a(e,o)){var s=void 0;try{if(typeof e[o]!=`function`){var l=Error((r||`React class`)+`: `+n+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name=`Invariant Violation`,l}s=e[o](t,o,r,n,null,`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`)}catch(e){s=e}s&&!(s instanceof Error)&&(Dr(i),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||`React class`,n,o,typeof s),Dr(null)),s instanceof Error&&!(s.message in Tr)&&(Tr[s.message]=!0,Dr(i),c(`Failed %s type: %s`,n,s.message),Dr(null))}}var kr=[],Ar=[],jr=-1;function Mr(e){return{current:e}}function Nr(e,t){if(jr<0){c(`Unexpected pop.`);return}t!==Ar[jr]&&c(`Unexpected Fiber popped.`),e.current=kr[jr],kr[jr]=null,Ar[jr]=null,jr--}function Pr(e,t,n){jr++,kr[jr]=e.current,Ar[jr]=n,e.current=t}var Fr={},Ir={};Object.freeze(Ir);var Lr=Mr(Ir),Rr=Mr(!1),zr=Ir;function Br(e,t,n){return n&&Wr(t)?zr:Lr.current}function Vr(e,t,n){var r=e.stateNode;r.__reactInternalMemoizedUnmaskedChildContext=t,r.__reactInternalMemoizedMaskedChildContext=n}function Hr(e,t){var n=e.type.contextTypes;if(!n)return Ir;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={};for(var a in n)i[a]=t[a];return Or(n,i,`context`,Me(e)||`Unknown`),r&&Vr(e,t,i),i}function Ur(){return Rr.current}function Wr(e){return e.childContextTypes!=null}function Gr(e){Nr(Rr,e),Nr(Lr,e)}function Kr(e){Nr(Rr,e),Nr(Lr,e)}function qr(e,t,n){if(Lr.current!==Ir)throw Error(`Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.`);Pr(Lr,t,e),Pr(Rr,n,e)}function Jr(e,t,n){var r=e.stateNode,i=t.childContextTypes;if(typeof r.getChildContext!=`function`){var a=Me(e)||`Unknown`;return Fr[a]||(Fr[a]=!0,c(`%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.`,a,a)),n}var o=r.getChildContext();for(var s in o)if(!(s in i))throw Error((Me(e)||`Unknown`)+`.getChildContext(): key "`+s+`" is not defined in childContextTypes.`);return Or(i,o,`child context`,Me(e)||`Unknown`),u({},n,o)}function Yr(e){var t=e.stateNode,n=t&&t.__reactInternalMemoizedMergedChildContext||Ir;return zr=Lr.current,Pr(Lr,n,e),Pr(Rr,Rr.current,e),!0}function Xr(e,t,n){var r=e.stateNode;if(!r)throw Error(`Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.`);if(n){var i=Jr(e,t,zr);r.__reactInternalMemoizedMergedChildContext=i,Nr(Rr,e),Nr(Lr,e),Pr(Lr,i,e),Pr(Rr,n,e)}else Nr(Rr,e),Pr(Rr,n,e)}function Zr(e){if(!dt(e)||e.tag!==b)throw Error(`Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.`);var t=e;do{switch(t.tag){case S:return t.stateNode.context;case b:var n=t.type;if(Wr(n))return t.stateNode.__reactInternalMemoizedMergedChildContext}t=t.return}while(t!==null);throw Error(`Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.`)}var Qr=0,$r=1,B=0,ei=1,ti=2,ni=8,ri=16,ii=Math.clz32?Math.clz32:si,ai=Math.log,oi=Math.LN2;function si(e){var t=e>>>0;return t===0?32:31-(ai(t)/oi|0)|0}var ci=31,V=0,li=0,ui=1,di=2,fi=4,pi=8,mi=16,hi=32,gi=4194240,_i=64,vi=128,yi=256,bi=512,xi=1024,Si=2048,Ci=4096,wi=8192,Ti=16384,Ei=32768,Di=65536,Oi=131072,ki=262144,Ai=524288,ji=1048576,Mi=2097152,Ni=130023424,Pi=4194304,Fi=8388608,Ii=16777216,Li=33554432,Ri=67108864,zi=Pi,Bi=134217728,Vi=268435455,Hi=268435456,Ui=536870912,Wi=1073741824;function Gi(e){if(e&ui)return`Sync`;if(e&di)return`InputContinuousHydration`;if(e&fi)return`InputContinuous`;if(e&pi)return`DefaultHydration`;if(e&mi)return`Default`;if(e&hi)return`TransitionHydration`;if(e&gi)return`Transition`;if(e&Ni)return`Retry`;if(e&Bi)return`SelectiveHydration`;if(e&Hi)return`IdleHydration`;if(e&Ui)return`Idle`;if(e&Wi)return`Offscreen`}var Ki=-1,qi=_i,Ji=Pi;function Yi(e){switch(fa(e)){case ui:return ui;case di:return di;case fi:return fi;case pi:return pi;case mi:return mi;case hi:return hi;case _i:case vi:case yi:case bi:case xi:case Si:case Ci:case wi:case Ti:case Ei:case Di:case Oi:case ki:case Ai:case ji:case Mi:return e&gi;case Pi:case Fi:case Ii:case Li:case Ri:return e&Ni;case Bi:return Bi;case Hi:return Hi;case Ui:return Ui;case Wi:return Wi;default:return c(`Should have found matching lanes. This is a bug in React.`),e}}function Xi(e,t){var n=e.pendingLanes;if(n===V)return V;var r=V,i=e.suspendedLanes,a=e.pingedLanes,o=n&Vi;if(o!==V){var s=o&~i;if(s!==V)r=Yi(s);else{var c=o&a;c!==V&&(r=Yi(c))}}else{var l=n&~i;l===V?a!==V&&(r=Yi(a)):r=Yi(l)}if(r===V)return V;if(t!==V&&t!==r&&(t&i)===V){var u=fa(r),d=fa(t);if(u>=d||u===mi&&(d&gi)!==V)return t}(r&fi)!==V&&(r|=n&mi);var f=e.entangledLanes;if(f!==V)for(var p=e.entanglements,m=r&f;m>0;){var h=ma(m),g=1<<h;r|=p[h],m&=~g}return r}function Zi(e,t){for(var n=e.eventTimes,r=Ki;t>0;){var i=ma(t),a=1<<i,o=n[i];o>r&&(r=o),t&=~a}return r}function Qi(e,t){switch(e){case ui:case di:case fi:return t+250;case pi:case mi:case hi:case _i:case vi:case yi:case bi:case xi:case Si:case Ci:case wi:case Ti:case Ei:case Di:case Oi:case ki:case Ai:case ji:case Mi:return t+5e3;case Pi:case Fi:case Ii:case Li:case Ri:return Ki;case Bi:case Hi:case Ui:case Wi:return Ki;default:return c(`Should have found matching lanes. This is a bug in React.`),Ki}}function $i(e,t){for(var n=e.pendingLanes,r=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,o=n;o>0;){var s=ma(o),c=1<<s,l=a[s];l===Ki?((c&r)===V||(c&i)!==V)&&(a[s]=Qi(c,t)):l<=t&&(e.expiredLanes|=c),o&=~c}}function ea(e){return Yi(e.pendingLanes)}function ta(e){var t=e.pendingLanes&~Wi;return t===V?t&Wi?Wi:V:t}function na(e){return(e&ui)!==V}function ra(e){return(e&Vi)!==V}function ia(e){return(e&Ni)===e}function aa(e){return(e&(ui|fi|mi))===V}function oa(e){return(e&gi)===e}function sa(e,t){return(t&(di|fi|pi|mi))!==V}function ca(e,t){return(t&e.expiredLanes)!==V}function la(e){return(e&gi)!==V}function ua(){var e=qi;return qi<<=1,(qi&gi)===V&&(qi=_i),e}function da(){var e=Ji;return Ji<<=1,(Ji&Ni)===V&&(Ji=Pi),e}function fa(e){return e&-e}function pa(e){return fa(e)}function ma(e){return 31-ii(e)}function ha(e){return ma(e)}function ga(e,t){return(e&t)!==V}function _a(e,t){return(e&t)===t}function va(e,t){return e|t}function ya(e,t){return e&~t}function ba(e,t){return e&t}function xa(e){return e}function Sa(e,t){return e!==li&&e<t?e:t}function Ca(e){for(var t=[],n=0;n<ci;n++)t.push(e);return t}function wa(e,t,n){e.pendingLanes|=t,t!==Ui&&(e.suspendedLanes=V,e.pingedLanes=V);var r=e.eventTimes,i=ha(t);r[i]=n}function Ta(e,t){e.suspendedLanes|=t,e.pingedLanes&=~t;for(var n=e.expirationTimes,r=t;r>0;){var i=ma(r),a=1<<i;n[i]=Ki,r&=~a}}function Ea(e,t,n){e.pingedLanes|=e.suspendedLanes&t}function Oa(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=V,e.pingedLanes=V,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t;for(var r=e.entanglements,i=e.eventTimes,a=e.expirationTimes,o=n;o>0;){var s=ma(o),c=1<<s;r[s]=V,i[s]=Ki,a[s]=Ki,o&=~c}}function ka(e,t){for(var n=e.entangledLanes|=t,r=e.entanglements,i=n;i;){var a=ma(i),o=1<<a;o&t|r[a]&t&&(r[a]|=t),i&=~o}}function Aa(e,t){var n=fa(t),r;switch(n){case fi:r=di;break;case mi:r=pi;break;case _i:case vi:case yi:case bi:case xi:case Si:case Ci:case wi:case Ti:case Ei:case Di:case Oi:case ki:case Ai:case ji:case Mi:case Pi:case Fi:case Ii:case Li:case Ri:r=hi;break;case Ui:r=Hi;break;default:r=li}return(r&(e.suspendedLanes|t))===li?r:li}function ja(e,t,n){if(ao)for(var r=e.pendingUpdatersLaneMap;n>0;){var i=ha(n),a=1<<i;r[i].add(t),n&=~a}}function Ma(e,t){if(ao)for(var n=e.pendingUpdatersLaneMap,r=e.memoizedUpdaters;t>0;){var i=ha(t),a=1<<i,o=n[i];o.size>0&&(o.forEach(function(e){var t=e.alternate;(t===null||!r.has(t))&&r.add(e)}),o.clear()),t&=~a}}function Na(e,t){return null}var Pa=ui,H=fi,Fa=mi,Ia=Ui,La=li;function Ra(){return La}function za(e){La=e}function Ba(e,t){var n=La;try{return La=e,t()}finally{La=n}}function Va(e,t){return e!==0&&e<t?e:t}function Ha(e,t){return e===0||e>t?e:t}function Ua(e,t){return e!==0&&e<t}function Wa(e){var t=fa(e);return Ua(Pa,t)?Ua(H,t)?ra(t)?Fa:Ia:H:Pa}var Ga=r.unstable_scheduleCallback,Ka=r.unstable_cancelCallback,qa=r.unstable_shouldYield,Ja=r.unstable_requestPaint,Ya=r.unstable_now,Xa=r.unstable_ImmediatePriority,Za=r.unstable_UserBlockingPriority,Qa=r.unstable_NormalPriority,$a=r.unstable_IdlePriority,eo=r.unstable_yieldValue,to=r.unstable_setDisableYieldValue,no=null,ro=null,U=null,io=!1,ao=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`;function oo(e){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled)return!0;if(!t.supportsFiber)return c(`The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools`),!0;try{g&&(e=u({},e,{getLaneLabelMap:mo,injectProfilingHooks:po})),no=t.inject(e),ro=t}catch(e){c(`React instrumentation encountered an error: %s.`,e)}return!!t.checkDCE}function so(e,t){if(ro&&typeof ro.onScheduleFiberRoot==`function`)try{ro.onScheduleFiberRoot(no,e,t)}catch(e){io||(io=!0,c(`React instrumentation encountered an error: %s`,e))}}function co(e,t){if(ro&&typeof ro.onCommitFiberRoot==`function`)try{var n=(e.current.flags&ze)===ze;if(_){var r;switch(t){case Pa:r=Xa;break;case H:r=Za;break;case Fa:r=Qa;break;case Ia:r=$a;break;default:r=Qa}ro.onCommitFiberRoot(no,e,r,n)}else ro.onCommitFiberRoot(no,e,void 0,n)}catch(e){io||(io=!0,c(`React instrumentation encountered an error: %s`,e))}}function lo(e){if(ro&&typeof ro.onPostCommitFiberRoot==`function`)try{ro.onPostCommitFiberRoot(no,e)}catch(e){io||(io=!0,c(`React instrumentation encountered an error: %s`,e))}}function uo(e){if(ro&&typeof ro.onCommitFiberUnmount==`function`)try{ro.onCommitFiberUnmount(no,e)}catch(e){io||(io=!0,c(`React instrumentation encountered an error: %s`,e))}}function fo(e){if(typeof eo==`function`&&(to(e),o(e)),ro&&typeof ro.setStrictMode==`function`)try{ro.setStrictMode(no,e)}catch(e){io||(io=!0,c(`React instrumentation encountered an error: %s`,e))}}function po(e){U=e}function mo(){for(var e=new Map,t=1,n=0;n<ci;n++){var r=Gi(t);e.set(t,r),t*=2}return e}function ho(e){U!==null&&typeof U.markCommitStarted==`function`&&U.markCommitStarted(e)}function go(){U!==null&&typeof U.markCommitStopped==`function`&&U.markCommitStopped()}function _o(e){U!==null&&typeof U.markComponentRenderStarted==`function`&&U.markComponentRenderStarted(e)}function vo(){U!==null&&typeof U.markComponentRenderStopped==`function`&&U.markComponentRenderStopped()}function yo(e){U!==null&&typeof U.markComponentPassiveEffectMountStarted==`function`&&U.markComponentPassiveEffectMountStarted(e)}function bo(){U!==null&&typeof U.markComponentPassiveEffectMountStopped==`function`&&U.markComponentPassiveEffectMountStopped()}function xo(e){U!==null&&typeof U.markComponentPassiveEffectUnmountStarted==`function`&&U.markComponentPassiveEffectUnmountStarted(e)}function So(){U!==null&&typeof U.markComponentPassiveEffectUnmountStopped==`function`&&U.markComponentPassiveEffectUnmountStopped()}function Co(e){U!==null&&typeof U.markComponentLayoutEffectMountStarted==`function`&&U.markComponentLayoutEffectMountStarted(e)}function wo(){U!==null&&typeof U.markComponentLayoutEffectMountStopped==`function`&&U.markComponentLayoutEffectMountStopped()}function To(e){U!==null&&typeof U.markComponentLayoutEffectUnmountStarted==`function`&&U.markComponentLayoutEffectUnmountStarted(e)}function Eo(){U!==null&&typeof U.markComponentLayoutEffectUnmountStopped==`function`&&U.markComponentLayoutEffectUnmountStopped()}function Do(e,t,n){U!==null&&typeof U.markComponentErrored==`function`&&U.markComponentErrored(e,t,n)}function Oo(e,t,n){U!==null&&typeof U.markComponentSuspended==`function`&&U.markComponentSuspended(e,t,n)}function ko(e){U!==null&&typeof U.markLayoutEffectsStarted==`function`&&U.markLayoutEffectsStarted(e)}function Ao(){U!==null&&typeof U.markLayoutEffectsStopped==`function`&&U.markLayoutEffectsStopped()}function jo(e){U!==null&&typeof U.markPassiveEffectsStarted==`function`&&U.markPassiveEffectsStarted(e)}function Mo(){U!==null&&typeof U.markPassiveEffectsStopped==`function`&&U.markPassiveEffectsStopped()}function No(e){U!==null&&typeof U.markRenderStarted==`function`&&U.markRenderStarted(e)}function Po(){U!==null&&typeof U.markRenderYielded==`function`&&U.markRenderYielded()}function Fo(){U!==null&&typeof U.markRenderStopped==`function`&&U.markRenderStopped()}function Io(e){U!==null&&typeof U.markRenderScheduled==`function`&&U.markRenderScheduled(e)}function Lo(e,t){U!==null&&typeof U.markForceUpdateScheduled==`function`&&U.markForceUpdateScheduled(e,t)}function Ro(e,t){U!==null&&typeof U.markStateUpdateScheduled==`function`&&U.markStateUpdateScheduled(e,t)}function zo(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Bo=typeof Object.is==`function`?Object.is:zo,Vo=null,Ho=!1,Uo=!1;function Wo(e){Vo===null?Vo=[e]:Vo.push(e)}function Go(e){Ho=!0,Wo(e)}function Ko(){Ho&&qo()}function qo(){if(!Uo&&Vo!==null){Uo=!0;var e=0,t=Ra();try{var n=!0,r=Vo;for(za(Pa);e<r.length;e++){var i=r[e];do i=i(n);while(i!==null)}Vo=null,Ho=!1}catch(t){throw Vo!==null&&(Vo=Vo.slice(e+1)),Ga(Xa,qo),t}finally{za(t),Uo=!1}}return null}function Jo(e){return e.current.memoizedState.isDehydrated}var Yo=[],Xo=0,Zo=null,Qo=0,$o=[],es=0,ts=null,ns=1,rs=``;function is(e){return hs(),(e.flags&Qe)!==R}function as(e){return hs(),Qo}function os(){var e=rs,t=ns;return(t&~ds(t)).toString(32)+e}function ss(e,t){hs(),Yo[Xo++]=Qo,Yo[Xo++]=Zo,Zo=e,Qo=t}function cs(e,t,n){hs(),$o[es++]=ns,$o[es++]=rs,$o[es++]=ts,ts=e;var r=ns,i=rs,a=us(r)-1,o=r&~(1<<a),s=n+1,c=us(t)+a;if(c>30){var l=a-a%5,u=(o&(1<<l)-1).toString(32),d=o>>l,f=a-l,p=us(t)+f,m=s<<f|d,h=u+i;ns=1<<p|m,rs=h}else{var g=s<<a|o,_=i;ns=1<<c|g,rs=_}}function ls(e){if(hs(),e.return!==null){var t=1;ss(e,t),cs(e,t,0)}}function us(e){return 32-ii(e)}function ds(e){return 1<<us(e)-1}function fs(e){for(;e===Zo;)Zo=Yo[--Xo],Yo[Xo]=null,Qo=Yo[--Xo],Yo[Xo]=null;for(;e===ts;)ts=$o[--es],$o[es]=null,rs=$o[--es],$o[es]=null,ns=$o[--es],$o[es]=null}function ps(){return hs(),ts===null?null:{id:ns,overflow:rs}}function ms(e,t){hs(),$o[es++]=ns,$o[es++]=rs,$o[es++]=ts,ns=t.id,rs=t.overflow,ts=e}function hs(){Ws()||c(`Expected to be hydrating. This is a bug in React. Please file an issue.`)}var gs=null,_s=null,vs=!1,ys=!1,bs=null;function xs(){vs&&c(`We should not be hydrating here. This is a bug in React. Please file a bug.`)}function Ss(){ys=!0}function Cs(){return ys}function ws(e){if(!zt)return!1;var t=e.stateNode.containerInfo;return _s=jn(t),gs=e,vs=!0,bs=null,ys=!1,!0}function Ts(e,t,n){return zt?(_s=Mn(t),gs=e,vs=!0,bs=null,ys=!1,n!==null&&ms(e,n),!0):!1}function Es(e,t){switch(e.tag){case S:Wn(e.stateNode.containerInfo,t);break;case w:var n=(e.mode&ei)!==B;Kn(e.type,e.memoizedProps,e.stateNode,t,n);break;case M:var r=e.memoizedState;r.dehydrated!==null&&Gn(r.dehydrated,t)}}function Ds(e,t){Es(e,t);var n=Sy();n.stateNode=t,n.return=e;var r=e.deletions;r===null?(e.deletions=[n],e.flags|=Ie):r.push(n)}function Os(e,t){if(!ys)switch(e.tag){case S:var n=e.stateNode.containerInfo;switch(t.tag){case w:var r=t.type,i=t.pendingProps;qn(n,r,i);break;case T:var a=t.pendingProps;Jn(n,a);break;case M:Yn(n)}break;case w:var o=e.type,s=e.memoizedProps,c=e.stateNode;switch(t.tag){case w:var l=t.type,u=t.pendingProps;$n(o,s,c,l,u,(e.mode&ei)!==B);break;case T:var d=t.pendingProps;er(o,s,c,d,(e.mode&ei)!==B);break;case M:tr(o,s,c)}break;case M:var f=e.memoizedState.dehydrated;if(f!==null)switch(t.tag){case w:var p=t.type,m=t.pendingProps;Xn(f,p,m);break;case T:var h=t.pendingProps;Zn(f,h);break;case M:Qn(f)}break;default:return}}function ks(e,t){t.flags=t.flags&~We|Pe,Os(e,t)}function As(e,t){switch(e.tag){case w:var n=e.type,r=e.pendingProps,i=Sn(t,n,r);return i!==null&&(e.stateNode=i,gs=e,_s=An(i),!0);case T:var a=e.pendingProps,o=Cn(t,a);return o!==null&&(e.stateNode=o,gs=e,_s=null,!0);case M:var s=wn(t);if(s!==null){e.memoizedState={dehydrated:s,treeContext:ps(),retryLane:Wi};var c=Cy(s);return c.return=e,e.child=c,gs=e,_s=null,!0}return!1;default:return!1}}function js(e){return(e.mode&ei)!==B&&(e.flags&ze)===R}function Ms(e){throw Error(`Hydration failed because the initial UI does not match what was rendered on the server.`)}function Ns(e){if(vs){var t=_s;if(!t){js(e)&&(Os(gs,e),Ms()),ks(gs,e),vs=!1,gs=e;return}var n=t;if(!As(e,t)){js(e)&&(Os(gs,e),Ms()),t=kn(n);var r=gs;if(!t||!As(e,t)){ks(gs,e),vs=!1,gs=e;return}Ds(r,n)}}}function Ps(e,t,n){if(!zt)throw Error(`Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.`);var r=e.stateNode,i=!ys,a=Nn(r,e.type,e.memoizedProps,t,n,e,i);return e.updateQueue=a,a!==null}function Fs(e){if(!zt)throw Error(`Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.`);var t=e.stateNode,n=e.memoizedProps,r=Pn(t,n,e,!ys);if(r){var i=gs;if(i!==null)switch(i.tag){case S:var a=i.stateNode.containerInfo;Hn(a,t,n,(i.mode&ei)!==B);break;case w:var o=i.type,s=i.memoizedProps,c=i.stateNode;Un(o,s,c,t,n,(i.mode&ei)!==B)}}return r}function Is(e){if(!zt)throw Error(`Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.`);var t=e.memoizedState,n=t===null?null:t.dehydrated;if(!n)throw Error(`Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.`);Fn(n,e)}function Ls(e){if(!zt)throw Error(`Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.`);var t=e.memoizedState,n=t===null?null:t.dehydrated;if(!n)throw Error(`Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.`);return In(n)}function Rs(e){for(var t=e.return;t!==null&&t.tag!==w&&t.tag!==S&&t.tag!==M;)t=t.return;gs=t}function zs(e){if(!zt||e!==gs)return!1;if(!vs)return Rs(e),vs=!0,!1;if(e.tag!==S&&(e.tag!==w||Vn(e.type)&&!At(e.type,e.memoizedProps))){var t=_s;if(t){if(js(e))Vs(e),Ms();else for(;t;)Ds(e,t),t=kn(t)}}return Rs(e),_s=e.tag===M?Ls(e):gs?kn(e.stateNode):null,!0}function Bs(){return vs&&_s!==null}function Vs(e){for(var t=_s;t;)Es(e,t),t=kn(t)}function Hs(){zt&&(gs=null,_s=null,vs=!1,ys=!1)}function Us(){bs!==null&&(N_(bs),bs=null)}function Ws(){return vs}function Gs(e){bs===null?bs=[e]:bs.push(e)}var Ks=i.ReactCurrentBatchConfig,qs=null;function Js(){return Ks.transition}function Ys(e,t){if(Bo(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++){var a=n[i];if(!wr.call(t,a)||!Bo(e[a],t[a]))return!1}return!0}function Xs(e){switch(e._debugOwner&&e._debugOwner.type,e._debugSource,e.tag){case w:return gr(e.type);case P:return gr(`Lazy`);case M:return gr(`Suspense`);case L:return gr(`SuspenseList`);case y:case x:case N:return xr(e.type);case A:return xr(e.type.render);case b:return br(e.type);default:return``}}function Zs(e){try{var t=``,n=e;do t+=Xs(n),n=n.return;while(n);return t}catch(e){return`
|
|
43
|
+
Error generating stack: `+e.message+`
|
|
44
|
+
`+e.stack}}var Qs=i.ReactDebugCurrentFrame,$s=null,ec=!1;function tc(){if($s===null)return null;var e=$s._debugOwner;return e==null?null:Me(e)}function nc(){return $s===null?``:Zs($s)}function rc(){Qs.getCurrentStack=null,$s=null,ec=!1}function ic(e){Qs.getCurrentStack=e===null?null:nc,$s=e,ec=!1}function ac(){return $s}function oc(e){ec=e}var sc={recordUnsafeLifecycleWarnings:function(e,t){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(e,t){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},cc=function(e){for(var t=null,n=e;n!==null;)n.mode&ni&&(t=n),n=n.return;return t},lc=function(e){var t=[];return e.forEach(function(e){t.push(e)}),t.sort().join(`, `)},uc=[],dc=[],fc=[],pc=[],mc=[],hc=[],gc=new Set;sc.recordUnsafeLifecycleWarnings=function(e,t){gc.has(e.type)||(typeof t.componentWillMount==`function`&&t.componentWillMount.__suppressDeprecationWarning!==!0&&uc.push(e),e.mode&ni&&typeof t.UNSAFE_componentWillMount==`function`&&dc.push(e),typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&fc.push(e),e.mode&ni&&typeof t.UNSAFE_componentWillReceiveProps==`function`&&pc.push(e),typeof t.componentWillUpdate==`function`&&t.componentWillUpdate.__suppressDeprecationWarning!==!0&&mc.push(e),e.mode&ni&&typeof t.UNSAFE_componentWillUpdate==`function`&&hc.push(e))},sc.flushPendingUnsafeLifecycleWarnings=function(){var e=new Set;uc.length>0&&(uc.forEach(function(t){e.add(Me(t)||`Component`),gc.add(t.type)}),uc=[]);var t=new Set;dc.length>0&&(dc.forEach(function(e){t.add(Me(e)||`Component`),gc.add(e.type)}),dc=[]);var n=new Set;fc.length>0&&(fc.forEach(function(e){n.add(Me(e)||`Component`),gc.add(e.type)}),fc=[]);var r=new Set;pc.length>0&&(pc.forEach(function(e){r.add(Me(e)||`Component`),gc.add(e.type)}),pc=[]);var i=new Set;mc.length>0&&(mc.forEach(function(e){i.add(Me(e)||`Component`),gc.add(e.type)}),mc=[]);var a=new Set;hc.length>0&&(hc.forEach(function(e){a.add(Me(e)||`Component`),gc.add(e.type)}),hc=[]),t.size>0&&c(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
45
|
+
|
|
46
|
+
* Move code with side effects to componentDidMount, and set initial state in the constructor.
|
|
47
|
+
|
|
48
|
+
Please update the following components: %s`,lc(t)),r.size>0&&c(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
49
|
+
|
|
50
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
51
|
+
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
|
|
52
|
+
|
|
53
|
+
Please update the following components: %s`,lc(r)),a.size>0&&c(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
54
|
+
|
|
55
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
56
|
+
|
|
57
|
+
Please update the following components: %s`,lc(a)),e.size>0&&s(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
58
|
+
|
|
59
|
+
* Move code with side effects to componentDidMount, and set initial state in the constructor.
|
|
60
|
+
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
61
|
+
|
|
62
|
+
Please update the following components: %s`,lc(e)),n.size>0&&s(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
63
|
+
|
|
64
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
65
|
+
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
|
|
66
|
+
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
67
|
+
|
|
68
|
+
Please update the following components: %s`,lc(n)),i.size>0&&s(`componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.
|
|
69
|
+
|
|
70
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
71
|
+
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
72
|
+
|
|
73
|
+
Please update the following components: %s`,lc(i))};var _c=new Map,vc=new Set;sc.recordLegacyContextWarning=function(e,t){var n=cc(e);if(n===null){c(`Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.`);return}if(!vc.has(e.type)){var r=_c.get(n);(e.type.contextTypes!=null||e.type.childContextTypes!=null||t!==null&&typeof t.getChildContext==`function`)&&(r===void 0&&(r=[],_c.set(n,r)),r.push(e))}},sc.flushLegacyContextWarning=function(){_c.forEach(function(e,t){if(e.length!==0){var n=e[0],r=new Set;e.forEach(function(e){r.add(Me(e)||`Component`),vc.add(e.type)});var i=lc(r);try{ic(n),c(`Legacy context API has been detected within a strict-mode tree.
|
|
74
|
+
|
|
75
|
+
The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
|
|
76
|
+
|
|
77
|
+
Please update the following components: %s
|
|
78
|
+
|
|
79
|
+
Learn more about this warning here: https://reactjs.org/link/legacy-context`,i)}finally{rc()}}})},sc.discardPendingWarnings=function(){uc=[],dc=[],fc=[],pc=[],mc=[],hc=[],_c=new Map};function yc(e){return typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`}function bc(e){try{return xc(e),!1}catch{return!0}}function xc(e){return``+e}function Sc(e){if(bc(e))return c(`The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.`,yc(e)),xc(e)}function Cc(e,t){if(bc(e))return c("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.",t,yc(e)),xc(e)}var wc,Tc,Ec,Dc,Oc,kc=function(e,t){};wc=!1,Tc=!1,Ec={},Dc={},Oc={},kc=function(e,t){if(!(typeof e!=`object`||!e)&&!(!e._store||e._store.validated||e.key!=null)){if(typeof e._store!=`object`)throw Error(`React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.`);e._store.validated=!0;var n=Me(t)||`Component`;Dc[n]||(Dc[n]=!0,c(`Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.`))}};function Ac(e){return e.prototype&&e.prototype.isReactComponent}function jc(e,t,n){var r=n.ref;if(r!==null&&typeof r!=`function`&&typeof r!=`object`){if((e.mode&ni||h)&&!(n._owner&&n._self&&n._owner.stateNode!==n._self)&&!(n._owner&&n._owner.tag!==b)&&!(typeof n.type==`function`&&!Ac(n.type))&&n._owner){var i=Me(e)||`Component`;Ec[i]||(c(`Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref`,i,r),Ec[i]=!0)}if(n._owner){var a=n._owner,o;if(a){var s=a;if(s.tag!==b)throw Error(`Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref`);o=s.stateNode}if(!o)throw Error(`Missing owner for string ref `+r+`. This error is likely caused by a bug in React. Please file an issue.`);var l=o;Cc(r,`ref`);var u=``+r;if(t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===u)return t.ref;var d=function(e){var t=l.refs;e===null?delete t[u]:t[u]=e};return d._stringRef=u,d}if(typeof r!=`string`)throw Error(`Expected ref to be a function, a string, an object returned by React.createRef(), or null.`);if(!n._owner)throw Error(`Element ref was specified as a string (`+r+`) but no owner was set. This could happen for one of the following reasons:
|
|
80
|
+
1. You may be adding a ref to a function component
|
|
81
|
+
2. You may be adding a ref to a component that was not created inside a component's render method
|
|
82
|
+
3. You have multiple copies of React loaded
|
|
83
|
+
See https://reactjs.org/link/refs-must-have-owner for more information.`)}return r}function Mc(e,t){var n=Object.prototype.toString.call(t);throw Error(`Objects are not valid as a React child (found: `+(n===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:n)+`). If you meant to render a collection of children, use an array instead.`)}function Nc(e){var t=Me(e)||`Component`;Oc[t]||(Oc[t]=!0,c(`Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.`))}function Pc(e){var t=e._payload,n=e._init;return n(t)}function Fc(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=Ie):r.push(n)}}function n(n,r){if(!e)return null;for(var i=r;i!==null;)t(n,i),i=i.sibling;return null}function r(e,t){for(var n=new Map,r=t;r!==null;)r.key===null?n.set(r.index,r):n.set(r.key,r),r=r.sibling;return n}function i(e,t){var n=dy(e,t);return n.index=0,n.sibling=null,n}function a(t,n,r){if(t.index=r,!e)return t.flags|=Qe,n;var i=t.alternate;if(i!==null){var a=i.index;return a<n?(t.flags|=Pe,n):a}return t.flags|=Pe,n}function o(t){return e&&t.alternate===null&&(t.flags|=Pe),t}function s(e,t,n,r){if(t===null||t.tag!==T){var a=xy(n,e.mode,r);return a.return=e,a}var o=i(t,n);return o.return=e,o}function l(e,t,n,r){var a=n.type;if(a===ce)return d(e,t,n.props.children,r,n.key);if(t!==null&&(t.elementType===a||Xv(t,n)||typeof a==`object`&&a&&a.$$typeof===_e&&Pc(a)===t.type)){var o=i(t,n.props);return o.ref=jc(e,t,n),o.return=e,o._debugSource=n._source,o._debugOwner=n._owner,o}var s=hy(n,e.mode,r);return s.ref=jc(e,t,n),s.return=e,s}function u(e,t,n,r){if(t===null||t.tag!==C||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation){var a=wy(n,e.mode,r);return a.return=e,a}var o=i(t,n.children||[]);return o.return=e,o}function d(e,t,n,r,a){if(t===null||t.tag!==E){var o=gy(n,e.mode,r,a);return o.return=e,o}var s=i(t,n);return s.return=e,s}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`){var r=xy(``+t,e.mode,n);return r.return=e,r}if(typeof t==`object`&&t){switch(t.$$typeof){case oe:var i=hy(t,e.mode,n);return i.ref=jc(e,null,t),i.return=e,i;case se:var a=wy(t,e.mode,n);return a.return=e,a;case _e:var o=t._payload,s=t._init;return f(e,s(o),n)}if(bt(t)||Ee(t)){var c=gy(t,e.mode,n,null);return c.return=e,c}Mc(e,t)}return typeof t==`function`&&Nc(e),null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?s(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case oe:return n.key===i?l(e,t,n,r):null;case se:return n.key===i?u(e,t,n,r):null;case _e:var a=n._payload,o=n._init;return p(e,t,o(a),r)}if(bt(n)||Ee(n))return i===null?d(e,t,n,r,null):null;Mc(e,n)}return typeof n==`function`&&Nc(e),null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return s(t,e.get(n)||null,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case oe:return l(t,e.get(r.key===null?n:r.key)||null,r,i);case se:return u(t,e.get(r.key===null?n:r.key)||null,r,i);case _e:var a=r._payload,o=r._init;return m(e,t,n,o(a),i)}if(bt(r)||Ee(r))return d(t,e.get(n)||null,r,i,null);Mc(t,r)}return typeof r==`function`&&Nc(t),null}function h(e,t,n){if(typeof e!=`object`||!e)return t;switch(e.$$typeof){case oe:case se:kc(e,n);var r=e.key;if(typeof r!=`string`)break;if(t===null){t=new Set,t.add(r);break}if(!t.has(r)){t.add(r);break}c("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",r);break;case _e:var i=e._payload,a=e._init;h(a(i),t,n)}return t}function g(i,o,s,c){for(var l=null,u=0;u<s.length;u++){var d=s[u];l=h(d,l,i)}for(var g=null,_=null,v=o,y=0,b=0,x=null;v!==null&&b<s.length;b++){v.index>b?(x=v,v=null):x=v.sibling;var S=p(i,v,s[b],c);if(S===null){v===null&&(v=x);break}e&&v&&S.alternate===null&&t(i,v),y=a(S,y,b),_===null?g=S:_.sibling=S,_=S,v=x}if(b===s.length)return n(i,v),Ws()&&ss(i,b),g;if(v===null){for(;b<s.length;b++){var C=f(i,s[b],c);C!==null&&(y=a(C,y,b),_===null?g=C:_.sibling=C,_=C)}return Ws()&&ss(i,b),g}for(var w=r(i,v);b<s.length;b++){var T=m(w,i,b,s[b],c);T!==null&&(e&&T.alternate!==null&&w.delete(T.key===null?b:T.key),y=a(T,y,b),_===null?g=T:_.sibling=T,_=T)}return e&&w.forEach(function(e){return t(i,e)}),Ws()&&ss(i,b),g}function _(i,o,s,l){var u=Ee(s);if(typeof u!=`function`)throw Error(`An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.`);typeof Symbol==`function`&&s[Symbol.toStringTag]===`Generator`&&(Tc||c("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),Tc=!0),s.entries===u&&(wc||c(`Using Maps as children is not supported. Use an array of keyed ReactElements instead.`),wc=!0);var d=u.call(s);if(d)for(var g=null,_=d.next();!_.done;_=d.next()){var v=_.value;g=h(v,g,i)}var y=u.call(s);if(y==null)throw Error(`An iterable object provided no iterator.`);for(var b=null,x=null,S=o,C=0,w=0,T=null,E=y.next();S!==null&&!E.done;w++,E=y.next()){S.index>w?(T=S,S=null):T=S.sibling;var D=p(i,S,E.value,l);if(D===null){S===null&&(S=T);break}e&&S&&D.alternate===null&&t(i,S),C=a(D,C,w),x===null?b=D:x.sibling=D,x=D,S=T}if(E.done)return n(i,S),Ws()&&ss(i,w),b;if(S===null){for(;!E.done;w++,E=y.next()){var O=f(i,E.value,l);O!==null&&(C=a(O,C,w),x===null?b=O:x.sibling=O,x=O)}return Ws()&&ss(i,w),b}for(var k=r(i,S);!E.done;w++,E=y.next()){var A=m(k,i,w,E.value,l);A!==null&&(e&&A.alternate!==null&&k.delete(A.key===null?w:A.key),C=a(A,C,w),x===null?b=A:x.sibling=A,x=A)}return e&&k.forEach(function(e){return t(i,e)}),Ws()&&ss(i,w),b}function v(e,t,r,a){if(t!==null&&t.tag===T){n(e,t.sibling);var o=i(t,r);return o.return=e,o}n(e,t);var s=xy(r,e.mode,a);return s.return=e,s}function y(e,r,a,o){for(var s=a.key,c=r;c!==null;){if(c.key===s){var l=a.type;if(l===ce){if(c.tag===E){n(e,c.sibling);var u=i(c,a.props.children);return u.return=e,u._debugSource=a._source,u._debugOwner=a._owner,u}}else if(c.elementType===l||Xv(c,a)||typeof l==`object`&&l&&l.$$typeof===_e&&Pc(l)===c.type){n(e,c.sibling);var d=i(c,a.props);return d.ref=jc(e,c,a),d.return=e,d._debugSource=a._source,d._debugOwner=a._owner,d}n(e,c);break}t(e,c),c=c.sibling}if(a.type===ce){var f=gy(a.props.children,e.mode,o,a.key);return f.return=e,f}var p=hy(a,e.mode,o);return p.ref=jc(e,r,a),p.return=e,p}function b(e,r,a,o){for(var s=a.key,c=r;c!==null;){if(c.key===s){if(c.tag===C&&c.stateNode.containerInfo===a.containerInfo&&c.stateNode.implementation===a.implementation){n(e,c.sibling);var l=i(c,a.children||[]);return l.return=e,l}n(e,c);break}t(e,c),c=c.sibling}var u=wy(a,e.mode,o);return u.return=e,u}function x(e,t,r,i){if(typeof r==`object`&&r&&r.type===ce&&r.key===null&&(r=r.props.children),typeof r==`object`&&r){switch(r.$$typeof){case oe:return o(y(e,t,r,i));case se:return o(b(e,t,r,i));case _e:var a=r._payload,s=r._init;return x(e,t,s(a),i)}if(bt(r))return g(e,t,r,i);if(Ee(r))return _(e,t,r,i);Mc(e,r)}return typeof r==`string`&&r!==``||typeof r==`number`?o(v(e,t,``+r,i)):(typeof r==`function`&&Nc(e),n(e,t))}return x}var Ic=Fc(!0),Lc=Fc(!1);function Rc(e,t){if(e!==null&&t.child!==e.child)throw Error(`Resuming work not yet implemented.`);if(t.child!==null){var n=t.child,r=dy(n,n.pendingProps);for(t.child=r,r.return=t;n.sibling!==null;)n=n.sibling,r=r.sibling=dy(n,n.pendingProps),r.return=t;r.sibling=null}}function zc(e,t){for(var n=e.child;n!==null;)fy(n,t),n=n.sibling}var Bc=Mr(null),Vc={},Hc=null,Uc=null,Wc=null,Gc=!1;function Kc(){Hc=null,Uc=null,Wc=null,Gc=!1}function qc(){Gc=!0}function Jc(){Gc=!1}function Yc(e,t,n){Ft?(Pr(Bc,t._currentValue,e),t._currentValue=n,t._currentRenderer!==void 0&&t._currentRenderer!==null&&t._currentRenderer!==Vc&&c(`Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.`),t._currentRenderer=Vc):(Pr(Bc,t._currentValue2,e),t._currentValue2=n,t._currentRenderer2!==void 0&&t._currentRenderer2!==null&&t._currentRenderer2!==Vc&&c(`Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.`),t._currentRenderer2=Vc)}function Xc(e,t){var n=Bc.current;Nr(Bc,t),Ft?e._currentValue=n:e._currentValue2=n}function Zc(e,t,n){for(var r=e;r!==null;){var i=r.alternate;if(_a(r.childLanes,t)?i!==null&&!_a(i.childLanes,t)&&(i.childLanes=va(i.childLanes,t)):(r.childLanes=va(r.childLanes,t),i!==null&&(i.childLanes=va(i.childLanes,t))),r===n)break;r=r.return}r!==n&&c(`Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.`)}function Qc(e,t,n){$c(e,t,n)}function $c(e,t,n){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var i=void 0,a=r.dependencies;if(a!==null){i=r.child;for(var o=a.firstContext;o!==null;){if(o.context===t){if(r.tag===b){var s=bl(Ki,pa(n));s.tag=pl;var c=r.updateQueue;if(c!==null){var l=c.shared,u=l.pending;u===null?s.next=s:(s.next=u.next,u.next=s),l.pending=s}}r.lanes=va(r.lanes,n);var d=r.alternate;d!==null&&(d.lanes=va(d.lanes,n)),Zc(r.return,n,e),a.lanes=va(a.lanes,n);break}o=o.next}}else if(r.tag===k)i=r.type===e.type?null:r.child;else if(r.tag===I){var f=r.return;if(f===null)throw Error(`We just came from a parent so we must have had a parent. This is a bug in React.`);f.lanes=va(f.lanes,n);var p=f.alternate;p!==null&&(p.lanes=va(p.lanes,n)),Zc(f,n,e),i=r.sibling}else i=r.child;if(i!==null)i.return=r;else for(i=r;i!==null;){if(i===e){i=null;break}var m=i.sibling;if(m!==null){m.return=i.return,i=m;break}i=i.return}r=i}}function el(e,t){Hc=e,Uc=null,Wc=null;var n=e.dependencies;n!==null&&n.firstContext!==null&&(ga(n.lanes,t)&&im(),n.firstContext=null)}function tl(e){Gc&&c(`Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().`);var t=Ft?e._currentValue:e._currentValue2;if(Wc!==e){var n={context:e,memoizedValue:t,next:null};if(Uc===null){if(Hc===null)throw Error(`Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().`);Uc=n,Hc.dependencies={lanes:V,firstContext:n}}else Uc=Uc.next=n}return t}var nl=null;function rl(e){nl===null?nl=[e]:nl.push(e)}function il(){if(nl!==null){for(var e=0;e<nl.length;e++){var t=nl[e],n=t.interleaved;if(n!==null){t.interleaved=null;var r=n.next,i=t.pending;if(i!==null){var a=i.next;i.next=r,n.next=a}t.pending=n}}nl=null}}function al(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,rl(t)):(n.next=i.next,i.next=n),t.interleaved=n,ul(e,r)}function ol(e,t,n,r){var i=t.interleaved;i===null?(n.next=n,rl(t)):(n.next=i.next,i.next=n),t.interleaved=n}function sl(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,rl(t)):(n.next=i.next,i.next=n),t.interleaved=n,ul(e,r)}function cl(e,t){return ul(e,t)}var ll=ul;function ul(e,t){e.lanes=va(e.lanes,t);var n=e.alternate;n!==null&&(n.lanes=va(n.lanes,t)),n===null&&(e.flags&(Pe|We))!==R&&Av(e);for(var r=e,i=e.return;i!==null;)i.childLanes=va(i.childLanes,t),n=i.alternate,n===null?(i.flags&(Pe|We))!==R&&Av(e):n.childLanes=va(n.childLanes,t),r=i,i=i.return;return r.tag===S?r.stateNode:null}var dl=0,fl=1,pl=2,ml=3,hl=!1,gl=!1,_l=null;function vl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:V},effects:null}}function yl(e,t){var n=t.updateQueue,r=e.updateQueue;n===r&&(t.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function bl(e,t){return{eventTime:e,lane:t,tag:dl,payload:null,callback:null,next:null}}function xl(e,t,n){var r=e.updateQueue;if(r===null)return null;var i=r.shared;if(_l===i&&!gl&&(c(`An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.`),gl=!0),k_()){var a=i.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),i.pending=t,ll(e,n)}return sl(e,i,t,n)}function Sl(e,t,n){var r=t.updateQueue;if(r!==null){var i=r.shared;if(la(n)){var a=i.lanes;a=ba(a,e.pendingLanes);var o=va(a,n);i.lanes=o,ka(e,o)}}}function Cl(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null){var i=r.updateQueue;if(n===i){var a=null,o=null,s=n.firstBaseUpdate;if(s!==null){var c=s;do{var l={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};o===null?a=o=l:(o.next=l,o=l),c=c.next}while(c!==null);o===null?a=o=t:(o.next=t,o=t)}else a=o=t;n={baseState:i.baseState,firstBaseUpdate:a,lastBaseUpdate:o,shared:i.shared,effects:i.effects},e.updateQueue=n;return}}var u=n.lastBaseUpdate;u===null?n.firstBaseUpdate=t:u.next=t,n.lastBaseUpdate=t}function wl(e,t,n,r,i,a){switch(n.tag){case fl:var o=n.payload;if(typeof o==`function`){qc();var s=o.call(a,r,i);if(e.mode&ni){fo(!0);try{o.call(a,r,i)}finally{fo(!1)}}return Jc(),s}return o;case ml:e.flags=e.flags&~Xe|ze;case dl:var c=n.payload,l;if(typeof c==`function`){if(qc(),l=c.call(a,r,i),e.mode&ni){fo(!0);try{c.call(a,r,i)}finally{fo(!1)}}Jc()}else l=c;return l==null?r:u({},r,l);case pl:return hl=!0,r}return r}function Tl(e,t,n,r){var i=e.updateQueue;hl=!1,_l=i.shared;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;if(u!==null){var d=u.updateQueue,f=d.lastBaseUpdate;f!==o&&(f===null?d.firstBaseUpdate=l:f.next=l,d.lastBaseUpdate=c)}}if(a!==null){var p=i.baseState,m=V,h=null,g=null,_=null,v=a;do{var y=v.lane,b=v.eventTime;if(_a(r,y)){if(_!==null){var x={eventTime:b,lane:li,tag:v.tag,payload:v.payload,callback:v.callback,next:null};_=_.next=x}if(p=wl(e,i,v,p,t,n),v.callback!==null&&v.lane!==li){e.flags|=Re;var S=i.effects;S===null?i.effects=[v]:S.push(v)}}else{var C={eventTime:b,lane:y,tag:v.tag,payload:v.payload,callback:v.callback,next:null};_===null?(g=_=C,h=p):_=_.next=C,m=va(m,y)}if(v=v.next,v===null){if(s=i.shared.pending,s===null)break;var w=s,T=w.next;w.next=null,v=T,i.lastBaseUpdate=w,i.shared.pending=null}}while(!0);_===null&&(h=p),i.baseState=h,i.firstBaseUpdate=g,i.lastBaseUpdate=_;var E=i.shared.interleaved;if(E!==null){var D=E;do m=va(m,D.lane),D=D.next;while(D!==E)}else a===null&&(i.shared.lanes=V);Q_(m),e.lanes=m,e.memoizedState=p}_l=null}function El(e,t){if(typeof e!=`function`)throw Error(`Invalid argument passed as callback. Expected a function. Instead `+(`received: `+e));e.call(t)}function Dl(){hl=!1}function Ol(){return hl}function kl(e,t,n){var r=t.effects;if(t.effects=null,r!==null)for(var i=0;i<r.length;i++){var a=r[i],o=a.callback;o!==null&&(a.callback=null,El(o,n))}}var Al={},jl=Mr(Al),Ml=Mr(Al),Nl=Mr(Al);function Pl(e){if(e===Al)throw Error(`Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.`);return e}function Fl(){return Pl(Nl.current)}function Il(e,t){Pr(Nl,t,e),Pr(Ml,e,e),Pr(jl,Al,e);var n=St(t);Nr(jl,e),Pr(jl,n,e)}function Ll(e){Nr(jl,e),Nr(Ml,e),Nr(Nl,e)}function Rl(){return Pl(jl.current)}function zl(e){var t=Pl(Nl.current),n=Pl(jl.current),r=Ct(n,e.type,t);n!==r&&(Pr(Ml,e,e),Pr(jl,r,e))}function Bl(e){Ml.current===e&&(Nr(jl,e),Nr(Ml,e))}var Vl=0,Hl=1,Ul=1,Wl=2,Gl=Mr(Vl);function Kl(e,t){return(e&t)!==0}function ql(e){return e&Hl}function Jl(e,t){return e&Hl|t}function Yl(e,t){return e|t}function Xl(e,t){Pr(Gl,t,e)}function Zl(e){Nr(Gl,e)}function Ql(e,t){var n=e.memoizedState;return n===null?(e.memoizedProps,!0):n.dehydrated!==null}function $l(e){for(var t=e;t!==null;){if(t.tag===M){var n=t.memoizedState;if(n!==null){var r=n.dehydrated;if(r===null||Tn(r)||En(r))return t}}else if(t.tag===L&&t.memoizedProps.revealOrder!==void 0){if((t.flags&ze)!==R)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)return null;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var eu=0,tu=1,nu=2,ru=4,iu=8,au=[];function ou(){for(var e=0;e<au.length;e++){var t=au[e];Ft?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}au.length=0}function su(e,t){var n=t._getVersion,r=n(t._source);e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,r]:e.mutableSourceEagerHydrationData.push(t,r)}var W=i.ReactCurrentDispatcher,cu=i.ReactCurrentBatchConfig,lu=new Set,uu,du=V,fu=null,pu=null,mu=null,hu=!1,gu=!1,_u=0,vu=0,yu=25,G=null,bu=null,xu=-1,Su=!1;function Cu(){var e=G;bu===null?bu=[e]:bu.push(e)}function K(){var e=G;bu!==null&&(xu++,bu[xu]!==e&&Tu(e))}function wu(e){e!=null&&!bt(e)&&c("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",G,typeof e)}function Tu(e){var t=Me(fu);if(!lu.has(t)&&(lu.add(t),bu!==null)){for(var n=``,r=30,i=0;i<=xu;i++){for(var a=bu[i],o=i===xu?e:a,s=i+1+`. `+a;s.length<r;)s+=` `;s+=o+`
|
|
84
|
+
`,n+=s}c(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks
|
|
85
|
+
|
|
86
|
+
Previous render Next render
|
|
87
|
+
------------------------------------------------------
|
|
88
|
+
%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
89
|
+
`,t,n)}}function q(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
90
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
91
|
+
2. You might be breaking the Rules of Hooks
|
|
92
|
+
3. You might have more than one copy of React in the same app
|
|
93
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function Eu(e,t){if(Su)return!1;if(t===null)return c(`%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.`,G),!1;e.length!==t.length&&c(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
|
|
94
|
+
|
|
95
|
+
Previous: %s
|
|
96
|
+
Incoming: %s`,G,`[`+t.join(`, `)+`]`,`[`+e.join(`, `)+`]`);for(var n=0;n<t.length&&n<e.length;n++)if(!Bo(e[n],t[n]))return!1;return!0}function Du(e,t,n,r,i,a){du=a,fu=t,bu=e===null?null:e._debugHookTypes,xu=-1,Su=e!==null&&e.type!==t.type,t.memoizedState=null,t.updateQueue=null,t.lanes=V,W.current=e!==null&&e.memoizedState!==null?Fd:bu===null?Nd:Pd;var o=n(r,i);if(gu){var s=0;do{if(gu=!1,_u=0,s>=yu)throw Error(`Too many re-renders. React limits the number of renders to prevent an infinite loop.`);s+=1,Su=!1,pu=null,mu=null,t.updateQueue=null,xu=-1,W.current=Id,o=n(r,i)}while(gu)}W.current=Md,t._debugHookTypes=bu;var l=pu!==null&&pu.next!==null;if(du=V,fu=null,pu=null,mu=null,G=null,bu=null,xu=-1,e!==null&&(e.flags&ct)!==(t.flags&ct)&&(e.mode&ei)!==B&&c(`Internal React error: Expected static flag was missing. Please notify the React team.`),hu=!1,l)throw Error(`Rendered fewer hooks than expected. This may be caused by an accidental early return statement.`);return o}function Ou(){var e=_u!==0;return _u=0,e}function ku(e,t,n){t.updateQueue=e.updateQueue,(t.mode&ri)===B?t.flags&=~(Ue|Fe):t.flags&=~(rt|nt|Ue|Fe),e.lanes=ya(e.lanes,n)}function Au(){if(W.current=Md,hu){for(var e=fu.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hu=!1}du=V,fu=null,pu=null,mu=null,bu=null,xu=-1,G=null,Sd=!1,gu=!1,_u=0}function ju(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mu===null?fu.memoizedState=mu=e:mu=mu.next=e,mu}function Mu(){var e;if(pu===null){var t=fu.alternate;e=t===null?null:t.memoizedState}else e=pu.next;var n=mu===null?fu.memoizedState:mu.next;if(n!==null)mu=n,n=mu.next,pu=e;else{if(e===null)throw Error(`Rendered more hooks than during the previous render.`);pu=e;var r={memoizedState:pu.memoizedState,baseState:pu.baseState,baseQueue:pu.baseQueue,queue:pu.queue,next:null};mu===null?fu.memoizedState=mu=r:mu=mu.next=r}return mu}function Nu(){return{lastEffect:null,stores:null}}function Pu(e,t){return typeof t==`function`?t(e):t}function Fu(e,t,n){var r=ju(),i=n===void 0?t:n(t);r.memoizedState=r.baseState=i;var a={pending:null,interleaved:null,lanes:V,dispatch:null,lastRenderedReducer:e,lastRenderedState:i};r.queue=a;var o=a.dispatch=Ed.bind(null,fu,a);return[r.memoizedState,o]}function Iu(e,t,n){var r=Mu(),i=r.queue;if(i===null)throw Error(`Should have a queue. This is likely a bug in React. Please file an issue.`);i.lastRenderedReducer=e;var a=pu,o=a.baseQueue,s=i.pending;if(s!==null){if(o!==null){var l=o.next,u=s.next;o.next=u,s.next=l}a.baseQueue!==o&&c(`Internal error: Expected work-in-progress queue to be a clone. This is a bug in React.`),a.baseQueue=o=s,i.pending=null}if(o!==null){var d=o.next,f=a.baseState,p=null,m=null,h=null,g=d;do{var _=g.lane;if(_a(du,_)){if(h!==null){var v={lane:li,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null};h=h.next=v}if(g.hasEagerState)f=g.eagerState;else{var y=g.action;f=e(f,y)}}else{var b={lane:_,action:g.action,hasEagerState:g.hasEagerState,eagerState:g.eagerState,next:null};h===null?(m=h=b,p=f):h=h.next=b,fu.lanes=va(fu.lanes,_),Q_(_)}g=g.next}while(g!==null&&g!==d);h===null?p=f:h.next=m,Bo(f,r.memoizedState)||im(),r.memoizedState=f,r.baseState=p,r.baseQueue=h,i.lastRenderedState=f}var x=i.interleaved;if(x!==null){var S=x;do{var C=S.lane;fu.lanes=va(fu.lanes,C),Q_(C),S=S.next}while(S!==x)}else o===null&&(i.lanes=V);var w=i.dispatch;return[r.memoizedState,w]}function Lu(e,t,n){var r=Mu(),i=r.queue;if(i===null)throw Error(`Should have a queue. This is likely a bug in React. Please file an issue.`);i.lastRenderedReducer=e;var a=i.dispatch,o=i.pending,s=r.memoizedState;if(o!==null){i.pending=null;var c=o.next,l=c;do{var u=l.action;s=e(s,u),l=l.next}while(l!==c);Bo(s,r.memoizedState)||im(),r.memoizedState=s,r.baseQueue===null&&(r.baseState=s),i.lastRenderedState=s}return[s,a]}function Ru(e,t,n){var r=fu,i=ju(),a;if(Ws()){if(n===void 0)throw Error(`Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.`);a=n(),uu||a!==n()&&(c(`The result of getServerSnapshot should be cached to avoid an infinite loop`),uu=!0)}else{if(a=t(),!uu){var o=t();Bo(a,o)||(c(`The result of getSnapshot should be cached to avoid an infinite loop`),uu=!0)}var s=C_();if(s===null)throw Error(`Expected a work-in-progress root. This is a bug in React. Please file an issue.`);sa(s,du)||Bu(r,t,a)}i.memoizedState=a;var l={value:a,getSnapshot:t};return i.queue=l,$u(Hu.bind(null,r,l,e),[e]),r.flags|=Ue,Ju(tu|iu,Vu.bind(null,r,l,a,t),void 0,null),a}function zu(e,t,n){var r=fu,i=Mu(),a=t();uu||Bo(a,t())||(c(`The result of getSnapshot should be cached to avoid an infinite loop`),uu=!0);var o=i.memoizedState,s=!Bo(o,a);s&&(i.memoizedState=a,im());var l=i.queue;if(ed(Hu.bind(null,r,l,e),[e]),l.getSnapshot!==t||s||mu!==null&&mu.memoizedState.tag&tu){r.flags|=Ue,Ju(tu|iu,Vu.bind(null,r,l,a,t),void 0,null);var u=C_();if(u===null)throw Error(`Expected a work-in-progress root. This is a bug in React. Please file an issue.`);sa(u,du)||Bu(r,t,a)}return a}function Bu(e,t,n){e.flags|=Ke;var r={getSnapshot:t,value:n},i=fu.updateQueue;if(i===null)i=Nu(),fu.updateQueue=i,i.stores=[r];else{var a=i.stores;a===null?i.stores=[r]:a.push(r)}}function Vu(e,t,n,r){t.value=n,t.getSnapshot=r,Uu(t)&&Wu(e)}function Hu(e,t,n){return n(function(){Uu(t)&&Wu(e)})}function Uu(e){var t=e.getSnapshot,n=e.value;try{return!Bo(n,t())}catch{return!0}}function Wu(e){var t=cl(e,ui);t!==null&&D_(t,e,ui,Ki)}function Gu(e){var t=ju();typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e;var n={pending:null,interleaved:null,lanes:V,dispatch:null,lastRenderedReducer:Pu,lastRenderedState:e};t.queue=n;var r=n.dispatch=Dd.bind(null,fu,n);return[t.memoizedState,r]}function Ku(e){return Iu(Pu)}function qu(e){return Lu(Pu)}function Ju(e,t,n,r){var i={tag:e,create:t,destroy:n,deps:r,next:null},a=fu.updateQueue;if(a===null)a=Nu(),fu.updateQueue=a,a.lastEffect=i.next=i;else{var o=a.lastEffect;if(o===null)a.lastEffect=i.next=i;else{var s=o.next;o.next=i,i.next=s,a.lastEffect=i}}return i}function Yu(e){var t=ju(),n={current:e};return t.memoizedState=n,n}function Xu(e){return Mu().memoizedState}function Zu(e,t,n,r){var i=ju(),a=r===void 0?null:r;fu.flags|=e,i.memoizedState=Ju(tu|t,n,void 0,a)}function Qu(e,t,n,r){var i=Mu(),a=r===void 0?null:r,o=void 0;if(pu!==null){var s=pu.memoizedState;if(o=s.destroy,a!==null){var c=s.deps;if(Eu(a,c)){i.memoizedState=Ju(t,n,o,a);return}}}fu.flags|=e,i.memoizedState=Ju(tu|t,n,o,a)}function $u(e,t){return(fu.mode&ri)===B?Zu(Ue|tt,iu,e,t):Zu(rt|Ue|tt,iu,e,t)}function ed(e,t){return Qu(Ue,iu,e,t)}function td(e,t){return Zu(Fe,nu,e,t)}function nd(e,t){return Qu(Fe,nu,e,t)}function rd(e,t){var n=Fe;return n|=et,(fu.mode&ri)!==B&&(n|=nt),Zu(n,ru,e,t)}function id(e,t){return Qu(Fe,ru,e,t)}function ad(e,t){if(typeof t==`function`){var n=t;return n(e()),function(){n(null)}}if(t!=null){var r=t;return r.hasOwnProperty(`current`)||c(`Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.`,`an object with keys {`+Object.keys(r).join(`, `)+`}`),r.current=e(),function(){r.current=null}}}function od(e,t,n){typeof t!=`function`&&c(`Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.`,t===null?`null`:typeof t);var r=n==null?null:n.concat([e]),i=Fe;return i|=et,(fu.mode&ri)!==B&&(i|=nt),Zu(i,ru,ad.bind(null,t,e),r)}function sd(e,t,n){typeof t!=`function`&&c(`Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.`,t===null?`null`:typeof t);var r=n==null?null:n.concat([e]);return Qu(Fe,ru,ad.bind(null,t,e),r)}function cd(e,t){}var ld=cd;function ud(e,t){var n=ju();return n.memoizedState=[e,t===void 0?null:t],e}function dd(e,t){var n=Mu(),r=t===void 0?null:t,i=n.memoizedState;if(i!==null&&r!==null){var a=i[1];if(Eu(r,a))return i[0]}return n.memoizedState=[e,r],e}function fd(e,t){var n=ju(),r=t===void 0?null:t,i=e();return n.memoizedState=[i,r],i}function pd(e,t){var n=Mu(),r=t===void 0?null:t,i=n.memoizedState;if(i!==null&&r!==null){var a=i[1];if(Eu(r,a))return i[0]}var o=e();return n.memoizedState=[o,r],o}function md(e){var t=ju();return t.memoizedState=e,e}function hd(e){var t=Mu(),n=pu.memoizedState;return _d(t,n,e)}function gd(e){var t=Mu();if(pu===null)return t.memoizedState=e,e;var n=pu.memoizedState;return _d(t,n,e)}function _d(e,t,n){if(aa(du))return e.baseState&&(e.baseState=!1,im()),e.memoizedState=n,n;if(!Bo(n,t)){var r=ua();fu.lanes=va(fu.lanes,r),Q_(r),e.baseState=!0}return t}function vd(e,t,n){var r=Ra();za(Va(r,H)),e(!0);var i=cu.transition;cu.transition={};var a=cu.transition;cu.transition._updatedFibers=new Set;try{e(!1),t()}finally{za(r),cu.transition=i,i===null&&a._updatedFibers&&(a._updatedFibers.size>10&&s(`Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.`),a._updatedFibers.clear())}}function yd(){var e=Gu(!1),t=e[0],n=e[1],r=vd.bind(null,n),i=ju();return i.memoizedState=r,[t,r]}function bd(){return[Ku()[0],Mu().memoizedState]}function xd(){return[qu()[0],Mu().memoizedState]}var Sd=!1;function Cd(){return Sd}function wd(){var e=ju(),t=C_().identifierPrefix,n;if(Ws()){var r=os();n=`:`+t+`R`+r;var i=_u++;i>0&&(n+=`H`+i.toString(32)),n+=`:`}else{var a=vu++;n=`:`+t+`r`+a.toString(32)+`:`}return e.memoizedState=n,n}function Td(){return Mu().memoizedState}function Ed(e,t,n){typeof arguments[3]==`function`&&c(`State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().`);var r=T_(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Od(e))kd(t,i);else{var a=al(e,t,i,r);a!==null&&(D_(a,e,r,w_()),Ad(a,t,r))}jd(e,r)}function Dd(e,t,n){typeof arguments[3]==`function`&&c(`State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().`);var r=T_(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Od(e))kd(t,i);else{var a=e.alternate;if(e.lanes===V&&(a===null||a.lanes===V)){var o=t.lastRenderedReducer;if(o!==null){var s=W.current;W.current=Rd;try{var l=t.lastRenderedState,u=o(l,n);if(i.hasEagerState=!0,i.eagerState=u,Bo(u,l)){ol(e,t,i,r);return}}catch{}finally{W.current=s}}}var d=al(e,t,i,r);d!==null&&(D_(d,e,r,w_()),Ad(d,t,r))}jd(e,r)}function Od(e){var t=e.alternate;return e===fu||t!==null&&t===fu}function kd(e,t){gu=hu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ad(e,t,n){if(la(n)){var r=t.lanes;r=ba(r,e.pendingLanes);var i=va(r,n);t.lanes=i,ka(e,i)}}function jd(e,t,n){Ro(e,t)}var Md={readContext:tl,useCallback:q,useContext:q,useEffect:q,useImperativeHandle:q,useInsertionEffect:q,useLayoutEffect:q,useMemo:q,useReducer:q,useRef:q,useState:q,useDebugValue:q,useDeferredValue:q,useTransition:q,useMutableSource:q,useSyncExternalStore:q,useId:q,unstable_isNewReconciler:p},Nd=null,Pd=null,Fd=null,Id=null,Ld=null,Rd=null,zd=null,Bd=function(){c(`Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().`)},Vd=function(){c(`Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks`)};Nd={readContext:function(e){return tl(e)},useCallback:function(e,t){return G=`useCallback`,Cu(),wu(t),ud(e,t)},useContext:function(e){return G=`useContext`,Cu(),tl(e)},useEffect:function(e,t){return G=`useEffect`,Cu(),wu(t),$u(e,t)},useImperativeHandle:function(e,t,n){return G=`useImperativeHandle`,Cu(),wu(n),od(e,t,n)},useInsertionEffect:function(e,t){return G=`useInsertionEffect`,Cu(),wu(t),td(e,t)},useLayoutEffect:function(e,t){return G=`useLayoutEffect`,Cu(),wu(t),rd(e,t)},useMemo:function(e,t){G=`useMemo`,Cu(),wu(t);var n=W.current;W.current=Ld;try{return fd(e,t)}finally{W.current=n}},useReducer:function(e,t,n){G=`useReducer`,Cu();var r=W.current;W.current=Ld;try{return Fu(e,t,n)}finally{W.current=r}},useRef:function(e){return G=`useRef`,Cu(),Yu(e)},useState:function(e){G=`useState`,Cu();var t=W.current;W.current=Ld;try{return Gu(e)}finally{W.current=t}},useDebugValue:function(e,t){G=`useDebugValue`,Cu()},useDeferredValue:function(e){return G=`useDeferredValue`,Cu(),md(e)},useTransition:function(){return G=`useTransition`,Cu(),yd()},useMutableSource:function(e,t,n){G=`useMutableSource`,Cu()},useSyncExternalStore:function(e,t,n){return G=`useSyncExternalStore`,Cu(),Ru(e,t,n)},useId:function(){return G=`useId`,Cu(),wd()},unstable_isNewReconciler:p},Pd={readContext:function(e){return tl(e)},useCallback:function(e,t){return G=`useCallback`,K(),ud(e,t)},useContext:function(e){return G=`useContext`,K(),tl(e)},useEffect:function(e,t){return G=`useEffect`,K(),$u(e,t)},useImperativeHandle:function(e,t,n){return G=`useImperativeHandle`,K(),od(e,t,n)},useInsertionEffect:function(e,t){return G=`useInsertionEffect`,K(),td(e,t)},useLayoutEffect:function(e,t){return G=`useLayoutEffect`,K(),rd(e,t)},useMemo:function(e,t){G=`useMemo`,K();var n=W.current;W.current=Ld;try{return fd(e,t)}finally{W.current=n}},useReducer:function(e,t,n){G=`useReducer`,K();var r=W.current;W.current=Ld;try{return Fu(e,t,n)}finally{W.current=r}},useRef:function(e){return G=`useRef`,K(),Yu(e)},useState:function(e){G=`useState`,K();var t=W.current;W.current=Ld;try{return Gu(e)}finally{W.current=t}},useDebugValue:function(e,t){G=`useDebugValue`,K()},useDeferredValue:function(e){return G=`useDeferredValue`,K(),md(e)},useTransition:function(){return G=`useTransition`,K(),yd()},useMutableSource:function(e,t,n){G=`useMutableSource`,K()},useSyncExternalStore:function(e,t,n){return G=`useSyncExternalStore`,K(),Ru(e,t,n)},useId:function(){return G=`useId`,K(),wd()},unstable_isNewReconciler:p},Fd={readContext:function(e){return tl(e)},useCallback:function(e,t){return G=`useCallback`,K(),dd(e,t)},useContext:function(e){return G=`useContext`,K(),tl(e)},useEffect:function(e,t){return G=`useEffect`,K(),ed(e,t)},useImperativeHandle:function(e,t,n){return G=`useImperativeHandle`,K(),sd(e,t,n)},useInsertionEffect:function(e,t){return G=`useInsertionEffect`,K(),nd(e,t)},useLayoutEffect:function(e,t){return G=`useLayoutEffect`,K(),id(e,t)},useMemo:function(e,t){G=`useMemo`,K();var n=W.current;W.current=Rd;try{return pd(e,t)}finally{W.current=n}},useReducer:function(e,t,n){G=`useReducer`,K();var r=W.current;W.current=Rd;try{return Iu(e,t,n)}finally{W.current=r}},useRef:function(e){return G=`useRef`,K(),Xu()},useState:function(e){G=`useState`,K();var t=W.current;W.current=Rd;try{return Ku(e)}finally{W.current=t}},useDebugValue:function(e,t){return G=`useDebugValue`,K(),ld()},useDeferredValue:function(e){return G=`useDeferredValue`,K(),hd(e)},useTransition:function(){return G=`useTransition`,K(),bd()},useMutableSource:function(e,t,n){G=`useMutableSource`,K()},useSyncExternalStore:function(e,t,n){return G=`useSyncExternalStore`,K(),zu(e,t)},useId:function(){return G=`useId`,K(),Td()},unstable_isNewReconciler:p},Id={readContext:function(e){return tl(e)},useCallback:function(e,t){return G=`useCallback`,K(),dd(e,t)},useContext:function(e){return G=`useContext`,K(),tl(e)},useEffect:function(e,t){return G=`useEffect`,K(),ed(e,t)},useImperativeHandle:function(e,t,n){return G=`useImperativeHandle`,K(),sd(e,t,n)},useInsertionEffect:function(e,t){return G=`useInsertionEffect`,K(),nd(e,t)},useLayoutEffect:function(e,t){return G=`useLayoutEffect`,K(),id(e,t)},useMemo:function(e,t){G=`useMemo`,K();var n=W.current;W.current=zd;try{return pd(e,t)}finally{W.current=n}},useReducer:function(e,t,n){G=`useReducer`,K();var r=W.current;W.current=zd;try{return Lu(e,t,n)}finally{W.current=r}},useRef:function(e){return G=`useRef`,K(),Xu()},useState:function(e){G=`useState`,K();var t=W.current;W.current=zd;try{return qu(e)}finally{W.current=t}},useDebugValue:function(e,t){return G=`useDebugValue`,K(),ld()},useDeferredValue:function(e){return G=`useDeferredValue`,K(),gd(e)},useTransition:function(){return G=`useTransition`,K(),xd()},useMutableSource:function(e,t,n){G=`useMutableSource`,K()},useSyncExternalStore:function(e,t,n){return G=`useSyncExternalStore`,K(),zu(e,t)},useId:function(){return G=`useId`,K(),Td()},unstable_isNewReconciler:p},Ld={readContext:function(e){return Bd(),tl(e)},useCallback:function(e,t){return G=`useCallback`,Vd(),Cu(),ud(e,t)},useContext:function(e){return G=`useContext`,Vd(),Cu(),tl(e)},useEffect:function(e,t){return G=`useEffect`,Vd(),Cu(),$u(e,t)},useImperativeHandle:function(e,t,n){return G=`useImperativeHandle`,Vd(),Cu(),od(e,t,n)},useInsertionEffect:function(e,t){return G=`useInsertionEffect`,Vd(),Cu(),td(e,t)},useLayoutEffect:function(e,t){return G=`useLayoutEffect`,Vd(),Cu(),rd(e,t)},useMemo:function(e,t){G=`useMemo`,Vd(),Cu();var n=W.current;W.current=Ld;try{return fd(e,t)}finally{W.current=n}},useReducer:function(e,t,n){G=`useReducer`,Vd(),Cu();var r=W.current;W.current=Ld;try{return Fu(e,t,n)}finally{W.current=r}},useRef:function(e){return G=`useRef`,Vd(),Cu(),Yu(e)},useState:function(e){G=`useState`,Vd(),Cu();var t=W.current;W.current=Ld;try{return Gu(e)}finally{W.current=t}},useDebugValue:function(e,t){G=`useDebugValue`,Vd(),Cu()},useDeferredValue:function(e){return G=`useDeferredValue`,Vd(),Cu(),md(e)},useTransition:function(){return G=`useTransition`,Vd(),Cu(),yd()},useMutableSource:function(e,t,n){G=`useMutableSource`,Vd(),Cu()},useSyncExternalStore:function(e,t,n){return G=`useSyncExternalStore`,Vd(),Cu(),Ru(e,t,n)},useId:function(){return G=`useId`,Vd(),Cu(),wd()},unstable_isNewReconciler:p},Rd={readContext:function(e){return Bd(),tl(e)},useCallback:function(e,t){return G=`useCallback`,Vd(),K(),dd(e,t)},useContext:function(e){return G=`useContext`,Vd(),K(),tl(e)},useEffect:function(e,t){return G=`useEffect`,Vd(),K(),ed(e,t)},useImperativeHandle:function(e,t,n){return G=`useImperativeHandle`,Vd(),K(),sd(e,t,n)},useInsertionEffect:function(e,t){return G=`useInsertionEffect`,Vd(),K(),nd(e,t)},useLayoutEffect:function(e,t){return G=`useLayoutEffect`,Vd(),K(),id(e,t)},useMemo:function(e,t){G=`useMemo`,Vd(),K();var n=W.current;W.current=Rd;try{return pd(e,t)}finally{W.current=n}},useReducer:function(e,t,n){G=`useReducer`,Vd(),K();var r=W.current;W.current=Rd;try{return Iu(e,t,n)}finally{W.current=r}},useRef:function(e){return G=`useRef`,Vd(),K(),Xu()},useState:function(e){G=`useState`,Vd(),K();var t=W.current;W.current=Rd;try{return Ku(e)}finally{W.current=t}},useDebugValue:function(e,t){return G=`useDebugValue`,Vd(),K(),ld()},useDeferredValue:function(e){return G=`useDeferredValue`,Vd(),K(),hd(e)},useTransition:function(){return G=`useTransition`,Vd(),K(),bd()},useMutableSource:function(e,t,n){G=`useMutableSource`,Vd(),K()},useSyncExternalStore:function(e,t,n){return G=`useSyncExternalStore`,Vd(),K(),zu(e,t)},useId:function(){return G=`useId`,Vd(),K(),Td()},unstable_isNewReconciler:p},zd={readContext:function(e){return Bd(),tl(e)},useCallback:function(e,t){return G=`useCallback`,Vd(),K(),dd(e,t)},useContext:function(e){return G=`useContext`,Vd(),K(),tl(e)},useEffect:function(e,t){return G=`useEffect`,Vd(),K(),ed(e,t)},useImperativeHandle:function(e,t,n){return G=`useImperativeHandle`,Vd(),K(),sd(e,t,n)},useInsertionEffect:function(e,t){return G=`useInsertionEffect`,Vd(),K(),nd(e,t)},useLayoutEffect:function(e,t){return G=`useLayoutEffect`,Vd(),K(),id(e,t)},useMemo:function(e,t){G=`useMemo`,Vd(),K();var n=W.current;W.current=Rd;try{return pd(e,t)}finally{W.current=n}},useReducer:function(e,t,n){G=`useReducer`,Vd(),K();var r=W.current;W.current=Rd;try{return Lu(e,t,n)}finally{W.current=r}},useRef:function(e){return G=`useRef`,Vd(),K(),Xu()},useState:function(e){G=`useState`,Vd(),K();var t=W.current;W.current=Rd;try{return qu(e)}finally{W.current=t}},useDebugValue:function(e,t){return G=`useDebugValue`,Vd(),K(),ld()},useDeferredValue:function(e){return G=`useDeferredValue`,Vd(),K(),gd(e)},useTransition:function(){return G=`useTransition`,Vd(),K(),xd()},useMutableSource:function(e,t,n){G=`useMutableSource`,Vd(),K()},useSyncExternalStore:function(e,t,n){return G=`useSyncExternalStore`,Vd(),K(),zu(e,t)},useId:function(){return G=`useId`,Vd(),K(),Td()},unstable_isNewReconciler:p};var Hd=r.unstable_now,Ud=0,Wd=-1,Gd=-1,Kd=-1,qd=!1,Jd=!1;function Yd(){return qd}function Xd(){Jd=!0}function Zd(){qd=!1,Jd=!1}function Qd(){qd=Jd,Jd=!1}function $d(){return Ud}function ef(){Ud=Hd()}function tf(e){Gd=Hd(),e.actualStartTime<0&&(e.actualStartTime=Hd())}function nf(e){Gd=-1}function rf(e,t){if(Gd>=0){var n=Hd()-Gd;e.actualDuration+=n,t&&(e.selfBaseDuration=n),Gd=-1}}function af(e){if(Wd>=0){var t=Hd()-Wd;Wd=-1;for(var n=e.return;n!==null;){switch(n.tag){case S:var r=n.stateNode;r.effectDuration+=t;return;case j:var i=n.stateNode;i.effectDuration+=t;return}n=n.return}}}function of(e){if(Kd>=0){var t=Hd()-Kd;Kd=-1;for(var n=e.return;n!==null;){switch(n.tag){case S:var r=n.stateNode;r!==null&&(r.passiveEffectDuration+=t);return;case j:var i=n.stateNode;i!==null&&(i.passiveEffectDuration+=t);return}n=n.return}}}function sf(){Wd=Hd()}function cf(){Kd=Hd()}function lf(e){for(var t=e.child;t;)e.actualDuration+=t.actualDuration,t=t.sibling}function uf(e,t){if(e&&e.defaultProps){var n=u({},t),r=e.defaultProps;for(var i in r)n[i]===void 0&&(n[i]=r[i]);return n}return t}var df={},ff=new Set,pf=new Set,mf=new Set,hf=new Set,gf,_f,vf,yf=new Set,bf,xf,Sf;gf=new Set,bf=new Set,xf=new Set,Sf=new Set;var Cf=new Set;vf=function(e,t){if(e!==null&&typeof e!=`function`){var n=t+`_`+e;Cf.has(n)||(Cf.add(n),c("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",t,e))}},_f=function(e,t){if(t===void 0){var n=ke(e)||`Component`;gf.has(n)||(gf.add(n),c(`%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.`,n))}},Object.defineProperty(df,"_processChildContext",{enumerable:!1,value:function(){throw Error(`_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).`)}}),Object.freeze(df);function wf(e,t,n,r){var i=e.memoizedState,a=n(r,i);if(e.mode&ni){fo(!0);try{a=n(r,i)}finally{fo(!1)}}_f(t,a);var o=a==null?i:u({},i,a);if(e.memoizedState=o,e.lanes===V){var s=e.updateQueue;s.baseState=o}}var Tf={isMounted:ft,enqueueSetState:function(e,t,n){var r=d(e),i=w_(),a=T_(r),o=bl(i,a);o.payload=t,n!=null&&(vf(n,`setState`),o.callback=n);var s=xl(r,o,a);s!==null&&(D_(s,r,a,i),Sl(s,r,a)),Ro(r,a)},enqueueReplaceState:function(e,t,n){var r=d(e),i=w_(),a=T_(r),o=bl(i,a);o.tag=fl,o.payload=t,n!=null&&(vf(n,`replaceState`),o.callback=n);var s=xl(r,o,a);s!==null&&(D_(s,r,a,i),Sl(s,r,a)),Ro(r,a)},enqueueForceUpdate:function(e,t){var n=d(e),r=w_(),i=T_(n),a=bl(r,i);a.tag=pl,t!=null&&(vf(t,`forceUpdate`),a.callback=t);var o=xl(n,a,i);o!==null&&(D_(o,n,i,r),Sl(o,n,i)),Lo(n,i)}};function Ef(e,t,n,r,i,a,o){var s=e.stateNode;if(typeof s.shouldComponentUpdate==`function`){var l=s.shouldComponentUpdate(r,a,o);if(e.mode&ni){fo(!0);try{l=s.shouldComponentUpdate(r,a,o)}finally{fo(!1)}}return l===void 0&&c(`%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.`,ke(t)||`Component`),l}return t.prototype&&t.prototype.isPureReactComponent?!Ys(n,r)||!Ys(i,a):!0}function Df(e,t,n){var r=e.stateNode,i=ke(t)||`Component`;r.render||(t.prototype&&typeof t.prototype.render==`function`?c("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",i):c("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",i)),r.getInitialState&&!r.getInitialState.isReactClassApproved&&!r.state&&c(`getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?`,i),r.getDefaultProps&&!r.getDefaultProps.isReactClassApproved&&c(`getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.`,i),r.propTypes&&c(`propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.`,i),r.contextType&&c(`contextType was defined as an instance property on %s. Use a static property to define contextType instead.`,i),t.childContextTypes&&!Sf.has(t)&&(e.mode&ni)===B&&(Sf.add(t),c(`%s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead
|
|
97
|
+
|
|
98
|
+
.Learn more about this warning here: https://reactjs.org/link/legacy-context`,i)),t.contextTypes&&!Sf.has(t)&&(e.mode&ni)===B&&(Sf.add(t),c(`%s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() with static contextType instead.
|
|
99
|
+
|
|
100
|
+
Learn more about this warning here: https://reactjs.org/link/legacy-context`,i)),r.contextTypes&&c(`contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.`,i),t.contextType&&t.contextTypes&&!bf.has(t)&&(bf.add(t),c(`%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.`,i)),typeof r.componentShouldUpdate==`function`&&c(`%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.`,i),t.prototype&&t.prototype.isPureReactComponent&&r.shouldComponentUpdate!==void 0&&c(`%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.`,ke(t)||`A pure component`),typeof r.componentDidUnmount==`function`&&c(`%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?`,i),typeof r.componentDidReceiveProps==`function`&&c(`%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().`,i),typeof r.componentWillRecieveProps==`function`&&c(`%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?`,i),typeof r.UNSAFE_componentWillRecieveProps==`function`&&c(`%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?`,i);var a=r.props!==n;r.props!==void 0&&a&&c("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",i,i),r.defaultProps&&c(`Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.`,i,i),typeof r.getSnapshotBeforeUpdate==`function`&&typeof r.componentDidUpdate!=`function`&&!mf.has(t)&&(mf.add(t),c(`%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.`,ke(t))),typeof r.getDerivedStateFromProps==`function`&&c(`%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.`,i),typeof r.getDerivedStateFromError==`function`&&c(`%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.`,i),typeof t.getSnapshotBeforeUpdate==`function`&&c(`%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.`,i);var o=r.state;o&&(typeof o!=`object`||bt(o))&&c(`%s.state: must be set to an object or null`,i),typeof r.getChildContext==`function`&&typeof t.childContextTypes!=`object`&&c(`%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().`,i)}function Of(e,t){t.updater=Tf,e.stateNode=t,f(t,e),t._reactInternalInstance=df}function kf(e,t,n){var r=!1,i=Ir,a=Ir,o=t.contextType;if(`contextType`in t&&!(o===null||o!==void 0&&o.$$typeof===fe&&o._context===void 0)&&!xf.has(t)){xf.add(t);var s=``;s=o===void 0?` However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.`:typeof o==`object`?o.$$typeof===de?` Did you accidentally pass the Context.Provider instead?`:o._context===void 0?` However, it is set to an object with keys {`+Object.keys(o).join(`, `)+`}.`:` Did you accidentally pass the Context.Consumer instead?`:` However, it is set to a `+typeof o+`.`,c(`%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s`,ke(t)||`Component`,s)}typeof o==`object`&&o?a=tl(o):(i=Br(e,t,!0),r=t.contextTypes!=null,a=r?Hr(e,i):Ir);var l=new t(n,a);if(e.mode&ni){fo(!0);try{l=new t(n,a)}finally{fo(!1)}}var u=e.memoizedState=l.state!==null&&l.state!==void 0?l.state:null;if(Of(e,l),typeof t.getDerivedStateFromProps==`function`&&u===null){var d=ke(t)||`Component`;pf.has(d)||(pf.add(d),c("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",d,l.state===null?`null`:`undefined`,d))}if(typeof t.getDerivedStateFromProps==`function`||typeof l.getSnapshotBeforeUpdate==`function`){var f=null,p=null,m=null;if(typeof l.componentWillMount==`function`&&l.componentWillMount.__suppressDeprecationWarning!==!0?f=`componentWillMount`:typeof l.UNSAFE_componentWillMount==`function`&&(f=`UNSAFE_componentWillMount`),typeof l.componentWillReceiveProps==`function`&&l.componentWillReceiveProps.__suppressDeprecationWarning!==!0?p=`componentWillReceiveProps`:typeof l.UNSAFE_componentWillReceiveProps==`function`&&(p=`UNSAFE_componentWillReceiveProps`),typeof l.componentWillUpdate==`function`&&l.componentWillUpdate.__suppressDeprecationWarning!==!0?m=`componentWillUpdate`:typeof l.UNSAFE_componentWillUpdate==`function`&&(m=`UNSAFE_componentWillUpdate`),f!==null||p!==null||m!==null){var h=ke(t)||`Component`,g=typeof t.getDerivedStateFromProps==`function`?`getDerivedStateFromProps()`:`getSnapshotBeforeUpdate()`;hf.has(h)||(hf.add(h),c(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
101
|
+
|
|
102
|
+
%s uses %s but also contains the following legacy lifecycles:%s%s%s
|
|
103
|
+
|
|
104
|
+
The above lifecycles should be removed. Learn more about this warning here:
|
|
105
|
+
https://reactjs.org/link/unsafe-component-lifecycles`,h,g,f===null?``:`
|
|
106
|
+
`+f,p===null?``:`
|
|
107
|
+
`+p,m===null?``:`
|
|
108
|
+
`+m))}}return r&&Vr(e,i,a),l}function Af(e,t){var n=t.state;typeof t.componentWillMount==`function`&&t.componentWillMount(),typeof t.UNSAFE_componentWillMount==`function`&&t.UNSAFE_componentWillMount(),n!==t.state&&(c(`%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.`,Me(e)||`Component`),Tf.enqueueReplaceState(t,t.state,null))}function jf(e,t,n,r){var i=t.state;if(typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==i){var a=Me(e)||`Component`;ff.has(a)||(ff.add(a),c(`%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.`,a)),Tf.enqueueReplaceState(t,t.state,null)}}function Mf(e,t,n,r){Df(e,t,n);var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},vl(e);var a=t.contextType;if(i.context=typeof a==`object`&&a?tl(a):Hr(e,Br(e,t,!0)),i.state===n){var o=ke(t)||`Component`;yf.has(o)||(yf.add(o),c(`%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.`,o))}e.mode&ni&&sc.recordLegacyContextWarning(e,i),sc.recordUnsafeLifecycleWarnings(e,i),i.state=e.memoizedState;var s=t.getDerivedStateFromProps;if(typeof s==`function`&&(wf(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps!=`function`&&typeof i.getSnapshotBeforeUpdate!=`function`&&(typeof i.UNSAFE_componentWillMount==`function`||typeof i.componentWillMount==`function`)&&(Af(e,i),Tl(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`){var l=Fe;l|=et,(e.mode&ri)!==B&&(l|=nt),e.flags|=l}}function Nf(e,t,n,r){var i=e.stateNode,a=e.memoizedProps;i.props=a;var o=i.context,s=t.contextType,c=Ir;c=typeof s==`object`&&s?tl(s):Hr(e,Br(e,t,!0));var l=t.getDerivedStateFromProps,u=typeof l==`function`||typeof i.getSnapshotBeforeUpdate==`function`;!u&&(typeof i.UNSAFE_componentWillReceiveProps==`function`||typeof i.componentWillReceiveProps==`function`)&&(a!==n||o!==c)&&jf(e,i,n,c),Dl();var d=e.memoizedState,f=i.state=d;if(Tl(e,n,i,r),f=e.memoizedState,a===n&&d===f&&!Ur()&&!Ol()){if(typeof i.componentDidMount==`function`){var p=Fe;p|=et,(e.mode&ri)!==B&&(p|=nt),e.flags|=p}return!1}typeof l==`function`&&(wf(e,t,l,n),f=e.memoizedState);var m=Ol()||Ef(e,t,a,n,d,f,c);if(m){if(!u&&(typeof i.UNSAFE_componentWillMount==`function`||typeof i.componentWillMount==`function`)&&(typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount==`function`){var h=Fe;h|=et,(e.mode&ri)!==B&&(h|=nt),e.flags|=h}}else{if(typeof i.componentDidMount==`function`){var g=Fe;g|=et,(e.mode&ri)!==B&&(g|=nt),e.flags|=g}e.memoizedProps=n,e.memoizedState=f}return i.props=n,i.state=f,i.context=c,m}function Pf(e,t,n,r,i){var a=t.stateNode;yl(e,t);var o=t.memoizedProps,s=t.type===t.elementType?o:uf(t.type,o);a.props=s;var c=t.pendingProps,l=a.context,u=n.contextType,d=Ir;d=typeof u==`object`&&u?tl(u):Hr(t,Br(t,n,!0));var f=n.getDerivedStateFromProps,p=typeof f==`function`||typeof a.getSnapshotBeforeUpdate==`function`;!p&&(typeof a.UNSAFE_componentWillReceiveProps==`function`||typeof a.componentWillReceiveProps==`function`)&&(o!==c||l!==d)&&jf(t,a,r,d),Dl();var h=t.memoizedState,g=a.state=h;if(Tl(t,r,a,i),g=t.memoizedState,o===c&&h===g&&!Ur()&&!Ol())return typeof a.componentDidUpdate==`function`&&(o!==e.memoizedProps||h!==e.memoizedState)&&(t.flags|=Fe),typeof a.getSnapshotBeforeUpdate==`function`&&(o!==e.memoizedProps||h!==e.memoizedState)&&(t.flags|=He),!1;typeof f==`function`&&(wf(t,n,f,r),g=t.memoizedState);var _=Ol()||Ef(t,n,s,r,h,g,d)||m;return _?(!p&&(typeof a.UNSAFE_componentWillUpdate==`function`||typeof a.componentWillUpdate==`function`)&&(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,g,d),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,g,d)),typeof a.componentDidUpdate==`function`&&(t.flags|=Fe),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=He)):(typeof a.componentDidUpdate==`function`&&(o!==e.memoizedProps||h!==e.memoizedState)&&(t.flags|=Fe),typeof a.getSnapshotBeforeUpdate==`function`&&(o!==e.memoizedProps||h!==e.memoizedState)&&(t.flags|=He),t.memoizedProps=r,t.memoizedState=g),a.props=r,a.state=g,a.context=d,_}function Ff(e,t){return{value:e,source:t,stack:Zs(t),digest:null}}function If(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Lf(e,t){return!0}function Rf(e,t){try{if(Lf(e,t)===!1)return;var n=t.value,r=t.source,i=t.stack,a=i===null?``:i;if(n!=null&&n._suppressLogging){if(e.tag===b)return;console.error(n)}var o=r?Me(r):null,s=o?`The above error occurred in the <`+o+`> component:`:`The above error occurred in one of your React components:`,c=e.tag===S?`Consider adding an error boundary to your tree to customize error handling behavior.
|
|
109
|
+
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`:`React will try to recreate this component tree from scratch `+(`using the error boundary you provided, `+(Me(e)||`Anonymous`)+`.`),l=s+`
|
|
110
|
+
`+a+`
|
|
111
|
+
|
|
112
|
+
`+(``+c);console.error(l)}catch(e){setTimeout(function(){throw e})}}var zf=typeof WeakMap==`function`?WeakMap:Map;function Bf(e,t,n){var r=bl(Ki,n);r.tag=ml,r.payload={element:null};var i=t.value;return r.callback=function(){_v(i),Rf(e,t)},r}function Vf(e,t,n){var r=bl(Ki,n);r.tag=ml;var i=e.type.getDerivedStateFromError;if(typeof i==`function`){var a=t.value;r.payload=function(){return i(a)},r.callback=function(){Zv(e),Rf(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch==`function`&&(r.callback=function(){Zv(e),Rf(e,t),typeof i!=`function`&&hv(this);var n=t.value,r=t.stack;this.componentDidCatch(n,{componentStack:r===null?``:r}),typeof i!=`function`&&(ga(e.lanes,ui)||c(`%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.`,Me(e)||`Unknown`))}),r}function Hf(e,t,n){var r=e.pingCache,i;if(r===null?(r=e.pingCache=new zf,i=new Set,r.set(t,i)):(i=r.get(t),i===void 0&&(i=new Set,r.set(t,i))),!i.has(n)){i.add(n);var a=bv.bind(null,e,t,n);ao&&Iv(e,n),t.then(a,a)}}function Uf(e,t,n,r){var i=e.updateQueue;if(i===null){var a=new Set;a.add(n),e.updateQueue=a}else i.add(n)}function Wf(e,t){var n=e.tag;if((e.mode&ei)===B&&(n===y||n===A||n===N)){var r=e.alternate;r?(e.updateQueue=r.updateQueue,e.memoizedState=r.memoizedState,e.lanes=r.lanes):(e.updateQueue=null,e.memoizedState=null)}}function Gf(e){var t=e;do{if(t.tag===M&&Ql(t))return t;t=t.return}while(t!==null);return null}function Kf(e,t,n,r,i){if((e.mode&ei)===B){if(e===t)e.flags|=Xe;else{if(e.flags|=ze,n.flags|=Ze,n.flags&=~(qe|Ye),n.tag===b){if(n.alternate===null)n.tag=F;else{var a=bl(Ki,ui);a.tag=pl,xl(n,a,ui)}}n.lanes=va(n.lanes,ui)}return e}return e.flags|=Xe,e.lanes=i,e}function qf(e,t,n,r,i){if(n.flags|=Ye,ao&&Iv(e,i),typeof r==`object`&&r&&typeof r.then==`function`){var a=r;Wf(n),Ws()&&n.mode&ei&&Ss();var o=Gf(t);if(o!==null){o.flags&=~Be,Kf(o,t,n,e,i),o.mode&ei&&Hf(e,a,i),Uf(o,e,a);return}if(!na(i)){Hf(e,a,i),ev();return}r=Error(`A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.`)}else if(Ws()&&n.mode&ei){Ss();var s=Gf(t);if(s!==null){(s.flags&Xe)===R&&(s.flags|=Be),Kf(s,t,n,e,i),Gs(Ff(r,n));return}}r=Ff(r,n),tv(r);var c=t;do{switch(c.tag){case S:var l=r;c.flags|=Xe;var u=pa(i);c.lanes=va(c.lanes,u);var d=Bf(c,l,u);Cl(c,d);return;case b:var f=r,p=c.type,m=c.stateNode;if((c.flags&ze)===R&&(typeof p.getDerivedStateFromError==`function`||m!==null&&typeof m.componentDidCatch==`function`&&!mv(m))){c.flags|=Xe;var h=pa(i);c.lanes=va(c.lanes,h);var g=Vf(c,f,h);Cl(c,g);return}}c=c.return}while(c!==null)}function Jf(){return null}var Yf=i.ReactCurrentOwner,Xf=!1,Zf={},Qf={},$f={},ep={},tp={},np=!1,rp={},ip={},ap={};function op(e,t,n,r){t.child=e===null?Lc(t,null,n,r):Ic(t,e.child,n,r)}function sp(e,t,n,r){t.child=Ic(t,e.child,null,r),t.child=Ic(t,null,n,r)}function cp(e,t,n,r,i){if(t.type!==t.elementType){var a=n.propTypes;a&&Or(a,r,`prop`,ke(n))}var o=n.render,s=t.ref,c,l;if(el(t,i),_o(t),Yf.current=t,oc(!0),c=Du(e,t,o,r,s,i),l=Ou(),t.mode&ni){fo(!0);try{c=Du(e,t,o,r,s,i),l=Ou()}finally{fo(!1)}}return oc(!1),vo(),e!==null&&!Xf?(ku(e,t,i),om(e,t,i)):(Ws()&&l&&ls(t),t.flags|=Ne,op(e,t,c,i),t.child)}function lp(e,t,n,r,i){if(e===null){var a=n.type;if(ly(a)&&n.compare===null&&n.defaultProps===void 0){var o=a;return o=qv(a),t.tag=N,t.type=o,Dp(t,a),up(e,t,o,r,i)}var s=a.propTypes;if(s&&Or(s,r,`prop`,ke(a)),n.defaultProps!==void 0){var l=ke(a)||`Unknown`;ap[l]||(c(`%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.`,l),ap[l]=!0)}var u=my(n.type,null,r,t,t.mode,i);return u.ref=t.ref,u.return=t,t.child=u,u}var d=n.type,f=d.propTypes;f&&Or(f,r,`prop`,ke(d));var p=e.child;if(!cm(e,i)){var m=p.memoizedProps,h=n.compare;if(h=h===null?Ys:h,h(m,r)&&e.ref===t.ref)return om(e,t,i)}t.flags|=Ne;var g=dy(p,r);return g.ref=t.ref,g.return=t,t.child=g,g}function up(e,t,n,r,i){if(t.type!==t.elementType){var a=t.elementType;if(a.$$typeof===_e){var o=a,s=o._payload,c=o._init;try{a=c(s)}catch{a=null}var l=a&&a.propTypes;l&&Or(l,r,`prop`,ke(a))}}if(e!==null){var u=e.memoizedProps;if(Ys(u,r)&&e.ref===t.ref&&t.type===e.type){if(Xf=!1,t.pendingProps=r=u,cm(e,i))(e.flags&Ze)!==R&&(Xf=!0);else return t.lanes=e.lanes,om(e,t,i)}}return gp(e,t,n,r,i)}function dp(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`){if((t.mode&ei)===B)t.memoizedState={baseLanes:V,cachePool:null,transitions:null},G_(t,n);else if(ga(n,Wi))t.memoizedState={baseLanes:V,cachePool:null,transitions:null},G_(t,a===null?n:a.baseLanes);else{var o=null,s;if(a!==null){var c=a.baseLanes;s=va(c,n)}else s=n;return t.lanes=t.childLanes=xa(Wi),t.memoizedState={baseLanes:s,cachePool:o,transitions:null},t.updateQueue=null,G_(t,s),null}}else{var l;a===null?l=n:(l=va(a.baseLanes,n),t.memoizedState=null),G_(t,l)}return op(e,t,i,n),t.child}function fp(e,t,n){var r=t.pendingProps;return op(e,t,r,n),t.child}function pp(e,t,n){var r=t.pendingProps.children;return op(e,t,r,n),t.child}function mp(e,t,n){t.flags|=Fe;var r=t.stateNode;r.effectDuration=0,r.passiveEffectDuration=0;var i=t.pendingProps.children;return op(e,t,i,n),t.child}function hp(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=Ve,t.flags|=$e)}function gp(e,t,n,r,i){if(t.type!==t.elementType){var a=n.propTypes;a&&Or(a,r,`prop`,ke(n))}var o=Hr(t,Br(t,n,!0)),s,c;if(el(t,i),_o(t),Yf.current=t,oc(!0),s=Du(e,t,n,r,o,i),c=Ou(),t.mode&ni){fo(!0);try{s=Du(e,t,n,r,o,i),c=Ou()}finally{fo(!1)}}return oc(!1),vo(),e!==null&&!Xf?(ku(e,t,i),om(e,t,i)):(Ws()&&c&&ls(t),t.flags|=Ne,op(e,t,s,i),t.child)}function _p(e,t,n,r,i){switch(qy(t)){case!1:var a=t.stateNode,o=t.type,s=new o(t.memoizedProps,a.context).state;a.updater.enqueueSetState(a,s,null);break;case!0:t.flags|=ze,t.flags|=Xe;var l=Error(`Simulated error coming from DevTools`),u=pa(i);t.lanes=va(t.lanes,u),Cl(t,Vf(t,Ff(l,t),u))}if(t.type!==t.elementType){var d=n.propTypes;d&&Or(d,r,`prop`,ke(n))}var f;Wr(n)?(f=!0,Yr(t)):f=!1,el(t,i);var p=t.stateNode,m;p===null?(am(e,t),kf(t,n,r),Mf(t,n,r,i),m=!0):m=e===null?Nf(t,n,r,i):Pf(e,t,n,r,i);var h=vp(e,t,n,m,f,i),g=t.stateNode;return m&&g.props!==r&&(np||c("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",Me(t)||`a component`),np=!0),h}function vp(e,t,n,r,i,a){hp(e,t);var o=(t.flags&ze)!==R;if(!r&&!o)return i&&Xr(t,n,!1),om(e,t,a);var s=t.stateNode;Yf.current=t;var c;if(o&&typeof n.getDerivedStateFromError!=`function`)c=null,nf();else{if(_o(t),oc(!0),c=s.render(),t.mode&ni){fo(!0);try{s.render()}finally{fo(!1)}}oc(!1),vo()}return t.flags|=Ne,e!==null&&o?sp(e,t,c,a):op(e,t,c,a),t.memoizedState=s.state,i&&Xr(t,n,!0),t.child}function yp(e){var t=e.stateNode;t.pendingContext?qr(e,t.pendingContext,t.pendingContext!==t.context):t.context&&qr(e,t.context,!1),Il(e,t.containerInfo)}function bp(e,t,n){if(yp(t),e===null)throw Error(`Should have a current fiber. This is a bug in React.`);var r=t.pendingProps,i=t.memoizedState,a=i.element;yl(e,t),Tl(t,r,null,n);var o=t.memoizedState;t.stateNode;var s=o.element;if(zt&&i.isDehydrated){var c={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},l=t.updateQueue;if(l.baseState=c,t.memoizedState=c,t.flags&Be)return xp(e,t,s,n,Ff(Error(`There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.`),t));if(s!==a)return xp(e,t,s,n,Ff(Error(`This root received an early update, before anything was able hydrate. Switched the entire root to client rendering.`),t));ws(t);var u=Lc(t,null,s,n);t.child=u;for(var d=u;d;)d.flags=d.flags&~Pe|We,d=d.sibling}else{if(Hs(),s===a)return om(e,t,n);op(e,t,s,n)}return t.child}function xp(e,t,n,r,i){return Hs(),Gs(i),t.flags|=Be,op(e,t,n,r),t.child}function Sp(e,t,n){zl(t),e===null&&Ns(t);var r=t.type,i=t.pendingProps,a=e===null?null:e.memoizedProps,o=i.children;return At(r,i)?o=null:a!==null&&At(r,a)&&(t.flags|=Le),hp(e,t),op(e,t,o,n),t.child}function Cp(e,t){return e===null&&Ns(t),null}function wp(e,t,n,r){am(e,t);var i=t.pendingProps,a=n,o=a._payload,s=a._init,c=s(o);t.type=c;var l=t.tag=uy(c),u=uf(c,i),d;switch(l){case y:return Dp(t,c),t.type=c=qv(c),d=gp(null,t,c,u,r),d;case b:return t.type=c=Jv(c),d=_p(null,t,c,u,r),d;case A:return t.type=c=Yv(c),d=cp(null,t,c,u,r),d;case ee:if(t.type!==t.elementType){var f=c.propTypes;f&&Or(f,u,`prop`,ke(c))}return d=lp(null,t,c,uf(c.type,u),r),d}var p=``;throw typeof c==`object`&&c&&c.$$typeof===_e&&(p=` Did you wrap a component in React.lazy() more than once?`),Error(`Element type is invalid. Received a promise that resolves to: `+c+`. `+(`Lazy element type must resolve to a class or function.`+p))}function Tp(e,t,n,r,i){am(e,t),t.tag=b;var a;return Wr(n)?(a=!0,Yr(t)):a=!1,el(t,i),kf(t,n,r),Mf(t,n,r,i),vp(null,t,n,!0,a,i)}function Ep(e,t,n,r){am(e,t);var i=t.pendingProps,a=Hr(t,Br(t,n,!1));el(t,r);var o,s;if(_o(t),n.prototype&&typeof n.prototype.render==`function`){var l=ke(n)||`Unknown`;Zf[l]||(c(`The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.`,l,l),Zf[l]=!0)}if(t.mode&ni&&sc.recordLegacyContextWarning(t,null),oc(!0),Yf.current=t,o=Du(null,t,n,i,a,r),s=Ou(),oc(!1),vo(),t.flags|=Ne,typeof o==`object`&&o&&typeof o.render==`function`&&o.$$typeof===void 0){var u=ke(n)||`Unknown`;Qf[u]||(c("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",u,u,u),Qf[u]=!0)}if(typeof o==`object`&&o&&typeof o.render==`function`&&o.$$typeof===void 0){var d=ke(n)||`Unknown`;Qf[d]||(c("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",d,d,d),Qf[d]=!0),t.tag=b,t.memoizedState=null,t.updateQueue=null;var f=!1;return Wr(n)?(f=!0,Yr(t)):f=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,vl(t),Of(t,o),Mf(t,n,i,r),vp(null,t,n,!0,f,r)}if(t.tag=y,t.mode&ni){fo(!0);try{o=Du(null,t,n,i,a,r),s=Ou()}finally{fo(!1)}}return Ws()&&s&&ls(t),op(null,t,o,r),Dp(t,n),t.child}function Dp(e,t){if(t&&t.childContextTypes&&c(`%s(...): childContextTypes cannot be defined on a function component.`,t.displayName||t.name||`Component`),e.ref!==null){var n=``,r=tc();r&&(n+=`
|
|
113
|
+
|
|
114
|
+
Check the render method of \``+r+"`.");var i=r||``,a=e._debugSource;a&&(i=a.fileName+`:`+a.lineNumber),tp[i]||(tp[i]=!0,c(`Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s`,n))}if(t.defaultProps!==void 0){var o=ke(t)||`Unknown`;ap[o]||(c(`%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.`,o),ap[o]=!0)}if(typeof t.getDerivedStateFromProps==`function`){var s=ke(t)||`Unknown`;ep[s]||(c(`%s: Function components do not support getDerivedStateFromProps.`,s),ep[s]=!0)}if(typeof t.contextType==`object`&&t.contextType!==null){var l=ke(t)||`Unknown`;$f[l]||(c(`%s: Function components do not support contextType.`,l),$f[l]=!0)}}var Op={dehydrated:null,treeContext:null,retryLane:li};function kp(e){return{baseLanes:e,cachePool:Jf(),transitions:null}}function Ap(e,t){return{baseLanes:va(e.baseLanes,t),cachePool:null,transitions:e.transitions}}function jp(e,t,n,r){return t!==null&&t.memoizedState===null?!1:Kl(e,Wl)}function Mp(e,t){return ya(e.childLanes,t)}function Np(e,t,n){var r=t.pendingProps;Yy(t)&&(t.flags|=ze);var i=Gl.current,a=!1,o=(t.flags&ze)!==R;if(o||jp(i,e)?(a=!0,t.flags&=~ze):(e===null||e.memoizedState!==null)&&(i=Yl(i,Ul)),i=ql(i),Xl(t,i),e===null){Ns(t);var s=t.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Hp(t,c)}var l=r.children,u=r.fallback;if(a){var d=Fp(t,l,u,n),f=t.child;return f.memoizedState=kp(n),t.memoizedState=Op,d}return Pp(t,l)}var p=e.memoizedState;if(p!==null){var m=p.dehydrated;if(m!==null)return Up(e,t,o,r,m,p,n)}if(a){var h=r.fallback,g=r.children,_=zp(e,t,g,h,n),v=t.child,y=e.child.memoizedState;return v.memoizedState=y===null?kp(n):Ap(y,n),v.childLanes=Mp(e,n),t.memoizedState=Op,_}var b=r.children,x=Rp(e,t,b,n);return t.memoizedState=null,x}function Pp(e,t,n){var r=e.mode,i=Ip({mode:`visible`,children:t},r);return i.return=e,e.child=i,i}function Fp(e,t,n,r){var i=e.mode,a=e.child,o={mode:`hidden`,children:t},s,c;return(i&ei)===B&&a!==null?(s=a,s.childLanes=V,s.pendingProps=o,e.mode&ti&&(s.actualDuration=0,s.actualStartTime=-1,s.selfBaseDuration=0,s.treeBaseDuration=0),c=gy(n,i,r,null)):(s=Ip(o,i),c=gy(n,i,r,null)),s.return=e,c.return=e,s.sibling=c,e.child=s,c}function Ip(e,t,n){return by(e,t,V,null)}function Lp(e,t){return dy(e,t)}function Rp(e,t,n,r){var i=e.child,a=i.sibling,o=Lp(i,{mode:`visible`,children:n});if((t.mode&ei)===B&&(o.lanes=r),o.return=t,o.sibling=null,a!==null){var s=t.deletions;s===null?(t.deletions=[a],t.flags|=Ie):s.push(a)}return t.child=o,o}function zp(e,t,n,r,i){var a=t.mode,o=e.child,s=o.sibling,c={mode:`hidden`,children:n},l;(a&ei)===B&&t.child!==o?(l=t.child,l.childLanes=V,l.pendingProps=c,t.mode&ti&&(l.actualDuration=0,l.actualStartTime=-1,l.selfBaseDuration=o.selfBaseDuration,l.treeBaseDuration=o.treeBaseDuration),t.deletions=null):(l=Lp(o,c),l.subtreeFlags=o.subtreeFlags&ct);var u;return s===null?(u=gy(r,a,i,null),u.flags|=Pe):u=dy(s,r),u.return=t,l.return=t,l.sibling=u,t.child=l,u}function Bp(e,t,n,r){r!==null&&Gs(r),Ic(t,e.child,null,n);var i=t.pendingProps.children,a=Pp(t,i);return a.flags|=Pe,t.memoizedState=null,a}function Vp(e,t,n,r,i){var a=t.mode,o=Ip({mode:`visible`,children:n},a),s=gy(r,a,i,null);return s.flags|=Pe,o.return=t,s.return=t,o.sibling=s,t.child=o,(t.mode&ei)!==B&&Ic(t,e.child,null,i),s}function Hp(e,t,n){return(e.mode&ei)===B?(c(`Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components.`),e.lanes=xa(ui)):e.lanes=En(t)?xa(pi):xa(Wi),null}function Up(e,t,n,r,i,a,o){if(!n){if(xs(),(t.mode&ei)===B)return Bp(e,t,o,null);if(En(i)){var s,c,l,u=Dn(i);return s=u.digest,c=u.message,l=u.stack,Bp(e,t,o,If(Error(c||`The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.`),s,l))}var d=ga(o,e.childLanes);if(Xf||d){var f=C_();if(f!==null){var p=Aa(f,o);if(p!==li&&p!==a.retryLane){a.retryLane=p;var m=Ki;cl(e,p),D_(f,e,p,m)}}return ev(),Bp(e,t,o,If(Error(`This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition.`)))}if(Tn(i))return t.flags|=ze,t.child=e.child,On(i,Sv.bind(null,e)),null;Ts(t,i,a.treeContext);var h=r.children,g=Pp(t,h);return g.flags|=We,g}if(t.flags&Be)return t.flags&=~Be,Bp(e,t,o,If(Error(`There was an error while hydrating this Suspense boundary. Switched to client rendering.`)));if(t.memoizedState!==null)return t.child=e.child,t.flags|=ze,null;var _=r.children,v=r.fallback,y=Vp(e,t,_,v,o),b=t.child;return b.memoizedState=kp(o),t.memoizedState=Op,y}function Wp(e,t,n){e.lanes=va(e.lanes,t);var r=e.alternate;r!==null&&(r.lanes=va(r.lanes,t)),Zc(e.return,t,n)}function Gp(e,t,n){for(var r=t;r!==null;){if(r.tag===M)r.memoizedState!==null&&Wp(r,n,e);else if(r.tag===L)Wp(r,n,e);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)return;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}}function Kp(e){for(var t=e,n=null;t!==null;){var r=t.alternate;r!==null&&$l(r)===null&&(n=t),t=t.sibling}return n}function qp(e){if(e!==void 0&&e!==`forwards`&&e!==`backwards`&&e!==`together`&&!rp[e]){if(rp[e]=!0,typeof e==`string`)switch(e.toLowerCase()){case`together`:case`forwards`:case`backwards`:c(`"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.`,e,e.toLowerCase());break;case`forward`:case`backward`:c(`"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.`,e,e.toLowerCase());break;default:c(`"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?`,e)}else c(`%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?`,e)}}function Jp(e,t){e!==void 0&&!ip[e]&&(e!==`collapsed`&&e!==`hidden`?(ip[e]=!0,c(`"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?`,e)):t!==`forwards`&&t!==`backwards`&&(ip[e]=!0,c(`<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?`,e)))}function Yp(e,t){var n=bt(e),r=!n&&typeof Ee(e)==`function`;if(n||r){var i=n?`array`:`iterable`;return c(`A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>`,i,t,i),!1}return!0}function Xp(e,t){if((t===`forwards`||t===`backwards`)&&e!=null&&e!==!1){if(bt(e)){for(var n=0;n<e.length;n++)if(!Yp(e[n],n))return}else{var r=Ee(e);if(typeof r==`function`){var i=r.call(e);if(i)for(var a=i.next(),o=0;!a.done;a=i.next()){if(!Yp(a.value,o))return;o++}}else c(`A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?`,t)}}}function Zp(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function Qp(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail,o=r.children;qp(i),Jp(a,i),Xp(o,i),op(e,t,o,n);var s=Gl.current;if(Kl(s,Wl)?(s=Jl(s,Wl),t.flags|=ze):(e!==null&&(e.flags&ze)!==R&&Gp(t,t.child,n),s=ql(s)),Xl(t,s),(t.mode&ei)===B)t.memoizedState=null;else switch(i){case`forwards`:var c=Kp(t.child),l;c===null?(l=t.child,t.child=null):(l=c.sibling,c.sibling=null),Zp(t,!1,l,c,a);break;case`backwards`:var u=null,d=t.child;for(t.child=null;d!==null;){var f=d.alternate;if(f!==null&&$l(f)===null){t.child=d;break}var p=d.sibling;d.sibling=u,u=d,d=p}Zp(t,!0,u,null,a);break;case`together`:Zp(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function $p(e,t,n){Il(t,t.stateNode.containerInfo);var r=t.pendingProps;return e===null?t.child=Ic(t,null,r,n):op(e,t,r,n),t.child}var em=!1;function tm(e,t,n){var r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value;`value`in i||em||(em=!0,c("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));var s=t.type.propTypes;if(s&&Or(s,i,`prop`,`Context.Provider`),Yc(t,r,o),a!==null){var l=a.value;if(Bo(l,o)){if(a.children===i.children&&!Ur())return om(e,t,n)}else Qc(t,r,n)}var u=i.children;return op(e,t,u,n),t.child}var nm=!1;function rm(e,t,n){var r=t.type;r._context===void 0?r!==r.Consumer&&(nm||(nm=!0,c(`Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?`))):r=r._context;var i=t.pendingProps.children;typeof i!=`function`&&c(`A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.`),el(t,n);var a=tl(r);_o(t);var o;return Yf.current=t,oc(!0),o=i(a),oc(!1),vo(),t.flags|=Ne,op(e,t,o,n),t.child}function im(){Xf=!0}function am(e,t){(t.mode&ei)===B&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=Pe)}function om(e,t,n){return e!==null&&(t.dependencies=e.dependencies),nf(),Q_(t.lanes),ga(n,t.childLanes)?(Rc(e,t),t.child):null}function sm(e,t,n){var r=t.return;if(r===null)throw Error(`Cannot swap the root fiber.`);if(e.alternate=null,t.alternate=null,n.index=t.index,n.sibling=t.sibling,n.return=t.return,n.ref=t.ref,t===r.child)r.child=n;else{var i=r.child;if(i===null)throw Error(`Expected parent to have a child.`);for(;i.sibling!==t;)if(i=i.sibling,i===null)throw Error(`Expected to find the previous sibling.`);i.sibling=n}var a=r.deletions;return a===null?(r.deletions=[e],r.flags|=Ie):a.push(e),n.flags|=Pe,n}function cm(e,t){var n=e.lanes;return!!ga(n,t)}function lm(e,t,n){switch(t.tag){case S:yp(t),t.stateNode,Hs();break;case w:zl(t);break;case b:var r=t.type;Wr(r)&&Yr(t);break;case C:Il(t,t.stateNode.containerInfo);break;case k:var i=t.memoizedProps.value,a=t.type._context;Yc(t,a,i);break;case j:ga(n,t.childLanes)&&(t.flags|=Fe);var o=t.stateNode;o.effectDuration=0,o.passiveEffectDuration=0;break;case M:var s=t.memoizedState;if(s!==null){if(s.dehydrated!==null)return Xl(t,ql(Gl.current)),t.flags|=ze,null;var c=t.child.childLanes;if(ga(n,c))return Np(e,t,n);Xl(t,ql(Gl.current));var l=om(e,t,n);return l===null?null:l.sibling}Xl(t,ql(Gl.current));break;case L:var u=(e.flags&ze)!==R,d=ga(n,t.childLanes);if(u){if(d)return Qp(e,t,n);t.flags|=ze}var f=t.memoizedState;if(f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Xl(t,Gl.current),d)break;return null;case ne:case re:return t.lanes=V,dp(e,t,n)}return om(e,t,n)}function um(e,t,n){if(t._debugNeedsRemount&&e!==null)return sm(e,t,my(t.type,t.key,t.pendingProps,t._debugOwner||null,t.mode,t.lanes));if(e!==null){if(e.memoizedProps!==t.pendingProps||Ur()||t.type!==e.type)Xf=!0;else{if(!cm(e,n)&&(t.flags&ze)===R)return Xf=!1,lm(e,t,n);Xf=(e.flags&Ze)!==R}}else if(Xf=!1,Ws()&&is(t)){var r=t.index;cs(t,as(),r)}switch(t.lanes=V,t.tag){case x:return Ep(e,t,t.type,n);case P:var i=t.elementType;return wp(e,t,i,n);case y:var a=t.type,o=t.pendingProps;return gp(e,t,a,t.elementType===a?o:uf(a,o),n);case b:var s=t.type,c=t.pendingProps;return _p(e,t,s,t.elementType===s?c:uf(s,c),n);case S:return bp(e,t,n);case w:return Sp(e,t,n);case T:return Cp(e,t);case M:return Np(e,t,n);case C:return $p(e,t,n);case A:var l=t.type,u=t.pendingProps;return cp(e,t,l,t.elementType===l?u:uf(l,u),n);case E:return fp(e,t,n);case D:return pp(e,t,n);case j:return mp(e,t,n);case k:return tm(e,t,n);case O:return rm(e,t,n);case ee:var d=t.type,f=t.pendingProps,p=uf(d,f);if(t.type!==t.elementType){var m=d.propTypes;m&&Or(m,p,`prop`,ke(d))}return p=uf(d.type,p),lp(e,t,d,p,n);case N:return up(e,t,t.type,t.pendingProps,n);case F:var h=t.type,g=t.pendingProps;return Tp(e,t,h,t.elementType===h?g:uf(h,g),n);case L:return Qp(e,t,n);case te:break;case ne:return dp(e,t,n)}throw Error(`Unknown unit of work tag (`+t.tag+`). This error is likely caused by a bug in React. Please file an issue.`)}function dm(e){e.flags|=Fe}function fm(e){e.flags|=Ve,e.flags|=$e}function pm(e,t){if(e!==null&&e.child===t.child)return!0;if((t.flags&Ie)!==R)return!1;for(var n=t.child;n!==null;){if((n.flags&at)!==R||(n.subtreeFlags&at)!==R)return!1;n=n.sibling}return!0}var mm,hm,gm,_m;if(Lt)mm=function(e,t,n,r){for(var i=t.child;i!==null;){if(i.tag===w||i.tag===T)Dt(e,i.stateNode);else if(i.tag!==C&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)return;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},hm=function(e,t){},gm=function(e,t,n,r,i){var a=e.memoizedProps;if(a!==r){var o=t.stateNode,s=kt(o,n,a,r,i,Rl());t.updateQueue=s,s&&dm(t)}},_m=function(e,t,n,r){n!==r&&dm(t)};else if(Rt){mm=function(e,t,n,r){for(var i=t.child;i!==null;){if(i.tag===w){var a=i.stateNode;if(n&&r){var o=i.memoizedProps,s=i.type;a=bn(a,s,o,i)}Dt(e,a)}else if(i.tag===T){var c=i.stateNode;if(n&&r){var l=i.memoizedProps;c=xn(c,l,i)}Dt(e,c)}else if(i.tag!==C){if(i.tag===ne&&i.memoizedState!==null){var u=i.child;u!==null&&(u.return=i),mm(e,i,!0,!0)}else if(i.child!==null){i.child.return=i,i=i.child;continue}}if(i=i,i===t)return;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};var vm=function(e,t,n,r){for(var i=t.child;i!==null;){if(i.tag===w){var a=i.stateNode;if(n&&r){var o=i.memoizedProps,s=i.type;a=bn(a,s,o,i)}_n(e,a)}else if(i.tag===T){var c=i.stateNode;if(n&&r){var l=i.memoizedProps;c=xn(c,l,i)}_n(e,c)}else if(i.tag!==C){if(i.tag===ne&&i.memoizedState!==null){var u=i.child;u!==null&&(u.return=i),vm(e,i,!0,!0)}else if(i.child!==null){i.child.return=i,i=i.child;continue}}if(i=i,i===t)return;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};hm=function(e,t){var n=t.stateNode;if(!pm(e,t)){var r=n.containerInfo,i=gn(r);vm(i,t,!1,!1),n.pendingChildren=i,dm(t),vn(r,i)}},gm=function(e,t,n,r,i){var a=e.stateNode,o=e.memoizedProps,s=pm(e,t);if(s&&o===r){t.stateNode=a;return}var c=t.stateNode,l=Rl(),u=null;if(o!==r&&(u=kt(c,n,o,r,i,l)),s&&u===null){t.stateNode=a;return}var d=hn(a,u,n,o,r,t,s,c);Ot(d,n,r,i,l)&&dm(t),t.stateNode=d,s?dm(t):mm(d,t,!1,!1)},_m=function(e,t,n,r){n===r?t.stateNode=e.stateNode:(t.stateNode=jt(r,Fl(),Rl(),t),dm(t))}}else hm=function(e,t){},gm=function(e,t,n,r,i){},_m=function(e,t,n,r){};function ym(e,t){if(!Ws())switch(e.tailMode){case`hidden`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e.tail=null:r.sibling=null;break;case`collapsed`:for(var i=e.tail,a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?!t&&e.tail!==null?e.tail.sibling=null:e.tail=null:a.sibling=null}}function bm(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=V,r=R;if(t){if((e.mode&ti)!==B){for(var i=e.selfBaseDuration,a=e.child;a!==null;)n=va(n,va(a.lanes,a.childLanes)),r|=a.subtreeFlags&ct,r|=a.flags&ct,i+=a.treeBaseDuration,a=a.sibling;e.treeBaseDuration=i}else for(var o=e.child;o!==null;)n=va(n,va(o.lanes,o.childLanes)),r|=o.subtreeFlags&ct,r|=o.flags&ct,o.return=e,o=o.sibling;e.subtreeFlags|=r}else{if((e.mode&ti)!==B){for(var s=e.actualDuration,c=e.selfBaseDuration,l=e.child;l!==null;)n=va(n,va(l.lanes,l.childLanes)),r|=l.subtreeFlags,r|=l.flags,s+=l.actualDuration,c+=l.treeBaseDuration,l=l.sibling;e.actualDuration=s,e.treeBaseDuration=c}else for(var u=e.child;u!==null;)n=va(n,va(u.lanes,u.childLanes)),r|=u.subtreeFlags,r|=u.flags,u.return=e,u=u.sibling;e.subtreeFlags|=r}return e.childLanes=n,t}function xm(e,t,n){if(Bs()&&(t.mode&ei)!==B&&(t.flags&ze)===R)return Vs(t),Hs(),t.flags|=Be|Ye|Xe,!1;var r=zs(t);if(n!==null&&n.dehydrated!==null){if(e===null){if(!r)throw Error(`A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.`);if(Is(t),bm(t),(t.mode&ti)!==B&&n!==null){var i=t.child;i!==null&&(t.treeBaseDuration-=i.treeBaseDuration)}return!1}if(Hs(),(t.flags&ze)===R&&(t.memoizedState=null),t.flags|=Fe,bm(t),(t.mode&ti)!==B&&n!==null){var a=t.child;a!==null&&(t.treeBaseDuration-=a.treeBaseDuration)}return!1}return Us(),!0}function Sm(e,t,n){var r=t.pendingProps;switch(fs(t),t.tag){case x:case P:case N:case y:case A:case E:case D:case j:case O:case ee:return bm(t),null;case b:var i=t.type;return Wr(i)&&Gr(t),bm(t),null;case S:var a=t.stateNode;return Ll(t),Kr(t),ou(),a.pendingContext&&=(a.context=a.pendingContext,null),(e===null||e.child===null)&&(zs(t)?dm(t):e!==null&&(!e.memoizedState.isDehydrated||(t.flags&Be)!==R)&&(t.flags|=He,Us())),hm(e,t),bm(t),null;case w:Bl(t);var o=Fl(),s=t.type;if(e!==null&&t.stateNode!=null)gm(e,t,s,r,o),e.ref!==t.ref&&fm(t);else{if(!r){if(t.stateNode===null)throw Error(`We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.`);return bm(t),null}var c=Rl();if(zs(t))Ps(t,o,c)&&dm(t);else{var l=Et(s,r,o,c,t);mm(l,t,!1,!1),t.stateNode=l,Ot(l,s,r,o,c)&&dm(t)}t.ref!==null&&fm(t)}return bm(t),null;case T:var u=r;if(e&&t.stateNode!=null){var d=e.memoizedProps;_m(e,t,d,u)}else{if(typeof u!=`string`&&t.stateNode===null)throw Error(`We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.`);var f=Fl(),p=Rl();zs(t)?Fs(t)&&dm(t):t.stateNode=jt(u,f,p,t)}return bm(t),null;case M:Zl(t);var m=t.memoizedState;if((e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null)&&!xm(e,t,m))return t.flags&Xe?t:null;if((t.flags&ze)!==R)return t.lanes=n,(t.mode&ti)!==B&&lf(t),t;var h=m!==null;if(h!==(e!==null&&e.memoizedState!==null)&&h){var g=t.child;g.flags|=Ge,(t.mode&ei)!==B&&(e===null&&(t.memoizedProps.unstable_avoidThisFallback!==!0||!0)||Kl(Gl.current,Ul)?$_():ev())}if(t.updateQueue!==null&&(t.flags|=Fe),bm(t),(t.mode&ti)!==B&&h){var _=t.child;_!==null&&(t.treeBaseDuration-=_.treeBaseDuration)}return null;case C:return Ll(t),hm(e,t),e===null&&Vt(t.stateNode.containerInfo),bm(t),null;case k:var v=t.type._context;return Xc(v,t),bm(t),null;case F:var I=t.type;return Wr(I)&&Gr(t),bm(t),null;case L:Zl(t);var oe=t.memoizedState;if(oe===null)return bm(t),null;var se=(t.flags&ze)!==R,ce=oe.rendering;if(ce===null){if(se)ym(oe,!1);else{if(!(nv()&&(e===null||(e.flags&ze)===R)))for(var le=t.child;le!==null;){var ue=$l(le);if(ue!==null){se=!0,t.flags|=ze,ym(oe,!1);var de=ue.updateQueue;return de!==null&&(t.updateQueue=de,t.flags|=Fe),t.subtreeFlags=R,zc(t,n),Xl(t,Jl(Gl.current,Wl)),t.child}le=le.sibling}oe.tail!==null&&Ya()>r_()&&(t.flags|=ze,se=!0,ym(oe,!1),t.lanes=zi)}}else{if(!se){var fe=$l(ce);if(fe!==null){t.flags|=ze,se=!0;var pe=fe.updateQueue;if(pe!==null&&(t.updateQueue=pe,t.flags|=Fe),ym(oe,!0),oe.tail===null&&oe.tailMode===`hidden`&&!ce.alternate&&!Ws())return bm(t),null}else Ya()*2-oe.renderingStartTime>r_()&&n!==Wi&&(t.flags|=ze,se=!0,ym(oe,!1),t.lanes=zi)}if(oe.isBackwards)ce.sibling=t.child,t.child=ce;else{var me=oe.last;me===null?t.child=ce:me.sibling=ce,oe.last=ce}}if(oe.tail!==null){var he=oe.tail;oe.rendering=he,oe.tail=he.sibling,oe.renderingStartTime=Ya(),he.sibling=null;var ge=Gl.current;return ge=se?Jl(ge,Wl):ql(ge),Xl(t,ge),he}return bm(t),null;case te:break;case ne:case re:K_(t);var _e=t.memoizedState!==null;return e!==null&&e.memoizedState!==null!==_e&&(t.flags|=Ge),!_e||(t.mode&ei)===B?bm(t):ga(Vg,Wi)&&(bm(t),Lt&&t.subtreeFlags&(Pe|Fe)&&(t.flags|=Ge)),null;case ie:return null;case ae:return null}throw Error(`Unknown unit of work tag (`+t.tag+`). This error is likely caused by a bug in React. Please file an issue.`)}function Cm(e,t,n){switch(fs(t),t.tag){case b:var r=t.type;Wr(r)&&Gr(t);var i=t.flags;return i&Xe?(t.flags=i&~Xe|ze,(t.mode&ti)!==B&&lf(t),t):null;case S:t.stateNode,Ll(t),Kr(t),ou();var a=t.flags;return(a&Xe)!==R&&(a&ze)===R?(t.flags=a&~Xe|ze,t):null;case w:return Bl(t),null;case M:Zl(t);var o=t.memoizedState;if(o!==null&&o.dehydrated!==null){if(t.alternate===null)throw Error(`Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.`);Hs()}var s=t.flags;return s&Xe?(t.flags=s&~Xe|ze,(t.mode&ti)!==B&&lf(t),t):null;case L:return Zl(t),null;case C:return Ll(t),null;case k:var c=t.type._context;return Xc(c,t),null;case ne:case re:return K_(t),null;case ie:return null;default:return null}}function wm(e,t,n){switch(fs(t),t.tag){case b:t.type.childContextTypes!=null&&Gr(t);break;case S:t.stateNode,Ll(t),Kr(t),ou();break;case w:Bl(t);break;case C:Ll(t);break;case M:Zl(t);break;case L:Zl(t);break;case k:var r=t.type._context;Xc(r,t);break;case ne:case re:K_(t)}}function Tm(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var Em=Tm;if(typeof window<`u`&&typeof window.dispatchEvent==`function`&&typeof document<`u`&&typeof document.createEvent==`function`){var Dm=document.createElement(`react`);Em=function(e,t,n,r,i,a,o,s,c){if(typeof document>`u`||document===null)throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");var l=document.createEvent(`Event`),u=!1,d=!0,f=window.event,p=Object.getOwnPropertyDescriptor(window,`event`);function m(){Dm.removeEventListener(x,g,!1),window.event!==void 0&&window.hasOwnProperty(`event`)&&(window.event=f)}var h=Array.prototype.slice.call(arguments,3);function g(){u=!0,m(),t.apply(n,h),d=!1}var _,v=!1,y=!1;function b(e){if(_=e.error,v=!0,_===null&&e.colno===0&&e.lineno===0&&(y=!0),e.defaultPrevented&&typeof _==`object`&&_)try{_._suppressLogging=!0}catch{}}var x=`react-`+(e||`invokeguardedcallback`);if(window.addEventListener(`error`,b),Dm.addEventListener(x,g,!1),l.initEvent(x,!1,!1),Dm.dispatchEvent(l),p&&Object.defineProperty(window,"event",p),u&&d&&(v?y&&(_=Error(`A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.`)):_=Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`),this.onError(_)),window.removeEventListener(`error`,b),!u)return m(),Tm.apply(this,arguments)}}var Om=Em,km=!1,Am=null,jm={onError:function(e){km=!0,Am=e}};function Mm(e,t,n,r,i,a,o,s,c){km=!1,Am=null,Om.apply(jm,arguments)}function Nm(){return km}function Pm(){if(km){var e=Am;return km=!1,Am=null,e}throw Error(`clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.`)}var Fm=null;Fm=new Set;var Im=!1,Lm=!1,Rm=typeof WeakSet==`function`?WeakSet:Set,J=null,zm=null,Bm=null;function Vm(e){Mm(null,function(){throw e}),Pm()}var Hm=function(e,t){if(t.props=e.memoizedProps,t.state=e.memoizedState,e.mode&ti)try{sf(),t.componentWillUnmount()}finally{af(e)}else t.componentWillUnmount()};function Um(e,t){try{th(ru,e)}catch(n){yv(e,t,n)}}function Wm(e,t,n){try{Hm(e,n)}catch(n){yv(e,t,n)}}function Gm(e,t,n){try{n.componentDidMount()}catch(n){yv(e,t,n)}}function Km(e,t){try{oh(e)}catch(n){yv(e,t,n)}}function qm(e,t){var n=e.ref;if(n!==null){if(typeof n==`function`){var r;try{if(_&&v&&e.mode&ti)try{sf(),r=n(null)}finally{af(e)}else r=n(null)}catch(n){yv(e,t,n)}typeof r==`function`&&c(`Unexpected return value from a callback ref in %s. A callback ref should not return a function.`,Me(e))}else n.current=null}}function Jm(e,t,n){try{n()}catch(n){yv(e,t,n)}}var Ym=!1;function Xm(e,t){wt(e.containerInfo),J=t,Zm();var n=Ym;return Ym=!1,n}function Zm(){for(;J!==null;){var e=J,t=e.child;(e.subtreeFlags&it)!==R&&t!==null?(t.return=e,J=t):Qm()}}function Qm(){for(;J!==null;){var e=J;ic(e);try{$m(e)}catch(t){yv(e,e.return,t)}rc();var t=e.sibling;if(t!==null){t.return=e.return,J=t;return}J=e.return}}function $m(e){var t=e.alternate;if((e.flags&He)!==R){switch(ic(e),e.tag){case y:case A:case N:break;case b:if(t!==null){var n=t.memoizedProps,r=t.memoizedState,i=e.stateNode;e.type===e.elementType&&!np&&(i.props!==e.memoizedProps&&c("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",Me(e)||`instance`),i.state!==e.memoizedState&&c("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",Me(e)||`instance`));var a=i.getSnapshotBeforeUpdate(e.elementType===e.type?n:uf(e.type,n),r),o=Fm;a===void 0&&!o.has(e.type)&&(o.add(e.type),c(`%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.`,Me(e))),i.__reactInternalSnapshotBeforeUpdate=a}break;case S:if(Lt){var s=e.stateNode;mn(s.containerInfo)}break;case w:case T:case C:case F:break;default:throw Error(`This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.`)}rc()}}function eh(e,t,n){var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next,o=a;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&((e&iu)===eu?(e&ru)!==eu&&To(t):xo(t),(e&nu)!==eu&&Uv(!0),Jm(t,n,s),(e&nu)!==eu&&Uv(!1),(e&iu)===eu?(e&ru)!==eu&&Eo():So())}o=o.next}while(o!==a)}}function th(e,t){var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next,a=i;do{if((a.tag&e)===e){(e&iu)===eu?(e&ru)!==eu&&Co(t):yo(t);var o=a.create;(e&nu)!==eu&&Uv(!0),a.destroy=o(),(e&nu)!==eu&&Uv(!1),(e&iu)===eu?(e&ru)!==eu&&wo():bo();var s=a.destroy;if(s!==void 0&&typeof s!=`function`){var l=void 0;l=(a.tag&ru)===R?(a.tag&nu)===R?`useEffect`:`useInsertionEffect`:`useLayoutEffect`;var u=void 0;u=s===null?` You returned null. If your effect does not require clean up, return undefined (or nothing).`:typeof s.then==`function`?`
|
|
115
|
+
|
|
116
|
+
It looks like you wrote `+l+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
|
|
117
|
+
|
|
118
|
+
`+l+`(() => {
|
|
119
|
+
async function fetchData() {
|
|
120
|
+
// You can await here
|
|
121
|
+
const response = await MyAPI.getData(someId);
|
|
122
|
+
// ...
|
|
123
|
+
}
|
|
124
|
+
fetchData();
|
|
125
|
+
}, [someId]); // Or [] if effect doesn't need props or state
|
|
126
|
+
|
|
127
|
+
Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`:` You returned: `+s,c(`%s must not return anything besides a function, which is used for clean-up.%s`,l,u)}}a=a.next}while(a!==i)}}function nh(e,t){if((t.flags&Fe)!==R)switch(t.tag){case j:var n=t.stateNode.passiveEffectDuration,r=t.memoizedProps,i=r.id,a=r.onPostCommit,o=$d(),s=t.alternate===null?`mount`:`update`;Yd()&&(s=`nested-update`),typeof a==`function`&&a(i,s,n,o);var c=t.return;outer:for(;c!==null;){switch(c.tag){case S:var l=c.stateNode;l.passiveEffectDuration+=n;break outer;case j:var u=c.stateNode;u.passiveEffectDuration+=n;break outer}c=c.return}}}function rh(e,t,n,r){if((n.flags&ot)!==R)switch(n.tag){case y:case A:case N:if(!Lm){if(n.mode&ti)try{sf(),th(ru|tu,n)}finally{af(n)}else th(ru|tu,n)}break;case b:var i=n.stateNode;if(n.flags&Fe&&!Lm){if(t===null){if(n.type===n.elementType&&!np&&(i.props!==n.memoizedProps&&c("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",Me(n)||`instance`),i.state!==n.memoizedState&&c("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",Me(n)||`instance`)),n.mode&ti)try{sf(),i.componentDidMount()}finally{af(n)}else i.componentDidMount()}else{var a=n.elementType===n.type?t.memoizedProps:uf(n.type,t.memoizedProps),o=t.memoizedState;if(n.type===n.elementType&&!np&&(i.props!==n.memoizedProps&&c("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",Me(n)||`instance`),i.state!==n.memoizedState&&c("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",Me(n)||`instance`)),n.mode&ti)try{sf(),i.componentDidUpdate(a,o,i.__reactInternalSnapshotBeforeUpdate)}finally{af(n)}else i.componentDidUpdate(a,o,i.__reactInternalSnapshotBeforeUpdate)}}var s=n.updateQueue;s!==null&&(n.type===n.elementType&&!np&&(i.props!==n.memoizedProps&&c("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",Me(n)||`instance`),i.state!==n.memoizedState&&c("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",Me(n)||`instance`)),kl(n,s,i));break;case S:var l=n.updateQueue;if(l!==null){var u=null;if(n.child!==null)switch(n.child.tag){case w:u=xt(n.child.stateNode);break;case b:u=n.child.stateNode}kl(n,l,u)}break;case w:var d=n.stateNode;if(t===null&&n.flags&Fe){var f=n.type,p=n.memoizedProps;nn(d,f,p,n)}break;case T:break;case C:break;case j:var m=n.memoizedProps,h=m.onCommit,g=m.onRender,_=n.stateNode.effectDuration,v=$d(),x=t===null?`mount`:`update`;Yd()&&(x=`nested-update`),typeof g==`function`&&g(n.memoizedProps.id,x,n.actualDuration,n.treeBaseDuration,n.actualStartTime,v),typeof h==`function`&&h(n.memoizedProps.id,x,_,v),fv(n);var E=n.return;outer:for(;E!==null;){switch(E.tag){case S:var D=E.stateNode;D.effectDuration+=_;break outer;case j:var O=E.stateNode;O.effectDuration+=_;break outer}E=E.return}break;case M:xh(e,n);break;case L:case F:case te:case ne:case re:case ae:break;default:throw Error(`This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.`)}Lm||n.flags&Ve&&oh(n)}function ih(e){switch(e.tag){case y:case A:case N:if(e.mode&ti)try{sf(),Um(e,e.return)}finally{af(e)}else Um(e,e.return);break;case b:var t=e.stateNode;typeof t.componentDidMount==`function`&&Gm(e,e.return,t),Km(e,e.return);break;case w:Km(e,e.return)}}function ah(e,t){var n=null;if(Lt)for(var r=e;;){if(r.tag===w){if(n===null){n=r;try{var i=r.stateNode;t?un(i):fn(r.stateNode,r.memoizedProps)}catch(t){yv(e,e.return,t)}}}else if(r.tag===T){if(n===null)try{var a=r.stateNode;t?dn(a):pn(a,r.memoizedProps)}catch(t){yv(e,e.return,t)}}else if((r.tag!==ne&&r.tag!==re||r.memoizedState===null||r===e)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)return;for(;r.sibling===null;){if(r.return===null||r.return===e)return;n===r&&(n=null),r=r.return}n===r&&(n=null),r.sibling.return=r.return,r=r.sibling}}function oh(e){var t=e.ref;if(t!==null){var n=e.stateNode,r;switch(e.tag){case w:r=xt(n);break;default:r=n}if(typeof t==`function`){var i;if(e.mode&ti)try{sf(),i=t(r)}finally{af(e)}else i=t(r);typeof i==`function`&&c(`Unexpected return value from a callback ref in %s. A callback ref should not return a function.`,Me(e))}else t.hasOwnProperty(`current`)||c(`Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().`,Me(e)),t.current=r}}function Y(e){var t=e.alternate;t!==null&&(t.return=null),e.return=null}function sh(e){var t=e.alternate;if(t!==null&&(e.alternate=null,sh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===w){var n=e.stateNode;n!==null&&Ut(n)}e.stateNode=null,e._debugOwner=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ch(e){if(Rt){var t=e.stateNode.containerInfo;yn(t,gn(t))}}function lh(e){for(var t=e.return;t!==null;){if(uh(t))return t;t=t.return}throw Error(`Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.`)}function uh(e){return e.tag===w||e.tag===S||e.tag===C}function dh(e){var t=e;siblings:for(;;){for(;t.sibling===null;){if(t.return===null||uh(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==w&&t.tag!==T&&t.tag!==I;){if(t.flags&Pe||t.child===null||t.tag===C)continue siblings;t.child.return=t,t=t.child}if(!(t.flags&Pe))return t.stateNode}}function fh(e){if(Lt){var t=lh(e);switch(t.tag){case w:var n=t.stateNode;t.flags&Le&&(ln(n),t.flags&=~Le),mh(e,dh(e),n);break;case S:case C:var r=t.stateNode.containerInfo;ph(e,dh(e),r);break;default:throw Error(`Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.`)}}}function ph(e,t,n){var r=e.tag;if(r===w||r===T){var i=e.stateNode;t?on(n,i,t):en(n,i)}else if(r!==C){var a=e.child;if(a!==null){ph(a,t,n);for(var o=a.sibling;o!==null;)ph(o,t,n),o=o.sibling}}}function mh(e,t,n){var r=e.tag;if(r===w||r===T){var i=e.stateNode;t?an(n,i,t):$t(n,i)}else if(r!==C){var a=e.child;if(a!==null){mh(a,t,n);for(var o=a.sibling;o!==null;)mh(o,t,n),o=o.sibling}}}var hh=null,gh=!1;function _h(e,t,n){if(Lt){var r=t;findParent:for(;r!==null;){switch(r.tag){case w:hh=r.stateNode,gh=!1;break findParent;case S:hh=r.stateNode.containerInfo,gh=!0;break findParent;case C:hh=r.stateNode.containerInfo,gh=!0;break findParent}r=r.return}if(hh===null)throw Error(`Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.`);yh(e,t,n),hh=null,gh=!1}else yh(e,t,n);Y(n)}function vh(e,t,n){for(var r=n.child;r!==null;)yh(e,t,r),r=r.sibling}function yh(e,t,n){switch(uo(n),n.tag){case w:Lm||qm(n,t);case T:if(Lt){var r=hh,i=gh;hh=null,vh(e,t,n),hh=r,gh=i,hh!==null&&(gh?cn(hh,n.stateNode):sn(hh,n.stateNode))}else vh(e,t,n);return;case I:Lt&&hh!==null&&(gh?Bn(hh,n.stateNode):zn(hh,n.stateNode));return;case C:if(Lt){var a=hh,o=gh;hh=n.stateNode.containerInfo,gh=!0,vh(e,t,n),hh=a,gh=o}else ch(n),vh(e,t,n);return;case y:case A:case ee:case N:if(!Lm){var s=n.updateQueue;if(s!==null){var c=s.lastEffect;if(c!==null){var l=c.next,u=l;do{var d=u,f=d.destroy,p=d.tag;f!==void 0&&((p&nu)===eu?(p&ru)!==eu&&(To(n),n.mode&ti?(sf(),Jm(n,t,f),af(n)):Jm(n,t,f),Eo()):Jm(n,t,f)),u=u.next}while(u!==l)}}}vh(e,t,n);return;case b:if(!Lm){qm(n,t);var m=n.stateNode;typeof m.componentWillUnmount==`function`&&Wm(n,t,m)}vh(e,t,n);return;case te:vh(e,t,n);return;case ne:if(n.mode&ei){var h=Lm;Lm=h||n.memoizedState!==null,vh(e,t,n),Lm=h}else vh(e,t,n);break;default:vh(e,t,n);return}}function bh(e){e.memoizedState}function xh(e,t){if(zt&&t.memoizedState===null){var n=t.alternate;if(n!==null){var r=n.memoizedState;if(r!==null){var i=r.dehydrated;i!==null&&Rn(i)}}}}function Sh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Rm),t.forEach(function(t){var r=Cv.bind(null,e,t);if(!n.has(t)){if(n.add(t),ao){if(zm!==null&&Bm!==null)Iv(Bm,zm);else throw Error(`Expected finished root and lanes to be set. This is a bug in React.`)}t.then(r,r)}})}}function Ch(e,t,n){zm=n,Bm=e,ic(t),Th(t,e),ic(t),zm=null,Bm=null}function wh(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i];try{_h(e,t,a)}catch(e){yv(a,t,e)}}var o=ac();if(t.subtreeFlags&at)for(var s=t.child;s!==null;)ic(s),Th(s,e),s=s.sibling;ic(o)}function Th(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case y:case A:case ee:case N:if(wh(t,e),Eh(e),i&Fe){try{eh(nu|tu,e,e.return),th(nu|tu,e)}catch(t){yv(e,e.return,t)}if(e.mode&ti){try{sf(),eh(ru|tu,e,e.return)}catch(t){yv(e,e.return,t)}af(e)}else try{eh(ru|tu,e,e.return)}catch(t){yv(e,e.return,t)}}return;case b:wh(t,e),Eh(e),i&Ve&&r!==null&&qm(r,r.return);return;case w:if(wh(t,e),Eh(e),i&Ve&&r!==null&&qm(r,r.return),Lt){if(e.flags&Le){var a=e.stateNode;try{ln(a)}catch(t){yv(e,e.return,t)}}if(i&Fe){var o=e.stateNode;if(o!=null){var s=e.memoizedProps,c=r===null?s:r.memoizedProps,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{rn(o,u,l,c,s,e)}catch(t){yv(e,e.return,t)}}}}return;case T:if(wh(t,e),Eh(e),i&Fe&&Lt){if(e.stateNode===null)throw Error(`This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.`);var d=e.stateNode,f=e.memoizedProps,p=r===null?f:r.memoizedProps;try{tn(d,p,f)}catch(t){yv(e,e.return,t)}}return;case S:if(wh(t,e),Eh(e),i&Fe){if(Lt&&zt&&r!==null&&r.memoizedState.isDehydrated)try{Ln(t.containerInfo)}catch(t){yv(e,e.return,t)}if(Rt){var m=t.containerInfo,h=t.pendingChildren;try{yn(m,h)}catch(t){yv(e,e.return,t)}}}return;case C:if(wh(t,e),Eh(e),i&Fe&&Rt){var g=e.stateNode,_=g.containerInfo,v=g.pendingChildren;try{yn(_,v)}catch(t){yv(e,e.return,t)}}return;case M:wh(t,e),Eh(e);var x=e.child;if(x.flags&Ge){var E=x.stateNode,D=x.memoizedState!==null;E.isHidden=D,D&&(x.alternate===null||x.alternate.memoizedState===null)&&Z_()}if(i&Fe){try{bh(e)}catch(t){yv(e,e.return,t)}Sh(e)}return;case ne:var O=r!==null&&r.memoizedState!==null;if(e.mode&ei){var k=Lm;Lm=k||O,wh(t,e),Lm=k}else wh(t,e);if(Eh(e),i&Ge){var j=e.stateNode,P=e.memoizedState!==null,F=e;if(j.isHidden=P,P&&!O&&(F.mode&ei)!==B){J=F;for(var I=F.child;I!==null;)J=I,Ah(I),I=I.sibling}Lt&&ah(F,P)}return;case L:wh(t,e),Eh(e),i&Fe&&Sh(e);return;case te:return;default:wh(t,e),Eh(e);return}}function Eh(e){var t=e.flags;if(t&Pe){try{fh(e)}catch(t){yv(e,e.return,t)}e.flags&=~Pe}t&We&&(e.flags&=~We)}function Dh(e,t,n){zm=n,Bm=t,J=e,Oh(e,t,n),zm=null,Bm=null}function Oh(e,t,n){for(var r=(e.mode&ei)!==B;J!==null;){var i=J,a=i.child;if(i.tag===ne&&r){var o=i.memoizedState!==null||Im;if(o){kh(e,t,n);continue}var s=i.alternate,c=s!==null&&s.memoizedState!==null||Lm,l=Im,u=Lm;Im=o,Lm=c,Lm&&!u&&(J=i,Mh(i));for(var d=a;d!==null;)J=d,Oh(d,t,n),d=d.sibling;J=i,Im=l,Lm=u,kh(e,t,n);continue}(i.subtreeFlags&ot)!==R&&a!==null?(a.return=i,J=a):kh(e,t,n)}}function kh(e,t,n){for(;J!==null;){var r=J;if((r.flags&ot)!==R){var i=r.alternate;ic(r);try{rh(t,i,r,n)}catch(e){yv(r,r.return,e)}rc()}if(r===e){J=null;return}var a=r.sibling;if(a!==null){a.return=r.return,J=a;return}J=r.return}}function Ah(e){for(;J!==null;){var t=J,n=t.child;switch(t.tag){case y:case A:case ee:case N:if(t.mode&ti)try{sf(),eh(ru,t,t.return)}finally{af(t)}else eh(ru,t,t.return);break;case b:qm(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount==`function`&&Wm(t,t.return,r);break;case w:qm(t,t.return);break;case ne:if(t.memoizedState!==null){jh(e);continue}}n===null?jh(e):(n.return=t,J=n)}}function jh(e){for(;J!==null;){var t=J;if(t===e){J=null;return}var n=t.sibling;if(n!==null){n.return=t.return,J=n;return}J=t.return}}function Mh(e){for(;J!==null;){var t=J,n=t.child;if(t.tag===ne&&t.memoizedState!==null){Nh(e);continue}n===null?Nh(e):(n.return=t,J=n)}}function Nh(e){for(;J!==null;){var t=J;ic(t);try{ih(t)}catch(e){yv(t,t.return,e)}if(rc(),t===e){J=null;return}var n=t.sibling;if(n!==null){n.return=t.return,J=n;return}J=t.return}}function Ph(e,t,n,r){J=t,Fh(t,e,n,r)}function Fh(e,t,n,r){for(;J!==null;){var i=J,a=i.child;(i.subtreeFlags&st)!==R&&a!==null?(a.return=i,J=a):Ih(e,t,n,r)}}function Ih(e,t,n,r){for(;J!==null;){var i=J;if((i.flags&Ue)!==R){ic(i);try{Lh(t,i,n,r)}catch(e){yv(i,i.return,e)}rc()}if(i===e){J=null;return}var a=i.sibling;if(a!==null){a.return=i.return,J=a;return}J=i.return}}function Lh(e,t,n,r){switch(t.tag){case y:case A:case N:if(t.mode&ti){cf();try{th(iu|tu,t)}finally{of(t)}}else th(iu|tu,t)}}function Rh(e){J=e,zh()}function zh(){for(;J!==null;){var e=J,t=e.child;if((J.flags&Ie)!==R){var n=e.deletions;if(n!==null){for(var r=0;r<n.length;r++){var i=n[r];J=i,Hh(i,e)}var a=e.alternate;if(a!==null){var o=a.child;if(o!==null){a.child=null;do{var s=o.sibling;o.sibling=null,o=s}while(o!==null)}}J=e}}(e.subtreeFlags&st)!==R&&t!==null?(t.return=e,J=t):Bh()}}function Bh(){for(;J!==null;){var e=J;(e.flags&Ue)!==R&&(ic(e),Vh(e),rc());var t=e.sibling;if(t!==null){t.return=e.return,J=t;return}J=e.return}}function Vh(e){switch(e.tag){case y:case A:case N:e.mode&ti?(cf(),eh(iu|tu,e,e.return),of(e)):eh(iu|tu,e,e.return)}}function Hh(e,t){for(;J!==null;){var n=J;ic(n),Wh(n,t),rc();var r=n.child;r===null?Uh(e):(r.return=n,J=r)}}function Uh(e){for(;J!==null;){var t=J,n=t.sibling,r=t.return;if(sh(t),t===e){J=null;return}if(n!==null){n.return=r,J=n;return}J=r}}function Wh(e,t){switch(e.tag){case y:case A:case N:e.mode&ti?(cf(),eh(iu,e,t),of(e)):eh(iu,e,t)}}function Gh(e){switch(e.tag){case y:case A:case N:try{th(ru|tu,e)}catch(t){yv(e,e.return,t)}break;case b:var t=e.stateNode;try{t.componentDidMount()}catch(t){yv(e,e.return,t)}}}function Kh(e){switch(e.tag){case y:case A:case N:try{th(iu|tu,e)}catch(t){yv(e,e.return,t)}}}function qh(e){switch(e.tag){case y:case A:case N:try{eh(ru|tu,e,e.return)}catch(t){yv(e,e.return,t)}break;case b:var t=e.stateNode;typeof t.componentWillUnmount==`function`&&Wm(e,e.return,t)}}function Jh(e){switch(e.tag){case y:case A:case N:try{eh(iu|tu,e,e.return)}catch(t){yv(e,e.return,t)}}}var Yh=0,Xh=1,Zh=2,Qh=3,$h=4;if(typeof Symbol==`function`&&Symbol.for){var eg=Symbol.for;Yh=eg(`selector.component`),Xh=eg(`selector.has_pseudo_class`),Zh=eg(`selector.role`),Qh=eg(`selector.test_id`),$h=eg(`selector.text`)}function tg(e){return{$$typeof:Yh,value:e}}function ng(e){return{$$typeof:Xh,value:e}}function rg(e){return{$$typeof:Zh,value:e}}function ig(e){return{$$typeof:$h,value:e}}function ag(e){return{$$typeof:Qh,value:e}}function og(e){var t=Bt(e);if(t!=null){if(typeof t.memoizedProps[`data-testname`]!=`string`)throw Error(`Invalid host root specified. Should be either a React container or a node with a testname attribute.`);return t}var n=qt(e);if(n===null)throw Error(`Could not find React container within specified host subtree.`);return n.stateNode.current}function sg(e,t){switch(t.$$typeof){case Yh:if(e.type===t.value)return!0;break;case Xh:return ug(e,t.value);case Zh:if(e.tag===w){var n=e.stateNode;if(Xt(n,t.value))return!0}break;case $h:if(e.tag===w||e.tag===T){var r=z(e);if(r!==null&&r.indexOf(t.value)>=0)return!0}break;case Qh:if(e.tag===w){var i=e.memoizedProps[`data-testname`];if(typeof i==`string`&&i.toLowerCase()===t.value.toLowerCase())return!0}break;default:throw Error(`Invalid selector type specified.`)}return!1}function cg(e){switch(e.$$typeof){case Yh:return`<`+(ke(e.value)||`Unknown`)+`>`;case Xh:return`:has(`+(cg(e)||``)+`)`;case Zh:return`[role="`+e.value+`"]`;case $h:return`"`+e.value+`"`;case Qh:return`[data-testname="`+e.value+`"]`;default:throw Error(`Invalid selector type specified.`)}}function lg(e,t){for(var n=[],r=[e,0],i=0;i<r.length;){var a=r[i++],o=r[i++],s=t[o];if(!(a.tag===w&&Yt(a))){for(;s!=null&&sg(a,s);)o++,s=t[o];if(o===t.length)n.push(a);else for(var c=a.child;c!==null;)r.push(c,o),c=c.sibling}}return n}function ug(e,t){for(var n=[e,0],r=0;r<n.length;){var i=n[r++],a=n[r++],o=t[a];if(!(i.tag===w&&Yt(i))){for(;o!=null&&sg(i,o);)a++,o=t[a];if(a===t.length)return!0;for(var s=i.child;s!==null;)n.push(s,a),s=s.sibling}}return!1}function dg(e,t){if(!Kt)throw Error(`Test selector API is not supported by this renderer.`);for(var n=lg(og(e),t),r=[],i=Array.from(n),a=0;a<i.length;){var o=i[a++];if(o.tag===w){if(Yt(o))continue;r.push(o.stateNode)}else for(var s=o.child;s!==null;)i.push(s),s=s.sibling}return r}function fg(e,t){if(!Kt)throw Error(`Test selector API is not supported by this renderer.`);for(var n=og(e),r=0,i=[],a=[n,0],o=0;o<a.length;){var s=a[o++],c=a[o++],l=t[c];if(!(s.tag===w&&Yt(s))&&(sg(s,l)&&(i.push(cg(l)),c++,c>r&&(r=c)),c<t.length))for(var u=s.child;u!==null;)a.push(u,c),u=u.sibling}if(r<t.length){for(var d=[],f=r;f<t.length;f++)d.push(cg(t[f]));return`findAllNodes was able to match part of the selector:
|
|
128
|
+
`+(` `+i.join(` > `)+`
|
|
129
|
+
|
|
130
|
+
`)+`No matching component was found for:
|
|
131
|
+
`+(` `+d.join(` > `))}return null}function pg(e,t){if(!Kt)throw Error(`Test selector API is not supported by this renderer.`);for(var n=dg(e,t),r=[],i=0;i<n.length;i++)r.push(Jt(n[i]));for(var a=r.length-1;a>0;a--)for(var o=r[a],s=o.x,c=s+o.width,l=o.y,u=l+o.height,d=a-1;d>=0;d--)if(a!==d){var f=r[d],p=f.x,m=p+f.width,h=f.y,g=h+f.height;if(s>=p&&l>=h&&c<=m&&u<=g){r.splice(a,1);break}if(s===p&&o.width===f.width&&!(g<l)&&!(h>u)){h>l&&(f.height+=h-l,f.y=l),g<u&&(f.height=u-h),r.splice(a,1);break}if(l===h&&o.height===f.height&&!(m<s)&&!(p>c)){p>s&&(f.width+=p-s,f.x=s),m<c&&(f.width=c-p),r.splice(a,1);break}}return r}function mg(e,t){if(!Kt)throw Error(`Test selector API is not supported by this renderer.`);for(var n=lg(og(e),t),r=Array.from(n),i=0;i<r.length;){var a=r[i++];if(!Yt(a)){if(a.tag===w){var o=a.stateNode;if(Zt(o))return!0}for(var s=a.child;s!==null;)r.push(s),s=s.sibling}}return!1}var hg=[];function gg(){Kt&&hg.forEach(function(e){return e()})}function _g(e,t,n,r){if(!Kt)throw Error(`Test selector API is not supported by this renderer.`);var i=dg(e,t),a=Qt(i,n,r),o=a.disconnect,s=a.observe,c=a.unobserve,l=function(){var n=dg(e,t);i.forEach(function(e){n.indexOf(e)<0&&c(e)}),n.forEach(function(e){i.indexOf(e)<0&&s(e)})};return hg.push(l),{disconnect:function(){var e=hg.indexOf(l);e>=0&&hg.splice(e,1),o()}}}var vg=i.ReactCurrentActQueue;function yg(e){var t=typeof IS_REACT_ACT_ENVIRONMENT<`u`?IS_REACT_ACT_ENVIRONMENT:void 0;return It&&typeof jest<`u`&&t!==!1}function bg(){var e=typeof IS_REACT_ACT_ENVIRONMENT<`u`?IS_REACT_ACT_ENVIRONMENT:void 0;return!e&&vg.current!==null&&c(`The current testing environment is not configured to support act(...)`),e}var xg=Math.ceil,Sg=i.ReactCurrentDispatcher,Cg=i.ReactCurrentOwner,wg=i.ReactCurrentBatchConfig,Tg=i.ReactCurrentActQueue,Eg=0,Dg=1,Og=2,kg=4,Ag=0,jg=1,Mg=2,Ng=3,Pg=4,Fg=5,Ig=6,Lg=Eg,Rg=null,zg=null,Bg=V,Vg=V,Hg=Mr(V),Ug=Ag,Wg=null,Gg=V,Kg=V,qg=V,Jg=V,Yg=null,Xg=null,Zg=0,Qg=500,$g=1/0,e_=500,t_=null;function n_(){$g=Ya()+e_}function r_(){return $g}var i_=!1,a_=null,o_=null,s_=!1,c_=null,l_=V,u_=[],d_=null,f_=50,p_=0,m_=null,h_=!1,g_=!1,__=50,v_=0,y_=null,b_=Ki,x_=V,S_=!1;function C_(){return Rg}function w_(){return(Lg&(Og|kg))===Eg?(b_===Ki&&(b_=Ya()),b_):Ya()}function T_(e){if((e.mode&ei)===B)return ui;if((Lg&Og)!==Eg&&Bg!==V)return pa(Bg);if(Js()!==qs){if(wg.transition!==null){var t=wg.transition;t._updatedFibers||=new Set,t._updatedFibers.add(e)}return x_===li&&(x_=ua()),x_}var n=Ra();return n===li?Ht():n}function E_(e){return(e.mode&ei)===B?ui:da()}function D_(e,t,n,r){Tv(),S_&&c(`useInsertionEffect must not schedule updates.`),h_&&(g_=!0),wa(e,n,r),(Lg&Og)!==V&&e===Rg?Fv(t):(ao&&ja(e,t,n),Vv(t),e===Rg&&((Lg&Og)===Eg&&(qg=va(qg,n)),Ug===Pg&&I_(e,Bg)),A_(e,r),n===ui&&Lg===Eg&&(t.mode&ei)===B&&!Tg.isBatchingLegacy&&(n_(),Ko()))}function O_(e,t,n){var r=e.current;r.lanes=t,wa(e,t,n),A_(e,n)}function k_(e){return(Lg&Og)!==Eg}function A_(e,t){var n=e.callbackNode;$i(e,t);var r=Xi(e,e===Rg?Bg:V);if(r===V){n!==null&&zv(n),e.callbackNode=null,e.callbackPriority=li;return}var i=fa(r),a=e.callbackPriority;if(a===i&&(Tg.current===null||n===Lv)){n==null&&a!==ui&&c(`Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.`);return}n!=null&&zv(n);var o;if(i===ui)e.tag===Qr?(Tg.isBatchingLegacy!==null&&(Tg.didScheduleLegacyUpdate=!0),Go(L_.bind(null,e))):Wo(L_.bind(null,e)),Wt?Tg.current===null?Gt(function(){(Lg&(Og|kg))===Eg&&qo()}):Tg.current.push(qo):Rv(Xa,qo),o=null;else{var s;switch(Wa(r)){case Pa:s=Xa;break;case H:s=Za;break;case Fa:s=Qa;break;case Ia:s=$a;break;default:s=Qa}o=Rv(s,j_.bind(null,e))}e.callbackPriority=i,e.callbackNode=o}function j_(e,t){if(Zd(),b_=Ki,x_=V,(Lg&(Og|kg))!==Eg)throw Error(`Should not already be working.`);var n=e.callbackNode;if(dv()&&e.callbackNode!==n)return null;var r=Xi(e,e===Rg?Bg:V);if(r===V)return null;var i=!sa(e,r)&&!ca(e,r)&&!t?av(e,r):rv(e,r);if(i!==Ag){if(i===Mg){var a=ta(e);a!==V&&(r=a,i=M_(e,a))}if(i===jg){var o=Wg;throw q_(e,V),I_(e,r),A_(e,Ya()),o}if(i===Ig)I_(e,r);else{var s=!sa(e,r),c=e.current.alternate;if(s&&!F_(c)){if(i=rv(e,r),i===Mg){var l=ta(e);l!==V&&(r=l,i=M_(e,l))}if(i===jg){var u=Wg;throw q_(e,V),I_(e,r),A_(e,Ya()),u}}e.finishedWork=c,e.finishedLanes=r,P_(e,i,r)}}return A_(e,Ya()),e.callbackNode===n?j_.bind(null,e):null}function M_(e,t){var n=Yg;if(Jo(e)){var r=q_(e,t);r.flags|=Be,nr(e.containerInfo)}var i=rv(e,t);if(i!==Mg){var a=Xg;Xg=n,a!==null&&N_(a)}return i}function N_(e){Xg===null?Xg=e:Xg.push.apply(Xg,e)}function P_(e,t,n){switch(t){case Ag:case jg:throw Error(`Root did not complete. This is a bug in React.`);case Mg:lv(e,Xg,t_);break;case Ng:if(I_(e,n),ia(n)&&!Bv()){var r=Zg+Qg-Ya();if(r>10){if(Xi(e,V)!==V)break;var i=e.suspendedLanes;if(!_a(i,n)){w_(),Ea(e,i);break}e.timeoutHandle=Mt(lv.bind(null,e,Xg,t_),r);break}}lv(e,Xg,t_);break;case Pg:if(I_(e,n),oa(n))break;if(!Bv()){var a=Zi(e,n),o=Ya()-a,s=wv(o)-o;if(s>10){e.timeoutHandle=Mt(lv.bind(null,e,Xg,t_),s);break}}lv(e,Xg,t_);break;case Fg:lv(e,Xg,t_);break;default:throw Error(`Unknown root exit status.`)}}function F_(e){for(var t=e;;){if(t.flags&Ke){var n=t.updateQueue;if(n!==null){var r=n.stores;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],o=a.getSnapshot,s=a.value;try{if(!Bo(o(),s))return!1}catch{return!1}}}}var c=t.child;if(t.subtreeFlags&Ke&&c!==null){c.return=t,t=c;continue}if(t===e)return!0;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}return!0}function I_(e,t){t=ya(t,Jg),t=ya(t,qg),Ta(e,t)}function L_(e){if(Qd(),(Lg&(Og|kg))!==Eg)throw Error(`Should not already be working.`);dv();var t=Xi(e,V);if(!ga(t,ui))return A_(e,Ya()),null;var n=rv(e,t);if(e.tag!==Qr&&n===Mg){var r=ta(e);r!==V&&(t=r,n=M_(e,r))}if(n===jg){var i=Wg;throw q_(e,V),I_(e,t),A_(e,Ya()),i}if(n===Ig)throw Error(`Root did not complete. This is a bug in React.`);return e.finishedWork=e.current.alternate,e.finishedLanes=t,lv(e,Xg,t_),A_(e,Ya()),null}function R_(e,t){t!==V&&(ka(e,va(t,ui)),A_(e,Ya()),(Lg&(Og|kg))===Eg&&(n_(),qo()))}function z_(e){var t=Ra(),n=wg.transition;try{return wg.transition=null,za(Fa),e()}finally{za(t),wg.transition=n}}function B_(e,t){var n=Lg;Lg|=Dg;try{return e(t)}finally{Lg=n,Lg===Eg&&!Tg.isBatchingLegacy&&(n_(),Ko())}}function V_(e,t,n,r,i){var a=Ra(),o=wg.transition;try{return wg.transition=null,za(Pa),e(t,n,r,i)}finally{za(a),wg.transition=o,Lg===Eg&&n_()}}function H_(e){c_!==null&&c_.tag===Qr&&(Lg&(Og|kg))===Eg&&dv();var t=Lg;Lg|=Dg;var n=wg.transition,r=Ra();try{return wg.transition=null,za(Pa),e?e():void 0}finally{za(r),wg.transition=n,Lg=t,(Lg&(Og|kg))===Eg&&qo()}}function U_(){return(Lg&(Og|kg))!==Eg}function W_(e){var t=Lg;Lg|=Dg;var n=wg.transition,r=Ra();try{wg.transition=null,za(Pa),e()}finally{za(r),wg.transition=n,Lg=t,Lg===Eg&&(n_(),qo())}}function G_(e,t){Pr(Hg,Vg,e),Vg=va(Vg,t),Gg=va(Gg,t)}function K_(e){Vg=Hg.current,Nr(Hg,e)}function q_(e,t){e.finishedWork=null,e.finishedLanes=V;var n=e.timeoutHandle;if(n!==Pt&&(e.timeoutHandle=Pt,Nt(n)),zg!==null)for(var r=zg.return;r!==null;){var i=r.alternate;wm(i,r),r=r.return}Rg=e;var a=dy(e.current,null);return zg=a,Bg=Vg=Gg=t,Ug=Ag,Wg=null,Kg=V,qg=V,Jg=V,Yg=null,Xg=null,il(),sc.discardPendingWarnings(),a}function J_(e,t){do{var n=zg;try{if(Kc(),Au(),rc(),Cg.current=null,n===null||n.return===null){Ug=jg,Wg=t,zg=null;return}_&&n.mode&ti&&rf(n,!0),g&&(vo(),typeof t==`object`&&t&&typeof t.then==`function`?Oo(n,t,Bg):Do(n,t,Bg)),qf(e,n.return,n,t,Bg),cv(n)}catch(e){t=e,zg===n&&n!==null?(n=n.return,zg=n):n=zg;continue}return}while(!0)}function Y_(){var e=Sg.current;return Sg.current=Md,e===null?Md:e}function X_(e){Sg.current=e}function Z_(){Zg=Ya()}function Q_(e){Kg=va(e,Kg)}function $_(){Ug===Ag&&(Ug=Ng)}function ev(){(Ug===Ag||Ug===Ng||Ug===Mg)&&(Ug=Pg),Rg!==null&&(ra(Kg)||ra(qg))&&I_(Rg,Bg)}function tv(e){Ug!==Pg&&(Ug=Mg),Yg===null?Yg=[e]:Yg.push(e)}function nv(){return Ug===Ag}function rv(e,t){var n=Lg;Lg|=Og;var r=Y_();if(Rg!==e||Bg!==t){if(ao){var i=e.memoizedUpdaters;i.size>0&&(Iv(e,Bg),i.clear()),Ma(e,t)}t_=Na(),q_(e,t)}No(t);do try{iv();break}catch(t){J_(e,t)}while(!0);if(Kc(),Lg=n,X_(r),zg!==null)throw Error(`Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.`);return Fo(),Rg=null,Bg=V,Ug}function iv(){for(;zg!==null;)sv(zg)}function av(e,t){var n=Lg;Lg|=Og;var r=Y_();if(Rg!==e||Bg!==t){if(ao){var i=e.memoizedUpdaters;i.size>0&&(Iv(e,Bg),i.clear()),Ma(e,t)}t_=Na(),n_(),q_(e,t)}No(t);do try{ov();break}catch(t){J_(e,t)}while(!0);return Kc(),X_(r),Lg=n,zg===null?(Fo(),Rg=null,Bg=V,Ug):(Po(),Ag)}function ov(){for(;zg!==null&&!qa();)sv(zg)}function sv(e){var t=e.alternate;ic(e);var n;(e.mode&ti)===B?n=jv(t,e,Vg):(tf(e),n=jv(t,e,Vg),rf(e,!0)),rc(),e.memoizedProps=e.pendingProps,n===null?cv(e):zg=n,Cg.current=null}function cv(e){var t=e;do{var n=t.alternate,r=t.return;if((t.flags&Ye)===R){ic(t);var i=void 0;if((t.mode&ti)===B?i=Sm(n,t,Vg):(tf(t),i=Sm(n,t,Vg),rf(t,!1)),rc(),i!==null){zg=i;return}}else{var a=Cm(n,t);if(a!==null){a.flags&=Je,zg=a;return}if((t.mode&ti)!==B){rf(t,!1);for(var o=t.actualDuration,s=t.child;s!==null;)o+=s.actualDuration,s=s.sibling;t.actualDuration=o}if(r!==null)r.flags|=Ye,r.subtreeFlags=R,r.deletions=null;else{Ug=Ig,zg=null;return}}var c=t.sibling;if(c!==null){zg=c;return}t=r,zg=t}while(t!==null);Ug===Ag&&(Ug=Fg)}function lv(e,t,n){var r=Ra(),i=wg.transition;try{wg.transition=null,za(Pa),uv(e,t,n,r)}finally{wg.transition=i,za(r)}return null}function uv(e,t,n,r){do dv();while(c_!==null);if(Ev(),(Lg&(Og|kg))!==Eg)throw Error(`Should not already be working.`);var i=e.finishedWork,a=e.finishedLanes;if(ho(a),i===null)return go(),null;if(a===V&&c(`root.finishedLanes should not be empty during a commit. This is a bug in React.`),e.finishedWork=null,e.finishedLanes=V,i===e.current)throw Error(`Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.`);e.callbackNode=null,e.callbackPriority=li;var o=va(i.lanes,i.childLanes);Oa(e,o),e===Rg&&(Rg=null,zg=null,Bg=V),((i.subtreeFlags&st)!==R||(i.flags&st)!==R)&&(s_||(s_=!0,d_=n,Rv(Qa,function(){return dv(),null})));var s=(i.subtreeFlags&(it|at|ot|st))!==R,l=(i.flags&(it|at|ot|st))!==R;if(s||l){var u=wg.transition;wg.transition=null;var d=Ra();za(Pa);var f=Lg;Lg|=kg,Cg.current=null,Xm(e,i),ef(),Ch(e,i,a),Tt(e.containerInfo),e.current=i,ko(a),Dh(i,e,a),Ao(),Ja(),Lg=f,za(d),wg.transition=u}else e.current=i,ef();var p=s_;if(s_?(s_=!1,c_=e,l_=a):(v_=0,y_=null),o=e.pendingLanes,o===V&&(o_=null),p||Dv(e.current,!1),co(i.stateNode,r),ao&&e.memoizedUpdaters.clear(),gg(),A_(e,Ya()),t!==null)for(var m=e.onRecoverableError,h=0;h<t.length;h++){var g=t[h],_=g.stack,v=g.digest;m(g.value,{componentStack:_,digest:v})}if(i_){i_=!1;var y=a_;throw a_=null,y}return ga(l_,ui)&&e.tag!==Qr&&dv(),o=e.pendingLanes,ga(o,ui)?(Xd(),e===m_?p_++:(p_=0,m_=e)):p_=0,qo(),go(),null}function dv(){if(c_!==null){var e=Ha(Fa,Wa(l_)),t=wg.transition,n=Ra();try{return wg.transition=null,za(e),pv()}finally{za(n),wg.transition=t}}return!1}function fv(e){u_.push(e),s_||(s_=!0,Rv(Qa,function(){return dv(),null}))}function pv(){if(c_===null)return!1;var e=d_;d_=null;var t=c_,n=l_;if(c_=null,l_=V,(Lg&(Og|kg))!==Eg)throw Error(`Cannot flush passive effects while already rendering.`);h_=!0,g_=!1,jo(n);var r=Lg;Lg|=kg,Rh(t.current),Ph(t,t.current,n,e);var i=u_;u_=[];for(var a=0;a<i.length;a++){var o=i[a];nh(t,o)}Mo(),Dv(t.current,!0),Lg=r,qo(),g_?t===y_?v_++:(v_=0,y_=t):v_=0,h_=!1,g_=!1,lo(t);var s=t.current.stateNode;return s.effectDuration=0,s.passiveEffectDuration=0,!0}function mv(e){return o_!==null&&o_.has(e)}function hv(e){o_===null?o_=new Set([e]):o_.add(e)}function gv(e){i_||(i_=!0,a_=e)}var _v=gv;function vv(e,t,n){var r=xl(e,Bf(e,Ff(n,t),ui),ui),i=w_();r!==null&&(wa(r,ui,i),A_(r,i))}function yv(e,t,n){if(Vm(n),Uv(!1),e.tag===S){vv(e,e,n);return}var r=null;for(r=t;r!==null;){if(r.tag===S){vv(r,e,n);return}if(r.tag===b){var i=r.type,a=r.stateNode;if(typeof i.getDerivedStateFromError==`function`||typeof a.componentDidCatch==`function`&&!mv(a)){var o=Ff(n,e),s=Vf(r,o,ui),l=xl(r,s,ui),u=w_();l!==null&&(wa(l,ui,u),A_(l,u));return}}r=r.return}c(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
|
|
132
|
+
|
|
133
|
+
Error message:
|
|
134
|
+
|
|
135
|
+
%s`,n)}function bv(e,t,n){var r=e.pingCache;r!==null&&r.delete(t);var i=w_();Ea(e,n),Hv(e),Rg===e&&_a(Bg,n)&&(Ug===Pg||Ug===Ng&&ia(Bg)&&Ya()-Zg<Qg?q_(e,V):Jg=va(Jg,n)),A_(e,i)}function xv(e,t){t===li&&(t=E_(e));var n=w_(),r=cl(e,t);r!==null&&(wa(r,t,n),A_(r,n))}function Sv(e){var t=e.memoizedState,n=li;t!==null&&(n=t.retryLane),xv(e,n)}function Cv(e,t){var n=li,r;switch(e.tag){case M:r=e.stateNode;var i=e.memoizedState;i!==null&&(n=i.retryLane);break;case L:r=e.stateNode;break;default:throw Error(`Pinged unknown suspense boundary type. This is probably a bug in React.`)}r!==null&&r.delete(t),xv(e,n)}function wv(e){return e<120?120:e<480?480:e<1080?1080:e<1920?1920:e<3e3?3e3:e<4320?4320:xg(e/1960)*1960}function Tv(){if(p_>f_)throw p_=0,m_=null,Error(`Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.`);v_>__&&(v_=0,y_=null,c(`Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.`))}function Ev(){sc.flushLegacyContextWarning(),sc.flushPendingUnsafeLifecycleWarnings()}function Dv(e,t){ic(e),Ov(e,nt,qh),t&&Ov(e,rt,Jh),Ov(e,nt,Gh),t&&Ov(e,rt,Kh),rc()}function Ov(e,t,n){for(var r=e,i=null;r!==null;){var a=r.subtreeFlags&t;r!==i&&r.child!==null&&a!==R?r=r.child:((r.flags&t)!==R&&n(r),r=r.sibling===null?i=r.return:r.sibling)}}var kv=null;function Av(e){if((Lg&Og)===Eg&&e.mode&ei){var t=e.tag;if(t===x||t===S||t===b||t===y||t===A||t===ee||t===N){var n=Me(e)||`ReactComponent`;if(kv!==null){if(kv.has(n))return;kv.add(n)}else kv=new Set([n]);var r=$s;try{ic(e),c(`Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.`)}finally{r?ic(e):rc()}}}}var jv,Mv=null;jv=function(e,t,n){var r=Ty(Mv,t);try{return um(e,t,n)}catch(a){if(Cs()||typeof a==`object`&&a&&typeof a.then==`function`)throw a;if(Kc(),Au(),wm(e,t),Ty(t,r),t.mode&ti&&tf(t),Mm(null,um,null,e,t,n),Nm()){var i=Pm();typeof i==`object`&&i&&i._suppressLogging&&typeof a==`object`&&a&&!a._suppressLogging&&(a._suppressLogging=!0)}throw a}};var Nv=!1,Pv=new Set;function Fv(e){if(ec&&!Cd())switch(e.tag){case y:case A:case N:var t=zg&&Me(zg)||`Unknown`,n=t;Pv.has(n)||(Pv.add(n),c("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render",Me(e)||`Unknown`,t,t));break;case b:Nv||=(c("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),!0)}}function Iv(e,t){ao&&e.memoizedUpdaters.forEach(function(n){ja(e,n,t)})}var Lv={};function Rv(e,t){var n=Tg.current;return n===null?Ga(e,t):(n.push(t),Lv)}function zv(e){if(e!==Lv)return Ka(e)}function Bv(){return Tg.current!==null}function Vv(e){if(e.mode&ei){if(!bg())return}else if(!yg()||Lg!==Eg||e.tag!==y&&e.tag!==A&&e.tag!==N)return;if(Tg.current===null){var t=$s;try{ic(e),c(`An update to %s inside a test was not wrapped in act(...).
|
|
136
|
+
|
|
137
|
+
When testing, code that causes React state updates should be wrapped into act(...):
|
|
138
|
+
|
|
139
|
+
act(() => {
|
|
140
|
+
/* fire events that update state */
|
|
141
|
+
});
|
|
142
|
+
/* assert on the output */
|
|
143
|
+
|
|
144
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`,Me(e))}finally{t?ic(e):rc()}}}function Hv(e){e.tag!==Qr&&bg()&&Tg.current===null&&c(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).
|
|
145
|
+
|
|
146
|
+
When testing, code that resolves suspended data should be wrapped into act(...):
|
|
147
|
+
|
|
148
|
+
act(() => {
|
|
149
|
+
/* finish loading suspended data */
|
|
150
|
+
});
|
|
151
|
+
/* assert on the output */
|
|
152
|
+
|
|
153
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`)}function Uv(e){S_=e}var Wv=null,Gv=null,Kv=function(e){Wv=e};function qv(e){if(Wv===null)return e;var t=Wv(e);return t===void 0?e:t.current}function Jv(e){return qv(e)}function Yv(e){if(Wv===null)return e;var t=Wv(e);if(t===void 0){if(e!=null&&typeof e.render==`function`){var n=qv(e.render);if(e.render!==n){var r={$$typeof:pe,render:n};return e.displayName!==void 0&&(r.displayName=e.displayName),r}}return e}return t.current}function Xv(e,t){if(Wv===null)return!1;var n=e.elementType,r=t.type,i=!1,a=typeof r==`object`&&r?r.$$typeof:null;switch(e.tag){case b:typeof r==`function`&&(i=!0);break;case y:(typeof r==`function`||a===_e)&&(i=!0);break;case A:(a===pe||a===_e)&&(i=!0);break;case ee:case N:(a===ge||a===_e)&&(i=!0);break;default:return!1}if(i){var o=Wv(n);if(o!==void 0&&o===Wv(r))return!0}return!1}function Zv(e){Wv!==null&&typeof WeakSet==`function`&&(Gv===null&&(Gv=new WeakSet),Gv.add(e))}var Qv=function(e,t){if(Wv!==null){var n=t.staleFamilies,r=t.updatedFamilies;dv(),H_(function(){ey(e.current,r,n)})}},$v=function(e,t){e.context===Ir&&(dv(),H_(function(){Ly(t,e,null,null)}))};function ey(e,t,n){var r=e.alternate,i=e.child,a=e.sibling,o=e.tag,s=e.type,c=null;switch(o){case y:case N:case b:c=s;break;case A:c=s.render}if(Wv===null)throw Error(`Expected resolveFamily to be set during hot reload.`);var l=!1,u=!1;if(c!==null){var d=Wv(c);d!==void 0&&(n.has(d)?u=!0:t.has(d)&&(o===b?u=!0:l=!0))}if(Gv!==null&&(Gv.has(e)||r!==null&&Gv.has(r))&&(u=!0),u&&(e._debugNeedsRemount=!0),u||l){var f=cl(e,ui);f!==null&&D_(f,e,ui,Ki)}i!==null&&!u&&ey(i,t,n),a!==null&&ey(a,t,n)}var ty=function(e,t){var n=new Set,r=new Set(t.map(function(e){return e.current}));return ny(e.current,r,n),n};function ny(e,t,n){var r=e.child,i=e.sibling,a=e.tag,o=e.type,s=null;switch(a){case y:case N:case b:s=o;break;case A:s=o.render}var c=!1;s!==null&&t.has(s)&&(c=!0),c?ry(e,n):r!==null&&ny(r,t,n),i!==null&&ny(i,t,n)}function ry(e,t){if(!iy(e,t))for(var n=e;;){switch(n.tag){case w:t.add(n.stateNode);return;case C:t.add(n.stateNode.containerInfo);return;case S:t.add(n.stateNode.containerInfo);return}if(n.return===null)throw Error(`Expected to reach root first.`);n=n.return}}function iy(e,t){for(var n=e,r=!1;;){if(n.tag===w)r=!0,t.add(n.stateNode);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)return r;for(;n.sibling===null;){if(n.return===null||n.return===e)return r;n=n.return}n.sibling.return=n.return,n=n.sibling}return!1}var ay=!1;try{Object.preventExtensions({})}catch{ay=!0}function oy(e,t,n,r){this.tag=e,this.key=n,this.elementType=null,this.type=null,this.stateNode=null,this.return=null,this.child=null,this.sibling=null,this.index=0,this.ref=null,this.pendingProps=t,this.memoizedProps=null,this.updateQueue=null,this.memoizedState=null,this.dependencies=null,this.mode=r,this.flags=R,this.subtreeFlags=R,this.deletions=null,this.lanes=V,this.childLanes=V,this.alternate=null,this.actualDuration=NaN,this.actualStartTime=NaN,this.selfBaseDuration=NaN,this.treeBaseDuration=NaN,this.actualDuration=0,this.actualStartTime=-1,this.selfBaseDuration=0,this.treeBaseDuration=0,this._debugSource=null,this._debugOwner=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,!ay&&typeof Object.preventExtensions==`function`&&Object.preventExtensions(this)}var sy=function(e,t,n,r){return new oy(e,t,n,r)};function cy(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function ly(e){return typeof e==`function`&&!cy(e)&&e.defaultProps===void 0}function uy(e){if(typeof e==`function`)return cy(e)?b:y;if(e!=null){var t=e.$$typeof;if(t===pe)return A;if(t===ge)return ee}return x}function dy(e,t){var n=e.alternate;n===null?(n=sy(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n._debugSource=e._debugSource,n._debugOwner=e._debugOwner,n._debugHookTypes=e._debugHookTypes,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=R,n.subtreeFlags=R,n.deletions=null,n.actualDuration=0,n.actualStartTime=-1),n.flags=e.flags&ct,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue;var r=e.dependencies;switch(n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.selfBaseDuration=e.selfBaseDuration,n.treeBaseDuration=e.treeBaseDuration,n._debugNeedsRemount=e._debugNeedsRemount,n.tag){case x:case y:case N:n.type=qv(e.type);break;case b:n.type=Jv(e.type);break;case A:n.type=Yv(e.type)}return n}function fy(e,t){e.flags&=ct|Pe;var n=e.alternate;if(n===null)e.childLanes=V,e.lanes=t,e.child=null,e.subtreeFlags=R,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null,e.selfBaseDuration=0,e.treeBaseDuration=0;else{e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=R,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type;var r=n.dependencies;e.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},e.selfBaseDuration=n.selfBaseDuration,e.treeBaseDuration=n.treeBaseDuration}return e}function py(e,t,n){var r;return e===$r?(r=ei,t===!0&&(r|=ni,r|=ri)):r=B,ao&&(r|=ti),sy(S,null,null,r)}function my(e,t,n,r,i,a){var o=x,s=e;if(typeof e==`function`)cy(e)?(o=b,s=Jv(s)):s=qv(s);else if(typeof e==`string`)o=w;else getTag:switch(e){case ce:return gy(n.children,i,a,t);case le:o=D,i|=ni,(i&ei)!==B&&(i|=ri);break;case ue:return _y(n,i,a,t);case me:return vy(n,i,a,t);case he:return yy(n,i,a,t);case be:return by(n,i,a,t);case xe:case ve:case Se:case Ce:case ye:default:if(typeof e==`object`&&e)switch(e.$$typeof){case de:o=k;break getTag;case fe:o=O;break getTag;case pe:o=A,s=Yv(s);break getTag;case ge:o=ee;break getTag;case _e:o=P,s=null;break getTag}var c=``;(e===void 0||typeof e==`object`&&e&&Object.keys(e).length===0)&&(c+=` You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.`);var l=r?Me(r):null;throw l&&(c+=`
|
|
154
|
+
|
|
155
|
+
Check the render method of \``+l+"`."),Error(`Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) `+(`but got: `+(e==null?e:typeof e)+`.`+c))}var u=sy(o,n,t,i);return u.elementType=e,u.type=s,u.lanes=a,u._debugOwner=r,u}function hy(e,t,n){var r=null;r=e._owner;var i=e.type,a=e.key,o=e.props,s=my(i,a,o,r,t,n);return s._debugSource=e._source,s._debugOwner=e._owner,s}function gy(e,t,n,r){var i=sy(E,e,r,t);return i.lanes=n,i}function _y(e,t,n,r){typeof e.id!=`string`&&c('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof e.id);var i=sy(j,e,r,t|ti);return i.elementType=ue,i.lanes=n,i.stateNode={effectDuration:0,passiveEffectDuration:0},i}function vy(e,t,n,r){var i=sy(M,e,r,t);return i.elementType=me,i.lanes=n,i}function yy(e,t,n,r){var i=sy(L,e,r,t);return i.elementType=he,i.lanes=n,i}function by(e,t,n,r){var i=sy(ne,e,r,t);return i.elementType=be,i.lanes=n,i.stateNode={isHidden:!1},i}function xy(e,t,n){var r=sy(T,e,null,t);return r.lanes=n,r}function Sy(){var e=sy(w,null,null,B);return e.elementType=`DELETED`,e}function Cy(e){var t=sy(I,null,null,B);return t.stateNode=e,t}function wy(e,t,n){var r=sy(C,e.children===null?[]:e.children,e.key,t);return r.lanes=n,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}function Ty(e,t){return e===null&&(e=sy(x,null,null,B)),e.tag=t.tag,e.key=t.key,e.elementType=t.elementType,e.type=t.type,e.stateNode=t.stateNode,e.return=t.return,e.child=t.child,e.sibling=t.sibling,e.index=t.index,e.ref=t.ref,e.pendingProps=t.pendingProps,e.memoizedProps=t.memoizedProps,e.updateQueue=t.updateQueue,e.memoizedState=t.memoizedState,e.dependencies=t.dependencies,e.mode=t.mode,e.flags=t.flags,e.subtreeFlags=t.subtreeFlags,e.deletions=t.deletions,e.lanes=t.lanes,e.childLanes=t.childLanes,e.alternate=t.alternate,e.actualDuration=t.actualDuration,e.actualStartTime=t.actualStartTime,e.selfBaseDuration=t.selfBaseDuration,e.treeBaseDuration=t.treeBaseDuration,e._debugSource=t._debugSource,e._debugOwner=t._debugOwner,e._debugNeedsRemount=t._debugNeedsRemount,e._debugHookTypes=t._debugHookTypes,e}function Ey(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=Pt,this.context=null,this.pendingContext=null,this.callbackNode=null,this.callbackPriority=li,this.eventTimes=Ca(V),this.expirationTimes=Ca(Ki),this.pendingLanes=V,this.suspendedLanes=V,this.pingedLanes=V,this.expiredLanes=V,this.mutableReadLanes=V,this.finishedLanes=V,this.entangledLanes=V,this.entanglements=Ca(V),this.identifierPrefix=r,this.onRecoverableError=i,zt&&(this.mutableSourceEagerHydrationData=null),this.effectDuration=0,this.passiveEffectDuration=0,this.memoizedUpdaters=new Set;for(var a=this.pendingUpdatersLaneMap=[],o=0;o<ci;o++)a.push(new Set);switch(t){case $r:this._debugRootType=n?`hydrateRoot()`:`createRoot()`;break;case Qr:this._debugRootType=n?`hydrate()`:`render()`}}function Dy(e,t,n,r,i,a,o,s,c,l){var u=new Ey(e,t,n,s,c),d=py(t,a);return u.current=d,d.stateNode=u,d.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vl(d),u}var Oy=`18.3.1`;function ky(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return Sc(r),{$$typeof:se,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var Ay=!1,jy={};function My(e){if(!e)return Ir;var t=d(e),n=Zr(t);if(t.tag===b){var r=t.type;if(Wr(r))return Jr(t,r,n)}return n}function Ny(e){var t=d(e);if(t===void 0){if(typeof e.render==`function`)throw Error(`Unable to find node on an unmounted component.`);var n=Object.keys(e).join(`,`);throw Error(`Argument appears to not be a ReactComponent. Keys: `+n)}var r=ht(t);return r===null?null:r.stateNode}function Py(e,t){var n=d(e);if(n===void 0){if(typeof e.render==`function`)throw Error(`Unable to find node on an unmounted component.`);var r=Object.keys(e).join(`,`);throw Error(`Argument appears to not be a ReactComponent. Keys: `+r)}var i=ht(n);if(i===null)return null;if(i.mode&ni){var a=Me(n)||`Component`;if(!jy[a]){jy[a]=!0;var o=$s;try{ic(i),n.mode&ni?c(`%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node`,t,t,a):c(`%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node`,t,t,a)}finally{o?ic(o):rc()}}}return i.stateNode}function Fy(e,t,n,r,i,a,o,s){return Dy(e,t,!1,null,n,r,i,a,o)}function Iy(e,t,n,r,i,a,o,s,c,l){var u=Dy(n,r,!0,e,i,a,o,s,c);u.context=My(null);var d=u.current,f=w_(),p=T_(d),m=bl(f,p);return m.callback=t??null,xl(d,m,p),O_(u,p,f),u}function Ly(e,t,n,r){so(t,e);var i=t.current,a=w_(),o=T_(i);Io(o);var s=My(n);t.context===null?t.context=s:t.pendingContext=s,ec&&$s!==null&&!Ay&&(Ay=!0,c(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
|
|
156
|
+
|
|
157
|
+
Check the render method of %s.`,Me($s)||`Unknown`));var l=bl(a,o);l.payload={element:e},r=r===void 0?null:r,r!==null&&(typeof r!=`function`&&c("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",r),l.callback=r);var u=xl(i,l,o);return u!==null&&(D_(u,i,o,a),Sl(u,i,o)),o}function Ry(e){var t=e.current;if(!t.child)return null;switch(t.child.tag){case w:return xt(t.child.stateNode);default:return t.child.stateNode}}function zy(e){switch(e.tag){case S:var t=e.stateNode;Jo(t)&&R_(t,ea(t));break;case M:H_(function(){var t=cl(e,ui);t!==null&&D_(t,e,ui,w_())}),Vy(e,ui)}}function By(e,t){var n=e.memoizedState;n!==null&&n.dehydrated!==null&&(n.retryLane=Sa(n.retryLane,t))}function Vy(e,t){By(e,t);var n=e.alternate;n&&By(n,t)}function Hy(e){if(e.tag===M){var t=ui,n=cl(e,t);n!==null&&D_(n,e,t,w_()),Vy(e,t)}}function Uy(e){if(e.tag===M){var t=Bi,n=cl(e,t);n!==null&&D_(n,e,t,w_()),Vy(e,t)}}function Wy(e){if(e.tag===M){var t=T_(e),n=cl(e,t);n!==null&&D_(n,e,t,w_()),Vy(e,t)}}function Gy(e){var t=_t(e);return t===null?null:t.stateNode}var Ky=function(e){return null};function qy(e){return Ky(e)}var Jy=function(e){return!1};function Yy(e){return Jy(e)}var Xy=null,Zy=null,Qy=null,$y=null,eb=null,tb=null,nb=null,rb=null,ib=null,ab=function(e,t,n){var r=t[n],i=bt(e)?e.slice():u({},e);return n+1===t.length?(bt(i)?i.splice(r,1):delete i[r],i):(i[r]=ab(e[r],t,n+1),i)},ob=function(e,t){return ab(e,t,0)},sb=function(e,t,n,r){var i=t[r],a=bt(e)?e.slice():u({},e);if(r+1===t.length){var o=n[r];a[o]=a[i],bt(a)?a.splice(i,1):delete a[i]}else a[i]=sb(e[i],t,n,r+1);return a},cb=function(e,t,n){if(t.length!==n.length){s(`copyWithRename() expects paths of the same length`);return}for(var r=0;r<n.length-1;r++)if(t[r]!==n[r]){s(`copyWithRename() expects paths to be the same except for the deepest key`);return}return sb(e,t,n,0)},lb=function(e,t,n,r){if(n>=t.length)return r;var i=t[n],a=bt(e)?e.slice():u({},e);return a[i]=lb(e[i],t,n+1,r),a},ub=function(e,t,n){return lb(e,t,0,n)},db=function(e,t){for(var n=e.memoizedState;n!==null&&t>0;)n=n.next,t--;return n};Xy=function(e,t,n,r){var i=db(e,t);if(i!==null){var a=ub(i.memoizedState,n,r);i.memoizedState=a,i.baseState=a,e.memoizedProps=u({},e.memoizedProps);var o=cl(e,ui);o!==null&&D_(o,e,ui,Ki)}},Zy=function(e,t,n){var r=db(e,t);if(r!==null){var i=ob(r.memoizedState,n);r.memoizedState=i,r.baseState=i,e.memoizedProps=u({},e.memoizedProps);var a=cl(e,ui);a!==null&&D_(a,e,ui,Ki)}},Qy=function(e,t,n,r){var i=db(e,t);if(i!==null){var a=cb(i.memoizedState,n,r);i.memoizedState=a,i.baseState=a,e.memoizedProps=u({},e.memoizedProps);var o=cl(e,ui);o!==null&&D_(o,e,ui,Ki)}},$y=function(e,t,n){e.pendingProps=ub(e.memoizedProps,t,n),e.alternate&&(e.alternate.pendingProps=e.pendingProps);var r=cl(e,ui);r!==null&&D_(r,e,ui,Ki)},eb=function(e,t){e.pendingProps=ob(e.memoizedProps,t),e.alternate&&(e.alternate.pendingProps=e.pendingProps);var n=cl(e,ui);n!==null&&D_(n,e,ui,Ki)},tb=function(e,t,n){e.pendingProps=cb(e.memoizedProps,t,n),e.alternate&&(e.alternate.pendingProps=e.pendingProps);var r=cl(e,ui);r!==null&&D_(r,e,ui,Ki)},nb=function(e){var t=cl(e,ui);t!==null&&D_(t,e,ui,Ki)},rb=function(e){Ky=e},ib=function(e){Jy=e};function fb(e){var t=ht(e);return t===null?null:t.stateNode}function pb(e){return null}function mb(){return $s}function hb(e){var t=e.findFiberByHostInstance,n=i.ReactCurrentDispatcher;return oo({bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:Xy,overrideHookStateDeletePath:Zy,overrideHookStateRenamePath:Qy,overrideProps:$y,overridePropsDeletePath:eb,overridePropsRenamePath:tb,setErrorHandler:rb,setSuspenseHandler:ib,scheduleUpdate:nb,currentDispatcherRef:n,findHostInstanceByFiber:fb,findFiberByHostInstance:t||pb,findHostInstancesForRefresh:ty,scheduleRefresh:Qv,scheduleRoot:$v,setRefreshHandler:Kv,getCurrentFiber:mb,reconcilerVersion:Oy})}return t.attemptContinuousHydration=Uy,t.attemptDiscreteHydration=Hy,t.attemptHydrationAtCurrentPriority=Wy,t.attemptSynchronousHydration=zy,t.batchedUpdates=B_,t.createComponentSelector=tg,t.createContainer=Fy,t.createHasPseudoClassSelector=ng,t.createHydrationContainer=Iy,t.createPortal=ky,t.createRoleSelector=rg,t.createTestNameSelector=ag,t.createTextSelector=ig,t.deferredUpdates=z_,t.discreteUpdates=V_,t.findAllNodes=dg,t.findBoundingRects=pg,t.findHostInstance=Ny,t.findHostInstanceWithNoPortals=Gy,t.findHostInstanceWithWarning=Py,t.flushControlled=W_,t.flushPassiveEffects=dv,t.flushSync=H_,t.focusWithin=mg,t.getCurrentUpdatePriority=Ra,t.getFindAllNodesFailureDescription=fg,t.getPublicRootInstance=Ry,t.injectIntoDevTools=hb,t.isAlreadyRendering=U_,t.observeVisibleRects=_g,t.registerMutableSourceForHydration=su,t.runWithPriority=Ba,t.shouldError=qy,t.shouldSuspend=Yy,t.updateContainer=Ly,t})})),Aa=o(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?Oa():ka()})),ja=o((e=>{e.ConcurrentRoot=1,e.ContinuousEventPriority=4,e.DefaultEventPriority=16,e.DiscreteEventPriority=1,e.IdleEventPriority=536870912,e.LegacyRoot=0})),Ma=o((e=>{process.env.NODE_ENV!==`production`&&(function(){"use strict";var t=1,n=4,r=16,i=536870912,a=t,o=n,s=r,c=i;e.ConcurrentRoot=1,e.ContinuousEventPriority=o,e.DefaultEventPriority=s,e.DiscreteEventPriority=a,e.IdleEventPriority=c,e.LegacyRoot=0})()})),Na=o(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?ja():Ma()}));Ca();var Pa=l(wa()),H=l(Aa()),Fa=Na(),Ia=xi(),La={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0},Ra=!1,za=!1,Ba=`.react-konva-event`,Va=!1,Ha=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
|
|
158
|
+
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
|
|
159
|
+
Consider to add onDragMove or onDragEnd events.
|
|
160
|
+
For more info see: https://github.com/konvajs/react-konva/issues/256
|
|
161
|
+
`,Ua=`ReactKonva: You are using "zIndex" attribute for a Konva node.
|
|
162
|
+
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
|
|
163
|
+
For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
164
|
+
`,Wa={};function Ga(e,t,n=Wa){if(!Ra&&`zIndex`in t&&(console.warn(Ua),Ra=!0),!za&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(Ha),za=!0)}for(var a in n)if(!La[a]){var o=a.slice(0,2)===`on`,s=n[a]!==t[a];if(o&&s){var c=a.substr(2).toLowerCase();c.substr(0,7)===`content`&&(c=`content`+c.substr(7,1).toUpperCase()+c.substr(8)),e.off(c,n[a])}t.hasOwnProperty(a)||e.setAttr(a,void 0)}var l=Va||t._useStrictMode,u={},d=!1;let f={};for(var a in t)if(!La[a]){var o=a.slice(0,2)===`on`,p=n[a]!==t[a];if(o&&p){var c=a.substr(2).toLowerCase();c.substr(0,7)===`content`&&(c=`content`+c.substr(7,1).toUpperCase()+c.substr(8)),t[a]&&(f[c]=t[a])}!o&&(t[a]!==n[a]||l&&t[a]!==e.getAttr(a))&&(d=!0,u[a]=t[a])}for(var c in d&&(e.setAttrs(u),Ka(e)),f)e.on(c+Ba,f[c])}function Ka(e){if(!Ia.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}var qa=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&ee(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&ee(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function ee(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,ee(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Ja=o((e=>{process.env.NODE_ENV!==`production`&&(function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=5;function n(e,t){var n=e.length;e.push(t),a(e,t,n)}function r(e){return e.length===0?null:e[0]}function i(e){if(e.length===0)return null;var t=e[0],n=e.pop();return n!==t&&(e[0]=n,o(e,n,0)),t}function a(e,t,n){for(var r=n;r>0;){var i=r-1>>>1,a=e[i];if(s(a,t)>0)e[i]=t,e[r]=a,r=i;else return}}function o(e,t,n){for(var r=n,i=e.length,a=i>>>1;r<a;){var o=(r+1)*2-1,c=e[o],l=o+1,u=e[l];if(s(c,t)<0)l<i&&s(u,c)<0?(e[r]=u,e[l]=t,r=l):(e[r]=c,e[o]=t,r=o);else if(l<i&&s(u,t)<0)e[r]=u,e[l]=t,r=l;else return}}function s(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}var c=1,l=2,u=3,d=4,f=5;if(typeof performance==`object`&&typeof performance.now==`function`){var p=performance;e.unstable_now=function(){return p.now()}}else{var m=Date,h=m.now();e.unstable_now=function(){return m.now()-h}}var g=1073741823,_=-1,v=250,y=5e3,b=1e4,x=g,S=[],C=[],w=1,T=null,E=u,D=!1,O=!1,k=!1,A=typeof setTimeout==`function`?setTimeout:null,j=typeof clearTimeout==`function`?clearTimeout:null,M=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ee(e){for(var t=r(C);t!==null;){if(t.callback===null)i(C);else if(t.startTime<=e)i(C),t.sortIndex=t.expirationTime,n(S,t);else return;t=r(C)}}function N(e){if(k=!1,ee(e),!O){if(r(S)!==null)O=!0,be(P);else{var t=r(C);t!==null&&xe(N,t.startTime-e)}}}function P(e,t){O=!1,k&&(k=!1,Se()),D=!0;var n=E;try{return F(e,t)}finally{T=null,E=n,D=!1}}function F(t,n){var a=n;for(ee(a),T=r(S);T!==null&&!(T.expirationTime>a&&(!t||pe()));){var o=T.callback;if(typeof o==`function`){T.callback=null,E=T.priorityLevel;var s=o(T.expirationTime<=a);a=e.unstable_now(),typeof s==`function`?T.callback=s:T===r(S)&&i(S),ee(a)}else i(S);T=r(S)}if(T!==null)return!0;var c=r(C);return c!==null&&xe(N,c.startTime-a),!1}function I(e,t){switch(e){case c:case l:case u:case d:case f:break;default:e=u}var n=E;E=e;try{return t()}finally{E=n}}function L(e){var t;switch(E){case c:case l:case u:t=u;break;default:t=E}var n=E;E=t;try{return e()}finally{E=n}}function te(e){var t=E;return function(){var n=E;E=t;try{return e.apply(this,arguments)}finally{E=n}}}function ne(t,i,a){var o=e.unstable_now(),s;if(typeof a==`object`&&a){var p=a.delay;s=typeof p==`number`&&p>0?o+p:o}else s=o;var m;switch(t){case c:m=_;break;case l:m=v;break;case f:m=x;break;case d:m=b;break;case u:default:m=y}var h=s+m,g={id:w++,callback:i,priorityLevel:t,startTime:s,expirationTime:h,sortIndex:-1};return s>o?(g.sortIndex=s,n(C,g),r(S)===null&&g===r(C)&&(k?Se():k=!0,xe(N,s-o))):(g.sortIndex=h,n(S,g),!O&&!D&&(O=!0,be(P))),g}function re(){}function ie(){!O&&!D&&(O=!0,be(P))}function ae(){return r(S)}function oe(e){e.callback=null}function se(){return E}var ce=!1,le=null,ue=-1,de=t,fe=-1;function pe(){return!(e.unstable_now()-fe<de)}function me(){}function he(e){if(e<0||e>125){console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`);return}de=e>0?Math.floor(1e3/e):t}var ge=function(){if(le!==null){var t=e.unstable_now();fe=t;var n=!0,r=!0;try{r=le(n,t)}finally{r?_e():(ce=!1,le=null)}}else ce=!1},_e;if(typeof M==`function`)_e=function(){M(ge)};else if(typeof MessageChannel<`u`){var ve=new MessageChannel,ye=ve.port2;ve.port1.onmessage=ge,_e=function(){ye.postMessage(null)}}else _e=function(){A(ge,0)};function be(e){le=e,ce||(ce=!0,_e())}function xe(t,n){ue=A(function(){t(e.unstable_now())},n)}function Se(){j(ue),ue=-1}var Ce=me;e.unstable_IdlePriority=f,e.unstable_ImmediatePriority=c,e.unstable_LowPriority=d,e.unstable_NormalPriority=u,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=l,e.unstable_cancelCallback=oe,e.unstable_continueExecution=ie,e.unstable_forceFrameRate=he,e.unstable_getCurrentPriorityLevel=se,e.unstable_getFirstCallbackNode=ae,e.unstable_next=L,e.unstable_pauseExecution=re,e.unstable_requestPaint=Ce,e.unstable_runWithPriority=I,e.unstable_scheduleCallback=ne,e.unstable_shouldYield=pe,e.unstable_wrapCallback=te,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),Ya=o(((e,t)=>{t.exports=process.env.NODE_ENV===`production`?qa():Ja()})),Xa=s({appendChild:()=>go,appendChildToContainer:()=>_o,appendInitialChild:()=>eo,cancelTimeout:()=>mo,clearContainer:()=>ko,commitMount:()=>Co,commitTextUpdate:()=>So,commitUpdate:()=>wo,createInstance:()=>to,createTextInstance:()=>no,detachDeletedInstance:()=>Ao,finalizeInitialChildren:()=>ro,getChildHostContext:()=>fo,getCurrentEventPriority:()=>jo,getPublicInstance:()=>U,getRootHostContext:()=>uo,hideInstance:()=>To,hideTextInstance:()=>Eo,idlePriority:()=>Za.unstable_IdlePriority,insertBefore:()=>vo,insertInContainerBefore:()=>yo,isPrimaryRenderer:()=>!1,noTimeout:()=>-1,now:()=>Za.unstable_now,prepareForCommit:()=>io,preparePortalMount:()=>ao,prepareUpdate:()=>oo,removeChild:()=>bo,removeChildFromContainer:()=>xo,resetAfterCommit:()=>so,resetTextContent:()=>co,run:()=>Za.unstable_runWithPriority,scheduleTimeout:()=>po,shouldDeprioritizeSubtree:()=>lo,shouldSetTextContent:()=>ho,supportsMutation:()=>!0,unhideInstance:()=>Do,unhideTextInstance:()=>Oo,warnsIfNotActing:()=>!0}),Za=Ya(),Qa={},$a={};Pa.default.Node.prototype._applyProps=Ga;function eo(e,t){if(typeof t==`string`){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),Ka(e)}function to(e,t,n){let r=Pa.default[e];r||=(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),Pa.default.Group);let i={},a={};for(var o in t)o.slice(0,2)===`on`?a[o]=t[o]:i[o]=t[o];let s=new r(i);return Ga(s,a),s}function no(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function ro(e,t,n){return!1}function U(e){return e}function io(){return null}function ao(){return null}function oo(e,t,n,r){return $a}function so(){}function co(e){}function lo(e,t){return!1}function uo(){return Qa}function fo(){return Qa}var po=setTimeout,mo=clearTimeout;function ho(e,t){return!1}function go(e,t){t.parent===e?t.moveToTop():e.add(t),Ka(e)}function _o(e,t){t.parent===e?t.moveToTop():e.add(t),Ka(e)}function vo(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),Ka(e)}function yo(e,t,n){vo(e,t,n)}function bo(e,t){t.destroy(),t.off(Ba),Ka(e)}function xo(e,t){t.destroy(),t.off(Ba),Ka(e)}function So(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function Co(e,t,n){}function wo(e,t,n,r,i){Ga(e,i,r)}function To(e){e.hide(),Ka(e)}function Eo(e){}function Do(e,t){(t.visible==null||t.visible)&&e.show()}function Oo(e,t){}function ko(e){}function Ao(){}var jo=()=>Fa.DefaultEventPriority,Mo=Object.defineProperty,No=Object.defineProperties,Po=Object.getOwnPropertyDescriptors,Fo=Object.getOwnPropertySymbols,Io=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable,Ro=(e,t,n)=>t in e?Mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zo=(e,t)=>{for(var n in t||={})Io.call(t,n)&&Ro(e,n,t[n]);if(Fo)for(var n of Fo(t))Lo.call(t,n)&&Ro(e,n,t[n]);return e},Bo=(e,t)=>No(e,Po(t));typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`)?d.useLayoutEffect:d.useEffect;function Vo(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){let e=Vo(r,t,n);if(e)return e;r=t?null:r.sibling}}function Ho(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}var Uo=console.error;console.error=function(){let e=[...arguments].join(``);if(e?.startsWith(`Warning:`)&&e.includes(`useContext`)){console.error=Uo;return}return Uo.apply(this,arguments)};var Wo=Ho(d.createContext(null)),Go=class extends d.Component{render(){return d.createElement(Wo.Provider,{value:this._reactInternals},this.props.children)}};function Ko(){let e=d.useContext(Wo);if(e===null)throw Error(`its-fine: useFiber must be called within a <FiberProvider />!`);let t=d.useId();return d.useMemo(()=>{for(let n of[e,e?.alternate]){if(!n)continue;let e=Vo(n,!1,e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}});if(e)return e}},[e,t])}function qo(){let e=Ko(),[t]=d.useState(()=>new Map);t.clear();let n=e;for(;n;){if(n.type&&typeof n.type==`object`){let e=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;e&&e!==Wo&&!t.has(e)&&t.set(e,d.useContext(Ho(e)))}n=n.return}return t}function Jo(){let e=qo();return d.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>d.createElement(t,null,d.createElement(n.Provider,Bo(zo({},r),{value:e.get(n)}))),e=>d.createElement(Go,zo({},e))),[e])}function Yo(e){let t=u.default.useRef({});return u.default.useLayoutEffect(()=>{t.current=e}),u.default.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}var Xo=e=>{let t=u.default.useRef(null),n=u.default.useRef(null),r=u.default.useRef(null),i=Yo(e),a=Jo(),o=t=>{let{forwardedRef:n}=e;n&&(typeof n==`function`?n(t):n.current=t)};return u.default.useLayoutEffect(()=>(n.current=new Pa.default.Stage({width:e.width,height:e.height,container:t.current}),o(n.current),r.current=ss.createContainer(n.current,Fa.LegacyRoot,!1,null),ss.updateContainer(u.default.createElement(a,{},e.children),r.current),()=>{Pa.default.isBrowser&&(o(null),ss.updateContainer(null,r.current,null),n.current.destroy())}),[]),u.default.useLayoutEffect(()=>{o(n.current),Ga(n.current,e,i),ss.updateContainer(u.default.createElement(a,{},e.children),r.current,null)}),u.default.createElement(`div`,{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},Zo=`Layer`,Qo=`Group`,$o=`Rect`,es=`Circle`,ts=`Ellipse`,ns=`Line`,rs=`Image`,is=`Text`,as=`Arrow`,os=`Transformer`,ss=(0,H.default)(Xa);ss.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:process.env.NODE_ENV===`production`?0:1,version:u.default.version,rendererPackageName:`react-konva`});var cs=u.default.forwardRef((e,t)=>u.default.createElement(Go,{},u.default.createElement(Xo,{...e,forwardedRef:t})));function ls({activeTool:e,baseStrokeWidth:t,displayMode:n,handleDragEnd:r,handleDragStart:i,isSelected:a,onShapeClick:o,onTransform:s,shape:c}){let l=(0,u.useRef)(),d=(0,u.useRef)();(0,u.useEffect)(()=>{d.current&&(d.current.nodes([l.current]),d.current.getLayer().batchDraw())},[a]);let f=()=>{o(c)};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)($o,{dashEnabled:n===qt.TARGET,draggable:e===`cursor`||e===`edit`,fill:c.fill,height:c.height,id:c.id,onClick:f,onDragEnd:r,onDragStart:i,onMousedown:f,onTransform:s,ref:l,scaleX:c.scaleX,scaleY:c.scaleY,stroke:c.stroke,strokeScaleEnabled:!1,strokeWidth:c.strokeWidth,width:c.width,x:c.x||0,y:c.y||0}),(0,p.jsx)(os,{ref:d,visible:e===`edit`&&a})]})}ls.propTypes={activeTool:f.default.string.isRequired,baseStrokeWidth:f.default.number.isRequired,displayMode:f.default.string.isRequired,handleDragEnd:f.default.func.isRequired,handleDragStart:f.default.func.isRequired,isSelected:f.default.bool.isRequired,onShapeClick:f.default.func.isRequired,onTransform:f.default.func.isRequired,shape:f.default.shape({fill:f.default.string,height:f.default.number,id:f.default.string,rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,stroke:f.default.string,strokeWidth:f.default.number,text:f.default.string,type:f.default.string,width:f.default.number,x:f.default.number,y:f.default.number}).isRequired};function us({activeTool:e,handleDragEnd:t,isSelected:n,onShapeClick:r,onTransform:i,shape:a,handleDragStart:o}){let s=(0,u.useRef)(),c=(0,u.useRef)();(0,u.useEffect)(()=>{c.current&&(c.current.nodes([s.current]),c.current.getLayer().batchDraw())},[n]);let l=()=>{r(a)};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ts,{draggable:e===`cursor`||e===`edit`,fill:a.fill,id:a.id,onClick:l,onDragEnd:t,onDragStart:o,onMousedown:l,onTransform:i,radiusX:a.width,radiusY:a.height,ref:s,rotation:a.rotation,scaleX:a.scaleX,scaleY:a.scaleY,stroke:a.stroke,strokeScaleEnabled:!1,strokeWidth:a.strokeWidth,x:a.x,y:a.y}),(0,p.jsx)(os,{ref:c,visible:e===`edit`&&n})]})}us.propTypes={activeTool:f.default.string.isRequired,baseStrokeWidth:f.default.number.isRequired,displayMode:f.default.string.isRequired,handleDragEnd:f.default.func.isRequired,handleDragStart:f.default.func.isRequired,isSelected:f.default.bool.isRequired,onShapeClick:f.default.func.isRequired,onTransform:f.default.func.isRequired,shape:f.default.shape({fill:f.default.string,height:f.default.number,id:f.default.string,rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,stroke:f.default.string,strokeWidth:f.default.number,type:f.default.string,url:f.default.string,width:f.default.number,x:f.default.number,y:f.default.number}).isRequired};function ds({shape:e,onShapeClick:t,activeTool:n,isSelected:r,onTransform:i,handleDragEnd:a,handleDragStart:o,text:s}){let c=(0,u.useRef)(),l=(0,u.useRef)(),d=()=>{t(e)};return(0,u.useEffect)(()=>{l.current&&(l.current.nodes([c.current]),l.current.getLayer().batchDraw())},[]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(is,{ref:c,scaleX:e.scaleX,scaleY:e.scaleY,rotation:e.rotation,x:e.x,y:e.y,fontSize:40,fill:e.fill,text:s,id:e.id,draggable:n===`cursor`||n===`edit`,onClick:d,onMousedown:d,onTransform:i,onDragEnd:a,onDragStart:o}),(0,p.jsx)(os,{ref:l,visible:n===`edit`&&r})]})}ds.propTypes={activeTool:f.default.string.isRequired,handleDragEnd:f.default.func.isRequired,handleDragStart:f.default.func.isRequired,isSelected:f.default.bool.isRequired,onShapeClick:f.default.func.isRequired,onTransform:f.default.func.isRequired,shape:f.default.shape({fill:f.default.string,height:f.default.number,id:f.default.string,rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,stroke:f.default.string,strokeWidth:f.default.number,text:f.default.string,type:f.default.string,width:f.default.number,x:f.default.number,y:f.default.number}).isRequired,text:f.default.string.isRequired};function fs({onShapeClick:e,shape:t,activeTool:n,isSelected:r,onTransform:i,handleDragEnd:a,handleDragStart:o}){let s=(0,u.useRef)(),c=(0,u.useRef)();(0,u.useEffect)(()=>{c.current&&(c.current.nodes([s.current]),c.current.getLayer().batchDraw())},[r]);let l=()=>{e(t)};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(as,{ref:s,fill:t.fill,scaleX:t.scaleX,scaleY:t.scaleY,rotation:t.rotation,x:t.x,y:t.y,stroke:t.stroke,strokeWidth:t.strokeWidth,points:t.points,id:t.id,draggable:n===`cursor`||n===`edit`,onClick:l,onMousedown:l,pointerLength:t.pointerLength,pointerWidth:t.pointerWidth,onTransform:i,onDragEnd:a,onDragStart:o}),(0,p.jsx)(os,{ref:c,visible:n===`edit`&&r})]})}fs.propTypes={activeTool:f.default.string.isRequired,handleDragEnd:f.default.func.isRequired,isSelected:f.default.bool.isRequired,onShapeClick:f.default.func.isRequired,onTransform:f.default.func.isRequired,shape:f.default.shape({fill:f.default.string,id:f.default.string,pointerLength:f.default.number,pointerWidth:f.default.number,points:f.default.arrayOf(f.default.number),rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,stroke:f.default.string,strokeWidth:f.default.number,type:f.default.string,url:f.default.string,x:f.default.number,y:f.default.number}).isRequired};function ps({activeTool:e,handleDragEnd:t,handleDragStart:n,isSelected:r,onShapeClick:i,onTransform:a,shape:o}){let s=(0,u.useRef)(),c=(0,u.useRef)();(0,u.useEffect)(()=>{c.current&&(c.current.nodes([s.current]),c.current.getLayer().batchDraw())},[r,o]);let l=()=>{i(o)};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ns,{closed:o.closed||!1,draggable:e===`cursor`||e===`edit`,fill:o.fill,globalCompositeOperation:`source-over`,id:o.id,lineCap:`round`,lineJoin:`round`,onClick:l,onDragEnd:t,onDragStart:n,onMousedown:l,onTransform:a,points:o.points,ref:s,rotation:o.rotation,scaleX:o.scaleX,scaleY:o.scaleY,stroke:o.stroke,strokeScaleEnabled:!1,strokeWidth:o.strokeWidth,x:o.x,y:o.y}),(0,p.jsx)(os,{ref:c,visible:e===`edit`&&r})]})}ps.propTypes={activeTool:f.default.string.isRequired,baseStrokeWidth:f.default.number.isRequired,displayMode:f.default.string.isRequired,handleDragEnd:f.default.func.isRequired,handleDragStart:f.default.func.isRequired,isSelected:f.default.bool.isRequired,onShapeClick:f.default.func.isRequired,onTransform:f.default.func.isRequired,shape:f.default.shape({fill:f.default.string,id:f.default.string,points:f.default.arrayOf(f.default.number),rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,stroke:f.default.string,strokeWidth:f.default.number,type:f.default.string,url:f.default.string,x:f.default.number,y:f.default.number}).isRequired};function ms({activeTool:e,onShapeClick:t,isSelected:n,shape:r,onTransform:i,handleDragEnd:a,handleDragStart:o}){let s=(0,u.useRef)(),c=(0,u.useRef)();(0,u.useEffect)(()=>{c.current&&(c.current.nodes([s.current]),c.current.getLayer().batchDraw())},[n,r]);let l=()=>{t(r)};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Qo,{ref:s,onClick:l,onMousedown:l,onTransform:i,scaleX:r.scaleX,scaleY:r.scaleY,rotation:r.rotation,x:r.x,y:r.y,width:r.width||1920,height:r.height||1080,draggable:e===`cursor`||e===`edit`,onDragEnd:a,onDragStart:o,id:r.id,children:r.lines.map(e=>(0,p.jsx)(ns,{fill:r.stroke,points:e.points,stroke:r.stroke,strokeWidth:r.strokeWidth,tension:.5,lineCap:`round`,lineJoin:`round`},e.points.join(`,`)))}),(0,p.jsx)(os,{ref:c,visible:e===`edit`&&n})]})}ms.propTypes={activeTool:f.default.string.isRequired,handleDragEnd:f.default.func.isRequired,handleDragStart:f.default.func.isRequired,isSelected:f.default.bool.isRequired,onShapeClick:f.default.func.isRequired,onTransform:f.default.func.isRequired,shape:f.default.shape({fill:f.default.string,height:f.default.number,id:f.default.string,lines:f.default.arrayOf({points:f.default.arrayOf(f.number),stroke:f.default.string,strokeWidth:f.default.number,x:f.default.number,y:f.default.number}),rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,stroke:f.default.string,strokeWidth:f.default.number,type:f.default.string,width:f.default.number,x:f.default.number,y:f.default.number}).isRequired};function hs({activeTool:e,displayMode:t,handleDragEnd:n,handleDragStart:r,isSelected:i,onShapeClick:a,onTransform:o,shape:s}){let c=(0,u.useRef)(null),l=(0,u.useRef)(null),[d,f]=(0,u.useState)(null);(0,u.useEffect)(()=>{i&&l.current&&c.current&&(l.current.nodes([c.current]),l.current.getLayer().batchDraw())},[i,d]),(0,u.useEffect)(()=>{let e=new window.Image;e.src=s.url,e.onload=()=>{f(e)}},[s.url]);let m=()=>{a(s)};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(rs,{ref:c,scaleX:s.scaleX,scaleY:s.scaleY,rotation:s.rotation,x:s.x,y:s.y,image:d,id:s.id,draggable:e===`cursor`||e===`edit`,onClick:m,onMousedown:m,onTransform:o,onDragEnd:n,onDragStart:r}),i&&(0,p.jsx)(`Transformer`,{rotateEnabled:t!==`image`,ref:l,visible:e===`edit`})]})}hs.propTypes={activeTool:f.default.string.isRequired,displayMode:f.default.string.isRequired,handleDragEnd:f.default.func.isRequired,handleDragStart:f.default.func.isRequired,isSelected:f.default.bool.isRequired,onShapeClick:f.default.func.isRequired,onTransform:f.default.func.isRequired,shape:f.default.shape({fill:f.default.string,height:f.default.number,id:f.default.string,lines:f.default.arrayOf({points:f.default.arrayOf(f.number),stroke:f.default.string,strokeWidth:f.default.number,x:f.default.number,y:f.default.number}),rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,stroke:f.default.string,strokeWidth:f.default.number,type:f.default.string,url:f.default.string,width:f.default.number,x:f.default.number,y:f.default.number}).isRequired};function gs({activeTool:e,handleDragEnd:t,handleDragStart:n,isSelected:r,onShapeClick:i,onTransform:a,shape:o}){let s=(0,u.useRef)(),c=(0,u.useRef)();(0,u.useEffect)(()=>{c.current&&(c.current.nodes([s.current]),c.current.getLayer().batchDraw())},[r]);let l=()=>{i(o)};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(es,{draggable:e===`cursor`||e===`edit`,fill:o.fill,id:o.id,onClick:l,onDragEnd:t,onDragStart:n,onMousedown:l,onTransform:a,radius:o.radius,ref:s,rotation:o.rotation,scaleX:o.scaleX,scaleY:o.scaleY,stroke:o.stroke,strokeScaleEnabled:!1,strokeWidth:o.strokeWidth,x:o.x,y:o.y}),(0,p.jsx)(os,{ref:c,visible:e===`edit`&&r})]})}gs.propTypes={activeTool:f.default.string.isRequired,baseStrokeWidth:f.default.number.isRequired,displayMode:f.default.string.isRequired,handleDragEnd:f.default.func.isRequired,handleDragStart:f.default.func.isRequired,isSelected:f.default.bool.isRequired,onShapeClick:f.default.func.isRequired,onTransform:f.default.func.isRequired,shape:f.default.shape({fill:f.default.string,height:f.default.number,id:f.default.string,radius:f.default.number,rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,stroke:f.default.string,strokeWidth:f.default.number,type:f.default.string,url:f.default.string,width:f.default.number,x:f.default.number,y:f.default.number}).isRequired};function _s({handleDragEnd:e,handleDragStart:t,onShapeClick:n,shape:r}){let i=()=>{n(r)};return(0,p.jsx)(es,{draggable:!0,fill:r.fill,id:r.id,onClick:i,onDragEnd:e,onDragStart:t,onMousedown:i,radius:r.radius,rotation:r.rotation,scaleX:r.scaleX,scaleY:r.scaleY,stroke:r.stroke,strokeScaleEnabled:!1,strokeWidth:r.strokeWidth,x:r.x,y:r.y})}_s.propTypes={handleDragEnd:f.default.func.isRequired,handleDragStart:f.default.func.isRequired,onShapeClick:f.default.func.isRequired,shape:f.default.shape({fill:f.default.string,id:f.default.string,radius:f.default.number,rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,stroke:f.default.string,strokeWidth:f.default.number,x:f.default.number,y:f.default.number}).isRequired};function vs({activeTool:e,baseStrokeWidth:t,displayMode:n,handleDragEnd:r,handleDragStart:i,onShapeClick:a,onTransform:o,scale:s,selectedShapeId:c,shapes:l,trview:d}){let[f,m]=(0,u.useState)(null);(0,u.useEffect)(()=>{},[l,c]),(0,u.useEffect)(()=>{},[f]);let h=e=>{a(e),m(e)};return(0,p.jsx)(Zo,{scaleX:s,scaleY:s,children:l.map(a=>{let s=c===a.id&&d;switch(a.type){case z.RECTANGLE:return(0,u.createElement)(ls,{activeTool:e,displayMode:n,handleDragEnd:r,handleDragStart:i,isSelected:s,onShapeClick:h,onTransform:o,shape:a,key:a.id,displayMode:n,baseStrokeWidth:t});case`text`:return(0,u.createElement)(ds,{activeTool:e,handleDragEnd:r,handleDragStart:i,isSelected:s,onShapeClick:h,onTransform:o,shape:a,text:a.text,key:a.id});case z.ELLIPSE:return(0,u.createElement)(us,{activeTool:e,handleDragEnd:r,handleDragStart:i,isSelected:s,onShapeClick:h,onTransform:o,shape:a,key:a.id,displayMode:n,baseStrokeWidth:t});case z.CIRCLE:return(0,u.createElement)(gs,{activeTool:e,handleDragEnd:r,handleDragStart:i,isSelected:s,onShapeClick:h,onTransform:o,shape:a,key:a.id,displayMode:n,baseStrokeWidth:t});case z.POI:return(0,u.createElement)(_s,{handleDragEnd:r,handleDragStart:i,onShapeClick:h,shape:a,key:a.id});case z.FREEHAND:return(0,u.createElement)(ms,{activeTool:e,handleDragEnd:r,handleDragStart:i,isSelected:s,onShapeClick:h,onTransform:o,shape:a,key:a.id});case z.POLYGON:return(0,u.createElement)(ps,{activeTool:e,handleDragEnd:r,handleDragStart:i,isSelected:s,onShapeClick:h,onTransform:o,shape:a,key:a.id,displayMode:n,baseStrokeWidth:t});case z.ARROW:return(0,u.createElement)(fs,{activeTool:e,handleDragEnd:r,handleDragStart:i,isSelected:s,onShapeClick:h,onTransform:o,shape:a,key:a.id});case Jt.IMAGE:return(0,u.createElement)(hs,{activeTool:e,displayMode:n,handleDragEnd:r,handleDragStart:i,isSelected:s,onShapeClick:h,onTransform:o,shape:a,key:a.id})}})})}vs.propTypes={activeTool:f.default.string.isRequired,baseStrokeWidth:f.default.number.isRequired,displayMode:f.default.string.isRequired,handleDragEnd:f.default.func.isRequired,handleDragStart:f.default.func.isRequired,onShapeClick:f.default.func.isRequired,onTransform:f.default.func.isRequired,scale:f.default.number.isRequired,selectedShapeId:f.default.string.isRequired,shapes:f.default.arrayOf(f.default.shape({id:f.default.string,rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,type:f.default.string,url:f.default.string,x:f.default.number,y:f.default.number})).isRequired,trview:f.default.bool.isRequired};function ys({displayMode:e,drawingState:t,playerReferences:n,scale:r,setColorToolFromCurrentShape:i,setDrawingState:a,setToolState:o,tabView:s,toolState:c,updateCurrentShapeInShapes:l,updateScale:d,windowId:f}){let[m,h]=(0,u.useState)(!1),[g,_]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let e=n.media?.current;if(e&&typeof e.addHandler==`function`){let t=()=>d();return e.addHandler(`animation`,t),e.addHandler(`resize`,t),d(),()=>{e.removeHandler(`animation`,t),e.removeHandler(`resize`,t)}}d()},[n,d]),(0,u.useEffect)(()=>{if(c.imageEvent?.id&&!t.currentShape){let e={id:Ft(),rotation:0,scaleX:.2,scaleY:.2,type:Jt.IMAGE,url:c.imageEvent.id,x:60,y:60};a({...t,currentShape:e,shapes:[...t.shapes,e]})}h(!1)},[c]);let v=e=>{if(e.stopPropagation(),t.currentShape){if(e.key===`Delete`||e.key===`Backspace`){let e=t.shapes.filter(e=>e.id!==t.currentShape.id);a({...t,currentShape:null,shapes:e}),o({...c,imageEvent:null});return}if(e.key===`Tab`){if(c.activeTool===Jt.IMAGE)return;c.activeTool===z.POLYGON&&(t.currentShape.points.splice(-2,2),l({points:[t.currentShape.points],...t.currentShape})),a({...t,currentShape:null,isDrawing:!1});return}if(e.key===`Shift`){if(c.activeTool===z.POLYGON&&t.isDrawing){t.currentShape.points.splice(-2,2);let e={...t.currentShape,closed:!0};l(e),a({...t,currentShape:e,isDrawing:!1}),h(!1)}return}if(t.currentShape.type===`text`){let e={...t.currentShape};a(t=>({...t,currentShape:e,shapes:t.shapes.map(t=>t.id===e.id?{...t,...e}:t)}))}}};(0,u.useEffect)(()=>{if(!m){let e=t[t.shapes.length-1];e&&l(e)}},[t]),(0,u.useEffect)(()=>{t.currentShape&&e!==qt.TARGET&&e!==qt.POI&&(t.currentShape.fill=c.fillColor,t.currentShape.stroke=c.strokeColor,t.currentShape.strokeWidth=c.strokeWidth,t.currentShape.text=c.text,l(t.currentShape))},[c]),(0,u.useLayoutEffect)(()=>{if(t.shapes.find(e=>e.id===t.currentShape?.id))return window.addEventListener(`keydown`,v),i({fillColor:t.currentShape.fill,strokeColor:t.currentShape.stroke,strokeWidth:t.currentShape.strokeWidth,text:t.currentShape.text}),()=>{window.removeEventListener(`keydown`,v)}},[t.currentShape]);let y=async e=>{if(c.activeTool!==`edit`&&c.activeTool!==`cursor`&&c.activeTool!==`delete`)return;let n=t.shapes.find(t=>t.id===e.id);if(c.activeTool===`delete`){let e=t.shapes.filter(e=>e.id!==n.id);a({...t,currentShape:null,shapes:e});return}a({...t,currentShape:n}),i({fillColor:n.fill,strokeColor:n.stroke,strokeWidth:n.strokeWidth})},b=e=>{let n=e.target.attrs,r=t.shapes.find(e=>e.id===n.id);Object.assign(r,n),r.type===Jt.IMAGE&&(r.width=n.image.width*n.scaleX,r.height=n.image.height*n.scaleY),l(r),g||_(!0)},x=e=>{let n=e.currentTarget.attrs,r=t.shapes.find(e=>e.id===n.id);Object.assign(r,n),r.x=n.x,r.y=n.y,r.type===z.IMAGE&&(r.width=n.image.width*n.scaleX,r.height=n.image.height*n.scaleY)},S=e=>{let n=e.currentTarget.attrs;a({...t,currentShape:t.shapes.find(e=>e.id===n.id)})},C=e=>[z.RECTANGLE,z.CIRCLE,z.ELLIPSE,z.POLYGON,z.ARROW,z.FREEHAND,z.POI].includes(e)?`crosshair`:`default`,w=e=>{try{let i=e.target.getStage(),o=i.getRelativePointerPosition();o.x/=r,o.y/=r;let s=null;switch(c.activeTool){case z.POI:if(e.target!==i)break;s={...Yt,id:Ft(),radius:Xt(n.getMediaTrueWidth(),n.getMediaTrueHeight()),rotation:0,scaleX:1,scaleY:1,type:c.activeTool,x:o.x,y:o.y},a({currentShape:s,isDrawing:!1,shapes:[s]});break;case z.RECTANGLE:s={fill:c.fillColor,height:30,id:Ft(),scaleX:1,scaleY:1,stroke:c.strokeColor,strokeWidth:c.strokeWidth,type:c.activeTool,width:30,x:o.x,y:o.y},a({currentShape:s,isDrawing:!0,shapes:[...t.shapes,s]});break;case z.ELLIPSE:s={fill:c.fillColor,height:1,id:Ft(),radiusX:1,radiusY:1,rotation:0,scaleX:1,scaleY:1,stroke:c.strokeColor,strokeWidth:c.strokeWidth,type:c.activeTool,width:1,x:o.x,y:o.y},a({currentShape:s,isDrawing:!0,shapes:[...t.shapes,s]});break;case z.CIRCLE:s={fill:c.fillColor,height:1,id:Ft(),radius:1,rotation:0,scaleX:1,scaleY:1,stroke:c.strokeColor,strokeWidth:c.strokeWidth,type:c.activeTool,width:1,x:o.x,y:o.y},a({currentShape:s,isDrawing:!0,shapes:[...t.shapes,s]});break;case Jt.TEXT:s={fill:c.fillColor,fontSize:20,id:Ft(),rotation:0,scaleX:1,scaleY:1,text:`Change me`,type:Jt.TEXT,x:o.x,y:o.y},a({...t,currentShape:s,shapes:[...t.shapes,s]});break;case z.FREEHAND:s={fill:c.fillColor,id:Ft(),lines:[{points:[o.x,o.y,o.x,o.y],stroke:c.strokeColor,strokeWidth:c.strokeWidth,x:0,y:0}],rotation:0,scaleX:1,scaleY:1,stroke:c.strokeColor,strokeWidth:c.strokeWidth,type:z.FREEHAND,x:0,y:0},a({currentShape:s,isDrawing:!0,shapes:[...t.shapes,s]});break;case z.POLYGON:if(t.isDrawing){let e=t.currentShape.points[0],n=t.currentShape.points[1],i=15/r;if(Math.sqrt((o.x-e)**2+(o.y-n)**2)<=i&&t.currentShape.points.length>6){let e={...t.currentShape,closed:!0};e.points.splice(-2,2),l(e),a({...t,currentShape:e,isDrawing:!1}),h(!1);break}t.currentShape.points.splice(-2,2,o.x,o.y),t.currentShape.points.push(o.x,o.y),l({points:[t.currentShape.points],...t.currentShape})}else s={fill:c.fillColor,id:Ft(),points:[o.x,o.y,o.x,o.y],rotation:0,scaleX:1,scaleY:1,stroke:c.strokeColor,strokeWidth:c.strokeWidth,type:z.POLYGON,x:0,y:0},a({currentShape:s,isDrawing:!0,shapes:[...t.shapes,s]}),h(!0);break;case z.ARROW:s={fill:c.fillColor,id:Ft(),pointerLength:20,pointerWidth:20,points:[o.x,o.y,o.x,o.y],rotation:0,scaleX:1,scaleY:1,stroke:c.strokeColor,strokeWidth:c.strokeWidth,type:z.ARROW},a({currentShape:s,isDrawing:!0,shapes:[...t.shapes,s]})}}catch(e){console.error(`error`,e)}},T=e=>{try{if(!t.isDrawing||!t.currentShape)return;let n=e.target.getStage().getRelativePointerPosition();switch(n.x/=r,n.y/=r,c.activeTool){case z.RECTANGLE:l({...t.currentShape,height:n.y-t.currentShape.y,width:n.x-t.currentShape.x});break;case z.ELLIPSE:n.x<t.currentShape.x&&(n.x=t.currentShape.x),n.y<t.currentShape.y&&(n.y=t.currentShape.y),l({...t.currentShape,height:n.y-t.currentShape.y,radiusX:(n.x-t.currentShape.x)/2,radiusY:(n.y-t.currentShape.y)/2,width:n.x-t.currentShape.x});break;case z.CIRCLE:n.x<t.currentShape.x&&(n.x=t.currentShape.x),n.y<t.currentShape.y&&(n.y=t.currentShape.y);let e=Math.sqrt((n.x-t.currentShape.x)**2+(n.y-t.currentShape.y)**2);l({...t.currentShape,radius:e});break;case z.FREEHAND:t.lines.push({points:[n.x,n.y,n.x,n.y],stroke:c.strokeColor,strokeWidth:c.strokeWidth}),l({...t.currentShape});break;case z.POLYGON:t.currentShape.points.splice(-2,2,n.x,n.y),l({...t.currentShape});break;case z.ARROW:l({...t.currentShape,fill:c.fillColor,points:[t.currentShape.points[0],t.currentShape.points[1],n.x,n.y],stroke:c.strokeColor,strokeWidth:c.strokeWidth}),h(!0)}}catch(e){console.error(`error`,e)}},E=e=>{if(t.currentShape&&!g){let n=e.target.getStage();if(e.target===n){let e=t.currentShape.type;o(t=>({...t,activeTool:e}))}}c.activeTool!==z.POLYGON&&(a({...t,isDrawing:!1}),[z.RECTANGLE,z.CIRCLE,z.ELLIPSE].includes(c.activeTool)&&o({...c,activeTool:Jt.EDIT})),_(!1)},D=()=>(0,p.jsx)(cs,{width:n.getDisplayedMediaWidth(),height:n.getDisplayedMediaHeight(),style:{cursor:C(c.activeTool),height:`auto`,left:n.getImagePosition().x,objectFit:`contain`,overflow:`clip`,overflowClipMargin:`content-box`,position:`absolute`,top:n.getImagePosition().y},onMouseDown:w,onMouseUp:E,onMouseMove:T,id:f,children:(0,p.jsx)(vs,{activeTool:c.activeTool,baseStrokeWidth:n.getTargetStrokeWidth(),displayMode:e,handleDragEnd:x,handleDragStart:S,onShapeClick:y,onTransform:b,scale:r,selectedShapeId:t.currentShape?.id,shapes:t.shapes,trview:s!==`target`})}),O=n.getContainer();return O?ee.default.createPortal(D(),O):(0,p.jsx)(p.Fragment,{})}var bs=f.default.shape({fill:f.default.string,id:f.default.string,lines:{pointerLength:f.default.number,points:f.default.arrayOf([f.default.number]),stroke:f.default.string,strokeWidth:f.default.number},pointerLength:f.default.number,pointerWidth:f.default.number,points:f.default.number,rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,stroke:f.default.string,strokeWidth:f.default.number,text:f.default.string,type:f.default.string,url:f.default.string,x:f.default.number,y:f.default.number});ys.propTypes={displayMode:f.default.string.isRequired,drawingState:f.default.oneOfType([f.default.shape({currentShape:bs,isDrawing:f.default.bool,shapes:f.default.arrayOf(bs)}),f.default.arrayOf(f.default.shape({currentShape:f.default.shape({id:f.default.string,rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,type:f.default.string,url:f.default.string,x:f.default.number,y:f.default.number}),isDrawing:f.default.bool,shapes:f.default.arrayOf(f.default.shape({id:f.default.string,rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,type:f.default.string,url:f.default.string,x:f.default.number,y:f.default.number}))}))]).isRequired,playerReferences:f.default.object.isRequired,scale:f.default.number.isRequired,setColorToolFromCurrentShape:f.default.func.isRequired,setDrawingState:f.default.func.isRequired,setToolState:f.default.func.isRequired,tabView:f.default.string.isRequired,toolState:f.default.oneOfType([f.default.string,f.default.number]).isRequired,updateCurrentShapeInShapes:f.default.func.isRequired,updateScale:f.default.func.isRequired,windowId:f.default.string.isRequired};var xs=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M5 4v3h5.5v12h3V7H19V4z`}),`Title`),Ss=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z`}),`Image`),Cs=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z`}),`Delete`),ws=(0,F.createSvgIcon)([(0,p.jsx)(`path`,{d:`m12 2-5.5 9h11z`},`0`),(0,p.jsx)(`circle`,{cx:`17.5`,cy:`17.5`,r:`4.5`},`1`),(0,p.jsx)(`path`,{d:`M3 13.5h8v8H3z`},`2`)],`Category`);function Ts(e){return(0,p.jsx)(N.default,{...e,children:(0,p.jsx)(`svg`,{version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,x:`0px`,y:`0px`,viewBox:`1064.7701 445.5539 419.8101 717.0565`,enableBackground:`new 1064.7701 445.5539 419.8101 717.0565`,xmlSpace:`preserve`,children:(0,p.jsx)(`polygon`,{fill:`#231F20`,points:`1283.1857,1127.3097 1406.1421,1077.6322 1314.2406,850.1678 1463.913,852.7823 1093.4828,480.8547 1085.4374,1005.6964 1191.2842,899.8454 `})})})}var Es=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2`}),`CheckBoxOutlineBlank`),Ds=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8`}),`RadioButtonUnchecked`),Os=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z`}),`ArrowOutward`),ks=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M23 8c0 1.1-.9 2-2 2-.18 0-.35-.02-.51-.07l-3.56 3.55c.05.16.07.34.07.52 0 1.1-.9 2-2 2s-2-.9-2-2c0-.18.02-.36.07-.52l-2.55-2.55c-.16.05-.34.07-.52.07s-.36-.02-.52-.07l-4.55 4.56c.05.16.07.33.07.51 0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.18 0 .35.02.51.07l4.56-4.55C8.02 9.36 8 9.18 8 9c0-1.1.9-2 2-2s2 .9 2 2c0 .18-.02.36-.07.52l2.55 2.55c.16-.05.34-.07.52-.07s.36.02.52.07l3.55-3.56C19.02 8.35 19 8.18 19 8c0-1.1.9-2 2-2s2 .9 2 2`}),`Timeline`),As=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99 0-2h3V2h2v3h3v2zm-3 4V8h-3V5H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8zM5 19l3-4 2 3 3-4 4 5z`}),`AddPhotoAlternate`),js=(0,h.styled)(`div`)(({theme:e})=>({display:`flex`,justifyContent:`flex-end`,marginTop:`5px`})),Ms=(0,h.styled)(`div`)(({theme:e})=>({alignItems:`center`,display:`flex`,flexDirection:`column`,justifyContent:`center`})),Ns=(0,h.styled)(h.TextField)(({theme:e})=>({marginBottom:`0`,marginTop:`0`}));function Ps({imageUrl:e=null,isReadOnly:t,onAddImage:n,onChange:r,t:i}){let a=(0,u.useRef)(null),[o,s]=(0,u.useState)(!1),c=e===null?``:e;return(0,u.useEffect)(()=>{a.current?s(e&&a.current.checkValidity()):s(!!e)},[e]),(0,p.jsx)(Ms,{children:t?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(w.default,{children:i(`onlyOneImageAllowed`)}),o&&(0,p.jsx)(`img`,{src:e,width:`100%`,height:`auto`,alt:i(`loading_failed`)})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(w.default,{variant:`overline`,children:i(`add_image_from_url`)}),(0,p.jsx)(Ns,{value:c,onChange:e=>r(e.target.value),error:c!==``&&!o,margin:`dense`,label:i(`imageURL`),type:`url`,fullWidth:!0,inputRef:a}),o&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`img`,{src:e,width:`100%`,height:`auto`,alt:i(`loading_failed`)}),(0,p.jsx)(js,{children:(0,p.jsx)(h.Button,{variant:`contained`,onClick:n,children:(0,p.jsx)(As,{})})})]})]})})}Ps.propTypes={imageUrl:f.default.string,isReadOnly:f.default.bool.isRequired,onAddImage:f.default.func.isRequired,onChange:f.default.func.isRequired,t:f.default.func.isRequired};var Fs=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M22 24H2v-4h20zM13.06 5.19l3.75 3.75L7.75 18H4v-3.75zm4.82 2.68-3.75-3.75 1.83-1.83c.39-.39 1.02-.39 1.41 0l2.34 2.34c.39.39.39 1.02 0 1.41z`}),`BorderColor`),Is=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`m7 10 5 5 5-5z`}),`ArrowDropDown`),Ls=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M3 17h18v-2H3zm0 3h18v-1H3zm0-7h18v-3H3zm0-9v4h18V4z`}),`LineWeight`),Rs=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z`}),`FormatColorFill`),zs=o(((e,t)=>{var n=$e(),r=rt(),i=et(),a=`[object String]`;function o(e){return typeof e==`string`||!r(e)&&i(e)&&n(e)==a}t.exports=o})),Bs=o(((e,t)=>{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),Vs=o(((e,t)=>{t.exports=Bs()()})),Hs=o(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),Us=o(((e,t)=>{function n(){return!1}t.exports=n})),Ws=o(((e,t)=>{var n=Ye(),r=Us(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),Gs=o(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;function r(e,t){var r=typeof e;return t??=9007199254740991,!!t&&(r==`number`||r!=`symbol`&&n.test(e))&&e>-1&&e%1==0&&e<t}t.exports=r})),Ks=o(((e,t)=>{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),qs=o(((e,t)=>{var n=$e(),r=Ks(),i=et(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),Js=o(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),Ys=o(((e,t)=>{var n=Je(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),Xs=o(((e,t)=>{var n=qs(),r=Js(),i=Ys(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),Zs=o(((e,t)=>{var n=Hs(),r=nt(),i=rt(),a=Ws(),o=Gs(),s=Xs(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),Qs=o(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),$s=o(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),ec=o(((e,t)=>{t.exports=$s()(Object.keys,Object)})),tc=o(((e,t)=>{var n=Qs(),r=ec(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),nc=o(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),rc=o(((e,t)=>{var n=$e(),r=nc(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),ic=o(((e,t)=>{var n=rc(),r=Ks();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),ac=o(((e,t)=>{var n=Zs(),r=tc(),i=ic();function a(e){return i(e)?n(e):r(e)}t.exports=a})),oc=o(((e,t)=>{var n=Vs(),r=ac();function i(e,t){return e&&n(e,t,r)}t.exports=i})),sc=o(((e,t)=>{function n(e){return e}t.exports=n})),cc=o(((e,t)=>{var n=sc();function r(e){return typeof e==`function`?e:n}t.exports=r})),lc=o(((e,t)=>{var n=oc(),r=cc();function i(e,t){return e&&n(e,r(t))}t.exports=i})),uc=o(((e,t)=>{t.exports=$s()(Object.getPrototypeOf,Object)})),dc=o(((e,t)=>{var n=$e(),r=uc(),i=et(),a=`[object Object]`,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=c.call(Object);function d(e){if(!i(e)||n(e)!=a)return!1;var t=r(e);if(t===null)return!0;var o=l.call(t,`constructor`)&&t.constructor;return typeof o==`function`&&o instanceof o&&c.call(o)==u}t.exports=d})),fc=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),pc=o(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),mc=o(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),hc=o(((e,t)=>{var n=mc();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),gc=o(((e,t)=>{var n=hc(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),_c=o(((e,t)=>{var n=hc();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),vc=o(((e,t)=>{var n=hc();function r(e){return n(this.__data__,e)>-1}t.exports=r})),yc=o(((e,t)=>{var n=hc();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),bc=o(((e,t)=>{var n=pc(),r=gc(),i=_c(),a=vc(),o=yc();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),xc=o(((e,t)=>{var n=bc();function r(){this.__data__=new n,this.size=0}t.exports=r})),Sc=o(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),Cc=o(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),wc=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Tc=o(((e,t)=>{t.exports=Ye()[`__core-js_shared__`]})),Ec=o(((e,t)=>{var n=Tc(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),Dc=o(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),Oc=o(((e,t)=>{var n=rc(),r=Ec(),i=nc(),a=Dc(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),kc=o(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),Ac=o(((e,t)=>{var n=Oc(),r=kc();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),jc=o(((e,t)=>{t.exports=Ac()(Ye(),`Map`)})),Mc=o(((e,t)=>{t.exports=Ac()(Object,`create`)})),Nc=o(((e,t)=>{var n=Mc();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Pc=o(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),Fc=o(((e,t)=>{var n=Mc(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Ic=o(((e,t)=>{var n=Mc(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Lc=o(((e,t)=>{var n=Mc(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),Rc=o(((e,t)=>{var n=Nc(),r=Pc(),i=Fc(),a=Ic(),o=Lc();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),zc=o(((e,t)=>{var n=Rc(),r=bc(),i=jc();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Bc=o(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Vc=o(((e,t)=>{var n=Bc();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Hc=o(((e,t)=>{var n=Vc();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),Uc=o(((e,t)=>{var n=Vc();function r(e){return n(this,e).get(e)}t.exports=r})),Wc=o(((e,t)=>{var n=Vc();function r(e){return n(this,e).has(e)}t.exports=r})),Gc=o(((e,t)=>{var n=Vc();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),Kc=o(((e,t)=>{var n=zc(),r=Hc(),i=Uc(),a=Wc(),o=Gc();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),qc=o(((e,t)=>{var n=bc(),r=jc(),i=Kc(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),Jc=o(((e,t)=>{var n=bc(),r=xc(),i=Sc(),a=Cc(),o=wc(),s=qc();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),Yc=o(((e,t)=>{function n(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this}t.exports=n})),Xc=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Zc=o(((e,t)=>{var n=Kc(),r=Yc(),i=Xc();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),Qc=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),$c=o(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),el=o(((e,t)=>{var n=Zc(),r=Qc(),i=$c(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),tl=o(((e,t)=>{t.exports=Ye().Uint8Array})),nl=o(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),rl=o(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),il=o(((e,t)=>{var n=Xe(),r=tl(),i=mc(),a=el(),o=nl(),s=rl(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),al=o(((e,t)=>{var n=qe(),r=rt();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),ol=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),sl=o(((e,t)=>{function n(){return[]}t.exports=n})),cl=o(((e,t)=>{var n=ol(),r=sl(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),ll=o(((e,t)=>{var n=al(),r=cl(),i=ac();function a(e){return n(e,i,r)}t.exports=a})),ul=o(((e,t)=>{var n=ll(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),dl=o(((e,t)=>{t.exports=Ac()(Ye(),`DataView`)})),fl=o(((e,t)=>{t.exports=Ac()(Ye(),`Promise`)})),pl=o(((e,t)=>{t.exports=Ac()(Ye(),`Set`)})),ml=o(((e,t)=>{t.exports=Ac()(Ye(),`WeakMap`)})),hl=o(((e,t)=>{var n=dl(),r=jc(),i=fl(),a=pl(),o=ml(),s=$e(),c=Dc(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),gl=o(((e,t)=>{var n=Jc(),r=el(),i=il(),a=ul(),o=hl(),s=rt(),c=Ws(),l=Xs(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),_l=o(((e,t)=>{var n=gl(),r=et();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),vl=o(((e,t)=>{var n=Jc(),r=_l(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),yl=o(((e,t)=>{var n=nc();function r(e){return e===e&&!n(e)}t.exports=r})),bl=o(((e,t)=>{var n=yl(),r=ac();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),xl=o(((e,t)=>{function n(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),Sl=o(((e,t)=>{var n=vl(),r=bl(),i=xl();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),Cl=o(((e,t)=>{var n=$e(),r=et(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),wl=o(((e,t)=>{var n=rt(),r=Cl(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),Tl=o(((e,t)=>{var n=Kc(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),El=o(((e,t)=>{var n=Tl(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),Dl=o(((e,t)=>{var n=El(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),Ol=o(((e,t)=>{var n=Xe(),r=fc(),i=rt(),a=Cl(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),kl=o(((e,t)=>{var n=Ol();function r(e){return e==null?``:n(e)}t.exports=r})),Al=o(((e,t)=>{var n=rt(),r=wl(),i=Dl(),a=kl();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),jl=o(((e,t)=>{var n=Cl(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),Ml=o(((e,t)=>{var n=Al(),r=jl();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),Nl=o(((e,t)=>{var n=Ml();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),Pl=o(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),Fl=o(((e,t)=>{var n=Al(),r=nt(),i=rt(),a=Gs(),o=Ks(),s=jl();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),Il=o(((e,t)=>{var n=Pl(),r=Fl();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),Ll=o(((e,t)=>{var n=_l(),r=Nl(),i=Il(),a=wl(),o=yl(),s=xl(),c=jl(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),Rl=o(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),zl=o(((e,t)=>{var n=Ml();function r(e){return function(t){return n(t,e)}}t.exports=r})),Bl=o(((e,t)=>{var n=Rl(),r=zl(),i=wl(),a=jl();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),Vl=o(((e,t)=>{var n=Sl(),r=Ll(),i=sc(),a=rt(),o=Bl();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),Hl=o(((e,t)=>{var n=ic();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}t.exports=r})),Ul=o(((e,t)=>{var n=oc();t.exports=Hl()(n)})),Wl=o(((e,t)=>{var n=Ul(),r=ic();function i(e,t){var i=-1,a=r(e)?Array(e.length):[];return n(e,function(e,n,r){a[++i]=t(e,n,r)}),a}t.exports=i})),Gl=o(((e,t)=>{var n=fc(),r=Vl(),i=Wl(),a=rt();function o(e,t){return(a(e)?n:i)(e,r(t,3))}t.exports=o})),Kl=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.flattenNames=void 0;var t=a(zs()),n=a(lc()),r=a(dc()),i=a(Gl());function a(e){return e&&e.__esModule?e:{default:e}}e.default=e.flattenNames=function e(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=[];return(0,i.default)(a,function(i){Array.isArray(i)?e(i).map(function(e){return o.push(e)}):(0,r.default)(i)?(0,n.default)(i,function(e,t){e===!0&&o.push(t),o.push(t+`-`+e)}):(0,t.default)(i)&&o.push(i)}),o}})),ql=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=n})),Jl=o(((e,t)=>{var n=Ac();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),Yl=o(((e,t)=>{var n=Jl();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),Xl=o(((e,t)=>{var n=Yl(),r=mc(),i=Object.prototype.hasOwnProperty;function a(e,t,a){var o=e[t];(!(i.call(e,t)&&r(o,a))||a===void 0&&!(t in e))&&n(e,t,a)}t.exports=a})),Zl=o(((e,t)=>{var n=Xl(),r=Yl();function i(e,t,i,a){var o=!i;i||={};for(var s=-1,c=t.length;++s<c;){var l=t[s],u=a?a(i[l],e[l],l,i,e):void 0;u===void 0&&(u=e[l]),o?r(i,l,u):n(i,l,u)}return i}t.exports=i})),Ql=o(((e,t)=>{var n=Zl(),r=ac();function i(e,t){return e&&n(t,r(t),e)}t.exports=i})),$l=o(((e,t)=>{function n(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}t.exports=n})),eu=o(((e,t)=>{var n=nc(),r=Qs(),i=$l(),a=Object.prototype.hasOwnProperty;function o(e){if(!n(e))return i(e);var t=r(e),o=[];for(var s in e)s==`constructor`&&(t||!a.call(e,s))||o.push(s);return o}t.exports=o})),tu=o(((e,t)=>{var n=Zs(),r=eu(),i=ic();function a(e){return i(e)?n(e,!0):r(e)}t.exports=a})),nu=o(((e,t)=>{var n=Zl(),r=tu();function i(e,t){return e&&n(t,r(t),e)}t.exports=i})),ru=o(((e,t)=>{var n=Ye(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r?n.Buffer:void 0,o=a?a.allocUnsafe:void 0;function s(e,t){if(t)return e.slice();var n=e.length,r=o?o(n):new e.constructor(n);return e.copy(r),r}t.exports=s})),iu=o(((e,t)=>{function n(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}t.exports=n})),au=o(((e,t)=>{var n=Zl(),r=cl();function i(e,t){return n(e,r(e),t)}t.exports=i})),ou=o(((e,t)=>{var n=qe(),r=uc(),i=cl(),a=sl();t.exports=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,i(e)),e=r(e);return t}:a})),su=o(((e,t)=>{var n=Zl(),r=ou();function i(e,t){return n(e,r(e),t)}t.exports=i})),W=o(((e,t)=>{var n=al(),r=ou(),i=tu();function a(e){return n(e,i,r)}t.exports=a})),cu=o(((e,t)=>{var n=Object.prototype.hasOwnProperty;function r(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]==`string`&&n.call(e,`index`)&&(r.index=e.index,r.input=e.input),r}t.exports=r})),lu=o(((e,t)=>{var n=tl();function r(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}t.exports=r})),uu=o(((e,t)=>{var n=lu();function r(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}t.exports=r})),du=o(((e,t)=>{var n=/\w*$/;function r(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}t.exports=r})),fu=o(((e,t)=>{var n=Xe(),r=n?n.prototype:void 0,i=r?r.valueOf:void 0;function a(e){return i?Object(i.call(e)):{}}t.exports=a})),pu=o(((e,t)=>{var n=lu();function r(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}t.exports=r})),mu=o(((e,t)=>{var n=lu(),r=uu(),i=du(),a=fu(),o=pu(),s=`[object Boolean]`,c=`[object Date]`,l=`[object Map]`,u=`[object Number]`,d=`[object RegExp]`,f=`[object Set]`,p=`[object String]`,m=`[object Symbol]`,h=`[object ArrayBuffer]`,g=`[object DataView]`,_=`[object Float32Array]`,v=`[object Float64Array]`,y=`[object Int8Array]`,b=`[object Int16Array]`,x=`[object Int32Array]`,S=`[object Uint8Array]`,C=`[object Uint8ClampedArray]`,w=`[object Uint16Array]`,T=`[object Uint32Array]`;function E(e,t,E){var D=e.constructor;switch(t){case h:return n(e);case s:case c:return new D(+e);case g:return r(e,E);case _:case v:case y:case b:case x:case S:case C:case w:case T:return o(e,E);case l:return new D;case u:case p:return new D(e);case d:return i(e);case f:return new D;case m:return a(e)}}t.exports=E})),hu=o(((e,t)=>{var n=nc(),r=Object.create;t.exports=function(){function e(){}return function(t){if(!n(t))return{};if(r)return r(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}()})),gu=o(((e,t)=>{var n=hu(),r=uc(),i=Qs();function a(e){return typeof e.constructor==`function`&&!i(e)?n(r(e)):{}}t.exports=a})),_u=o(((e,t)=>{var n=hl(),r=et(),i=`[object Map]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),vu=o(((e,t)=>{var n=_u(),r=Js(),i=Ys(),a=i&&i.isMap;t.exports=a?r(a):n})),yu=o(((e,t)=>{var n=hl(),r=et(),i=`[object Set]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),G=o(((e,t)=>{var n=yu(),r=Js(),i=Ys(),a=i&&i.isSet;t.exports=a?r(a):n})),bu=o(((e,t)=>{var n=Jc(),r=ql(),i=Xl(),a=Ql(),o=nu(),s=ru(),c=iu(),l=au(),u=su(),d=ll(),f=W(),p=hl(),m=cu(),h=mu(),g=gu(),_=rt(),v=Ws(),y=vu(),b=nc(),x=G(),S=ac(),C=tu(),w=1,T=2,E=4,D=`[object Arguments]`,O=`[object Array]`,k=`[object Boolean]`,A=`[object Date]`,j=`[object Error]`,M=`[object Function]`,ee=`[object GeneratorFunction]`,N=`[object Map]`,P=`[object Number]`,F=`[object Object]`,I=`[object RegExp]`,L=`[object Set]`,te=`[object String]`,ne=`[object Symbol]`,re=`[object WeakMap]`,ie=`[object ArrayBuffer]`,ae=`[object DataView]`,oe=`[object Float32Array]`,se=`[object Float64Array]`,ce=`[object Int8Array]`,le=`[object Int16Array]`,ue=`[object Int32Array]`,de=`[object Uint8Array]`,fe=`[object Uint8ClampedArray]`,pe=`[object Uint16Array]`,me=`[object Uint32Array]`,he={};he[D]=he[O]=he[ie]=he[ae]=he[k]=he[A]=he[oe]=he[se]=he[ce]=he[le]=he[ue]=he[N]=he[P]=he[F]=he[I]=he[L]=he[te]=he[ne]=he[de]=he[fe]=he[pe]=he[me]=!0,he[j]=he[M]=he[re]=!1;function ge(e,t,O,k,A,j){var N,P=t&w,I=t&T,L=t&E;if(O&&(N=A?O(e,k,A,j):O(e)),N!==void 0)return N;if(!b(e))return e;var te=_(e);if(te){if(N=m(e),!P)return c(e,N)}else{var ne=p(e),re=ne==M||ne==ee;if(v(e))return s(e,P);if(ne==F||ne==D||re&&!A){if(N=I||re?{}:g(e),!P)return I?u(e,o(N,e)):l(e,a(N,e))}else{if(!he[ne])return A?e:{};N=h(e,ne,P)}}j||=new n;var ie=j.get(e);if(ie)return ie;j.set(e,N),x(e)?e.forEach(function(n){N.add(ge(n,t,O,n,e,j))}):y(e)&&e.forEach(function(n,r){N.set(r,ge(n,t,O,r,e,j))});var ae=te?void 0:(L?I?f:d:I?C:S)(e);return r(ae||e,function(n,r){ae&&(r=n,n=e[r]),i(N,r,ge(n,t,O,r,e,j))}),N}t.exports=ge})),xu=o(((e,t)=>{var n=bu(),r=1,i=4;function a(e){return n(e,r|i)}t.exports=a})),Su=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.mergeClasses=void 0;var t=i(lc()),n=i(xu()),r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function i(e){return e&&e.__esModule?e:{default:e}}e.default=e.mergeClasses=function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=e.default&&(0,n.default)(e.default)||{};return i.map(function(n){var i=e[n];return i&&(0,t.default)(i,function(e,t){a[t]||(a[t]={}),a[t]=r({},a[t],i[t])}),n}),a}})),Cu=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.autoprefix=void 0;var t=r(lc()),n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function r(e){return e&&e.__esModule?e:{default:e}}var i={borderRadius:function(e){return{msBorderRadius:e,MozBorderRadius:e,OBorderRadius:e,WebkitBorderRadius:e,borderRadius:e}},boxShadow:function(e){return{msBoxShadow:e,MozBoxShadow:e,OBoxShadow:e,WebkitBoxShadow:e,boxShadow:e}},userSelect:function(e){return{WebkitTouchCallout:e,KhtmlUserSelect:e,MozUserSelect:e,msUserSelect:e,WebkitUserSelect:e,userSelect:e}},flex:function(e){return{WebkitBoxFlex:e,MozBoxFlex:e,WebkitFlex:e,msFlex:e,flex:e}},flexBasis:function(e){return{WebkitFlexBasis:e,flexBasis:e}},justifyContent:function(e){return{WebkitJustifyContent:e,justifyContent:e}},transition:function(e){return{msTransition:e,MozTransition:e,OTransition:e,WebkitTransition:e,transition:e}},transform:function(e){return{msTransform:e,MozTransform:e,OTransform:e,WebkitTransform:e,transform:e}},absolute:function(e){var t=e&&e.split(` `);return{position:`absolute`,top:t&&t[0],right:t&&t[1],bottom:t&&t[2],left:t&&t[3]}},extend:function(e,t){return t[e]||{extend:e}}};e.default=e.autoprefix=function(e){var r={};return(0,t.default)(e,function(e,a){var o={};(0,t.default)(e,function(e,t){var r=i[t];r?o=n({},o,r(e)):o[t]=e}),r[a]=o}),r}})),K=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.hover=void 0;var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n=r(require("react"));function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function a(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function o(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}e.default=e.hover=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`span`;return function(s){o(c,s);function c(){var o,s,l,u;i(this,c);for(var d=arguments.length,f=Array(d),p=0;p<d;p++)f[p]=arguments[p];return u=(s=(l=a(this,(o=c.__proto__||Object.getPrototypeOf(c)).call.apply(o,[this].concat(f))),l),l.state={hover:!1},l.handleMouseOver=function(){return l.setState({hover:!0})},l.handleMouseOut=function(){return l.setState({hover:!1})},l.render=function(){return n.default.createElement(r,{onMouseOver:l.handleMouseOver,onMouseOut:l.handleMouseOut},n.default.createElement(e,t({},l.props,l.state)))},s),a(l,u)}return c}(n.default.Component)}})),wu=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.active=void 0;var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n=r(require("react"));function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function a(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function o(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}e.default=e.active=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`span`;return function(s){o(c,s);function c(){var o,s,l,u;i(this,c);for(var d=arguments.length,f=Array(d),p=0;p<d;p++)f[p]=arguments[p];return u=(s=(l=a(this,(o=c.__proto__||Object.getPrototypeOf(c)).call.apply(o,[this].concat(f))),l),l.state={active:!1},l.handleMouseDown=function(){return l.setState({active:!0})},l.handleMouseUp=function(){return l.setState({active:!1})},l.render=function(){return n.default.createElement(r,{onMouseDown:l.handleMouseDown,onMouseUp:l.handleMouseUp},n.default.createElement(e,t({},l.props,l.state)))},s),a(l,u)}return c}(n.default.Component)}})),Tu=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t){var n={},r=function(e){n[e]=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0};return e===0&&r(`first-child`),e===t-1&&r(`last-child`),(e===0||e%2==0)&&r(`even`),Math.abs(e%2)===1&&r(`odd`),r(`nth-child`,e),n}})),q=l(o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReactCSS=e.loop=e.handleActive=e.handleHover=e.hover=void 0;var t=s(Kl()),n=s(Su()),r=s(Cu()),i=s(K()),a=s(wu()),o=s(Tu());function s(e){return e&&e.__esModule?e:{default:e}}e.hover=i.default,e.handleHover=i.default,e.handleActive=a.default,e.loop=o.default,e.default=e.ReactCSS=function(e){for(var i=arguments.length,a=Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var s=(0,t.default)(a),c=(0,n.default)(e,s);return(0,r.default)(c)}}))()),Eu=function(e,t,n,r,i){var a=i.clientWidth,o=i.clientHeight,s=typeof e.pageX==`number`?e.pageX:e.touches[0].pageX,c=typeof e.pageY==`number`?e.pageY:e.touches[0].pageY,l=s-(i.getBoundingClientRect().left+window.pageXOffset),u=c-(i.getBoundingClientRect().top+window.pageYOffset);if(n===`vertical`){var d=void 0;if(d=u<0?0:u>o?1:Math.round(u*100/o)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:`rgb`}}else{var f=void 0;if(f=l<0?0:l>a?1:Math.round(l*100/a)/100,r!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:`rgb`}}return null},Du={},Ou=function(e,t,n,r){if(typeof document>`u`&&!r)return null;var i=r?new r:document.createElement(`canvas`);i.width=n*2,i.height=n*2;var a=i.getContext(`2d`);return a?(a.fillStyle=e,a.fillRect(0,0,i.width,i.height),a.fillStyle=t,a.fillRect(0,0,n,n),a.translate(n,n),a.fillRect(0,0,n,n),i.toDataURL()):null},ku=function(e,t,n,r){var i=e+`-`+t+`-`+n+(r?`-server`:``);if(Du[i])return Du[i];var a=Ou(e,t,n,r);return Du[i]=a,a},Au=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ju=function(e){var t=e.white,n=e.grey,r=e.size,i=e.renderers,a=e.borderRadius,o=e.boxShadow,s=e.children,c=(0,q.default)({default:{grid:{borderRadius:a,boxShadow:o,absolute:`0px 0px 0px 0px`,background:`url(`+ku(t,n,r,i.canvas)+`) center left`}}});return(0,u.isValidElement)(s)?u.default.cloneElement(s,Au({},s.props,{style:Au({},s.props.style,c.grid)})):u.default.createElement(`div`,{style:c.grid})};ju.defaultProps={size:8,white:`transparent`,grey:`rgba(0,0,0,.08)`,renderers:{}};var Mu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nu=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Pu(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Fu(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function Iu(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Lu=function(e){Iu(t,e);function t(){var e,n,r,i;Pu(this,t);for(var a=arguments.length,o=Array(a),s=0;s<a;s++)o[s]=arguments[s];return i=(n=(r=Fu(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r),r.handleChange=function(e){var t=Eu(e,r.props.hsl,r.props.direction,r.props.a,r.container);t&&typeof r.props.onChange==`function`&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener(`mousemove`,r.handleChange),window.addEventListener(`mouseup`,r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener(`mousemove`,r.handleChange),window.removeEventListener(`mouseup`,r.handleMouseUp)},n),Fu(r,i)}return Nu(t,[{key:`componentWillUnmount`,value:function(){this.unbindEventListeners()}},{key:`render`,value:function(){var e=this,t=this.props.rgb,n=(0,q.default)({default:{alpha:{absolute:`0px 0px 0px 0px`,borderRadius:this.props.radius},checkboard:{absolute:`0px 0px 0px 0px`,overflow:`hidden`,borderRadius:this.props.radius},gradient:{absolute:`0px 0px 0px 0px`,background:`linear-gradient(to right, rgba(`+t.r+`,`+t.g+`,`+t.b+`, 0) 0%,
|
|
165
|
+
rgba(`+t.r+`,`+t.g+`,`+t.b+`, 1) 100%)`,boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:`relative`,height:`100%`,margin:`0 3px`},pointer:{position:`absolute`,left:t.a*100+`%`},slider:{width:`4px`,borderRadius:`1px`,height:`8px`,boxShadow:`0 0 2px rgba(0, 0, 0, .6)`,background:`#fff`,marginTop:`1px`,transform:`translateX(-2px)`}},vertical:{gradient:{background:`linear-gradient(to bottom, rgba(`+t.r+`,`+t.g+`,`+t.b+`, 0) 0%,
|
|
166
|
+
rgba(`+t.r+`,`+t.g+`,`+t.b+`, 1) 100%)`},pointer:{left:0,top:t.a*100+`%`}},overwrite:Mu({},this.props.style)},{vertical:this.props.direction===`vertical`,overwrite:!0});return u.default.createElement(`div`,{style:n.alpha},u.default.createElement(`div`,{style:n.checkboard},u.default.createElement(ju,{renderers:this.props.renderers})),u.default.createElement(`div`,{style:n.gradient}),u.default.createElement(`div`,{style:n.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},u.default.createElement(`div`,{style:n.pointer},this.props.pointer?u.default.createElement(this.props.pointer,this.props):u.default.createElement(`div`,{style:n.slider}))))}}]),t}(u.PureComponent||u.Component),Ru=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function zu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bu(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Vu(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function Hu(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Uu=1,Wu=38,Gu=[Wu,40],Ku=function(e){return Gu.indexOf(e)>-1},qu=function(e){return Number(String(e).replace(/%/g,``))},Ju=1,Yu=function(e){Hu(t,e);function t(e){Bu(this,t);var n=Vu(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(e){n.setUpdatedValue(e.target.value,e)},n.handleKeyDown=function(e){var t=qu(e.target.value);if(!isNaN(t)&&Ku(e.keyCode)){var r=n.getArrowOffset(),i=e.keyCode===Wu?t+r:t-r;n.setUpdatedValue(i,e)}},n.handleDrag=function(e){if(n.props.dragLabel){var t=Math.round(n.props.value+e.movementX);t>=0&&t<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(t),e)}},n.handleMouseDown=function(e){n.props.dragLabel&&(e.preventDefault(),n.handleDrag(e),window.addEventListener(`mousemove`,n.handleDrag),window.addEventListener(`mouseup`,n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener(`mousemove`,n.handleDrag),window.removeEventListener(`mouseup`,n.handleMouseUp)},n.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},n.inputId=`rc-editable-input-`+Ju++,n}return Ru(t,[{key:`componentDidUpdate`,value:function(e,t){this.props.value!==this.state.value&&(e.value!==this.props.value||t.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:`componentWillUnmount`,value:function(){this.unbindEventListeners()}},{key:`getValueObjectWithLabel`,value:function(e){return zu({},this.props.label,e)}},{key:`getArrowOffset`,value:function(){return this.props.arrowOffset||Uu}},{key:`setUpdatedValue`,value:function(e,t){var n=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t),this.setState({value:e})}},{key:`render`,value:function(){var e=this,t=(0,q.default)({default:{wrap:{position:`relative`}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:`ew-resize`}}},{"user-override":!0},this.props);return u.default.createElement(`div`,{style:t.wrap},u.default.createElement(`input`,{id:this.inputId,style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:`false`}),this.props.label&&!this.props.hideLabel?u.default.createElement(`label`,{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(u.PureComponent||u.Component),Xu=function(e,t,n,r){var i=r.clientWidth,a=r.clientHeight,o=typeof e.pageX==`number`?e.pageX:e.touches[0].pageX,s=typeof e.pageY==`number`?e.pageY:e.touches[0].pageY,c=o-(r.getBoundingClientRect().left+window.pageXOffset),l=s-(r.getBoundingClientRect().top+window.pageYOffset);if(t===`vertical`){var u=void 0;if(u=l<0?359:l>a?0:360*(-(l*100/a)+100)/100,n.h!==u)return{h:u,s:n.s,l:n.l,a:n.a,source:`hsl`}}else{var d=void 0;if(d=c<0?0:c>i?359:360*(c*100/i)/100,n.h!==d)return{h:d,s:n.s,l:n.l,a:n.a,source:`hsl`}}return null},Zu=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Qu(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function $u(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function ed(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var td=function(e){ed(t,e);function t(){var e,n,r,i;Qu(this,t);for(var a=arguments.length,o=Array(a),s=0;s<a;s++)o[s]=arguments[s];return i=(n=(r=$u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r),r.handleChange=function(e){var t=Xu(e,r.props.direction,r.props.hsl,r.container);t&&typeof r.props.onChange==`function`&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener(`mousemove`,r.handleChange),window.addEventListener(`mouseup`,r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},n),$u(r,i)}return Zu(t,[{key:`componentWillUnmount`,value:function(){this.unbindEventListeners()}},{key:`unbindEventListeners`,value:function(){window.removeEventListener(`mousemove`,this.handleChange),window.removeEventListener(`mouseup`,this.handleMouseUp)}},{key:`render`,value:function(){var e=this,t=this.props.direction,n=t===void 0?`horizontal`:t,r=(0,q.default)({default:{hue:{absolute:`0px 0px 0px 0px`,borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:`0 2px`,position:`relative`,height:`100%`,borderRadius:this.props.radius},pointer:{position:`absolute`,left:this.props.hsl.h*100/360+`%`},slider:{marginTop:`1px`,width:`4px`,borderRadius:`1px`,height:`8px`,boxShadow:`0 0 2px rgba(0, 0, 0, .6)`,background:`#fff`,transform:`translateX(-2px)`}},vertical:{pointer:{left:`0px`,top:-(this.props.hsl.h*100/360)+100+`%`}}},{vertical:n===`vertical`});return u.default.createElement(`div`,{style:r.hue},u.default.createElement(`div`,{className:`hue-`+n,style:r.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},u.default.createElement(`style`,null,`
|
|
167
|
+
.hue-horizontal {
|
|
168
|
+
background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0
|
|
169
|
+
33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
|
170
|
+
background: -webkit-linear-gradient(to right, #f00 0%, #ff0
|
|
171
|
+
17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.hue-vertical {
|
|
175
|
+
background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,
|
|
176
|
+
#0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
|
177
|
+
background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,
|
|
178
|
+
#0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
|
179
|
+
}
|
|
180
|
+
`),u.default.createElement(`div`,{style:r.pointer},this.props.pointer?u.default.createElement(this.props.pointer,this.props):u.default.createElement(`div`,{style:r.slider}))))}}]),t}(u.PureComponent||u.Component);function nd(){this.__data__=[],this.size=0}function rd(e,t){return e===t||e!==e&&t!==t}function id(e,t){for(var n=e.length;n--;)if(rd(e[n][0],t))return n;return-1}var ad=Array.prototype.splice;function od(e){var t=this.__data__,n=id(t,e);return n<0?!1:(n==t.length-1?t.pop():ad.call(t,n,1),--this.size,!0)}function sd(e){var t=this.__data__,n=id(t,e);return n<0?void 0:t[n][1]}function cd(e){return id(this.__data__,e)>-1}function ld(e,t){var n=this.__data__,r=id(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ud(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ud.prototype.clear=nd,ud.prototype.delete=od,ud.prototype.get=sd,ud.prototype.has=cd,ud.prototype.set=ld;function dd(){this.__data__=new ud,this.size=0}function fd(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function pd(e){return this.__data__.get(e)}function md(e){return this.__data__.has(e)}var hd=typeof global==`object`&&global&&global.Object===Object&&global,gd=typeof self==`object`&&self&&self.Object===Object&&self,_d=hd||gd||Function(`return this`)(),vd=_d.Symbol,yd=Object.prototype,bd=yd.hasOwnProperty,xd=yd.toString,Sd=vd?vd.toStringTag:void 0;function Cd(e){var t=bd.call(e,Sd),n=e[Sd];try{e[Sd]=void 0;var r=!0}catch{}var i=xd.call(e);return r&&(t?e[Sd]=n:delete e[Sd]),i}var wd=Object.prototype.toString;function Td(e){return wd.call(e)}var Ed=`[object Null]`,Dd=`[object Undefined]`,Od=vd?vd.toStringTag:void 0;function kd(e){return e==null?e===void 0?Dd:Ed:Od&&Od in Object(e)?Cd(e):Td(e)}function Ad(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var jd=`[object AsyncFunction]`,Md=`[object Function]`,Nd=`[object GeneratorFunction]`,Pd=`[object Proxy]`;function Fd(e){if(!Ad(e))return!1;var t=kd(e);return t==Md||t==Nd||t==jd||t==Pd}var Id=_d[`__core-js_shared__`],Ld=function(){var e=/[^.]+$/.exec(Id&&Id.keys&&Id.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function Rd(e){return!!Ld&&Ld in e}var zd=Function.prototype.toString;function Bd(e){if(e!=null){try{return zd.call(e)}catch{}try{return e+``}catch{}}return``}var Vd=/[\\^$.*+?()[\]{}|]/g,Hd=/^\[object .+?Constructor\]$/,Ud=Function.prototype,Wd=Object.prototype,Gd=Ud.toString,Kd=Wd.hasOwnProperty,qd=RegExp(`^`+Gd.call(Kd).replace(Vd,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function Jd(e){return!Ad(e)||Rd(e)?!1:(Fd(e)?qd:Hd).test(Bd(e))}function Yd(e,t){return e?.[t]}function Xd(e,t){var n=Yd(e,t);return Jd(n)?n:void 0}var Zd=Xd(_d,`Map`),Qd=Xd(Object,`create`);function $d(){this.__data__=Qd?Qd(null):{},this.size=0}function ef(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var tf=`__lodash_hash_undefined__`,nf=Object.prototype.hasOwnProperty;function rf(e){var t=this.__data__;if(Qd){var n=t[e];return n===tf?void 0:n}return nf.call(t,e)?t[e]:void 0}var af=Object.prototype.hasOwnProperty;function of(e){var t=this.__data__;return Qd?t[e]!==void 0:af.call(t,e)}var sf=`__lodash_hash_undefined__`;function cf(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=Qd&&t===void 0?sf:t,this}function lf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}lf.prototype.clear=$d,lf.prototype.delete=ef,lf.prototype.get=rf,lf.prototype.has=of,lf.prototype.set=cf;function uf(){this.size=0,this.__data__={hash:new lf,map:new(Zd||ud),string:new lf}}function df(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function ff(e,t){var n=e.__data__;return df(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function pf(e){var t=ff(this,e).delete(e);return this.size-=+!!t,t}function mf(e){return ff(this,e).get(e)}function hf(e){return ff(this,e).has(e)}function gf(e,t){var n=ff(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function _f(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}_f.prototype.clear=uf,_f.prototype.delete=pf,_f.prototype.get=mf,_f.prototype.has=hf,_f.prototype.set=gf;var vf=200;function yf(e,t){var n=this.__data__;if(n instanceof ud){var r=n.__data__;if(!Zd||r.length<vf-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _f(r)}return n.set(e,t),this.size=n.size,this}function bf(e){var t=this.__data__=new ud(e);this.size=t.size}bf.prototype.clear=dd,bf.prototype.delete=fd,bf.prototype.get=pd,bf.prototype.has=md,bf.prototype.set=yf;var xf=function(){try{var e=Xd(Object,`defineProperty`);return e({},``,{}),e}catch{}}();function Sf(e,t,n){t==`__proto__`&&xf?xf(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Cf(e,t,n){(n!==void 0&&!rd(e[t],n)||n===void 0&&!(t in e))&&Sf(e,t,n)}function wf(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var Tf=wf(),Ef=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Df=Ef&&typeof module==`object`&&module&&!module.nodeType&&module,Of=Df&&Df.exports===Ef?_d.Buffer:void 0,kf=Of?Of.allocUnsafe:void 0;function Af(e,t){if(t)return e.slice();var n=e.length,r=kf?kf(n):new e.constructor(n);return e.copy(r),r}var jf=_d.Uint8Array;function Mf(e){var t=new e.constructor(e.byteLength);return new jf(t).set(new jf(e)),t}function Nf(e,t){var n=t?Mf(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Pf(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var Ff=Object.create,If=function(){function e(){}return function(t){if(!Ad(t))return{};if(Ff)return Ff(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Lf(e,t){return function(n){return e(t(n))}}var Rf=Lf(Object.getPrototypeOf,Object),zf=Object.prototype;function Bf(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||zf)}function Vf(e){return typeof e.constructor==`function`&&!Bf(e)?If(Rf(e)):{}}function Hf(e){return typeof e==`object`&&!!e}var Uf=`[object Arguments]`;function Wf(e){return Hf(e)&&kd(e)==Uf}var Gf=Object.prototype,Kf=Gf.hasOwnProperty,qf=Gf.propertyIsEnumerable,Jf=Wf(function(){return arguments}())?Wf:function(e){return Hf(e)&&Kf.call(e,`callee`)&&!qf.call(e,`callee`)},Yf=Array.isArray,Xf=9007199254740991;function Zf(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Xf}function Qf(e){return e!=null&&Zf(e.length)&&!Fd(e)}function $f(e){return Hf(e)&&Qf(e)}function ep(){return!1}var tp=typeof exports==`object`&&exports&&!exports.nodeType&&exports,np=tp&&typeof module==`object`&&module&&!module.nodeType&&module,rp=np&&np.exports===tp?_d.Buffer:void 0,ip=(rp?rp.isBuffer:void 0)||ep,ap=`[object Object]`,op=Function.prototype,sp=Object.prototype,cp=op.toString,lp=sp.hasOwnProperty,up=cp.call(Object);function dp(e){if(!Hf(e)||kd(e)!=ap)return!1;var t=Rf(e);if(t===null)return!0;var n=lp.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&cp.call(n)==up}var fp=`[object Arguments]`,pp=`[object Array]`,mp=`[object Boolean]`,hp=`[object Date]`,gp=`[object Error]`,_p=`[object Function]`,vp=`[object Map]`,yp=`[object Number]`,bp=`[object Object]`,xp=`[object RegExp]`,Sp=`[object Set]`,Cp=`[object String]`,wp=`[object WeakMap]`,Tp=`[object ArrayBuffer]`,Ep=`[object DataView]`,Dp=`[object Float32Array]`,Op=`[object Float64Array]`,kp=`[object Int8Array]`,Ap=`[object Int16Array]`,jp=`[object Int32Array]`,Mp=`[object Uint8Array]`,Np=`[object Uint8ClampedArray]`,Pp=`[object Uint16Array]`,Fp=`[object Uint32Array]`,Ip={};Ip[Dp]=Ip[Op]=Ip[kp]=Ip[Ap]=Ip[jp]=Ip[Mp]=Ip[Np]=Ip[Pp]=Ip[Fp]=!0,Ip[fp]=Ip[pp]=Ip[Tp]=Ip[mp]=Ip[Ep]=Ip[hp]=Ip[gp]=Ip[_p]=Ip[vp]=Ip[yp]=Ip[bp]=Ip[xp]=Ip[Sp]=Ip[Cp]=Ip[wp]=!1;function Lp(e){return Hf(e)&&Zf(e.length)&&!!Ip[kd(e)]}function Rp(e){return function(t){return e(t)}}var zp=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Bp=zp&&typeof module==`object`&&module&&!module.nodeType&&module,Vp=Bp&&Bp.exports===zp&&hd.process,Hp=function(){try{return Bp&&Bp.require&&Bp.require(`util`).types||Vp&&Vp.binding&&Vp.binding(`util`)}catch{}}(),Up=Hp&&Hp.isTypedArray,Wp=Up?Rp(Up):Lp;function Gp(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}var Kp=Object.prototype.hasOwnProperty;function qp(e,t,n){var r=e[t];(!(Kp.call(e,t)&&rd(r,n))||n===void 0&&!(t in e))&&Sf(e,t,n)}function Jp(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Sf(n,s,c):qp(n,s,c)}return n}function Yp(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Xp=9007199254740991,Zp=/^(?:0|[1-9]\d*)$/;function Qp(e,t){var n=typeof e;return t??=Xp,!!t&&(n==`number`||n!=`symbol`&&Zp.test(e))&&e>-1&&e%1==0&&e<t}var $p=Object.prototype.hasOwnProperty;function em(e,t){var n=Yf(e),r=!n&&Jf(e),i=!n&&!r&&ip(e),a=!n&&!r&&!i&&Wp(e),o=n||r||i||a,s=o?Yp(e.length,String):[],c=s.length;for(var l in e)(t||$p.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Qp(l,c)))&&s.push(l);return s}function tm(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var nm=Object.prototype.hasOwnProperty;function rm(e){if(!Ad(e))return tm(e);var t=Bf(e),n=[];for(var r in e)r==`constructor`&&(t||!nm.call(e,r))||n.push(r);return n}function im(e){return Qf(e)?em(e,!0):rm(e)}function am(e){return Jp(e,im(e))}function om(e,t,n,r,i,a,o){var s=Gp(e,n),c=Gp(t,n),l=o.get(c);if(l){Cf(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=Yf(c),p=!f&&ip(c),m=!f&&!p&&Wp(c);u=c,f||p||m?Yf(s)?u=s:$f(s)?u=Pf(s):p?(d=!1,u=Af(c,!0)):m?(d=!1,u=Nf(c,!0)):u=[]:dp(c)||Jf(c)?(u=s,Jf(s)?u=am(s):(!Ad(s)||Fd(s))&&(u=Vf(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),Cf(e,n,u)}function sm(e,t,n,r,i){e!==t&&Tf(t,function(a,o){if(i||=new bf,Ad(a))om(e,t,o,n,sm,r,i);else{var s=r?r(Gp(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),Cf(e,o,s)}},im)}function cm(e){return e}function lm(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var um=Math.max;function dm(e,t,n){return t=um(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=um(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),lm(e,this,s)}}function fm(e){return function(){return e}}var pm=xf?function(e,t){return xf(e,`toString`,{configurable:!0,enumerable:!1,value:fm(t),writable:!0})}:cm,mm=800,hm=16,gm=Date.now;function _m(e){var t=0,n=0;return function(){var r=gm(),i=hm-(r-n);if(n=r,i>0){if(++t>=mm)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var vm=_m(pm);function ym(e,t){return vm(dm(e,t,cm),e+``)}function bm(e,t,n){if(!Ad(n))return!1;var r=typeof t;return(r==`number`?Qf(n)&&Qp(t,n.length):r==`string`&&t in n)?rd(n[t],e):!1}function xm(e){return ym(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&bm(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var Sm=xm(function(e,t,n){sm(e,t,n)}),Cm=function(e){var t=e.zDepth,n=e.radius,r=e.background,i=e.children,a=e.styles,o=a===void 0?{}:a,s=(0,q.default)(Sm({default:{wrap:{position:`relative`,display:`inline-block`},content:{position:`relative`},bg:{absolute:`0px 0px 0px 0px`,boxShadow:`0 `+t+`px `+t*4+`px rgba(0,0,0,.24)`,borderRadius:n,background:r}},"zDepth-0":{bg:{boxShadow:`none`}},"zDepth-1":{bg:{boxShadow:`0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)`}},"zDepth-2":{bg:{boxShadow:`0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)`}},"zDepth-3":{bg:{boxShadow:`0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)`}},"zDepth-4":{bg:{boxShadow:`0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)`}},"zDepth-5":{bg:{boxShadow:`0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)`}},square:{bg:{borderRadius:`0`}},circle:{bg:{borderRadius:`50%`}}},o),{"zDepth-1":t===1});return u.default.createElement(`div`,{style:s.wrap},u.default.createElement(`div`,{style:s.bg}),u.default.createElement(`div`,{style:s.content},i))};Cm.propTypes={background:f.default.string,zDepth:f.default.oneOf([0,1,2,3,4,5]),radius:f.default.number,styles:f.default.object},Cm.defaultProps={background:`#fff`,zDepth:1,radius:2,styles:{}};var wm=function(){return _d.Date.now()},Tm=/\s/;function Em(e){for(var t=e.length;t--&&Tm.test(e.charAt(t)););return t}var Dm=/^\s+/;function Om(e){return e&&e.slice(0,Em(e)+1).replace(Dm,``)}var km=`[object Symbol]`;function Am(e){return typeof e==`symbol`||Hf(e)&&kd(e)==km}var jm=NaN,Mm=/^[-+]0x[0-9a-f]+$/i,Nm=/^0b[01]+$/i,Pm=/^0o[0-7]+$/i,Fm=parseInt;function Im(e){if(typeof e==`number`)return e;if(Am(e))return jm;if(Ad(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=Ad(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Om(e);var n=Nm.test(e);return n||Pm.test(e)?Fm(e.slice(2),n?2:8):Mm.test(e)?jm:+e}var Lm=`Expected a function`,Rm=Math.max,J=Math.min;function zm(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(Lm);t=Im(t)||0,Ad(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?Rm(Im(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?J(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=wm();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(wm())}function x(){var e=wm(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}var Bm=`Expected a function`;function Vm(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw TypeError(Bm);return Ad(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),zm(e,t,{leading:r,maxWait:t,trailing:i})}var Hm=function(e,t,n){var r=n.getBoundingClientRect(),i=r.width,a=r.height,o=typeof e.pageX==`number`?e.pageX:e.touches[0].pageX,s=typeof e.pageY==`number`?e.pageY:e.touches[0].pageY,c=o-(n.getBoundingClientRect().left+window.pageXOffset),l=s-(n.getBoundingClientRect().top+window.pageYOffset);c<0?c=0:c>i&&(c=i),l<0?l=0:l>a&&(l=a);var u=c/i,d=1-l/a;return{h:t.h,s:u,v:d,a:t.a,source:`hsv`}},Um=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Wm(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Gm(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function Km(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var qm=function(e){Km(t,e);function t(e){Wm(this,t);var n=Gm(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleChange=function(e){typeof n.props.onChange==`function`&&n.throttle(n.props.onChange,Hm(e,n.props.hsl,n.container),e)},n.handleMouseDown=function(e){n.handleChange(e);var t=n.getContainerRenderWindow();t.addEventListener(`mousemove`,n.handleChange),t.addEventListener(`mouseup`,n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.throttle=Vm(function(e,t,n){e(t,n)},50),n}return Um(t,[{key:`componentWillUnmount`,value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:`getContainerRenderWindow`,value:function(){for(var e=this.container,t=window;!t.document.contains(e)&&t.parent!==t;)t=t.parent;return t}},{key:`unbindEventListeners`,value:function(){var e=this.getContainerRenderWindow();e.removeEventListener(`mousemove`,this.handleChange),e.removeEventListener(`mouseup`,this.handleMouseUp)}},{key:`render`,value:function(){var e=this,t=this.props.style||{},n=t.color,r=t.white,i=t.black,a=t.pointer,o=t.circle,s=(0,q.default)({default:{color:{absolute:`0px 0px 0px 0px`,background:`hsl(`+this.props.hsl.h+`,100%, 50%)`,borderRadius:this.props.radius},white:{absolute:`0px 0px 0px 0px`,borderRadius:this.props.radius},black:{absolute:`0px 0px 0px 0px`,boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:`absolute`,top:-(this.props.hsv.v*100)+100+`%`,left:this.props.hsv.s*100+`%`,cursor:`default`},circle:{width:`4px`,height:`4px`,boxShadow:`0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),
|
|
181
|
+
0 0 1px 2px rgba(0,0,0,.4)`,borderRadius:`50%`,cursor:`hand`,transform:`translate(-2px, -2px)`}},custom:{color:n,white:r,black:i,pointer:a,circle:o}},{custom:!!this.props.style});return u.default.createElement(`div`,{style:s.color,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},u.default.createElement(`style`,null,`
|
|
182
|
+
.saturation-white {
|
|
183
|
+
background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));
|
|
184
|
+
background: linear-gradient(to right, #fff, rgba(255,255,255,0));
|
|
185
|
+
}
|
|
186
|
+
.saturation-black {
|
|
187
|
+
background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));
|
|
188
|
+
background: linear-gradient(to top, #000, rgba(0,0,0,0));
|
|
189
|
+
}
|
|
190
|
+
`),u.default.createElement(`div`,{style:s.white,className:`saturation-white`},u.default.createElement(`div`,{style:s.black,className:`saturation-black`}),u.default.createElement(`div`,{style:s.pointer},this.props.pointer?u.default.createElement(this.props.pointer,this.props):u.default.createElement(`div`,{style:s.circle}))))}}]),t}(u.PureComponent||u.Component);function Jm(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Ym=Lf(Object.keys,Object),Xm=Object.prototype.hasOwnProperty;function Zm(e){if(!Bf(e))return Ym(e);var t=[];for(var n in Object(e))Xm.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Qm(e){return Qf(e)?em(e):Zm(e)}function $m(e,t){return e&&Tf(e,t,Qm)}function eh(e,t){return function(n,r){if(n==null)return n;if(!Qf(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var th=eh($m);function nh(e){return typeof e==`function`?e:cm}function rh(e,t){return(Yf(e)?Jm:th)(e,nh(t))}function ih(e){"@babel/helpers - typeof";return ih=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},ih(e)}var ah=/^\s+/,oh=/\s+$/;function Y(e,t){if(e||=``,t||={},e instanceof Y)return e;if(!(this instanceof Y))return new Y(e,t);var n=sh(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}Y.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255,i=t<=.03928?t/12.92:((t+.055)/1.055)**2.4,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4;return .2126*i+.7152*a+.0722*o},setAlpha:function(e){return this._a=jh(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=dh(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=dh(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this._a==1?`hsv(`+t+`, `+n+`%, `+r+`%)`:`hsva(`+t+`, `+n+`%, `+r+`%, `+this._roundA+`)`},toHsl:function(){var e=lh(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=lh(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this._a==1?`hsl(`+t+`, `+n+`%, `+r+`%)`:`hsla(`+t+`, `+n+`%, `+r+`%, `+this._roundA+`)`},toHex:function(e){return ph(this._r,this._g,this._b,e)},toHexString:function(e){return`#`+this.toHex(e)},toHex8:function(e){return mh(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return`#`+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?`rgb(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`)`:`rgba(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`, `+this._roundA+`)`},toPercentageRgb:function(){return{r:Math.round(Mh(this._r,255)*100)+`%`,g:Math.round(Mh(this._g,255)*100)+`%`,b:Math.round(Mh(this._b,255)*100)+`%`,a:this._a}},toPercentageRgbString:function(){return this._a==1?`rgb(`+Math.round(Mh(this._r,255)*100)+`%, `+Math.round(Mh(this._g,255)*100)+`%, `+Math.round(Mh(this._b,255)*100)+`%)`:`rgba(`+Math.round(Mh(this._r,255)*100)+`%, `+Math.round(Mh(this._g,255)*100)+`%, `+Math.round(Mh(this._b,255)*100)+`%, `+this._roundA+`)`},toName:function(){return this._a===0?`transparent`:this._a<1?!1:kh[ph(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t=`#`+hh(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?`GradientType = 1, `:``;if(e){var i=Y(e);n=`#`+hh(i._r,i._g,i._b,i._a)}return`progid:DXImageTransform.Microsoft.gradient(`+r+`startColorstr=`+t+`,endColorstr=`+n+`)`},toString:function(e){var t=!!e;e||=this._format;var n=!1,r=this._a<1&&this._a>=0;return!t&&r&&(e===`hex`||e===`hex6`||e===`hex3`||e===`hex4`||e===`hex8`||e===`name`)?e===`name`&&this._a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return Y(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(yh,arguments)},brighten:function(){return this._applyModification(bh,arguments)},darken:function(){return this._applyModification(xh,arguments)},desaturate:function(){return this._applyModification(gh,arguments)},saturate:function(){return this._applyModification(_h,arguments)},greyscale:function(){return this._applyModification(vh,arguments)},spin:function(){return this._applyModification(Sh,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(Eh,arguments)},complement:function(){return this._applyCombination(Ch,arguments)},monochromatic:function(){return this._applyCombination(Dh,arguments)},splitcomplement:function(){return this._applyCombination(Th,arguments)},triad:function(){return this._applyCombination(wh,[3])},tetrad:function(){return this._applyCombination(wh,[4])}},Y.fromRatio=function(e,t){if(ih(e)==`object`){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=r===`a`?e[r]:Rh(e[r]));e=n}return Y(e,t)};function sh(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;return typeof e==`string`&&(e=Uh(e)),ih(e)==`object`&&(Hh(e.r)&&Hh(e.g)&&Hh(e.b)?(t=ch(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):Hh(e.h)&&Hh(e.s)&&Hh(e.v)?(r=Rh(e.s),i=Rh(e.v),t=fh(e.h,r,i),o=!0,s=`hsv`):Hh(e.h)&&Hh(e.s)&&Hh(e.l)&&(r=Rh(e.s),a=Rh(e.l),t=uh(e.h,r,a),o=!0,s=`hsl`),e.hasOwnProperty(`a`)&&(n=e.a)),n=jh(n),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function ch(e,t,n){return{r:Mh(e,255)*255,g:Mh(t,255)*255,b:Mh(n,255)*255}}function lh(e,t,n){e=Mh(e,255),t=Mh(t,255),n=Mh(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=(r+i)/2;if(r==i)a=o=0;else{var c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4}a/=6}return{h:a,s:o,l:s}}function uh(e,t,n){var r,i,a;e=Mh(e,360),t=Mh(t,100),n=Mh(n,100);function o(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(t===0)r=i=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),i=o(c,s,e),a=o(c,s,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function dh(e,t,n){e=Mh(e,255),t=Mh(t,255),n=Mh(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=r,c=r-i;if(o=r===0?0:c/r,r==i)a=0;else{switch(r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4}a/=6}return{h:a,s:o,v:s}}function fh(e,t,n){e=Mh(e,360)*6,t=Mh(t,100),n=Mh(n,100);var r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),c=r%6,l=[n,o,a,a,s,n][c],u=[s,n,n,o,a,a][c],d=[a,a,s,n,n,o][c];return{r:l*255,g:u*255,b:d*255}}function ph(e,t,n,r){var i=[Lh(Math.round(e).toString(16)),Lh(Math.round(t).toString(16)),Lh(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join(``)}function mh(e,t,n,r,i){var a=[Lh(Math.round(e).toString(16)),Lh(Math.round(t).toString(16)),Lh(Math.round(n).toString(16)),Lh(zh(r))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join(``)}function hh(e,t,n,r){return[Lh(zh(r)),Lh(Math.round(e).toString(16)),Lh(Math.round(t).toString(16)),Lh(Math.round(n).toString(16))].join(``)}Y.equals=function(e,t){return!e||!t?!1:Y(e).toRgbString()==Y(t).toRgbString()},Y.random=function(){return Y.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function gh(e,t){t=t===0?0:t||10;var n=Y(e).toHsl();return n.s-=t/100,n.s=Nh(n.s),Y(n)}function _h(e,t){t=t===0?0:t||10;var n=Y(e).toHsl();return n.s+=t/100,n.s=Nh(n.s),Y(n)}function vh(e){return Y(e).desaturate(100)}function yh(e,t){t=t===0?0:t||10;var n=Y(e).toHsl();return n.l+=t/100,n.l=Nh(n.l),Y(n)}function bh(e,t){t=t===0?0:t||10;var n=Y(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),Y(n)}function xh(e,t){t=t===0?0:t||10;var n=Y(e).toHsl();return n.l-=t/100,n.l=Nh(n.l),Y(n)}function Sh(e,t){var n=Y(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,Y(n)}function Ch(e){var t=Y(e).toHsl();return t.h=(t.h+180)%360,Y(t)}function wh(e,t){if(isNaN(t)||t<=0)throw Error(`Argument to polyad must be a positive number`);for(var n=Y(e).toHsl(),r=[Y(e)],i=360/t,a=1;a<t;a++)r.push(Y({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function Th(e){var t=Y(e).toHsl(),n=t.h;return[Y(e),Y({h:(n+72)%360,s:t.s,l:t.l}),Y({h:(n+216)%360,s:t.s,l:t.l})]}function Eh(e,t,n){t||=6,n||=30;var r=Y(e).toHsl(),i=360/n,a=[Y(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,a.push(Y(r));return a}function Dh(e,t){t||=6;for(var n=Y(e).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/t;t--;)o.push(Y({h:r,s:i,v:a})),a=(a+s)%1;return o}Y.mix=function(e,t,n){n=n===0?0:n||50;var r=Y(e).toRgb(),i=Y(t).toRgb(),a=n/100;return Y({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},Y.readability=function(e,t){var n=Y(e),r=Y(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},Y.isReadable=function(e,t,n){var r=Y.readability(e,t),i,a=!1;switch(i=Wh(n),i.level+i.size){case`AAsmall`:case`AAAlarge`:a=r>=4.5;break;case`AAlarge`:a=r>=3;break;case`AAAsmall`:a=r>=7}return a},Y.mostReadable=function(e,t,n){var r=null,i=0,a,o,s,c;n||={},o=n.includeFallbackColors,s=n.level,c=n.size;for(var l=0;l<t.length;l++)a=Y.readability(e,t[l]),a>i&&(i=a,r=Y(t[l]));return Y.isReadable(e,r,{level:s,size:c})||!o?r:(n.includeFallbackColors=!1,Y.mostReadable(e,[`#fff`,`#000`],n))};var Oh=Y.names={aliceblue:`f0f8ff`,antiquewhite:`faebd7`,aqua:`0ff`,aquamarine:`7fffd4`,azure:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`000`,blanchedalmond:`ffebcd`,blue:`00f`,blueviolet:`8a2be2`,brown:`a52a2a`,burlywood:`deb887`,burntsienna:`ea7e5d`,cadetblue:`5f9ea0`,chartreuse:`7fff00`,chocolate:`d2691e`,coral:`ff7f50`,cornflowerblue:`6495ed`,cornsilk:`fff8dc`,crimson:`dc143c`,cyan:`0ff`,darkblue:`00008b`,darkcyan:`008b8b`,darkgoldenrod:`b8860b`,darkgray:`a9a9a9`,darkgreen:`006400`,darkgrey:`a9a9a9`,darkkhaki:`bdb76b`,darkmagenta:`8b008b`,darkolivegreen:`556b2f`,darkorange:`ff8c00`,darkorchid:`9932cc`,darkred:`8b0000`,darksalmon:`e9967a`,darkseagreen:`8fbc8f`,darkslateblue:`483d8b`,darkslategray:`2f4f4f`,darkslategrey:`2f4f4f`,darkturquoise:`00ced1`,darkviolet:`9400d3`,deeppink:`ff1493`,deepskyblue:`00bfff`,dimgray:`696969`,dimgrey:`696969`,dodgerblue:`1e90ff`,firebrick:`b22222`,floralwhite:`fffaf0`,forestgreen:`228b22`,fuchsia:`f0f`,gainsboro:`dcdcdc`,ghostwhite:`f8f8ff`,gold:`ffd700`,goldenrod:`daa520`,gray:`808080`,green:`008000`,greenyellow:`adff2f`,grey:`808080`,honeydew:`f0fff0`,hotpink:`ff69b4`,indianred:`cd5c5c`,indigo:`4b0082`,ivory:`fffff0`,khaki:`f0e68c`,lavender:`e6e6fa`,lavenderblush:`fff0f5`,lawngreen:`7cfc00`,lemonchiffon:`fffacd`,lightblue:`add8e6`,lightcoral:`f08080`,lightcyan:`e0ffff`,lightgoldenrodyellow:`fafad2`,lightgray:`d3d3d3`,lightgreen:`90ee90`,lightgrey:`d3d3d3`,lightpink:`ffb6c1`,lightsalmon:`ffa07a`,lightseagreen:`20b2aa`,lightskyblue:`87cefa`,lightslategray:`789`,lightslategrey:`789`,lightsteelblue:`b0c4de`,lightyellow:`ffffe0`,lime:`0f0`,limegreen:`32cd32`,linen:`faf0e6`,magenta:`f0f`,maroon:`800000`,mediumaquamarine:`66cdaa`,mediumblue:`0000cd`,mediumorchid:`ba55d3`,mediumpurple:`9370db`,mediumseagreen:`3cb371`,mediumslateblue:`7b68ee`,mediumspringgreen:`00fa9a`,mediumturquoise:`48d1cc`,mediumvioletred:`c71585`,midnightblue:`191970`,mintcream:`f5fffa`,mistyrose:`ffe4e1`,moccasin:`ffe4b5`,navajowhite:`ffdead`,navy:`000080`,oldlace:`fdf5e6`,olive:`808000`,olivedrab:`6b8e23`,orange:`ffa500`,orangered:`ff4500`,orchid:`da70d6`,palegoldenrod:`eee8aa`,palegreen:`98fb98`,paleturquoise:`afeeee`,palevioletred:`db7093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,rebeccapurple:`663399`,red:`f00`,rosybrown:`bc8f8f`,royalblue:`4169e1`,saddlebrown:`8b4513`,salmon:`fa8072`,sandybrown:`f4a460`,seagreen:`2e8b57`,seashell:`fff5ee`,sienna:`a0522d`,silver:`c0c0c0`,skyblue:`87ceeb`,slateblue:`6a5acd`,slategray:`708090`,slategrey:`708090`,snow:`fffafa`,springgreen:`00ff7f`,steelblue:`4682b4`,tan:`d2b48c`,teal:`008080`,thistle:`d8bfd8`,tomato:`ff6347`,turquoise:`40e0d0`,violet:`ee82ee`,wheat:`f5deb3`,white:`fff`,whitesmoke:`f5f5f5`,yellow:`ff0`,yellowgreen:`9acd32`},kh=Y.hexNames=Ah(Oh);function Ah(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function jh(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Mh(e,t){Fh(e)&&(e=`100%`);var n=Ih(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Nh(e){return Math.min(1,Math.max(0,e))}function Ph(e){return parseInt(e,16)}function Fh(e){return typeof e==`string`&&e.indexOf(`.`)!=-1&&parseFloat(e)===1}function Ih(e){return typeof e==`string`&&e.indexOf(`%`)!=-1}function Lh(e){return e.length==1?`0`+e:``+e}function Rh(e){return e<=1&&(e=e*100+`%`),e}function zh(e){return Math.round(parseFloat(e)*255).toString(16)}function Bh(e){return Ph(e)/255}var Vh=function(){var e=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,t=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`,n=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`;return{CSS_UNIT:new RegExp(e),rgb:RegExp(`rgb`+t),rgba:RegExp(`rgba`+n),hsl:RegExp(`hsl`+t),hsla:RegExp(`hsla`+n),hsv:RegExp(`hsv`+t),hsva:RegExp(`hsva`+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Hh(e){return!!Vh.CSS_UNIT.exec(e)}function Uh(e){e=e.replace(ah,``).replace(oh,``).toLowerCase();var t=!1;if(Oh[e])e=Oh[e],t=!0;else if(e==`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var n;return(n=Vh.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=Vh.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Vh.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=Vh.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Vh.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=Vh.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Vh.hex8.exec(e))?{r:Ph(n[1]),g:Ph(n[2]),b:Ph(n[3]),a:Bh(n[4]),format:t?`name`:`hex8`}:(n=Vh.hex6.exec(e))?{r:Ph(n[1]),g:Ph(n[2]),b:Ph(n[3]),format:t?`name`:`hex`}:(n=Vh.hex4.exec(e))?{r:Ph(n[1]+``+n[1]),g:Ph(n[2]+``+n[2]),b:Ph(n[3]+``+n[3]),a:Bh(n[4]+``+n[4]),format:t?`name`:`hex8`}:(n=Vh.hex3.exec(e))?{r:Ph(n[1]+``+n[1]),g:Ph(n[2]+``+n[2]),b:Ph(n[3]+``+n[3]),format:t?`name`:`hex`}:!1}function Wh(e){var t,n;return e||={level:`AA`,size:`small`},t=(e.level||`AA`).toUpperCase(),n=(e.size||`small`).toLowerCase(),t!==`AA`&&t!==`AAA`&&(t=`AA`),n!==`small`&&n!==`large`&&(n=`small`),{level:t,size:n}}var Gh=function(e){var t=[`r`,`g`,`b`,`a`,`h`,`s`,`l`,`v`],n=0,r=0;return rh(t,function(t){e[t]&&(n+=1,isNaN(e[t])||(r+=1),(t===`s`||t===`l`)&&/^\d+%$/.test(e[t])&&(r+=1))}),n===r&&e},Kh=function(e,t){var n=e.hex?Y(e.hex):Y(e),r=n.toHsl(),i=n.toHsv(),a=n.toRgb(),o=n.toHex();return r.s===0&&(r.h=t||0,i.h=t||0),{hsl:r,hex:o===`000000`&&a.a===0?`transparent`:`#`+o,rgb:a,hsv:i,oldHue:e.h||t||r.h,source:e.source}},qh=function(e){if(e===`transparent`)return!0;var t=+(String(e).charAt(0)===`#`);return e.length!==4+t&&e.length<7+t&&Y(e).isValid()},Jh=function(e){if(!e)return`#fff`;var t=Kh(e);return t.hex===`transparent`?`rgba(0,0,0,0.4)`:(t.rgb.r*299+t.rgb.g*587+t.rgb.b*114)/1e3>=128?`#000`:`#fff`},Yh=function(e,t){var n=e.replace(`°`,``);return Y(t+` (`+n+`)`)._ok},Xh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zh=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Qh(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function $h(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function eg(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var tg=function(e){var t=function(t){eg(n,t);function n(e){Qh(this,n);var t=$h(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return t.handleChange=function(e,n){if(Gh(e)){var r=Kh(e,e.h||t.state.oldHue);t.setState(r),t.props.onChangeComplete&&t.debounce(t.props.onChangeComplete,r,n),t.props.onChange&&t.props.onChange(r,n)}},t.handleSwatchHover=function(e,n){if(Gh(e)){var r=Kh(e,e.h||t.state.oldHue);t.props.onSwatchHover&&t.props.onSwatchHover(r,n)}},t.state=Xh({},Kh(e.color,0)),t.debounce=zm(function(e,t,n){e(t,n)},100),t}return Zh(n,[{key:`render`,value:function(){var t={};return this.props.onSwatchHover&&(t.onSwatchHover=this.handleSwatchHover),u.default.createElement(e,Xh({},this.props,this.state,{onChange:this.handleChange},t))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return Xh({},Kh(e.color,t.oldHue))}}]),n}(u.PureComponent||u.Component);return t.propTypes=Xh({},e.propTypes),t.defaultProps=Xh({},e.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),t},ng=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rg=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function ig(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function ag(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function og(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var sg=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`span`;return function(n){og(r,n);function r(){var e,t,n,i;ig(this,r);for(var a=arguments.length,o=Array(a),s=0;s<a;s++)o[s]=arguments[s];return i=(t=(n=ag(this,(e=r.__proto__||Object.getPrototypeOf(r)).call.apply(e,[this].concat(o))),n),n.state={focus:!1},n.handleFocus=function(){return n.setState({focus:!0})},n.handleBlur=function(){return n.setState({focus:!1})},t),ag(n,i)}return rg(r,[{key:`render`,value:function(){return u.default.createElement(t,{onFocus:this.handleFocus,onBlur:this.handleBlur},u.default.createElement(e,ng({},this.props,this.state)))}}]),r}(u.default.Component)},cg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lg=13,ug=sg(function(e){var t=e.color,n=e.style,r=e.onClick,i=r===void 0?function(){}:r,a=e.onHover,o=e.title,s=o===void 0?t:o,c=e.children,l=e.focus,d=e.focusStyle,f=d===void 0?{}:d,p=t===`transparent`,m=(0,q.default)({default:{swatch:cg({background:t,height:`100%`,width:`100%`,cursor:`pointer`,position:`relative`,outline:`none`},n,l?f:{})}}),h=function(e){return i(t,e)},g=function(e){return e.keyCode===lg&&i(t,e)},_=function(e){return a(t,e)},v={};return a&&(v.onMouseOver=_),u.default.createElement(`div`,cg({style:m.swatch,onClick:h,title:s,tabIndex:0,onKeyDown:g},v),c,p&&u.default.createElement(ju,{borderRadius:m.swatch.borderRadius,boxShadow:`inset 0 0 0 1px rgba(0,0,0,0.1)`}))}),dg=function(e){var t=e.direction,n=(0,q.default)({default:{picker:{width:`18px`,height:`18px`,borderRadius:`50%`,transform:`translate(-9px, -1px)`,backgroundColor:`rgb(248, 248, 248)`,boxShadow:`0 1px 4px 0 rgba(0, 0, 0, 0.37)`}},vertical:{picker:{transform:`translate(-3px, -9px)`}}},{vertical:t===`vertical`});return u.default.createElement(`div`,{style:n.picker})},fg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pg=function(e){var t=e.rgb,n=e.hsl,r=e.width,i=e.height,a=e.onChange,o=e.direction,s=e.style,c=e.renderers,l=e.pointer,d=e.className,f=d===void 0?``:d,p=(0,q.default)({default:{picker:{position:`relative`,width:r,height:i},alpha:{radius:`2px`,style:s}}});return u.default.createElement(`div`,{style:p.picker,className:`alpha-picker `+f},u.default.createElement(Lu,fg({},p.alpha,{rgb:t,hsl:n,pointer:l,renderers:c,onChange:a,direction:o})))};pg.defaultProps={width:`316px`,height:`16px`,direction:`horizontal`,pointer:dg},tg(pg);function mg(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var hg=`__lodash_hash_undefined__`;function gg(e){return this.__data__.set(e,hg),this}function _g(e){return this.__data__.has(e)}function vg(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new _f;++t<n;)this.add(e[t])}vg.prototype.add=vg.prototype.push=gg,vg.prototype.has=_g;function yg(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function bg(e,t){return e.has(t)}var xg=1,Sg=2;function Cg(e,t,n,r,i,a){var o=n&xg,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Sg?new vg:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!yg(t,function(e,t){if(!bg(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function wg(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Tg(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Eg=1,Dg=2,Og=`[object Boolean]`,kg=`[object Date]`,Ag=`[object Error]`,jg=`[object Map]`,Mg=`[object Number]`,Ng=`[object RegExp]`,Pg=`[object Set]`,Fg=`[object String]`,Ig=`[object Symbol]`,Lg=`[object ArrayBuffer]`,Rg=`[object DataView]`,zg=vd?vd.prototype:void 0,Bg=zg?zg.valueOf:void 0;function Vg(e,t,n,r,i,a,o){switch(n){case Rg:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Lg:return!(e.byteLength!=t.byteLength||!a(new jf(e),new jf(t)));case Og:case kg:case Mg:return rd(+e,+t);case Ag:return e.name==t.name&&e.message==t.message;case Ng:case Fg:return e==t+``;case jg:var s=wg;case Pg:var c=r&Eg;if(s||=Tg,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Dg,o.set(e,t);var u=Cg(s(e),s(t),r,i,a,o);return o.delete(e),u;case Ig:if(Bg)return Bg.call(e)==Bg.call(t)}return!1}function Hg(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Ug(e,t,n){var r=t(e);return Yf(e)?r:Hg(r,n(e))}function Wg(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function Gg(){return[]}var Kg=Object.prototype.propertyIsEnumerable,qg=Object.getOwnPropertySymbols,Jg=qg?function(e){return e==null?[]:(e=Object(e),Wg(qg(e),function(t){return Kg.call(e,t)}))}:Gg;function Yg(e){return Ug(e,Qm,Jg)}var Xg=1,Zg=Object.prototype.hasOwnProperty;function Qg(e,t,n,r,i,a){var o=n&Xg,s=Yg(e),c=s.length;if(c!=Yg(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:Zg.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var $g=Xd(_d,`DataView`),e_=Xd(_d,`Promise`),t_=Xd(_d,`Set`),n_=Xd(_d,`WeakMap`),r_=`[object Map]`,i_=`[object Object]`,a_=`[object Promise]`,o_=`[object Set]`,s_=`[object WeakMap]`,c_=`[object DataView]`,l_=Bd($g),u_=Bd(Zd),d_=Bd(e_),f_=Bd(t_),p_=Bd(n_),m_=kd;($g&&m_(new $g(new ArrayBuffer(1)))!=c_||Zd&&m_(new Zd)!=r_||e_&&m_(e_.resolve())!=a_||t_&&m_(new t_)!=o_||n_&&m_(new n_)!=s_)&&(m_=function(e){var t=kd(e),n=t==i_?e.constructor:void 0,r=n?Bd(n):``;if(r)switch(r){case l_:return c_;case u_:return r_;case d_:return a_;case f_:return o_;case p_:return s_}return t});var h_=m_,g_=1,__=`[object Arguments]`,v_=`[object Array]`,y_=`[object Object]`,b_=Object.prototype.hasOwnProperty;function x_(e,t,n,r,i,a){var o=Yf(e),s=Yf(t),c=o?v_:h_(e),l=s?v_:h_(t);c=c==__?y_:c,l=l==__?y_:l;var u=c==y_,d=l==y_,f=c==l;if(f&&ip(e)){if(!ip(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new bf,o||Wp(e)?Cg(e,t,n,r,i,a):Vg(e,t,c,n,r,i,a);if(!(n&g_)){var p=u&&b_.call(e,`__wrapped__`),m=d&&b_.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new bf,i(h,g,n,r,a)}}return f?(a||=new bf,Qg(e,t,n,r,i,a)):!1}function S_(e,t,n,r,i){return e===t?!0:e==null||t==null||!Hf(e)&&!Hf(t)?e!==e&&t!==t:x_(e,t,n,r,S_,i)}var C_=1,w_=2;function T_(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new bf;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?S_(u,l,C_|w_,r,d):f))return!1}}return!0}function E_(e){return e===e&&!Ad(e)}function D_(e){for(var t=Qm(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,E_(i)]}return t}function O_(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}function k_(e){var t=D_(e);return t.length==1&&t[0][2]?O_(t[0][0],t[0][1]):function(n){return n===e||T_(n,e,t)}}var A_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j_=/^\w*$/;function M_(e,t){if(Yf(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Am(e)?!0:j_.test(e)||!A_.test(e)||t!=null&&e in Object(t)}var N_=`Expected a function`;function P_(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(N_);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(P_.Cache||_f),n}P_.Cache=_f;var F_=500;function I_(e){var t=P_(e,function(e){return n.size===F_&&n.clear(),e}),n=t.cache;return t}var L_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,R_=/\\(\\)?/g,z_=I_(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(L_,function(e,n,r,i){t.push(r?i.replace(R_,`$1`):n||e)}),t}),B_=1/0,V_=vd?vd.prototype:void 0,H_=V_?V_.toString:void 0;function U_(e){if(typeof e==`string`)return e;if(Yf(e))return mg(e,U_)+``;if(Am(e))return H_?H_.call(e):``;var t=e+``;return t==`0`&&1/e==-B_?`-0`:t}function W_(e){return e==null?``:U_(e)}function G_(e,t){return Yf(e)?e:M_(e,t)?[e]:z_(W_(e))}var K_=1/0;function q_(e){if(typeof e==`string`||Am(e))return e;var t=e+``;return t==`0`&&1/e==-K_?`-0`:t}function J_(e,t){t=G_(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[q_(t[n++])];return n&&n==r?e:void 0}function Y_(e,t,n){var r=e==null?void 0:J_(e,t);return r===void 0?n:r}function X_(e,t){return e!=null&&t in Object(e)}function Z_(e,t,n){t=G_(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=q_(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Zf(i)&&Qp(o,i)&&(Yf(e)||Jf(e)))}function Q_(e,t){return e!=null&&Z_(e,t,X_)}var $_=1,ev=2;function tv(e,t){return M_(e)&&E_(t)?O_(q_(e),t):function(n){var r=Y_(n,e);return r===void 0&&r===t?Q_(n,e):S_(t,r,$_|ev)}}function nv(e){return function(t){return t?.[e]}}function rv(e){return function(t){return J_(t,e)}}function iv(e){return M_(e)?nv(q_(e)):rv(e)}function av(e){return typeof e==`function`?e:e==null?cm:typeof e==`object`?Yf(e)?tv(e[0],e[1]):k_(e):iv(e)}function ov(e,t){var n=-1,r=Qf(e)?Array(e.length):[];return th(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function sv(e,t){return(Yf(e)?mg:ov)(e,av(t,3))}var cv=function(e){var t=e.colors,n=e.onClick,r=e.onSwatchHover,i=(0,q.default)({default:{swatches:{marginRight:`-10px`},swatch:{width:`22px`,height:`22px`,float:`left`,marginRight:`10px`,marginBottom:`10px`,borderRadius:`4px`},clear:{clear:`both`}}});return u.default.createElement(`div`,{style:i.swatches},sv(t,function(e){return u.default.createElement(ug,{key:e,color:e,style:i.swatch,onClick:n,onHover:r,focusStyle:{boxShadow:`0 0 4px `+e}})}),u.default.createElement(`div`,{style:i.clear}))},lv=function(e){var t=e.onChange,n=e.onSwatchHover,r=e.hex,i=e.colors,a=e.width,o=e.triangle,s=e.styles,c=s===void 0?{}:s,l=e.className,d=l===void 0?``:l,f=r===`transparent`,p=function(e,n){qh(e)&&t({hex:e,source:`hex`},n)},m=(0,q.default)(Sm({default:{card:{width:a,background:`#fff`,boxShadow:`0 1px rgba(0,0,0,.1)`,borderRadius:`6px`,position:`relative`},head:{height:`110px`,background:r,borderRadius:`6px 6px 0 0`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},body:{padding:`10px`},label:{fontSize:`18px`,color:Jh(r),position:`relative`},triangle:{width:`0px`,height:`0px`,borderStyle:`solid`,borderWidth:`0 10px 10px 10px`,borderColor:`transparent transparent `+r+` transparent`,position:`absolute`,top:`-10px`,left:`50%`,marginLeft:`-10px`},input:{width:`100%`,fontSize:`12px`,color:`#666`,border:`0px`,outline:`none`,height:`22px`,boxShadow:`inset 0 0 0 1px #ddd`,borderRadius:`4px`,padding:`0 7px`,boxSizing:`border-box`}},"hide-triangle":{triangle:{display:`none`}}},c),{"hide-triangle":o===`hide`});return u.default.createElement(`div`,{style:m.card,className:`block-picker `+d},u.default.createElement(`div`,{style:m.triangle}),u.default.createElement(`div`,{style:m.head},f&&u.default.createElement(ju,{borderRadius:`6px 6px 0 0`}),u.default.createElement(`div`,{style:m.label},r)),u.default.createElement(`div`,{style:m.body},u.default.createElement(cv,{colors:i,onClick:p,onSwatchHover:n}),u.default.createElement(Yu,{style:{input:m.input},value:r,onChange:p})))};lv.propTypes={width:f.default.oneOfType([f.default.string,f.default.number]),colors:f.default.arrayOf(f.default.string),triangle:f.default.oneOf([`top`,`hide`]),styles:f.default.object},lv.defaultProps={width:170,colors:[`#D9E3F0`,`#F47373`,`#697689`,`#37D67A`,`#2CCCE4`,`#555555`,`#dce775`,`#ff8a65`,`#ba68c8`],triangle:`top`,styles:{}},tg(lv);var uv={50:`#ffebee`,100:`#ffcdd2`,200:`#ef9a9a`,300:`#e57373`,400:`#ef5350`,500:`#f44336`,600:`#e53935`,700:`#d32f2f`,800:`#c62828`,900:`#b71c1c`,a100:`#ff8a80`,a200:`#ff5252`,a400:`#ff1744`,a700:`#d50000`},dv={50:`#fce4ec`,100:`#f8bbd0`,200:`#f48fb1`,300:`#f06292`,400:`#ec407a`,500:`#e91e63`,600:`#d81b60`,700:`#c2185b`,800:`#ad1457`,900:`#880e4f`,a100:`#ff80ab`,a200:`#ff4081`,a400:`#f50057`,a700:`#c51162`},fv={50:`#f3e5f5`,100:`#e1bee7`,200:`#ce93d8`,300:`#ba68c8`,400:`#ab47bc`,500:`#9c27b0`,600:`#8e24aa`,700:`#7b1fa2`,800:`#6a1b9a`,900:`#4a148c`,a100:`#ea80fc`,a200:`#e040fb`,a400:`#d500f9`,a700:`#aa00ff`},pv={50:`#ede7f6`,100:`#d1c4e9`,200:`#b39ddb`,300:`#9575cd`,400:`#7e57c2`,500:`#673ab7`,600:`#5e35b1`,700:`#512da8`,800:`#4527a0`,900:`#311b92`,a100:`#b388ff`,a200:`#7c4dff`,a400:`#651fff`,a700:`#6200ea`},mv={50:`#e8eaf6`,100:`#c5cae9`,200:`#9fa8da`,300:`#7986cb`,400:`#5c6bc0`,500:`#3f51b5`,600:`#3949ab`,700:`#303f9f`,800:`#283593`,900:`#1a237e`,a100:`#8c9eff`,a200:`#536dfe`,a400:`#3d5afe`,a700:`#304ffe`},hv={50:`#e3f2fd`,100:`#bbdefb`,200:`#90caf9`,300:`#64b5f6`,400:`#42a5f5`,500:`#2196f3`,600:`#1e88e5`,700:`#1976d2`,800:`#1565c0`,900:`#0d47a1`,a100:`#82b1ff`,a200:`#448aff`,a400:`#2979ff`,a700:`#2962ff`},gv={50:`#e1f5fe`,100:`#b3e5fc`,200:`#81d4fa`,300:`#4fc3f7`,400:`#29b6f6`,500:`#03a9f4`,600:`#039be5`,700:`#0288d1`,800:`#0277bd`,900:`#01579b`,a100:`#80d8ff`,a200:`#40c4ff`,a400:`#00b0ff`,a700:`#0091ea`},_v={50:`#e0f7fa`,100:`#b2ebf2`,200:`#80deea`,300:`#4dd0e1`,400:`#26c6da`,500:`#00bcd4`,600:`#00acc1`,700:`#0097a7`,800:`#00838f`,900:`#006064`,a100:`#84ffff`,a200:`#18ffff`,a400:`#00e5ff`,a700:`#00b8d4`},vv={50:`#e0f2f1`,100:`#b2dfdb`,200:`#80cbc4`,300:`#4db6ac`,400:`#26a69a`,500:`#009688`,600:`#00897b`,700:`#00796b`,800:`#00695c`,900:`#004d40`,a100:`#a7ffeb`,a200:`#64ffda`,a400:`#1de9b6`,a700:`#00bfa5`},yv={50:`#e8f5e9`,100:`#c8e6c9`,200:`#a5d6a7`,300:`#81c784`,400:`#66bb6a`,500:`#4caf50`,600:`#43a047`,700:`#388e3c`,800:`#2e7d32`,900:`#1b5e20`,a100:`#b9f6ca`,a200:`#69f0ae`,a400:`#00e676`,a700:`#00c853`},bv={50:`#f1f8e9`,100:`#dcedc8`,200:`#c5e1a5`,300:`#aed581`,400:`#9ccc65`,500:`#8bc34a`,600:`#7cb342`,700:`#689f38`,800:`#558b2f`,900:`#33691e`,a100:`#ccff90`,a200:`#b2ff59`,a400:`#76ff03`,a700:`#64dd17`},xv={50:`#f9fbe7`,100:`#f0f4c3`,200:`#e6ee9c`,300:`#dce775`,400:`#d4e157`,500:`#cddc39`,600:`#c0ca33`,700:`#afb42b`,800:`#9e9d24`,900:`#827717`,a100:`#f4ff81`,a200:`#eeff41`,a400:`#c6ff00`,a700:`#aeea00`},Sv={50:`#fffde7`,100:`#fff9c4`,200:`#fff59d`,300:`#fff176`,400:`#ffee58`,500:`#ffeb3b`,600:`#fdd835`,700:`#fbc02d`,800:`#f9a825`,900:`#f57f17`,a100:`#ffff8d`,a200:`#ffff00`,a400:`#ffea00`,a700:`#ffd600`},Cv={50:`#fff8e1`,100:`#ffecb3`,200:`#ffe082`,300:`#ffd54f`,400:`#ffca28`,500:`#ffc107`,600:`#ffb300`,700:`#ffa000`,800:`#ff8f00`,900:`#ff6f00`,a100:`#ffe57f`,a200:`#ffd740`,a400:`#ffc400`,a700:`#ffab00`},wv={50:`#fff3e0`,100:`#ffe0b2`,200:`#ffcc80`,300:`#ffb74d`,400:`#ffa726`,500:`#ff9800`,600:`#fb8c00`,700:`#f57c00`,800:`#ef6c00`,900:`#e65100`,a100:`#ffd180`,a200:`#ffab40`,a400:`#ff9100`,a700:`#ff6d00`},Tv={50:`#fbe9e7`,100:`#ffccbc`,200:`#ffab91`,300:`#ff8a65`,400:`#ff7043`,500:`#ff5722`,600:`#f4511e`,700:`#e64a19`,800:`#d84315`,900:`#bf360c`,a100:`#ff9e80`,a200:`#ff6e40`,a400:`#ff3d00`,a700:`#dd2c00`},Ev={50:`#efebe9`,100:`#d7ccc8`,200:`#bcaaa4`,300:`#a1887f`,400:`#8d6e63`,500:`#795548`,600:`#6d4c41`,700:`#5d4037`,800:`#4e342e`,900:`#3e2723`},Dv={50:`#eceff1`,100:`#cfd8dc`,200:`#b0bec5`,300:`#90a4ae`,400:`#78909c`,500:`#607d8b`,600:`#546e7a`,700:`#455a64`,800:`#37474f`,900:`#263238`},Ov=function(e){var t=e.color,n=e.onClick,r=e.onSwatchHover,i=e.hover,a=e.active,o=e.circleSize,s=e.circleSpacing,c=(0,q.default)({default:{swatch:{width:o,height:o,marginRight:s,marginBottom:s,transform:`scale(1)`,transition:`100ms transform ease`},Swatch:{borderRadius:`50%`,background:`transparent`,boxShadow:`inset 0 0 0 `+(o/2+1)+`px `+t,transition:`100ms box-shadow ease`}},hover:{swatch:{transform:`scale(1.2)`}},active:{Swatch:{boxShadow:`inset 0 0 0 3px `+t}}},{hover:i,active:a});return u.default.createElement(`div`,{style:c.swatch},u.default.createElement(ug,{style:c.Swatch,color:t,onClick:n,onHover:r,focusStyle:{boxShadow:c.Swatch.boxShadow+`, 0 0 5px `+t}}))};Ov.defaultProps={circleSize:28,circleSpacing:14};var kv=(0,q.handleHover)(Ov),Av=function(e){var t=e.width,n=e.onChange,r=e.onSwatchHover,i=e.colors,a=e.hex,o=e.circleSize,s=e.styles,c=s===void 0?{}:s,l=e.circleSpacing,d=e.className,f=d===void 0?``:d,p=(0,q.default)(Sm({default:{card:{width:t,display:`flex`,flexWrap:`wrap`,marginRight:-l,marginBottom:-l}}},c)),m=function(e,t){return n({hex:e,source:`hex`},t)};return u.default.createElement(`div`,{style:p.card,className:`circle-picker `+f},sv(i,function(e){return u.default.createElement(kv,{key:e,color:e,onClick:m,onSwatchHover:r,active:a===e.toLowerCase(),circleSize:o,circleSpacing:l})}))};Av.propTypes={width:f.default.oneOfType([f.default.string,f.default.number]),circleSize:f.default.number,circleSpacing:f.default.number,styles:f.default.object},Av.defaultProps={width:252,circleSize:28,circleSpacing:14,colors:[uv[500],dv[500],fv[500],pv[500],mv[500],hv[500],gv[500],_v[500],vv[500],yv[500],bv[500],xv[500],Sv[500],Cv[500],wv[500],Tv[500],Ev[500],Dv[500]],styles:{}},tg(Av);function jv(e){return e===void 0}var Mv=l(o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n=r(require("react"));function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var a=24;e.default=function(e){var r=e.fill,o=r===void 0?`currentColor`:r,s=e.width,c=s===void 0?a:s,l=e.height,u=l===void 0?a:l,d=e.style,f=d===void 0?{}:d,p=i(e,[`fill`,`width`,`height`,`style`]);return n.default.createElement(`svg`,t({viewBox:`0 0 `+a+` `+a,style:t({fill:o,width:c,height:u},f)},p),n.default.createElement(`path`,{d:`M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z`}))}}))()),Nv=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function Pv(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Fv(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function Iv(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Lv=function(e){Iv(t,e);function t(e){Pv(this,t);var n=Fv(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.toggleViews=function(){n.state.view===`hex`?n.setState({view:`rgb`}):n.state.view===`rgb`?n.setState({view:`hsl`}):n.state.view===`hsl`&&(n.props.hsl.a===1?n.setState({view:`hex`}):n.setState({view:`rgb`}))},n.handleChange=function(e,t){e.hex?qh(e.hex)&&n.props.onChange({hex:e.hex,source:`hex`},t):e.r||e.g||e.b?n.props.onChange({r:e.r||n.props.rgb.r,g:e.g||n.props.rgb.g,b:e.b||n.props.rgb.b,source:`rgb`},t):e.a?(e.a<0?e.a=0:e.a>1&&(e.a=1),n.props.onChange({h:n.props.hsl.h,s:n.props.hsl.s,l:n.props.hsl.l,a:Math.round(e.a*100)/100,source:`rgb`},t)):(e.h||e.s||e.l)&&(typeof e.s==`string`&&e.s.includes(`%`)&&(e.s=e.s.replace(`%`,``)),typeof e.l==`string`&&e.l.includes(`%`)&&(e.l=e.l.replace(`%`,``)),e.s==1?e.s=.01:e.l==1&&(e.l=.01),n.props.onChange({h:e.h||n.props.hsl.h,s:Number(jv(e.s)?n.props.hsl.s:e.s),l:Number(jv(e.l)?n.props.hsl.l:e.l),source:`hsl`},t))},n.showHighlight=function(e){e.currentTarget.style.background=`#eee`},n.hideHighlight=function(e){e.currentTarget.style.background=`transparent`},n.state=e.hsl.a!==1&&e.view===`hex`?{view:`rgb`}:{view:e.view},n}return Nv(t,[{key:`render`,value:function(){var e=this,t=(0,q.default)({default:{wrap:{paddingTop:`16px`,display:`flex`},fields:{flex:`1`,display:`flex`,marginLeft:`-6px`},field:{paddingLeft:`6px`,width:`100%`},alpha:{paddingLeft:`6px`,width:`100%`},toggle:{width:`32px`,textAlign:`right`,position:`relative`},icon:{marginRight:`-4px`,marginTop:`12px`,cursor:`pointer`,position:`relative`},iconHighlight:{position:`absolute`,width:`24px`,height:`28px`,background:`#eee`,borderRadius:`4px`,top:`10px`,left:`12px`,display:`none`},input:{fontSize:`11px`,color:`#333`,width:`100%`,borderRadius:`2px`,border:`none`,boxShadow:`inset 0 0 0 1px #dadada`,height:`21px`,textAlign:`center`},label:{textTransform:`uppercase`,fontSize:`11px`,lineHeight:`11px`,color:`#969696`,textAlign:`center`,display:`block`,marginTop:`12px`},svg:{fill:`#333`,width:`24px`,height:`24px`,border:`1px transparent solid`,borderRadius:`5px`}},disableAlpha:{alpha:{display:`none`}}},this.props,this.state),n=void 0;return this.state.view===`hex`?n=u.default.createElement(`div`,{style:t.fields,className:`flexbox-fix`},u.default.createElement(`div`,{style:t.field},u.default.createElement(Yu,{style:{input:t.input,label:t.label},label:`hex`,value:this.props.hex,onChange:this.handleChange}))):this.state.view===`rgb`?n=u.default.createElement(`div`,{style:t.fields,className:`flexbox-fix`},u.default.createElement(`div`,{style:t.field},u.default.createElement(Yu,{style:{input:t.input,label:t.label},label:`r`,value:this.props.rgb.r,onChange:this.handleChange})),u.default.createElement(`div`,{style:t.field},u.default.createElement(Yu,{style:{input:t.input,label:t.label},label:`g`,value:this.props.rgb.g,onChange:this.handleChange})),u.default.createElement(`div`,{style:t.field},u.default.createElement(Yu,{style:{input:t.input,label:t.label},label:`b`,value:this.props.rgb.b,onChange:this.handleChange})),u.default.createElement(`div`,{style:t.alpha},u.default.createElement(Yu,{style:{input:t.input,label:t.label},label:`a`,value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view===`hsl`&&(n=u.default.createElement(`div`,{style:t.fields,className:`flexbox-fix`},u.default.createElement(`div`,{style:t.field},u.default.createElement(Yu,{style:{input:t.input,label:t.label},label:`h`,value:Math.round(this.props.hsl.h),onChange:this.handleChange})),u.default.createElement(`div`,{style:t.field},u.default.createElement(Yu,{style:{input:t.input,label:t.label},label:`s`,value:Math.round(this.props.hsl.s*100)+`%`,onChange:this.handleChange})),u.default.createElement(`div`,{style:t.field},u.default.createElement(Yu,{style:{input:t.input,label:t.label},label:`l`,value:Math.round(this.props.hsl.l*100)+`%`,onChange:this.handleChange})),u.default.createElement(`div`,{style:t.alpha},u.default.createElement(Yu,{style:{input:t.input,label:t.label},label:`a`,value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),u.default.createElement(`div`,{style:t.wrap,className:`flexbox-fix`},n,u.default.createElement(`div`,{style:t.toggle},u.default.createElement(`div`,{style:t.icon,onClick:this.toggleViews,ref:function(t){return e.icon=t}},u.default.createElement(Mv.default,{style:t.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.hsl.a!==1&&t.view===`hex`?{view:`rgb`}:null}}]),t}(u.default.Component);Lv.defaultProps={view:`hex`};var Rv=function(){var e=(0,q.default)({default:{picker:{width:`12px`,height:`12px`,borderRadius:`6px`,transform:`translate(-6px, -1px)`,backgroundColor:`rgb(248, 248, 248)`,boxShadow:`0 1px 4px 0 rgba(0, 0, 0, 0.37)`}}});return u.default.createElement(`div`,{style:e.picker})},zv=function(){var e=(0,q.default)({default:{picker:{width:`12px`,height:`12px`,borderRadius:`6px`,boxShadow:`inset 0 0 0 1px #fff`,transform:`translate(-6px, -6px)`}}});return u.default.createElement(`div`,{style:e.picker})},Bv=function(e){var t=e.width,n=e.onChange,r=e.disableAlpha,i=e.rgb,a=e.hsl,o=e.hsv,s=e.hex,c=e.renderers,l=e.styles,d=l===void 0?{}:l,f=e.className,p=f===void 0?``:f,m=e.defaultView,h=(0,q.default)(Sm({default:{picker:{width:t,background:`#fff`,borderRadius:`2px`,boxShadow:`0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)`,boxSizing:`initial`,fontFamily:`Menlo`},saturation:{width:`100%`,paddingBottom:`55%`,position:`relative`,borderRadius:`2px 2px 0 0`,overflow:`hidden`},Saturation:{radius:`2px 2px 0 0`},body:{padding:`16px 16px 12px`},controls:{display:`flex`},color:{width:`32px`},swatch:{marginTop:`6px`,width:`16px`,height:`16px`,borderRadius:`8px`,position:`relative`,overflow:`hidden`},active:{absolute:`0px 0px 0px 0px`,borderRadius:`8px`,boxShadow:`inset 0 0 0 1px rgba(0,0,0,.1)`,background:`rgba(`+i.r+`, `+i.g+`, `+i.b+`, `+i.a+`)`,zIndex:`2`},toggles:{flex:`1`},hue:{height:`10px`,position:`relative`,marginBottom:`8px`},Hue:{radius:`2px`},alpha:{height:`10px`,position:`relative`},Alpha:{radius:`2px`}},disableAlpha:{color:{width:`22px`},alpha:{display:`none`},hue:{marginBottom:`0px`},swatch:{width:`10px`,height:`10px`,marginTop:`0px`}}},d),{disableAlpha:r});return u.default.createElement(`div`,{style:h.picker,className:`chrome-picker `+p},u.default.createElement(`div`,{style:h.saturation},u.default.createElement(qm,{style:h.Saturation,hsl:a,hsv:o,pointer:zv,onChange:n})),u.default.createElement(`div`,{style:h.body},u.default.createElement(`div`,{style:h.controls,className:`flexbox-fix`},u.default.createElement(`div`,{style:h.color},u.default.createElement(`div`,{style:h.swatch},u.default.createElement(`div`,{style:h.active}),u.default.createElement(ju,{renderers:c}))),u.default.createElement(`div`,{style:h.toggles},u.default.createElement(`div`,{style:h.hue},u.default.createElement(td,{style:h.Hue,hsl:a,pointer:Rv,onChange:n})),u.default.createElement(`div`,{style:h.alpha},u.default.createElement(Lu,{style:h.Alpha,rgb:i,hsl:a,pointer:Rv,renderers:c,onChange:n})))),u.default.createElement(Lv,{rgb:i,hsl:a,hex:s,view:m,onChange:n,disableAlpha:r})))};Bv.propTypes={width:f.default.oneOfType([f.default.string,f.default.number]),disableAlpha:f.default.bool,styles:f.default.object,defaultView:f.default.oneOf([`hex`,`rgb`,`hsl`])},Bv.defaultProps={width:225,disableAlpha:!1,styles:{}},tg(Bv);var Vv=function(e){var t=e.color,n=e.onClick,r=n===void 0?function(){}:n,i=e.onSwatchHover,a=e.active,o=(0,q.default)({default:{color:{background:t,width:`15px`,height:`15px`,float:`left`,marginRight:`5px`,marginBottom:`5px`,position:`relative`,cursor:`pointer`},dot:{absolute:`5px 5px 5px 5px`,background:Jh(t),borderRadius:`50%`,opacity:`0`}},active:{dot:{opacity:`1`}},"color-#FFFFFF":{color:{boxShadow:`inset 0 0 0 1px #ddd`},dot:{background:`#000`}},transparent:{dot:{background:`#000`}}},{active:a,"color-#FFFFFF":t===`#FFFFFF`,transparent:t===`transparent`});return u.default.createElement(ug,{style:o.color,color:t,onClick:r,onHover:i,focusStyle:{boxShadow:`0 0 4px `+t}},u.default.createElement(`div`,{style:o.dot}))},Hv=function(e){var t=e.hex,n=e.rgb,r=e.onChange,i=(0,q.default)({default:{fields:{display:`flex`,paddingBottom:`6px`,paddingRight:`5px`,position:`relative`},active:{position:`absolute`,top:`6px`,left:`5px`,height:`9px`,width:`9px`,background:t},HEXwrap:{flex:`6`,position:`relative`},HEXinput:{width:`80%`,padding:`0px`,paddingLeft:`20%`,border:`none`,outline:`none`,background:`none`,fontSize:`12px`,color:`#333`,height:`16px`},HEXlabel:{display:`none`},RGBwrap:{flex:`3`,position:`relative`},RGBinput:{width:`70%`,padding:`0px`,paddingLeft:`30%`,border:`none`,outline:`none`,background:`none`,fontSize:`12px`,color:`#333`,height:`16px`},RGBlabel:{position:`absolute`,top:`3px`,left:`0px`,lineHeight:`16px`,textTransform:`uppercase`,fontSize:`12px`,color:`#999`}}}),a=function(e,t){e.r||e.g||e.b?r({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,source:`rgb`},t):r({hex:e.hex,source:`hex`},t)};return u.default.createElement(`div`,{style:i.fields,className:`flexbox-fix`},u.default.createElement(`div`,{style:i.active}),u.default.createElement(Yu,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:`hex`,value:t,onChange:a}),u.default.createElement(Yu,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:`r`,value:n.r,onChange:a}),u.default.createElement(Yu,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:`g`,value:n.g,onChange:a}),u.default.createElement(Yu,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:`b`,value:n.b,onChange:a}))},Uv=function(e){var t=e.onChange,n=e.onSwatchHover,r=e.colors,i=e.hex,a=e.rgb,o=e.styles,s=o===void 0?{}:o,c=e.className,l=c===void 0?``:c,d=(0,q.default)(Sm({default:{Compact:{background:`#f6f6f6`,radius:`4px`},compact:{paddingTop:`5px`,paddingLeft:`5px`,boxSizing:`initial`,width:`240px`},clear:{clear:`both`}}},s)),f=function(e,n){e.hex?qh(e.hex)&&t({hex:e.hex,source:`hex`},n):t(e,n)};return u.default.createElement(Cm,{style:d.Compact,styles:s},u.default.createElement(`div`,{style:d.compact,className:`compact-picker `+l},u.default.createElement(`div`,null,sv(r,function(e){return u.default.createElement(Vv,{key:e,color:e,active:e.toLowerCase()===i,onClick:f,onSwatchHover:n})}),u.default.createElement(`div`,{style:d.clear})),u.default.createElement(Hv,{hex:i,rgb:a,onChange:f})))};Uv.propTypes={colors:f.default.arrayOf(f.default.string),styles:f.default.object},Uv.defaultProps={colors:`#4D4D4D.#999999.#FFFFFF.#F44E3B.#FE9200.#FCDC00.#DBDF00.#A4DD00.#68CCCA.#73D8FF.#AEA1FF.#FDA1FF.#333333.#808080.#cccccc.#D33115.#E27300.#FCC400.#B0BC00.#68BC00.#16A5A5.#009CE0.#7B64FF.#FA28FF.#000000.#666666.#B3B3B3.#9F0500.#C45100.#FB9E00.#808900.#194D33.#0C797D.#0062B1.#653294.#AB149E`.split(`.`),styles:{}},tg(Uv);var Wv=(0,q.handleHover)(function(e){var t=e.hover,n=e.color,r=e.onClick,i=e.onSwatchHover,a={position:`relative`,zIndex:`2`,outline:`2px solid #fff`,boxShadow:`0 0 5px 2px rgba(0,0,0,0.25)`},o=(0,q.default)({default:{swatch:{width:`25px`,height:`25px`,fontSize:`0`}},hover:{swatch:a}},{hover:t});return u.default.createElement(`div`,{style:o.swatch},u.default.createElement(ug,{color:n,onClick:r,onHover:i,focusStyle:a}))}),Gv=function(e){var t=e.width,n=e.colors,r=e.onChange,i=e.onSwatchHover,a=e.triangle,o=e.styles,s=o===void 0?{}:o,c=e.className,l=c===void 0?``:c,d=(0,q.default)(Sm({default:{card:{width:t,background:`#fff`,border:`1px solid rgba(0,0,0,0.2)`,boxShadow:`0 3px 12px rgba(0,0,0,0.15)`,borderRadius:`4px`,position:`relative`,padding:`5px`,display:`flex`,flexWrap:`wrap`},triangle:{position:`absolute`,border:`7px solid transparent`,borderBottomColor:`#fff`},triangleShadow:{position:`absolute`,border:`8px solid transparent`,borderBottomColor:`rgba(0,0,0,0.15)`}},"hide-triangle":{triangle:{display:`none`},triangleShadow:{display:`none`}},"top-left-triangle":{triangle:{top:`-14px`,left:`10px`},triangleShadow:{top:`-16px`,left:`9px`}},"top-right-triangle":{triangle:{top:`-14px`,right:`10px`},triangleShadow:{top:`-16px`,right:`9px`}},"bottom-left-triangle":{triangle:{top:`35px`,left:`10px`,transform:`rotate(180deg)`},triangleShadow:{top:`37px`,left:`9px`,transform:`rotate(180deg)`}},"bottom-right-triangle":{triangle:{top:`35px`,right:`10px`,transform:`rotate(180deg)`},triangleShadow:{top:`37px`,right:`9px`,transform:`rotate(180deg)`}}},s),{"hide-triangle":a===`hide`,"top-left-triangle":a===`top-left`,"top-right-triangle":a===`top-right`,"bottom-left-triangle":a===`bottom-left`,"bottom-right-triangle":a===`bottom-right`}),f=function(e,t){return r({hex:e,source:`hex`},t)};return u.default.createElement(`div`,{style:d.card,className:`github-picker `+l},u.default.createElement(`div`,{style:d.triangleShadow}),u.default.createElement(`div`,{style:d.triangle}),sv(n,function(e){return u.default.createElement(Wv,{color:e,key:e,onClick:f,onSwatchHover:i})}))};Gv.propTypes={width:f.default.oneOfType([f.default.string,f.default.number]),colors:f.default.arrayOf(f.default.string),triangle:f.default.oneOf([`hide`,`top-left`,`top-right`,`bottom-left`,`bottom-right`]),styles:f.default.object},Gv.defaultProps={width:200,colors:[`#B80000`,`#DB3E00`,`#FCCB00`,`#008B02`,`#006B76`,`#1273DE`,`#004DCF`,`#5300EB`,`#EB9694`,`#FAD0C3`,`#FEF3BD`,`#C1E1C5`,`#BEDADC`,`#C4DEF6`,`#BED3F3`,`#D4C4FB`],triangle:`top-left`,styles:{}},tg(Gv);var Kv=function(e){var t=e.direction,n=(0,q.default)({default:{picker:{width:`18px`,height:`18px`,borderRadius:`50%`,transform:`translate(-9px, -1px)`,backgroundColor:`rgb(248, 248, 248)`,boxShadow:`0 1px 4px 0 rgba(0, 0, 0, 0.37)`}},vertical:{picker:{transform:`translate(-3px, -9px)`}}},{vertical:t===`vertical`});return u.default.createElement(`div`,{style:n.picker})},qv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jv=function(e){var t=e.width,n=e.height,r=e.onChange,i=e.hsl,a=e.direction,o=e.pointer,s=e.styles,c=s===void 0?{}:s,l=e.className,d=l===void 0?``:l,f=(0,q.default)(Sm({default:{picker:{position:`relative`,width:t,height:n},hue:{radius:`2px`}}},c));return u.default.createElement(`div`,{style:f.picker,className:`hue-picker `+d},u.default.createElement(td,qv({},f.hue,{hsl:i,pointer:o,onChange:function(e){return r({a:1,h:e.h,l:.5,s:1})},direction:a})))};Jv.propTypes={styles:f.default.object},Jv.defaultProps={width:`316px`,height:`16px`,direction:`horizontal`,pointer:Kv,styles:{}},tg(Jv),tg(function(e){var t=e.onChange,n=e.hex,r=e.rgb,i=e.styles,a=i===void 0?{}:i,o=e.className,s=o===void 0?``:o,c=(0,q.default)(Sm({default:{material:{width:`98px`,height:`98px`,padding:`16px`,fontFamily:`Roboto`},HEXwrap:{position:`relative`},HEXinput:{width:`100%`,marginTop:`12px`,fontSize:`15px`,color:`#333`,padding:`0px`,border:`0px`,borderBottom:`2px solid `+n,outline:`none`,height:`30px`},HEXlabel:{position:`absolute`,top:`0px`,left:`0px`,fontSize:`11px`,color:`#999999`,textTransform:`capitalize`},Hex:{style:{}},RGBwrap:{position:`relative`},RGBinput:{width:`100%`,marginTop:`12px`,fontSize:`15px`,color:`#333`,padding:`0px`,border:`0px`,borderBottom:`1px solid #eee`,outline:`none`,height:`30px`},RGBlabel:{position:`absolute`,top:`0px`,left:`0px`,fontSize:`11px`,color:`#999999`,textTransform:`capitalize`},split:{display:`flex`,marginRight:`-10px`,paddingTop:`11px`},third:{flex:`1`,paddingRight:`10px`}}},a)),l=function(e,n){e.hex?qh(e.hex)&&t({hex:e.hex,source:`hex`},n):(e.r||e.g||e.b)&&t({r:e.r||r.r,g:e.g||r.g,b:e.b||r.b,source:`rgb`},n)};return u.default.createElement(Cm,{styles:a},u.default.createElement(`div`,{style:c.material,className:`material-picker `+s},u.default.createElement(Yu,{style:{wrap:c.HEXwrap,input:c.HEXinput,label:c.HEXlabel},label:`hex`,value:n,onChange:l}),u.default.createElement(`div`,{style:c.split,className:`flexbox-fix`},u.default.createElement(`div`,{style:c.third},u.default.createElement(Yu,{style:{wrap:c.RGBwrap,input:c.RGBinput,label:c.RGBlabel},label:`r`,value:r.r,onChange:l})),u.default.createElement(`div`,{style:c.third},u.default.createElement(Yu,{style:{wrap:c.RGBwrap,input:c.RGBinput,label:c.RGBlabel},label:`g`,value:r.g,onChange:l})),u.default.createElement(`div`,{style:c.third},u.default.createElement(Yu,{style:{wrap:c.RGBwrap,input:c.RGBinput,label:c.RGBlabel},label:`b`,value:r.b,onChange:l})))))});var Yv=function(e){var t=e.onChange,n=e.rgb,r=e.hsv,i=e.hex,a=(0,q.default)({default:{fields:{paddingTop:`5px`,paddingBottom:`9px`,width:`80px`,position:`relative`},divider:{height:`5px`},RGBwrap:{position:`relative`},RGBinput:{marginLeft:`40%`,width:`40%`,height:`18px`,border:`1px solid #888888`,boxShadow:`inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC`,marginBottom:`5px`,fontSize:`13px`,paddingLeft:`3px`,marginRight:`10px`},RGBlabel:{left:`0px`,top:`0px`,width:`34px`,textTransform:`uppercase`,fontSize:`13px`,height:`18px`,lineHeight:`22px`,position:`absolute`},HEXwrap:{position:`relative`},HEXinput:{marginLeft:`20%`,width:`80%`,height:`18px`,border:`1px solid #888888`,boxShadow:`inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC`,marginBottom:`6px`,fontSize:`13px`,paddingLeft:`3px`},HEXlabel:{position:`absolute`,top:`0px`,left:`0px`,width:`14px`,textTransform:`uppercase`,fontSize:`13px`,height:`18px`,lineHeight:`22px`},fieldSymbols:{position:`absolute`,top:`5px`,right:`-7px`,fontSize:`13px`},symbol:{height:`20px`,lineHeight:`22px`,paddingBottom:`7px`}}}),o=function(e,i){e[`#`]?qh(e[`#`])&&t({hex:e[`#`],source:`hex`},i):e.r||e.g||e.b?t({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,source:`rgb`},i):(e.h||e.s||e.v)&&t({h:e.h||r.h,s:e.s||r.s,v:e.v||r.v,source:`hsv`},i)};return u.default.createElement(`div`,{style:a.fields},u.default.createElement(Yu,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:`h`,value:Math.round(r.h),onChange:o}),u.default.createElement(Yu,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:`s`,value:Math.round(r.s*100),onChange:o}),u.default.createElement(Yu,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:`v`,value:Math.round(r.v*100),onChange:o}),u.default.createElement(`div`,{style:a.divider}),u.default.createElement(Yu,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:`r`,value:n.r,onChange:o}),u.default.createElement(Yu,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:`g`,value:n.g,onChange:o}),u.default.createElement(Yu,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:`b`,value:n.b,onChange:o}),u.default.createElement(`div`,{style:a.divider}),u.default.createElement(Yu,{style:{wrap:a.HEXwrap,input:a.HEXinput,label:a.HEXlabel},label:`#`,value:i.replace(`#`,``),onChange:o}),u.default.createElement(`div`,{style:a.fieldSymbols},u.default.createElement(`div`,{style:a.symbol},`°`),u.default.createElement(`div`,{style:a.symbol},`%`),u.default.createElement(`div`,{style:a.symbol},`%`)))},Xv=function(e){var t=e.hsl,n=(0,q.default)({default:{picker:{width:`12px`,height:`12px`,borderRadius:`6px`,boxShadow:`inset 0 0 0 1px #fff`,transform:`translate(-6px, -6px)`}},"black-outline":{picker:{boxShadow:`inset 0 0 0 1px #000`}}},{"black-outline":t.l>.5});return u.default.createElement(`div`,{style:n.picker})},Zv=function(){var e=(0,q.default)({default:{triangle:{width:0,height:0,borderStyle:`solid`,borderWidth:`4px 0 4px 6px`,borderColor:`transparent transparent transparent #fff`,position:`absolute`,top:`1px`,left:`1px`},triangleBorder:{width:0,height:0,borderStyle:`solid`,borderWidth:`5px 0 5px 8px`,borderColor:`transparent transparent transparent #555`},left:{Extend:`triangleBorder`,transform:`translate(-13px, -4px)`},leftInside:{Extend:`triangle`,transform:`translate(-8px, -5px)`},right:{Extend:`triangleBorder`,transform:`translate(20px, -14px) rotate(180deg)`},rightInside:{Extend:`triangle`,transform:`translate(-8px, -5px)`}}});return u.default.createElement(`div`,{style:e.pointer},u.default.createElement(`div`,{style:e.left},u.default.createElement(`div`,{style:e.leftInside})),u.default.createElement(`div`,{style:e.right},u.default.createElement(`div`,{style:e.rightInside})))},Qv=function(e){var t=e.onClick,n=e.label,r=e.children,i=e.active,a=(0,q.default)({default:{button:{backgroundImage:`linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)`,border:`1px solid #878787`,borderRadius:`2px`,height:`20px`,boxShadow:`0 1px 0 0 #EAEAEA`,fontSize:`14px`,color:`#000`,lineHeight:`20px`,textAlign:`center`,marginBottom:`10px`,cursor:`pointer`}},active:{button:{boxShadow:`0 0 0 1px #878787`}}},{active:i});return u.default.createElement(`div`,{style:a.button,onClick:t},n||r)},$v=function(e){var t=e.rgb,n=e.currentColor,r=(0,q.default)({default:{swatches:{border:`1px solid #B3B3B3`,borderBottom:`1px solid #F0F0F0`,marginBottom:`2px`,marginTop:`1px`},new:{height:`34px`,background:`rgb(`+t.r+`,`+t.g+`, `+t.b+`)`,boxShadow:`inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000`},current:{height:`34px`,background:n,boxShadow:`inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000`},label:{fontSize:`14px`,color:`#000`,textAlign:`center`}}});return u.default.createElement(`div`,null,u.default.createElement(`div`,{style:r.label},`new`),u.default.createElement(`div`,{style:r.swatches},u.default.createElement(`div`,{style:r.new}),u.default.createElement(`div`,{style:r.current})),u.default.createElement(`div`,{style:r.label},`current`))},ey=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function ty(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function ny(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function ry(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var iy=function(e){ry(t,e);function t(e){ty(this,t);var n=ny(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.state={currentColor:e.hex},n}return ey(t,[{key:`render`,value:function(){var e=this.props,t=e.styles,n=t===void 0?{}:t,r=e.className,i=r===void 0?``:r,a=(0,q.default)(Sm({default:{picker:{background:`#DCDCDC`,borderRadius:`4px`,boxShadow:`0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15)`,boxSizing:`initial`,width:`513px`},head:{backgroundImage:`linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%)`,borderBottom:`1px solid #B1B1B1`,boxShadow:`inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02)`,height:`23px`,lineHeight:`24px`,borderRadius:`4px 4px 0 0`,fontSize:`13px`,color:`#4D4D4D`,textAlign:`center`},body:{padding:`15px 15px 0`,display:`flex`},saturation:{width:`256px`,height:`256px`,position:`relative`,border:`2px solid #B3B3B3`,borderBottom:`2px solid #F0F0F0`,overflow:`hidden`},hue:{position:`relative`,height:`256px`,width:`19px`,marginLeft:`10px`,border:`2px solid #B3B3B3`,borderBottom:`2px solid #F0F0F0`},controls:{width:`180px`,marginLeft:`10px`},top:{display:`flex`},previews:{width:`60px`},actions:{flex:`1`,marginLeft:`20px`}}},n));return u.default.createElement(`div`,{style:a.picker,className:`photoshop-picker `+i},u.default.createElement(`div`,{style:a.head},this.props.header),u.default.createElement(`div`,{style:a.body,className:`flexbox-fix`},u.default.createElement(`div`,{style:a.saturation},u.default.createElement(qm,{hsl:this.props.hsl,hsv:this.props.hsv,pointer:Xv,onChange:this.props.onChange})),u.default.createElement(`div`,{style:a.hue},u.default.createElement(td,{direction:`vertical`,hsl:this.props.hsl,pointer:Zv,onChange:this.props.onChange})),u.default.createElement(`div`,{style:a.controls},u.default.createElement(`div`,{style:a.top,className:`flexbox-fix`},u.default.createElement(`div`,{style:a.previews},u.default.createElement($v,{rgb:this.props.rgb,currentColor:this.state.currentColor})),u.default.createElement(`div`,{style:a.actions},u.default.createElement(Qv,{label:`OK`,onClick:this.props.onAccept,active:!0}),u.default.createElement(Qv,{label:`Cancel`,onClick:this.props.onCancel}),u.default.createElement(Yv,{onChange:this.props.onChange,rgb:this.props.rgb,hsv:this.props.hsv,hex:this.props.hex}))))))}}]),t}(u.default.Component);iy.propTypes={header:f.default.string,styles:f.default.object},iy.defaultProps={header:`Color Picker`,styles:{}},tg(iy);var ay=function(e){var t=e.onChange,n=e.rgb,r=e.hsl,i=e.hex,a=e.disableAlpha,o=(0,q.default)({default:{fields:{display:`flex`,paddingTop:`4px`},single:{flex:`1`,paddingLeft:`6px`},alpha:{flex:`1`,paddingLeft:`6px`},double:{flex:`2`},input:{width:`80%`,padding:`4px 10% 3px`,border:`none`,boxShadow:`inset 0 0 0 1px #ccc`,fontSize:`11px`},label:{display:`block`,textAlign:`center`,fontSize:`11px`,color:`#222`,paddingTop:`3px`,paddingBottom:`4px`,textTransform:`capitalize`}},disableAlpha:{alpha:{display:`none`}}},{disableAlpha:a}),s=function(e,i){e.hex?qh(e.hex)&&t({hex:e.hex,source:`hex`},i):e.r||e.g||e.b?t({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,a:n.a,source:`rgb`},i):e.a&&(e.a<0?e.a=0:e.a>100&&(e.a=100),e.a/=100,t({h:r.h,s:r.s,l:r.l,a:e.a,source:`rgb`},i))};return u.default.createElement(`div`,{style:o.fields,className:`flexbox-fix`},u.default.createElement(`div`,{style:o.double},u.default.createElement(Yu,{style:{input:o.input,label:o.label},label:`hex`,value:i.replace(`#`,``),onChange:s})),u.default.createElement(`div`,{style:o.single},u.default.createElement(Yu,{style:{input:o.input,label:o.label},label:`r`,value:n.r,onChange:s,dragLabel:`true`,dragMax:`255`})),u.default.createElement(`div`,{style:o.single},u.default.createElement(Yu,{style:{input:o.input,label:o.label},label:`g`,value:n.g,onChange:s,dragLabel:`true`,dragMax:`255`})),u.default.createElement(`div`,{style:o.single},u.default.createElement(Yu,{style:{input:o.input,label:o.label},label:`b`,value:n.b,onChange:s,dragLabel:`true`,dragMax:`255`})),u.default.createElement(`div`,{style:o.alpha},u.default.createElement(Yu,{style:{input:o.input,label:o.label},label:`a`,value:Math.round(n.a*100),onChange:s,dragLabel:`true`,dragMax:`100`})))},oy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sy=function(e){var t=e.colors,n=e.onClick,r=n===void 0?function(){}:n,i=e.onSwatchHover,a=(0,q.default)({default:{colors:{margin:`0 -10px`,padding:`10px 0 0 10px`,borderTop:`1px solid #eee`,display:`flex`,flexWrap:`wrap`,position:`relative`},swatchWrap:{width:`16px`,height:`16px`,margin:`0 10px 10px 0`},swatch:{borderRadius:`3px`,boxShadow:`inset 0 0 0 1px rgba(0,0,0,.15)`}},"no-presets":{colors:{display:`none`}}},{"no-presets":!t||!t.length}),o=function(e,t){r({hex:e,source:`hex`},t)};return u.default.createElement(`div`,{style:a.colors,className:`flexbox-fix`},t.map(function(e){var t=typeof e==`string`?{color:e}:e,n=``+t.color+(t.title||``);return u.default.createElement(`div`,{key:n,style:a.swatchWrap},u.default.createElement(ug,oy({},t,{style:a.swatch,onClick:o,onHover:i,focusStyle:{boxShadow:`inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px `+t.color}})))}))};sy.propTypes={colors:f.default.arrayOf(f.default.oneOfType([f.default.string,f.default.shape({color:f.default.string,title:f.default.string})])).isRequired};var cy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ly=function(e){var t=e.width,n=e.rgb,r=e.hex,i=e.hsv,a=e.hsl,o=e.onChange,s=e.onSwatchHover,c=e.disableAlpha,l=e.presetColors,d=e.renderers,f=e.styles,p=f===void 0?{}:f,m=e.className,h=m===void 0?``:m,g=(0,q.default)(Sm({default:cy({picker:{width:t,padding:`10px 10px 0`,boxSizing:`initial`,background:`#fff`,borderRadius:`4px`,boxShadow:`0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)`},saturation:{width:`100%`,paddingBottom:`75%`,position:`relative`,overflow:`hidden`},Saturation:{radius:`3px`,shadow:`inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)`},controls:{display:`flex`},sliders:{padding:`4px 0`,flex:`1`},color:{width:`24px`,height:`24px`,position:`relative`,marginTop:`4px`,marginLeft:`4px`,borderRadius:`3px`},activeColor:{absolute:`0px 0px 0px 0px`,borderRadius:`2px`,background:`rgba(`+n.r+`,`+n.g+`,`+n.b+`,`+n.a+`)`,boxShadow:`inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)`},hue:{position:`relative`,height:`10px`,overflow:`hidden`},Hue:{radius:`2px`,shadow:`inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)`},alpha:{position:`relative`,height:`10px`,marginTop:`4px`,overflow:`hidden`},Alpha:{radius:`2px`,shadow:`inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)`}},p),disableAlpha:{color:{height:`10px`},hue:{height:`10px`},alpha:{display:`none`}}},p),{disableAlpha:c});return u.default.createElement(`div`,{style:g.picker,className:`sketch-picker `+h},u.default.createElement(`div`,{style:g.saturation},u.default.createElement(qm,{style:g.Saturation,hsl:a,hsv:i,onChange:o})),u.default.createElement(`div`,{style:g.controls,className:`flexbox-fix`},u.default.createElement(`div`,{style:g.sliders},u.default.createElement(`div`,{style:g.hue},u.default.createElement(td,{style:g.Hue,hsl:a,onChange:o})),u.default.createElement(`div`,{style:g.alpha},u.default.createElement(Lu,{style:g.Alpha,rgb:n,hsl:a,renderers:d,onChange:o}))),u.default.createElement(`div`,{style:g.color},u.default.createElement(ju,null),u.default.createElement(`div`,{style:g.activeColor}))),u.default.createElement(ay,{rgb:n,hsl:a,hex:r,onChange:o,disableAlpha:c}),u.default.createElement(sy,{colors:l,onClick:o,onSwatchHover:s}))};ly.propTypes={disableAlpha:f.default.bool,width:f.default.oneOfType([f.default.string,f.default.number]),styles:f.default.object},ly.defaultProps={disableAlpha:!1,width:200,styles:{},presetColors:[`#D0021B`,`#F5A623`,`#F8E71C`,`#8B572A`,`#7ED321`,`#417505`,`#BD10E0`,`#9013FE`,`#4A90E2`,`#50E3C2`,`#B8E986`,`#000000`,`#4A4A4A`,`#9B9B9B`,`#FFFFFF`]};var uy=tg(ly),dy=function(e){var t=e.hsl,n=e.offset,r=e.onClick,i=r===void 0?function(){}:r,a=e.active,o=e.first,s=e.last,c=(0,q.default)({default:{swatch:{height:`12px`,background:`hsl(`+t.h+`, 50%, `+n*100+`%)`,cursor:`pointer`}},first:{swatch:{borderRadius:`2px 0 0 2px`}},last:{swatch:{borderRadius:`0 2px 2px 0`}},active:{swatch:{transform:`scaleY(1.8)`,borderRadius:`3.6px/2px`}}},{active:a,first:o,last:s});return u.default.createElement(`div`,{style:c.swatch,onClick:function(e){return i({h:t.h,s:.5,l:n,source:`hsl`},e)}})},fy=function(e){var t=e.onClick,n=e.hsl,r=(0,q.default)({default:{swatches:{marginTop:`20px`},swatch:{boxSizing:`border-box`,width:`20%`,paddingRight:`1px`,float:`left`},clear:{clear:`both`}}}),i=.1;return u.default.createElement(`div`,{style:r.swatches},u.default.createElement(`div`,{style:r.swatch},u.default.createElement(dy,{hsl:n,offset:`.80`,active:Math.abs(n.l-.8)<i&&Math.abs(n.s-.5)<i,onClick:t,first:!0})),u.default.createElement(`div`,{style:r.swatch},u.default.createElement(dy,{hsl:n,offset:`.65`,active:Math.abs(n.l-.65)<i&&Math.abs(n.s-.5)<i,onClick:t})),u.default.createElement(`div`,{style:r.swatch},u.default.createElement(dy,{hsl:n,offset:`.50`,active:Math.abs(n.l-.5)<i&&Math.abs(n.s-.5)<i,onClick:t})),u.default.createElement(`div`,{style:r.swatch},u.default.createElement(dy,{hsl:n,offset:`.35`,active:Math.abs(n.l-.35)<i&&Math.abs(n.s-.5)<i,onClick:t})),u.default.createElement(`div`,{style:r.swatch},u.default.createElement(dy,{hsl:n,offset:`.20`,active:Math.abs(n.l-.2)<i&&Math.abs(n.s-.5)<i,onClick:t,last:!0})),u.default.createElement(`div`,{style:r.clear}))},py=function(){var e=(0,q.default)({default:{picker:{width:`14px`,height:`14px`,borderRadius:`6px`,transform:`translate(-7px, -1px)`,backgroundColor:`rgb(248, 248, 248)`,boxShadow:`0 1px 4px 0 rgba(0, 0, 0, 0.37)`}}});return u.default.createElement(`div`,{style:e.picker})},my=function(e){var t=e.hsl,n=e.onChange,r=e.pointer,i=e.styles,a=i===void 0?{}:i,o=e.className,s=o===void 0?``:o,c=(0,q.default)(Sm({default:{hue:{height:`12px`,position:`relative`},Hue:{radius:`2px`}}},a));return u.default.createElement(`div`,{style:c.wrap||{},className:`slider-picker `+s},u.default.createElement(`div`,{style:c.hue},u.default.createElement(td,{style:c.Hue,hsl:t,pointer:r,onChange:n})),u.default.createElement(`div`,{style:c.swatches},u.default.createElement(fy,{hsl:t,onClick:n})))};my.propTypes={styles:f.default.object},my.defaultProps={pointer:py,styles:{}},tg(my);var hy=l(o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n=r(require("react"));function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var a=24;e.default=function(e){var r=e.fill,o=r===void 0?`currentColor`:r,s=e.width,c=s===void 0?a:s,l=e.height,u=l===void 0?a:l,d=e.style,f=d===void 0?{}:d,p=i(e,[`fill`,`width`,`height`,`style`]);return n.default.createElement(`svg`,t({viewBox:`0 0 `+a+` `+a,style:t({fill:o,width:c,height:u},f)},p),n.default.createElement(`path`,{d:`M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z`}))}}))()),gy=function(e){var t=e.color,n=e.onClick,r=n===void 0?function(){}:n,i=e.onSwatchHover,a=e.first,o=e.last,s=e.active,c=(0,q.default)({default:{color:{width:`40px`,height:`24px`,cursor:`pointer`,background:t,marginBottom:`1px`},check:{color:Jh(t),marginLeft:`8px`,display:`none`}},first:{color:{overflow:`hidden`,borderRadius:`2px 2px 0 0`}},last:{color:{overflow:`hidden`,borderRadius:`0 0 2px 2px`}},active:{check:{display:`block`}},"color-#FFFFFF":{color:{boxShadow:`inset 0 0 0 1px #ddd`},check:{color:`#333`}},transparent:{check:{color:`#333`}}},{first:a,last:o,active:s,"color-#FFFFFF":t===`#FFFFFF`,transparent:t===`transparent`});return u.default.createElement(ug,{color:t,style:c.color,onClick:r,onHover:i,focusStyle:{boxShadow:`0 0 4px `+t}},u.default.createElement(`div`,{style:c.check},u.default.createElement(hy.default,null)))},_y=function(e){var t=e.onClick,n=e.onSwatchHover,r=e.group,i=e.active,a=(0,q.default)({default:{group:{paddingBottom:`10px`,width:`40px`,float:`left`,marginRight:`10px`}}});return u.default.createElement(`div`,{style:a.group},sv(r,function(e,a){return u.default.createElement(gy,{key:e,color:e,active:e.toLowerCase()===i,first:a===0,last:a===r.length-1,onClick:t,onSwatchHover:n})}))},vy=function(e){var t=e.width,n=e.height,r=e.onChange,i=e.onSwatchHover,a=e.colors,o=e.hex,s=e.styles,c=s===void 0?{}:s,l=e.className,d=l===void 0?``:l,f=(0,q.default)(Sm({default:{picker:{width:t,height:n},overflow:{height:n,overflowY:`scroll`},body:{padding:`16px 0 6px 16px`},clear:{clear:`both`}}},c)),p=function(e,t){return r({hex:e,source:`hex`},t)};return u.default.createElement(`div`,{style:f.picker,className:`swatches-picker `+d},u.default.createElement(Cm,null,u.default.createElement(`div`,{style:f.overflow},u.default.createElement(`div`,{style:f.body},sv(a,function(e){return u.default.createElement(_y,{key:e.toString(),group:e,active:o,onClick:p,onSwatchHover:i})}),u.default.createElement(`div`,{style:f.clear})))))};vy.propTypes={width:f.default.oneOfType([f.default.string,f.default.number]),height:f.default.oneOfType([f.default.string,f.default.number]),colors:f.default.arrayOf(f.default.arrayOf(f.default.string)),styles:f.default.object},vy.defaultProps={width:320,height:240,colors:[[uv[900],uv[700],uv[500],uv[300],uv[100]],[dv[900],dv[700],dv[500],dv[300],dv[100]],[fv[900],fv[700],fv[500],fv[300],fv[100]],[pv[900],pv[700],pv[500],pv[300],pv[100]],[mv[900],mv[700],mv[500],mv[300],mv[100]],[hv[900],hv[700],hv[500],hv[300],hv[100]],[gv[900],gv[700],gv[500],gv[300],gv[100]],[_v[900],_v[700],_v[500],_v[300],_v[100]],[vv[900],vv[700],vv[500],vv[300],vv[100]],[`#194D33`,yv[700],yv[500],yv[300],yv[100]],[bv[900],bv[700],bv[500],bv[300],bv[100]],[xv[900],xv[700],xv[500],xv[300],xv[100]],[Sv[900],Sv[700],Sv[500],Sv[300],Sv[100]],[Cv[900],Cv[700],Cv[500],Cv[300],Cv[100]],[wv[900],wv[700],wv[500],wv[300],wv[100]],[Tv[900],Tv[700],Tv[500],Tv[300],Tv[100]],[Ev[900],Ev[700],Ev[500],Ev[300],Ev[100]],[Dv[900],Dv[700],Dv[500],Dv[300],Dv[100]],[`#000000`,`#525252`,`#969696`,`#D9D9D9`,`#FFFFFF`]],styles:{}},tg(vy);var yy=function(e){var t=e.onChange,n=e.onSwatchHover,r=e.hex,i=e.colors,a=e.width,o=e.triangle,s=e.styles,c=s===void 0?{}:s,l=e.className,d=l===void 0?``:l,f=(0,q.default)(Sm({default:{card:{width:a,background:`#fff`,border:`0 solid rgba(0,0,0,0.25)`,boxShadow:`0 1px 4px rgba(0,0,0,0.25)`,borderRadius:`4px`,position:`relative`},body:{padding:`15px 9px 9px 15px`},label:{fontSize:`18px`,color:`#fff`},triangle:{width:`0px`,height:`0px`,borderStyle:`solid`,borderWidth:`0 9px 10px 9px`,borderColor:`transparent transparent #fff transparent`,position:`absolute`},triangleShadow:{width:`0px`,height:`0px`,borderStyle:`solid`,borderWidth:`0 9px 10px 9px`,borderColor:`transparent transparent rgba(0,0,0,.1) transparent`,position:`absolute`},hash:{background:`#F0F0F0`,height:`30px`,width:`30px`,borderRadius:`4px 0 0 4px`,float:`left`,color:`#98A1A4`,display:`flex`,alignItems:`center`,justifyContent:`center`},input:{width:`100px`,fontSize:`14px`,color:`#666`,border:`0px`,outline:`none`,height:`28px`,boxShadow:`inset 0 0 0 1px #F0F0F0`,boxSizing:`content-box`,borderRadius:`0 4px 4px 0`,float:`left`,paddingLeft:`8px`},swatch:{width:`30px`,height:`30px`,float:`left`,borderRadius:`4px`,margin:`0 6px 6px 0`},clear:{clear:`both`}},"hide-triangle":{triangle:{display:`none`},triangleShadow:{display:`none`}},"top-left-triangle":{triangle:{top:`-10px`,left:`12px`},triangleShadow:{top:`-11px`,left:`12px`}},"top-right-triangle":{triangle:{top:`-10px`,right:`12px`},triangleShadow:{top:`-11px`,right:`12px`}}},c),{"hide-triangle":o===`hide`,"top-left-triangle":o===`top-left`,"top-right-triangle":o===`top-right`}),p=function(e,n){qh(e)&&t({hex:e,source:`hex`},n)};return u.default.createElement(`div`,{style:f.card,className:`twitter-picker `+d},u.default.createElement(`div`,{style:f.triangleShadow}),u.default.createElement(`div`,{style:f.triangle}),u.default.createElement(`div`,{style:f.body},sv(i,function(e,t){return u.default.createElement(ug,{key:t,color:e,hex:e,style:f.swatch,onClick:p,onHover:n,focusStyle:{boxShadow:`0 0 4px `+e}})}),u.default.createElement(`div`,{style:f.hash},`#`),u.default.createElement(Yu,{label:null,style:{input:f.input},value:r.replace(`#`,``),onChange:p}),u.default.createElement(`div`,{style:f.clear})))};yy.propTypes={width:f.default.oneOfType([f.default.string,f.default.number]),triangle:f.default.oneOf([`hide`,`top-left`,`top-right`]),colors:f.default.arrayOf(f.default.string),styles:f.default.object},yy.defaultProps={width:276,colors:[`#FF6900`,`#FCB900`,`#7BDCB5`,`#00D084`,`#8ED1FC`,`#0693E3`,`#ABB8C3`,`#EB144C`,`#F78DA7`,`#9900EF`],triangle:`top-left`,styles:{}},tg(yy);var by=function(e){var t=(0,q.default)({default:{picker:{width:`20px`,height:`20px`,borderRadius:`22px`,border:`2px #fff solid`,transform:`translate(-12px, -13px)`,background:`hsl(`+Math.round(e.hsl.h)+`, `+Math.round(e.hsl.s*100)+`%, `+Math.round(e.hsl.l*100)+`%)`}}});return u.default.createElement(`div`,{style:t.picker})};by.propTypes={hsl:f.default.shape({h:f.default.number,s:f.default.number,l:f.default.number,a:f.default.number})},by.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var xy=function(e){var t=(0,q.default)({default:{picker:{width:`20px`,height:`20px`,borderRadius:`22px`,transform:`translate(-10px, -7px)`,background:`hsl(`+Math.round(e.hsl.h)+`, 100%, 50%)`,border:`2px white solid`}}});return u.default.createElement(`div`,{style:t.picker})};xy.propTypes={hsl:f.default.shape({h:f.default.number,s:f.default.number,l:f.default.number,a:f.default.number})},xy.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var Sy=function(e){var t=e.onChange,n=e.rgb,r=e.hsl,i=e.hex,a=e.hsv,o=function(e,n){if(e.hex)qh(e.hex)&&t({hex:e.hex,source:`hex`},n);else if(e.rgb){var r=e.rgb.split(`,`);Yh(e.rgb,`rgb`)&&t({r:r[0],g:r[1],b:r[2],a:1,source:`rgb`},n)}else if(e.hsv){var i=e.hsv.split(`,`);Yh(e.hsv,`hsv`)&&(i[2]=i[2].replace(`%`,``),i[1]=i[1].replace(`%`,``),i[0]=i[0].replace(`°`,``),i[1]==1?i[1]=.01:i[2]==1&&(i[2]=.01),t({h:Number(i[0]),s:Number(i[1]),v:Number(i[2]),source:`hsv`},n))}else if(e.hsl){var a=e.hsl.split(`,`);Yh(e.hsl,`hsl`)&&(a[2]=a[2].replace(`%`,``),a[1]=a[1].replace(`%`,``),a[0]=a[0].replace(`°`,``),d[1]==1?d[1]=.01:d[2]==1&&(d[2]=.01),t({h:Number(a[0]),s:Number(a[1]),v:Number(a[2]),source:`hsl`},n))}},s=(0,q.default)({default:{wrap:{display:`flex`,height:`100px`,marginTop:`4px`},fields:{width:`100%`},column:{paddingTop:`10px`,display:`flex`,justifyContent:`space-between`},double:{padding:`0px 4.4px`,boxSizing:`border-box`},input:{width:`100%`,height:`38px`,boxSizing:`border-box`,padding:`4px 10% 3px`,textAlign:`center`,border:`1px solid #dadce0`,fontSize:`11px`,textTransform:`lowercase`,borderRadius:`5px`,outline:`none`,fontFamily:`Roboto,Arial,sans-serif`},input2:{height:`38px`,width:`100%`,border:`1px solid #dadce0`,boxSizing:`border-box`,fontSize:`11px`,textTransform:`lowercase`,borderRadius:`5px`,outline:`none`,paddingLeft:`10px`,fontFamily:`Roboto,Arial,sans-serif`},label:{textAlign:`center`,fontSize:`12px`,background:`#fff`,position:`absolute`,textTransform:`uppercase`,color:`#3c4043`,width:`35px`,top:`-6px`,left:`0`,right:`0`,marginLeft:`auto`,marginRight:`auto`,fontFamily:`Roboto,Arial,sans-serif`},label2:{left:`10px`,textAlign:`center`,fontSize:`12px`,background:`#fff`,position:`absolute`,textTransform:`uppercase`,color:`#3c4043`,width:`32px`,top:`-6px`,fontFamily:`Roboto,Arial,sans-serif`},single:{flexGrow:`1`,margin:`0px 4.4px`}}}),c=n.r+`, `+n.g+`, `+n.b,l=Math.round(r.h)+`°, `+Math.round(r.s*100)+`%, `+Math.round(r.l*100)+`%`,d=Math.round(a.h)+`°, `+Math.round(a.s*100)+`%, `+Math.round(a.v*100)+`%`;return u.default.createElement(`div`,{style:s.wrap,className:`flexbox-fix`},u.default.createElement(`div`,{style:s.fields},u.default.createElement(`div`,{style:s.double},u.default.createElement(Yu,{style:{input:s.input,label:s.label},label:`hex`,value:i,onChange:o})),u.default.createElement(`div`,{style:s.column},u.default.createElement(`div`,{style:s.single},u.default.createElement(Yu,{style:{input:s.input2,label:s.label2},label:`rgb`,value:c,onChange:o})),u.default.createElement(`div`,{style:s.single},u.default.createElement(Yu,{style:{input:s.input2,label:s.label2},label:`hsv`,value:d,onChange:o})),u.default.createElement(`div`,{style:s.single},u.default.createElement(Yu,{style:{input:s.input2,label:s.label2},label:`hsl`,value:l,onChange:o})))))},Cy=function(e){var t=e.width,n=e.onChange,r=e.rgb,i=e.hsl,a=e.hsv,o=e.hex,s=e.header,c=e.styles,l=c===void 0?{}:c,d=e.className,f=d===void 0?``:d,p=(0,q.default)(Sm({default:{picker:{width:t,background:`#fff`,border:`1px solid #dfe1e5`,boxSizing:`initial`,display:`flex`,flexWrap:`wrap`,borderRadius:`8px 8px 0px 0px`},head:{height:`57px`,width:`100%`,paddingTop:`16px`,paddingBottom:`16px`,paddingLeft:`16px`,fontSize:`20px`,boxSizing:`border-box`,fontFamily:`Roboto-Regular,HelveticaNeue,Arial,sans-serif`},saturation:{width:`70%`,padding:`0px`,position:`relative`,overflow:`hidden`},swatch:{width:`30%`,height:`228px`,padding:`0px`,background:`rgba(`+r.r+`, `+r.g+`, `+r.b+`, 1)`,position:`relative`,overflow:`hidden`},body:{margin:`auto`,width:`95%`},controls:{display:`flex`,boxSizing:`border-box`,height:`52px`,paddingTop:`22px`},color:{width:`32px`},hue:{height:`8px`,position:`relative`,margin:`0px 16px 0px 16px`,width:`100%`},Hue:{radius:`2px`}}},l));return u.default.createElement(`div`,{style:p.picker,className:`google-picker `+f},u.default.createElement(`div`,{style:p.head},s),u.default.createElement(`div`,{style:p.swatch}),u.default.createElement(`div`,{style:p.saturation},u.default.createElement(qm,{hsl:i,hsv:a,pointer:by,onChange:n})),u.default.createElement(`div`,{style:p.body},u.default.createElement(`div`,{style:p.controls,className:`flexbox-fix`},u.default.createElement(`div`,{style:p.hue},u.default.createElement(td,{style:p.Hue,hsl:i,radius:`4px`,pointer:xy,onChange:n}))),u.default.createElement(Sy,{rgb:r,hsl:i,hex:o,hsv:a,onChange:n})))};Cy.propTypes={width:f.default.oneOfType([f.default.string,f.default.number]),styles:f.default.object,header:f.default.string},Cy.defaultProps={width:652,styles:{},header:`Color picker`},tg(Cy);function wy({closeChooseColor:e,currentColor:t,handleCloseLineWeight:n,handleLineWeightSelect:r,openChooseColor:i,openChooseLineWeight:a,toolOptions:o,toolState:s,updateColor:c}){let{t:l}=(0,_.useTranslation)();return(0,p.jsxs)(h.Grid,{container:!0,spacing:1,children:[(0,p.jsx)(h.Grid,{size:{xs:12},children:(0,p.jsx)(w.default,{variant:`overline`,children:l(`style`)})}),(0,p.jsx)(h.Grid,{size:{xs:12},children:(0,p.jsxs)(M.default,{"aria-label":l(`style_selection`),size:`small`,children:[s.activeTool!==Jt.TEXT&&[(0,p.jsxs)(j.default,{value:`strokeColor`,"aria-label":l(`border_color`),onClick:i,children:[(0,p.jsx)(h.Tooltip,{title:l(`border_color`),children:(0,p.jsx)(`span`,{children:(0,p.jsx)(Fs,{style:{fill:s.strokeColor}})})}),(0,p.jsx)(Is,{})]},`strokeColor`),(0,p.jsxs)(j.default,{value:`lineWeight`,"aria-label":l(`line_weight`),onClick:a,children:[(0,p.jsx)(h.Tooltip,{title:l(`line_weight`),children:(0,p.jsx)(`span`,{children:(0,p.jsx)(Ls,{})})}),(0,p.jsx)(Is,{})]},`lineWeight`)],(0,p.jsxs)(j.default,{value:`fillColor`,"aria-label":l(`fill_color`),onClick:i,children:[(0,p.jsx)(h.Tooltip,{title:l(`fill_color`),children:(0,p.jsx)(`span`,{children:(0,p.jsx)(Rs,{})})}),(0,p.jsx)(Is,{})]})]})}),(0,p.jsx)(h.Popover,{open:o.lineWeightPopoverOpen,anchorEl:o.popoverLineWeightAnchorEl,children:(0,p.jsx)(`div`,{children:(0,p.jsx)(h.ClickAwayListener,{onClickAway:n,children:(0,p.jsx)(h.MenuList,{autoFocus:!0,role:`listbox`,children:Kt.map(e=>(0,p.jsx)(h.MenuItem,{onClick:r,value:e,selected:e===s.strokeWidth,role:`option`,"aria-selected":e===s.strokeWidth,children:e},e))})})})}),(0,p.jsx)(h.Popover,{open:o.colorPopoverOpen,anchorEl:o.popoverAnchorEl,onClose:e,children:(0,p.jsx)(uy,{disableAlpha:!1,color:t,onChange:c})})]})}wy.propTypes={closeChooseColor:f.func.isRequired,currentColor:f.string.isRequired,handleCloseLineWeight:f.func.isRequired,handleLineWeightSelect:f.func.isRequired,openChooseColor:f.func.isRequired,openChooseLineWeight:f.func.isRequired,toolOptions:f.shape({colorPopoverOpen:f.default.bool,currentColorType:f.default.any,lineWeightPopoverOpen:f.default.bool,popoverAnchorEl:f.default.any,popoverLineWeightAnchorEl:f.default.any}).isRequired,toolState:f.default.shape({activeTool:f.default.string.isRequired,closedMode:f.default.string.isRequired,fillColor:f.default.string,image:f.default.shape({id:f.default.string}),strokeColor:f.default.string.isRequired,strokeWidth:f.default.number.isRequired,text:f.default.string,textBody:f.default.string,updateColor:f.default.func}).isRequired,updateColor:f.func.isRequired};function Ty({currentShape:e,displayMode:t,setToolState:n,t:r,toolState:i}){let[a,o]=(0,u.useState)({colorPopoverOpen:!1,currentColorType:null,lineWeightPopoverOpen:!1,popoverAnchorEl:null,popoverLineWeightAnchorEl:null}),s=a.currentColorType?Qt(i[a.currentColorType]):`rgba(255, 0, 0, 0.5)`,c=e=>{o({...a,lineWeightPopoverOpen:!0,popoverLineWeightAnchorEl:e.currentTarget})},l=e=>{o({...a,lineWeightPopoverOpen:!1,popoverLineWeightAnchorEl:null}),n({...i,strokeWidth:e.currentTarget.value})},d=e=>{o({...a,colorPopoverOpen:!1,currentColorType:null,popoverAnchorEl:null})},f=e=>{o({...a,colorPopoverOpen:!0,currentColorType:e.currentTarget.value,popoverAnchorEl:e.currentTarget})},g=e=>{o({...a,lineWeightPopoverOpen:!1,popoverLineWeightAnchorEl:null})},_=e=>{n({...i,closedMode:e.currentTarget.value})},v=e=>{n({...i,[a.currentColorType]:$t(e.rgb)})},y=(e,t)=>{n({...i,image:{...i.image,id:e}})},b=()=>{let e={id:i?.image?.id,uuid:Ft()};n({...i,image:{id:null},imageEvent:e})},x=e=>{let t=e.target.value;n({...i,text:t})},S=ge(e=>(0,m.getConfig)(e)).annotation?.allowTargetShapesStyling===!0;return(0,p.jsxs)(`div`,{children:[(t===qt.DRAW||S&&t===qt.TARGET)&&Zt(i.activeTool)&&(0,p.jsx)(h.Grid,{container:!0,children:(0,p.jsx)(wy,{currentColor:s,changeClosedMode:_,closeChooseColor:d,handleCloseLineWeight:g,handleLineWeightSelect:l,openChooseColor:f,openChooseLineWeight:c,updateColor:v,toolOptions:a,toolState:i})}),i.activeTool===Jt.TEXT&&(0,p.jsxs)(h.Grid,{container:!0,direction:`column`,spacing:1,children:[(0,p.jsx)(h.Grid,{children:(0,p.jsx)(w.default,{variant:`overline`,children:r(`text`)})}),e?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h.Grid,{children:(0,p.jsx)(h.TextField,{value:i.text,placeholder:r(`text`),fullwidth:!0,onChange:x})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(wy,{changeClosedMode:_,closeChooseColor:d,currentColor:s,handleCloseLineWeight:g,handleLineWeightSelect:l,openChooseColor:f,openChooseLineWeight:c,toolOptions:a,toolState:i,updateColor:v})})]}):(0,p.jsx)(h.Grid,{children:(0,p.jsx)(w.default,{children:r(`click_on_canvas_to_write`)})})]}),i.activeTool===Jt.IMAGE&&(0,p.jsx)(h.Grid,{container:!0,children:(0,p.jsx)(Ps,{size:{xs:8},imageUrl:i.image?.id,onChange:y,isReadOnly:!!e,onAddImage:b,t:r})}),i.activeTool===z.POLYGON&&(0,p.jsx)(w.default,{children:r(`pressEnterOrClickFirstPointToClose`)})]})}Ty.propTypes={currentShape:f.default.object.isRequired,displayMode:f.default.string.isRequired,setToolState:f.default.func.isRequired,t:f.default.func.isRequired,toolState:f.default.shape({activeTool:f.default.string.isRequired,closedMode:f.default.string.isRequired,fillColor:f.default.string,image:f.default.shape({id:f.default.string}),strokeColor:f.default.string.isRequired,strokeWidth:f.default.number.isRequired,text:f.default.string,textBody:f.default.string,updateColor:f.default.func}).isRequired};var Ey=(0,g.styled)(h.ListItem)(({theme:e})=>({display:`flex`,justifyContent:`space-between`}));function Dy({currentShapeId:e,deleteShape:t,shapes:n,t:r,updateCurrentShapeInShapes:i}){return(0,p.jsx)(D.default,{children:n.map(n=>(0,p.jsxs)(u.default.Fragment,{children:[(0,p.jsx)(O.default,{disableGutters:!0,children:(0,p.jsxs)(Ey,{children:[(0,p.jsx)(w.default,{component:`span`,sx:{color:`black`,cursor:`pointer`,fontWeight:n.id===e?`bold`:void 0},onClick:()=>i(n),children:r(n.type)}),(0,p.jsx)(h.Tooltip,{title:(0,p.jsx)(Oe,{label:r(`delete`),action:`delete`}),children:(0,p.jsx)(h.IconButton,{onClick:()=>t(n.id),edge:`end`,"aria-label":`delete`,children:(0,p.jsx)(We,{})})})]})}),(0,p.jsx)(h.Divider,{component:`li`})]},n.id))})}Dy.propTypes={currentShapeId:f.default.string.isRequired,deleteShape:f.default.func.isRequired,shapes:f.default.array.isRequired,t:f.default.func.isRequired,updateCurrentShapeInShapes:f.default.func.isRequired};function Oy({currentShape:e,deleteShape:t,displayMode:n,setToolState:r,shapes:i,t:a,toolState:o,updateCurrentShapeInShapes:s}){let c=(e,t)=>{if(!t)return;let n=t===Jt.SHAPE?z.RECTANGLE:t;r(e=>e.activeTool===n?e:{...e,activeTool:n})},l=t=>{if(r(e=>({...e,...t,activeTool:Jt.EDIT})),e){let n={};Object.prototype.hasOwnProperty.call(t,`strokeWidth`)&&t.strokeWidth!==e.strokeWidth&&(n.strokeWidth=t.strokeWidth),Object.prototype.hasOwnProperty.call(t,`strokeColor`)&&t.strokeColor!==e.stroke&&(n.stroke=t.strokeColor),Object.prototype.hasOwnProperty.call(t,`fillColor`)&&t.fillColor!==e.fill&&(n.fill=t.fillColor),Object.prototype.hasOwnProperty.call(t,`text`)&&t.text!==e.text&&(n.text=t.text),Object.prototype.hasOwnProperty.call(t,`image`)&&t.image?.id!==e.url&&(n.url=t.image?.id??null),Object.keys(n).length&&s({...e,...n})}};(0,u.useEffect)(()=>{o.activeTool===Jt.SHAPE&&r(e=>({...e,activeTool:z.RECTANGLE}))},[o.activeTool,r]);let d=(0,u.useMemo)(()=>e?{...o,activeTool:e.type,closedMode:e.closedMode,fillColor:e.fill,image:{id:e.url},strokeColor:e.stroke,strokeWidth:e.strokeWidth,text:e.text}:o,[o,e]);return(0,p.jsxs)(p.Fragment,{children:[o.activeTool===Jt.EDIT&&(0,p.jsxs)(p.Fragment,{children:[e&&(n===qt.DRAW||n===qt.TARGET)&&(0,p.jsxs)(`div`,{children:[(0,p.jsx)(w.default,{variant:`subFormSectionTitle`,children:a(`selected_object`)}),(0,p.jsx)(Ty,{t:a,toolState:d,setToolState:l,displayMode:n,currentShape:e})]}),n===qt.DRAW&&i.length>0&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(w.default,{variant:`subFormSectionTitle`,children:a(`object_list`)}),(0,p.jsx)(Dy,{currentShapeId:e?.id,shapes:i,deleteShape:t,updateCurrentShapeInShapes:s,t:a})]})]}),Zt(o.activeTool)&&(0,p.jsxs)(dn,{value:o.activeTool,exclusive:!0,onChange:c,"aria-label":a(`tool_selection`),size:`small`,"data-testid":`tool_selection`,children:[n!==qt.IMAGE&&(0,p.jsx)(h.Tooltip,{title:a(`rectangle`),children:(0,p.jsx)(j.default,{value:z.RECTANGLE,"aria-label":a(`add_a_rectangle`),children:(0,p.jsx)(Es,{})})}),n===qt.TARGET&&(0,p.jsx)(h.Tooltip,{title:a(`circle`),children:(0,p.jsx)(j.default,{value:z.CIRCLE,"aria-label":a(`add_a_circle`),children:(0,p.jsx)(Ds,{})})}),n!==qt.IMAGE&&(0,p.jsx)(`div`,{children:(0,p.jsx)(h.Tooltip,{title:a(`line`),children:(0,p.jsx)(j.default,{value:z.POLYGON,"aria-label":a(`add_a_line`),children:(0,p.jsx)(ks,{})})})}),n===qt.DRAW&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h.Tooltip,{title:`Ellipse shape`,children:(0,p.jsx)(j.default,{value:z.ELLIPSE,"aria-label":a(`add_an_ellipse`),children:(0,p.jsx)(Ds,{})})}),(0,p.jsx)(h.Tooltip,{title:a(`arrow`),children:(0,p.jsx)(j.default,{value:z.ARROW,"aria-label":a(`add_an_arrow_shape`),children:(0,p.jsx)(Os,{})})})]})]}),o.activeTool===Jt.DELETE&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(w.default,{variant:`overline`,children:a(`delete`)}),(0,p.jsx)(`p`,{children:a(`click_to_delete_shape`)}),(0,p.jsxs)(h.Button,{onClick:()=>t(),children:[(0,p.jsx)(`span`,{children:a(`delete_all`)}),(0,p.jsx)(Cs,{color:`red`})]})]}),(0,p.jsx)(Ty,{t:a,toolState:o,setToolState:r,displayMode:n,currentShape:e})]})}Oy.propTypes={currentShape:f.default.object.isRequired,deleteShape:f.default.func.isRequired,displayMode:f.default.string.isRequired,setToolState:f.default.func.isRequired,shapes:f.default.array.isRequired,t:f.default.func.isRequired,toolState:f.default.shape({activeTool:f.default.string.isRequired,closedMode:f.default.string.isRequired,fillColor:f.default.string.isRequired,image:f.default.shape({id:f.default.string}).isRequired,strokeColor:f.default.string.isRequired,strokeWidth:f.default.number.isRequired,updateColor:f.default.func.isRequired}).isRequired,updateCurrentShapeInShapes:f.default.func.isRequired};var ky=(0,g.styled)(h.Grid)(({})=>({display:`flex`,flexDirection:`column`}));function Ay({displayMode:e,setToolState:t,toolState:n,deleteShape:r,currentShape:i,updateCurrentShapeInShapes:a,setViewTool:o,shapes:s,t:c}){(0,u.useEffect)(()=>{},[n.fillColor,n.strokeColor,n.strokeWidth]);let l=(0,u.useCallback)((n,r)=>{r&&(e?(t(e=>e.activeTool===r?e:{...e,activeTool:r}),r!==Jt.EDIT&&a(null)):(r===Jt.SHAPE&&t({...rn,activeTool:r}),a(null)))},[e,t,a]),d=(0,u.useCallback)(e=>()=>{o(e)},[o]),{activeTool:f}=n;return(0,p.jsx)(h.Grid,{container:!0,children:(0,p.jsxs)(ky,{item:!0,xs:12,children:[(0,p.jsxs)(dn,{value:f,exclusive:!0,onChange:l,"aria-label":c(`tool_selection`),size:`small`,children:[e!==qt.IMAGE&&(0,p.jsx)(h.Tooltip,{title:c(`shape_selection`),children:(0,p.jsx)(j.default,{value:Zt(f)?f:Jt.SHAPE,"aria-label":c(`select_cursor`),onClick:d(`layer`),children:(0,p.jsx)(ws,{})})}),e===qt.DRAW&&(0,p.jsx)(h.Tooltip,{title:c(`text`),children:(0,p.jsx)(j.default,{value:Jt.TEXT,"aria-label":c(`select_text`),onClick:d(`layer`),children:(0,p.jsx)(xs,{})})}),e===qt.IMAGE&&(0,p.jsx)(h.Tooltip,{title:c(`image`),children:(0,p.jsx)(j.default,{value:Jt.IMAGE,"aria-label":c(`select_cursor`),onClick:d(`layer`),children:(0,p.jsx)(Ss,{})})}),(0,p.jsx)(h.Tooltip,{title:c(`edit`),children:(0,p.jsx)(j.default,{value:Jt.EDIT,"aria-label":c(`select_cursor`),onClick:d(on),children:(0,p.jsx)(Ts,{})})}),(0,p.jsx)(h.Tooltip,{title:(0,p.jsx)(Oe,{label:c(`delete`),action:`delete`}),children:(0,p.jsx)(j.default,{value:Jt.DELETE,"aria-label":c(`select_cursor`),onClick:d(sn),children:(0,p.jsx)(Cs,{})})})]}),(0,p.jsx)(Oy,{currentShape:i,deleteShape:r,displayMode:e,setToolState:t,shapes:s,t:c,toolState:n,updateCurrentShapeInShapes:a})]})})}Ay.propTypes={currentShape:f.default.shape({id:f.default.string,rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,type:f.default.string,url:f.default.string,x:f.default.number,y:f.default.number}).isRequired,deleteShape:f.default.func.isRequired,displayMode:f.default.string.isRequired,setToolState:f.default.func.isRequired,setViewTool:f.default.func.isRequired,shapes:f.default.arrayOf(f.default.shape({id:f.default.string,rotation:f.default.number,scaleX:f.default.number,scaleY:f.default.number,type:f.default.string,url:f.default.string,x:f.default.number,y:f.default.number})).isRequired,t:f.default.func.isRequired,toolState:f.default.shape({activeTool:f.default.string.isRequired,closedMode:f.default.string.isRequired,fillColor:f.default.string.isRequired,image:f.default.shape({id:f.default.string}).isRequired,strokeColor:f.default.string.isRequired,strokeWidth:f.default.number.isRequired,updateColor:f.default.func.isRequired}).isRequired,updateCurrentShapeInShapes:f.default.func.isRequired};function jy({playerReferences:e,setTargetDrawingState:t,targetDrawingState:n,windowId:r}){let{t:i}=(0,_.useTranslation)(),{editMode:a}=Ct(ge(e=>(0,m.getConfig)(e))),[o,s]=(0,u.useState)(()=>{let e=Array.isArray(n?.shapes)?n.shapes:[];return{currentShape:null,isDrawing:!1,shapes:e,...n,...a&&e.length>0?{currentShape:e[0]}:{}}}),c=Array.isArray(n?.shapes)&&n.shapes.length>0,[l,d]=(0,u.useState)(c?an:{...an,activeTool:Jt.SHAPE}),[,f]=(0,u.useState)(on),[g,v]=(0,u.useState)(e.getScale()),y=(0,u.useCallback)(()=>{let t=e.getScale();v(e=>e===t?e:t)},[e]),b=(0,u.useRef)(o.shapes);(0,u.useLayoutEffect)(()=>{let e=b.current,n=o.shapes;e!==n&&(e&&n&&e.length===n.length&&e.every((e,t)=>e===n[t])||(b.current=n,t({drawingState:o})))},[o.shapes,t,o]);let x=(0,u.useCallback)(e=>{s(t=>{if(!e)return t.shapes.length===0&&t.currentShape==null?t:{...t,currentShape:null,shapes:[]};let n=t.shapes.filter(t=>t.id!==e);return n.length===t.shapes.length?t:{...t,currentShape:null,shapes:n}})},[]),S=(0,u.useRef)(o);S.current=o,(0,u.useEffect)(()=>{let e=()=>{let{currentShape:e,shapes:t}=S.current;if(e){let n=t.filter(t=>t.id!==e.id);s(e=>({...e,currentShape:null,shapes:n}))}};return document.addEventListener(ve,e),()=>document.removeEventListener(ve,e)},[]);let C=(0,u.useCallback)(e=>{setTimeout(()=>{s(t=>{if(!e)return t.currentShape==null?t:{...t,currentShape:null};let n=t.shapes.findIndex(t=>t.id===e.id);if(n!==-1){if(t.shapes[n]===e&&t.currentShape===e)return t;let r=t.shapes===void 0?[]:[...t.shapes];return r[n]=e,{...t,currentShape:e,shapes:r}}return{...t,currentShape:e,shapes:[...t.shapes||[],e]}})},0)},[]);return(0,p.jsx)(h.Grid,{container:!0,direction:`column`,children:(0,p.jsxs)(h.Grid,{container:!0,direction:`column`,children:[(0,p.jsx)(w.default,{variant:`subFormSectionTitle`,children:i(`spatialTarget`)}),(0,p.jsxs)(h.Grid,{direction:`row`,spacing:2,children:[(0,p.jsx)(ys,{displayMode:qt.TARGET,drawingState:o,playerReferences:e,scale:g,setColorToolFromCurrentShape:()=>{},setDrawingState:s,tabView:`edit`,toolState:l,updateCurrentShapeInShapes:C,updateScale:y,windowId:r,setToolState:d}),(0,p.jsx)(Ay,{toolState:l,deleteShape:x,setToolState:d,shapes:o.shapes,currentShape:o.currentShape,setViewTool:f,t:i,displayMode:qt.TARGET,updateCurrentShapeInShapes:C})]})]})})}jy.propTypes={playerReferences:f.default.object.isRequired,setTargetDrawingState:f.default.func.isRequired,targetDrawingState:f.default.object.isRequired,windowId:f.default.string.isRequired};var My={activeTool:z.POI},Ny=()=>{};function Py({playerReferences:e,setTargetDrawingState:t,targetDrawingState:n,windowId:r}){let{t:i}=(0,_.useTranslation)(),[a,o]=(0,u.useState)(()=>({currentShape:null,isDrawing:!1,shapes:Array.isArray(n?.shapes)?n.shapes:[],...n})),[s,c]=(0,u.useState)(e.getScale()),l=(0,u.useCallback)(()=>{let t=e.getScale();c(e=>e===t?e:t)},[e]),d=(0,u.useRef)(a.shapes);(0,u.useLayoutEffect)(()=>{let e=d.current,n=a.shapes;e!==n&&(d.current=n,t({drawingState:a}))},[a.shapes,t,a]);let f=(0,u.useCallback)(e=>{setTimeout(()=>{o(t=>e?t.currentShape===e&&t.shapes[0]===e?t:{...t,currentShape:e,shapes:[e]}:t.currentShape==null?t:{...t,currentShape:null})},0)},[]);return(0,p.jsxs)(h.Grid,{container:!0,direction:`column`,children:[(0,p.jsx)(h.Typography,{variant:`subFormSectionTitle`,children:i(`spatialTarget`)}),(0,p.jsx)(h.Typography,{variant:`caption`,children:i(`poi_click_to_place`)}),(0,p.jsx)(h.Grid,{direction:`row`,spacing:2,children:(0,p.jsx)(ys,{displayMode:qt.POI,drawingState:a,playerReferences:e,scale:s,setColorToolFromCurrentShape:Ny,setDrawingState:o,setToolState:Ny,tabView:`edit`,toolState:My,updateCurrentShapeInShapes:f,updateScale:l,windowId:r})})]})}Py.propTypes={playerReferences:f.default.object.isRequired,setTargetDrawingState:f.default.func.isRequired,targetDrawingState:f.default.object.isRequired,windowId:f.default.string.isRequired};function Fy({onChangeTarget:e,spatialTarget:t,pointOnly:n,playerReferences:r,target:i,windowId:a}){let{t:o}=(0,_.useTranslation)(),s=r.getMediaType(),c=(0,u.useMemo)(()=>{if(i)return i;let e={drawingState:{currentShape:null,isDrawing:!1,shapes:[]}};return s===nn.IMAGE&&(e.fullCanvaXYWH=`0,0,${r.getMediaTrueWidth()},${r.getMediaTrueHeight()}`),e},[i,s,r]);(0,u.useEffect)(()=>{i||e(c)},[i,c,e]);let l=t=>{e({...c,...t})};return t?(0,p.jsxs)(h.Grid,{container:!0,direction:`column`,spacing:1,children:[(0,p.jsx)(h.Grid,{children:(0,p.jsx)(h.Typography,{variant:`formSectionTitle`,children:o(`target`)})}),t&&s!==nn.AUDIO&&(0,p.jsx)(h.Grid,{container:!0,direction:`column`,children:n?(0,p.jsx)(Py,{playerReferences:r,setTargetDrawingState:l,targetDrawingState:c.drawingState,windowId:a}):(0,p.jsx)(jy,{playerReferences:r,setTargetDrawingState:l,targetDrawingState:c.drawingState,windowId:a})})]}):null}Fy.propTypes={onChangeTarget:f.default.func.isRequired,playerReferences:f.default.object.isRequired,pointOnly:f.default.bool,spatialTarget:f.default.bool.isRequired,target:f.default.object,windowId:f.default.string.isRequired},Fy.defaultProps={pointOnly:!1};function Iy(e,t){return e&&Jp(t,Qm(t),e)}function Ly(e,t){return e&&Jp(t,im(t),e)}function Ry(e,t){return Jp(e,Jg(e),t)}var zy=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Hg(t,Jg(e)),e=Rf(e);return t}:Gg;function By(e,t){return Jp(e,zy(e),t)}function Vy(e){return Ug(e,im,zy)}var Hy=Object.prototype.hasOwnProperty;function Uy(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&Hy.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function Wy(e,t){var n=t?Mf(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Gy=/\w*$/;function Ky(e){var t=new e.constructor(e.source,Gy.exec(e));return t.lastIndex=e.lastIndex,t}var qy=vd?vd.prototype:void 0,Jy=qy?qy.valueOf:void 0;function Yy(e){return Jy?Object(Jy.call(e)):{}}var Xy=`[object Boolean]`,Zy=`[object Date]`,Qy=`[object Map]`,$y=`[object Number]`,eb=`[object RegExp]`,tb=`[object Set]`,nb=`[object String]`,rb=`[object Symbol]`,ib=`[object ArrayBuffer]`,ab=`[object DataView]`,ob=`[object Float32Array]`,sb=`[object Float64Array]`,cb=`[object Int8Array]`,lb=`[object Int16Array]`,ub=`[object Int32Array]`,db=`[object Uint8Array]`,fb=`[object Uint8ClampedArray]`,pb=`[object Uint16Array]`,mb=`[object Uint32Array]`;function hb(e,t,n){var r=e.constructor;switch(t){case ib:return Mf(e);case Xy:case Zy:return new r(+e);case ab:return Wy(e,n);case ob:case sb:case cb:case lb:case ub:case db:case fb:case pb:case mb:return Nf(e,n);case Qy:return new r;case $y:case nb:return new r(e);case eb:return Ky(e);case tb:return new r;case rb:return Yy(e)}}var gb=`[object Map]`;function _b(e){return Hf(e)&&h_(e)==gb}var vb=Hp&&Hp.isMap,yb=vb?Rp(vb):_b,bb=`[object Set]`;function xb(e){return Hf(e)&&h_(e)==bb}var Sb=Hp&&Hp.isSet,Cb=Sb?Rp(Sb):xb,wb=1,Tb=2,Eb=4,Db=`[object Arguments]`,Ob=`[object Array]`,kb=`[object Boolean]`,Ab=`[object Date]`,jb=`[object Error]`,Mb=`[object Function]`,Nb=`[object GeneratorFunction]`,Pb=`[object Map]`,Fb=`[object Number]`,Ib=`[object Object]`,Lb=`[object RegExp]`,Rb=`[object Set]`,zb=`[object String]`,Bb=`[object Symbol]`,Vb=`[object WeakMap]`,Hb=`[object ArrayBuffer]`,Ub=`[object DataView]`,Wb=`[object Float32Array]`,Gb=`[object Float64Array]`,Kb=`[object Int8Array]`,qb=`[object Int16Array]`,Jb=`[object Int32Array]`,Yb=`[object Uint8Array]`,Xb=`[object Uint8ClampedArray]`,Zb=`[object Uint16Array]`,Qb=`[object Uint32Array]`,$b={};$b[Db]=$b[Ob]=$b[Hb]=$b[Ub]=$b[kb]=$b[Ab]=$b[Wb]=$b[Gb]=$b[Kb]=$b[qb]=$b[Jb]=$b[Pb]=$b[Fb]=$b[Ib]=$b[Lb]=$b[Rb]=$b[zb]=$b[Bb]=$b[Yb]=$b[Xb]=$b[Zb]=$b[Qb]=!0,$b[jb]=$b[Mb]=$b[Vb]=!1;function ex(e,t,n,r,i,a){var o,s=t&wb,c=t&Tb,l=t&Eb;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!Ad(e))return e;var u=Yf(e);if(u){if(o=Uy(e),!s)return Pf(e,o)}else{var d=h_(e),f=d==Mb||d==Nb;if(ip(e))return Af(e,s);if(d==Ib||d==Db||f&&!i){if(o=c||f?{}:Vf(e),!s)return c?By(e,Ly(o,e)):Ry(e,Iy(o,e))}else{if(!$b[d])return i?e:{};o=hb(e,d,s)}}a||=new bf;var p=a.get(e);if(p)return p;a.set(e,o),Cb(e)?e.forEach(function(r){o.add(ex(r,t,n,r,e,a))}):yb(e)&&e.forEach(function(r,i){o.set(i,ex(r,t,n,i,e,a))});var m=u?void 0:(l?c?Vy:Yg:c?im:Qm)(e);return Jm(m||e,function(r,i){m&&(i=r,r=e[i]),qp(o,i,ex(r,t,n,i,e,a))}),o}var tx=1,nx=4;function rx(e){return ex(e,tx|nx)}function ix(e,t){return S_(e,t)}var ax=s({Attributor:()=>ox,AttributorStore:()=>mx,BlockBlot:()=>Dx,ClassAttributor:()=>dx,ContainerBlot:()=>kx,EmbedBlot:()=>Ax,InlineBlot:()=>Tx,LeafBlot:()=>vx,ParentBlot:()=>Sx,Registry:()=>lx,Scope:()=>X,ScrollBlot:()=>Px,StyleAttributor:()=>px,TextBlot:()=>Ix}),X=(e=>(e[e.TYPE=3]=`TYPE`,e[e.LEVEL=12]=`LEVEL`,e[e.ATTRIBUTE=13]=`ATTRIBUTE`,e[e.BLOT=14]=`BLOT`,e[e.INLINE=7]=`INLINE`,e[e.BLOCK=11]=`BLOCK`,e[e.BLOCK_BLOT=10]=`BLOCK_BLOT`,e[e.INLINE_BLOT=6]=`INLINE_BLOT`,e[e.BLOCK_ATTRIBUTE=9]=`BLOCK_ATTRIBUTE`,e[e.INLINE_ATTRIBUTE=5]=`INLINE_ATTRIBUTE`,e[e.ANY=15]=`ANY`,e))(X||{}),ox=class{constructor(e,t,n={}){this.attrName=e,this.keyName=t;let r=X.TYPE&X.ATTRIBUTE;this.scope=n.scope==null?X.ATTRIBUTE:n.scope&X.LEVEL|r,n.whitelist!=null&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map(e=>e.name)}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t==`string`?this.whitelist.indexOf(t.replace(/["']/g,``))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){let t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:``}},sx=class extends Error{constructor(e){e=`[Parchment] `+e,super(e),this.message=e,this.name=this.constructor.name}},cx=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(t,n,r){let i=this.query(n);if(i==null)throw new sx(`Unable to create ${n} blot`);let a=i,o=new a(t,n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),r);return e.blots.set(o.domNode,o),o}find(t,n=!1){return e.find(t,n)}query(e,t=X.ANY){let n;return typeof e==`string`?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:typeof e==`number`?e&X.LEVEL&X.BLOCK?n=this.types.block:e&X.LEVEL&X.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute(`class`)||``).split(/\s+/).some(e=>(n=this.classes[e],!!n)),n||=this.tags[e.tagName]),n==null?null:`scope`in n&&t&X.LEVEL&n.scope&&t&X.TYPE&n.scope?n:null}register(...e){return e.map(e=>{let t=`blotName`in e,n=`attrName`in e;if(!t&&!n)throw new sx(`Invalid definition`);if(t&&e.blotName===`abstract`)throw new sx(`Cannot register abstract class`);let r=t?e.blotName:n?e.attrName:void 0;return this.types[r]=e,n?typeof e.keyName==`string`&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(e.tagName=Array.isArray(e.tagName)?e.tagName.map(e=>e.toUpperCase()):e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(t=>{(this.tags[t]==null||e.className==null)&&(this.tags[t]=e)}))),e})}};cx.blots=new WeakMap;var lx=cx;function ux(e,t){return(e.getAttribute(`class`)||``).split(/\s+/).filter(e=>e.indexOf(`${t}-`)===0)}var dx=class extends ox{static keys(e){return(e.getAttribute(`class`)||``).split(/\s+/).map(e=>e.split(`-`).slice(0,-1).join(`-`))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){ux(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute(`class`)}value(e){let t=(ux(e,this.keyName)[0]||``).slice(this.keyName.length+1);return this.canAdd(e,t)?t:``}};function fx(e){let t=e.split(`-`),n=t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join(``);return t[0]+n}var px=class extends ox{static keys(e){return(e.getAttribute(`style`)||``).split(`;`).map(e=>e.split(`:`)[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[fx(this.keyName)]=t,!0):!1}remove(e){e.style[fx(this.keyName)]=``,e.getAttribute(`style`)||e.removeAttribute(`style`)}value(e){let t=e.style[fx(this.keyName)];return this.canAdd(e,t)?t:``}},mx=class{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)==null?delete this.attributes[e.attrName]:this.attributes[e.attrName]=e):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};let e=lx.find(this.domNode);if(e==null)return;let t=ox.keys(this.domNode),n=dx.keys(this.domNode),r=px.keys(this.domNode);t.concat(n).concat(r).forEach(t=>{let n=e.scroll.query(t,X.ATTRIBUTE);n instanceof ox&&(this.attributes[n.attrName]=n)})}copy(e){Object.keys(this.attributes).forEach(t=>{let n=this.attributes[t].value(this.domNode);e.format(t,n)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(e=>{this.attributes[e].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}},hx=class{constructor(e,t){this.scroll=e,this.domNode=t,lx.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new sx(`Blot definition missing tagName`);let t,n;return Array.isArray(this.tagName)?(typeof e==`string`?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):typeof e==`number`&&(n=e),t=typeof n==`number`?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){let e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),lx.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,r){let i=this.isolate(e,t);if(this.scroll.query(n,X.BLOT)!=null&&r)i.wrap(n,r);else if(this.scroll.query(n,X.ATTRIBUTE)!=null){let e=this.scroll.create(this.statics.scope);i.wrap(e),e.format(n,r)}}insertAt(e,t,n){let r=n==null?this.scroll.create(`text`,t):this.scroll.create(t,n),i=this.split(e);this.parent.insertBefore(r,i||void 0)}isolate(e,t){let n=this.split(e);if(n==null)throw Error(`Attempt to isolate at end`);return n.split(t),n}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){let n=typeof e==`string`?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){let n=typeof e==`string`?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(n,this.next||void 0),typeof n.appendChild!=`function`)throw new sx(`Cannot wrap ${e}`);return n.appendChild(this),n}};hx.blotName=`abstract`;var gx=hx,_x=class extends gx{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};_x.scope=X.INLINE_BLOT;var vx=_x,yx=class{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){let t=e.slice(1);this.append(...t)}}at(e){let t=this.iterator(),n=t();for(;n&&e>0;)--e,n=t();return n}contains(e){let t=this.iterator(),n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){let t=this.iterator(),n=t(),r=0;for(;n;){if(n===e)return r;r+=1,n=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t==null?this.tail==null?(e.prev=null,this.head=this.tail=e):(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)),this.length+=1)}offset(e){let t=0,n=this.head;for(;n!=null;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),--this.length)}iterator(e=this.head){return()=>{let t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){let n=this.iterator(),r=n();for(;r;){let i=r.length();if(e<i||t&&e===i&&(r.next==null||r.next.length()!==0))return[r,e];e-=i,r=n()}return[null,0]}forEach(e){let t=this.iterator(),n=t();for(;n;)e(n),n=t()}forEachAt(e,t,n){if(t<=0)return;let[r,i]=this.find(e),a=e-i,o=this.iterator(r),s=o();for(;s&&a<e+t;){let r=s.length();e>a?n(s,e-a,Math.min(t,a+r-e)):n(s,0,Math.min(r,e+t-a)),a+=r,s=o()}}map(e){return this.reduce((t,n)=>(t.push(e(n)),t),[])}reduce(e,t){let n=this.iterator(),r=n();for(;r;)t=e(t,r),r=n();return t}};function bx(e,t){let n=t.find(e);if(n)return n;try{return t.create(e)}catch{let n=t.create(X.INLINE);return Array.from(e.childNodes).forEach(e=>{n.domNode.appendChild(e)}),e.parentNode&&e.parentNode.replaceChild(n.domNode,e),n.attach(),n}}var xx=class e extends gx{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(t){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute(`contenteditable`,`false`),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new yx,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{let t=bx(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof sx)return;throw e}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(e,t,n)=>{e.deleteAt(t,n)})}descendant(t,n=0){let[r,i]=this.children.find(n);return t.blotName==null&&t(r)||t.blotName!=null&&r instanceof t?[r,i]:r instanceof e?r.descendant(t,i):[null,-1]}descendants(t,n=0,r=Number.MAX_VALUE){let i=[],a=r;return this.children.forEachAt(n,r,(n,r,o)=>{(t.blotName==null&&t(n)||t.blotName!=null&&n instanceof t)&&i.push(n),n instanceof e&&(i=i.concat(n.descendants(t,r,a))),a-=o}),i}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(n=>{t||this.statics.allowedChildren.some(e=>n instanceof e)||(n.statics.scope===X.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),t=!0):n instanceof e?n.unwrap():n.remove())})}formatAt(e,t,n,r){this.children.forEachAt(e,t,(e,t,i)=>{e.formatAt(t,i,n,r)})}insertAt(e,t,n){let[r,i]=this.children.find(e);if(r)r.insertAt(i,t,n);else{let e=n==null?this.scroll.create(`text`,t):this.scroll.create(t,n);this.appendChild(e)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(n=>{e.insertBefore(n,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0){if(this.statics.defaultChild!=null){let e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}}path(t,n=!1){let[r,i]=this.children.find(t,n),a=[[this,t]];return r instanceof e?a.concat(r.path(i,n)):(r!=null&&a.push([r,i]),a)}removeChild(e){this.children.remove(e)}replaceWith(t,n){let r=typeof t==`string`?this.scroll.create(t,n):t;return r instanceof e&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}let n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),(e,r,i)=>{let a=e.split(r,t);a!=null&&n.appendChild(a)}),n}splitAfter(e){let t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){let n=[],r=[];e.forEach(e=>{e.target===this.domNode&&e.type===`childList`&&(n.push(...e.addedNodes),r.push(...e.removedNodes))}),r.forEach(e=>{if(e.parentNode!=null&&e.tagName!==`IFRAME`&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;let t=this.scroll.find(e);t!=null&&(t.domNode.parentNode==null||t.domNode.parentNode===this.domNode)&&t.detach()}),n.filter(e=>e.parentNode===this.domNode&&e!==this.uiNode).sort((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(e=>{let t=null;e.nextSibling!=null&&(t=this.scroll.find(e.nextSibling));let n=bx(e,this.scroll);(n.next!==t||n.next==null)&&(n.parent!=null&&n.parent.removeChild(this),this.insertBefore(n,t||void 0))}),this.enforceAllowedChildren()}};xx.uiClass=``;var Sx=xx;function Cx(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}var wx=class e extends Sx{static create(e){return super.create(e)}static formats(t,n){let r=n.query(e.blotName);if(r==null||t.tagName!==r.tagName){if(typeof this.tagName==`string`)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new mx(this.domNode)}format(t,n){if(t===this.statics.blotName&&!n)this.children.forEach(t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)}),this.unwrap();else{let e=this.scroll.query(t,X.INLINE);if(e==null)return;e instanceof ox?this.attributes.attribute(e,n):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n)}}formats(){let e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){this.formats()[n]!=null||this.scroll.query(n,X.ATTRIBUTE)?this.isolate(e,t).format(n,r):super.formatAt(e,t,n,r)}optimize(t){super.optimize(t);let n=this.formats();if(Object.keys(n).length===0)return this.unwrap();let r=this.next;r instanceof e&&r.prev===this&&Cx(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){let n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(e=>e.target===this.domNode&&e.type===`attributes`)&&this.attributes.build()}wrap(t,n){let r=super.wrap(t,n);return r instanceof e&&this.attributes.move(r),r}};wx.allowedChildren=[wx,vx],wx.blotName=`inline`,wx.scope=X.INLINE_BLOT,wx.tagName=`SPAN`;var Tx=wx,Ex=class e extends Sx{static create(e){return super.create(e)}static formats(t,n){let r=n.query(e.blotName);if(r==null||t.tagName!==r.tagName){if(typeof this.tagName==`string`)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new mx(this.domNode)}format(t,n){let r=this.scroll.query(t,X.BLOCK);r!=null&&(r instanceof ox?this.attributes.attribute(r,n):t===this.statics.blotName&&!n?this.replaceWith(e.blotName):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n))}formats(){let e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,r){this.scroll.query(n,X.BLOCK)==null?super.formatAt(e,t,n,r):this.format(n,r)}insertAt(e,t,n){if(n==null||this.scroll.query(t,X.INLINE)!=null)super.insertAt(e,t,n);else{let r=this.split(e);if(r!=null){let e=this.scroll.create(t,n);r.parent.insertBefore(e,r)}else throw Error(`Attempt to insertAt after block boundaries`)}}replaceWith(e,t){let n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(e=>e.target===this.domNode&&e.type===`attributes`)&&this.attributes.build()}};Ex.blotName=`block`,Ex.scope=X.BLOCK_BLOT,Ex.tagName=`P`,Ex.allowedChildren=[Tx,Ex,vx];var Dx=Ex,Ox=class extends Sx{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Ox.blotName=`container`,Ox.scope=X.BLOCK_BLOT;var kx=Ox,Ax=class extends vx{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,r){e===0&&t===this.length()?this.format(n,r):super.formatAt(e,t,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}},jx={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Mx=100,Nx=class extends Sx{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(e=>{this.update(e)}),this.observer.observe(this.domNode,jx),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){let n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=X.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach(e=>{e.remove()}):super.deleteAt(e,t)}formatAt(e,t,n,r){this.update(),super.formatAt(e,t,n,r)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);let n=t.mutationsMap||new WeakMap,r=Array.from(this.observer.takeRecords());for(;r.length>0;)e.push(r.pop());let i=(e,t=!0)=>{e==null||e===this||e.domNode.parentNode!=null&&(n.has(e.domNode)||n.set(e.domNode,[]),t&&i(e.parent))},a=e=>{n.has(e.domNode)&&(e instanceof Sx&&e.children.forEach(a),n.delete(e.domNode),e.optimize(t))},o=e;for(let t=0;o.length>0;t+=1){if(t>=Mx)throw Error(`[Parchment] Maximum optimize iterations reached`);for(o.forEach(e=>{let t=this.find(e.target,!0);t!=null&&(t.domNode===e.target&&(e.type===`childList`?(i(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach(e=>{let t=this.find(e,!1);i(t,!1),t instanceof Sx&&t.children.forEach(e=>{i(e,!1)})})):e.type===`attributes`&&i(t.prev)),i(t))}),this.children.forEach(a),o=Array.from(this.observer.takeRecords()),r=o.slice();r.length>0;)e.push(r.pop())}}update(e,t={}){e||=this.observer.takeRecords();let n=new WeakMap;e.map(e=>{let t=this.find(e.target,!0);return t==null?null:n.has(t.domNode)?(n.get(t.domNode).push(e),null):(n.set(t.domNode,[e]),t)}).forEach(e=>{e!=null&&e!==this&&n.has(e.domNode)&&e.update(n.get(e.domNode)||[],t)}),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};Nx.blotName=`scroll`,Nx.defaultChild=Dx,Nx.allowedChildren=[Dx,kx],Nx.scope=X.BLOCK_BLOT,Nx.tagName=`DIV`;var Px=Nx,Fx=class e extends vx{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){n==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(t){super.optimize(t),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}let n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some(e=>e.type===`characterData`&&e.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Fx.blotName=`text`,Fx.scope=X.INLINE_BLOT;var Ix=Fx,Lx=o(((e,t)=>{var n=-1,r=1,i=0;function a(e,t,n,r,a){if(e===t)return e?[[i,e]]:[];if(n!=null){var s=D(e,t,n);if(s)return s}var c=l(e,t),u=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=d(e,t);var f=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var m=o(e,t);return u&&m.unshift([i,u]),f&&m.push([i,f]),b(m,a),r&&p(m),m}function o(e,t){var o;if(!e)return[[r,t]];if(!t)return[[n,e]];var c=e.length>t.length?e:t,l=e.length>t.length?t:e,u=c.indexOf(l);if(u!==-1)return o=[[r,c.substring(0,u)],[i,l],[r,c.substring(u+l.length)]],e.length>t.length&&(o[0][0]=o[2][0]=n),o;if(l.length===1)return[[n,e],[r,t]];var d=f(e,t);if(d){var p=d[0],m=d[1],h=d[2],g=d[3],_=d[4],v=a(p,h),y=a(m,g);return v.concat([[i,_]],y)}return s(e,t)}function s(e,t){for(var i=e.length,a=t.length,o=Math.ceil((i+a)/2),s=o,l=2*o,u=Array(l),d=Array(l),f=0;f<l;f++)u[f]=-1,d[f]=-1;u[s+1]=0,d[s+1]=0;for(var p=i-a,m=p%2!=0,h=0,g=0,_=0,v=0,y=0;y<o;y++){for(var b=-y+h;b<=y-g;b+=2){for(var x=s+b,S=b===-y||b!==y&&u[x-1]<u[x+1]?u[x+1]:u[x-1]+1,C=S-b;S<i&&C<a&&e.charAt(S)===t.charAt(C);)S++,C++;if(u[x]=S,S>i)g+=2;else if(C>a)h+=2;else if(m){var w=s+p-b;if(w>=0&&w<l&&d[w]!==-1){var T=i-d[w];if(S>=T)return c(e,t,S,C)}}}for(var E=-y+_;E<=y-v;E+=2){for(var w=s+E,T=E===-y||E!==y&&d[w-1]<d[w+1]?d[w+1]:d[w-1]+1,D=T-E;T<i&&D<a&&e.charAt(i-T-1)===t.charAt(a-D-1);)T++,D++;if(d[w]=T,T>i)v+=2;else if(D>a)_+=2;else if(!m){var x=s+p-E;if(x>=0&&x<l&&u[x]!==-1){var S=u[x],C=s+S-x;if(T=i-T,S>=T)return c(e,t,S,C)}}}}return[[n,e],[r,t]]}function c(e,t,n,r){var i=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=a(i,o),u=a(s,c);return l.concat(u)}function l(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return x(e.charCodeAt(i-1))&&i--,i}function u(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}}function d(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return S(e.charCodeAt(e.length-i))&&i--,i}function f(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;function i(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),i=-1,a=``,o,s,c,u;(i=t.indexOf(r,i+1))!==-1;){var f=l(e.substring(n),t.substring(i)),p=d(e.substring(0,n),t.substring(0,i));a.length<p+f&&(a=t.substring(i-p,i)+t.substring(i,i+f),o=e.substring(0,n-p),s=e.substring(n+f),c=t.substring(0,i-p),u=t.substring(i+f))}return a.length*2>=e.length?[o,s,c,u,a]:null}var a=i(n,r,Math.ceil(n.length/4)),o=i(n,r,Math.ceil(n.length/2)),s;if(!a&&!o)return null;s=o?a&&a[4].length>o[4].length?a:o:a;var c,u,f,p;e.length>t.length?(c=s[0],u=s[1],f=s[2],p=s[3]):(f=s[0],p=s[1],c=s[2],u=s[3]);var m=s[4];return[c,u,f,p,m]}function p(e){for(var t=!1,a=[],o=0,s=null,c=0,l=0,d=0,f=0,p=0;c<e.length;)e[c][0]==i?(a[o++]=c,l=f,d=p,f=0,p=0,s=e[c][1]):(e[c][0]==r?f+=e[c][1].length:p+=e[c][1].length,s&&s.length<=Math.max(l,d)&&s.length<=Math.max(f,p)&&(e.splice(a[o-1],0,[n,s]),e[a[o-1]+1][0]=r,o--,o--,c=o>0?a[o-1]:-1,l=0,d=0,f=0,p=0,s=null,t=!0)),c++;for(t&&b(e),y(e),c=1;c<e.length;){if(e[c-1][0]==n&&e[c][0]==r){var m=e[c-1][1],h=e[c][1],g=u(m,h),_=u(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(c,0,[i,h.substring(0,g)]),e[c-1][1]=m.substring(0,m.length-g),e[c+1][1]=h.substring(g),c++):(_>=m.length/2||_>=h.length/2)&&(e.splice(c,0,[i,m.substring(0,_)]),e[c-1][0]=r,e[c-1][1]=h.substring(0,h.length-_),e[c+1][0]=n,e[c+1][1]=m.substring(_),c++),c++}c++}}var m=/[^a-zA-Z0-9]/,h=/\s/,g=/[\r\n]/,_=/\n\r?\n$/,v=/^\r?\n\r?\n/;function y(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),i=n.match(m),a=r.match(m),o=i&&n.match(h),s=a&&r.match(h),c=o&&n.match(g),l=s&&r.match(g),u=c&&e.match(_),d=l&&t.match(v);return u||d?5:c||l?4:i&&!o&&s?3:o||s?2:i||a?1:0}for(var n=1;n<e.length-1;){if(e[n-1][0]==i&&e[n+1][0]==i){var r=e[n-1][1],a=e[n][1],o=e[n+1][1],s=d(r,a);if(s){var c=a.substring(a.length-s);r=r.substring(0,r.length-s),a=c+a.substring(0,a.length-s),o=c+o}for(var l=r,u=a,f=o,p=t(r,a)+t(a,o);a.charAt(0)===o.charAt(0);){r+=a.charAt(0),a=a.substring(1)+o.charAt(0),o=o.substring(1);var y=t(r,a)+t(a,o);y>=p&&(p=y,l=r,u=a,f=o)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=u,f?e[n+1][1]=f:(e.splice(n+1,1),n--))}n++}}function b(e,t){e.push([i,``]);for(var a=0,o=0,s=0,c=``,u=``,f;a<e.length;){if(a<e.length-1&&!e[a][1]){e.splice(a,1);continue}switch(e[a][0]){case r:s++,u+=e[a][1],a++;break;case n:o++,c+=e[a][1],a++;break;case i:var p=a-s-o-1;if(t){if(p>=0&&w(e[p][1])){var m=e[p][1].slice(-1);if(e[p][1]=e[p][1].slice(0,-1),c=m+c,u=m+u,!e[p][1]){e.splice(p,1),a--;var h=p-1;e[h]&&e[h][0]===r&&(s++,u=e[h][1]+u,h--),e[h]&&e[h][0]===n&&(o++,c=e[h][1]+c,h--),p=h}}if(C(e[a][1])){var m=e[a][1].charAt(0);e[a][1]=e[a][1].slice(1),c+=m,u+=m}}if(a<e.length-1&&!e[a][1]){e.splice(a,1);break}if(c.length>0||u.length>0){c.length>0&&u.length>0&&(f=l(u,c),f!==0&&(p>=0?e[p][1]+=u.substring(0,f):(e.splice(0,0,[i,u.substring(0,f)]),a++),u=u.substring(f),c=c.substring(f)),f=d(u,c),f!==0&&(e[a][1]=u.substring(u.length-f)+e[a][1],u=u.substring(0,u.length-f),c=c.substring(0,c.length-f)));var g=s+o;c.length===0&&u.length===0?(e.splice(a-g,g),a-=g):c.length===0?(e.splice(a-g,g,[r,u]),a=a-g+1):u.length===0?(e.splice(a-g,g,[n,c]),a=a-g+1):(e.splice(a-g,g,[n,c],[r,u]),a=a-g+2)}a!==0&&e[a-1][0]===i?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,s=0,o=0,c=``,u=``}}e[e.length-1][1]===``&&e.pop();var _=!1;for(a=1;a<e.length-1;)e[a-1][0]===i&&e[a+1][0]===i&&(e[a][1].substring(e[a][1].length-e[a-1][1].length)===e[a-1][1]?(e[a][1]=e[a-1][1]+e[a][1].substring(0,e[a][1].length-e[a-1][1].length),e[a+1][1]=e[a-1][1]+e[a+1][1],e.splice(a-1,1),_=!0):e[a][1].substring(0,e[a+1][1].length)==e[a+1][1]&&(e[a-1][1]+=e[a+1][1],e[a][1]=e[a][1].substring(e[a+1][1].length)+e[a+1][1],e.splice(a+1,1),_=!0)),a++;_&&b(e,t)}function x(e){return e>=55296&&e<=56319}function S(e){return e>=56320&&e<=57343}function C(e){return S(e.charCodeAt(0))}function w(e){return x(e.charCodeAt(e.length-1))}function T(e){for(var t=[],n=0;n<e.length;n++)e[n][1].length>0&&t.push(e[n]);return t}function E(e,t,a,o){return w(e)||C(o)?null:T([[i,e],[n,t],[r,a],[i,o]])}function D(e,t,n){var r=typeof n==`number`?{index:n,length:0}:n.oldRange,i=typeof n==`number`?null:n.newRange,a=e.length,o=t.length;if(r.length===0&&(i===null||i.length===0)){var s=r.index,c=e.slice(0,s),l=e.slice(s),u=i?i.index:null;editBefore:{var d=s+o-a;if(u!==null&&u!==d||d<0||d>o)break editBefore;var f=t.slice(0,d),p=t.slice(d);if(p!==l)break editBefore;var m=Math.min(s,d),h=c.slice(0,m),g=f.slice(0,m);if(h!==g)break editBefore;var _=c.slice(m),v=f.slice(m);return E(h,_,v,l)}editAfter:{if(u!==null&&u!==s)break editAfter;var y=s,f=t.slice(0,y),p=t.slice(y);if(f!==c)break editAfter;var b=Math.min(a-y,o-y),x=l.slice(l.length-b),S=p.slice(p.length-b);if(x!==S)break editAfter;var _=l.slice(0,l.length-b),v=p.slice(0,p.length-b);return E(c,_,v,x)}}if(r.length>0&&i&&i.length===0)replaceRange:{var h=e.slice(0,r.index),x=e.slice(r.index+r.length),m=h.length,b=x.length;if(o<m+b)break replaceRange;var g=t.slice(0,m),S=t.slice(o-b);if(h!==g||x!==S)break replaceRange;var _=e.slice(m,a-b),v=t.slice(m,o-b);return E(h,_,v,x)}return null}function O(e,t,n,r){return a(e,t,n,r,!0)}O.INSERT=r,O.DELETE=n,O.EQUAL=i,t.exports=O})),Rx=o(((e,t)=>{var n=`__lodash_hash_undefined__`,r=9007199254740991,i=`[object Arguments]`,a=`[object Array]`,o=`[object Boolean]`,s=`[object Date]`,c=`[object Error]`,l=`[object Function]`,u=`[object GeneratorFunction]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object Promise]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object WeakMap]`,b=`[object ArrayBuffer]`,x=`[object DataView]`,S=`[object Float32Array]`,C=`[object Float64Array]`,w=`[object Int8Array]`,T=`[object Int16Array]`,E=`[object Int32Array]`,D=`[object Uint8Array]`,O=`[object Uint8ClampedArray]`,k=`[object Uint16Array]`,A=`[object Uint32Array]`,j=/[\\^$.*+?()[\]{}|]/g,M=/\w*$/,ee=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,P={};P[i]=P[a]=P[b]=P[x]=P[o]=P[s]=P[S]=P[C]=P[w]=P[T]=P[E]=P[d]=P[f]=P[p]=P[h]=P[g]=P[_]=P[v]=P[D]=P[O]=P[k]=P[A]=!0,P[c]=P[l]=P[y]=!1;var F=typeof global==`object`&&global&&global.Object===Object&&global,I=typeof self==`object`&&self&&self.Object===Object&&self,L=F||I||Function(`return this`)(),te=typeof e==`object`&&e&&!e.nodeType&&e,ne=te&&typeof t==`object`&&t&&!t.nodeType&&t,re=ne&&ne.exports===te;function ie(e,t){return e.set(t[0],t[1]),e}function ae(e,t){return e.add(t),e}function oe(e,t){for(var n=-1,r=e?e.length:0;++n<r&&t(e[n],n,e)!==!1;);return e}function se(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function ce(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function le(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function ue(e,t){return e?.[t]}function de(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}function fe(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function pe(e,t){return function(n){return e(t(n))}}function me(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var he=Array.prototype,ge=Function.prototype,_e=Object.prototype,ve=L[`__core-js_shared__`],ye=function(){var e=/[^.]+$/.exec(ve&&ve.keys&&ve.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),be=ge.toString,xe=_e.hasOwnProperty,Se=_e.toString,Ce=RegExp(`^`+be.call(xe).replace(j,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),we=re?L.Buffer:void 0,Te=L.Symbol,Ee=L.Uint8Array,De=pe(Object.getPrototypeOf,Object),Oe=Object.create,ke=_e.propertyIsEnumerable,Ae=he.splice,je=Object.getOwnPropertySymbols,Me=we?we.isBuffer:void 0,R=pe(Object.keys,Object),Ne=zt(L,`DataView`),Pe=zt(L,`Map`),Fe=zt(L,`Promise`),Ie=zt(L,`Set`),Le=zt(L,`WeakMap`),Re=zt(Object,`create`),ze=z(Ne),Be=z(Pe),Ve=z(Fe),He=z(Ie),Ue=z(Le),We=Te?Te.prototype:void 0,Ge=We?We.valueOf:void 0;function Ke(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qe(){this.__data__=Re?Re(null):{}}function Je(e){return this.has(e)&&delete this.__data__[e]}function Ye(e){var t=this.__data__;if(Re){var r=t[e];return r===n?void 0:r}return xe.call(t,e)?t[e]:void 0}function Xe(e){var t=this.__data__;return Re?t[e]!==void 0:xe.call(t,e)}function Ze(e,t){var r=this.__data__;return r[e]=Re&&t===void 0?n:t,this}Ke.prototype.clear=qe,Ke.prototype.delete=Je,Ke.prototype.get=Ye,Ke.prototype.has=Xe,Ke.prototype.set=Ze;function Qe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $e(){this.__data__=[]}function et(e){var t=this.__data__,n=vt(t,e);return n<0?!1:(n==t.length-1?t.pop():Ae.call(t,n,1),!0)}function tt(e){var t=this.__data__,n=vt(t,e);return n<0?void 0:t[n][1]}function nt(e){return vt(this.__data__,e)>-1}function rt(e,t){var n=this.__data__,r=vt(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}Qe.prototype.clear=$e,Qe.prototype.delete=et,Qe.prototype.get=tt,Qe.prototype.has=nt,Qe.prototype.set=rt;function it(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function at(){this.__data__={hash:new Ke,map:new(Pe||Qe),string:new Ke}}function ot(e){return Rt(this,e).delete(e)}function st(e){return Rt(this,e).get(e)}function ct(e){return Rt(this,e).has(e)}function lt(e,t){return Rt(this,e).set(e,t),this}it.prototype.clear=at,it.prototype.delete=ot,it.prototype.get=st,it.prototype.has=ct,it.prototype.set=lt;function ut(e){this.__data__=new Qe(e)}function dt(){this.__data__=new Qe}function ft(e){return this.__data__.delete(e)}function pt(e){return this.__data__.get(e)}function mt(e){return this.__data__.has(e)}function ht(e,t){var n=this.__data__;if(n instanceof Qe){var r=n.__data__;if(!Pe||r.length<199)return r.push([e,t]),this;n=this.__data__=new it(r)}return n.set(e,t),this}ut.prototype.clear=dt,ut.prototype.delete=ft,ut.prototype.get=pt,ut.prototype.has=mt,ut.prototype.set=ht;function gt(e,t){var n=Qt(e)||Zt(e)?le(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||xe.call(e,a))&&!(i&&(a==`length`||Gt(a,r)))&&n.push(a);return n}function _t(e,t,n){var r=e[t];(!(xe.call(e,t)&&Xt(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function vt(e,t){for(var n=e.length;n--;)if(Xt(e[n][0],t))return n;return-1}function yt(e,t){return e&&Ft(t,sn(t),e)}function bt(e,t,n,r,a,o,s){var c;if(r&&(c=o?r(e,a,o,s):r(e)),c!==void 0)return c;if(!an(e))return e;var d=Qt(e);if(d){if(c=Ht(e),!t)return Pt(e,c)}else{var f=Vt(e),m=f==l||f==u;if(tn(e))return Et(e,t);if(f==p||f==i||m&&!o){if(de(e))return o?e:{};if(c=Ut(m?{}:e),!t)return It(e,yt(c,e))}else{if(!P[f])return o?e:{};c=Wt(e,f,bt,t)}}s||=new ut;var h=s.get(e);if(h)return h;if(s.set(e,c),!d)var g=n?Lt(e):sn(e);return oe(g||e,function(i,a){g&&(a=i,i=e[a]),_t(c,a,bt(i,t,n,r,a,e,s))}),c}function xt(e){return an(e)?Oe(e):{}}function St(e,t,n){var r=t(e);return Qt(e)?r:se(r,n(e))}function Ct(e){return Se.call(e)}function wt(e){return!an(e)||qt(e)?!1:(nn(e)||de(e)?Ce:ee).test(z(e))}function Tt(e){if(!Jt(e))return R(e);var t=[];for(var n in Object(e))xe.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Et(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function Dt(e){var t=new e.constructor(e.byteLength);return new Ee(t).set(new Ee(e)),t}function Ot(e,t){var n=t?Dt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function kt(e,t,n){return ce(t?n(fe(e),!0):fe(e),ie,new e.constructor)}function At(e){var t=new e.constructor(e.source,M.exec(e));return t.lastIndex=e.lastIndex,t}function jt(e,t,n){return ce(t?n(me(e),!0):me(e),ae,new e.constructor)}function Mt(e){return Ge?Object(Ge.call(e)):{}}function Nt(e,t){var n=t?Dt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Pt(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function Ft(e,t,n,r){n||={};for(var i=-1,a=t.length;++i<a;){var o=t[i],s=r?r(n[o],e[o],o,n,e):void 0;_t(n,o,s===void 0?e[o]:s)}return n}function It(e,t){return Ft(e,Bt(e),t)}function Lt(e){return St(e,sn,Bt)}function Rt(e,t){var n=e.__data__;return Kt(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function zt(e,t){var n=ue(e,t);return wt(n)?n:void 0}var Bt=je?pe(je,Object):cn,Vt=Ct;(Ne&&Vt(new Ne(new ArrayBuffer(1)))!=x||Pe&&Vt(new Pe)!=d||Fe&&Vt(Fe.resolve())!=m||Ie&&Vt(new Ie)!=g||Le&&Vt(new Le)!=y)&&(Vt=function(e){var t=Se.call(e),n=t==p?e.constructor:void 0,r=n?z(n):void 0;if(r)switch(r){case ze:return x;case Be:return d;case Ve:return m;case He:return g;case Ue:return y}return t});function Ht(e){var t=e.length,n=e.constructor(t);return t&&typeof e[0]==`string`&&xe.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function Ut(e){return typeof e.constructor==`function`&&!Jt(e)?xt(De(e)):{}}function Wt(e,t,n,r){var i=e.constructor;switch(t){case b:return Dt(e);case o:case s:return new i(+e);case x:return Ot(e,r);case S:case C:case w:case T:case E:case D:case O:case k:case A:return Nt(e,r);case d:return kt(e,r,n);case f:case _:return new i(e);case h:return At(e);case g:return jt(e,r,n);case v:return Mt(e)}}function Gt(e,t){return t??=r,!!t&&(typeof e==`number`||N.test(e))&&e>-1&&e%1==0&&e<t}function Kt(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function qt(e){return!!ye&&ye in e}function Jt(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||_e)}function z(e){if(e!=null){try{return be.call(e)}catch{}try{return e+``}catch{}}return``}function Yt(e){return bt(e,!0,!0)}function Xt(e,t){return e===t||e!==e&&t!==t}function Zt(e){return en(e)&&xe.call(e,`callee`)&&(!ke.call(e,`callee`)||Se.call(e)==i)}var Qt=Array.isArray;function $t(e){return e!=null&&rn(e.length)&&!nn(e)}function en(e){return on(e)&&$t(e)}var tn=Me||ln;function nn(e){var t=an(e)?Se.call(e):``;return t==l||t==u}function rn(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=r}function an(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function on(e){return!!e&&typeof e==`object`}function sn(e){return $t(e)?gt(e):Tt(e)}function cn(){return[]}function ln(){return!1}t.exports=Yt})),zx=o(((e,t)=>{var n=`__lodash_hash_undefined__`,r=9007199254740991,i=`[object Arguments]`,a=`[object Array]`,o=`[object Boolean]`,s=`[object Date]`,c=`[object Error]`,l=`[object Function]`,u=`[object Map]`,d=`[object Number]`,f=`[object Object]`,p=`[object Promise]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k=/[\\^$.*+?()[\]{}|]/g,A=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,M={};M[b]=M[x]=M[S]=M[C]=M[w]=M[T]=M[E]=M[D]=M[O]=!0,M[i]=M[a]=M[v]=M[o]=M[y]=M[s]=M[c]=M[l]=M[u]=M[d]=M[f]=M[m]=M[h]=M[g]=M[_]=!1;var ee=typeof global==`object`&&global&&global.Object===Object&&global,N=typeof self==`object`&&self&&self.Object===Object&&self,P=ee||N||Function(`return this`)(),F=typeof e==`object`&&e&&!e.nodeType&&e,I=F&&typeof t==`object`&&t&&!t.nodeType&&t,L=I&&I.exports===F,te=L&&ee.process,ne=function(){try{return te&&te.binding&&te.binding(`util`)}catch{}}(),re=ne&&ne.isTypedArray;function ie(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function ae(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function oe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function se(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function ce(e){return function(t){return e(t)}}function le(e,t){return e.has(t)}function ue(e,t){return e?.[t]}function de(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function fe(e,t){return function(n){return e(t(n))}}function pe(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var me=Array.prototype,he=Function.prototype,ge=Object.prototype,_e=P[`__core-js_shared__`],ve=he.toString,ye=ge.hasOwnProperty,be=function(){var e=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),xe=ge.toString,Se=RegExp(`^`+ve.call(ye).replace(k,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),Ce=L?P.Buffer:void 0,we=P.Symbol,Te=P.Uint8Array,Ee=ge.propertyIsEnumerable,De=me.splice,Oe=we?we.toStringTag:void 0,ke=Object.getOwnPropertySymbols,Ae=Ce?Ce.isBuffer:void 0,je=fe(Object.keys,Object),Me=Mt(P,`DataView`),R=Mt(P,`Map`),Ne=Mt(P,`Promise`),Pe=Mt(P,`Set`),Fe=Mt(P,`WeakMap`),Ie=Mt(Object,`create`),Le=Vt(Me),Re=Vt(R),ze=Vt(Ne),Be=Vt(Pe),Ve=Vt(Fe),He=we?we.prototype:void 0,Ue=He?He.valueOf:void 0;function We(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ge(){this.__data__=Ie?Ie(null):{},this.size=0}function Ke(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function qe(e){var t=this.__data__;if(Ie){var r=t[e];return r===n?void 0:r}return ye.call(t,e)?t[e]:void 0}function Je(e){var t=this.__data__;return Ie?t[e]!==void 0:ye.call(t,e)}function Ye(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=Ie&&t===void 0?n:t,this}We.prototype.clear=Ge,We.prototype.delete=Ke,We.prototype.get=qe,We.prototype.has=Je,We.prototype.set=Ye;function Xe(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ze(){this.__data__=[],this.size=0}function Qe(e){var t=this.__data__,n=vt(t,e);return n<0?!1:(n==t.length-1?t.pop():De.call(t,n,1),--this.size,!0)}function $e(e){var t=this.__data__,n=vt(t,e);return n<0?void 0:t[n][1]}function et(e){return vt(this.__data__,e)>-1}function tt(e,t){var n=this.__data__,r=vt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}Xe.prototype.clear=Ze,Xe.prototype.delete=Qe,Xe.prototype.get=$e,Xe.prototype.has=et,Xe.prototype.set=tt;function nt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function rt(){this.size=0,this.__data__={hash:new We,map:new(R||Xe),string:new We}}function it(e){var t=jt(this,e).delete(e);return this.size-=+!!t,t}function at(e){return jt(this,e).get(e)}function ot(e){return jt(this,e).has(e)}function st(e,t){var n=jt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}nt.prototype.clear=rt,nt.prototype.delete=it,nt.prototype.get=at,nt.prototype.has=ot,nt.prototype.set=st;function ct(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new nt;++t<n;)this.add(e[t])}function lt(e){return this.__data__.set(e,n),this}function ut(e){return this.__data__.has(e)}ct.prototype.add=ct.prototype.push=lt,ct.prototype.has=ut;function dt(e){var t=this.__data__=new Xe(e);this.size=t.size}function ft(){this.__data__=new Xe,this.size=0}function pt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function mt(e){return this.__data__.get(e)}function ht(e){return this.__data__.has(e)}function gt(e,t){var n=this.__data__;if(n instanceof Xe){var r=n.__data__;if(!R||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new nt(r)}return n.set(e,t),this.size=n.size,this}dt.prototype.clear=ft,dt.prototype.delete=pt,dt.prototype.get=mt,dt.prototype.has=ht,dt.prototype.set=gt;function _t(e,t){var n=Wt(e),r=!n&&Ut(e),i=!n&&!r&&Kt(e),a=!n&&!r&&!i&&Zt(e),o=n||r||i||a,s=o?se(e.length,String):[],c=s.length;for(var l in e)(t||ye.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||It(l,c)))&&s.push(l);return s}function vt(e,t){for(var n=e.length;n--;)if(Ht(e[n][0],t))return n;return-1}function yt(e,t,n){var r=t(e);return Wt(e)?r:ae(r,n(e))}function bt(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Oe&&Oe in Object(e)?Nt(e):Bt(e)}function xt(e){return Xt(e)&&bt(e)==i}function St(e,t,n,r,i){return e===t?!0:e==null||t==null||!Xt(e)&&!Xt(t)?e!==e&&t!==t:Ct(e,t,n,r,St,i)}function Ct(e,t,n,r,o,s){var c=Wt(e),l=Wt(t),u=c?a:Ft(e),d=l?a:Ft(t);u=u==i?f:u,d=d==i?f:d;var p=u==f,m=d==f,h=u==d;if(h&&Kt(e)){if(!Kt(t))return!1;c=!0,p=!1}if(h&&!p)return s||=new dt,c||Zt(e)?Dt(e,t,n,r,o,s):Ot(e,t,u,n,r,o,s);if(!(n&1)){var g=p&&ye.call(e,`__wrapped__`),_=m&&ye.call(t,`__wrapped__`);if(g||_){var v=g?e.value():e,y=_?t.value():t;return s||=new dt,o(v,y,n,r,s)}}return h?(s||=new dt,kt(e,t,n,r,o,s)):!1}function wt(e){return!Yt(e)||Rt(e)?!1:(Jt(e)?Se:A).test(Vt(e))}function Tt(e){return Xt(e)&&z(e.length)&&!!M[bt(e)]}function Et(e){if(!zt(e))return je(e);var t=[];for(var n in Object(e))ye.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Dt(e,t,n,r,i,a){var o=n&1,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e);if(l&&a.get(t))return l==t;var u=-1,d=!0,f=n&2?new ct:void 0;for(a.set(e,t),a.set(t,e);++u<s;){var p=e[u],m=t[u];if(r)var h=o?r(m,p,u,t,e,a):r(p,m,u,e,t,a);if(h!==void 0){if(h)continue;d=!1;break}if(f){if(!oe(t,function(e,t){if(!le(f,t)&&(p===e||i(p,e,n,r,a)))return f.push(t)})){d=!1;break}}else if(!(p===m||i(p,m,n,r,a))){d=!1;break}}return a.delete(e),a.delete(t),d}function Ot(e,t,n,r,i,a,l){switch(n){case y:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case v:return!(e.byteLength!=t.byteLength||!a(new Te(e),new Te(t)));case o:case s:case d:return Ht(+e,+t);case c:return e.name==t.name&&e.message==t.message;case m:case g:return e==t+``;case u:var f=de;case h:var p=r&1;if(f||=pe,e.size!=t.size&&!p)return!1;var _=l.get(e);if(_)return _==t;r|=2,l.set(e,t);var b=Dt(f(e),f(t),r,i,a,l);return l.delete(e),b;case`[object Symbol]`:if(Ue)return Ue.call(e)==Ue.call(t)}return!1}function kt(e,t,n,r,i,a){var o=n&1,s=At(e),c=s.length;if(c!=At(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:ye.call(t,u)))return!1}var d=a.get(e);if(d&&a.get(t))return d==t;var f=!0;a.set(e,t),a.set(t,e);for(var p=o;++l<c;){u=s[l];var m=e[u],h=t[u];if(r)var g=o?r(h,m,u,t,e,a):r(m,h,u,e,t,a);if(!(g===void 0?m===h||i(m,h,n,r,a):g)){f=!1;break}p||=u==`constructor`}if(f&&!p){var _=e.constructor,v=t.constructor;_!=v&&`constructor`in e&&`constructor`in t&&!(typeof _==`function`&&_ instanceof _&&typeof v==`function`&&v instanceof v)&&(f=!1)}return a.delete(e),a.delete(t),f}function At(e){return yt(e,Qt,Pt)}function jt(e,t){var n=e.__data__;return Lt(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Mt(e,t){var n=ue(e,t);return wt(n)?n:void 0}function Nt(e){var t=ye.call(e,Oe),n=e[Oe];try{e[Oe]=void 0;var r=!0}catch{}var i=xe.call(e);return r&&(t?e[Oe]=n:delete e[Oe]),i}var Pt=ke?function(e){return e==null?[]:(e=Object(e),ie(ke(e),function(t){return Ee.call(e,t)}))}:$t,Ft=bt;(Me&&Ft(new Me(new ArrayBuffer(1)))!=y||R&&Ft(new R)!=u||Ne&&Ft(Ne.resolve())!=p||Pe&&Ft(new Pe)!=h||Fe&&Ft(new Fe)!=_)&&(Ft=function(e){var t=bt(e),n=t==f?e.constructor:void 0,r=n?Vt(n):``;if(r)switch(r){case Le:return y;case Re:return u;case ze:return p;case Be:return h;case Ve:return _}return t});function It(e,t){return t??=r,!!t&&(typeof e==`number`||j.test(e))&&e>-1&&e%1==0&&e<t}function Lt(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Rt(e){return!!be&&be in e}function zt(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||ge)}function Bt(e){return xe.call(e)}function Vt(e){if(e!=null){try{return ve.call(e)}catch{}try{return e+``}catch{}}return``}function Ht(e,t){return e===t||e!==e&&t!==t}var Ut=xt(function(){return arguments}())?xt:function(e){return Xt(e)&&ye.call(e,`callee`)&&!Ee.call(e,`callee`)},Wt=Array.isArray;function Gt(e){return e!=null&&z(e.length)&&!Jt(e)}var Kt=Ae||en;function qt(e,t){return St(e,t)}function Jt(e){if(!Yt(e))return!1;var t=bt(e);return t==l||t==`[object GeneratorFunction]`||t==`[object AsyncFunction]`||t==`[object Proxy]`}function z(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=r}function Yt(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function Xt(e){return typeof e==`object`&&!!e}var Zt=re?ce(re):Tt;function Qt(e){return Gt(e)?_t(e):Et(e)}function $t(){return[]}function en(){return!1}t.exports=qt})),Bx=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Rx(),n=zx(),r;(function(e){function r(e={},n={},r=!1){typeof e!=`object`&&(e={}),typeof n!=`object`&&(n={});let i=t(n);r||(i=Object.keys(i).reduce((e,t)=>(i[t]!=null&&(e[t]=i[t]),e),{}));for(let t in e)e[t]!==void 0&&n[t]===void 0&&(i[t]=e[t]);return Object.keys(i).length>0?i:void 0}e.compose=r;function i(e={},t={}){typeof e!=`object`&&(e={}),typeof t!=`object`&&(t={});let r=Object.keys(e).concat(Object.keys(t)).reduce((r,i)=>(n(e[i],t[i])||(r[i]=t[i]===void 0?null:t[i]),r),{});return Object.keys(r).length>0?r:void 0}e.diff=i;function a(e={},t={}){e||={};let n=Object.keys(t).reduce((n,r)=>(t[r]!==e[r]&&e[r]!==void 0&&(n[r]=t[r]),n),{});return Object.keys(e).reduce((n,r)=>(e[r]!==t[r]&&t[r]===void 0&&(n[r]=null),n),n)}e.invert=a;function o(e,t,n=!1){if(typeof e!=`object`)return t;if(typeof t!=`object`)return;if(!n)return t;let r=Object.keys(t).reduce((n,r)=>(e[r]===void 0&&(n[r]=t[r]),n),{});return Object.keys(r).length>0?r:void 0}e.transform=o})(r||={}),e.default=r})),Vx=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t;(function(e){function t(e){return typeof e.delete==`number`?e.delete:typeof e.retain==`number`?e.retain:typeof e.retain==`object`&&e.retain!==null?1:typeof e.insert==`string`?e.insert.length:1}e.length=t})(t||={}),e.default=t})),Hx=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Vx();e.default=class{constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||=1/0;let n=this.ops[this.index];if(n){let r=this.offset,i=t.default.length(n);if(e>=i-r?(e=i-r,this.index+=1,this.offset=0):this.offset+=e,typeof n.delete==`number`)return{delete:e};{let t={};return n.attributes&&(t.attributes=n.attributes),typeof n.retain==`number`?t.retain=e:typeof n.retain==`object`&&n.retain!==null?t.retain=n.retain:t.insert=typeof n.insert==`string`?n.insert.substr(r,e):n.insert,t}}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:1/0}peekType(){let e=this.ops[this.index];return e?typeof e.delete==`number`?`delete`:typeof e.retain==`number`||typeof e.retain==`object`&&e.retain!==null?`retain`:`insert`:`retain`}rest(){if(!this.hasNext())return[];if(this.offset===0)return this.ops.slice(this.index);{let e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)}}}})),Z=l(o(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;var n=Lx(),r=Rx(),i=zx(),a=Bx();e.AttributeMap=a.default;var o=Vx();e.Op=o.default;var s=Hx();e.OpIterator=s.default;var c=`\0`,l=(e,t)=>{if(typeof e!=`object`||!e)throw Error(`cannot retain a ${typeof e}`);if(typeof t!=`object`||!t)throw Error(`cannot retain a ${typeof t}`);let n=Object.keys(e)[0];if(!n||n!==Object.keys(t)[0])throw Error(`embed types not matched: ${n} != ${Object.keys(t)[0]}`);return[n,e[n],t[n]]},u=class e{constructor(e){this.ops=Array.isArray(e)?e:e!=null&&Array.isArray(e.ops)?e.ops:[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){let t=this.handlers[e];if(!t)throw Error(`no handlers for embed type "${e}"`);return t}insert(e,t){let n={};return typeof e==`string`&&e.length===0?this:(n.insert=e,typeof t==`object`&&t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if(typeof e==`number`&&e<=0)return this;let n={retain:e};return typeof t==`object`&&t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=r(e),typeof n==`object`){if(typeof e.delete==`number`&&typeof n.delete==`number`)return this.ops[t-1]={delete:n.delete+e.delete},this;if(typeof n.delete==`number`&&e.insert!=null&&(--t,n=this.ops[t-1],typeof n!=`object`))return this.ops.unshift(e),this;if(i(e.attributes,n.attributes)){if(typeof e.insert==`string`&&typeof n.insert==`string`)return this.ops[t-1]={insert:n.insert+e.insert},typeof e.attributes==`object`&&(this.ops[t-1].attributes=e.attributes),this;if(typeof e.retain==`number`&&typeof n.retain==`number`)return this.ops[t-1]={retain:n.retain+e.retain},typeof e.attributes==`object`&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){let e=this.ops[this.ops.length-1];return e&&typeof e.retain==`number`&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){let t=[],n=[];return this.forEach(r=>{(e(r)?t:n).push(r)}),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce((e,t)=>t.insert?e+o.default.length(t):t.delete?e-t.delete:e,0)}length(){return this.reduce((e,t)=>e+o.default.length(t),0)}slice(t=0,n=1/0){let r=[],i=new s.default(this.ops),a=0;for(;a<n&&i.hasNext();){let e;a<t?e=i.next(t-a):(e=i.next(n-a),r.push(e)),a+=o.default.length(e)}return new e(r)}compose(t){let n=new s.default(this.ops),r=new s.default(t.ops),o=[],c=r.peek();if(c!=null&&typeof c.retain==`number`&&c.attributes==null){let e=c.retain;for(;n.peekType()===`insert`&&n.peekLength()<=e;)e-=n.peekLength(),o.push(n.next());c.retain-e>0&&r.next(c.retain-e)}let u=new e(o);for(;n.hasNext()||r.hasNext();)if(r.peekType()===`insert`)u.push(r.next());else if(n.peekType()===`delete`)u.push(n.next());else{let t=Math.min(n.peekLength(),r.peekLength()),o=n.next(t),s=r.next(t);if(s.retain){let c={};if(typeof o.retain==`number`)c.retain=typeof s.retain==`number`?t:s.retain;else if(typeof s.retain==`number`)o.retain==null?c.insert=o.insert:c.retain=o.retain;else{let t=o.retain==null?`insert`:`retain`,[n,r,i]=l(o[t],s.retain),a=e.getHandler(n);c[t]={[n]:a.compose(r,i,t===`retain`)}}let d=a.default.compose(o.attributes,s.attributes,typeof o.retain==`number`);if(d&&(c.attributes=d),u.push(c),!r.hasNext()&&i(u.ops[u.ops.length-1],c)){let t=new e(n.rest());return u.concat(t).chop()}}else typeof s.delete==`number`&&(typeof o.retain==`number`||typeof o.retain==`object`&&o.retain!==null)&&u.push(s)}return u.chop()}concat(t){let n=new e(this.ops.slice());return t.ops.length>0&&(n.push(t.ops[0]),n.ops=n.ops.concat(t.ops.slice(1))),n}diff(t,r){if(this.ops===t.ops)return new e;let o=[this,t].map(e=>e.map(n=>{if(n.insert!=null)return typeof n.insert==`string`?n.insert:c;throw Error(`diff() called `+(e===t?`on`:`with`)+` non-document`)}).join(``)),l=new e,u=n(o[0],o[1],r,!0),d=new s.default(this.ops),f=new s.default(t.ops);return u.forEach(e=>{let t=e[1].length;for(;t>0;){let r=0;switch(e[0]){case n.INSERT:r=Math.min(f.peekLength(),t),l.push(f.next(r));break;case n.DELETE:r=Math.min(t,d.peekLength()),d.next(r),l.delete(r);break;case n.EQUAL:r=Math.min(d.peekLength(),f.peekLength(),t);let e=d.next(r),o=f.next(r);i(e.insert,o.insert)?l.retain(r,a.default.diff(e.attributes,o.attributes)):l.push(o).delete(r)}t-=r}}),l.chop()}eachLine(t,n=`
|
|
191
|
+
`){let r=new s.default(this.ops),i=new e,a=0;for(;r.hasNext();){if(r.peekType()!==`insert`)return;let s=r.peek(),c=o.default.length(s)-r.peekLength(),l=typeof s.insert==`string`?s.insert.indexOf(n,c)-c:-1;if(l<0)i.push(r.next());else if(l>0)i.push(r.next(l));else{if(t(i,r.next(1).attributes||{},a)===!1)return;a+=1,i=new e}}i.length()>0&&t(i,{},a)}invert(t){let n=new e;return this.reduce((r,i)=>{if(i.insert)n.delete(o.default.length(i));else if(typeof i.retain==`number`&&i.attributes==null)return n.retain(i.retain),r+i.retain;else if(i.delete||typeof i.retain==`number`){let e=i.delete||i.retain;return t.slice(r,r+e).forEach(e=>{i.delete?n.push(e):i.retain&&i.attributes&&n.retain(o.default.length(e),a.default.invert(i.attributes,e.attributes))}),r+e}else if(typeof i.retain==`object`&&i.retain!==null){let o=t.slice(r,r+1),c=new s.default(o.ops).next(),[u,d,f]=l(i.retain,c.insert),p=e.getHandler(u);return n.retain({[u]:p.invert(d,f)},a.default.invert(i.attributes,c.attributes)),r+1}return r},0),n.chop()}transform(t,n=!1){if(n=!!n,typeof t==`number`)return this.transformPosition(t,n);let r=t,i=new s.default(this.ops),c=new s.default(r.ops),l=new e;for(;i.hasNext()||c.hasNext();)if(i.peekType()===`insert`&&(n||c.peekType()!==`insert`))l.retain(o.default.length(i.next()));else if(c.peekType()===`insert`)l.push(c.next());else{let t=Math.min(i.peekLength(),c.peekLength()),r=i.next(t),o=c.next(t);if(r.delete)continue;if(o.delete)l.push(o);else{let i=r.retain,s=o.retain,c=typeof s==`object`&&s?s:t;if(typeof i==`object`&&i&&typeof s==`object`&&s){let t=Object.keys(i)[0];if(t===Object.keys(s)[0]){let r=e.getHandler(t);r&&(c={[t]:r.transform(i[t],s[t],n)})}}l.retain(c,a.default.transform(r.attributes,o.attributes,n))}}return l.chop()}transformPosition(e,t=!1){t=!!t;let n=new s.default(this.ops),r=0;for(;n.hasNext()&&r<=e;){let i=n.peekLength(),a=n.peekType();if(n.next(),a===`delete`){e-=Math.min(i,e-r);continue}a===`insert`&&(r<e||!t)&&(e+=i),r+=i}return e}};u.Op=o.default,u.OpIterator=s.default,u.AttributeMap=a.default,u.handlers={},e.default=u,typeof t==`object`&&(t.exports=u,t.exports.default=u)}))(),1),Ux=class extends Ax{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return``}};Ux.blotName=`break`,Ux.tagName=`BR`;var Wx=class extends Ix{},Gx={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function Kx(e){return e.replace(/[&<>"']/g,e=>Gx[e])}var qx=class e extends Tx{static allowedChildren=[e,Ux,Ax,Wx];static order=[`cursor`,`inline`,`link`,`underline`,`strike`,`italic`,`bold`,`script`,`code`];static compare(t,n){let r=e.order.indexOf(t),i=e.order.indexOf(n);return r>=0||i>=0?r-i:t===n?0:t<n?-1:1}formatAt(t,n,r,i){if(e.compare(this.statics.blotName,r)<0&&this.scroll.query(r,X.BLOT)){let e=this.isolate(t,n);i&&e.wrap(r,i)}else super.formatAt(t,n,r,i)}optimize(t){if(super.optimize(t),this.parent instanceof e&&e.compare(this.statics.blotName,this.parent.statics.blotName)>0){let e=this.parent.isolate(this.offset(),this.length());this.moveChildren(e),e.wrap(this)}}},Jx=1,Yx=class extends Dx{cache={};delta(){return this.cache.delta??(this.cache.delta=Zx(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,n,r){t<=0||(this.scroll.query(n,X.BLOCK)?e+t===this.length()&&this.format(n,r):super.formatAt(e,Math.min(t,this.length()-e-1),n,r),this.cache={})}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n),this.cache={};return}if(t.length===0)return;let r=t.split(`
|
|
192
|
+
`),i=r.shift();i.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let a=this;r.reduce((e,t)=>(a=a.split(e,!0),a.insertAt(0,t),t.length),e+i.length)}insertBefore(e,t){let{head:n}=this.children;super.insertBefore(e,t),n instanceof Ux&&n.remove(),this.cache={}}length(){return this.cache.length??(this.cache.length=super.length()+Jx),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(t&&(e===0||e>=this.length()-Jx)){let t=this.clone();return e===0?(this.parent.insertBefore(t,this),this):(this.parent.insertBefore(t,this.next),t)}let n=super.split(e,t);return this.cache={},n}};Yx.blotName=`block`,Yx.tagName=`P`,Yx.defaultChild=Ux,Yx.allowedChildren=[Ux,qx,Ax,Wx];var Xx=class extends Ax{attach(){super.attach(),this.attributes=new mx(this.domNode)}delta(){return new Z.default().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){let n=this.scroll.query(e,X.BLOCK_ATTRIBUTE);n!=null&&this.attributes.attribute(n,t)}formatAt(e,t,n,r){this.format(n,r)}insertAt(e,t,n){if(n!=null){super.insertAt(e,t,n);return}let r=t.split(`
|
|
193
|
+
`),i=r.pop(),a=r.map(e=>{let t=this.scroll.create(Yx.blotName);return t.insertAt(0,e),t}),o=this.split(e);a.forEach(e=>{this.parent.insertBefore(e,o)}),i&&this.parent.insertBefore(this.scroll.create(`text`,i),o)}};Xx.scope=X.BLOCK_BLOT;function Zx(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.descendants(vx).reduce((e,n)=>n.length()===0?e:e.insert(n.value(),Qx(n,{},t)),new Z.default).insert(`
|
|
194
|
+
`,Qx(e))}function Qx(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return e==null||(`formats`in e&&typeof e.formats==`function`&&(t={...t,...e.formats()},n&&delete t[`code-token`]),e.parent==null||e.parent.statics.blotName===`scroll`||e.parent.statics.scope!==e.statics.scope)?t:Qx(e.parent,t,n)}var $x=class e extends Ax{static blotName=`cursor`;static className=`ql-cursor`;static tagName=`span`;static CONTENTS=``;static value(){}constructor(t,n,r){super(t,n),this.selection=r,this.textNode=document.createTextNode(e.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(t,n){if(this.savedLength!==0){super.format(t,n);return}let r=this,i=0;for(;r!=null&&r.statics.scope!==X.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=e.CONTENTS.length,r.optimize(),r.formatAt(i,e.CONTENTS.length,t,n),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;let t=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);let n=this.prev instanceof Wx?this.prev:null,r=n?n.length():0,i=this.next instanceof Wx?this.next:null,a=i?i.text:``,{textNode:o}=this,s=o.data.split(e.CONTENTS).join(``);o.data=e.CONTENTS;let c;if(n)c=n,(s||i)&&(n.insertAt(n.length(),s+a),i&&i.remove());else if(i)c=i,i.insertAt(0,s);else{let e=document.createTextNode(s);c=this.scroll.create(e),this.parent.insertBefore(c,this)}if(this.remove(),t){let e=(e,t)=>n&&e===n.domNode?t:e===o?r+t-1:i&&e===i.domNode?r+s.length+t:null,a=e(t.start.node,t.start.offset),l=e(t.end.node,t.end.offset);if(a!==null&&l!==null)return{startNode:c.domNode,startOffset:a,endNode:c.domNode,endOffset:l}}return null}update(e,t){if(e.some(e=>e.type===`characterData`&&e.target===this.textNode)){let e=this.restore();e&&(t.range=e)}}optimize(t){super.optimize(t);let{parent:n}=this;for(;n;){if(n.domNode.tagName===`A`){this.savedLength=e.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return``}},eS=l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1),tS=new WeakMap,nS=[`error`,`warn`,`log`,`info`],rS=`warn`;function iS(e){if(rS&&nS.indexOf(e)<=nS.indexOf(rS)){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console[e](...n)}}function aS(e){return nS.reduce((t,n)=>(t[n]=iS.bind(console,n,e),t),{})}aS.level=e=>{rS=e},iS.level=aS.level;var oS=aS(`quill:events`);[`selectionchange`,`mousedown`,`mouseup`,`click`].forEach(e=>{document.addEventListener(e,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];Array.from(document.querySelectorAll(`.ql-container`)).forEach(e=>{let n=tS.get(e);n&&n.emitter&&n.emitter.handleDOM(...t)})})});var Q=class extends eS.default{static events={EDITOR_CHANGE:`editor-change`,SCROLL_BEFORE_UPDATE:`scroll-before-update`,SCROLL_BLOT_MOUNT:`scroll-blot-mount`,SCROLL_BLOT_UNMOUNT:`scroll-blot-unmount`,SCROLL_OPTIMIZE:`scroll-optimize`,SCROLL_UPDATE:`scroll-update`,SCROLL_EMBED_UPDATE:`scroll-embed-update`,SELECTION_CHANGE:`selection-change`,TEXT_CHANGE:`text-change`,COMPOSITION_BEFORE_START:`composition-before-start`,COMPOSITION_START:`composition-start`,COMPOSITION_BEFORE_END:`composition-before-end`,COMPOSITION_END:`composition-end`};static sources={API:`api`,SILENT:`silent`,USER:`user`};constructor(){super(),this.domListeners={},this.on(`error`,oS.error)}emit(){var e=[...arguments];return oS.log.call(oS,...e),super.emit(...e)}handleDOM(e){var t=[...arguments].slice(1);(this.domListeners[e.type]||[]).forEach(n=>{let{node:r,handler:i}=n;(e.target===r||r.contains(e.target))&&i(e,...t)})}listenDOM(e,t,n){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:n})}},sS=aS(`quill:selection`),cS=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}},lS=class{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create(`cursor`,this),this.savedRange=new cS(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM(`selectionchange`,document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,Q.sources.USER),1)}),this.emitter.on(Q.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;let e=this.getNativeRange();e!=null&&e.start.node!==this.cursor.textNode&&this.emitter.once(Q.events.SCROLL_UPDATE,(t,n)=>{try{this.root.contains(e.start.node)&&this.root.contains(e.end.node)&&this.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset);let r=n.some(e=>e.type===`characterData`||e.type===`childList`||e.type===`attributes`&&e.target===this.root);this.update(r?Q.sources.SILENT:t)}catch{}})}),this.emitter.on(Q.events.SCROLL_OPTIMIZE,(e,t)=>{if(t.range){let{startNode:e,startOffset:n,endNode:r,endOffset:i}=t.range;this.setNativeRange(e,n,r,i),this.update(Q.sources.SILENT)}}),this.update(Q.sources.SILENT)}handleComposition(){this.emitter.on(Q.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Q.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){let e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM(`mousedown`,document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM(`mouseup`,document.body,()=>{this.mouseDown=!1,this.update(Q.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();let n=this.getNativeRange();if(!(n==null||!n.native.collapsed||this.scroll.query(e,X.BLOCK))){if(n.start.node!==this.cursor.textNode){let e=this.scroll.find(n.start.node,!1);if(e==null)return;if(e instanceof vx){let t=e.split(n.start.offset);e.parent.insertBefore(this.cursor,t)}else e.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=this.scroll.length();e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;let r,[i,a]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&a===i.length()){let[t]=this.scroll.leaf(e+1);if(t){let[n]=this.scroll.line(e),[r]=this.scroll.line(e+1);n===r&&(i=t,a=0)}}[r,a]=i.position(a,!0);let o=document.createRange();if(t>0)return o.setStart(r,a),[i,a]=this.scroll.leaf(e+t),i==null?null:([r,a]=i.position(a,!0),o.setEnd(r,a),o.getBoundingClientRect());let s=`left`,c;if(r instanceof Text){if(!r.data.length)return null;a<r.data.length?(o.setStart(r,a),o.setEnd(r,a+1)):(o.setStart(r,a-1),o.setEnd(r,a),s=`right`),c=o.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;c=i.domNode.getBoundingClientRect(),a>0&&(s=`right`)}return{bottom:c.top+c.height,height:c.height,left:c[s],right:c[s],top:c.top,width:0}}getNativeRange(){let e=document.getSelection();if(e==null||e.rangeCount<=0)return null;let t=e.getRangeAt(0);if(t==null)return null;let n=this.normalizeNative(t);return sS.info(`getNativeRange`,n),n}getRange(){let e=this.scroll.domNode;if(`isConnected`in e&&!e.isConnected)return[null,null];let t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&uS(this.root,document.activeElement)}normalizedToRange(e){let t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);let n=t.map(e=>{let[t,n]=e,r=this.scroll.find(t,!0),i=r.offset(this.scroll);return n===0?i:r instanceof vx?i+r.index(t,n):i+r.length()}),r=Math.min(Math.max(...n),this.scroll.length()-1),i=Math.min(r,...n);return new cS(i,r-i)}normalizeNative(e){if(!uS(this.root,e.startContainer)||!e.collapsed&&!uS(this.root,e.endContainer))return null;let t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(e=>{let{node:t,offset:n}=e;for(;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else if(t.childNodes.length===n)t=t.lastChild,n=t instanceof Text?t.data.length:t.childNodes.length>0?t.childNodes.length:t.childNodes.length+1;else break;e.node=t,e.offset=n}),t}rangeToNative(e){let t=this.scroll.length(),n=(e,n)=>{e=Math.min(t-1,e);let[r,i]=this.scroll.leaf(e);return r?r.position(i,n):[null,-1]};return[...n(e.index,!1),...n(e.index+e.length,!0)]}setNativeRange(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0&&arguments[4];if(sS.info(`setNativeRange`,e,t,n,r),e!=null&&(this.root.parentNode==null||e.parentNode==null||n.parentNode==null))return;let a=document.getSelection();if(a!=null){if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});let{native:o}=this.getNativeRange()||{};if(o==null||i||e!==o.startContainer||t!==o.startOffset||n!==o.endContainer||r!==o.endOffset){e instanceof Element&&e.tagName===`BR`&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),n instanceof Element&&n.tagName===`BR`&&(r=Array.from(n.parentNode.childNodes).indexOf(n),n=n.parentNode);let i=document.createRange();i.setStart(e,t),i.setEnd(n,r),a.removeAllRanges(),a.addRange(i)}}else a.removeAllRanges(),this.root.blur()}}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Q.sources.API;if(typeof t==`string`&&(n=t,t=!1),sS.info(`setRange`,e),e!=null){let n=this.rangeToNative(e);this.setNativeRange(...n,t)}else this.setNativeRange(null);this.update(n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q.sources.USER,t=this.lastRange,[n,r]=this.getRange();if(this.lastRange=n,this.lastNative=r,this.lastRange!=null&&(this.savedRange=this.lastRange),!ix(t,this.lastRange)){if(!this.composing&&r!=null&&r.native.collapsed&&r.start.node!==this.cursor.textNode){let e=this.cursor.restore();e&&this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}let n=[Q.events.SELECTION_CHANGE,rx(this.lastRange),rx(t),e];this.emitter.emit(Q.events.EDITOR_CHANGE,...n),e!==Q.sources.SILENT&&this.emitter.emit(...n)}}};function uS(e,t){try{t.parentNode}catch{return!1}return e.contains(t)}var dS=/^[ -~]*$/,fS=class{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();let n=_S(e),r=new Z.default;return yS(n.ops.slice()).reduce((e,n)=>{let i=Z.Op.length(n),a=n.attributes||{},o=!1,s=!1;if(n.insert!=null){if(r.retain(i),typeof n.insert==`string`){let r=n.insert;s=!r.endsWith(`
|
|
195
|
+
`)&&(t<=e||!!this.scroll.descendant(Xx,e)[0]),this.scroll.insertAt(e,r);let[i,o]=this.scroll.line(e),c=Sm({},Qx(i));if(i instanceof Yx){let[e]=i.descendant(vx,o);e&&(c=Sm(c,Qx(e)))}a=Z.AttributeMap.diff(c,a)||{}}else if(typeof n.insert==`object`){let r=Object.keys(n.insert)[0];if(r==null)return e;let i=this.scroll.query(r,X.INLINE)!=null;if(i)(t<=e||this.scroll.descendant(Xx,e)[0])&&(s=!0);else if(e>0){let[t,n]=this.scroll.descendant(vx,e-1);t instanceof Wx?t.value()[n]!==`
|
|
196
|
+
`&&(o=!0):t instanceof Ax&&t.statics.scope===X.INLINE_BLOT&&(o=!0)}if(this.scroll.insertAt(e,r,n.insert[r]),i){let[t]=this.scroll.descendant(vx,e);if(t){let e=Sm({},Qx(t));a=Z.AttributeMap.diff(e,a)||{}}}}t+=i}else if(r.push(n),n.retain!==null&&typeof n.retain==`object`){let t=Object.keys(n.retain)[0];if(t==null)return e;this.scroll.updateEmbedAt(e,t,n.retain[t])}Object.keys(a).forEach(t=>{this.scroll.formatAt(e,i,t,a[t])});let c=+!!o,l=+!!s;return t+=c+l,r.retain(c),r.delete(l),e+i+c+l},0),r.reduce((e,t)=>typeof t.delete==`number`?(this.scroll.deleteAt(e,t.delete),e):e+Z.Op.length(t),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(n)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new Z.default().retain(e).delete(t))}formatLine(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(n).forEach(r=>{this.scroll.lines(e,Math.max(t,1)).forEach(e=>{e.format(r,n[r])})}),this.scroll.optimize();let r=new Z.default().retain(e).retain(t,rx(n));return this.update(r)}formatText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(n).forEach(r=>{this.scroll.formatAt(e,t,r,n[r])});let r=new Z.default().retain(e).retain(t,rx(n));return this.update(r)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new Z.default)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=[],r=[];t===0?this.scroll.path(e).forEach(e=>{let[t]=e;t instanceof Yx?n.push(t):t instanceof vx&&r.push(t)}):(n=this.scroll.lines(e,t),r=this.scroll.descendants(vx,e,t));let[i,a]=[n,r].map(e=>{let t=e.shift();if(t==null)return{};let n=Qx(t);for(;Object.keys(n).length>0;){let t=e.shift();if(t==null)return n;n=hS(Qx(t),n)}return n});return{...i,...a}}getHTML(e,t){let[n,r]=this.scroll.line(e);if(n){let i=n.length();return n.length()>=r+t&&(r!==0||t!==i)?mS(n,r,t,!0):mS(this.scroll,e,t,!0)}return``}getText(e,t){return this.getContents(e,t).filter(e=>typeof e.insert==`string`).map(e=>e.insert).join(``)}insertContents(e,t){let n=_S(t),r=new Z.default().retain(e).concat(n);return this.scroll.insertContents(e,n),this.update(r)}insertEmbed(e,t,n){return this.scroll.insertAt(e,t,n),this.update(new Z.default().retain(e).insert({[t]:n}))}insertText(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
|
|
197
|
+
`).replace(/\r/g,`
|
|
198
|
+
`),this.scroll.insertAt(e,t),Object.keys(n).forEach(r=>{this.scroll.formatAt(e,t.length,r,n[r])}),this.update(new Z.default().retain(e).insert(t,rx(n)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;let e=this.scroll.children.head;if(e?.statics.blotName!==Yx.blotName)return!1;let t=e;return t.children.length>1?!1:t.children.head instanceof Ux}removeFormat(e,t){let n=this.getText(e,t),[r,i]=this.scroll.line(e+t),a=0,o=new Z.default;r!=null&&(a=r.length()-i,o=r.delta().slice(i,i+a-1).insert(`
|
|
199
|
+
`));let s=this.getContents(e,t+a).diff(new Z.default().insert(n).concat(o)),c=new Z.default().retain(e).concat(s);return this.applyDelta(c)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=this.delta;if(t.length===1&&t[0].type===`characterData`&&t[0].target.data.match(dS)&&this.scroll.find(t[0].target)){let i=this.scroll.find(t[0].target),a=Qx(i),o=i.offset(this.scroll),s=t[0].oldValue.replace($x.CONTENTS,``),c=new Z.default().insert(s),l=new Z.default().insert(i.value()),u=n&&{oldRange:vS(n.oldRange,-o),newRange:vS(n.newRange,-o)};e=new Z.default().retain(o).concat(c.diff(l,u)).reduce((e,t)=>t.insert?e.insert(t.insert,a):e.push(t),new Z.default),this.delta=r.compose(e)}else this.delta=this.getDelta(),(!e||!ix(r.compose(e),this.delta))&&(e=r.diff(this.delta,n));return e}};function pS(e,t,n){if(e.length===0){let[e]=gS(n.pop());return t<=0?`</li></${e}>`:`</li></${e}>${pS([],t-1,n)}`}let[{child:r,offset:i,length:a,indent:o,type:s},...c]=e,[l,u]=gS(s);if(o>t)return n.push(s),o===t+1?`<${l}><li${u}>${mS(r,i,a)}${pS(c,o,n)}`:`<${l}><li>${pS(e,t+1,n)}`;let d=n[n.length-1];if(o===t&&s===d)return`</li><li${u}>${mS(r,i,a)}${pS(c,o,n)}`;let[f]=gS(n.pop());return`</li></${f}>${pS(e,t-1,n)}`}function mS(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(`html`in e&&typeof e.html==`function`)return e.html(t,n);if(e instanceof Wx)return Kx(e.value().slice(t,t+n)).replaceAll(` `,` `);if(e instanceof Sx){if(e.statics.blotName===`list-container`){let r=[];return e.children.forEachAt(t,n,(e,t,n)=>{let i=`formats`in e&&typeof e.formats==`function`?e.formats():{};r.push({child:e,offset:t,length:n,indent:i.indent||0,type:i.list})}),pS(r,-1,[])}let i=[];if(e.children.forEachAt(t,n,(e,t,n)=>{i.push(mS(e,t,n))}),r||e.statics.blotName===`list`)return i.join(``);let{outerHTML:a,innerHTML:o}=e.domNode,[s,c]=a.split(`>${o}<`);return s===`<table`?`<table style="border: 1px solid #000;">${i.join(``)}<${c}`:`${s}>${i.join(``)}<${c}`}return e.domNode instanceof Element?e.domNode.outerHTML:``}function hS(e,t){return Object.keys(t).reduce((n,r)=>{if(e[r]==null)return n;let i=t[r];return n[r]=i===e[r]?i:Array.isArray(i)?i.indexOf(e[r])<0?i.concat([e[r]]):i:[i,e[r]],n},{})}function gS(e){let t=e===`ordered`?`ol`:`ul`;switch(e){case`checked`:return[t,` data-list="checked"`];case`unchecked`:return[t,` data-list="unchecked"`];default:return[t,``]}}function _S(e){return e.reduce((e,t)=>{if(typeof t.insert==`string`){let n=t.insert.replace(/\r\n/g,`
|
|
200
|
+
`).replace(/\r/g,`
|
|
201
|
+
`);return e.insert(n,t.attributes)}return e.push(t)},new Z.default)}function vS(e,t){let{index:n,length:r}=e;return new cS(n+t,r)}function yS(e){let t=[];return e.forEach(e=>{typeof e.insert==`string`?e.insert.split(`
|
|
202
|
+
`).forEach((n,r)=>{r&&t.push({insert:`
|
|
203
|
+
`,attributes:e.attributes}),n&&t.push({insert:n,attributes:e.attributes})}):t.push(e)}),t}var bS=class{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}},xS=``,SS=class extends Ax{constructor(e,t){super(e,t),this.contentNode=document.createElement(`span`),this.contentNode.setAttribute(`contenteditable`,`false`),Array.from(this.domNode.childNodes).forEach(e=>{this.contentNode.appendChild(e)}),this.leftGuard=document.createTextNode(xS),this.rightGuard=document.createTextNode(xS),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,n,r=e.data.split(xS).join(``);if(e===this.leftGuard){if(this.prev instanceof Wx){let e=this.prev.length();this.prev.insertAt(e,r),t={startNode:this.prev.domNode,startOffset:e+r.length}}else n=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(n),this),t={startNode:n,startOffset:r.length}}else e===this.rightGuard&&(this.next instanceof Wx?(this.next.insertAt(0,r),t={startNode:this.next.domNode,startOffset:r.length}):(n=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(n),this.next),t={startNode:n,startOffset:r.length}));return e.data=xS,t}update(e,t){e.forEach(e=>{if(e.type===`characterData`&&(e.target===this.leftGuard||e.target===this.rightGuard)){let n=this.restore(e.target);n&&(t.range=n)}})}},CS=class{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener(`compositionstart`,e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener(`compositionend`,e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){let t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof SS)&&(this.emitter.emit(Q.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Q.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Q.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Q.events.COMPOSITION_END,e),this.isComposing=!1}},wS=class e{static DEFAULTS={modules:{}};static themes={default:e};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]??this.addModule(e)})}addModule(e){let t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}},TS=e=>e.parentElement||e.getRootNode().host||null,ES=e=>{let t=e.getBoundingClientRect(),n=`offsetWidth`in e&&Math.abs(t.width)/e.offsetWidth||1,r=`offsetHeight`in e&&Math.abs(t.height)/e.offsetHeight||1;return{top:t.top,right:t.left+e.clientWidth*n,bottom:t.top+e.clientHeight*r,left:t.left}},DS=e=>{let t=parseInt(e,10);return Number.isNaN(t)?0:t},OS=(e,t,n,r,i,a)=>e<n&&t>r?0:e<n?-(n-e+i):t>r?t-e>r-n?e+i-n:t-r+a:0,kS=(e,t)=>{let n=e.ownerDocument,r=t,i=e;for(;i;){let e=i===n.body,t=e?{top:0,right:window.visualViewport?.width??n.documentElement.clientWidth,bottom:window.visualViewport?.height??n.documentElement.clientHeight,left:0}:ES(i),a=getComputedStyle(i),o=OS(r.left,r.right,t.left,t.right,DS(a.scrollPaddingLeft),DS(a.scrollPaddingRight)),s=OS(r.top,r.bottom,t.top,t.bottom,DS(a.scrollPaddingTop),DS(a.scrollPaddingBottom));if(o||s){if(e)n.defaultView?.scrollBy(o,s);else{let{scrollLeft:e,scrollTop:t}=i;s&&(i.scrollTop+=s),o&&(i.scrollLeft+=o);let n=i.scrollLeft-e,a=i.scrollTop-t;r={left:r.left-n,top:r.top-a,right:r.right-n,bottom:r.bottom-a}}}i=e||a.position===`fixed`?null:TS(i)}},AS=100,jS=[`block`,`break`,`cursor`,`inline`,`scroll`,`text`],MS=(e,t,n)=>{let r=new lx;return jS.forEach(e=>{let n=t.query(e);n&&r.register(n)}),e.forEach(e=>{let i=t.query(e);i||n.error(`Cannot register "${e}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(r.register(i),i=`blotName`in i?i.requiredContainer??null:null,a+=1,a>AS){n.error(`Cycle detected in registering blot requiredContainer: "${e}"`);break}}),r},NS=aS(`quill`),PS=new lx;Sx.uiClass=`ql-ui`;var $=class e{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:``,readOnly:!1,registry:PS,theme:`default`};static events=Q.events;static sources=Q.sources;static version=`2.0.3`;static imports={delta:Z.default,parchment:ax,"core/module":bS,"core/theme":wS};static debug(e){e===!0&&(e=`log`),aS.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return tS.get(e)||PS.find(e,t)}static import(e){return this.imports[e]??NS.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!=`string`){let e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),n=`attrName`in e?e.attrName:e.blotName;typeof n==`string`?this.register(`formats/${n}`,e,t):Object.keys(e).forEach(n=>{this.register(n,e[n],t)})}else{let e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!n&&NS.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith(`blots/`)||e.startsWith(`formats/`))&&t&&typeof t!=`boolean`&&t.blotName!==`abstract`&&PS.register(t),typeof t.register==`function`&&t.register(PS)}}constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=RS(t,n),this.container=this.options.container,this.container==null){NS.error(`Invalid Quill container`,t);return}this.options.debug&&e.debug(this.options.debug);let r=this.container.innerHTML.trim();this.container.classList.add(`ql-container`),this.container.innerHTML=``,tS.set(this.container,this),this.root=this.addContainer(`ql-editor`),this.root.classList.add(`ql-blank`),this.emitter=new Q;let i=Px.blotName,a=this.options.registry.query(i);if(!a||!(`blotName`in a))throw Error(`Cannot initialize Quill without "${i}" blot`);if(this.scroll=new a(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new fS(this.scroll),this.selection=new lS(this.scroll,this.emitter),this.composition=new CS(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule(`keyboard`),this.clipboard=this.theme.addModule(`clipboard`),this.history=this.theme.addModule(`history`),this.uploader=this.theme.addModule(`uploader`),this.theme.addModule(`input`),this.theme.addModule(`uiNode`),this.theme.init(),this.emitter.on(Q.events.EDITOR_CHANGE,e=>{e===Q.events.TEXT_CHANGE&&this.root.classList.toggle(`ql-blank`,this.editor.isBlank())}),this.emitter.on(Q.events.SCROLL_UPDATE,(e,t)=>{let n=this.selection.lastRange,[r]=this.selection.getRange(),i=n&&r?{oldRange:n,newRange:r}:void 0;zS.call(this,()=>this.editor.update(null,t,i),e)}),this.emitter.on(Q.events.SCROLL_EMBED_UPDATE,(t,n)=>{let r=this.selection.lastRange,[i]=this.selection.getRange(),a=r&&i?{oldRange:r,newRange:i}:void 0;zS.call(this,()=>{let e=new Z.default().retain(t.offset(this)).retain({[t.statics.blotName]:n});return this.editor.update(e,[],a)},e.sources.USER)}),r){let e=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
|
|
204
|
+
`});this.setContents(e)}this.history.clear(),this.options.placeholder&&this.root.setAttribute(`data-placeholder`,this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e==`string`){let t=e;e=document.createElement(`div`),e.classList.add(t)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,n){return[e,t,,n]=BS(e,t,n),zS.call(this,()=>this.editor.deleteText(e,t),n,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;let t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle(`ql-disabled`,!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Q.sources.API;return zS.call(this,()=>{let n=this.getSelection(!0),r=new Z.default;if(n==null)return r;if(this.scroll.query(e,X.BLOCK))r=this.editor.formatLine(n.index,n.length,{[e]:t});else if(n.length===0)return this.selection.format(e,t),r;else r=this.editor.formatText(n.index,n.length,{[e]:t});return this.setSelection(n,Q.sources.SILENT),r},n)}formatLine(e,t,n,r,i){let a;return[e,t,a,i]=BS(e,t,n,r,i),zS.call(this,()=>this.editor.formatLine(e,t,a),i,e,0)}formatText(e,t,n,r,i){let a;return[e,t,a,i]=BS(e,t,n,r,i),zS.call(this,()=>this.editor.formatText(e,t,a),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=null;if(n=typeof e==`number`?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length),!n)return null;let r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=BS(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e==`number`?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e==`number`?this.scroll.lines(e,t):this.scroll.lines(e.index,e.length)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e==`number`&&(t??=this.getLength()-e),[e,t]=BS(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e==`number`&&(t??=this.getLength()-e),[e,t]=BS(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e.sources.API;return zS.call(this,()=>this.editor.insertEmbed(t,n,r),i,t)}insertText(e,t,n,r,i){let a;return[e,,a,i]=BS(e,0,n,r,i),zS.call(this,()=>this.editor.insertText(e,t,a),i,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,n){return[e,t,,n]=BS(e,t,n),zS.call(this,()=>this.editor.removeFormat(e,t),n,e)}scrollRectIntoView(e){kS(this.root,e)}scrollIntoView(){console.warn(`Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead.`),this.scrollSelectionIntoView()}scrollSelectionIntoView(){let e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q.sources.API;return zS.call(this,()=>{e=new Z.default(e);let t=this.getLength(),n=this.editor.deleteText(0,t),r=this.editor.insertContents(0,e),i=this.editor.deleteText(this.getLength()-1,1);return n.compose(r).compose(i)},t)}setSelection(t,n,r){t==null?this.selection.setRange(null,n||e.sources.API):([t,n,,r]=BS(t,n,r),this.selection.setRange(new cS(Math.max(0,t),n),r),r!==Q.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q.sources.API,n=new Z.default().insert(e);return this.setContents(n,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q.sources.USER,t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q.sources.API;return zS.call(this,()=>(e=new Z.default(e),this.editor.applyDelta(e)),t,!0)}};function FS(e){return typeof e==`string`?document.querySelector(e):e}function IS(e){return Object.entries(e??{}).reduce((e,t)=>{let[n,r]=t;return{...e,[n]:r===!0?{}:r}},{})}function LS(e){return Object.fromEntries(Object.entries(e).filter(e=>e[1]!==void 0))}function RS(e,t){let n=FS(e);if(!n)throw Error(`Invalid Quill container`);let r=!t.theme||t.theme===$.DEFAULTS.theme?wS:$.import(`themes/${t.theme}`);if(!r)throw Error(`Invalid theme ${t.theme}. Did you register it?`);let{modules:i,...a}=$.DEFAULTS,{modules:o,...s}=r.DEFAULTS,c=IS(t.modules);c!=null&&c.toolbar&&c.toolbar.constructor!==Object&&(c={...c,toolbar:{container:c.toolbar}});let l=Sm({},IS(i),IS(o),c),u={...a,...LS(s),...LS(t)},d=t.registry;return d?t.formats&&NS.warn(`Ignoring "formats" option because "registry" is specified`):d=t.formats?MS(t.formats,u.registry,NS):u.registry,{...u,registry:d,container:n,theme:r,modules:Object.entries(l).reduce((e,t)=>{let[n,r]=t;if(!r)return e;let i=$.import(`modules/${n}`);return i==null?(NS.error(`Cannot load ${n} module. Are you sure you registered it?`),e):{...e,[n]:Sm({},i.DEFAULTS||{},r)}},{}),bounds:FS(u.bounds)}}function zS(e,t,n,r){if(!this.isEnabled()&&t===Q.sources.USER&&!this.allowReadOnlyEdits)return new Z.default;let i=n==null?null:this.getSelection(),a=this.editor.delta,o=e();if(i!=null&&(n===!0&&(n=i.index),r==null?i=VS(i,o,t):r!==0&&(i=VS(i,n,r,t)),this.setSelection(i,Q.sources.SILENT)),o.length()>0){let e=[Q.events.TEXT_CHANGE,o,a,t];this.emitter.emit(Q.events.EDITOR_CHANGE,...e),t!==Q.sources.SILENT&&this.emitter.emit(...e)}return o}function BS(e,t,n,r,i){let a={};return typeof e.index==`number`&&typeof e.length==`number`?typeof t==`number`?(t=e.length,e=e.index):(i=r,r=n,n=t,t=e.length,e=e.index):typeof t!=`number`&&(i=r,r=n,n=t,t=0),typeof n==`object`?(a=n,i=r):typeof n==`string`&&(r==null?i=n:a[n]=r),i||=Q.sources.API,[e,t,a,i]}function VS(e,t,n,r){let i=typeof n==`number`?n:0;if(e==null)return null;let a,o;return t&&typeof t.transformPosition==`function`?[a,o]=[e.index,e.index+e.length].map(e=>t.transformPosition(e,r!==Q.sources.USER)):[a,o]=[e.index,e.index+e.length].map(e=>e<t||e===t&&r===Q.sources.USER?e:i>=0?e+i:Math.max(t,e+i)),new cS(a,o-a)}var HS=class extends kx{};function US(e){return e instanceof Yx||e instanceof Xx}function WS(e){return typeof e.updateContent==`function`}var GS=class extends Px{static blotName=`scroll`;static className=`ql-editor`;static tagName=`DIV`;static defaultChild=Yx;static allowedChildren=[Yx,Xx,HS];constructor(e,t,n){let{emitter:r}=n;super(e,t),this.emitter=r,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener(`dragstart`,e=>this.handleDragStart(e))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;let e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(Q.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Q.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(Q.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){let[n,r]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&n!==i&&r>0){if(n instanceof Xx||i instanceof Xx){this.optimize();return}let e=i.children.head instanceof Ux?null:i.children.head;n.moveChildren(i,e),n.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute(`contenteditable`,e?`true`:`false`)}formatAt(e,t,n,r){super.formatAt(e,t,n,r),this.optimize()}insertAt(e,t,n){if(e>=this.length()){if(n==null||this.scroll.query(t,X.BLOCK)==null){let e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e),n==null&&t.endsWith(`
|
|
205
|
+
`)?e.insertAt(0,t.slice(0,-1),n):e.insertAt(0,t,n)}else{let e=this.scroll.create(t,n);this.appendChild(e)}}else super.insertAt(e,t,n);this.optimize()}insertBefore(e,t){if(e.statics.scope===X.INLINE_BLOT){let n=this.scroll.create(this.statics.defaultChild.blotName);n.appendChild(e),super.insertBefore(n,t)}else super.insertBefore(e,t)}insertContents(e,t){let n=this.deltaToRenderBlocks(t.concat(new Z.default().insert(`
|
|
206
|
+
`))),r=n.pop();if(r==null)return;this.batchStart();let i=n.shift();if(i){let t=i.type===`block`&&(i.delta.length()===0||!this.descendant(Xx,e)[0]&&e<this.length()),n=i.type===`block`?i.delta:new Z.default().insert({[i.key]:i.value});KS(this,e,n);let r=+(i.type===`block`),a=e+n.length()+r;t&&this.insertAt(a-1,`
|
|
207
|
+
`);let o=Qx(this.line(e)[0]),s=Z.AttributeMap.diff(o,i.attributes)||{};Object.keys(s).forEach(e=>{this.formatAt(a-1,1,e,s[e])}),e=a}let[a,o]=this.children.find(e);if(n.length&&(a&&(a=a.split(o),o=0),n.forEach(e=>{if(e.type===`block`)KS(this.createBlock(e.attributes,a||void 0),0,e.delta);else{let t=this.create(e.key,e.value);this.insertBefore(t,a||void 0),Object.keys(e.attributes).forEach(n=>{t.format(n,e.attributes[n])})}})),r.type===`block`&&r.delta.length()){let e=a?a.offset(a.scroll)+o:this.length();KS(this,e,r.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute(`contenteditable`)===`true`}leaf(e){let t=this.path(e).pop();if(!t)return[null,-1];let[n,r]=t;return n instanceof vx?[n,r]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(US,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,n=(e,t,r)=>{let i=[],a=r;return e.children.forEachAt(t,r,(e,t,r)=>{US(e)?i.push(e):e instanceof kx&&(i=i.concat(n(e,t,a))),a-=r}),i};return n(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(Q.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=Q.sources.USER;typeof e==`string`&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(e=>{let{target:t}=e,n=this.find(t,!0);return n&&!WS(n)}),e.length>0&&this.emitter.emit(Q.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Q.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,n){let[r]=this.descendant(e=>e instanceof Xx,e);r&&r.statics.blotName===t&&WS(r)&&r.updateContent(n)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){let t=[],n=new Z.default;return e.forEach(e=>{let r=e?.insert;if(r){if(typeof r==`string`){let i=r.split(`
|
|
208
|
+
`);i.slice(0,-1).forEach(r=>{n.insert(r,e.attributes),t.push({type:`block`,delta:n,attributes:e.attributes??{}}),n=new Z.default});let a=i[i.length-1];a&&n.insert(a,e.attributes)}else{let i=Object.keys(r)[0];if(!i)return;this.query(i,X.INLINE)?n.push(e):(n.length()&&t.push({type:`block`,delta:n,attributes:{}}),n=new Z.default,t.push({type:`blockEmbed`,key:i,value:r[i],attributes:e.attributes??{}}))}}}),n.length()&&t.push({type:`block`,delta:n,attributes:{}}),t}createBlock(e,t){let n,r={};Object.entries(e).forEach(e=>{let[t,i]=e;this.query(t,X.BLOCK&X.BLOT)==null?r[t]=i:n=t});let i=this.create(n||this.statics.defaultChild.blotName,n?e[n]:void 0);this.insertBefore(i,t||void 0);let a=i.length();return Object.entries(r).forEach(e=>{let[t,n]=e;i.formatAt(0,a,t,n)}),i}};function KS(e,t,n){n.reduce((t,n)=>{let r=Z.Op.length(n),i=n.attributes||{};if(n.insert!=null){if(typeof n.insert==`string`){let r=n.insert;e.insertAt(t,r);let[a]=e.descendant(vx,t),o=Qx(a);i=Z.AttributeMap.diff(o,i)||{}}else if(typeof n.insert==`object`){let r=Object.keys(n.insert)[0];if(r==null)return t;if(e.insertAt(t,r,n.insert[r]),e.scroll.query(r,X.INLINE)!=null){let[n]=e.descendant(vx,t),r=Qx(n);i=Z.AttributeMap.diff(r,i)||{}}}}return Object.keys(i).forEach(n=>{e.formatAt(t,r,n,i[n])}),t+r},t)}var qS={scope:X.BLOCK,whitelist:[`right`,`center`,`justify`]},JS=new ox(`align`,`align`,qS),YS=new dx(`align`,`ql-align`,qS),XS=new px(`align`,`text-align`,qS),ZS=class extends px{value(e){let t=super.value(e);return t.startsWith(`rgb(`)?(t=t.replace(/^[^\d]+/,``).replace(/[^\d]+$/,``),`#${t.split(`,`).map(e=>`00${parseInt(e,10).toString(16)}`.slice(-2)).join(``)}`):t}},QS=new dx(`color`,`ql-color`,{scope:X.INLINE}),$S=new ZS(`color`,`color`,{scope:X.INLINE}),eC=new dx(`background`,`ql-bg`,{scope:X.INLINE}),tC=new ZS(`background`,`background-color`,{scope:X.INLINE}),nC=class extends HS{static create(e){let t=super.create(e);return t.setAttribute(`spellcheck`,`false`),t}code(e,t){return this.children.map(e=>e.length()<=1?``:e.domNode.innerText).join(`
|
|
209
|
+
`).slice(e,e+t)}html(e,t){return`<pre>\n${Kx(this.code(e,t))}\n</pre>`}},rC=class extends Yx{static TAB=` `;static register(){$.register(nC)}},iC=class extends qx{};iC.blotName=`code`,iC.tagName=`CODE`,rC.blotName=`code-block`,rC.className=`ql-code-block`,rC.tagName=`DIV`,nC.blotName=`code-block-container`,nC.className=`ql-code-block-container`,nC.tagName=`DIV`,nC.allowedChildren=[rC],rC.allowedChildren=[Wx,Ux,$x],rC.requiredContainer=nC;var aC={scope:X.BLOCK,whitelist:[`rtl`]},oC=new ox(`direction`,`dir`,aC),sC=new dx(`direction`,`ql-direction`,aC),cC=new px(`direction`,`direction`,aC),lC={scope:X.INLINE,whitelist:[`serif`,`monospace`]},uC=new dx(`font`,`ql-font`,lC),dC=new class extends px{value(e){return super.value(e).replace(/["']/g,``)}}(`font`,`font-family`,lC),fC=new dx(`size`,`ql-size`,{scope:X.INLINE,whitelist:[`small`,`large`,`huge`]}),pC=new px(`size`,`font-size`,{scope:X.INLINE,whitelist:[`10px`,`18px`,`32px`]}),mC=aS(`quill:keyboard`),hC=/Mac/i.test(navigator.platform)?`metaKey`:`ctrlKey`,gC=class e extends bS{static match(e,t){return[`altKey`,`ctrlKey`,`metaKey`,`shiftKey`].some(n=>!!t[n]!==e[n]&&t[n]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(e=>{this.options.bindings[e]&&this.addBinding(this.options.bindings[e])}),this.addBinding({key:`Enter`,shiftKey:null},this.handleEnter),this.addBinding({key:`Enter`,metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:`Backspace`},{collapsed:!0},this.handleBackspace),this.addBinding({key:`Delete`},{collapsed:!0},this.handleDelete)):(this.addBinding({key:`Backspace`},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:`Delete`},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:`Backspace`},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:`Delete`},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:`Backspace`,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=xC(e);if(r==null){mC.warn(`Attempted to add invalid keyboard binding`,r);return}typeof t==`function`&&(t={handler:t}),typeof n==`function`&&(n={handler:n}),(Array.isArray(r.key)?r.key:[r.key]).forEach(e=>{let i={...r,key:e,...t,...n};this.bindings[i.key]=this.bindings[i.key]||[],this.bindings[i.key].push(i)})}listen(){this.quill.root.addEventListener(`keydown`,t=>{if(t.defaultPrevented||t.isComposing||t.keyCode===229&&(t.key===`Enter`||t.key===`Backspace`))return;let n=(this.bindings[t.key]||[]).concat(this.bindings[t.which]||[]).filter(n=>e.match(t,n));if(n.length===0)return;let r=$.find(t.target,!0);if(r&&r.scroll!==this.quill.scroll)return;let i=this.quill.getSelection();if(i==null||!this.quill.hasFocus())return;let[a,o]=this.quill.getLine(i.index),[s,c]=this.quill.getLeaf(i.index),[l,u]=i.length===0?[s,c]:this.quill.getLeaf(i.index+i.length),d=s instanceof Ix?s.value().slice(0,c):``,f=l instanceof Ix?l.value().slice(u):``,p={collapsed:i.length===0,empty:i.length===0&&a.length()<=1,format:this.quill.getFormat(i),line:a,offset:o,prefix:d,suffix:f,event:t};n.some(e=>{if(e.collapsed!=null&&e.collapsed!==p.collapsed||e.empty!=null&&e.empty!==p.empty||e.offset!=null&&e.offset!==p.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(e=>p.format[e]==null))return!1}else if(typeof e.format==`object`&&!Object.keys(e.format).every(t=>e.format[t]===!0?p.format[t]!=null:e.format[t]===!1?p.format[t]==null:ix(e.format[t],p.format[t])))return!1;return e.prefix!=null&&!e.prefix.test(p.prefix)||e.suffix!=null&&!e.suffix.test(p.suffix)?!1:e.handler.call(this,i,p,e)!==!0})&&t.preventDefault()})}handleBackspace(e,t){let n=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let r={},[i]=this.quill.getLine(e.index),a=new Z.default().retain(e.index-n).delete(n);if(t.offset===0){let[t]=this.quill.getLine(e.index-1);if(t&&!(t.statics.blotName===`block`&&t.length()<=1)){let t=i.formats(),n=this.quill.getFormat(e.index-1,1);if(r=Z.AttributeMap.diff(t,n)||{},Object.keys(r).length>0){let t=new Z.default().retain(e.index+i.length()-2).retain(1,r);a=a.compose(t)}}}this.quill.updateContents(a,$.sources.USER),this.quill.focus()}handleDelete(e,t){let n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-n)return;let r={},[i]=this.quill.getLine(e.index),a=new Z.default().retain(e.index).delete(n);if(t.offset>=i.length()-1){let[t]=this.quill.getLine(e.index+1);if(t){let n=i.formats(),o=this.quill.getFormat(e.index,1);r=Z.AttributeMap.diff(n,o)||{},Object.keys(r).length>0&&(a=a.retain(t.length()-1).retain(1,r))}}this.quill.updateContents(a,$.sources.USER),this.quill.focus()}handleDeleteRange(e){SC({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){let n=Object.keys(t.format).reduce((e,n)=>(this.quill.scroll.query(n,X.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e),{}),r=new Z.default().retain(e.index).delete(e.length).insert(`
|
|
210
|
+
`,n);this.quill.updateContents(r,$.sources.USER),this.quill.setSelection(e.index+1,$.sources.SILENT),this.quill.focus()}};gC.DEFAULTS={bindings:{bold:yC(`bold`),italic:yC(`italic`),underline:yC(`underline`),indent:{key:`Tab`,format:[`blockquote`,`indent`,`list`],handler(e,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format(`indent`,`+1`,$.sources.USER),!1)}},outdent:{key:`Tab`,shiftKey:!0,format:[`blockquote`,`indent`,`list`],handler(e,t){return t.collapsed&&t.offset!==0?!0:(this.quill.format(`indent`,`-1`,$.sources.USER),!1)}},"outdent backspace":{key:`Backspace`,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:[`indent`,`list`],offset:0,handler(e,t){t.format.indent==null?t.format.list!=null&&this.quill.format(`list`,!1,$.sources.USER):this.quill.format(`indent`,`-1`,$.sources.USER)}},"indent code-block":_C(!0),"outdent code-block":_C(!1),"remove tab":{key:`Tab`,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(e){this.quill.deleteText(e.index-1,1,$.sources.USER)}},tab:{key:`Tab`,handler(e,t){if(t.format.table)return!0;this.quill.history.cutoff();let n=new Z.default().retain(e.index).delete(e.length).insert(` `);return this.quill.updateContents(n,$.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,$.sources.SILENT),!1}},"blockquote empty enter":{key:`Enter`,collapsed:!0,format:[`blockquote`],empty:!0,handler(){this.quill.format(`blockquote`,!1,$.sources.USER)}},"list empty enter":{key:`Enter`,collapsed:!0,format:[`list`],empty:!0,handler(e,t){let n={list:!1};t.format.indent&&(n.indent=!1),this.quill.formatLine(e.index,e.length,n,$.sources.USER)}},"checklist enter":{key:`Enter`,collapsed:!0,format:{list:`checked`},handler(e){let[t,n]=this.quill.getLine(e.index),r={...t.formats(),list:`checked`},i=new Z.default().retain(e.index).insert(`
|
|
211
|
+
`,r).retain(t.length()-n-1).retain(1,{list:`unchecked`});this.quill.updateContents(i,$.sources.USER),this.quill.setSelection(e.index+1,$.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:`Enter`,collapsed:!0,format:[`header`],suffix:/^$/,handler(e,t){let[n,r]=this.quill.getLine(e.index),i=new Z.default().retain(e.index).insert(`
|
|
212
|
+
`,t.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,$.sources.USER),this.quill.setSelection(e.index+1,$.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:`Backspace`,format:[`table`],collapsed:!0,offset:0,handler(){}},"table delete":{key:`Delete`,format:[`table`],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:`Enter`,shiftKey:null,format:[`table`],handler(e){let t=this.quill.getModule(`table`);if(t){let[n,r,i,a]=t.getTable(e),o=CC(n,r,i,a);if(o==null)return;let s=n.offset();if(o<0){let t=new Z.default().retain(s).insert(`
|
|
213
|
+
`);this.quill.updateContents(t,$.sources.USER),this.quill.setSelection(e.index+1,e.length,$.sources.SILENT)}else if(o>0){s+=n.length();let e=new Z.default().retain(s).insert(`
|
|
214
|
+
`);this.quill.updateContents(e,$.sources.USER),this.quill.setSelection(s,$.sources.USER)}}}},"table tab":{key:`Tab`,shiftKey:null,format:[`table`],handler(e,t){let{event:n,line:r}=t,i=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(i-1,$.sources.USER):this.quill.setSelection(i+r.length(),$.sources.USER)}},"list autofill":{key:` `,shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(e,t){if(this.quill.scroll.query(`list`)==null)return!0;let{length:n}=t.prefix,[r,i]=this.quill.getLine(e.index);if(i>n)return!0;let a;switch(t.prefix.trim()){case`[]`:case`[ ]`:a=`unchecked`;break;case`[x]`:a=`checked`;break;case`-`:case`*`:a=`bullet`;break;default:a=`ordered`}this.quill.insertText(e.index,` `,$.sources.USER),this.quill.history.cutoff();let o=new Z.default().retain(e.index-i).delete(n+1).retain(r.length()-2-i).retain(1,{list:a});return this.quill.updateContents(o,$.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,$.sources.SILENT),!1}},"code exit":{key:`Enter`,collapsed:!0,format:[`code-block`],prefix:/^$/,suffix:/^\s*$/,handler(e){let[t,n]=this.quill.getLine(e.index),r=2,i=t;for(;i!=null&&i.length()<=1&&i.formats()[`code-block`];)if(i=i.prev,--r,r<=0){let r=new Z.default().retain(e.index+t.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(r,$.sources.USER),this.quill.setSelection(e.index-1,$.sources.SILENT),!1}return!0}},"embed left":vC(`ArrowLeft`,!1),"embed left shift":vC(`ArrowLeft`,!0),"embed right":vC(`ArrowRight`,!1),"embed right shift":vC(`ArrowRight`,!0),"table down":bC(!1),"table up":bC(!0)}};function _C(e){return{key:`Tab`,shiftKey:!e,format:{"code-block":!0},handler(t,n){let{event:r}=n,{TAB:i}=this.quill.scroll.query(`code-block`);if(t.length===0&&!r.shiftKey){this.quill.insertText(t.index,i,$.sources.USER),this.quill.setSelection(t.index+i.length,$.sources.SILENT);return}let a=t.length===0?this.quill.getLines(t.index,1):this.quill.getLines(t),{index:o,length:s}=t;a.forEach((t,n)=>{e?(t.insertAt(0,i),n===0?o+=i.length:s+=i.length):t.domNode.textContent.startsWith(i)&&(t.deleteAt(0,i.length),n===0?o-=i.length:s-=i.length)}),this.quill.update($.sources.USER),this.quill.setSelection(o,s,$.sources.SILENT)}}}function vC(e,t){return{key:e,shiftKey:t,altKey:null,[e===`ArrowLeft`?`prefix`:`suffix`]:/^$/,handler(n){let{index:r}=n;e===`ArrowRight`&&(r+=n.length+1);let[i]=this.quill.getLeaf(r);return i instanceof Ax?(e===`ArrowLeft`?t?this.quill.setSelection(n.index-1,n.length+1,$.sources.USER):this.quill.setSelection(n.index-1,$.sources.USER):t?this.quill.setSelection(n.index,n.length+1,$.sources.USER):this.quill.setSelection(n.index+n.length+1,$.sources.USER),!1):!0}}}function yC(e){return{key:e[0],shortKey:!0,handler(t,n){this.quill.format(e,!n.format[e],$.sources.USER)}}}function bC(e){return{key:e?`ArrowUp`:`ArrowDown`,collapsed:!0,format:[`table`],handler(t,n){let r=e?`prev`:`next`,i=n.line,a=i.parent[r];if(a!=null){if(a.statics.blotName===`table-row`){let e=a.children.head,t=i;for(;t.prev!=null;)t=t.prev,e=e.next;let r=e.offset(this.quill.scroll)+Math.min(n.offset,e.length()-1);this.quill.setSelection(r,0,$.sources.USER)}}else{let t=i.table()[r];t!=null&&(e?this.quill.setSelection(t.offset(this.quill.scroll)+t.length()-1,0,$.sources.USER):this.quill.setSelection(t.offset(this.quill.scroll),0,$.sources.USER))}return!1}}}function xC(e){if(typeof e==`string`||typeof e==`number`)e={key:e};else if(typeof e==`object`)e=rx(e);else return null;return e.shortKey&&(e[hC]=e.shortKey,delete e.shortKey),e}function SC(e){let{quill:t,range:n}=e,r=t.getLines(n),i={};if(r.length>1){let e=r[0].formats(),t=r[r.length-1].formats();i=Z.AttributeMap.diff(t,e)||{}}t.deleteText(n,$.sources.USER),Object.keys(i).length>0&&t.formatLine(n.index,1,i,$.sources.USER),t.setSelection(n.index,$.sources.SILENT)}function CC(e,t,n,r){return t.prev==null&&t.next==null?n.prev==null&&n.next==null?r===0?-1:1:n.prev==null?-1:1:t.prev==null?-1:t.next==null?1:null}var wC=/font-weight:\s*normal/,TC=[`P`,`OL`,`UL`],EC=e=>e&&TC.includes(e.tagName),DC=e=>{Array.from(e.querySelectorAll(`br`)).filter(e=>EC(e.previousElementSibling)&&EC(e.nextElementSibling)).forEach(e=>{e.parentNode?.removeChild(e)})},OC=e=>{Array.from(e.querySelectorAll(`b[style*="font-weight"]`)).filter(e=>e.getAttribute(`style`)?.match(wC)).forEach(t=>{let n=e.createDocumentFragment();n.append(...t.childNodes),t.parentNode?.replaceChild(n,t)})};function kC(e){e.querySelector(`[id^="docs-internal-guid-"]`)&&(OC(e),DC(e))}var AC=/\bmso-list:[^;]*ignore/i,jC=/\bmso-list:[^;]*\bl(\d+)/i,MC=/\bmso-list:[^;]*\blevel(\d+)/i,NC=(e,t)=>{let n=e.getAttribute(`style`),r=n?.match(jC);if(!r)return null;let i=Number(r[1]),a=n?.match(MC),o=a?Number(a[1]):1,s=RegExp(`@list l${i}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,`i`),c=t.match(s);return{id:i,indent:o,type:c&&c[1]===`bullet`?`bullet`:`ordered`,element:e}},PC=e=>{let t=Array.from(e.querySelectorAll(`[style*=mso-list]`)),n=[],r=[];t.forEach(e=>{(e.getAttribute(`style`)||``).match(AC)?n.push(e):r.push(e)}),n.forEach(e=>e.parentNode?.removeChild(e));let i=e.documentElement.innerHTML,a=r.map(e=>NC(e,i)).filter(e=>e);for(;a.length;){let e=[],t=a.shift();for(;t;)e.push(t),t=a.length&&a[0]?.element===t.element.nextElementSibling&&a[0].id===t.id?a.shift():null;let n=document.createElement(`ul`);e.forEach(e=>{let t=document.createElement(`li`);t.setAttribute(`data-list`,e.type),e.indent>1&&t.setAttribute(`class`,`ql-indent-${e.indent-1}`),t.innerHTML=e.element.innerHTML,n.appendChild(t)});let r=e[0]?.element,{parentNode:i}=r??{};r&&i?.replaceChild(n,r),e.slice(1).forEach(e=>{let{element:t}=e;i?.removeChild(t)})}};function FC(e){e.documentElement.getAttribute(`xmlns:w`)===`urn:schemas-microsoft-com:office:word`&&PC(e)}var IC=[FC,kC],LC=e=>{e.documentElement&&IC.forEach(t=>{t(e)})},RC=aS(`quill:clipboard`),zC=[[Node.TEXT_NODE,sw],[Node.TEXT_NODE,iw],[`br`,$C],[Node.ELEMENT_NODE,iw],[Node.ELEMENT_NODE,QC],[Node.ELEMENT_NODE,ZC],[Node.ELEMENT_NODE,aw],[`li`,nw],[`ol, ul`,rw],[`pre`,ew],[`tr`,ow],[`b`,XC(`bold`)],[`i`,XC(`italic`)],[`strike`,XC(`strike`)],[`style`,tw]],BC=[JS,oC].reduce((e,t)=>(e[t.keyName]=t,e),{}),VC=[XS,tC,$S,cC,dC,pC].reduce((e,t)=>(e[t.keyName]=t,e),{}),HC=class extends bS{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener(`copy`,e=>this.onCaptureCopy(e,!1)),this.quill.root.addEventListener(`cut`,e=>this.onCaptureCopy(e,!0)),this.quill.root.addEventListener(`paste`,this.onCapturePaste.bind(this)),this.matchers=[],zC.concat(this.options.matchers??[]).forEach(e=>{let[t,n]=e;this.addMatcher(t,n)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:n}=e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r[rC.blotName])return new Z.default().insert(n||``,{[rC.blotName]:r[rC.blotName]});if(!t)return new Z.default().insert(n||``,r);let i=this.convertHTML(t);return WC(i,`
|
|
215
|
+
`)&&(i.ops[i.ops.length-1].attributes==null||r.table)?i.compose(new Z.default().retain(i.length()-1).delete(1)):i}normalizeHTML(e){LC(e)}convertHTML(e){let t=new DOMParser().parseFromString(e,`text/html`);this.normalizeHTML(t);let n=t.body,r=new WeakMap,[i,a]=this.prepareMatching(n,r);return YC(this.quill.scroll,n,i,a,r)}dangerouslyPasteHTML(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$.sources.API;if(typeof e==`string`){let n=this.convert({html:e,text:``});this.quill.setContents(n,t),this.quill.setSelection(0,$.sources.SILENT)}else{let r=this.convert({html:t,text:``});this.quill.updateContents(new Z.default().retain(e).concat(r),n),this.quill.setSelection(e+r.length(),$.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(e.defaultPrevented)return;e.preventDefault();let[n]=this.quill.selection.getRange();if(n==null)return;let{html:r,text:i}=this.onCopy(n,t);e.clipboardData?.setData(`text/plain`,i),e.clipboardData?.setData(`text/html`,r),t&&SC({range:n,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(e=>e[0]!==`#`).join(`
|
|
216
|
+
`)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();let t=this.quill.getSelection(!0);if(t==null)return;let n=e.clipboardData?.getData(`text/html`),r=e.clipboardData?.getData(`text/plain`);if(!n&&!r){let t=e.clipboardData?.getData(`text/uri-list`);t&&(r=this.normalizeURIList(t))}let i=Array.from(e.clipboardData?.files||[]);if(!n&&i.length>0){this.quill.uploader.upload(t,i);return}if(n&&i.length>0){let e=new DOMParser().parseFromString(n,`text/html`);if(e.body.childElementCount===1&&e.body.firstElementChild?.tagName===`IMG`){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:n,text:r})}onCopy(e){let t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:n,html:r}=t,i=this.quill.getFormat(e.index),a=this.convert({text:n,html:r},i);RC.log(`onPaste`,a,{text:n,html:r});let o=new Z.default().retain(e.index).delete(e.length).concat(a);this.quill.updateContents(o,$.sources.USER),this.quill.setSelection(o.length()-e.length,$.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){let n=[],r=[];return this.matchers.forEach(i=>{let[a,o]=i;switch(a){case Node.TEXT_NODE:r.push(o);break;case Node.ELEMENT_NODE:n.push(o);break;default:Array.from(e.querySelectorAll(a)).forEach(e=>{t.has(e)?t.get(e)?.push(o):t.set(e,[o])})}}),[n,r]}};function UC(e,t,n,r){return r.query(t)?e.reduce((e,r)=>{if(!r.insert)return e;if(r.attributes&&r.attributes[t])return e.push(r);let i=n?{[t]:n}:{};return e.insert(r.insert,{...i,...r.attributes})},new Z.default):e}function WC(e,t){let n=``;for(let r=e.ops.length-1;r>=0&&n.length<t.length;--r){let t=e.ops[r];if(typeof t.insert!=`string`)break;n=t.insert+n}return n.slice(-1*t.length)===t}function GC(e,t){if(!(e instanceof Element))return!1;let n=t.query(e);return n&&n.prototype instanceof Ax?!1:`address.article.blockquote.canvas.dd.div.dl.dt.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.iframe.li.main.nav.ol.output.p.pre.section.table.td.tr.ul.video`.split(`.`).includes(e.tagName.toLowerCase())}function KC(e,t){return e.previousElementSibling&&e.nextElementSibling&&!GC(e.previousElementSibling,t)&&!GC(e.nextElementSibling,t)}var qC=new WeakMap;function JC(e){return e!=null&&(qC.has(e)||(e.tagName===`PRE`?qC.set(e,!0):qC.set(e,JC(e.parentNode))),qC.get(e))}function YC(e,t,n,r,i){return t.nodeType===t.TEXT_NODE?r.reduce((n,r)=>r(t,n,e),new Z.default):t.nodeType===t.ELEMENT_NODE?Array.from(t.childNodes||[]).reduce((a,o)=>{let s=YC(e,o,n,r,i);return o.nodeType===t.ELEMENT_NODE&&(s=n.reduce((t,n)=>n(o,t,e),s),s=(i.get(o)||[]).reduce((t,n)=>n(o,t,e),s)),a.concat(s)},new Z.default):new Z.default}function XC(e){return(t,n,r)=>UC(n,e,!0,r)}function ZC(e,t,n){let r=ox.keys(e),i=dx.keys(e),a=px.keys(e),o={};return r.concat(i).concat(a).forEach(t=>{let r=n.query(t,X.ATTRIBUTE);r!=null&&(o[r.attrName]=r.value(e),o[r.attrName])||(r=BC[t],r!=null&&(r.attrName===t||r.keyName===t)&&(o[r.attrName]=r.value(e)||void 0),r=VC[t],r!=null&&(r.attrName===t||r.keyName===t)&&(r=VC[t],o[r.attrName]=r.value(e)||void 0))}),Object.entries(o).reduce((e,t)=>{let[r,i]=t;return UC(e,r,i,n)},t)}function QC(e,t,n){let r=n.query(e);if(r==null)return t;if(r.prototype instanceof Ax){let t={},i=r.value(e);if(i!=null)return t[r.blotName]=i,new Z.default().insert(t,r.formats(e,n))}else if(r.prototype instanceof Dx&&!WC(t,`
|
|
217
|
+
`)&&t.insert(`
|
|
218
|
+
`),`blotName`in r&&`formats`in r&&typeof r.formats==`function`)return UC(t,r.blotName,r.formats(e,n),n);return t}function $C(e,t){return WC(t,`
|
|
219
|
+
`)||t.insert(`
|
|
220
|
+
`),t}function ew(e,t,n){let r=n.query(`code-block`);return UC(t,`code-block`,r&&`formats`in r&&typeof r.formats==`function`?r.formats(e,n):!0,n)}function tw(){return new Z.default}function nw(e,t,n){let r=n.query(e);if(r==null||r.blotName!==`list`||!WC(t,`
|
|
221
|
+
`))return t;let i=-1,a=e.parentNode;for(;a!=null;)[`OL`,`UL`].includes(a.tagName)&&(i+=1),a=a.parentNode;return i<=0?t:t.reduce((e,t)=>t.insert?t.attributes&&typeof t.attributes.indent==`number`?e.push(t):e.insert(t.insert,{indent:i,...t.attributes||{}}):e,new Z.default)}function rw(e,t,n){let r=e,i=r.tagName===`OL`?`ordered`:`bullet`,a=r.getAttribute(`data-checked`);return a&&(i=a===`true`?`checked`:`unchecked`),UC(t,`list`,i,n)}function iw(e,t,n){if(!WC(t,`
|
|
222
|
+
`)){if(GC(e,n)&&(e.childNodes.length>0||e instanceof HTMLParagraphElement))return t.insert(`
|
|
223
|
+
`);if(t.length()>0&&e.nextSibling){let r=e.nextSibling;for(;r!=null;){if(GC(r,n))return t.insert(`
|
|
224
|
+
`);let e=n.query(r);if(e&&e.prototype instanceof Xx)return t.insert(`
|
|
225
|
+
`);r=r.firstChild}}}return t}function aw(e,t,n){let r={},i=e.style||{};return i.fontStyle===`italic`&&(r.italic=!0),i.textDecoration===`underline`&&(r.underline=!0),i.textDecoration===`line-through`&&(r.strike=!0),(i.fontWeight?.startsWith(`bold`)||parseInt(i.fontWeight,10)>=700)&&(r.bold=!0),t=Object.entries(r).reduce((e,t)=>{let[r,i]=t;return UC(e,r,i,n)},t),parseFloat(i.textIndent||0)>0?new Z.default().insert(` `).concat(t):t}function ow(e,t,n){let r=e.parentElement?.tagName===`TABLE`?e.parentElement:e.parentElement?.parentElement;return r==null?t:UC(t,`table`,Array.from(r.querySelectorAll(`tr`)).indexOf(e)+1,n)}function sw(e,t,n){let r=e.data;if(e.parentElement?.tagName===`O:P`)return t.insert(r.trim());if(!JC(e)){if(r.trim().length===0&&r.includes(`
|
|
226
|
+
`)&&!KC(e,n))return t;r=r.replace(/[^\S\u00a0]/g,` `),r=r.replace(/ {2,}/g,` `),(e.previousSibling==null&&e.parentElement!=null&&GC(e.parentElement,n)||e.previousSibling instanceof Element&&GC(e.previousSibling,n))&&(r=r.replace(/^ /,``)),(e.nextSibling==null&&e.parentElement!=null&&GC(e.parentElement,n)||e.nextSibling instanceof Element&&GC(e.nextSibling,n))&&(r=r.replace(/ $/,``)),r=r.replaceAll(`\xA0`,` `)}return t.insert(r)}var cw=class extends bS{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on($.events.EDITOR_CHANGE,(e,t,n,r)=>{e===$.events.SELECTION_CHANGE?t&&r!==$.sources.SILENT&&(this.currentRange=t):e===$.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||r===$.sources.USER?this.record(t,n):this.transform(t)),this.currentRange=fw(this.currentRange,t))}),this.quill.keyboard.addBinding({key:`z`,shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:[`z`,`Z`],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:`y`,shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener(`beforeinput`,e=>{e.inputType===`historyUndo`?(this.undo(),e.preventDefault()):e.inputType===`historyRedo`&&(this.redo(),e.preventDefault())})}change(e,t){if(this.stack[e].length===0)return;let n=this.stack[e].pop();if(!n)return;let r=this.quill.getContents(),i=n.delta.invert(r);this.stack[t].push({delta:i,range:fw(n.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(n.delta,$.sources.USER),this.ignoreChange=!1,this.restoreSelection(n)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let n=e.invert(t),r=this.currentRange,i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){let e=this.stack.undo.pop();e&&(n=n.compose(e.delta),r=e.range)}else this.lastRecorded=i;n.length()!==0&&(this.stack.undo.push({delta:n,range:r}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change(`redo`,`undo`)}transform(e){lw(this.stack.undo,e),lw(this.stack.redo,e)}undo(){this.change(`undo`,`redo`)}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,$.sources.USER);else{let t=dw(this.quill.scroll,e.delta);this.quill.setSelection(t,$.sources.USER)}}};function lw(e,t){let n=t;for(let t=e.length-1;t>=0;--t){let r=e[t];e[t]={delta:n.transform(r.delta,!0),range:r.range&&fw(r.range,n)},n=r.delta.transform(n),e[t].delta.length()===0&&e.splice(t,1)}}function uw(e,t){let n=t.ops[t.ops.length-1];return n==null?!1:n.insert==null?n.attributes!=null&&Object.keys(n.attributes).some(t=>e.query(t,X.BLOCK)!=null):typeof n.insert==`string`&&n.insert.endsWith(`
|
|
227
|
+
`)}function dw(e,t){let n=t.reduce((e,t)=>e+(t.delete||0),0),r=t.length()-n;return uw(e,t)&&--r,r}function fw(e,t){if(!e)return e;let n=t.transformPosition(e.index);return{index:n,length:t.transformPosition(e.index+e.length)-n}}var pw=class extends bS{constructor(e,t){super(e,t),e.root.addEventListener(`drop`,t=>{t.preventDefault();let n=null;if(document.caretRangeFromPoint)n=document.caretRangeFromPoint(t.clientX,t.clientY);else if(document.caretPositionFromPoint){let e=document.caretPositionFromPoint(t.clientX,t.clientY);n=document.createRange(),n.setStart(e.offsetNode,e.offset),n.setEnd(e.offsetNode,e.offset)}let r=n&&e.selection.normalizeNative(n);if(r){let n=e.selection.normalizedToRange(r);t.dataTransfer?.files&&this.upload(n,t.dataTransfer.files)}})}upload(e,t){let n=[];Array.from(t).forEach(e=>{e&&this.options.mimetypes?.includes(e.type)&&n.push(e)}),n.length>0&&this.options.handler.call(this,e,n)}};pw.DEFAULTS={mimetypes:[`image/png`,`image/jpeg`],handler(e,t){if(!this.quill.scroll.query(`image`))return;let n=t.map(e=>new Promise(t=>{let n=new FileReader;n.onload=()=>{t(n.result)},n.readAsDataURL(e)}));Promise.all(n).then(t=>{let n=t.reduce((e,t)=>e.insert({image:t}),new Z.default().retain(e.index).delete(e.length));this.quill.updateContents(n,Q.sources.USER),this.quill.setSelection(e.index+t.length,Q.sources.SILENT)})}};var mw=[`insertText`,`insertReplacementText`],hw=class extends bS{constructor(e,t){super(e,t),e.root.addEventListener(`beforeinput`,e=>{this.handleBeforeInput(e)}),/Android/i.test(navigator.userAgent)||e.on($.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){SC({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``;if(e.length===0)return!1;if(t){let n=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new Z.default().retain(e.index).insert(t,n),$.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,$.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!mw.includes(e.inputType))return;let t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;let n=gw(e);if(n==null)return;let r=this.quill.selection.normalizeNative(t),i=r?this.quill.selection.normalizedToRange(r):null;i&&this.replaceText(i,n)&&e.preventDefault()}handleCompositionStart(){let e=this.quill.getSelection();e&&this.replaceText(e)}};function gw(e){return typeof e.data==`string`?e.data:e.dataTransfer?.types.includes(`text/plain`)?e.dataTransfer.getData(`text/plain`):null}var _w=/Mac/i.test(navigator.platform),vw=e=>!!(e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Home`||_w&&e.key===`a`&&e.ctrlKey===!0),yw=class extends bS{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:[`ArrowLeft`,`ArrowRight`],offset:0,shiftKey:null,handler(e,t){let{line:n,event:r}=t;if(!(n instanceof Sx)||!n.uiNode)return!0;let i=getComputedStyle(n.domNode).direction===`rtl`;return i&&r.key!==`ArrowRight`||!i&&r.key!==`ArrowLeft`?!0:(this.quill.setSelection(e.index-1,e.length+ +!!r.shiftKey,$.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener(`keydown`,e=>{!e.defaultPrevented&&vw(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){this.selectionChangeDeadline=Date.now()+100,!this.isListening&&(this.isListening=!0,document.addEventListener(`selectionchange`,()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()},{once:!0}))}handleSelectionChange(){let e=document.getSelection();if(!e)return;let t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;let n=this.quill.scroll.find(t.startContainer);if(!(n instanceof Sx)||!n.uiNode)return;let r=document.createRange();r.setStartAfter(n.uiNode),r.setEndAfter(n.uiNode),e.removeAllRanges(),e.addRange(r)}};$.register({"blots/block":Yx,"blots/block/embed":Xx,"blots/break":Ux,"blots/container":HS,"blots/cursor":$x,"blots/embed":SS,"blots/inline":qx,"blots/scroll":GS,"blots/text":Wx,"modules/clipboard":HC,"modules/history":cw,"modules/keyboard":gC,"modules/uploader":pw,"modules/input":hw,"modules/uiNode":yw});var bw=$,xw=new class extends dx{add(e,t){let n=0;if(t===`+1`||t===`-1`){let r=this.value(e)||0;n=t===`+1`?r+1:r-1}else typeof t==`number`&&(n=t);return n===0?(this.remove(e),!0):super.add(e,n.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}(`indent`,`ql-indent`,{scope:X.BLOCK,whitelist:[1,2,3,4,5,6,7,8]}),Sw=class extends Yx{static blotName=`blockquote`;static tagName=`blockquote`},Cw=class extends Yx{static blotName=`header`;static tagName=[`H1`,`H2`,`H3`,`H4`,`H5`,`H6`];static formats(e){return this.tagName.indexOf(e.tagName)+1}},ww=class extends HS{};ww.blotName=`list-container`,ww.tagName=`OL`;var Tw=class extends Yx{static create(e){let t=super.create();return t.setAttribute(`data-list`,e),t}static formats(e){return e.getAttribute(`data-list`)||void 0}static register(){$.register(ww)}constructor(e,t){super(e,t);let n=t.ownerDocument.createElement(`span`),r=n=>{if(!e.isEnabled())return;let r=this.statics.formats(t,e);r===`checked`?(this.format(`list`,`unchecked`),n.preventDefault()):r===`unchecked`&&(this.format(`list`,`checked`),n.preventDefault())};n.addEventListener(`mousedown`,r),n.addEventListener(`touchstart`,r),this.attachUI(n)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute(`data-list`,t):super.format(e,t)}};Tw.blotName=`list`,Tw.tagName=`LI`,ww.allowedChildren=[Tw],Tw.requiredContainer=ww;var Ew=class extends qx{static blotName=`bold`;static tagName=[`STRONG`,`B`];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}},Dw=class extends Ew{static blotName=`italic`;static tagName=[`EM`,`I`]},Ow=class extends qx{static blotName=`link`;static tagName=`A`;static SANITIZED_URL=`about:blank`;static PROTOCOL_WHITELIST=[`http`,`https`,`mailto`,`tel`,`sms`];static create(e){let t=super.create(e);return t.setAttribute(`href`,this.sanitize(e)),t.setAttribute(`rel`,`noopener noreferrer`),t.setAttribute(`target`,`_blank`),t}static formats(e){return e.getAttribute(`href`)}static sanitize(e){return kw(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute(`href`,this.constructor.sanitize(t))}};function kw(e,t){let n=document.createElement(`a`);n.href=e;let r=n.href.slice(0,n.href.indexOf(`:`));return t.indexOf(r)>-1}var Aw=class extends qx{static blotName=`script`;static tagName=[`SUB`,`SUP`];static create(e){return e===`super`?document.createElement(`sup`):e===`sub`?document.createElement(`sub`):super.create(e)}static formats(e){if(e.tagName===`SUB`)return`sub`;if(e.tagName===`SUP`)return`super`}},jw=class extends Ew{static blotName=`strike`;static tagName=[`S`,`STRIKE`]},Mw=class extends qx{static blotName=`underline`;static tagName=`U`},Nw=class extends SS{static blotName=`formula`;static className=`ql-formula`;static tagName=`SPAN`;static create(e){if(window.katex==null)throw Error(`Formula module requires KaTeX.`);let t=super.create(e);return typeof e==`string`&&(window.katex.render(e,t,{throwOnError:!1,errorColor:`#f00`}),t.setAttribute(`data-value`,e)),t}static value(e){return e.getAttribute(`data-value`)}html(){let{formula:e}=this.value();return`<span>${e}</span>`}},Pw=[`alt`,`height`,`width`],Fw=class extends Ax{static blotName=`image`;static tagName=`IMG`;static create(e){let t=super.create(e);return typeof e==`string`&&t.setAttribute(`src`,this.sanitize(e)),t}static formats(e){return Pw.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return kw(e,[`http`,`https`,`data`])?e:`//:0`}static value(e){return e.getAttribute(`src`)}format(e,t){Pw.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}},Iw=[`height`,`width`],Lw=class extends Xx{static blotName=`video`;static className=`ql-video`;static tagName=`IFRAME`;static create(e){let t=super.create(e);return t.setAttribute(`frameborder`,`0`),t.setAttribute(`allowfullscreen`,`true`),t.setAttribute(`src`,this.sanitize(e)),t}static formats(e){return Iw.reduce((t,n)=>(e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t),{})}static sanitize(e){return Ow.sanitize(e)}static value(e){return e.getAttribute(`src`)}format(e,t){Iw.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){let{video:e}=this.value();return`<a href="${e}">${e}</a>`}},Rw=new dx(`code-token`,`hljs`,{scope:X.INLINE}),zw=class e extends qx{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(rC.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,n){super(e,t,n),Rw.add(this.domNode,n)}format(t,n){t===e.blotName?n?Rw.add(this.domNode,n):(Rw.remove(this.domNode),this.domNode.classList.remove(this.statics.className)):super.format(t,n)}optimize(){super.optimize(...arguments),Rw.value(this.domNode)||this.unwrap()}};zw.blotName=`code-token`,zw.className=`ql-token`;var Bw=class extends rC{static create(e){let t=super.create(e);return typeof e==`string`&&t.setAttribute(`data-language`,e),t}static formats(e){return e.getAttribute(`data-language`)||`plain`}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute(`data-language`,t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),zw.blotName,!1),super.replaceWith(e,t)}},Vw=class extends nC{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===Bw.blotName&&(this.forceNext=!0,this.children.forEach(n=>{n.format(e,t)}))}formatAt(e,t,n,r){n===Bw.blotName&&(this.forceNext=!0),super.formatAt(e,t,n,r)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.children.head==null)return;let n=`${Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).map(e=>e.textContent).join(`
|
|
228
|
+
`)}\n`,r=Bw.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==n){if(n.trim().length>0||this.cachedText==null){let t=this.children.reduce((e,t)=>e.concat(Zx(t,!1)),new Z.default),i=e(n,r);t.diff(i).reduce((e,t)=>{let{retain:n,attributes:r}=t;return n?(r&&Object.keys(r).forEach(t=>{[Bw.blotName,zw.blotName].includes(t)&&this.formatAt(e,n,t,r[t])}),e+n):e},0)}this.cachedText=n,this.forceNext=!1}}html(e,t){let[n]=this.children.find(e);return`<pre data-language="${n?Bw.formats(n.domNode):`plain`}">\n${Kx(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){let e=Bw.formats(this.children.head.domNode);e!==this.uiNode.value&&(this.uiNode.value=e)}}};Vw.allowedChildren=[Bw],Bw.requiredContainer=Vw,Bw.allowedChildren=[zw,$x,Wx,Ux];var Hw=(e,t,n)=>{if(typeof e.versionString==`string`){let r=e.versionString.split(`.`)[0];if(parseInt(r,10)>=11)return e.highlight(n,{language:t}).value}return e.highlight(t,n).value},Uw=class extends bS{static register(){$.register(zw,!0),$.register(Bw,!0),$.register(Vw,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw Error(`Syntax module requires highlight.js. Please include the library on the page before Quill.`);this.languages=this.options.languages.reduce((e,t)=>{let{key:n}=t;return e[n]=!0,e},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on($.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof Vw))return;let t=this.quill.root.ownerDocument.createElement(`select`);this.options.languages.forEach(e=>{let{key:n,label:r}=e,i=t.ownerDocument.createElement(`option`);i.textContent=r,i.setAttribute(`value`,n),t.appendChild(i)}),t.addEventListener(`change`,()=>{e.format(Bw.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode??(e.attachUI(t),e.children.head&&(t.value=Bw.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on($.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.quill.selection.composing)return;this.quill.update($.sources.USER);let n=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Vw):[e]).forEach(e=>{e.highlight(this.highlightBlot,t)}),this.quill.update($.sources.SILENT),n!=null&&this.quill.setSelection(n,$.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`plain`;if(t=this.languages[t]?t:`plain`,t===`plain`)return Kx(e).split(`
|
|
229
|
+
`).reduce((e,n,r)=>(r!==0&&e.insert(`
|
|
230
|
+
`,{[rC.blotName]:t}),e.insert(n)),new Z.default);let n=this.quill.root.ownerDocument.createElement(`div`);return n.classList.add(rC.className),n.innerHTML=Hw(this.options.hljs,t,e),YC(this.quill.scroll,n,[(e,t)=>{let n=Rw.value(e);return n?t.compose(new Z.default().retain(t.length(),{[zw.blotName]:n})):t}],[(e,n)=>e.data.split(`
|
|
231
|
+
`).reduce((e,n,r)=>(r!==0&&e.insert(`
|
|
232
|
+
`,{[rC.blotName]:t}),e.insert(n)),n)],new WeakMap)}};Uw.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:`plain`,label:`Plain`},{key:`bash`,label:`Bash`},{key:`cpp`,label:`C++`},{key:`cs`,label:`C#`},{key:`css`,label:`CSS`},{key:`diff`,label:`Diff`},{key:`xml`,label:`HTML/XML`},{key:`java`,label:`Java`},{key:`javascript`,label:`JavaScript`},{key:`markdown`,label:`Markdown`},{key:`php`,label:`PHP`},{key:`python`,label:`Python`},{key:`ruby`,label:`Ruby`},{key:`sql`,label:`SQL`}]};var Ww=class e extends Yx{static blotName=`table`;static tagName=`TD`;static create(e){let t=super.create();return e?t.setAttribute(`data-row`,e):t.setAttribute(`data-row`,Jw()),t}static formats(e){if(e.hasAttribute(`data-row`))return e.getAttribute(`data-row`)}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,n){t===e.blotName&&n?this.domNode.setAttribute(`data-row`,n):super.format(t,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}},Gw=class extends HS{static blotName=`table-row`;static tagName=`TR`;checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){let e=this.children.head.formats(),t=this.children.tail.formats(),n=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===n.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach(e=>{if(e.next==null)return;let t=e.formats(),n=e.next.formats();if(t.table!==n.table){let t=this.splitAfter(e);t&&t.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}},Kw=class extends HS{static blotName=`table-body`;static tagName=`TBODY`},qw=class extends HS{static blotName=`table-container`;static tagName=`TABLE`;balanceCells(){let e=this.descendants(Gw),t=e.reduce((e,t)=>Math.max(t.children.length,e),0);e.forEach(e=>{Array(t-e.children.length).fill(0).forEach(()=>{let t;e.children.head!=null&&(t=Ww.formats(e.children.head.domNode));let n=this.scroll.create(Ww.blotName,t);e.appendChild(n),n.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){let[t]=this.descendant(Kw);t!=null&&t.children.head!=null&&t.children.forEach(t=>{t.children.at(e)?.remove()})}insertColumn(e){let[t]=this.descendant(Kw);t!=null&&t.children.head!=null&&t.children.forEach(t=>{let n=t.children.at(e),r=Ww.formats(t.children.head.domNode),i=this.scroll.create(Ww.blotName,r);t.insertBefore(i,n)})}insertRow(e){let[t]=this.descendant(Kw);if(t==null||t.children.head==null)return;let n=Jw(),r=this.scroll.create(Gw.blotName);t.children.head.children.forEach(()=>{let e=this.scroll.create(Ww.blotName,n);r.appendChild(e)});let i=t.children.at(e);t.insertBefore(r,i)}rows(){let e=this.children.head;return e==null?[]:e.children.map(e=>e)}};qw.allowedChildren=[Kw],Kw.requiredContainer=qw,Kw.allowedChildren=[Gw],Gw.requiredContainer=Kw,Gw.allowedChildren=[Ww],Ww.requiredContainer=Gw;function Jw(){return`row-${Math.random().toString(36).slice(2,6)}`}var Yw=class extends bS{static register(){$.register(Ww),$.register(Gw),$.register(Kw),$.register(qw)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(qw).forEach(e=>{e.balanceCells()})}deleteColumn(){let[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update($.sources.USER))}deleteRow(){let[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update($.sources.USER))}deleteTable(){let[e]=this.getTable();if(e==null)return;let t=e.offset();e.remove(),this.quill.update($.sources.USER),this.quill.setSelection(t,$.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];let[t,n]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==Ww.blotName)return[null,null,null,-1];let r=t.parent;return[r.parent.parent,r,t,n]}insertColumn(e){let t=this.quill.getSelection();if(!t)return;let[n,r,i]=this.getTable(t);if(i==null)return;let a=i.cellOffset();n.insertColumn(a+e),this.quill.update($.sources.USER);let o=r.rowOffset();e===0&&(o+=1),this.quill.setSelection(t.index+o,t.length,$.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){let t=this.quill.getSelection();if(!t)return;let[n,r,i]=this.getTable(t);if(i==null)return;let a=r.rowOffset();n.insertRow(a+e),this.quill.update($.sources.USER),e>0?this.quill.setSelection(t,$.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,$.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){let n=this.quill.getSelection();if(n==null)return;let r=Array(e).fill(0).reduce(e=>{let n=Array(t).fill(`
|
|
233
|
+
`).join(``);return e.insert(n,{table:Jw()})},new Z.default().retain(n.index));this.quill.updateContents(r,$.sources.USER),this.quill.setSelection(n.index,$.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on($.events.SCROLL_OPTIMIZE,e=>{e.some(e=>[`TD`,`TR`,`TBODY`,`TABLE`].includes(e.target.tagName)?(this.quill.once($.events.TEXT_CHANGE,(e,t,n)=>{n===$.sources.USER&&this.balanceTables()}),!0):!1)})}},Xw=aS(`quill:toolbar`),Zw=class extends bS{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){let t=document.createElement(`div`);t.setAttribute(`role`,`toolbar`),$w(t,this.options.container),e.container?.parentNode?.insertBefore(t,e.container),this.container=t}else this.container=typeof this.options.container==`string`?document.querySelector(this.options.container):this.options.container;if(!(this.container instanceof HTMLElement)){Xw.error(`Container required for toolbar`,this.options);return}this.container.classList.add(`ql-toolbar`),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(e=>{let t=this.options.handlers?.[e];t&&this.addHandler(e,t)}),Array.from(this.container.querySelectorAll(`button, select`)).forEach(e=>{this.attach(e)}),this.quill.on($.events.EDITOR_CHANGE,()=>{let[e]=this.quill.selection.getRange();this.update(e)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(e=>e.indexOf(`ql-`)===0);if(!t)return;if(t=t.slice(3),e.tagName===`BUTTON`&&e.setAttribute(`type`,`button`),this.handlers[t]==null&&this.quill.scroll.query(t)==null){Xw.warn(`ignoring attaching to nonexistent format`,t,e);return}let n=e.tagName===`SELECT`?`change`:`click`;e.addEventListener(n,n=>{let r;if(e.tagName===`SELECT`){if(e.selectedIndex<0)return;let t=e.options[e.selectedIndex];r=t.hasAttribute(`selected`)?!1:t.value||!1}else r=e.classList.contains(`ql-active`)?!1:e.value||!e.hasAttribute(`value`),n.preventDefault();this.quill.focus();let[i]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,r);else if(this.quill.scroll.query(t).prototype instanceof Ax){if(r=prompt(`Enter ${t}`),!r)return;this.quill.updateContents(new Z.default().retain(i.index).delete(i.length).insert({[t]:r}),$.sources.USER)}else this.quill.format(t,r,$.sources.USER);this.update(i)}),this.controls.push([t,e])}update(e){let t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(n=>{let[r,i]=n;if(i.tagName===`SELECT`){let n=null;if(e==null)n=null;else if(t[r]==null)n=i.querySelector(`option[selected]`);else if(!Array.isArray(t[r])){let e=t[r];typeof e==`string`&&(e=e.replace(/"/g,`\\"`)),n=i.querySelector(`option[value="${e}"]`)}n==null?(i.value=``,i.selectedIndex=-1):n.selected=!0}else if(e==null)i.classList.remove(`ql-active`),i.setAttribute(`aria-pressed`,`false`);else if(i.hasAttribute(`value`)){let e=t[r],n=e===i.getAttribute(`value`)||e!=null&&e.toString()===i.getAttribute(`value`)||e==null&&!i.getAttribute(`value`);i.classList.toggle(`ql-active`,n),i.setAttribute(`aria-pressed`,n.toString())}else{let e=t[r]!=null;i.classList.toggle(`ql-active`,e),i.setAttribute(`aria-pressed`,e.toString())}})}};Zw.DEFAULTS={};function Qw(e,t,n){let r=document.createElement(`button`);r.setAttribute(`type`,`button`),r.classList.add(`ql-${t}`),r.setAttribute(`aria-pressed`,`false`),n==null?r.setAttribute(`aria-label`,t):(r.value=n,r.setAttribute(`aria-label`,`${t}: ${n}`)),e.appendChild(r)}function $w(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(t=>{let n=document.createElement(`span`);n.classList.add(`ql-formats`),t.forEach(e=>{if(typeof e==`string`)Qw(n,e);else{let t=Object.keys(e)[0],r=e[t];Array.isArray(r)?eT(n,t,r):Qw(n,t,r)}}),e.appendChild(n)})}function eT(e,t,n){let r=document.createElement(`select`);r.classList.add(`ql-${t}`),n.forEach(e=>{let t=document.createElement(`option`);e===!1?t.setAttribute(`selected`,`selected`):t.setAttribute(`value`,String(e)),r.appendChild(t)}),e.appendChild(r)}Zw.DEFAULTS={container:null,handlers:{clean(){let e=this.quill.getSelection();if(e!=null){if(e.length===0){let e=this.quill.getFormat();Object.keys(e).forEach(e=>{this.quill.scroll.query(e,X.INLINE)!=null&&this.quill.format(e,!1,$.sources.USER)})}else this.quill.removeFormat(e.index,e.length,$.sources.USER)}},direction(e){let{align:t}=this.quill.getFormat();e===`rtl`&&t==null?this.quill.format(`align`,`right`,$.sources.USER):!e&&t===`right`&&this.quill.format(`align`,!1,$.sources.USER),this.quill.format(`direction`,e,$.sources.USER)},indent(e){let t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if(e===`+1`||e===`-1`){let t=e===`+1`?1:-1;n.direction===`rtl`&&(t*=-1),this.quill.format(`indent`,r+t,$.sources.USER)}},link(e){e===!0&&(e=prompt(`Enter link URL:`)),this.quill.format(`link`,e,$.sources.USER)},list(e){let t=this.quill.getSelection(),n=this.quill.getFormat(t);e===`check`?n.list===`checked`||n.list===`unchecked`?this.quill.format(`list`,!1,$.sources.USER):this.quill.format(`list`,`unchecked`,$.sources.USER):this.quill.format(`list`,e,$.sources.USER)}}};var tT=`<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>`,nT=`<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>`,rT=`<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>`,iT=`<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>`,aT=`<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>`,oT=`<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>`,sT=`<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>`,cT=`<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>`,lT=`<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>`,uT={align:{"":tT,center:nT,right:rT,justify:iT},background:aT,blockquote:oT,bold:sT,clean:cT,code:lT,"code-block":lT,color:`<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>`,direction:{"":`<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>`,rtl:`<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>`},formula:`<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>`,header:{1:`<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>`,2:`<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>`,3:`<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>`,4:`<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>`,5:`<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>`,6:`<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>`},italic:`<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>`,image:`<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>`,indent:{"+1":`<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>`,"-1":`<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>`},link:`<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>`,list:{bullet:`<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>`,check:`<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>`,ordered:`<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>`},script:{sub:`<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>`,super:`<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>`},strike:`<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>`,table:`<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>`,underline:`<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>`,video:`<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>`},dT=`<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>`,fT=0;function pT(e,t){e.setAttribute(t,`${e.getAttribute(t)!==`true`}`)}var mT=class{constructor(e){this.select=e,this.container=document.createElement(`span`),this.buildPicker(),this.select.style.display=`none`,this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener(`mousedown`,()=>{this.togglePicker()}),this.label.addEventListener(`keydown`,e=>{switch(e.key){case`Enter`:this.togglePicker();break;case`Escape`:this.escape(),e.preventDefault()}}),this.select.addEventListener(`change`,this.update.bind(this))}togglePicker(){this.container.classList.toggle(`ql-expanded`),pT(this.label,`aria-expanded`),pT(this.options,`aria-hidden`)}buildItem(e){let t=document.createElement(`span`);t.tabIndex=`0`,t.setAttribute(`role`,`button`),t.classList.add(`ql-picker-item`);let n=e.getAttribute(`value`);return n&&t.setAttribute(`data-value`,n),e.textContent&&t.setAttribute(`data-label`,e.textContent),t.addEventListener(`click`,()=>{this.selectItem(t,!0)}),t.addEventListener(`keydown`,e=>{switch(e.key){case`Enter`:this.selectItem(t,!0),e.preventDefault();break;case`Escape`:this.escape(),e.preventDefault()}}),t}buildLabel(){let e=document.createElement(`span`);return e.classList.add(`ql-picker-label`),e.innerHTML=dT,e.tabIndex=`0`,e.setAttribute(`role`,`button`),e.setAttribute(`aria-expanded`,`false`),this.container.appendChild(e),e}buildOptions(){let e=document.createElement(`span`);e.classList.add(`ql-picker-options`),e.setAttribute(`aria-hidden`,`true`),e.tabIndex=`-1`,e.id=`ql-picker-options-${fT}`,fT+=1,this.label.setAttribute(`aria-controls`,e.id),this.options=e,Array.from(this.select.options).forEach(t=>{let n=this.buildItem(t);e.appendChild(n),t.selected===!0&&this.selectItem(n)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add(`ql-picker`),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove(`ql-expanded`),this.label.setAttribute(`aria-expanded`,`false`),this.options.setAttribute(`aria-hidden`,`true`)}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=this.container.querySelector(`.ql-selected`);e!==n&&(n?.classList.remove(`ql-selected`),e!=null&&(e.classList.add(`ql-selected`),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute(`data-value`)?this.label.setAttribute(`data-value`,e.getAttribute(`data-value`)):this.label.removeAttribute(`data-value`),e.hasAttribute(`data-label`)?this.label.setAttribute(`data-label`,e.getAttribute(`data-label`)):this.label.removeAttribute(`data-label`),t&&(this.select.dispatchEvent(new Event(`change`)),this.close())))}update(){let e;if(this.select.selectedIndex>-1){let t=this.container.querySelector(`.ql-picker-options`).children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);let t=e!=null&&e!==this.select.querySelector(`option[selected]`);this.label.classList.toggle(`ql-active`,t)}},hT=class extends mT{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add(`ql-color-picker`),Array.from(this.container.querySelectorAll(`.ql-picker-item`)).slice(0,7).forEach(e=>{e.classList.add(`ql-primary`)})}buildItem(e){let t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute(`value`)||``,t}selectItem(e,t){super.selectItem(e,t);let n=this.label.querySelector(`.ql-color-label`),r=e&&e.getAttribute(`data-value`)||``;n&&(n.tagName===`line`?n.style.stroke=r:n.style.fill=r)}},gT=class extends mT{constructor(e,t){super(e),this.container.classList.add(`ql-icon-picker`),Array.from(this.container.querySelectorAll(`.ql-picker-item`)).forEach(e=>{e.innerHTML=t[e.getAttribute(`data-value`)||``]}),this.defaultItem=this.container.querySelector(`.ql-selected`),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);let n=e||this.defaultItem;if(n!=null){if(this.label.innerHTML===n.innerHTML)return;this.label.innerHTML=n.innerHTML}}},_T=e=>{let{overflowY:t}=getComputedStyle(e,null);return t!==`visible`&&t!==`clip`},vT=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer(`ql-tooltip`),this.root.innerHTML=this.constructor.TEMPLATE,_T(this.quill.root)&&this.quill.root.addEventListener(`scroll`,()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add(`ql-hidden`)}position(e){let t=e.left+e.width/2-this.root.offsetWidth/2,n=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${n}px`,this.root.classList.remove(`ql-flip`);let r=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect(),a=0;if(i.right>r.right&&(a=r.right-i.right,this.root.style.left=`${t+a}px`),i.left<r.left&&(a=r.left-i.left,this.root.style.left=`${t+a}px`),i.bottom>r.bottom){let t=i.bottom-i.top,r=e.bottom-e.top+t;this.root.style.top=`${n-r}px`,this.root.classList.add(`ql-flip`)}return a}show(){this.root.classList.remove(`ql-editing`),this.root.classList.remove(`ql-hidden`)}},yT=[!1,`center`,`right`,`justify`],bT=`#000000.#e60000.#ff9900.#ffff00.#008a00.#0066cc.#9933ff.#ffffff.#facccc.#ffebcc.#ffffcc.#cce8cc.#cce0f5.#ebd6ff.#bbbbbb.#f06666.#ffc266.#ffff66.#66b966.#66a3e0.#c285ff.#888888.#a10000.#b26b00.#b2b200.#006100.#0047b2.#6b24b2.#444444.#5c0000.#663d00.#666600.#003700.#002966.#3d1466`.split(`.`),xT=[!1,`serif`,`monospace`],ST=[`1`,`2`,`3`,!1],CT=[`small`,!1,`large`,`huge`],wT=class extends wS{constructor(e,t){super(e,t);let n=t=>{if(!document.body.contains(e.root)){document.body.removeEventListener(`click`,n);return}this.tooltip!=null&&!this.tooltip.root.contains(t.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(e=>{e.container.contains(t.target)||e.close()})};e.emitter.listenDOM(`click`,document.body,n)}addModule(e){let t=super.addModule(e);return e===`toolbar`&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(e=>{(e.getAttribute(`class`)||``).split(/\s+/).forEach(n=>{if(n.startsWith(`ql-`)&&(n=n.slice(3),t[n]!=null)){if(n===`direction`)e.innerHTML=t[n][``]+t[n].rtl;else if(typeof t[n]==`string`)e.innerHTML=t[n];else{let r=e.value||``;r!=null&&t[n][r]&&(e.innerHTML=t[n][r])}}})})}buildPickers(e,t){this.pickers=Array.from(e).map(e=>{if(e.classList.contains(`ql-align`)&&(e.querySelector(`option`)??DT(e,yT),typeof t.align==`object`))return new gT(e,t.align);if(e.classList.contains(`ql-background`)||e.classList.contains(`ql-color`)){let n=e.classList.contains(`ql-background`)?`background`:`color`;return e.querySelector(`option`)??DT(e,bT,n===`background`?`#ffffff`:`#000000`),new hT(e,t[n])}return e.querySelector(`option`)??(e.classList.contains(`ql-font`)?DT(e,xT):e.classList.contains(`ql-header`)?DT(e,ST):e.classList.contains(`ql-size`)&&DT(e,CT)),new mT(e)}),this.quill.on(Q.events.EDITOR_CHANGE,()=>{this.pickers.forEach(e=>{e.update()})})}};wT.DEFAULTS=Sm({},wS.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit(`formula`)},image(){let e=this.container.querySelector(`input.ql-image[type=file]`);e??(e=document.createElement(`input`),e.setAttribute(`type`,`file`),e.setAttribute(`accept`,this.quill.uploader.options.mimetypes.join(`, `)),e.classList.add(`ql-image`),e.addEventListener(`change`,()=>{let t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=``}),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit(`video`)}}}}});var TT=class extends vT{constructor(e,t){super(e,t),this.textbox=this.root.querySelector(`input[type="text"]`),this.listen()}listen(){this.textbox.addEventListener(`keydown`,e=>{e.key===`Enter`?(this.save(),e.preventDefault()):e.key===`Escape`&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`link`,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove(`ql-hidden`),this.root.classList.add(`ql-editing`),this.textbox==null)return;t==null?e!==this.root.getAttribute(`data-mode`)&&(this.textbox.value=``):this.textbox.value=t;let n=this.quill.getBounds(this.quill.selection.savedRange);n!=null&&this.position(n),this.textbox.select(),this.textbox.setAttribute(`placeholder`,this.textbox.getAttribute(`data-${e}`)||``),this.root.setAttribute(`data-mode`,e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute(`data-mode`)){case`link`:{let{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,`link`,e,Q.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format(`link`,e,Q.sources.USER)),this.quill.root.scrollTop=t;break}case`video`:e=ET(e);case`formula`:{if(!e)break;let t=this.quill.getSelection(!0);if(t!=null){let n=t.index+t.length;this.quill.insertEmbed(n,this.root.getAttribute(`data-mode`),e,Q.sources.USER),this.root.getAttribute(`data-mode`)===`formula`&&this.quill.insertText(n+1,` `,Q.sources.USER),this.quill.setSelection(n+2,Q.sources.USER)}break}}this.textbox.value=``,this.hide()}};function ET(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||`https`}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||`https`}://player.vimeo.com/video/${t[2]}/`:e}function DT(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];t.forEach(t=>{let r=document.createElement(`option`);t===n?r.setAttribute(`selected`,`selected`):r.setAttribute(`value`,String(t)),e.appendChild(r)})}var OT=[[`bold`,`italic`,`link`],[{header:1},{header:2},`blockquote`]],kT=class extends TT{static TEMPLATE=[`<span class="ql-tooltip-arrow"></span>`,`<div class="ql-tooltip-editor">`,`<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">`,`<a class="ql-close"></a>`,`</div>`].join(``);constructor(e,t){super(e,t),this.quill.on(Q.events.EDITOR_CHANGE,(e,t,n,r)=>{if(e===Q.events.SELECTION_CHANGE){if(t!=null&&t.length>0&&r===Q.sources.USER){this.show(),this.root.style.left=`0px`,this.root.style.width=``,this.root.style.width=`${this.root.offsetWidth}px`;let e=this.quill.getLines(t.index,t.length);if(e.length===1){let e=this.quill.getBounds(t);e!=null&&this.position(e)}else{let n=e[e.length-1],r=this.quill.getIndex(n),i=Math.min(n.length()-1,t.index+t.length-r),a=this.quill.getBounds(new cS(r,i));a!=null&&this.position(a)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()}})}listen(){super.listen(),this.root.querySelector(`.ql-close`).addEventListener(`click`,()=>{this.root.classList.remove(`ql-editing`)}),this.quill.on(Q.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains(`ql-hidden`))return;let e=this.quill.getSelection();if(e!=null){let t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){let t=super.position(e),n=this.root.querySelector(`.ql-tooltip-arrow`);return n.style.marginLeft=``,t!==0&&(n.style.marginLeft=`${-1*t-n.offsetWidth/2}px`),t}},AT=class extends wT{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=OT),super(e,t),this.quill.container.classList.add(`ql-bubble`)}extendToolbar(e){this.tooltip=new kT(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll(`button`),uT),this.buildPickers(e.container.querySelectorAll(`select`),uT))}};AT.DEFAULTS=Sm({},wT.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format(`link`,!1,$.sources.USER)}}}}});var jT=[[{header:[`1`,`2`,`3`,!1]}],[`bold`,`italic`,`underline`,`link`],[{list:`ordered`},{list:`bullet`}],[`clean`]],MT=class extends TT{static TEMPLATE=[`<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>`,`<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">`,`<a class="ql-action"></a>`,`<a class="ql-remove"></a>`].join(``);preview=this.root.querySelector(`a.ql-preview`);listen(){super.listen(),this.root.querySelector(`a.ql-action`).addEventListener(`click`,e=>{this.root.classList.contains(`ql-editing`)?this.save():this.edit(`link`,this.preview.textContent),e.preventDefault()}),this.root.querySelector(`a.ql-remove`).addEventListener(`click`,e=>{if(this.linkRange!=null){let e=this.linkRange;this.restoreFocus(),this.quill.formatText(e,`link`,!1,Q.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(Q.events.SELECTION_CHANGE,(e,t,n)=>{if(e!=null){if(e.length===0&&n===Q.sources.USER){let[t,n]=this.quill.scroll.descendant(Ow,e.index);if(t!=null){this.linkRange=new cS(e.index-n,t.length());let r=Ow.formats(t.domNode);this.preview.textContent=r,this.preview.setAttribute(`href`,r),this.show();let i=this.quill.getBounds(this.linkRange);i!=null&&this.position(i);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute(`data-mode`)}},NT=class extends wT{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=jT),super(e,t),this.quill.container.classList.add(`ql-snow`)}extendToolbar(e){e.container!=null&&(e.container.classList.add(`ql-snow`),this.buildButtons(e.container.querySelectorAll(`button`),uT),this.buildPickers(e.container.querySelectorAll(`select`),uT),this.tooltip=new MT(this.quill,this.options.bounds),e.container.querySelector(`.ql-link`)&&this.quill.keyboard.addBinding({key:`k`,shortKey:!0},(t,n)=>{e.handlers.link.call(e,!n.format.link)}))}};NT.DEFAULTS=Sm({},wT.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){let e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf(`mailto:`)!==0&&(t=`mailto:${t}`);let{tooltip:n}=this.quill.theme;n.edit(`link`,t)}else this.quill.format(`link`,!1,$.sources.USER)}}}}}),bw.register({"attributors/attribute/direction":oC,"attributors/class/align":YS,"attributors/class/background":eC,"attributors/class/color":QS,"attributors/class/direction":sC,"attributors/class/font":uC,"attributors/class/size":fC,"attributors/style/align":XS,"attributors/style/background":tC,"attributors/style/color":$S,"attributors/style/direction":cC,"attributors/style/font":dC,"attributors/style/size":pC},!0),bw.register({"formats/align":YS,"formats/direction":sC,"formats/indent":xw,"formats/background":tC,"formats/color":$S,"formats/font":uC,"formats/size":fC,"formats/blockquote":Sw,"formats/code-block":rC,"formats/header":Cw,"formats/list":Tw,"formats/bold":Ew,"formats/code":iC,"formats/italic":Dw,"formats/link":Ow,"formats/script":Aw,"formats/strike":jw,"formats/underline":Mw,"formats/formula":Nw,"formats/image":Fw,"formats/video":Lw,"modules/syntax":Uw,"modules/table":Yw,"modules/toolbar":Zw,"themes/bubble":AT,"themes/snow":NT,"ui/icons":uT,"ui/picker":mT,"ui/icon-picker":gT,"ui/color-picker":hT,"ui/tooltip":vT},!0);var PT=bw,FT=class extends d.default.Component{constructor(e){super(e),this.editingAreaRef=(0,d.createRef)(),this.containerRef=(0,d.createRef)(),this.dirtyProps=[`modules`,`formats`,`bounds`,`theme`,`children`],this.cleanProps=[`id`,`className`,`style`,`placeholder`,`tabIndex`,`onChange`,`onChangeSelection`,`onFocus`,`onBlur`,`onKeyPress`,`onKeyDown`,`onKeyUp`,`useSemanticHTML`],this.state={generation:0},this.selection=null,this.onEditorChange=(e,t,n,r)=>{e===`text-change`?this.onEditorChangeText?.(this.props.useSemanticHTML===!1?this.editor.root.innerHTML:this.editor.getSemanticHTML(),t,r,this.unprivilegedEditor):e===`selection-change`&&this.onEditorChangeSelection?.(t,r,this.unprivilegedEditor)};let t=this.isControlled()?e.value:e.defaultValue;this.value=t??``}validateProps(e){if(d.default.Children.count(e.children)>1)throw Error(`The Quill editing area can only be composed of a single React element.`);if(d.default.Children.count(e.children)&&d.default.Children.only(e.children)?.type===`textarea`)throw Error(`Quill does not support editing on a <textarea>. Use a <div> instead.`);if(this.lastDeltaChangeSet&&e.value===this.lastDeltaChangeSet)throw Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")}shouldComponentUpdate(e,t){if(this.validateProps(e),!this.editor||this.state.generation!==t.generation)return!0;if(`value`in e){let t=this.getEditorContents(),n=e.value??``;this.isEqualValue(n,t)||this.setEditorContents(this.editor,n)}return e.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,e.readOnly),[...this.cleanProps,...this.dirtyProps].some(t=>!ix(e[t],this.props[t]))}shouldComponentRegenerate(e){return this.dirtyProps.some(t=>!ix(e[t],this.props[t]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(e,t){if(this.editor&&this.shouldComponentRegenerate(e)){let e=this.editor.getContents(),t=this.editor.getSelection();this.regenerationSnapshot={delta:e,selection:t},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.editor&&e.placeholder!==this.props.placeholder&&(this.editor.root.dataset.placeholder=this.props.placeholder||``),this.state.generation!==t.generation){let{delta:e,selection:t}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();let n=this.editor;n.setContents(e),IT(()=>this.setEditorSelection(n,t))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){if(!this.editor)return;this.unhookEditor(this.editor);let e=this.props.modules?.toolbar;if(!(typeof e==`object`&&e&&`container`in e&&typeof e.container==`string`||typeof e==`string`)){let e=this.containerRef.current?.querySelector(`.ql-toolbar`);e&&e.remove()}delete this.editor}isControlled(){return`value`in this.props}getEditorConfig(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,tabIndex:this.props.tabIndex,theme:this.props.theme}}getEditor(){if(!this.editor)throw Error(`Accessing non-instantiated editor`);return this.editor}createEditor(e,t){let n=new PT(e,t);return t.tabIndex!=null&&this.setEditorTabIndex(n,t.tabIndex),this.hookEditor(n),n}hookEditor(e){this.unprivilegedEditor=this.makeUnprivilegedEditor(e),e.on(`editor-change`,this.onEditorChange)}unhookEditor(e){e.off(`editor-change`,this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(e){return e&&e.ops}isEqualValue(e,t){return this.isDelta(e)&&this.isDelta(t)?ix(e.ops,t.ops):ix(e,t)}setEditorContents(e,t){this.value=t;let n=this.getEditorSelection();typeof t==`string`?e.setContents(e.clipboard.convert({html:t})):e.setContents(t),IT(()=>this.setEditorSelection(e,n))}setEditorSelection(e,t){if(this.selection=t,t){let n=e.getLength();t.index=Math.max(0,Math.min(t.index,n-1)),t.length=Math.max(0,Math.min(t.length,n-1-t.index)),e.setSelection(t)}}setEditorTabIndex(e,t){e?.scroll?.domNode&&(e.scroll.domNode.tabIndex=t)}setEditorReadOnly(e,t){t?e.disable():e.enable()}makeUnprivilegedEditor(e){let t=e;return{getHTML:()=>t.root.innerHTML,getSemanticHTML:t.getSemanticHTML.bind(t),getLength:t.getLength.bind(t),getText:t.getText.bind(t),getContents:t.getContents.bind(t),getSelection:t.getSelection.bind(t),getBounds:t.getBounds.bind(t)}}getEditingArea(){let e=this.editingAreaRef.current;if(!e)throw Error(`Cannot find element for editing area`);if(e.nodeType===3)throw Error(`Editing area cannot be a text node`);return e}renderEditingArea(){let{children:e,preserveWhitespace:t}=this.props,{generation:n}=this.state;return d.default.Children.count(e)?d.default.cloneElement(d.default.Children.only(e),{key:n,ref:this.editingAreaRef}):t?(0,p.jsx)(`pre`,{ref:this.editingAreaRef},n):(0,p.jsx)(`div`,{ref:this.editingAreaRef},n)}render(){return(0,p.jsx)(`div`,{ref:this.containerRef,id:this.props.id,style:this.props.style,className:`quill ${this.props.className??``}`,onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp,children:this.renderEditingArea()},this.state.generation)}onEditorChangeText(e,t,n,r){if(!this.editor)return;let i=this.isDelta(this.value)?r.getContents():this.props.useSemanticHTML===!1?r.getHTML():r.getSemanticHTML();i!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=i,this.props.onChange?.(e,t,n,r))}onEditorChangeSelection(e,t,n){if(!this.editor)return;let r=this.getEditorSelection(),i=!r&&e,a=r&&!e;ix(e,r)||(this.selection=e,this.props.onChangeSelection?.(e,t,n),i?this.props.onFocus?.(e,t,n):a&&this.props.onBlur?.(r,t,n))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}};FT.displayName=`React Quill`,FT.Quill=PT,FT.defaultProps={theme:`snow`,modules:{},readOnly:!1};function IT(e){Promise.resolve().then(e)}var LT=FT,RT={formats:[`header`,`bold`,`italic`,`underline`,`strike`,`blockquote`,`list`,`indent`,`link`,`image`,`color`,`background`],modules:{toolbar:[[{header:[1,2,!1]}],[`bold`,`italic`,`underline`,`strike`,`blockquote`],[{list:`ordered`},{list:`bullet`},{indent:`-1`},{indent:`+1`}],[{color:[]},{background:[]}],[`link`,`image`],[`clean`]]}},zT=(0,g.styled)(LT)(({theme:e})=>({".ql-container":{maxWidth:`100%`,width:`100%`},".ql-editor":{maxWidth:`100%`,minHeight:`150px`,overflowWrap:`break-word`,whiteSpace:`pre-wrap`,width:`100%`,wordBreak:`break-word`},maxWidth:`100%`,width:`100%`}));function BT({text:e,setText:t}){let n=ge(e=>(0,m.getConfig)(e)?.annotation?.quillConfig),{formats:r,modules:i}=(0,u.useMemo)(()=>n?.modules&&n?.formats?n:RT,[n]);return(0,p.jsx)(`div`,{"data-text-editor":`name`,"data-testid":`textEditor`,children:(0,p.jsx)(zT,{value:e,onChange:e=>{t(e)},placeholder:`Your text here`,bounds:`[data-text-editor="name"]`,modules:i,formats:r})})}BT.propTypes={setText:f.default.func.isRequired,text:f.default.string.isRequired};function VT({annoHtml:e,updateAnnotationBody:t,t:n}){return(0,p.jsxs)(h.Grid,{container:!0,direction:`column`,spacing:1,children:[(0,p.jsx)(h.Grid,{container:!0,children:(0,p.jsx)(h.Typography,{variant:`formSectionTitle`,children:n(`note`)})}),(0,p.jsx)(h.Grid,{container:!0,children:(0,p.jsx)(BT,{annoHtml:e,updateAnnotationBody:t})})]})}VT.propTypes={annoHtml:f.default.string.isRequired,t:f.default.func.isRequired,updateAnnotationBody:f.default.func.isRequired};function HT(){return HT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HT.apply(null,arguments)}function UT(e){"@babel/helpers - typeof";return UT=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},UT(e)}function WT(e,t){if(UT(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(UT(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function GT(e){var t=WT(e,`string`);return UT(t)==`symbol`?t:t+``}function KT(e,t,n){return(t=GT(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function JT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qT(Object(n),!0).forEach(function(t){KT(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qT(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function YT(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function XT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,GT(r.key),r)}}function ZT(e,t,n){return t&&XT(e.prototype,t),n&&XT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function QT(e,t){return QT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},QT(e,t)}function $T(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QT(e,t)}function eE(e){return eE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},eE(e)}function tE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tE=function(){return!!e})()}function nE(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function rE(e,t){if(t&&(UT(t)==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return nE(e)}function iE(e){var t=tE();return function(){var n,r=eE(e);if(t){var i=eE(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return rE(this,n)}}function aE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oE(e){if(Array.isArray(e))return aE(e)}function sE(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function cE(e,t){if(e){if(typeof e==`string`)return aE(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?aE(e,t):void 0}}function lE(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
234
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uE(e){return oE(e)||sE(e)||cE(e)||lE()}function dE(e){if(Array.isArray(e))return e}function fE(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function pE(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
235
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mE(e,t){return dE(e)||fE(e,t)||cE(e,t)||pE()}function hE(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function gE(e,t){if(e==null)return{};var n,r,i=hE(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _E(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var vE=Math.min,yE=Math.max,bE=Math.round,xE=Math.floor,SE=e=>({x:e,y:e});function CE(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function wE(){return typeof window<`u`}function TE(e){return OE(e)?(e.nodeName||``).toLowerCase():`#document`}function EE(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function DE(e){return((OE(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function OE(e){return wE()?e instanceof Node||e instanceof EE(e).Node:!1}function kE(e){return wE()?e instanceof Element||e instanceof EE(e).Element:!1}function AE(e){return wE()?e instanceof HTMLElement||e instanceof EE(e).HTMLElement:!1}function jE(e){return!wE()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof EE(e).ShadowRoot}function ME(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=IE(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}var NE;function PE(){return NE??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),NE}function FE(e){return/^(html|body|#document)$/.test(TE(e))}function IE(e){return EE(e).getComputedStyle(e)}function LE(e){if(TE(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||jE(e)&&e.host||DE(e);return jE(t)?t.host:t}function RE(e){let t=LE(e);return FE(t)?(e.ownerDocument||e).body:AE(t)&&ME(t)?t:RE(t)}function zE(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=RE(e),i=r===e.ownerDocument?.body,a=EE(r);if(i){let e=BE(a);return t.concat(a,a.visualViewport||[],ME(r)?r:[],e&&n?zE(e):[])}return t.concat(r,zE(r,[],n))}function BE(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function VE(e){let t=IE(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=AE(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=bE(n)!==a||bE(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function HE(e){return kE(e)?e:e.contextElement}function UE(e){let t=HE(e);if(!AE(t))return SE(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=VE(t),o=(a?bE(n.width):n.width)/r,s=(a?bE(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var WE=SE(0);function GE(e){let t=EE(e);return!PE()||!t.visualViewport?WE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function KE(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===EE(e)}function qE(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=HE(e),o=SE(1);t&&(r?kE(r)&&(o=UE(r)):o=UE(e));let s=KE(a,n,r)?GE(a):SE(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=EE(a),t=kE(r)?EE(r):r,n=e,i=BE(n);for(;i&&t!==n;){let e=UE(i),t=i.getBoundingClientRect(),r=IE(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=EE(i),i=BE(n)}}return CE({width:u,height:d,x:c,y:l})}function JE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function YE(e,t,n){let r=null,i,a=DE(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=xE(d),h=xE(a.clientWidth-(u+f)),g=xE(a.clientHeight-(d+p)),_=xE(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:yE(0,vE(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!JE(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=EE(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function XE(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=HE(e),u=i||a?[...l?zE(l):[],...t?zE(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?YE(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?qE(e):null;c&&g();function g(){let t=qE(e);h&&!JE(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ZE=u.useLayoutEffect,QE=[`className`,`clearValue`,`cx`,`getStyles`,`getClassNames`,`getValue`,`hasValue`,`isMulti`,`isRtl`,`options`,`selectOption`,`selectProps`,`setValue`,`theme`],$E=function(){};function eD(e,t){return t?t[0]===`-`?e+t:e+`__`+t:e}function tD(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var a=[].concat(r);if(t&&e)for(var o in t)t.hasOwnProperty(o)&&t[o]&&a.push(`${eD(e,o)}`);return a.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(` `)}var nD=function(e){return xD(e)?e.filter(Boolean):UT(e)===`object`&&e!==null?[e]:[]},rD=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,JT({},gE(e,QE))},iD=function(e,t,n){var r=e.cx,i=e.getStyles,a=e.getClassNames,o=e.className;return{css:i(t,e),className:r(n??{},a(t,e),o)}};function aD(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function oD(e){return aD(e)?window.innerHeight:e.clientHeight}function sD(e){return aD(e)?window.pageYOffset:e.scrollTop}function cD(e,t){if(aD(e)){window.scrollTo(0,t);return}e.scrollTop=t}function lD(e){var t=getComputedStyle(e),n=t.position===`absolute`,r=/(auto|scroll)/;if(t.position===`fixed`)return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position===`static`)&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function uD(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function dD(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:$E,i=sD(e),a=t-i,o=10,s=0;function c(){s+=o,cD(e,uD(s,i,a,n)),s<n?window.requestAnimationFrame(c):r(e)}c()}function fD(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?cD(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&cD(e,Math.max(t.offsetTop-i,0))}function pD(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function mD(){try{return document.createEvent(`TouchEvent`),!0}catch{return!1}}function hD(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var gD=!1,_D={get passive(){return gD=!0}},vD=typeof window<`u`?window:{};vD.addEventListener&&vD.removeEventListener&&(vD.addEventListener(`p`,$E,_D),vD.removeEventListener(`p`,$E,!1));var yD=gD;function bD(e){return e!=null}function xD(e){return Array.isArray(e)}function SD(e,t,n){return e?t:n}function CD(e){return e}function wD(e){return e}var TD=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Object.entries(e).filter(function(e){var t=mE(e,1)[0];return!n.includes(t)}).reduce(function(e,t){var n=mE(t,2),r=n[0];return e[r]=n[1],e},{})},ED=[`children`,`innerProps`],DD=[`children`,`innerProps`];function OD(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,a=e.shouldScroll,o=e.isFixedPosition,s=e.controlHeight,c=lD(n),l={placement:`bottom`,maxHeight:t};if(!n||!n.offsetParent)return l;var u=c.getBoundingClientRect().height,d=n.getBoundingClientRect(),f=d.bottom,p=d.height,m=d.top,h=n.offsetParent.getBoundingClientRect().top,g=o?window.innerHeight:oD(c),_=sD(c),v=parseInt(getComputedStyle(n).marginBottom,10),y=parseInt(getComputedStyle(n).marginTop,10),b=h-y,x=g-m,S=b+_,C=u-_-m,w=f-g+_+v,T=_+m-y,E=160;switch(i){case`auto`:case`bottom`:if(x>=p)return{placement:`bottom`,maxHeight:t};if(C>=p&&!o)return a&&dD(c,w,E),{placement:`bottom`,maxHeight:t};if(!o&&C>=r||o&&x>=r)return a&&dD(c,w,E),{placement:`bottom`,maxHeight:o?x-v:C-v};if(i===`auto`||o){var D=t,O=o?b:S;return O>=r&&(D=Math.min(O-v-s,t)),{placement:`top`,maxHeight:D}}if(i===`bottom`)return a&&cD(c,w),{placement:`bottom`,maxHeight:t};break;case`top`:if(b>=p)return{placement:`top`,maxHeight:t};if(S>=p&&!o)return a&&dD(c,T,E),{placement:`top`,maxHeight:t};if(!o&&S>=r||o&&b>=r){var k=t;return(!o&&S>=r||o&&b>=r)&&(k=o?b-y:S-y),a&&dD(c,T,E),{placement:`top`,maxHeight:k}}return{placement:`bottom`,maxHeight:t};default:throw Error(`Invalid placement provided "${i}".`)}return l}function kD(e){return e?{bottom:`top`,top:`bottom`}[e]:`bottom`}var AD=function(e){return e===`auto`?`bottom`:e},jD=function(e,t){var n,r=e.placement,i=e.theme,a=i.borderRadius,o=i.spacing,s=i.colors;return JT((n={label:`menu`},KT(n,kD(r),`100%`),KT(n,`position`,`absolute`),KT(n,`width`,`100%`),KT(n,`zIndex`,1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:a,boxShadow:`0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)`,marginBottom:o.menuGutter,marginTop:o.menuGutter})},MD=(0,u.createContext)(null),ND=function(e){var t=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,i=e.menuPlacement,a=e.menuPosition,o=e.menuShouldScrollIntoView,s=e.theme,c=((0,u.useContext)(MD)||{}).setPortalPlacement,l=(0,u.useRef)(null),d=mE((0,u.useState)(r),2),f=d[0],p=d[1],m=mE((0,u.useState)(null),2),h=m[0],g=m[1],_=s.spacing.controlHeight;return ZE(function(){var e=l.current;if(e){var t=a===`fixed`,s=OD({maxHeight:r,menuEl:e,minHeight:n,placement:i,shouldScroll:o&&!t,isFixedPosition:t,controlHeight:_});p(s.maxHeight),g(s.placement),c?.(s.placement)}},[r,i,a,o,n,c,_]),t({ref:l,placerProps:JT(JT({},e),{},{placement:h||AD(i),maxHeight:f})})},PD=function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return(0,P.jsx)(`div`,HT({},iD(e,`menu`,{menu:!0}),{ref:n},r),t)},FD=function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return JT({maxHeight:n,overflowY:`auto`,position:`relative`,WebkitOverflowScrolling:`touch`},t?{}:{paddingBottom:r,paddingTop:r})},ID=function(e){var t=e.children,n=e.innerProps,r=e.innerRef,i=e.isMulti;return(0,P.jsx)(`div`,HT({},iD(e,`menuList`,{"menu-list":!0,"menu-list--is-multi":i}),{ref:r},n),t)},LD=function(e,t){var n=e.theme,r=n.spacing.baseUnit,i=n.colors;return JT({textAlign:`center`},t?{}:{color:i.neutral40,padding:`${r*2}px ${r*3}px`})},RD=LD,zD=LD,BD=function(e){var t=e.children,n=t===void 0?`No options`:t,r=e.innerProps,i=gE(e,ED);return(0,P.jsx)(`div`,HT({},iD(JT(JT({},i),{},{children:n,innerProps:r}),`noOptionsMessage`,{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},VD=function(e){var t=e.children,n=t===void 0?`Loading...`:t,r=e.innerProps,i=gE(e,DD);return(0,P.jsx)(`div`,HT({},iD(JT(JT({},i),{},{children:n,innerProps:r}),`loadingMessage`,{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},HD=function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},UD=function(e){var t=e.appendTo,n=e.children,r=e.controlElement,i=e.innerProps,a=e.menuPlacement,o=e.menuPosition,s=(0,u.useRef)(null),c=(0,u.useRef)(null),l=mE((0,u.useState)(AD(a)),2),d=l[0],f=l[1],p=(0,u.useMemo)(function(){return{setPortalPlacement:f}},[]),m=mE((0,u.useState)(null),2),h=m[0],g=m[1],_=(0,u.useCallback)(function(){if(r){var e=pD(r),t=o===`fixed`?0:window.pageYOffset,n=e[d]+t;(n!==h?.offset||e.left!==h?.rect.left||e.width!==h?.rect.width)&&g({offset:n,rect:e})}},[r,o,d,h?.offset,h?.rect.left,h?.rect.width]);ZE(function(){_()},[_]);var v=(0,u.useCallback)(function(){typeof c.current==`function`&&(c.current(),c.current=null),r&&s.current&&(c.current=XE(r,s.current,_,{elementResize:`ResizeObserver`in window}))},[r,_]);ZE(function(){v()},[v]);var y=(0,u.useCallback)(function(e){s.current=e,v()},[v]);if(!t&&o!==`fixed`||!h)return null;var b=(0,P.jsx)(`div`,HT({ref:y},iD(JT(JT({},e),{},{offset:h.offset,position:o,rect:h.rect}),`menuPortal`,{"menu-portal":!0}),i),n);return(0,P.jsx)(MD.Provider,{value:p},t?(0,ee.createPortal)(b,t):b)},WD=function(e){var t=e.isDisabled;return{label:`container`,direction:e.isRtl?`rtl`:void 0,pointerEvents:t?`none`:void 0,position:`relative`}},GD=function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,i=e.isRtl;return(0,P.jsx)(`div`,HT({},iD(e,`container`,{"--is-disabled":r,"--is-rtl":i}),n),t)},KD=function(e,t){var n=e.theme.spacing,r=e.isMulti,i=e.hasValue,a=e.selectProps.controlShouldRenderValue;return JT({alignItems:`center`,display:r&&i&&a?`flex`:`grid`,flex:1,flexWrap:`wrap`,WebkitOverflowScrolling:`touch`,position:`relative`,overflow:`hidden`},t?{}:{padding:`${n.baseUnit/2}px ${n.baseUnit*2}px`})},qD=function(e){var t=e.children,n=e.innerProps,r=e.isMulti,i=e.hasValue;return(0,P.jsx)(`div`,HT({},iD(e,`valueContainer`,{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":i}),n),t)},JD=function(){return{alignItems:`center`,alignSelf:`stretch`,display:`flex`,flexShrink:0}},YD=function(e){var t=e.children,n=e.innerProps;return(0,P.jsx)(`div`,HT({},iD(e,`indicatorsContainer`,{indicators:!0}),n),t)},XD,ZD=[`size`],QD=[`innerProps`,`isRtl`,`size`];function $D(){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 eO=process.env.NODE_ENV===`production`?{name:`8mmkcg`,styles:`display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0`}:{name:`tj5bde-Svg`,styles:`display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;`,map:`/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWUsXG4gIENTU09iamVjdFdpdGhMYWJlbCxcbiAgR3JvdXBCYXNlLFxufSBmcm9tICcuLi90eXBlcyc7XG5pbXBvcnQgeyBnZXRTdHlsZVByb3BzIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgSWNvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBTdmcgPSAoe1xuICBzaXplLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZTogbnVtYmVyIH0pID0+IChcbiAgPHN2Z1xuICAgIGhlaWdodD17c2l6ZX1cbiAgICB3aWR0aD17c2l6ZX1cbiAgICB2aWV3Qm94PVwiMCAwIDIwIDIwXCJcbiAgICBhcmlhLWhpZGRlbj1cInRydWVcIlxuICAgIGZvY3VzYWJsZT1cImZhbHNlXCJcbiAgICBjc3M9e3tcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgZmlsbDogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBsaW5lSGVpZ2h0OiAxLFxuICAgICAgc3Ryb2tlOiAnY3VycmVudENvbG9yJyxcbiAgICAgIHN0cm9rZVdpZHRoOiAwLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IHR5cGUgQ3Jvc3NJY29uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgQ3Jvc3NJY29uID0gKHByb3BzOiBDcm9zc0ljb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNMTQuMzQ4IDE0Ljg0OWMtMC40NjkgMC40NjktMS4yMjkgMC40NjktMS42OTcgMGwtMi42NTEtMy4wMzAtMi42NTEgMy4wMjljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDAtMC40NjktMC40NjktMC40NjktMS4yMjkgMC0xLjY5N2wyLjc1OC0zLjE1LTIuNzU5LTMuMTUyYy0wLjQ2OS0wLjQ2OS0wLjQ2OS0xLjIyOCAwLTEuNjk3czEuMjI4LTAuNDY5IDEuNjk3IDBsMi42NTIgMy4wMzEgMi42NTEtMy4wMzFjMC40NjktMC40NjkgMS4yMjgtMC40NjkgMS42OTcgMHMwLjQ2OSAxLjIyOSAwIDEuNjk3bC0yLjc1OCAzLjE1MiAyLjc1OCAzLjE1YzAuNDY5IDAuNDY5IDAuNDY5IDEuMjI5IDAgMS42OTh6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuZXhwb3J0IHR5cGUgRG93bkNoZXZyb25Qcm9wcyA9IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU/OiBudW1iZXIgfTtcbmV4cG9ydCBjb25zdCBEb3duQ2hldnJvbiA9IChwcm9wczogRG93bkNoZXZyb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNNC41MTYgNy41NDhjMC40MzYtMC40NDYgMS4wNDMtMC40ODEgMS41NzYgMGwzLjkwOCAzLjc0NyAzLjkwOC0zLjc0N2MwLjUzMy0wLjQ4MSAxLjE0MS0wLjQ0NiAxLjU3NCAwIDAuNDM2IDAuNDQ1IDAuNDA4IDEuMTk3IDAgMS42MTUtMC40MDYgMC40MTgtNC42OTUgNC41MDItNC42OTUgNC41MDItMC4yMTcgMC4yMjMtMC41MDIgMC4zMzUtMC43ODcgMC4zMzVzLTAuNTctMC4xMTItMC43ODktMC4zMzVjMCAwLTQuMjg3LTQuMDg0LTQuNjk1LTQuNTAycy0wLjQzNi0xLjE3IDAtMS42MTV6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgQnV0dG9uc1xuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbmV4cG9ydCBpbnRlcmZhY2UgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBUaGUgY2hpbGRyZW4gdG8gYmUgcmVuZGVyZWQgaW5zaWRlIHRoZSBpbmRpY2F0b3IuICovXG4gIGNoaWxkcmVuPzogUmVhY3ROb2RlO1xuICAvKiogUHJvcHMgdGhhdCB3aWxsIGJlIHBhc3NlZCBvbiB0byB0aGUgY2hpbGRyZW4uICovXG4gIGlubmVyUHJvcHM6IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snZGl2J107XG4gIC8qKiBUaGUgZm9jdXNlZCBzdGF0ZSBvZiB0aGUgc2VsZWN0LiAqL1xuICBpc0ZvY3VzZWQ6IGJvb2xlYW47XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG59XG5cbmNvbnN0IGJhc2VDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgdGhlbWU6IHtcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICAgIGNvbG9ycyxcbiAgICB9LFxuICB9OlxuICAgIHwgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuICAgIHwgQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2luZGljYXRvckNvbnRhaW5lcicsXG4gIGRpc3BsYXk6ICdmbGV4JyxcbiAgdHJhbnNpdGlvbjogJ2NvbG9yIDE1MG1zJyxcbiAgLi4uKHVuc3R5bGVkXG4gICAgPyB7fVxuICAgIDoge1xuICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw2MCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIHBhZGRpbmc6IGJhc2VVbml0ICogMixcbiAgICAgICAgJzpob3Zlcic6IHtcbiAgICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw4MCA6IGNvbG9ycy5uZXV0cmFsNDAsXG4gICAgICAgIH0sXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgZHJvcGRvd25JbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IERyb3Bkb3duSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnZHJvcGRvd25JbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2Ryb3Bkb3duLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8RG93bkNoZXZyb24gLz59XG4gICAgPC9kaXY+XG4gICk7XG59O1xuXG5leHBvcnQgaW50ZXJmYWNlIENsZWFySW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xufVxuXG5leHBvcnQgY29uc3QgY2xlYXJJbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IENsZWFySW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnY2xlYXJJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2NsZWFyLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8Q3Jvc3NJY29uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBTZXBhcmF0b3Jcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIEluZGljYXRvclNlcGFyYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpbm5lclByb3BzPzogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ107XG59XG5cbmV4cG9ydCBjb25zdCBpbmRpY2F0b3JTZXBhcmF0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0Rpc2FibGVkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JTZXBhcmF0b3InLFxuICBhbGlnblNlbGY6ICdzdHJldGNoJyxcbiAgd2lkdGg6IDEsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgYmFja2dyb3VuZENvbG9yOiBpc0Rpc2FibGVkID8gY29sb3JzLm5ldXRyYWwxMCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIG1hcmdpbkJvdHRvbTogYmFzZVVuaXQgKiAyLFxuICAgICAgICBtYXJnaW5Ub3A6IGJhc2VVbml0ICogMixcbiAgICAgIH0pLFxufSk7XG5cbmV4cG9ydCBjb25zdCBJbmRpY2F0b3JTZXBhcmF0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHByb3BzOiBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgaW5uZXJQcm9wcyB9ID0gcHJvcHM7XG4gIHJldHVybiAoXG4gICAgPHNwYW5cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgICAgey4uLmdldFN0eWxlUHJvcHMocHJvcHMsICdpbmRpY2F0b3JTZXBhcmF0b3InLCB7XG4gICAgICAgICdpbmRpY2F0b3Itc2VwYXJhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgIC8+XG4gICk7XG59O1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIExvYWRpbmdcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBsb2FkaW5nRG90QW5pbWF0aW9ucyA9IGtleWZyYW1lc2BcbiAgMCUsIDgwJSwgMTAwJSB7IG9wYWNpdHk6IDA7IH1cbiAgNDAlIHsgb3BhY2l0eTogMTsgfVxuYDtcblxuZXhwb3J0IGNvbnN0IGxvYWRpbmdJbmRpY2F0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgc2l6ZSxcbiAgICB0aGVtZToge1xuICAgICAgY29sb3JzLFxuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgIH0sXG4gIH06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2xvYWRpbmdJbmRpY2F0b3InLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIGFsaWduU2VsZjogJ2NlbnRlcicsXG4gIGZvbnRTaXplOiBzaXplLFxuICBsaW5lSGVpZ2h0OiAxLFxuICBtYXJnaW5SaWdodDogc2l6ZSxcbiAgdGV4dEFsaWduOiAnY2VudGVyJyxcbiAgdmVydGljYWxBbGlnbjogJ21pZGRsZScsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5pbnRlcmZhY2UgTG9hZGluZ0RvdFByb3BzIHtcbiAgZGVsYXk6IG51bWJlcjtcbiAgb2Zmc2V0OiBib29sZWFuO1xufVxuY29uc3QgTG9hZGluZ0RvdCA9ICh7IGRlbGF5LCBvZmZzZXQgfTogTG9hZGluZ0RvdFByb3BzKSA9PiAoXG4gIDxzcGFuXG4gICAgY3NzPXt7XG4gICAgICBhbmltYXRpb246IGAke2xvYWRpbmdEb3RBbmltYXRpb25zfSAxcyBlYXNlLWluLW91dCAke2RlbGF5fW1zIGluZmluaXRlO2AsXG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6ICdjdXJyZW50Q29sb3InLFxuICAgICAgYm9yZGVyUmFkaXVzOiAnMWVtJyxcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgbWFyZ2luTGVmdDogb2Zmc2V0ID8gJzFlbScgOiB1bmRlZmluZWQsXG4gICAgICBoZWlnaHQ6ICcxZW0nLFxuICAgICAgdmVydGljYWxBbGlnbjogJ3RvcCcsXG4gICAgICB3aWR0aDogJzFlbScsXG4gICAgfX1cbiAgLz5cbik7XG5cbmV4cG9ydCBpbnRlcmZhY2UgTG9hZGluZ0luZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xuICAvKiogU2V0IHNpemUgb2YgdGhlIGNvbnRhaW5lci4gKi9cbiAgc2l6ZTogbnVtYmVyO1xufVxuZXhwb3J0IGNvbnN0IExvYWRpbmdJbmRpY2F0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oe1xuICBpbm5lclByb3BzLFxuICBpc1J0bCxcbiAgc2l6ZSA9IDQsXG4gIC4uLnJlc3RQcm9wc1xufTogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+KSA9PiB7XG4gIHJldHVybiAoXG4gICAgPGRpdlxuICAgICAgey4uLmdldFN0eWxlUHJvcHMoXG4gICAgICAgIHsgLi4ucmVzdFByb3BzLCBpbm5lclByb3BzLCBpc1J0bCwgc2l6ZSB9LFxuICAgICAgICAnbG9hZGluZ0luZGljYXRvcicsXG4gICAgICAgIHtcbiAgICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgICAgfVxuICAgICAgKX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXswfSBvZmZzZXQ9e2lzUnRsfSAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezE2MH0gb2Zmc2V0IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MzIwfSBvZmZzZXQ9eyFpc1J0bH0gLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG4iXX0= */`,toString:$D},tO=function(e){var t=e.size,n=gE(e,ZD);return(0,P.jsx)(`svg`,HT({height:t,width:t,viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,css:eO},n))},nO=function(e){return(0,P.jsx)(tO,HT({size:20},e),(0,P.jsx)(`path`,{d:`M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z`}))},rO=function(e){return(0,P.jsx)(tO,HT({size:20},e),(0,P.jsx)(`path`,{d:`M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z`}))},iO=function(e,t){var n=e.isFocused,r=e.theme,i=r.spacing.baseUnit,a=r.colors;return JT({label:`indicatorContainer`,display:`flex`,transition:`color 150ms`},t?{}:{color:n?a.neutral60:a.neutral20,padding:i*2,":hover":{color:n?a.neutral80:a.neutral40}})},aO=iO,oO=function(e){var t=e.children,n=e.innerProps;return(0,P.jsx)(`div`,HT({},iD(e,`dropdownIndicator`,{indicator:!0,"dropdown-indicator":!0}),n),t||(0,P.jsx)(rO,null))},sO=iO,cO=function(e){var t=e.children,n=e.innerProps;return(0,P.jsx)(`div`,HT({},iD(e,`clearIndicator`,{indicator:!0,"clear-indicator":!0}),n),t||(0,P.jsx)(nO,null))},lO=function(e,t){var n=e.isDisabled,r=e.theme,i=r.spacing.baseUnit,a=r.colors;return JT({label:`indicatorSeparator`,alignSelf:`stretch`,width:1},t?{}:{backgroundColor:n?a.neutral10:a.neutral20,marginBottom:i*2,marginTop:i*2})},uO=function(e){var t=e.innerProps;return(0,P.jsx)(`span`,HT({},t,iD(e,`indicatorSeparator`,{"indicator-separator":!0})))},dO=(0,P.keyframes)(XD||=_E([`
|
|
236
|
+
0%, 80%, 100% { opacity: 0; }
|
|
237
|
+
40% { opacity: 1; }
|
|
238
|
+
`])),fO=function(e,t){var n=e.isFocused,r=e.size,i=e.theme,a=i.colors,o=i.spacing.baseUnit;return JT({label:`loadingIndicator`,display:`flex`,transition:`color 150ms`,alignSelf:`center`,fontSize:r,lineHeight:1,marginRight:r,textAlign:`center`,verticalAlign:`middle`},t?{}:{color:n?a.neutral60:a.neutral20,padding:o*2})},pO=function(e){var t=e.delay,n=e.offset;return(0,P.jsx)(`span`,{css:(0,P.css)({animation:`${dO} 1s ease-in-out ${t}ms infinite;`,backgroundColor:`currentColor`,borderRadius:`1em`,display:`inline-block`,marginLeft:n?`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= */`)})},mO=function(e){var t=e.innerProps,n=e.isRtl,r=e.size,i=r===void 0?4:r,a=gE(e,QD);return(0,P.jsx)(`div`,HT({},iD(JT(JT({},a),{},{innerProps:t,isRtl:n,size:i}),`loadingIndicator`,{indicator:!0,"loading-indicator":!0}),t),(0,P.jsx)(pO,{delay:0,offset:n}),(0,P.jsx)(pO,{delay:160,offset:!0}),(0,P.jsx)(pO,{delay:320,offset:!n}))},hO=function(e,t){var n=e.isDisabled,r=e.isFocused,i=e.theme,a=i.colors,o=i.borderRadius,s=i.spacing;return JT({label:`control`,alignItems:`center`,cursor:`default`,display:`flex`,flexWrap:`wrap`,justifyContent:`space-between`,minHeight:s.controlHeight,outline:`0 !important`,position:`relative`,transition:`all 100ms`},t?{}:{backgroundColor:n?a.neutral5:a.neutral0,borderColor:n?a.neutral10:r?a.primary:a.neutral20,borderRadius:o,borderStyle:`solid`,borderWidth:1,boxShadow:r?`0 0 0 1px ${a.primary}`:void 0,"&:hover":{borderColor:r?a.primary:a.neutral30}})},gO=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,i=e.innerRef,a=e.innerProps,o=e.menuIsOpen;return(0,P.jsx)(`div`,HT({ref:i},iD(e,`control`,{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":o}),a,{"aria-disabled":n||void 0}),t)},_O=[`data`],vO=function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},yO=function(e){var t=e.children,n=e.cx,r=e.getStyles,i=e.getClassNames,a=e.Heading,o=e.headingProps,s=e.innerProps,c=e.label,l=e.theme,u=e.selectProps;return(0,P.jsx)(`div`,HT({},iD(e,`group`,{group:!0}),s),(0,P.jsx)(a,HT({},o,{selectProps:u,theme:l,getStyles:r,getClassNames:i,cx:n}),c),(0,P.jsx)(`div`,null,t))},bO=function(e,t){var n=e.theme,r=n.colors,i=n.spacing;return JT({label:`group`,cursor:`default`,display:`block`},t?{}:{color:r.neutral40,fontSize:`75%`,fontWeight:500,marginBottom:`0.25em`,paddingLeft:i.baseUnit*3,paddingRight:i.baseUnit*3,textTransform:`uppercase`})},xO=function(e){var t=rD(e);t.data;var n=gE(t,_O);return(0,P.jsx)(`div`,HT({},iD(e,`groupHeading`,{"group-heading":!0}),n))},SO=yO,CO=[`innerRef`,`isDisabled`,`isHidden`,`inputClassName`],wO=function(e,t){var n=e.isDisabled,r=e.value,i=e.theme,a=i.spacing,o=i.colors;return JT(JT({visibility:n?`hidden`:`visible`,transform:r?`translateZ(0)`:``},EO),t?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:o.neutral80})},TO={gridArea:`1 / 2`,font:`inherit`,minWidth:`2px`,border:0,margin:0,outline:0,padding:0},EO={flex:`1 1 auto`,display:`inline-grid`,gridArea:`1 / 1 / 2 / 3`,gridTemplateColumns:`0 min-content`,"&:after":JT({content:`attr(data-value) " "`,visibility:`hidden`,whiteSpace:`pre`},TO)},DO=function(e){return JT({label:`input`,color:`inherit`,background:0,opacity:+!e,width:`100%`},TO)},OO=function(e){var t=e.cx,n=e.value,r=rD(e),i=r.innerRef,a=r.isDisabled,o=r.isHidden,s=r.inputClassName,c=gE(r,CO);return(0,P.jsx)(`div`,HT({},iD(e,`input`,{"input-container":!0}),{"data-value":n||``}),(0,P.jsx)(`input`,HT({className:t({input:!0},s),ref:i,style:DO(o),disabled:a},c)))},kO=function(e,t){var n=e.theme,r=n.spacing,i=n.borderRadius,a=n.colors;return JT({label:`multiValue`,display:`flex`,minWidth:0},t?{}:{backgroundColor:a.neutral10,borderRadius:i/2,margin:r.baseUnit/2})},AO=function(e,t){var n=e.theme,r=n.borderRadius,i=n.colors,a=e.cropWithEllipsis;return JT({overflow:`hidden`,textOverflow:a||a===void 0?`ellipsis`:void 0,whiteSpace:`nowrap`},t?{}:{borderRadius:r/2,color:i.neutral80,fontSize:`85%`,padding:3,paddingLeft:6})},jO=function(e,t){var n=e.theme,r=n.spacing,i=n.borderRadius,a=n.colors,o=e.isFocused;return JT({alignItems:`center`,display:`flex`},t?{}:{borderRadius:i/2,backgroundColor:o?a.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},MO=function(e){var t=e.children,n=e.innerProps;return(0,P.jsx)(`div`,n,t)},NO=MO,PO=MO;function FO(e){var t=e.children,n=e.innerProps;return(0,P.jsx)(`div`,HT({role:`button`},n),t||(0,P.jsx)(nO,{size:14}))}var IO=function(e){var t=e.children,n=e.components,r=e.data,i=e.innerProps,a=e.isDisabled,o=e.removeProps,s=e.selectProps,c=n.Container,l=n.Label,u=n.Remove;return(0,P.jsx)(c,{data:r,innerProps:JT(JT({},iD(e,`multiValue`,{"multi-value":!0,"multi-value--is-disabled":a})),i),selectProps:s},(0,P.jsx)(l,{data:r,innerProps:JT({},iD(e,`multiValueLabel`,{"multi-value__label":!0})),selectProps:s},t),(0,P.jsx)(u,{data:r,innerProps:JT(JT({},iD(e,`multiValueRemove`,{"multi-value__remove":!0})),{},{"aria-label":`Remove ${t||`option`}`},o),selectProps:s}))},LO=function(e,t){var n=e.isDisabled,r=e.isFocused,i=e.isSelected,a=e.theme,o=a.spacing,s=a.colors;return JT({label:`option`,cursor:`default`,display:`block`,fontSize:`inherit`,width:`100%`,userSelect:`none`,WebkitTapHighlightColor:`rgba(0, 0, 0, 0)`},t?{}:{backgroundColor:i?s.primary:r?s.primary25:`transparent`,color:n?s.neutral20:i?s.neutral0:`inherit`,padding:`${o.baseUnit*2}px ${o.baseUnit*3}px`,":active":{backgroundColor:n?void 0:i?s.primary:s.primary50}})},RO=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,i=e.isSelected,a=e.innerRef,o=e.innerProps;return(0,P.jsx)(`div`,HT({},iD(e,`option`,{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":i}),{ref:a,"aria-disabled":n},o),t)},zO=function(e,t){var n=e.theme,r=n.spacing,i=n.colors;return JT({label:`placeholder`,gridArea:`1 / 1 / 2 / 3`},t?{}:{color:i.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},BO=function(e){var t=e.children,n=e.innerProps;return(0,P.jsx)(`div`,HT({},iD(e,`placeholder`,{placeholder:!0}),n),t)},VO=function(e,t){var n=e.isDisabled,r=e.theme,i=r.spacing,a=r.colors;return JT({label:`singleValue`,gridArea:`1 / 1 / 2 / 3`,maxWidth:`100%`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},t?{}:{color:n?a.neutral40:a.neutral80,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},HO={ClearIndicator:cO,Control:gO,DropdownIndicator:oO,DownChevron:rO,CrossIcon:nO,Group:SO,GroupHeading:xO,IndicatorsContainer:YD,IndicatorSeparator:uO,Input:OO,LoadingIndicator:mO,Menu:PD,MenuList:ID,MenuPortal:UD,LoadingMessage:VD,NoOptionsMessage:BD,MultiValue:IO,MultiValueContainer:NO,MultiValueLabel:PO,MultiValueRemove:FO,Option:RO,Placeholder:BO,SelectContainer:GD,SingleValue:function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return(0,P.jsx)(`div`,HT({},iD(e,`singleValue`,{"single-value":!0,"single-value--is-disabled":n}),r),t)},ValueContainer:qD},UO=function(e){return JT(JT({},HO),e.components)},WO=Number.isNaN||function(e){return typeof e==`number`&&e!==e};function GO(e,t){return!!(e===t||WO(e)&&WO(t))}function KO(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!GO(e[n],t[n]))return!1;return!0}function qO(e,t){t===void 0&&(t=KO);var n=null;function r(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var a=e.apply(this,r);return n={lastResult:a,lastArgs:r,lastThis:this},a}return r.clear=function(){n=null},r}function JO(){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)."}for(var YO=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:JO},XO=function(e){return(0,P.jsx)(`span`,HT({css:YO},e))},ZO={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,i=e.context,a=e.isInitialFocus;switch(i){case`menu`:return`Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu${r?`, press Tab to select the option and exit the menu`:``}.`;case`input`:return a?`${e[`aria-label`]||`Select`} is focused ${t?`,type to refine list`:``}, press Down to open the menu, ${n?` 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,n=e.label,r=n===void 0?``:n,i=e.labels,a=e.isDisabled;switch(t){case`deselect-option`:case`pop-value`:case`remove-value`:return`option ${r}, deselected.`;case`clear`:return`All selected options have been cleared.`;case`initial-input-focus`:return`option${i.length>1?`s`:``} ${i.join(`,`)}, selected.`;case`select-option`:return a?`option ${r} is disabled. Select another option.`:`option ${r}, selected.`;default:return``}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,i=e.label,a=i===void 0?``:i,o=e.selectValue,s=e.isDisabled,c=e.isSelected,l=e.isAppleDevice,u=function(e,t){return e&&e.length?`${e.indexOf(t)+1} of ${e.length}`:``};return t===`value`&&o?`value ${a} focused, ${u(o,n)}.`:t===`menu`&&l?`${a}${`${c?` selected`:``}${s?` disabled`:``}`}, ${u(r,n)}.`:``},onFilter:function(e){var t=e.inputValue;return`${e.resultsMessage}${t?` for search term `+t:``}.`}},QO=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,i=e.focusableOptions,a=e.isFocused,o=e.selectValue,s=e.selectProps,c=e.id,l=e.isAppleDevice,d=s.ariaLiveMessages,f=s.getOptionLabel,p=s.inputValue,m=s.isMulti,h=s.isOptionDisabled,g=s.isSearchable,_=s.menuIsOpen,v=s.options,y=s.screenReaderStatus,b=s.tabSelectsValue,x=s.isLoading,S=s[`aria-label`],C=s[`aria-live`],w=(0,u.useMemo)(function(){return JT(JT({},ZO),d||{})},[d]),T=(0,u.useMemo)(function(){var e=``;if(t&&w.onChange){var n=t.option,r=t.options,i=t.removedValue,a=t.removedValues,s=t.value,c=i||n||function(e){return Array.isArray(e)?null:e}(s),l=c?f(c):``,u=r||a||void 0,d=u?u.map(f):[],p=JT({isDisabled:c&&h(c,o),label:l,labels:d},t);e=w.onChange(p)}return e},[t,w,h,o,f]),E=(0,u.useMemo)(function(){var e=``,t=n||r,a=!!(n&&o&&o.includes(n));if(t&&w.onFocus){var s={focused:t,label:f(t),isDisabled:h(t,o),isSelected:a,options:i,context:t===n?`menu`:`value`,selectValue:o,isAppleDevice:l};e=w.onFocus(s)}return e},[n,r,f,h,w,i,o,l]),D=(0,u.useMemo)(function(){var e=``;if(_&&v.length&&!x&&w.onFilter){var t=y({count:i.length});e=w.onFilter({inputValue:p,resultsMessage:t})}return e},[i,p,_,w,v,y,x]),O=t?.action===`initial-input-focus`,k=(0,u.useMemo)(function(){var e=``;if(w.guidance){var t=r?`value`:_?`menu`:`input`;e=w.guidance({"aria-label":S,context:t,isDisabled:n&&h(n,o),isMulti:m,isSearchable:g,tabSelectsValue:b,isInitialFocus:O})}return e},[S,n,r,m,h,g,_,w,o,b,O]),A=(0,P.jsx)(u.Fragment,null,(0,P.jsx)(`span`,{id:`aria-selection`},T),(0,P.jsx)(`span`,{id:`aria-focused`},E),(0,P.jsx)(`span`,{id:`aria-results`},D),(0,P.jsx)(`span`,{id:`aria-guidance`},k));return(0,P.jsx)(u.Fragment,null,(0,P.jsx)(XO,{id:c},O&&A),(0,P.jsx)(XO,{"aria-live":C,"aria-atomic":`false`,"aria-relevant":`additions text`,role:`log`},a&&!O&&A))},$O=[{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źẑżžẓẕƶȥɀⱬꝣ`}],ek=RegExp(`[`+$O.map(function(e){return e.letters}).join(``)+`]`,`g`),tk={},nk=0;nk<$O.length;nk++)for(var rk=$O[nk],ik=0;ik<rk.letters.length;ik++)tk[rk.letters[ik]]=rk.base;var ak=function(e){return e.replace(ek,function(e){return tk[e]})},ok=qO(ak),sk=function(e){return e.replace(/^\s+|\s+$/g,``)},ck=function(e){return`${e.label} ${e.value}`},lk=function(e){return function(t,n){if(t.data.__isNew__)return!0;var r=JT({ignoreCase:!0,ignoreAccents:!0,stringify:ck,trim:!0,matchFrom:`any`},e),i=r.ignoreCase,a=r.ignoreAccents,o=r.stringify,s=r.trim,c=r.matchFrom,l=s?sk(n):n,u=s?sk(o(t)):o(t);return i&&(l=l.toLowerCase(),u=u.toLowerCase()),a&&(l=ok(l),u=ak(u)),c===`start`?u.substr(0,l.length)===l:u.indexOf(l)>-1}},uk=[`innerRef`];function dk(e){var t=e.innerRef,n=TD(gE(e,uk),`onExited`,`in`,`enter`,`exit`,`appear`);return(0,P.jsx)(`input`,HT({ref:t},n,{css:(0,P.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 fk=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function pk(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,a=e.onTopLeave,o=(0,u.useRef)(!1),s=(0,u.useRef)(!1),c=(0,u.useRef)(0),l=(0,u.useRef)(null),d=(0,u.useCallback)(function(e,t){if(l.current!==null){var c=l.current,u=c.scrollTop,d=c.scrollHeight,f=c.clientHeight,p=l.current,m=t>0,h=d-f-u,g=!1;h>t&&o.current&&(r&&r(e),o.current=!1),m&&s.current&&(a&&a(e),s.current=!1),m&&t>h?(n&&!o.current&&n(e),p.scrollTop=d,g=!0,o.current=!0):!m&&-t>u&&(i&&!s.current&&i(e),p.scrollTop=0,g=!0,s.current=!0),g&&fk(e)}},[n,r,i,a]),f=(0,u.useCallback)(function(e){d(e,e.deltaY)},[d]),p=(0,u.useCallback)(function(e){c.current=e.changedTouches[0].clientY},[]),m=(0,u.useCallback)(function(e){d(e,c.current-e.changedTouches[0].clientY)},[d]),h=(0,u.useCallback)(function(e){if(e){var t=yD?{passive:!1}:!1;e.addEventListener(`wheel`,f,t),e.addEventListener(`touchstart`,p,t),e.addEventListener(`touchmove`,m,t)}},[m,p,f]),g=(0,u.useCallback)(function(e){e&&(e.removeEventListener(`wheel`,f,!1),e.removeEventListener(`touchstart`,p,!1),e.removeEventListener(`touchmove`,m,!1))},[m,p,f]);return(0,u.useEffect)(function(){if(t){var e=l.current;return h(e),function(){g(e)}}},[t,h,g]),function(e){l.current=e}}var mk=[`boxSizing`,`height`,`overflow`,`paddingRight`,`position`],hk={boxSizing:`border-box`,overflow:`hidden`,position:`relative`,height:`100%`};function gk(e){e.cancelable&&e.preventDefault()}function _k(e){e.stopPropagation()}function vk(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function yk(){return`ontouchstart`in window||navigator.maxTouchPoints}var bk=!!(typeof window<`u`&&window.document&&window.document.createElement),xk=0,Sk={capture:!1,passive:!1};function Ck(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0||n,i=(0,u.useRef)({}),a=(0,u.useRef)(null),o=(0,u.useCallback)(function(e){if(bk){var t=document.body,n=t&&t.style;if(r&&mk.forEach(function(e){var t=n&&n[e];i.current[e]=t}),r&&xk<1){var a=parseInt(i.current.paddingRight,10)||0,o=document.body?document.body.clientWidth:0,s=window.innerWidth-o+a||0;Object.keys(hk).forEach(function(e){var t=hk[e];n&&(n[e]=t)}),n&&(n.paddingRight=`${s}px`)}t&&yk()&&(t.addEventListener(`touchmove`,gk,Sk),e&&(e.addEventListener(`touchstart`,vk,Sk),e.addEventListener(`touchmove`,_k,Sk))),xk+=1}},[r]),s=(0,u.useCallback)(function(e){if(bk){var t=document.body,n=t&&t.style;xk=Math.max(xk-1,0),r&&xk<1&&mk.forEach(function(e){var t=i.current[e];n&&(n[e]=t)}),t&&yk()&&(t.removeEventListener(`touchmove`,gk,Sk),e&&(e.removeEventListener(`touchstart`,vk,Sk),e.removeEventListener(`touchmove`,_k,Sk)))}},[r]);return(0,u.useEffect)(function(){if(t){var e=a.current;return o(e),function(){s(e)}}},[t,o,s]),function(e){a.current=e}}function wk(){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 Tk=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Ek=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:wk};function Dk(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0||r,a=e.onBottomArrive,o=e.onBottomLeave,s=e.onTopArrive,c=e.onTopLeave,l=pk({isEnabled:i,onBottomArrive:a,onBottomLeave:o,onTopArrive:s,onTopLeave:c}),d=Ck({isEnabled:n});return(0,P.jsx)(u.Fragment,null,n&&(0,P.jsx)(`div`,{onClick:Tk,css:Ek}),t(function(e){l(e),d(e)}))}function Ok(){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 kk=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:Ok},Ak=function(e){var t=e.name,n=e.onFocus;return(0,P.jsx)(`input`,{required:!0,name:t,tabIndex:-1,"aria-hidden":`true`,onFocus:n,css:kk,value:``,onChange:function(){}})};function jk(e){return typeof window<`u`&&window.navigator!=null&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function Mk(){return jk(/^iPhone/i)}function Nk(){return jk(/^Mac/i)}function Pk(){return jk(/^iPad/i)||Nk()&&navigator.maxTouchPoints>1}function Fk(){return Mk()||Pk()}function Ik(){return Nk()||Fk()}var Lk=function(e){return e.label},Rk=function(e){return e.label},zk=function(e){return e.value},Bk=function(e){return!!e.isDisabled},Vk={clearIndicator:sO,container:WD,control:hO,dropdownIndicator:aO,group:vO,groupHeading:bO,indicatorsContainer:JD,indicatorSeparator:lO,input:wO,loadingIndicator:fO,loadingMessage:zD,menu:jD,menuList:FD,menuPortal:HD,multiValue:kO,multiValueLabel:AO,multiValueRemove:jO,noOptionsMessage:RD,option:LO,placeholder:zO,singleValue:VO,valueContainer:KD},Hk={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%)`},Uk=4,Wk=4,Gk={borderRadius:Uk,colors:Hk,spacing:{baseUnit:Wk,controlHeight:38,menuGutter:Wk*2}},Kk={"aria-live":`polite`,backspaceRemovesValue:!0,blurInputOnSelect:mD(),captureMenuScroll:!mD(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:lk(),formatGroupLabel:Lk,getOptionLabel:Rk,getOptionValue:zk,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Bk,loadingMessage:function(){return`Loading...`},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:`bottom`,menuPosition:`absolute`,menuShouldBlockScroll:!1,menuShouldScrollIntoView:!hD(),noOptionsMessage:function(){return`No options`},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:`Select...`,screenReaderStatus:function(e){var t=e.count;return`${t} result${t===1?``:`s`} available`},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function qk(e,t,n,r){return{type:`option`,data:t,isDisabled:iA(e,t,n),isSelected:aA(e,t,n),label:nA(e,t),value:rA(e,t),index:r}}function Jk(e,t){return e.options.map(function(n,r){if(`options`in n){var i=n.options.map(function(n,r){return qk(e,n,t,r)}).filter(function(t){return Qk(e,t)});return i.length>0?{type:`group`,data:n,options:i,index:r}:void 0}var a=qk(e,n,t,r);return Qk(e,a)?a:void 0}).filter(bD)}function Yk(e){return e.reduce(function(e,t){return t.type===`group`?e.push.apply(e,uE(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function Xk(e,t){return e.reduce(function(e,n){return n.type===`group`?e.push.apply(e,uE(n.options.map(function(e){return{data:e.data,id:`${t}-${n.index}-${e.index}`}}))):e.push({data:n.data,id:`${t}-${n.index}`}),e},[])}function Zk(e,t){return Yk(Jk(e,t))}function Qk(e,t){var n=e.inputValue,r=n===void 0?``:n,i=t.data,a=t.isSelected,o=t.label,s=t.value;return(!sA(e)||!a)&&oA(e,{label:o,value:s,data:i},r)}function $k(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r<t.length)return t[r]}return null}function eA(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var tA=function(e,t){return e.find(function(e){return e.data===t})?.id||null},nA=function(e,t){return e.getOptionLabel(t)},rA=function(e,t){return e.getOptionValue(t)};function iA(e,t,n){return typeof e.isOptionDisabled==`function`&&e.isOptionDisabled(t,n)}function aA(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected==`function`)return e.isOptionSelected(t,n);var r=rA(e,t);return n.some(function(t){return rA(e,t)===r})}function oA(e,t,n){return!e.filterOption||e.filterOption(t,n)}var sA=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return t===void 0?n:t},cA=1,lA=function(e){$T(n,e);var t=iE(n);function n(e){var r;if(YT(this,n),r=t.call(this,e),r.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},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,i=n.onChange;t.name=n.name,r.ariaOnChange(e,t),i(e,t)},r.setValue=function(e,t,n){var i=r.props,a=i.closeMenuOnSelect,o=i.isMulti,s=i.inputValue;r.onInputChange(``,{action:`set-value`,prevInputValue:s}),a&&(r.setState({inputIsHiddenAfterUpdate:!o}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,i=t.isMulti,a=t.name,o=r.state.selectValue,s=i&&r.isOptionSelected(e,o),c=r.isOptionDisabled(e,o);if(s){var l=r.getOptionValue(e);r.setValue(wD(o.filter(function(e){return r.getOptionValue(e)!==l})),`deselect-option`,e)}else if(!c)i?r.setValue(wD([].concat(uE(o),[e])),`select-option`,e):r.setValue(CD(e),`select-option`);else{r.ariaOnChange(CD(e),{action:`select-option`,option:e,name:a});return}n&&r.blurInput()},r.removeValue=function(e){var t=r.props.isMulti,n=r.state.selectValue,i=r.getOptionValue(e),a=n.filter(function(e){return r.getOptionValue(e)!==i}),o=SD(t,a,a[0]||null);r.onChange(o,{action:`remove-value`,removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(SD(r.props.isMulti,[],null),{action:`clear`,removedValues:e})},r.popValue=function(){var e=r.props.isMulti,t=r.state.selectValue,n=t[t.length-1],i=t.slice(0,t.length-1),a=SD(e,i,i[0]||null);n&&r.onChange(a,{action:`pop-value`,removedValue:n})},r.getFocusedOptionId=function(e){return tA(r.state.focusableOptionsWithIds,e)},r.getFocusableOptionsWithIds=function(){return Xk(Jk(r.props,r.state.selectValue),r.getElementId(`option`))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return tD.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return nA(r.props,e)},r.getOptionValue=function(e){return rA(r.props,e)},r.getStyles=function(e,t){var n=r.props.unstyled,i=Vk[e](t,n);i.boxSizing=`border-box`;var a=r.props.styles[e];return a?a(i,t):i},r.getClassNames=function(e,t){var n;return(n=r.props.classNames)[e]?.call(n,t)},r.getElementId=function(e){return`${r.state.instancePrefix}-${e}`},r.getComponents=function(){return UO(r.props)},r.buildCategorizedOptions=function(){return Jk(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Yk(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(e,t){r.setState({ariaSelection:JT({value:e},t)})},r.onMenuMouseDown=function(e){e.button===0&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?e.target.tagName!==`INPUT`&&e.target.tagName!==`TEXTAREA`&&r.onMenuClose():t&&r.openMenu(`first`):(t&&(r.openAfterFocus=!0),r.focusInput()),e.target.tagName!==`INPUT`&&e.target.tagName!==`TEXTAREA`&&e.preventDefault()}},r.onDropdownIndicatorMouseDown=function(e){if(!(e&&e.type===`mousedown`&&e.button!==0)&&!r.props.isDisabled){var t=r.props,n=t.isMulti,i=t.menuIsOpen;r.focusInput(),i?(r.setState({inputIsHiddenAfterUpdate:!n}),r.onMenuClose()):r.openMenu(`first`),e.preventDefault()}},r.onClearIndicatorMouseDown=function(e){e&&e.type===`mousedown`&&e.button!==0||(r.clearValue(),e.preventDefault(),r.openAfterFocus=!1,e.type===`touchend`?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(e){typeof r.props.closeMenuOnScroll==`boolean`?e.target instanceof HTMLElement&&aD(e.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll==`function`&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var i=Math.abs(n.clientX-r.initialTouchX),a=Math.abs(n.clientY-r.initialTouchY),o=5;r.userIsDragging=i>o||a>o}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=r.props.inputValue,n=e.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(n,{action:`input-change`,prevInputValue:t}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu(`first`),r.openAfterFocus=!1},r.onInputBlur=function(e){var t=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(e),r.onInputChange(``,{action:`input-blur`,prevInputValue:t}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(e){if(!(r.blockOptionHover||r.state.focusedOption===e)){var t=r.getFocusableOptions().indexOf(e);r.setState({focusedOption:e,focusedOptionId:t>-1?r.getFocusedOptionId(e):null})}},r.shouldHideSelectedOptions=function(){return sA(r.props)},r.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),r.focus()},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,i=t.backspaceRemovesValue,a=t.escapeClearsValue,o=t.inputValue,s=t.isClearable,c=t.isDisabled,l=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,f=t.openMenuOnFocus,p=r.state,m=p.focusedOption,h=p.focusedValue,g=p.selectValue;if(!c&&!(typeof u==`function`&&(u(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case`ArrowLeft`:if(!n||o)return;r.focusValue(`previous`);break;case`ArrowRight`:if(!n||o)return;r.focusValue(`next`);break;case`Delete`:case`Backspace`:if(o)return;if(h)r.removeValue(h);else{if(!i)return;n?r.popValue():s&&r.clearValue()}break;case`Tab`:if(r.isComposing||e.shiftKey||!l||!d||!m||f&&r.isOptionSelected(m,g))return;r.selectOption(m);break;case`Enter`:if(e.keyCode===229)break;if(l){if(!m||r.isComposing)return;r.selectOption(m);break}return;case`Escape`:l?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(``,{action:`menu-close`,prevInputValue:o}),r.onMenuClose()):s&&a&&r.clearValue();break;case` `:if(o)return;if(!l){r.openMenu(`first`);break}if(!m)return;r.selectOption(m);break;case`ArrowUp`:l?r.focusOption(`up`):r.openMenu(`last`);break;case`ArrowDown`:l?r.focusOption(`down`):r.openMenu(`first`);break;case`PageUp`:if(!l)return;r.focusOption(`pageup`);break;case`PageDown`:if(!l)return;r.focusOption(`pagedown`);break;case`Home`:if(!l)return;r.focusOption(`first`);break;case`End`:if(!l)return;r.focusOption(`last`);break;default:return}e.preventDefault()}},r.state.instancePrefix=`react-select-`+(r.props.instanceId||++cA),r.state.selectValue=nD(e.value),e.menuIsOpen&&r.state.selectValue.length){var i=r.getFocusableOptionsWithIds(),a=r.buildFocusableOptions(),o=a.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=i,r.state.focusedOption=a[o],r.state.focusedOptionId=tA(i,a[o])}return r}return ZT(n,[{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&&fD(this.menuListRef,this.focusedOptionRef),Ik()&&this.setState({isAppleDevice:!0})}},{key:`componentDidUpdate`,value:function(e){var t=this.props,n=t.isDisabled,r=t.menuIsOpen,i=this.state.isFocused;(i&&!n&&e.isDisabled||i&&r&&!e.menuIsOpen)&&this.focusInput(),i&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!i&&!n&&e.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(fD(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(e,t){this.props.onInputChange(e,t)}},{key:`focusInput`,value:function(){this.inputRef&&this.inputRef.focus()}},{key:`blurInput`,value:function(){this.inputRef&&this.inputRef.blur()}},{key:`openMenu`,value:function(e){var t=this,n=this.state,r=n.selectValue,i=n.isFocused,a=this.buildFocusableOptions(),o=e===`first`?0:a.length-1;if(!this.props.isMulti){var s=a.indexOf(r[0]);s>-1&&(o=s)}this.scrollToFocusedOptionOnUpdate=!(i&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:a[o],focusedOptionId:this.getFocusedOptionId(a[o])},function(){return t.onMenuOpen()})}},{key:`focusValue`,value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var i=n.indexOf(r);r||(i=-1);var a=n.length-1,o=-1;if(n.length){switch(e){case`previous`:o=i===0?0:i===-1?a:i-1;break;case`next`:i>-1&&i<a&&(o=i+1)}this.setState({inputIsHidden:o!==-1,focusedValue:n[o]})}}}},{key:`focusOption`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:`first`,t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var i=0,a=r.indexOf(n);n||(a=-1),e===`up`?i=a>0?a-1:r.length-1:e===`down`?i=(a+1)%r.length:e===`pageup`?(i=a-t,i<0&&(i=0)):e===`pagedown`?(i=a+t,i>r.length-1&&(i=r.length-1)):e===`last`&&(i=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[i],focusedValue:null,focusedOptionId:this.getFocusedOptionId(r[i])})}}},{key:`getTheme`,value:function(){return this.props.theme?typeof this.props.theme==`function`?this.props.theme(Gk):JT(JT({},Gk),this.props.theme):Gk}},{key:`getCommonProps`,value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getClassNames,i=this.getValue,a=this.selectOption,o=this.setValue,s=this.props,c=s.isMulti,l=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:r,getValue:i,hasValue:this.hasValue(),isMulti:c,isRtl:l,options:u,selectOption:a,selectProps:s,setValue:o,theme:this.getTheme()}}},{key:`hasValue`,value:function(){return this.state.selectValue.length>0}},{key:`hasOptions`,value:function(){return!!this.getFocusableOptions().length}},{key:`isClearable`,value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return t===void 0?n:t}},{key:`isOptionDisabled`,value:function(e,t){return iA(this.props,e,t)}},{key:`isOptionSelected`,value:function(e,t){return aA(this.props,e,t)}},{key:`filterOption`,value:function(e,t){return oA(this.props,e,t)}},{key:`formatOptionLabel`,value:function(e,t){if(typeof this.props.formatOptionLabel==`function`){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:`formatGroupLabel`,value:function(e){return this.props.formatGroupLabel(e)}},{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 e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,i=e.inputValue,a=e.tabIndex,o=e.form,s=e.menuIsOpen,c=e.required,l=this.getComponents().Input,d=this.state,f=d.inputIsHidden,p=d.ariaSelection,m=this.commonProps,h=r||this.getElementId(`input`),g=JT(JT(JT({"aria-autocomplete":`list`,"aria-expanded":s,"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":c,role:`combobox`,"aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||``},s&&{"aria-controls":this.getElementId(`listbox`)}),!n&&{"aria-readonly":!0}),this.hasValue()?p?.action===`initial-input-focus`&&{"aria-describedby":this.getElementId(`live-region`)}:{"aria-describedby":this.getElementId(`placeholder`)});return n?u.createElement(l,HT({},m,{autoCapitalize:`none`,autoComplete:`off`,autoCorrect:`off`,id:h,innerRef:this.getInputRef,isDisabled:t,isHidden:f,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:`false`,tabIndex:a,form:o,type:`text`,value:i},g)):u.createElement(dk,HT({id:h,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:$E,onFocus:this.onInputFocus,disabled:t,tabIndex:a,inputMode:`none`,form:o,value:``},g))}},{key:`renderPlaceholderOrValue`,value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,i=t.MultiValueLabel,a=t.MultiValueRemove,o=t.SingleValue,s=t.Placeholder,c=this.commonProps,l=this.props,d=l.controlShouldRenderValue,f=l.isDisabled,p=l.isMulti,m=l.inputValue,h=l.placeholder,g=this.state,_=g.selectValue,v=g.focusedValue,y=g.isFocused;if(!this.hasValue()||!d)return m?null:u.createElement(s,HT({},c,{key:`placeholder`,isDisabled:f,isFocused:y,innerProps:{id:this.getElementId(`placeholder`)}}),h);if(p)return _.map(function(t,o){var s=t===v,l=`${e.getOptionLabel(t)}-${e.getOptionValue(t)}`;return u.createElement(n,HT({},c,{components:{Container:r,Label:i,Remove:a},isFocused:s,isDisabled:f,key:l,index:o,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,`value`))});if(m)return null;var b=_[0];return u.createElement(o,HT({},c,{data:b,isDisabled:f}),this.formatOptionLabel(b,`value`))}},{key:`renderClearIndicator`,value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,a=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||i)return null;var o={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":`true`};return u.createElement(e,HT({},t,{innerProps:o,isFocused:a}))}},{key:`renderLoadingIndicator`,value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,a=this.state.isFocused;return!e||!i?null:u.createElement(e,HT({},t,{innerProps:{"aria-hidden":`true`},isDisabled:r,isFocused:a}))}},{key:`renderIndicatorSeparator`,value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,i=this.props.isDisabled,a=this.state.isFocused;return u.createElement(n,HT({},r,{isDisabled:i,isFocused:a}))}},{key:`renderDropdownIndicator`,value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":`true`};return u.createElement(e,HT({},t,{innerProps:i,isDisabled:n,isFocused:r}))}},{key:`renderMenu`,value:function(){var e=this,t=this.getComponents(),n=t.Group,r=t.GroupHeading,i=t.Menu,a=t.MenuList,o=t.MenuPortal,s=t.LoadingMessage,c=t.NoOptionsMessage,l=t.Option,d=this.commonProps,f=this.state.focusedOption,p=this.props,m=p.captureMenuScroll,h=p.inputValue,g=p.isLoading,_=p.loadingMessage,v=p.minMenuHeight,y=p.maxMenuHeight,b=p.menuIsOpen,x=p.menuPlacement,S=p.menuPosition,C=p.menuPortalTarget,w=p.menuShouldBlockScroll,T=p.menuShouldScrollIntoView,E=p.noOptionsMessage,D=p.onMenuScrollToTop,O=p.onMenuScrollToBottom;if(!b)return null;var k=function(t,n){var r=t.type,i=t.data,a=t.isDisabled,o=t.isSelected,s=t.label,c=t.value,p=f===i,m=a?void 0:function(){return e.onOptionHover(i)},h=a?void 0:function(){return e.selectOption(i)},g=`${e.getElementId(`option`)}-${n}`,_={id:g,onClick:h,onMouseMove:m,onMouseOver:m,tabIndex:-1,role:`option`,"aria-selected":e.state.isAppleDevice?void 0:o};return u.createElement(l,HT({},d,{innerProps:_,data:i,isDisabled:a,isSelected:o,key:g,label:s,type:r,value:c,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,`menu`))},A;if(this.hasOptions())A=this.getCategorizedOptions().map(function(t){if(t.type===`group`){var i=t.data,a=t.options,o=t.index,s=`${e.getElementId(`group`)}-${o}`,c=`${s}-heading`;return u.createElement(n,HT({},d,{key:s,data:i,options:a,Heading:r,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return k(e,`${o}-${e.index}`)}))}if(t.type===`option`)return k(t,`${t.index}`)});else if(g){var j=_({inputValue:h});if(j===null)return null;A=u.createElement(s,d,j)}else{var M=E({inputValue:h});if(M===null)return null;A=u.createElement(c,d,M)}var ee={minMenuHeight:v,maxMenuHeight:y,menuPlacement:x,menuPosition:S,menuShouldScrollIntoView:T},N=u.createElement(ND,HT({},d,ee),function(t){var n=t.ref,r=t.placerProps,o=r.placement,s=r.maxHeight;return u.createElement(i,HT({},d,ee,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:o}),u.createElement(Dk,{captureEnabled:m,onTopArrive:D,onBottomArrive:O,lockEnabled:w},function(t){return u.createElement(a,HT({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:`listbox`,"aria-multiselectable":d.isMulti,id:e.getElementId(`listbox`)},isLoading:g,maxHeight:s,focusedOption:f}),A)}))});return C||S===`fixed`?u.createElement(o,HT({},d,{appendTo:C,controlElement:this.controlRef,menuPlacement:x,menuPosition:S}),N):N}},{key:`renderFormField`,value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,i=t.isMulti,a=t.name,o=t.required,s=this.state.selectValue;if(o&&!this.hasValue()&&!r)return u.createElement(Ak,{name:a,onFocus:this.onValueInputFocus});if(!(!a||r)){if(i){if(n){var c=s.map(function(t){return e.getOptionValue(t)}).join(n);return u.createElement(`input`,{name:a,type:`hidden`,value:c})}var l=s.length>0?s.map(function(t,n){return u.createElement(`input`,{key:`i-${n}`,name:a,type:`hidden`,value:e.getOptionValue(t)})}):u.createElement(`input`,{name:a,type:`hidden`,value:``});return u.createElement(`div`,null,l)}var d=s[0]?this.getOptionValue(s[0]):``;return u.createElement(`input`,{name:a,type:`hidden`,value:d})}}},{key:`renderLiveRegion`,value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,a=t.isFocused,o=t.selectValue,s=this.getFocusableOptions();return u.createElement(QO,HT({},e,{id:this.getElementId(`live-region`),ariaSelection:n,focusedOption:r,focusedValue:i,isFocused:a,selectValue:o,focusableOptions:s,isAppleDevice:this.state.isAppleDevice}))}},{key:`render`,value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,i=e.ValueContainer,a=this.props,o=a.className,s=a.id,c=a.isDisabled,l=a.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return u.createElement(r,HT({},f,{className:o,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),u.createElement(t,HT({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:l}),u.createElement(i,HT({},f,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),u.createElement(n,HT({},f,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:`getDerivedStateFromProps`,value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,i=t.inputIsHiddenAfterUpdate,a=t.ariaSelection,o=t.isFocused,s=t.prevWasFocused,c=t.instancePrefix,l=e.options,u=e.value,d=e.menuIsOpen,f=e.inputValue,p=e.isMulti,m=nD(u),h={};if(n&&(u!==n.value||l!==n.options||d!==n.menuIsOpen||f!==n.inputValue)){var g=d?Zk(e,m):[],_=d?Xk(Jk(e,m),`${c}-option`):[],v=r?$k(t,m):null,y=eA(t,g);h={selectValue:m,focusedOption:y,focusedOptionId:tA(_,y),focusableOptionsWithIds:_,focusedValue:v,clearFocusValueOnUpdate:!1}}var b=i!=null&&e!==n?{inputIsHidden:i,inputIsHiddenAfterUpdate:void 0}:{},x=a,S=o&&s;return o&&!S&&(x={value:SD(p,m,m[0]||null),options:m,action:`initial-input-focus`},S=!s),a?.action===`initial-input-focus`&&(x=null),JT(JT(JT({},h),b),{},{prevProps:e,ariaSelection:x,prevWasFocused:S})}}]),n}(u.Component);lA.defaultProps=Kk;var uA=[`defaultInputValue`,`defaultMenuIsOpen`,`defaultValue`,`inputValue`,`menuIsOpen`,`onChange`,`onInputChange`,`onMenuClose`,`onMenuOpen`,`value`];function dA(e){var t=e.defaultInputValue,n=t===void 0?``:t,r=e.defaultMenuIsOpen,i=r!==void 0&&r,a=e.defaultValue,o=a===void 0?null:a,s=e.inputValue,c=e.menuIsOpen,l=e.onChange,d=e.onInputChange,f=e.onMenuClose,p=e.onMenuOpen,m=e.value,h=gE(e,uA),g=mE((0,u.useState)(s===void 0?n:s),2),_=g[0],v=g[1],y=mE((0,u.useState)(c===void 0?i:c),2),b=y[0],x=y[1],S=mE((0,u.useState)(m===void 0?o:m),2),C=S[0],w=S[1],T=(0,u.useCallback)(function(e,t){typeof l==`function`&&l(e,t),w(e)},[l]),E=(0,u.useCallback)(function(e,t){var n;typeof d==`function`&&(n=d(e,t)),v(n===void 0?e:n)},[d]),D=(0,u.useCallback)(function(){typeof p==`function`&&p(),x(!0)},[p]),O=(0,u.useCallback)(function(){typeof f==`function`&&f(),x(!1)},[f]),k=s===void 0?_:s,A=c===void 0?b:c,j=m===void 0?C:m;return JT(JT({},h),{},{inputValue:k,menuIsOpen:A,onChange:T,onInputChange:E,onMenuClose:O,onMenuOpen:D,value:j})}var fA=[`allowCreateWhileLoading`,`createOptionPosition`,`formatCreateLabel`,`isValidNewOption`,`getNewOptionData`,`onCreateOption`,`options`,`onChange`],pA=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),i=String(n.getOptionValue(t)).toLowerCase(),a=String(n.getOptionLabel(t)).toLowerCase();return i===r||a===r},mA={formatCreateLabel:function(e){return`Create "${e}"`},isValidNewOption:function(e,t,n,r){return!(!e||t.some(function(t){return pA(e,t,r)})||n.some(function(t){return pA(e,t,r)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function hA(e){var t=e.allowCreateWhileLoading,n=t!==void 0&&t,r=e.createOptionPosition,i=r===void 0?`last`:r,a=e.formatCreateLabel,o=a===void 0?mA.formatCreateLabel:a,s=e.isValidNewOption,c=s===void 0?mA.isValidNewOption:s,l=e.getNewOptionData,d=l===void 0?mA.getNewOptionData:l,f=e.onCreateOption,p=e.options,m=p===void 0?[]:p,h=e.onChange,g=gE(e,fA),_=g.getOptionValue,v=_===void 0?zk:_,y=g.getOptionLabel,b=y===void 0?Rk:y,x=g.inputValue,S=g.isLoading,C=g.isMulti,w=g.value,T=g.name,E=(0,u.useMemo)(function(){return c(x,nD(w),m,{getOptionValue:v,getOptionLabel:b})?d(x,o(x)):void 0},[o,d,b,v,x,c,m,w]),D=(0,u.useMemo)(function(){return(n||!S)&&E?i===`first`?[E].concat(uE(m)):[].concat(uE(m),[E]):m},[n,i,S,E,m]),O=(0,u.useCallback)(function(e,t){if(t.action!==`select-option`)return h(e,t);var n=Array.isArray(e)?e:[e];if(n[n.length-1]===E){if(f)f(x);else{var r=d(x,x),i={action:`create-option`,name:T,option:r};h(SD(C,[].concat(uE(nD(w)),[r]),r),i)}return}h(e,t)},[d,x,C,T,E,f,h,w]);return JT(JT({},g),{},{options:D,onChange:O})}var gA=(0,u.forwardRef)(function(e,t){var n=hA(dA(e));return u.createElement(lA,HT({ref:t},n))});function _A({comment:e,onChangeTemplate:t,setComment:n,t:r}){let i=e=>(0,p.jsx)(`div`,{title:e.title,children:e.label}),a=ge(e=>(0,m.getConfig)(e)).annotation.commentTemplates??[],[o,s]=(0,u.useState)(null),[c,l]=(0,u.useState)(``),[d,f]=(0,u.useState)(0),g=n=>{if(n){if(e.trim().length>0){s(n),l(e);return}t(n.value)}},_=()=>{t({...o.value,content:c}),s(null),l(``)},v=()=>{s(null),l(``),f(e=>e+1)};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h.Grid,{container:!0,children:(0,p.jsx)(h.Typography,{variant:`formSectionTitle`,children:r(`note`)})}),a.length>0&&(0,p.jsx)(h.Grid,{style:{marginBottom:`10px`},children:(0,p.jsx)(gA,{options:a.map(e=>({label:e.title,title:e.content,value:e})),placeholder:r(`useTemplate`),onChange:g,isClearable:!0,isSearchable:!0,formatOptionLabel:i,styles:{marginBottom:`20px`}},d)}),(0,p.jsx)(h.Grid,{container:!0,children:(0,p.jsx)(BT,{text:e,setText:n})}),(0,p.jsxs)(h.Dialog,{"aria-labelledby":`confirm-template-selection-title`,fullWidth:!0,maxWidth:`sm`,onClose:v,open:o!==null,children:[(0,p.jsx)(h.DialogTitle,{id:`confirm-template-selection-title`,children:(0,p.jsx)(h.Typography,{variant:`h2`,component:`span`,children:r(`confirmTemplateSelectionTitle`)})}),(0,p.jsxs)(h.DialogContent,{children:[(0,p.jsx)(h.DialogContentText,{variant:`body1`,color:`inherit`,children:r(`confirmTemplateSelectionContent`)}),(0,p.jsx)(h.Typography,{variant:`subtitle2`,sx:{marginTop:`16px`},children:r(`selectedTemplateContent`)}),(0,p.jsx)(h.Box,{sx:{border:`1px solid rgba(0, 0, 0, 0.23)`,borderRadius:`4px`,marginBottom:`16px`,maxHeight:`150px`,overflowY:`auto`,padding:`8px 12px`},dangerouslySetInnerHTML:{__html:o?.value.content??``}}),(0,p.jsx)(h.Typography,{variant:`subtitle2`,children:r(`currentNoteContent`)}),(0,p.jsx)(BT,{text:c,setText:l})]}),(0,p.jsxs)(h.DialogActions,{children:[(0,p.jsx)(h.Button,{onClick:v,children:r(`cancel`)}),(0,p.jsx)(h.Button,{color:`primary`,onClick:_,variant:`contained`,children:r(`applyMerge`)})]})]})]})}_A.propTypes={comment:f.default.string.isRequired,onChangeTemplate:f.default.func.isRequired,setComment:f.default.func.isRequired,t:f.default.func.isRequired};function vA({setTags:e,t,tags:n,tagsSuggestions:r}){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h.Typography,{variant:`formSectionTitle`,children:t(`tags`)}),(0,p.jsx)(gA,{isMulti:!0,options:r,value:n,onChange:e,closeMenuOnSelect:!1,placeholder:t(`tagsPlaceholder`)}),(0,p.jsx)(h.Divider,{spacing:2})]})}vA.propTypes={setTags:f.default.func.isRequired,t:f.default.func.isRequired,tags:f.default.any.isRequired,tagsSuggestions:f.default.arrayOf(f.default.shape({label:f.default.string,value:f.default.string})).isRequired};var yA={AnnotationFormFooter:bi,MultiTagsInput:vA,TargetFormSection:Fy,TextCommentInput:_A,TextFormSection:VT},{AnnotationFormFooter:bA}=yA,xA=async e=>e;function SA({annotation:e,canvases:t,closeFormCompanionWindow:n,saveAnnotation:r,t:i}){let[a,o]=(0,u.useState)(e);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h.Paper,{elevation:0,style:{minHeight:`300px`},children:(0,p.jsx)(mi,{data:a,onUpdate:o})}),(0,p.jsx)(bA,{closeFormCompanionWindow:n,saveAnnotation:()=>{t.forEach(async e=>{r(a.newData,e.id)}),n()},t:i,annotationState:a})]})}SA.propTypes={annotation:f.default.shape({body:f.default.shape({format:f.default.string,id:f.default.string,type:f.default.string,value:f.default.string}),drawingState:f.default.string,id:f.default.string,maeData:f.default.object,manifestNetwork:f.default.string,motivation:f.default.string,target:f.default.string}).isRequired,canvases:f.default.arrayOf(f.default.object).isRequired,closeFormCompanionWindow:f.default.func.isRequired,saveAnnotation:f.default.func.isRequired,t:f.default.func.isRequired};var{AnnotationFormFooter:CA,MultiTagsInput:wA,TargetFormSection:TA,TextCommentInput:EA}=yA,DA=async(e,{canvas:t,windowId:n,playerReferences:r})=>An(Mn(e),t,n,r);function OA({annotation:e,closeFormCompanionWindow:t,playerReferences:n,saveAnnotation:r,t:i,windowId:a}){let o=ge(e=>(0,m.getConfig)(e)),s=o.annotation.tagsSuggestions??[],c=e;if(c.id)c.maeData.target.drawingState&&typeof c.maeData.target.drawingState==`string`&&(c.maeData.target.drawingState=JSON.parse(c.maeData.target.drawingState),console.debug(`Parsed drawingState:`,c.maeData.target.drawingState),c.maeData.target.drawingState={...c.maeData.target.drawingState,currentShape:null}),c.maeData.textBody=c.body.find(e=>e.purpose===`describing`),c.maeData.tags=c.body.filter(e=>e.purpose===`tagging`).map(e=>({label:e.value,value:e.value})),c.maeData.textBody===void 0&&(c.maeData.textBody={purpose:`describing`,type:`TextualBody`,value:``});else{let{defaultTags:e}=Ct(o);c={body:[],maeData:{tags:e.map(e=>({label:e,value:e})),target:null,templateType:en.MULTIPLE_BODY_TYPE,textBody:{purpose:`describing`,type:`TextualBody`,value:``}},motivation:`commenting`,target:null}}let[l,d]=(0,u.useState)(c),f=e=>{d({...l,maeData:{...l.maeData,textBody:{...l.maeData.textBody,value:e}}})},g=e=>{d({...l,maeData:{...l.maeData,tags:e}})},_=e=>{let t=l.maeData;t.target=e,d({...l,maeData:t})},v=async()=>{Bt(a,n.getMediaTrueWidth(),n.getMediaTrueHeight(),1/n.getScale()),r(l)},y=s.map(e=>({label:e,value:e}));return(0,p.jsxs)(h.Grid,{container:!0,direction:`column`,spacing:2,children:[(0,p.jsx)(h.Grid,{children:(0,p.jsx)(EA,{comment:l.maeData.textBody.value,setComment:f,onChangeTemplate:e=>{let t=y.find(t=>t.value===e.title);if(t&&!l.maeData.tags.find(e=>e.value===t.value)){d({...l,maeData:{...l.maeData,tags:[...l.maeData.tags,t],textBody:{...l.maeData.textBody,value:e.content}}});return}f(e.content)},t:i})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(wA,{t:i,tags:l.maeData.tags,setTags:g,tagsSuggestions:y})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(TA,{onChangeTarget:_,playerReferences:n,spatialTarget:!0,t:i,target:l.maeData.target,timeTarget:!0,windowId:a})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(CA,{closeFormCompanionWindow:t,saveAnnotation:v,t:i,annotationState:l})})]})}OA.propTypes={annotation:f.default.shape({adapter:f.default.func,body:f.default.arrayOf(f.default.shape({type:f.default.string})),defaults:f.default.objectOf(f.default.oneOfType([f.default.bool,f.default.func,f.default.number,f.default.string])),drawingState:f.default.string,manifestNetwork:f.default.string,target:f.default.string}).isRequired,closeFormCompanionWindow:f.default.func.isRequired,playerReferences:f.default.object.isRequired,saveAnnotation:f.default.func.isRequired,t:f.default.func.isRequired,windowId:f.default.string.isRequired};var kA=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z`}),`Add`),AA=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z`}),`ArrowDownward`),jA=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z`}),`ArrowUpward`),{AnnotationFormFooter:MA,TargetFormSection:NA}=yA,PA={IMAGE:`Image`,SOUND:`Sound`,TEXT:`TextualBody`},FA=e=>{let t=e?.target?.drawingState?.shapes;return Array.isArray(t)&&t.length===1&&t[0].type===z.POI},IA=e=>{let t=e,{title:n,descriptionItems:r}=t.maeData;return t.body=[{purpose:`identifying`,type:PA.TEXT,value:Dn(n)?On():n},...r.filter(e=>!Dn(e.value)).map(e=>e.type===PA.TEXT?{purpose:`describing`,type:PA.TEXT,value:e.value}:{id:e.value,purpose:`describing`,type:e.type})],t},LA=async(e,{canvas:t,windowId:n,playerReferences:r})=>An(IA(e),t,n,r);function RA({annotation:e,closeFormCompanionWindow:t,playerReferences:n,saveAnnotation:r,t:i,windowId:a}){let o=e;o.id?(o.maeData.target.drawingState&&typeof o.maeData.target.drawingState==`string`&&(o.maeData.target.drawingState={...JSON.parse(o.maeData.target.drawingState),currentShape:null}),o.maeData.title=o.body.find(e=>e.purpose===`identifying`)?.value??``,o.maeData.descriptionItems=o.body.filter(e=>e.purpose===`describing`).map(e=>({key:Ft(),type:e.type,value:e.type===PA.TEXT?e.value:e.id}))):o={body:[],"dbf:kind":`POI`,maeData:{descriptionItems:[],target:null,templateType:en.POI_TYPE,title:``},motivation:`identifying`,target:null};let[s,c]=(0,u.useState)(o),[l,d]=(0,u.useState)(!1),f=e=>{c({...s,maeData:{...s.maeData,...e}})},m=e=>{f({target:e})},g=()=>{f({descriptionItems:[...s.maeData.descriptionItems,{key:Ft(),type:PA.TEXT,value:``}]})},_=(e,t)=>{let n=[...s.maeData.descriptionItems];n[e]=t,f({descriptionItems:n})},v=e=>{f({descriptionItems:s.maeData.descriptionItems.filter((t,n)=>n!==e)})},y=(e,t)=>{let n=[...s.maeData.descriptionItems],r=e+t;r<0||r>=n.length||([n[e],n[r]]=[n[r],n[e]],f({descriptionItems:n}))};return(0,p.jsxs)(h.Grid,{container:!0,direction:`column`,spacing:2,children:[(0,p.jsx)(h.Grid,{children:(0,p.jsx)(w.default,{variant:`formSectionTitle`,children:i(`poi`)})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(h.TextField,{fullWidth:!0,label:i(`poi_title`),value:s.maeData.title,variant:`outlined`,onChange:e=>f({title:e.target.value})})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(w.default,{variant:`formSectionTitle`,children:i(`poi_description_section`)})}),s.maeData.descriptionItems.map((e,t)=>(0,p.jsxs)(h.Grid,{container:!0,spacing:1,alignItems:`center`,children:[(0,p.jsx)(h.Grid,{children:(0,p.jsxs)(h.FormControl,{size:`small`,sx:{minWidth:130},children:[(0,p.jsx)(h.InputLabel,{id:`poi-desc-type-label-${e.key}`,children:i(`poi_description_item_type`)}),(0,p.jsxs)(h.Select,{labelId:`poi-desc-type-label-${e.key}`,label:i(`poi_description_item_type`),value:e.type,onChange:n=>_(t,{...e,type:n.target.value,value:``}),children:[(0,p.jsx)(h.MenuItem,{value:PA.TEXT,children:i(`poi_description_item_type_text`)}),(0,p.jsx)(h.MenuItem,{value:PA.IMAGE,children:i(`poi_description_item_type_image`)}),(0,p.jsx)(h.MenuItem,{value:PA.SOUND,children:i(`poi_description_item_type_sound`)})]})]})}),(0,p.jsx)(h.Grid,{size:`grow`,children:(0,p.jsx)(h.TextField,{fullWidth:!0,multiline:e.type===PA.TEXT,label:e.type===PA.TEXT?i(`poi_description_item_text_value`):i(`poi_description_item_url_value`),value:e.value,variant:`outlined`,error:e.type!==PA.TEXT&&!cn(e.value),helperText:e.type!==PA.TEXT&&!cn(e.value)?i(`invalid_url`):void 0,onChange:n=>_(t,{...e,value:n.target.value})})}),(0,p.jsxs)(h.Grid,{children:[(0,p.jsx)(h.IconButton,{"aria-label":i(`poi_move_description_item_up`),disabled:t===0,onClick:()=>y(t,-1),children:(0,p.jsx)(jA,{fontSize:`small`})}),(0,p.jsx)(h.IconButton,{"aria-label":i(`poi_move_description_item_down`),disabled:t===s.maeData.descriptionItems.length-1,onClick:()=>y(t,1),children:(0,p.jsx)(AA,{fontSize:`small`})}),(0,p.jsx)(h.IconButton,{"aria-label":i(`poi_remove_description_item`),onClick:()=>v(t),children:(0,p.jsx)(Cs,{fontSize:`small`})})]})]},e.key)),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(h.Button,{startIcon:(0,p.jsx)(kA,{}),onClick:g,children:i(`poi_add_description_item`)})}),(0,p.jsxs)(h.Grid,{children:[(0,p.jsx)(NA,{onChangeTarget:m,playerReferences:n,pointOnly:!0,spatialTarget:!0,target:s.maeData.target,windowId:a}),l&&(0,p.jsx)(w.default,{color:`error`,variant:`caption`,children:i(`poi_target_must_be_point`)})]}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(MA,{closeFormCompanionWindow:t,saveAnnotation:async()=>{if(!FA(s.maeData)){d(!0);return}d(!1),Bt(a,n.getMediaTrueWidth(),n.getMediaTrueHeight(),1/n.getScale()),r(s)},t:i,annotationState:s})})]})}RA.propTypes={annotation:f.default.shape({adapter:f.default.func,body:f.default.arrayOf(f.default.shape({type:f.default.string})),defaults:f.default.objectOf(f.default.oneOfType([f.default.bool,f.default.func,f.default.number,f.default.string])),drawingState:f.default.string,manifestNetwork:f.default.string,target:f.default.string}).isRequired,closeFormCompanionWindow:f.default.func.isRequired,playerReferences:f.default.object.isRequired,saveAnnotation:f.default.func.isRequired,t:f.default.func.isRequired,windowId:f.default.string.isRequired};var{AnnotationFormFooter:zA,TargetFormSection:BA}=yA,VA=jn;function HA({annotation:e,closeFormCompanionWindow:t,playerReferences:n,saveAnnotation:r,t:i,windowId:a}){let o=ge(e=>(0,m.getConfig)(e)),s=e;if(s.id)s.maeData.target.drawingState&&typeof s.maeData.target.drawingState==`string`&&(s.maeData.target.drawingState=JSON.parse(s.maeData.target.drawingState));else{let{defaultTags:e}=Ct(o);s={body:{type:`Image`,value:e.length>0?e[0]:``},maeData:{target:null,templateType:en.TAGGING_TYPE},motivation:`tagging`,target:null}}let[c,l]=(0,u.useState)(s),d=e=>{let t=c.body;t.value=e,l({...c,body:t})};return(0,p.jsxs)(h.Grid,{container:!0,direction:`column`,spacing:2,children:[(0,p.jsx)(h.Grid,{children:(0,p.jsxs)(w.default,{variant:`formSectionTitle`,children:[i(`tag`),` `]})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(h.TextField,{id:`outlined-basic`,label:i(`your_tag_here`),value:c.body.value,variant:`outlined`,onChange:e=>d(e.target.value)})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(BA,{onChangeTarget:e=>{let t=c.maeData;t.target=e,l({...c,maeData:t})},playerReferences:n,spatialTarget:!0,target:c.maeData.target,windowId:a})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(zA,{closeFormCompanionWindow:t,saveAnnotation:async()=>{Bt(a,n.getMediaTrueWidth(),n.getMediaTrueHeight(),1/n.getScale()),r(c)},t:i,annotationState:c})})]})}HA.propTypes={annotation:f.default.shape({adapter:f.default.func,body:f.default.arrayOf(f.default.shape({type:f.default.string})),defaults:f.default.objectOf(f.default.oneOfType([f.default.bool,f.default.func,f.default.number,f.default.string])),drawingState:f.default.string,manifestNetwork:f.default.string,target:f.default.string}).isRequired,closeFormCompanionWindow:f.default.func.isRequired,playerReferences:f.default.object.isRequired,saveAnnotation:f.default.func.isRequired,t:f.default.func.isRequired,windowId:f.default.string.isRequired};var{AnnotationFormFooter:UA,TargetFormSection:WA,TextCommentInput:GA}=yA,KA=`Annotation`,qA=jn;function JA({annotation:e,closeFormCompanionWindow:t,playerReferences:n,saveAnnotation:r,t:i,windowId:a}){let o=e;o.id?o.maeData.target.drawingState&&typeof o.maeData.target.drawingState==`string`&&(o.maeData.target.drawingState=JSON.parse(o.maeData.target.drawingState)):o={body:{id:Ft(),type:`TextualBody`,value:``},maeData:{target:null,templateType:en.TEXT_TYPE},motivation:`commenting`,target:null};let[s,c]=(0,u.useState)(o),l=e=>{let t=s.body;t.value=e,c({...s,body:t})};return(0,u.useEffect)(()=>{},[s.maeData.target]),(0,p.jsxs)(h.Grid,{container:!0,direction:`column`,spacing:2,children:[(0,p.jsx)(h.Grid,{children:(0,p.jsx)(GA,{comment:s.body.value,setComment:l,onChangeTemplate:e=>{l(e.content)},t:i})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(WA,{onChangeTarget:e=>{let t=s.maeData;t.target=e,c({...s,maeData:t})},playerReferences:n,spatialTarget:!0,target:s.maeData.target,windowId:a})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(UA,{closeFormCompanionWindow:t,saveAnnotation:()=>{Bt(a,n.getMediaTrueWidth(),n.getMediaTrueHeight(),1/n.getScale()),s.body.value===void 0&&(s.body.value=KA),r(s)},t:i,annotationState:s})})]})}JA.propTypes={annotation:f.default.object.isRequired,closeFormCompanionWindow:f.default.func.isRequired,playerReferences:f.default.object.isRequired,saveAnnotation:f.default.func.isRequired,t:f.default.func.isRequired,windowId:f.default.string.isRequired};var YA=e=>e===nn.IMAGE,XA=(e,t=[])=>{let n=[{Component:OA,convertToAnnotation:DA,description:e(`textual_note_with_target`),icon:(0,p.jsx)(Vn,{}),id:en.MULTIPLE_BODY_TYPE,isCompatibleWithMediaType:YA,label:e(`note`),selectable:!0},{Component:HA,convertToAnnotation:VA,description:e(`tag_with_target`),icon:(0,p.jsx)(Hn,{fontSize:`small`}),id:en.TAGGING_TYPE,isCompatibleWithMediaType:YA,label:e(`tag`),selectable:!0},{Component:RA,convertToAnnotation:LA,description:e(`poi_description`),icon:(0,p.jsx)(Wn,{fontSize:`small`}),id:en.POI_TYPE,isCompatibleWithMediaType:YA,label:e(`poi`),selectable:!0},{Component:SA,convertToAnnotation:xA,description:e(`edit_iiif_json_code`),icon:(0,p.jsx)(Un,{fontSize:`small`}),id:en.IIIF_TYPE,isCompatibleWithMediaType:YA,label:e(`expert_mode`),selectable:!0},{Component:JA,convertToAnnotation:qA,description:``,icon:null,id:en.TEXT_TYPE,isCompatibleWithMediaType:YA,label:``,selectable:!1}],r=new Set(n.map(e=>e.id)),i=t.filter(e=>r.has(e.id)?(console.warn(`Ignoring external annotation template with id "${e.id}": it collides with a built-in template id.`),!1):typeof e.id!=`string`||typeof e.Component!=`function`||typeof e.convertToAnnotation!=`function`||typeof e.isCompatibleWithMediaType!=`function`?(console.warn(`Ignoring external annotation template with id "${e.id}": it does not follow the TEMPLATE_REGISTRY contract (id: string, Component/convertToAnnotation/isCompatibleWithMediaType: function are all required).`),!1):!0);return[...n,...i]},ZA=(e,t=[])=>XA(e,t).filter(e=>e.selectable),QA=(e,t,n=[])=>XA(e,n).find(e=>e.id===t);function $A({mediaType:e,setCommentingType:t}){let{t:n}=(0,_.useTranslation)(),r=e=>t(e),{externalTemplates:i}=ge(e=>(0,m.getConfig)(e)).annotation,a=ZA(n,i);return(0,p.jsx)(ej,{children:e===nn.AUDIO?(0,p.jsx)(h.Grid,{container:!0,spacing:1,direction:`column`,children:(0,p.jsx)(h.Grid,{children:(0,p.jsx)(w.default,{children:n(`audio_not_supported`)})})}):a.map(t=>t.isCompatibleWithMediaType(e)&&(0,p.jsx)(tj,{children:(0,p.jsx)(nj,{id:t.id,onClick:()=>r(t),children:(0,p.jsxs)(h.CardContent,{children:[(0,p.jsxs)(rj,{component:`div`,children:[n(t.label),t.icon]}),(0,p.jsx)(ij,{component:`div`,variant:`body2`,children:n(t.description)})]})})},t.id))})}var ej=(0,g.styled)(`div`)(({theme:e})=>({display:`flex`,flexDirection:`column`,gap:e.spacing(3.75),margin:e.spacing(1.25)})),tj=(0,g.styled)(h.Card)(({theme:e})=>({borderRadius:e.shape.borderRadius,boxShadow:e.shadows[1],border:`1px solid ${(0,g.alpha)(e.palette.primary?.main??`#5A8264`,.25)}`,transition:`box-shadow 120ms ease, transform 120ms ease, border-color 120ms ease`,"&:hover":{boxShadow:e.shadows[3],borderColor:(0,g.alpha)(e.palette.primary?.main??`#5A8264`,.5),transform:`translateY(-1px)`}})),nj=(0,g.styled)(h.CardActionArea)(({theme:e})=>({borderRadius:e.shape.borderRadius,"&:hover":{backgroundColor:(0,g.alpha)(e.palette.primary?.main??`#5A8264`,.06)}})),rj=(0,g.styled)(w.default)(({theme:e})=>{let t=e.typography.formSectionTitle??{};return{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:e.spacing(1),color:t.color??e.palette.primary?.main??`#5A8264`,fontSize:t.fontSize??e.typography.h6.fontSize,fontWeight:t.fontWeight??600,letterSpacing:t.letterSpacing??`0.02em`,textTransform:t.textTransform??`none`,lineHeight:1.25,marginBottom:e.spacing(.5)}}),ij=(0,g.styled)(w.default)(({theme:e})=>{let t=e.typography.subFormSectionTitle??{};return{color:e.palette.text.secondary,fontSize:t.fontSize??e.typography.body2.fontSize,fontWeight:t.fontWeight??300,letterSpacing:t.letterSpacing??0,lineHeight:t.lineHeight??e.typography.body2.lineHeight,textTransform:t.textTransform??`none`}});$A.propTypes={mediaType:f.default.string.isRequired,setCommentingType:f.default.func.isRequired};var aj=(0,F.createSvgIcon)((0,p.jsx)(`path`,{d:`M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z`}),`ChevronLeft`);function oj({templateType:e,setCommentingType:t,annotation:n}){return(0,p.jsxs)(h.Grid,{container:!0,direction:`row`,alignItems:`center`,justifyContent:`space-between`,sx:{marginRight:`10px`},spacing:2,children:[(0,p.jsx)(h.Grid,{children:n.id==null&&(0,p.jsx)(m.MiradorMenuButton,{"aria-label":`back`,TooltipProps:{title:`back`},children:(0,p.jsx)(aj,{onClick:()=>{t(null)}})})}),(0,p.jsx)(h.Grid,{children:e.icon})]})}oj.propTypes={annotation:f.default.oneOfType([f.default.shape({body:f.default.shape({format:f.default.string,id:f.default.string,type:f.default.string,value:f.default.string}),drawingState:f.default.string,id:f.default.string,manifestNetwork:f.default.string,motivation:f.default.string,target:f.default.string}),f.default.string]).isRequired,setCommentingType:f.default.func.isRequired,templateType:f.default.shape({description:f.default.string,icon:f.default.element,id:f.default.string,label:f.default.string}).isRequired};function sj({playerReferences:e,t}){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`h4`,{children:`Debug info `}),(0,p.jsx)(`p`,{children:`Only visible in debug mode`}),(0,p.jsx)(w.default,{children:e.getMediaType()}),(0,p.jsxs)(w.default,{children:[t(`scale`),`:`,e.getScale()]}),(0,p.jsxs)(w.default,{children:[t(`zoom`),`:`,e.getZoom()]}),(0,p.jsxs)(w.default,{children:[t(`image_true_size`),`:`,e.getMediaTrueWidth(),` `,`x`,e.getMediaTrueHeight()]}),(0,p.jsxs)(w.default,{children:[t(`container_size`),`:`,e.getContainerWidth(),` `,`x`,e.getContainerHeight()]}),(0,p.jsxs)(w.default,{children:[t(`image_displayed`),`:`,e.getDisplayedMediaWidth(),` `,`x`,e.getDisplayedMediaHeight()]})]})}sj.propTypes={playerReferences:f.default.any.isRequired,t:f.default.func.isRequired};function cj({annotation:e,canvases:t,closeFormCompanionWindow:n,playerReferences:r,saveAnnotation:i,templateType:a,windowId:o}){let{t:s}=(0,_.useTranslation)(),c=ge(e=>(0,m.getConfig)(e)).annotation,l=c.debug??!1,{externalTemplates:d}=c,f=(0,u.useMemo)(()=>XA(s,d).find(e=>e.id===a.id)?.Component,[s,a.id,d]);return(0,p.jsxs)(h.Grid,{container:!0,direction:`column`,children:[(0,p.jsx)(lj,{children:f&&(0,p.jsx)(f,{annotation:e,canvases:t,closeFormCompanionWindow:n,playerReferences:r,saveAnnotation:i,t:s,windowId:o})}),l&&(0,p.jsx)(sj,{playerReferences:r,t:s})]})}var lj=(0,g.styled)(h.Grid)({margin:`0 10px`});cj.propTypes={annotation:f.default.shape({adapter:f.default.func,body:f.default.arrayOf(f.default.shape({type:f.default.string})),defaults:f.default.objectOf(f.default.oneOfType([f.default.bool,f.default.func,f.default.number,f.default.string])),drawingState:f.default.string,manifestNetwork:f.default.string,target:f.default.string}).isRequired,canvases:f.default.arrayOf(f.default.shape({id:f.default.string,index:f.default.number})).isRequired,closeFormCompanionWindow:f.default.func.isRequired,playerReferences:f.default.object.isRequired,saveAnnotation:f.default.func.isRequired,templateType:f.default.shape({description:f.default.string,icon:f.default.element,id:f.default.string,label:f.default.string}).isRequired,windowId:f.default.string.isRequired};function uj({id:e,windowId:t,mediaType:n}){let{t:r}=(0,_.useTranslation)();return(0,p.jsx)(m.CompanionWindow,{title:r(`media_not_supported`),windowId:t,id:e,children:(0,p.jsxs)(h.Grid,{container:!0,padding:1,spacing:1,children:[(0,p.jsx)(h.Grid,{children:(0,p.jsx)(w.default,{children:r(`media_not_supported`)})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(w.default,{children:r(`detected_media_type`,{mediaType:n})})})]})})}uj.propTypes={id:f.default.string.isRequired,mediaType:f.default.string.isRequired,windowId:f.default.string.isRequired};function dj({annotation:e,canvases:t,closeCompanionWindow:n,config:r,id:i,playerReferences:a,receiveAnnotation:o,windowId:s}){let{t:c}=(0,_.useTranslation)(),{externalTemplates:l}=r.annotation,[d,f]=(0,u.useState)(null),[g,v]=(0,u.useState)(a.getMediaType()),[y,b]=(0,u.useState)(0),[,x]=(0,u.useReducer)(e=>e+1,0);!a.isInitializedCorrectly()&&y<10&&(console.log(`AnnotationForm.js: retryCount`,y),setTimeout(()=>{b(y+1),x()},100));let[S,C]=(0,u.useState)({height:window.innerHeight,width:window.innerWidth});if(!d){if(e.id)e.maeData&&e.maeData.templateType?f(QA(c,e.maeData.templateType,l)??QA(c,en.IIIF_TYPE)):f(QA(c,en.IIIF_TYPE));else{let{defaultForm:e}=Ct(r);e&&tn[e]&&f(QA(c,tn[e]))}}if((0,u.useEffect)(()=>{f(null),v(a.getMediaType())},[t[0].index]),(0,u.useEffect)(()=>{let e=()=>{C({height:window.innerHeight,width:window.innerWidth})};return window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[]),a.isInitCorrectly||a.isInitializedCorrectly(),!a.isInitCorrectly)return(0,p.jsx)(uj,{id:i,mediaType:g,windowId:s});let w=(0,u.useCallback)(()=>{n(`annotationCreation`,{id:i,position:`right`})},[n,i]),T=(0,u.useRef)(e);return T.current=e,(0,p.jsx)(m.ConnectedCompanionWindow,{title:e.id?c(`edit_annotation`):c(`new_annotation`),windowId:s,id:i,children:d===null?(0,p.jsx)($A,{setCommentingType:f,mediaType:g}):(0,p.jsxs)(h.Grid,{container:!0,direction:`column`,spacing:1,children:[(0,p.jsx)(h.Grid,{container:!0,children:(0,p.jsx)(oj,{setCommentingType:f,templateType:d,annotation:e})}),(0,p.jsx)(h.Grid,{children:(0,p.jsx)(cj,{annotation:e,canvases:t,closeFormCompanionWindow:w,playerReferences:a,saveAnnotation:e=>{let t=e,n=t?.maeData?.templateType?QA(c,t.maeData.templateType,l):void 0,i=a.getCanvases().map(async e=>{let i;i=t?.maeData&&t.maeData.templateType?n?await n.convertToAnnotation(t,{canvas:e,playerReferences:a,windowId:s}):await Nn(t,e,s,a):t;let c=r.annotation.adapter(e.id);return un(e.id,c,o,i)});return Promise.all(i).then(()=>{w()})},templateType:d,windowId:s})})]})})}dj.propTypes={annotation:f.default.oneOfType([f.default.shape({body:f.default.shape({format:f.default.string,id:f.default.string,type:f.default.string,value:f.default.string}),drawingState:f.default.string,id:f.default.string,manifestNetwork:f.default.string,motivation:f.default.string,target:f.default.string}),f.default.string]).isRequired,canvases:f.default.arrayOf(f.default.shape({id:f.default.string})).isRequired,closeCompanionWindow:f.default.func.isRequired,config:f.default.shape({annotation:f.default.shape({adapter:f.default.func,debug:f.default.bool,defaults:f.default.objectOf(f.default.oneOfType([f.default.bool,f.default.func,f.default.number,f.default.string])),externalTemplates:f.default.arrayOf(f.default.object)}),language:f.default.string,translations:f.default.objectOf(f.default.object)}).isRequired,id:f.default.string.isRequired,playerReferences:f.default.object.isRequired,receiveAnnotation:f.default.func.isRequired,windowId:f.default.string.isRequired};var fj=class{actions;mediaType;canvases;windowId;overlay;isInitCorrectly;constructor(e,t,n,r){if(this.actions=r,this.media=n,this.mediaType=pj(e,t),this.canvases=(0,m.getVisibleCanvases)(e,{windowId:t}),this.windowId=t,this.isInitCorrectly=!1,this.isInitializedCorrectly())switch(this.mediaType){case nn.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};break;default:console.error(`Unknown media type`)}}sleep(e){return new Promise(t=>{setTimeout(t,e)})}isInitializedCorrectly(){return this.isInitCorrectly=this.media&&(this.mediaType===nn.IMAGE&&this.media.current&&this.media.current.canvas||this.mediaType===nn.VIDEO&&this.media.video)&&this.mediaType!==nn.UNKNOWN&&this.mediaType!==nn.AUDIO,this.isInitCorrectly}getMediaType(){return this.mediaType}getCanvases(){return this.canvases}getAudioElement(){return this.mediaType===nn.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===nn.IMAGE?this.media.current.container:null}getContainerHeight(){return this.overlay.containerHeight}getContainerWidth(){return this.overlay.containerWidth}getDisplayedMediaHeight(){if(this.mediaType===nn.IMAGE){let e=this.media.current;if(e){let t=this.getMediaTrueHeight()*e.viewport.getZoom(),n=e.container.clientWidth;return Math.round(n*t)}}}getDisplayedMediaWidth(){if(this.mediaType===nn.IMAGE){let e=this.media.current;if(e&&e.world.getItemCount()>0){let t=this.getMediaTrueWidth()*e.viewport.getZoom(),n=e.container.clientWidth;return Math.round(n*t)}}}getMediaTrueHeight(){if(this.mediaType===nn.IMAGE)return this.canvases[0].__jsonld.height;console.error(`Unknown media type`)}getMediaTrueWidth(){if(this.mediaType===nn.IMAGE)return this.canvases[0].__jsonld.width}getScale(){return this.isInitializedCorrectly()?this.getDisplayedMediaWidth()/this.getMediaTrueWidth():null}getZoom(){if(this.mediaType===nn.IMAGE){let e=this.media.current.viewport.getZoom()/this.media.current.viewport.getMaxZoom();return e=Math.round(e*100)/100,e}}getImagePosition(){if(this.mediaType===nn.IMAGE){let e=this.media.current;if(e){let t=e.world.getItemAt(0).getBounds(),n=e.viewport.viewportToViewerElementCoordinates(t.getTopLeft());return{x:Math.round(n.x),y:Math.round(n.y)}}}}getTargetStrokeWidth(){return Math.max(this.getDisplayedMediaWidth()/500,3)}};function pj(e,t){let n=(0,m.getVisibleCanvasAudioResources)(e,{windowId:t})||[];return((0,m.getVisibleCanvasVideoResources)(e,{windowId:t})||[]).length>0?nn.VIDEO:n.length>0?nn.AUDIO:nn.IMAGE}var mj=(e,{id:t,windowId:n})=>({closeCompanionWindow:()=>e((0,m.removeCompanionWindow)(n,t)),receiveAnnotation:(t,n,r)=>e((0,m.receiveAnnotation)(t,n,r))});function hj(e,{id:t,windowId:n}){let{annotationid:r}=(0,m.getCompanionWindow)(e,{companionWindowId:t,windowId:n}),i=new fj(e,n,m.OSDReferences.get(n),m),a=(0,m.getVisibleCanvases)(e,{windowId:n}),o=(0,m.getPresentAnnotationsOnSelectedCanvases)(e,{windowId:n}).flatMap(e=>e.json.items||[]).find(e=>e.id===r);return o||={id:null,maeData:{templateType:null}},{annotation:o,canvases:a,config:{...e.config,translations:Ne},currentTime:null,playerReferences:i}}var gj={companionWindowKey:`annotationCreation`,component:dj,mapDispatchToProps:mj,mapStateToProps:hj};function _j({PluginComponents:e=[],TargetComponent:t,targetProps:n}){return n.hasAnyAnnotations=!0,(0,p.jsx)(t,{...n,PluginComponents:e})}_j.propTypes={PluginComponents:f.default.array.isRequired,TargetComponent:f.default.oneOfType([f.default.func,f.default.node]).isRequired,targetProps:f.default.object.isRequired};var vj={component:_j,mode:`wrap`,target:`WindowSideBarButtons`},yj=function(e){return`@@redux-saga/`+e},bj=yj(`IO`),xj=yj(`MULTICAST`),Sj=function(e){return e==null},Cj=function(e){return e!=null},wj=function(e){return typeof e==`function`},Tj=function(e){return typeof e==`string`},Ej=Array.isArray,Dj=function(e){return e&&(Tj(e)||Aj(e)||wj(e)||Ej(e)&&e.every(Dj))},Oj=function(e){return e&&wj(e.take)&&wj(e.close)},kj=function(e){return wj(e)&&e.hasOwnProperty(`toString`)},Aj=function(e){return!!e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype},jj=function(e){return Oj(e)&&e[xj]},Mj=function(e){return e},Nj=function(e){throw e},Pj=function(e){return{value:e,done:!0}};function Fj(e,t,n){t===void 0&&(t=Nj),n===void 0&&(n=`iterator`);var r={meta:{name:n},next:e,throw:t,return:Pj,isSagaIterator:!0};return typeof Symbol<`u`&&(r[Symbol.iterator]=function(){return r}),r}var Ij=`TAKE`,Lj=`CALL`,Rj=`FORK`,zj=`SELECT`,Bj=function(e,t){var n;return n={},n[bj]=!0,n.combinator=!1,n.type=e,n.payload=t,n};function Vj(e,t){if(e===void 0&&(e=`*`),Dj(e))return Cj(t)&&console.warn(`take(pattern) takes one argument but two were provided. Consider passing an array for listening to several action types`),Bj(Ij,{pattern:e});if(jj(e)&&Cj(t)&&Dj(t))return Bj(Ij,{channel:e,pattern:t});if(Oj(e))return Cj(t)&&console.warn(`take(channel) takes one argument but two were provided. Second argument is ignored.`),Bj(Ij,{channel:e})}function Hj(e,t){return Sj(t)&&(t=e,e=void 0),Bj(`PUT`,{channel:e,action:t})}function Uj(e){var t=Bj(`ALL`,e);return t.combinator=!0,t}function Wj(e,t){var n=null,r;return wj(e)?r=e:(Ej(e)?(n=e[0],r=e[1]):(n=e.context,r=e.fn),n&&Tj(r)&&wj(n[r])&&(r=n[r])),{context:n,fn:r,args:t}}function Gj(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Bj(Lj,Wj(e,n))}function Kj(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Bj(Rj,Wj(e,n))}function qj(e){e===void 0&&(e=Mj);for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Bj(zj,{selector:e,args:n})}var Jj=function(e){return{done:!0,value:e}},Yj={};function Xj(e){return Oj(e)?`channel`:kj(e)?String(e):wj(e)?e.name:String(e)}function Zj(e,t,n){var r,i,a,o=t;function s(t,n){if(o===Yj)return Jj(t);if(n&&!i)throw o=Yj,n;r&&r(t);var s=n?e[i](n):e[o]();return o=s.nextState,a=s.effect,r=s.stateUpdater,i=s.errorState,o===Yj?Jj(t):a}return Fj(s,function(e){return s(null,e)},n)}function Qj(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var a={done:!1,value:Vj(e)},o=function(e){return{done:!1,value:Kj.apply(void 0,[t].concat(r,[e]))}},s,c=function(e){return s=e};return Zj({q1:function(){return{nextState:`q2`,effect:a,stateUpdater:c}},q2:function(){return{nextState:`q1`,effect:o(s)}}},`q1`,`takeEvery(`+Xj(e)+`, `+t.name+`)`)}function $j(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return Kj.apply(void 0,[Qj,e,t].concat(r))}function*eM(e){let t=yield qj(m.getConfig);if(t&&t.annotation.adapter){let n=t.annotation.adapter(e),r=yield Gj([n,n.all]);r&&(yield Hj((0,m.receiveAnnotation)(e,n.annotationPageId,r)))}}function*tM(e){let{canvasId:t}=e;yield Gj(eM,t)}function*nM(){yield Uj([$j(m.ActionTypes.SET_CANVAS,tM)])}var rM={mode:`wrap`,saga:nM,target:`Window`},iM=(e,t)=>{console.error(`AiinotateAdapter.${e} error: `,t)},aM=async e=>{if(!e.ok)throw Error(`Fetch error: response ${e.status} on url: ${e.url}`)},oM={AiiinotateAdapter:class{constructor(e,t,n,r){if(![2,3].includes(t))throw Error(`AiiinotateAdapter: unrecognized value for 'iiifPresentationVersion'. expected one of [2,3], got '${t}'`);this.user=r||`Anonymous`,this.canvasId=n,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?In(e):e}handleResponse=async(e,t)=>(await aM(t),this.all());handleError=(e,t)=>(iM(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 e=>await this.handleResponse(`create`,e)).catch(e=>this.handleError(`create`,e))}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 e=>await this.handleResponse(`update`,e)).catch(e=>this.handleError(`update`,e))}async delete(e){return fetch(`${this.endpointUrlAnnotations}/delete?uri=${e}`,{method:`DELETE`}).then(async e=>await this.handleResponse(`delete`,e)).catch(e=>this.handleError(`delete`,e))}async get(e){return await fetch(e)}async all(){let e=[],t=this.annotationPageId,n,r;for(;t&&t.length;)n=await fetch(this.annotationPageId),r=await n.json(),e=[...e,...r.resources],t=r.next;let i=await this.iiifPresentationVersion===2?Bn(e,this.annotationPageId):e;return i.items=i.items.map(En),i}},LocalStorageAdapter:Me},sM=[Le,Ue,Dt,gj,vj,rM];exports.annotationAdapters=oM,exports.annotationCreationCompanionWindowPlugin=gj,exports.canvasAnnotationsPlugin=Dt,exports.default=sM,exports.externalStorageAnnotationPlugin=Ue,exports.miradorAnnotationPlugin=Le,exports.templateKit=yA,exports.windowSideBarButtonsPlugin=vj;
|
|
239
|
+
//# sourceMappingURL=mirador-annotation-editor.cjs.js.map
|