dbf-mirador-annotation-editor 1.6.0-testing3 → 1.6.1
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("react/jsx-runtime"),m=require("react"),d=require("prop-types"),at=require("@mui/material/utils"),be=require("dbf-mirador"),xn=require("react-redux"),q=require("@mui/material"),In=require("@mui/material/styles"),Bn=require("react-i18next"),Rg=require("@mui/material/Button"),I1=require("@mui/material/Dialog"),nA=require("@mui/material/DialogActions"),S1=require("@mui/material/DialogContent"),rA=require("@mui/material/DialogContentText"),R1=require("@mui/material/DialogTitle"),Ne=require("@mui/material/Typography"),iA=require("@mui/material/ListItemIcon"),oA=require("@mui/material/ListItemText"),O1=require("@mui/material/MenuList"),sl=require("@mui/material/MenuItem"),aA=require("@mui/system"),Dl=require("@mui/material/ToggleButtonGroup"),hu=require("i18next"),Ft=require("@mui/material/ToggleButton"),sA=require("@mui/material/Menu"),lA=require("@mui/material/Divider"),N1=require("@mui/material/SvgIcon"),j1=require("react-dom"),Yt=require("react-konva"),xe=require("@emotion/react"),uA=require("@ckeditor/ckeditor5-react"),Xt=require("ckeditor5");function Yf(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const dt=Yf(m),bi=Yf(d),cA=Yf(be),dA=at.createSvgIcon(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"),D1=at.createSvgIcon(p.jsx("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp"),rf="mae-save-annotation",of="mae-delete-shape",af="mae-poi-saving";function Ml(n,e){const t=be.getCompanionWindowsForContent(n,{content:"annotationCreation",windowId:e});return Object.values(t).filter(r=>r?.id)}function hA(n,e,t){Ml(n,t).forEach(r=>{e(be.removeCompanionWindow(t,r.id))})}function fA({state:n,dispatch:e,windowId:t,config:r}){if(Ml(n,t).length>0){document.dispatchEvent(new CustomEvent(of));return}const o=be.getSelectedAnnotationId(n,{windowId:t});if(!o)return;const a=r?.annotation?.adapter;if(!a)return;be.getVisibleCanvases(n,{windowId:t}).forEach(l=>{const u=a(l.id);u.delete(o).then(c=>{e(be.receiveAnnotation(l.id,u.annotationPageId,c))})}),e(be.deselectAnnotation(t))}function pA({state:n,windowId:e}){Ml(n,e).length!==0&&document.dispatchEvent(new CustomEvent(rf))}function gA({state:n,dispatch:e,windowId:t}){Ml(n,t).length>0||e(be.addCompanionWindow(t,{content:"annotationCreation",position:"right"}))}function mA({state:n,dispatch:e,windowId:t}){if(be.getSelectedAnnotationId(n,{windowId:t})){e(be.deselectAnnotation(t));return}hA(n,e,t)}const sf={create:{description:"Create a new annotation",handler:gA,keys:["a"]},delete:{description:"Delete selected shape or annotation",handler:fA,keys:["Delete","Backspace"]},escape:{description:"Deselect annotation / close companion window",handler:mA,keys:["Escape"]},save:{description:"Save current annotation",handler:pA,keys:["Enter"]}},bA={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 vA(n){return Object.prototype.hasOwnProperty.call(sf,n)?sf[n].keys:null}function Ii({label:n,action:e}){const t=vA(e);return t?p.jsxs(q.Typography,{variant:"body2",component:"span",sx:{alignItems:"center",display:"inline-flex"},children:[n,t.map(r=>p.jsx(q.Typography,{component:"HotKey",variant:"caption",sx:bA,children:r},r))]}):n}Ii.propTypes={action:d.string.isRequired,label:d.string.isRequired};function Zf({handleClose:n,open:e,switchToSingleCanvasView:t}){const{t:r}=Bn.useTranslation(),i=m.useCallback(()=>{t(),n()},[n,t]),o=m.useCallback((a,s)=>{n()},[n]);return p.jsxs(I1,{"aria-labelledby":"single-canvas-dialog-title",fullWidth:!0,maxWidth:"sm",onClose:o,open:e,children:[p.jsx(R1,{id:"single-canvas-dialog-title",children:p.jsx(Ne,{variant:"h2",component:"span",children:r("switch_view_h2")})}),p.jsx(S1,{children:p.jsx(rA,{variant:"body1",color:"inherit",children:r("switch_view_content")})}),p.jsxs(nA,{children:[p.jsx(q.Tooltip,{title:p.jsx(Ii,{label:r("cancel"),action:"escape"}),children:p.jsx(Rg,{onClick:n,children:r("cancel")})}),p.jsx(q.Tooltip,{title:r("switch_view"),children:p.jsx(Rg,{color:"primary",onClick:i,variant:"contained",children:r("switch_view")})})]})]})}Zf.propTypes={handleClose:d.func.isRequired,open:d.bool.isRequired,switchToSingleCanvasView:d.func.isRequired};const yA=aA.styled(sl)(({theme:n})=>({"&:focus":{backgroundColor:n.palette.action.focus},"&:hover":{backgroundColor:n.palette.action.hover}}));function M1({canvases:n,config:e,handleClose:t,open:r}){const[i,o]=m.useState([]),{t:a}=Bn.useTranslation();m.useEffect(()=>{if(!r)return;(async()=>{const c=async(h,f)=>{const b=e.annotation.adapter(f.id),x=await h,w=await b.all();if(!w)return x;const g=f.__jsonld&&f.__jsonld.label||f.id,y=new Blob([JSON.stringify(w)],{type:"application/json"}),C=window.URL.createObjectURL(y);return[...x,{canvasId:f.id,id:w.id||w["@id"],label:g,url:C}]};if(n?.length>0){const h=await n.reduce(c,[]);o(h)}})()},[n,e,r]);const s=()=>{i.forEach(u=>{try{URL.revokeObjectURL(u.url)}catch{}}),o([]),t()},l=(u,c)=>{if(c==="escapeKeyDown"||c==="backdropClick"){s();return}t()};return p.jsxs(I1,{"aria-labelledby":"annotation-export-dialog-title",id:"annotation-export-dialog",onClose:l,open:r,children:[p.jsx(R1,{id:"annotation-export-dialog-title",children:p.jsx(Ne,{variant:"h2",component:"span",children:a("export_annotation")})}),p.jsx(S1,{children:i.length===0?p.jsx(Ne,{variant:"body1",children:a("no_annotation")}):p.jsx(O1,{children:i.map(u=>p.jsxs(yA,{component:"a","aria-label":a("export_annotation_for",{label:u.canvasId}),href:u.url,download:`${u.id}.json`,children:[p.jsx(iA,{children:p.jsx(D1,{})}),p.jsx(oA,{children:a("export_annotation_for",{label:u.canvasId})})]},u.canvasId))})})]})}M1.propTypes={canvases:d.arrayOf(d.shape({id:d.string})).isRequired,config:d.shape({annotation:d.shape({adapter:d.func})}).isRequired,handleClose:d.func.isRequired,open:d.bool.isRequired};const cn=[];for(let n=0;n<256;++n)cn.push((n+256).toString(16).slice(1));function xA(n,e=0){return(cn[n[e+0]]+cn[n[e+1]]+cn[n[e+2]]+cn[n[e+3]]+"-"+cn[n[e+4]]+cn[n[e+5]]+"-"+cn[n[e+6]]+cn[n[e+7]]+"-"+cn[n[e+8]]+cn[n[e+9]]+"-"+cn[n[e+10]]+cn[n[e+11]]+cn[n[e+12]]+cn[n[e+13]]+cn[n[e+14]]+cn[n[e+15]]).toLowerCase()}let fu;const CA=new Uint8Array(16);function EA(){if(!fu){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");fu=crypto.getRandomValues.bind(crypto)}return fu(CA)}const wA=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Og={randomUUID:wA};function AA(n,e,t){n=n||{};const r=n.random??n.rng?.()??EA();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,xA(r)}function hn(n,e,t){return Og.randomUUID&&!n?Og.randomUUID():AA(n)}var ar=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function la(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function k1(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var ba={},Ng;function _A(){if(Ng)return ba;Ng=1,Object.defineProperty(ba,"__esModule",{value:!0});function n(o){return!o||typeof o=="string"?o:o+""}class e{async svg2canvas(a,s,l){const u=await new Promise(f=>{var b=new Image;b.onload=function(){f(b)},b.src=a});var c=document.createElement("canvas");return c.width=s,c.height=l,c.getContext("2d").drawImage(u,0,0),c}toDataURL(a,s,l,u,c,h){var f=new XMLSerializer().serializeToString(a),b=document.documentMode;if(b){var x=/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi;x.test(f)&&(f=f.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink'))}h||(h={});var w="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(f);if(u==="image/svg+xml"||!u)return h.async?Promise.resolve(w):w;if(u==="image/jpeg"||u==="image/png"){if(!h.async)throw new Error("svgcanvas: options.async must be set to true if type is image/jpeg | image/png");return(async()=>{const g=await this.svg2canvas(w,s,l),y=g.toDataURL(u,c);return g.remove(),y})()}throw new Error("svgcanvas: Unknown type for toDataURL, please use image/jpeg | image/png | image/svg+xml.")}getImageData(a,s,l,u,c,h,f,b){if(b||(b={}),!b.async)throw new Error("svgcanvas: options.async must be set to true for getImageData");const x=this.toDataURL(a,s,l,"image/svg+xml");return(async()=>{const w=await this.svg2canvas(x,s,l),y=w.getContext("2d").getImageData(u,c,h,f);return w.remove(),y})()}}const t=new e;var r=(function(){var o,a,s,l,u;function c(g,y){var C=Object.keys(y),A;for(A=0;A<C.length;A++)g=g.replace(new RegExp("\\{"+C[A]+"\\}","gi"),y[C[A]]);return g}function h(g){var y,C,A;if(!g)throw new Error("cannot create a random attribute name for an undefined object");y="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",C="";do for(C="",A=0;A<12;A++)C+=y[Math.floor(Math.random()*y.length)];while(g[C]);return C}function f(g,y){var C,A,_={},N;for(g=g.split(","),y=y||10,C=0;C<g.length;C+=2)A="&"+g[C+1]+";",N=parseInt(g[C],y),_[A]="&#"+N+";";return _["\\xa0"]=" ",_}function b(g){var y={left:"start",right:"end",center:"middle",start:"start",end:"end"};return y[g]||y.start}function x(g){var y={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return y[g]||y.alphabetic}u=f("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),o={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"}},s=function(g,y){this.__root=g,this.__ctx=y},s.prototype.addColorStop=function(g,y){var C=this.__ctx.__createElement("stop"),A,_;C.setAttribute("offset",g),n(y).indexOf("rgba")!==-1?(A=/rgba\(\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi,_=A.exec(y),C.setAttribute("stop-color",c("rgb({r},{g},{b})",{r:_[1],g:_[2],b:_[3]})),C.setAttribute("stop-opacity",_[4])):C.setAttribute("stop-color",n(y)),this.__root.appendChild(C)},l=function(g,y){this.__root=g,this.__ctx=y},a=function(g){var y={width:500,height:500,enableMirroring:!1},C;if(arguments.length>1?(C=y,C.width=arguments[0],C.height=arguments[1]):g?C=g:C=y,!(this instanceof a))return new a(C);this.width=C.width||y.width,this.height=C.height||y.height,this.enableMirroring=C.enableMirroring!==void 0?C.enableMirroring:y.enableMirroring,this.canvas=this,this.__document=C.document||document,C.ctx?this.__ctx=C.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=C,this.__id=Math.random().toString(16).substring(2,8),this.__debug("new",g)},a.prototype.__debug=function(...g){this.__options.debug&&console.debug(`svgcanvas#${this.__id}:`,...g)},a.prototype.__createElement=function(g,y,C){typeof y>"u"&&(y={});var A=this.__document.createElementNS("http://www.w3.org/2000/svg",g),_=Object.keys(y),N,O;for(C&&(A.setAttribute("fill","none"),A.setAttribute("stroke","none")),N=0;N<_.length;N++)O=_[N],A.setAttribute(O,y[O]);return A},a.prototype.__setDefaultStyles=function(){var g=Object.keys(o),y,C;for(y=0;y<g.length;y++)C=g[y],this[C]=o[C].canvas},a.prototype.__applyStyleState=function(g){var y=Object.keys(g),C,A;for(C=0;C<y.length;C++)A=y[C],this[A]=g[A]},a.prototype.__getStyleState=function(){var g,y={},C=Object.keys(o),A;for(g=0;g<C.length;g++)A=C[g],y[A]=this[A];return y},a.prototype.__applyTransformation=function(g,y){const{a:C,b:A,c:_,d:N,e:O,f:T}=y||this.getTransform();g.setAttribute("transform",`matrix(${C} ${A} ${_} ${N} ${O} ${T})`)},a.prototype.__applyStyleToCurrentElement=function(g){var y=this.__currentElement,C=this.__currentElementsToStyle;C&&(y.setAttribute(g,""),y=C.element,C.children.forEach(function(F){F.setAttribute(g,"")}));var A=Object.keys(o),_,N,O,T,D,M,L,E;for(_=0;_<A.length;_++)if(N=o[A[_]],O=this[A[_]],N.apply){if(O instanceof l){if(O.__ctx)for(L=0;L<O.__ctx.__defs.childNodes.length;L++)E=O.__ctx.__defs.childNodes[L],M=E.getAttribute("id"),this.__ids[M]=M,this.__defs.appendChild(E);y.setAttribute(N.apply,c("url(#{id})",{id:O.__root.getAttribute("id")}))}else if(O instanceof s)y.setAttribute(N.apply,c("url(#{id})",{id:O.__root.getAttribute("id")}));else if(N.apply.indexOf(g)!==-1&&N.svg!==O)if((N.svgAttr==="stroke"||N.svgAttr==="fill")&&O&&O.indexOf("rgba")!==-1){T=/rgba\(\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi,D=T.exec(O),y.setAttribute(N.svgAttr,c("rgb({r},{g},{b})",{r:D[1],g:D[2],b:D[3]}));var S=D[4],I=this.globalAlpha;I!=null&&(S*=I),y.setAttribute(N.svgAttr+"-opacity",S)}else{var P=N.svgAttr;if(A[_]==="globalAlpha"){if(P=g+"-"+N.svgAttr,y.getAttribute(P))continue}else if(A[_]==="lineWidth"){var B=this.__getTransformScale();O=O*Math.max(B.x,B.y)}y.setAttribute(P,O)}}},a.prototype.__closestGroupOrSvg=function(g){return g=g||this.__currentElement,g.nodeName==="g"||g.nodeName==="svg"?g:this.__closestGroupOrSvg(g.parentNode)},a.prototype.getSerializedSvg=function(g){var y=new XMLSerializer().serializeToString(this.__root),C,A,_,N,O,T;if(T=/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi,T.test(y)&&(y=y.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),g)for(C=Object.keys(u),A=0;A<C.length;A++)_=C[A],N=u[_],O=new RegExp(_,"gi"),O.test(y)&&(y=y.replace(O,N));return y},a.prototype.getSvg=function(){return this.__root},a.prototype.save=function(){var g=this.__createElement("g"),y=this.__closestGroupOrSvg();this.__groupStack.push(y),y.appendChild(g),this.__currentElement=g;const C=this.__getStyleState();this.__debug("save style",C),this.__styleStack.push(C),this.__transformMatrixStack||(this.__transformMatrixStack=[]),this.__transformMatrixStack.push(this.getTransform())},a.prototype.restore=function(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||(this.__currentElement=this.__root.childNodes[1]);var g=this.__styleStack.pop();this.__debug("restore style",g),this.__applyStyleState(g),this.__transformMatrixStack&&this.__transformMatrixStack.length>0&&this.setTransform(this.__transformMatrixStack.pop())},a.prototype.beginPath=function(){var g,y;this.__currentDefaultPath="",this.__currentPosition={},g=this.__createElement("path",{},!0),y=this.__closestGroupOrSvg(),y.appendChild(g),this.__currentElement=g},a.prototype.__applyCurrentDefaultPath=function(){var g=this.__currentElement;g.nodeName==="path"?g.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",g.nodeName)},a.prototype.__addPathCommand=function(g){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=g},a.prototype.moveTo=function(g,y){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:g,y},this.__addPathCommand(c("M {x} {y}",{x:this.__matrixTransform(g,y).x,y:this.__matrixTransform(g,y).y}))},a.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand("Z")},a.prototype.lineTo=function(g,y){this.__currentPosition={x:g,y},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(c("L {x} {y}",{x:this.__matrixTransform(g,y).x,y:this.__matrixTransform(g,y).y})):this.__addPathCommand(c("M {x} {y}",{x:this.__matrixTransform(g,y).x,y:this.__matrixTransform(g,y).y}))},a.prototype.bezierCurveTo=function(g,y,C,A,_,N){this.__currentPosition={x:_,y:N},this.__addPathCommand(c("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:this.__matrixTransform(g,y).x,cp1y:this.__matrixTransform(g,y).y,cp2x:this.__matrixTransform(C,A).x,cp2y:this.__matrixTransform(C,A).y,x:this.__matrixTransform(_,N).x,y:this.__matrixTransform(_,N).y}))},a.prototype.quadraticCurveTo=function(g,y,C,A){this.__currentPosition={x:C,y:A},this.__addPathCommand(c("Q {cpx} {cpy} {x} {y}",{cpx:this.__matrixTransform(g,y).x,cpy:this.__matrixTransform(g,y).y,x:this.__matrixTransform(C,A).x,y:this.__matrixTransform(C,A).y}))};var w=function(g){var y=Math.sqrt(g[0]*g[0]+g[1]*g[1]);return[g[0]/y,g[1]/y]};return a.prototype.arcTo=function(g,y,C,A,_){var N=this.__currentPosition&&this.__currentPosition.x,O=this.__currentPosition&&this.__currentPosition.y;if(!(typeof N>"u"||typeof O>"u")){if(_<0)throw new Error("IndexSizeError: The radius provided ("+_+") is negative.");if(N===g&&O===y||g===C&&y===A||_===0){this.lineTo(g,y);return}var T=w([N-g,O-y]),D=w([C-g,A-y]);if(T[0]*D[1]===T[1]*D[0]){this.lineTo(g,y);return}var M=T[0]*D[0]+T[1]*D[1],L=Math.acos(Math.abs(M)),E=w([T[0]+D[0],T[1]+D[1]]),S=_/Math.sin(L/2),I=g+S*E[0],P=y+S*E[1],B=[-T[1],T[0]],F=[D[1],-D[0]],G=function(W){var J=W[0],Y=W[1];return Y>=0?Math.acos(J):-Math.acos(J)},V=G(B),z=G(F);this.lineTo(I+B[0]*_,P+B[1]*_),this.arc(I,P,_,V,z)}},a.prototype.stroke=function(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")},a.prototype.fill=function(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")},a.prototype.rect=function(g,y,C,A){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(g,y),this.lineTo(g+C,y),this.lineTo(g+C,y+A),this.lineTo(g,y+A),this.lineTo(g,y),this.closePath()},a.prototype.roundRect=function(g,y,C,A,_){this.__currentElement.nodeName!=="path"&&this.beginPath();let N,O,T,D;typeof _=="number"?(N=_,O=_,T=_,D=_):[N,O,T,D]=_,this.moveTo(g+N,y),this.arcTo(g+C,y,g+C,y+A,O),this.arcTo(g+C,y+A,g,y+A,T),this.arcTo(g,y+A,g,y,D),this.arcTo(g,y,g+C,y,N),this.closePath()},a.prototype.fillRect=function(g,y,C,A){let{a:_,b:N,c:O,d:T,e:D,f:M}=this.getTransform();JSON.stringify([_,N,O,T,D,M])===JSON.stringify([1,0,0,1,0,0])&&g===0&&y===0&&C===this.width&&A===this.height&&this.__clearCanvas();var L,E;L=this.__createElement("rect",{x:g,y,width:C,height:A},!0),E=this.__closestGroupOrSvg(),E.appendChild(L),this.__currentElement=L,this.__applyTransformation(L),this.__applyStyleToCurrentElement("fill")},a.prototype.strokeRect=function(g,y,C,A){var _,N;_=this.__createElement("rect",{x:g,y,width:C,height:A},!0),N=this.__closestGroupOrSvg(),N.appendChild(_),this.__currentElement=_,this.__applyTransformation(_),this.__applyStyleToCurrentElement("stroke")},a.prototype.__clearCanvas=function(){var g=this.__root.childNodes[1];this.__root.removeChild(g),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__root.appendChild(this.__currentElement),this.__groupStack=[]},a.prototype.clearRect=function(g,y,C,A){let{a:_,b:N,c:O,d:T,e:D,f:M}=this.getTransform();if(JSON.stringify([_,N,O,T,D,M])===JSON.stringify([1,0,0,1,0,0])&&g===0&&y===0&&C===this.width&&A===this.height){this.__clearCanvas();return}var L,E=this.__closestGroupOrSvg();L=this.__createElement("rect",{x:g,y,width:C,height:A,fill:"#FFFFFF"},!0),this.__applyTransformation(L),E.appendChild(L)},a.prototype.createLinearGradient=function(g,y,C,A){var _=this.__createElement("linearGradient",{id:h(this.__ids),x1:g+"px",x2:C+"px",y1:y+"px",y2:A+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(_),new s(_,this)},a.prototype.createRadialGradient=function(g,y,C,A,_,N){var O=this.__createElement("radialGradient",{id:h(this.__ids),cx:A+"px",cy:_+"px",r:N+"px",fx:g+"px",fy:y+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(O),new s(O,this)},a.prototype.__applyText=function(g,y,C,A){var _=document.createElement("span");_.setAttribute("style","font:"+this.font);var N=_.style,O=this.__closestGroupOrSvg(),T=this.__createElement("text",{"font-family":N.fontFamily,"font-size":N.fontSize,"font-style":N.fontStyle,"font-weight":N.fontWeight,"text-decoration":this.__fontUnderline,x:y,y:C,"text-anchor":b(this.textAlign),"dominant-baseline":x(this.textBaseline)},!0);if(T.appendChild(this.__document.createTextNode(g)),this.__currentElement=T,this.__applyTransformation(T),this.__applyStyleToCurrentElement(A),this.__fontHref){var D=this.__createElement("a");D.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",this.__fontHref),D.appendChild(T),T=D}O.appendChild(T)},a.prototype.fillText=function(g,y,C){this.__applyText(g,y,C,"fill")},a.prototype.strokeText=function(g,y,C){this.__applyText(g,y,C,"stroke")},a.prototype.measureText=function(g){return this.__ctx.font=this.font,this.__ctx.measureText(g)},a.prototype.arc=function(g,y,C,A,_,N){if(A!==_){A=A%(2*Math.PI),_=_%(2*Math.PI),A===_&&(_=(_+2*Math.PI-.001*(N?-1:1))%(2*Math.PI));var O=g+C*Math.cos(_),T=y+C*Math.sin(_),D=g+C*Math.cos(A),M=y+C*Math.sin(A),L=N?0:1,E=0,S=_-A;S<0&&(S+=2*Math.PI),N?E=S>Math.PI?0:1:E=S>Math.PI?1:0;var I=Math.hypot(this.__transformMatrix.a,this.__transformMatrix.b),P=Math.hypot(this.__transformMatrix.c,this.__transformMatrix.d);this.lineTo(D,M),this.__addPathCommand(c("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:C*I,ry:C*P,xAxisRotation:0,largeArcFlag:E,sweepFlag:L,endX:this.__matrixTransform(O,T).x,endY:this.__matrixTransform(O,T).y})),this.__currentPosition={x:O,y:T}}},a.prototype.ellipse=function(g,y,C,A,_,N,O,T){if(N!==O){var D=this.__matrixTransform(g,y);g=D.x,y=D.y;var M=this.__getTransformScale();C=C*M.x,A=A*M.y,_=_+this.__getTransformRotation(),N=N%(2*Math.PI),O=O%(2*Math.PI),N===O&&(O=(O+2*Math.PI-.001*(T?-1:1))%(2*Math.PI));var L=g+Math.cos(-_)*C*Math.cos(O)+Math.sin(-_)*A*Math.sin(O),E=y-Math.sin(-_)*C*Math.cos(O)+Math.cos(-_)*A*Math.sin(O),S=g+Math.cos(-_)*C*Math.cos(N)+Math.sin(-_)*A*Math.sin(N),I=y-Math.sin(-_)*C*Math.cos(N)+Math.cos(-_)*A*Math.sin(N),P=T?0:1,B=0,F=O-N;F<0&&(F+=2*Math.PI),T?B=F>Math.PI?0:1:B=F>Math.PI?1:0;var G=this.__transformMatrix;this.resetTransform(),this.lineTo(S,I),this.__transformMatrix=G,this.__addPathCommand(c("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:C,ry:A,xAxisRotation:_*(180/Math.PI),largeArcFlag:B,sweepFlag:P,endX:L,endY:E})),this.__currentPosition={x:L,y:E}}},a.prototype.clip=function(){var g=this.__closestGroupOrSvg(),y=this.__createElement("clipPath"),C=h(this.__ids),A=this.__createElement("g");this.__applyCurrentDefaultPath(),g.removeChild(this.__currentElement),y.setAttribute("id",C),y.appendChild(this.__currentElement),this.__defs.appendChild(y),g.setAttribute("clip-path",c("url(#{id})",{id:C})),g.appendChild(A),this.__currentElement=A},a.prototype.drawImage=function(){var g=Array.prototype.slice.call(arguments),y=g[0],C,A,_,N,O=0,T=0,D,M,L,E,S,I,P,B,F,G;if(g.length===3)C=g[1],A=g[2],D=y.width,M=y.height,_=D,N=M;else if(g.length===5)C=g[1],A=g[2],_=g[3],N=g[4],D=y.width,M=y.height;else if(g.length===9)O=g[1],T=g[2],D=g[3],M=g[4],C=g[5],A=g[6],_=g[7],N=g[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);L=this.__closestGroupOrSvg(),this.__currentElement;const V=this.getTransform().translate(C,A);if(y instanceof a){if(E=y.getSvg().cloneNode(!0),E.childNodes&&E.childNodes.length>1){for(S=E.childNodes[0];S.childNodes.length;)G=S.childNodes[0].getAttribute("id"),this.__ids[G]=G,this.__defs.appendChild(S.childNodes[0]);I=E.childNodes[1],I&&(this.__applyTransformation(I,V),L.appendChild(I))}}else(y.nodeName==="CANVAS"||y.nodeName==="IMG")&&(P=this.__createElement("image"),P.setAttribute("width",_),P.setAttribute("height",N),P.setAttribute("preserveAspectRatio","none"),(O||T||D!==y.width||M!==y.height)&&(B=this.__document.createElement("canvas"),B.width=_,B.height=N,F=B.getContext("2d"),F.drawImage(y,O,T,D,M,0,0,_,N),y=B),this.__applyTransformation(P,V),P.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",y.nodeName==="CANVAS"?y.toDataURL():y.getAttribute("src")),L.appendChild(P))},a.prototype.createPattern=function(g,y){var C=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),A=h(this.__ids),_;return C.setAttribute("id",A),C.setAttribute("width",g.width),C.setAttribute("height",g.height),C.setAttribute("patternUnits","userSpaceOnUse"),g.nodeName==="CANVAS"||g.nodeName==="IMG"?(_=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),_.setAttribute("width",g.width),_.setAttribute("height",g.height),_.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",g.nodeName==="CANVAS"?g.toDataURL():g.getAttribute("src")),C.appendChild(_),this.__defs.appendChild(C)):g instanceof a&&(C.appendChild(g.__root.childNodes[1]),this.__defs.appendChild(C)),new l(C,this)},a.prototype.setLineDash=function(g){g&&g.length>0?this.lineDash=g.join(","):this.lineDash=null},a.prototype.setTransform=function(g,y,C,A,_,N){g instanceof DOMMatrix?this.__transformMatrix=new DOMMatrix([g.a,g.b,g.c,g.d,g.e,g.f]):this.__transformMatrix=new DOMMatrix([g,y,C,A,_,N])},a.prototype.getTransform=function(){let{a:g,b:y,c:C,d:A,e:_,f:N}=this.__transformMatrix;return new DOMMatrix([g,y,C,A,_,N])},a.prototype.resetTransform=function(){this.setTransform(1,0,0,1,0,0)},a.prototype.scale=function(g,y){if(y===void 0&&(y=g),isNaN(g)||isNaN(y)||!isFinite(g)||!isFinite(y))return;let C=this.getTransform().scale(g,y);this.setTransform(C)},a.prototype.rotate=function(g){let y=this.getTransform().multiply(new DOMMatrix([Math.cos(g),Math.sin(g),-Math.sin(g),Math.cos(g),0,0]));this.setTransform(y)},a.prototype.translate=function(g,y){const C=this.getTransform().translate(g,y);this.setTransform(C)},a.prototype.transform=function(g,y,C,A,_,N){const O=this.getTransform().multiply(new DOMMatrix([g,y,C,A,_,N]));this.setTransform(O)},a.prototype.__matrixTransform=function(g,y){return new DOMPoint(g,y).matrixTransform(this.__transformMatrix)},a.prototype.__getTransformScale=function(){return{x:Math.hypot(this.__transformMatrix.a,this.__transformMatrix.b),y:Math.hypot(this.__transformMatrix.c,this.__transformMatrix.d)}},a.prototype.__getTransformRotation=function(){return Math.atan2(this.__transformMatrix.b,this.__transformMatrix.a)},a.prototype.getImageData=function(g,y,C,A,_){return t.getImageData(this.getSvg(),this.width,this.height,g,y,C,A,_)},a.prototype.drawFocusRing=function(){},a.prototype.createImageData=function(){},a.prototype.putImageData=function(){},a.prototype.globalCompositeOperation=function(){},a})();function i(o){this.ctx=new r(o),this.svg=this.ctx.__root;var a=this.svg,s=this,l=document.createElement("div");l.style.display="inline-block",l.appendChild(a),this.wrapper=l,Object.defineProperty(this,"className",{get:function(){return l.getAttribute("class")||""},set:function(u){return l.setAttribute("class",u)}}),Object.defineProperty(this,"tagName",{get:function(){return"CANVAS"},set:function(){}}),["width","height"].forEach(function(u){Object.defineProperty(s,u,{get:function(){return a.getAttribute(u)|0},set:function(c){if(!(isNaN(c)||typeof c>"u"))return s.ctx[u]=c,a.setAttribute(u,c),l[u]=c}})}),["style","id"].forEach(function(u){Object.defineProperty(s,u,{get:function(){return l[u]},set:function(c){if(typeof c<"u")return l[u]=c}})}),["getBoundingClientRect"].forEach(function(u){s[u]=function(){return a[u]()}})}return i.prototype.getContext=function(o){if(o!=="2d")throw new Error("Unsupported type of context for SVGCanvas");return this.ctx},i.prototype.toObjectURL=function(){var o=new XMLSerializer().serializeToString(this.svg),a=new Blob([o],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(a)},i.prototype.toDataURL=function(o,a,s){return t.toDataURL(this.svg,this.width,this.height,o,a,s)},i.prototype.addEventListener=function(){return this.svg.addEventListener.apply(this.svg,arguments)},i.prototype.getElement=function(){return this.wrapper},i.prototype.getAttribute=function(o){return this.wrapper.getAttribute(o)},i.prototype.setAttribute=function(o,a){this.wrapper.setAttribute(o,a)},ba.Context=r,ba.Element=i,ba}var TA=_A();const jg=async n=>new Promise(e=>setTimeout(e,n));async function IA(n,e=!1,{onBefore:t,onAfter:r}={}){const i=n.getLayers()[0];t&&t([n,i]),await jg(200);const o=i.canvas.context._context,a=i.canvas.context._context=new TA.Context({height:n.height(),width:n.width(),ctx:o});n.draw();let s=a.getSerializedSvg();return s=e?new Blob([s],{type:"image/svg+xml;charset=utf-8"}):s,i.canvas.context._context=o,r&&r([n,i]),await jg(200),n.draw(),s}function L1(n){return window.Konva.stages.find(e=>e.attrs.id===n)}function ds(n,e,t,r,i=!0,o=!1){SA();const a=L1(n);a.width(e),a.height(t),a.scale({x:r,y:r}),o&&(a.find("Rect").map(s=>{s.strokeWidth(s.strokeWidth()*r)}),a.find("Line").map(s=>{s.strokeWidth(s.strokeWidth()*r)}),a.find("Circle").map(s=>{s.strokeWidth(s.strokeWidth()*r)}),a.find("Ellipse").map(s=>{s.strokeWidth(s.strokeWidth()*r)})),i||RA()}function SA(){const n=document.getElementsByClassName("konvajs-content");n[0].style.visibility="hidden"}function RA(){const n=document.getElementsByClassName("konvajs-content");n[0].style.visibility="visible"}function OA(n){const e=new DOMParser().parseFromString(n,"image/svg+xml");return e.querySelectorAll("rect").forEach(t=>{const r=(t.getAttribute("fill")||"").trim().toLowerCase(),i=r==="#ffffff"||r==="#fff"||r==="white",o=(t.getAttribute("stroke")||"none").trim().toLowerCase();i&&(o==="none"||o==="")&&t.remove()}),new XMLSerializer().serializeToString(e.documentElement)}async function NA(n){const e=L1(n),t=3;e.find("Transformer").forEach(o=>o.destroy());function r(o){const{r:a,g:s,b:l,a:u}=B1(o.stroke());o.strokeScaleEnabled(!0),o.stroke(`rgb(${a},${s},${l})`),o.strokeWidth(t)}e.find("Rect").map(o=>{r(o)}),e.find("Line").map(o=>{r(o)}),e.find("Circle").map(o=>{r(o)}),e.find("Ellipse").map(o=>{r(o)});let i=await IA(e,!1);return i=OA(i),i=i.replaceAll('"',"'"),i}const jA=[0,2,5,10,20,50],sn={DRAW:"draw",IMAGE:"image",POI:"poi",TARGET:"target"},It={CURSOR:"cursor",DELETE:"delete",EDIT:"edit",IMAGE:"image",SHAPE:"shapes",TEXT:"text"},Te={ARROW:"arrow",CIRCLE:"circle",ELLIPSE:"ellipse",FREEHAND:"freehand",IMAGE:"image",POI:"poi",POLYGON:"polygon",RECTANGLE:"rectangle",SHAPES:"shapes"},Yo={fill:"#1e88e5",stroke:"#ffffff",strokeWidth:2};function P1(n,e){const t=Math.min(n,e);return!Number.isFinite(t)||t<=0?10:Math.min(40,Math.max(6,t*.015))}function Jf(n){return Object.values(Te).find(e=>e===n)}const B1=(n="rgba(255,255,255,0.5)")=>window.Konva.Util.colorToRGBA(n),DA=(n={r:255,g:255,b:255,a:.5})=>`rgba(${n.r},${n.g},${n.b},${n.a})`,Ge={IIIF_TYPE:"iiif",JOURNEY_TYPE:"journey",MULTIPLE_BODY_TYPE:"multiple_body",NESTED_MAP_TYPE:"nestedMap",POI_TYPE:"poi",TAGGING_TYPE:"tagging",TEXT_TYPE:"text"},Dg={expert:Ge.IIIF_TYPE,journey:Ge.JOURNEY_TYPE,note:Ge.MULTIPLE_BODY_TYPE,poi:Ge.POI_TYPE,tag:Ge.TAGGING_TYPE},$t={AUDIO:"Audio",IMAGE:"Image",UNKNOWN:"Unknown",VIDEO:"Video"},MA={activeTool:It.SHAPE,closedMode:"closed",fillColor:"rgba(83,162, 235, 0.5)",image:{id:""},imageEvent:null,strokeColor:"rgba(20,82,168,1)",strokeWidth:2},Ln={activeTool:It.EDIT,closedMode:"closed",fillColor:"rgba(100,100,100, 0)",image:{id:null},imageEvent:null,strokeColor:"rgba(255,0, 0, 0.5)",strokeWidth:5},F1="target",Ss="layer";function Mg(){return new Date().toLocaleString([navigator.language],{dateStyle:"short",timeStyle:"short"})}async function kA(n,e,t,r){r?.maeData?r.id?(r.lastSavedDate=Mg(),r.lastEditor=e.getStorageAdapterUser(),console.log("Annotation to update",r),e.update(r).then(i=>{t(n,e.annotationPageId,i)})):(r.id=`${n}/annotation/${hn()}`,r.creationDate=Mg(),r.creator=e.getStorageAdapterUser(),r?.maeData?.manifestNetwork&&(r.id=`${r.id}#${r.maeData.manifestNetwork}`),console.log("Annotation to create",r),e.create(r).then(i=>{t(n,e.annotationPageId,i)})):r.id?e.update(r).then(i=>{t(n,e.annotationPageId,i)}):(r.id=`${n}/annotation/${hn()}`,e.create(r).then(i=>{t(n,e.annotationPageId,i)}))}const G1=In.styled(Dl)(({theme:n})=>({"&:first-of-type":{borderRadius:n.shape.borderRadius},"&:not(:first-of-type)":{borderRadius:n.shape.borderRadius},border:"none",margin:n.spacing(.5),"& .MuiToggleButton-root":{borderRadius:n.shape.borderRadius,color:n.palette.text.primary,transition:"transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease","&:hover":{transform:"translateY(-1px)",boxShadow:n.shadows[1]}},"& .MuiToggleButton-root.Mui-selected":{backgroundColor:n.palette.primary.main,color:n.palette.primary.contrastText,boxShadow:n.shadows[3],transform:"scale(1.03)","&:hover":{backgroundColor:n.palette.primary.dark}}}));function LA(n){return!1}const PA=n=>n.strokeColor===Ln.strokeColor&&n.fillColor===Ln.fillColor,BA=n=>n.type===Te.RECTANGLE,FA=n=>{if(n.length!==1)return!1;const e=n[0];return BA(e)&&(!e?.rotation||e.rotation===0)&&PA(e)},GA=(n,e)=>{console.info("Implement target as string on fullSizeCanvas.");const t=n.target;return`${e}#${t.tend?`xywh=${t.fullCanvaXYWH}&t=${t.tstart},${t.tend}`:`xywh=${t.fullCanvaXYWH}`}`},qA=(n,e,t)=>{console.info("Implement target as string with one shape (rectangle)");let{x:r,y:i,width:o,height:a,scaleX:s,scaleY:l}=t;return o<0&&(o=-o,r-=o),a<0&&(a=-a,i-=a),`${e}#${n.tend?`xywh=${r},${i},${o*s},${a*l}&t=${n.tstart},${n.tend}`:`xywh=${r},${i},${o*s},${a*l}`}`},HA=(n,e)=>({selector:{type:"PointSelector",x:e.x,y:e.y},source:n}),q1=(n,e)=>{const t=`${n.tend?`t=${n.tstart},${n.tend}`:""}`;return{selector:[{type:"SvgSelector",value:n.svg},{type:"FragmentSelector",value:`${e}#${t}`}],source:e}},VA=(n,e,t=null,r=null)=>{const i=n.target,{templateType:o}=n;switch(o){case Ge.IIIF_TYPE:return i;case Ge.POI_TYPE:case Ge.NESTED_MAP_TYPE:return HA(e,i.drawingState.shapes[0]);case Ge.TAGGING_TYPE:case Ge.TEXT_TYPE:case Ge.MULTIPLE_BODY_TYPE:return FA(i.drawingState.shapes)?(console.info("Simple target detected"),qA(i,e,i.drawingState.shapes[0])):(console.info("Implement target as SVG/Fragment with shapes"),q1(i,e));default:return GA(n,e)}},WA=n=>{const e={purpose:"describing",type:"TextualBody",value:""},t=a=>{const s=structuredClone(e);return s.value=a.value||"",s},r=a=>{const s=structuredClone(e);return s.value=a||"",s};let i="",o={};return n["dbf:kind"]==="POI"?i=n["dbf:linkedMap"]?Ge.NESTED_MAP_TYPE:Ge.POI_TYPE:n["dbf:kind"]==="Journey"?i=Ge.JOURNEY_TYPE:n.motivation==="tagging"||Array.isArray(n.motivation)&&n.motivation.includes("tagging")?i=Ge.TAGGING_TYPE:(i=Ge.MULTIPLE_BODY_TYPE,n.bodyValue?o=r(n.bodyValue):n.body&&(o=Array.isArray(n.body)?n.body.map(t):t(n.body))),[i,o]},H1=n=>{const e=n.documentElement,t=document.createElement("div");t.style.position="absolute",t.style.left="-99999px",t.style.width="0",t.style.height="0",t.style.overflow="hidden",t.style.pointerEvents="none",document.body.appendChild(t);const r=document.importNode(e,!0),i="http://www.w3.org/2000/svg",o=document.createElementNS(i,"svg");for(const l of r.attributes||[])o.setAttribute(l.name,l.value);const a=document.createElementNS(i,"g");for(;r.firstChild;)a.appendChild(r.firstChild);o.appendChild(a),t.appendChild(o),t.offsetWidth;const s=a.getBBox();return document.body.removeChild(t),s},zA=({x:n,y:e,w:t,h:r,fullW:i=void 0,fullH:o=void 0})=>{n=parseFloat(n),e=parseFloat(e),t=parseFloat(t),r=parseFloat(r),o?o=parseFloat(o):i&&(i=parseFloat(i));const a=i&&o?`width='${i}' height='${o}'`:"";if([n,e,t,r].some(s=>typeof s!="number"))throw new Error(`xywhToSvg: x,y,w,h must be floats (got x=${n}, y=${e}, w=${t}, h=${r})`);return`<svg
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react/jsx-runtime"),m=require("react"),d=require("prop-types"),tt=require("@mui/material/utils"),pe=require("dbf-mirador"),xn=require("react-redux"),G=require("@mui/material"),In=require("@mui/material/styles"),Rn=require("react-i18next"),Gg=require("@mui/material/Button"),q1=require("@mui/material/Dialog"),C_=require("@mui/material/DialogActions"),H1=require("@mui/material/DialogContent"),E_=require("@mui/material/DialogContentText"),V1=require("@mui/material/DialogTitle"),je=require("@mui/material/Typography"),w_=require("@mui/material/ListItemIcon"),__=require("@mui/material/ListItemText"),W1=require("@mui/material/MenuList"),ul=require("@mui/material/MenuItem"),A_=require("@mui/system"),Ll=require("@mui/material/ToggleButtonGroup"),mu=require("i18next"),Gt=require("@mui/material/ToggleButton"),T_=require("@mui/material/Menu"),I_=require("@mui/material/Divider"),z1=require("@mui/material/SvgIcon"),ep=require("react-dom"),kt=require("react-konva"),xe=require("@emotion/react"),S_=require("@ckeditor/ckeditor5-react"),Ut=require("ckeditor5");function tp(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const dt=tp(m),vi=tp(d),R_=tp(pe),O_=tt.createSvgIcon(f.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"),X1=tt.createSvgIcon(f.jsx("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp"),cf="mae-save-annotation",df="mae-delete-shape",hf="mae-poi-saving";function Bl(n,e){const t=pe.getCompanionWindowsForContent(n,{content:"annotationCreation",windowId:e});return Object.values(t).filter(r=>r?.id)}function j_(n,e,t){Bl(n,t).forEach(r=>{e(pe.removeCompanionWindow(t,r.id))})}function N_({state:n,dispatch:e,windowId:t,config:r}){if(Bl(n,t).length>0){document.dispatchEvent(new CustomEvent(df));return}const o=pe.getSelectedAnnotationId(n,{windowId:t});if(!o)return;const a=r?.annotation?.adapter;if(!a)return;pe.getVisibleCanvases(n,{windowId:t}).forEach(l=>{const u=a(l.id);u.delete(o).then(c=>{e(pe.receiveAnnotation(l.id,u.annotationPageId,c))})}),e(pe.deselectAnnotation(t))}function D_({state:n,windowId:e}){Bl(n,e).length!==0&&document.dispatchEvent(new CustomEvent(cf))}function M_({state:n,dispatch:e,windowId:t}){Bl(n,t).length>0||e(pe.addCompanionWindow(t,{content:"annotationCreation",position:"right"}))}function k_({state:n,dispatch:e,windowId:t}){if(pe.getSelectedAnnotationId(n,{windowId:t})){e(pe.deselectAnnotation(t));return}j_(n,e,t)}const ff={create:{description:"Create a new annotation",handler:M_,keys:["a"]},delete:{description:"Delete selected shape or annotation",handler:N_,keys:["Delete","Backspace"]},escape:{description:"Deselect annotation / close companion window",handler:k_,keys:["Escape"]},save:{description:"Save current annotation",handler:D_,keys:["Enter"]}},P_={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 L_(n){return Object.prototype.hasOwnProperty.call(ff,n)?ff[n].keys:null}function Ri({label:n,action:e}){const t=L_(e);return t?f.jsxs(G.Typography,{variant:"body2",component:"span",sx:{alignItems:"center",display:"inline-flex"},children:[n,t.map(r=>f.jsx(G.Typography,{component:"HotKey",variant:"caption",sx:P_,children:r},r))]}):n}Ri.propTypes={action:d.string.isRequired,label:d.string.isRequired};function np({handleClose:n,open:e,switchToSingleCanvasView:t}){const{t:r}=Rn.useTranslation(),i=m.useCallback(()=>{t(),n()},[n,t]),o=m.useCallback((a,s)=>{n()},[n]);return f.jsxs(q1,{"aria-labelledby":"single-canvas-dialog-title",fullWidth:!0,maxWidth:"sm",onClose:o,open:e,children:[f.jsx(V1,{id:"single-canvas-dialog-title",children:f.jsx(je,{variant:"h2",component:"span",children:r("switch_view_h2")})}),f.jsx(H1,{children:f.jsx(E_,{variant:"body1",color:"inherit",children:r("switch_view_content")})}),f.jsxs(C_,{children:[f.jsx(G.Tooltip,{title:f.jsx(Ri,{label:r("cancel"),action:"escape"}),children:f.jsx(Gg,{onClick:n,children:r("cancel")})}),f.jsx(G.Tooltip,{title:r("switch_view"),children:f.jsx(Gg,{color:"primary",onClick:i,variant:"contained",children:r("switch_view")})})]})]})}np.propTypes={handleClose:d.func.isRequired,open:d.bool.isRequired,switchToSingleCanvasView:d.func.isRequired};const B_=A_.styled(ul)(({theme:n})=>({"&:focus":{backgroundColor:n.palette.action.focus},"&:hover":{backgroundColor:n.palette.action.hover}}));function U1({canvases:n,config:e,handleClose:t,open:r}){const[i,o]=m.useState([]),{t:a}=Rn.useTranslation();m.useEffect(()=>{if(!r)return;(async()=>{const c=async(h,p)=>{const b=e.annotation.adapter(p.id),x=await h,E=await b.all();if(!E)return x;const g=p.__jsonld&&p.__jsonld.label||p.id,v=new Blob([JSON.stringify(E)],{type:"application/json"}),C=window.URL.createObjectURL(v);return[...x,{canvasId:p.id,id:E.id||E["@id"],label:g,url:C}]};if(n?.length>0){const h=await n.reduce(c,[]);o(h)}})()},[n,e,r]);const s=()=>{i.forEach(u=>{try{URL.revokeObjectURL(u.url)}catch{}}),o([]),t()},l=(u,c)=>{if(c==="escapeKeyDown"||c==="backdropClick"){s();return}t()};return f.jsxs(q1,{"aria-labelledby":"annotation-export-dialog-title",id:"annotation-export-dialog",onClose:l,open:r,children:[f.jsx(V1,{id:"annotation-export-dialog-title",children:f.jsx(je,{variant:"h2",component:"span",children:a("export_annotation")})}),f.jsx(H1,{children:i.length===0?f.jsx(je,{variant:"body1",children:a("no_annotation")}):f.jsx(W1,{children:i.map(u=>f.jsxs(B_,{component:"a","aria-label":a("export_annotation_for",{label:u.canvasId}),href:u.url,download:`${u.id}.json`,children:[f.jsx(w_,{children:f.jsx(X1,{})}),f.jsx(__,{children:a("export_annotation_for",{label:u.canvasId})})]},u.canvasId))})})]})}U1.propTypes={canvases:d.arrayOf(d.shape({id:d.string})).isRequired,config:d.shape({annotation:d.shape({adapter:d.func})}).isRequired,handleClose:d.func.isRequired,open:d.bool.isRequired};const dn=[];for(let n=0;n<256;++n)dn.push((n+256).toString(16).slice(1));function F_(n,e=0){return(dn[n[e+0]]+dn[n[e+1]]+dn[n[e+2]]+dn[n[e+3]]+"-"+dn[n[e+4]]+dn[n[e+5]]+"-"+dn[n[e+6]]+dn[n[e+7]]+"-"+dn[n[e+8]]+dn[n[e+9]]+"-"+dn[n[e+10]]+dn[n[e+11]]+dn[n[e+12]]+dn[n[e+13]]+dn[n[e+14]]+dn[n[e+15]]).toLowerCase()}let bu;const G_=new Uint8Array(16);function q_(){if(!bu){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");bu=crypto.getRandomValues.bind(crypto)}return bu(G_)}const H_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qg={randomUUID:H_};function V_(n,e,t){n=n||{};const r=n.random??n.rng?.()??q_();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,F_(r)}function ln(n,e,t){return qg.randomUUID&&!n?qg.randomUUID():V_(n)}var sr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function $1(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var va={},Hg;function W_(){if(Hg)return va;Hg=1,Object.defineProperty(va,"__esModule",{value:!0});function n(o){return!o||typeof o=="string"?o:o+""}class e{async svg2canvas(a,s,l){const u=await new Promise(p=>{var b=new Image;b.onload=function(){p(b)},b.src=a});var c=document.createElement("canvas");return c.width=s,c.height=l,c.getContext("2d").drawImage(u,0,0),c}toDataURL(a,s,l,u,c,h){var p=new XMLSerializer().serializeToString(a),b=document.documentMode;if(b){var x=/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi;x.test(p)&&(p=p.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink'))}h||(h={});var E="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(p);if(u==="image/svg+xml"||!u)return h.async?Promise.resolve(E):E;if(u==="image/jpeg"||u==="image/png"){if(!h.async)throw new Error("svgcanvas: options.async must be set to true if type is image/jpeg | image/png");return(async()=>{const g=await this.svg2canvas(E,s,l),v=g.toDataURL(u,c);return g.remove(),v})()}throw new Error("svgcanvas: Unknown type for toDataURL, please use image/jpeg | image/png | image/svg+xml.")}getImageData(a,s,l,u,c,h,p,b){if(b||(b={}),!b.async)throw new Error("svgcanvas: options.async must be set to true for getImageData");const x=this.toDataURL(a,s,l,"image/svg+xml");return(async()=>{const E=await this.svg2canvas(x,s,l),v=E.getContext("2d").getImageData(u,c,h,p);return E.remove(),v})()}}const t=new e;var r=(function(){var o,a,s,l,u;function c(g,v){var C=Object.keys(v),A;for(A=0;A<C.length;A++)g=g.replace(new RegExp("\\{"+C[A]+"\\}","gi"),v[C[A]]);return g}function h(g){var v,C,A;if(!g)throw new Error("cannot create a random attribute name for an undefined object");v="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",C="";do for(C="",A=0;A<12;A++)C+=v[Math.floor(Math.random()*v.length)];while(g[C]);return C}function p(g,v){var C,A,_={},O;for(g=g.split(","),v=v||10,C=0;C<g.length;C+=2)A="&"+g[C+1]+";",O=parseInt(g[C],v),_[A]="&#"+O+";";return _["\\xa0"]=" ",_}function b(g){var v={left:"start",right:"end",center:"middle",start:"start",end:"end"};return v[g]||v.start}function x(g){var v={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return v[g]||v.alphabetic}u=p("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),o={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"}},s=function(g,v){this.__root=g,this.__ctx=v},s.prototype.addColorStop=function(g,v){var C=this.__ctx.__createElement("stop"),A,_;C.setAttribute("offset",g),n(v).indexOf("rgba")!==-1?(A=/rgba\(\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi,_=A.exec(v),C.setAttribute("stop-color",c("rgb({r},{g},{b})",{r:_[1],g:_[2],b:_[3]})),C.setAttribute("stop-opacity",_[4])):C.setAttribute("stop-color",n(v)),this.__root.appendChild(C)},l=function(g,v){this.__root=g,this.__ctx=v},a=function(g){var v={width:500,height:500,enableMirroring:!1},C;if(arguments.length>1?(C=v,C.width=arguments[0],C.height=arguments[1]):g?C=g:C=v,!(this instanceof a))return new a(C);this.width=C.width||v.width,this.height=C.height||v.height,this.enableMirroring=C.enableMirroring!==void 0?C.enableMirroring:v.enableMirroring,this.canvas=this,this.__document=C.document||document,C.ctx?this.__ctx=C.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=C,this.__id=Math.random().toString(16).substring(2,8),this.__debug("new",g)},a.prototype.__debug=function(...g){this.__options.debug&&console.debug(`svgcanvas#${this.__id}:`,...g)},a.prototype.__createElement=function(g,v,C){typeof v>"u"&&(v={});var A=this.__document.createElementNS("http://www.w3.org/2000/svg",g),_=Object.keys(v),O,R;for(C&&(A.setAttribute("fill","none"),A.setAttribute("stroke","none")),O=0;O<_.length;O++)R=_[O],A.setAttribute(R,v[R]);return A},a.prototype.__setDefaultStyles=function(){var g=Object.keys(o),v,C;for(v=0;v<g.length;v++)C=g[v],this[C]=o[C].canvas},a.prototype.__applyStyleState=function(g){var v=Object.keys(g),C,A;for(C=0;C<v.length;C++)A=v[C],this[A]=g[A]},a.prototype.__getStyleState=function(){var g,v={},C=Object.keys(o),A;for(g=0;g<C.length;g++)A=C[g],v[A]=this[A];return v},a.prototype.__applyTransformation=function(g,v){const{a:C,b:A,c:_,d:O,e:R,f:I}=v||this.getTransform();g.setAttribute("transform",`matrix(${C} ${A} ${_} ${O} ${R} ${I})`)},a.prototype.__applyStyleToCurrentElement=function(g){var v=this.__currentElement,C=this.__currentElementsToStyle;C&&(v.setAttribute(g,""),v=C.element,C.children.forEach(function(k){k.setAttribute(g,"")}));var A=Object.keys(o),_,O,R,I,N,L,B,w;for(_=0;_<A.length;_++)if(O=o[A[_]],R=this[A[_]],O.apply){if(R instanceof l){if(R.__ctx)for(B=0;B<R.__ctx.__defs.childNodes.length;B++)w=R.__ctx.__defs.childNodes[B],L=w.getAttribute("id"),this.__ids[L]=L,this.__defs.appendChild(w);v.setAttribute(O.apply,c("url(#{id})",{id:R.__root.getAttribute("id")}))}else if(R instanceof s)v.setAttribute(O.apply,c("url(#{id})",{id:R.__root.getAttribute("id")}));else if(O.apply.indexOf(g)!==-1&&O.svg!==R)if((O.svgAttr==="stroke"||O.svgAttr==="fill")&&R&&R.indexOf("rgba")!==-1){I=/rgba\(\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi,N=I.exec(R),v.setAttribute(O.svgAttr,c("rgb({r},{g},{b})",{r:N[1],g:N[2],b:N[3]}));var P=N[4],T=this.globalAlpha;T!=null&&(P*=T),v.setAttribute(O.svgAttr+"-opacity",P)}else{var D=O.svgAttr;if(A[_]==="globalAlpha"){if(D=g+"-"+O.svgAttr,v.getAttribute(D))continue}else if(A[_]==="lineWidth"){var M=this.__getTransformScale();R=R*Math.max(M.x,M.y)}v.setAttribute(D,R)}}},a.prototype.__closestGroupOrSvg=function(g){return g=g||this.__currentElement,g.nodeName==="g"||g.nodeName==="svg"?g:this.__closestGroupOrSvg(g.parentNode)},a.prototype.getSerializedSvg=function(g){var v=new XMLSerializer().serializeToString(this.__root),C,A,_,O,R,I;if(I=/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi,I.test(v)&&(v=v.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),g)for(C=Object.keys(u),A=0;A<C.length;A++)_=C[A],O=u[_],R=new RegExp(_,"gi"),R.test(v)&&(v=v.replace(R,O));return v},a.prototype.getSvg=function(){return this.__root},a.prototype.save=function(){var g=this.__createElement("g"),v=this.__closestGroupOrSvg();this.__groupStack.push(v),v.appendChild(g),this.__currentElement=g;const C=this.__getStyleState();this.__debug("save style",C),this.__styleStack.push(C),this.__transformMatrixStack||(this.__transformMatrixStack=[]),this.__transformMatrixStack.push(this.getTransform())},a.prototype.restore=function(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||(this.__currentElement=this.__root.childNodes[1]);var g=this.__styleStack.pop();this.__debug("restore style",g),this.__applyStyleState(g),this.__transformMatrixStack&&this.__transformMatrixStack.length>0&&this.setTransform(this.__transformMatrixStack.pop())},a.prototype.beginPath=function(){var g,v;this.__currentDefaultPath="",this.__currentPosition={},g=this.__createElement("path",{},!0),v=this.__closestGroupOrSvg(),v.appendChild(g),this.__currentElement=g},a.prototype.__applyCurrentDefaultPath=function(){var g=this.__currentElement;g.nodeName==="path"?g.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",g.nodeName)},a.prototype.__addPathCommand=function(g){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=g},a.prototype.moveTo=function(g,v){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:g,y:v},this.__addPathCommand(c("M {x} {y}",{x:this.__matrixTransform(g,v).x,y:this.__matrixTransform(g,v).y}))},a.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand("Z")},a.prototype.lineTo=function(g,v){this.__currentPosition={x:g,y:v},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(c("L {x} {y}",{x:this.__matrixTransform(g,v).x,y:this.__matrixTransform(g,v).y})):this.__addPathCommand(c("M {x} {y}",{x:this.__matrixTransform(g,v).x,y:this.__matrixTransform(g,v).y}))},a.prototype.bezierCurveTo=function(g,v,C,A,_,O){this.__currentPosition={x:_,y:O},this.__addPathCommand(c("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:this.__matrixTransform(g,v).x,cp1y:this.__matrixTransform(g,v).y,cp2x:this.__matrixTransform(C,A).x,cp2y:this.__matrixTransform(C,A).y,x:this.__matrixTransform(_,O).x,y:this.__matrixTransform(_,O).y}))},a.prototype.quadraticCurveTo=function(g,v,C,A){this.__currentPosition={x:C,y:A},this.__addPathCommand(c("Q {cpx} {cpy} {x} {y}",{cpx:this.__matrixTransform(g,v).x,cpy:this.__matrixTransform(g,v).y,x:this.__matrixTransform(C,A).x,y:this.__matrixTransform(C,A).y}))};var E=function(g){var v=Math.sqrt(g[0]*g[0]+g[1]*g[1]);return[g[0]/v,g[1]/v]};return a.prototype.arcTo=function(g,v,C,A,_){var O=this.__currentPosition&&this.__currentPosition.x,R=this.__currentPosition&&this.__currentPosition.y;if(!(typeof O>"u"||typeof R>"u")){if(_<0)throw new Error("IndexSizeError: The radius provided ("+_+") is negative.");if(O===g&&R===v||g===C&&v===A||_===0){this.lineTo(g,v);return}var I=E([O-g,R-v]),N=E([C-g,A-v]);if(I[0]*N[1]===I[1]*N[0]){this.lineTo(g,v);return}var L=I[0]*N[0]+I[1]*N[1],B=Math.acos(Math.abs(L)),w=E([I[0]+N[0],I[1]+N[1]]),P=_/Math.sin(B/2),T=g+P*w[0],D=v+P*w[1],M=[-I[1],I[0]],k=[N[1],-N[0]],V=function(q){var J=q[0],X=q[1];return X>=0?Math.acos(J):-Math.acos(J)},W=V(M),Y=V(k);this.lineTo(T+M[0]*_,D+M[1]*_),this.arc(T,D,_,W,Y)}},a.prototype.stroke=function(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")},a.prototype.fill=function(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")},a.prototype.rect=function(g,v,C,A){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(g,v),this.lineTo(g+C,v),this.lineTo(g+C,v+A),this.lineTo(g,v+A),this.lineTo(g,v),this.closePath()},a.prototype.roundRect=function(g,v,C,A,_){this.__currentElement.nodeName!=="path"&&this.beginPath();let O,R,I,N;typeof _=="number"?(O=_,R=_,I=_,N=_):[O,R,I,N]=_,this.moveTo(g+O,v),this.arcTo(g+C,v,g+C,v+A,R),this.arcTo(g+C,v+A,g,v+A,I),this.arcTo(g,v+A,g,v,N),this.arcTo(g,v,g+C,v,O),this.closePath()},a.prototype.fillRect=function(g,v,C,A){let{a:_,b:O,c:R,d:I,e:N,f:L}=this.getTransform();JSON.stringify([_,O,R,I,N,L])===JSON.stringify([1,0,0,1,0,0])&&g===0&&v===0&&C===this.width&&A===this.height&&this.__clearCanvas();var B,w;B=this.__createElement("rect",{x:g,y:v,width:C,height:A},!0),w=this.__closestGroupOrSvg(),w.appendChild(B),this.__currentElement=B,this.__applyTransformation(B),this.__applyStyleToCurrentElement("fill")},a.prototype.strokeRect=function(g,v,C,A){var _,O;_=this.__createElement("rect",{x:g,y:v,width:C,height:A},!0),O=this.__closestGroupOrSvg(),O.appendChild(_),this.__currentElement=_,this.__applyTransformation(_),this.__applyStyleToCurrentElement("stroke")},a.prototype.__clearCanvas=function(){var g=this.__root.childNodes[1];this.__root.removeChild(g),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__root.appendChild(this.__currentElement),this.__groupStack=[]},a.prototype.clearRect=function(g,v,C,A){let{a:_,b:O,c:R,d:I,e:N,f:L}=this.getTransform();if(JSON.stringify([_,O,R,I,N,L])===JSON.stringify([1,0,0,1,0,0])&&g===0&&v===0&&C===this.width&&A===this.height){this.__clearCanvas();return}var B,w=this.__closestGroupOrSvg();B=this.__createElement("rect",{x:g,y:v,width:C,height:A,fill:"#FFFFFF"},!0),this.__applyTransformation(B),w.appendChild(B)},a.prototype.createLinearGradient=function(g,v,C,A){var _=this.__createElement("linearGradient",{id:h(this.__ids),x1:g+"px",x2:C+"px",y1:v+"px",y2:A+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(_),new s(_,this)},a.prototype.createRadialGradient=function(g,v,C,A,_,O){var R=this.__createElement("radialGradient",{id:h(this.__ids),cx:A+"px",cy:_+"px",r:O+"px",fx:g+"px",fy:v+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(R),new s(R,this)},a.prototype.__applyText=function(g,v,C,A){var _=document.createElement("span");_.setAttribute("style","font:"+this.font);var O=_.style,R=this.__closestGroupOrSvg(),I=this.__createElement("text",{"font-family":O.fontFamily,"font-size":O.fontSize,"font-style":O.fontStyle,"font-weight":O.fontWeight,"text-decoration":this.__fontUnderline,x:v,y:C,"text-anchor":b(this.textAlign),"dominant-baseline":x(this.textBaseline)},!0);if(I.appendChild(this.__document.createTextNode(g)),this.__currentElement=I,this.__applyTransformation(I),this.__applyStyleToCurrentElement(A),this.__fontHref){var N=this.__createElement("a");N.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",this.__fontHref),N.appendChild(I),I=N}R.appendChild(I)},a.prototype.fillText=function(g,v,C){this.__applyText(g,v,C,"fill")},a.prototype.strokeText=function(g,v,C){this.__applyText(g,v,C,"stroke")},a.prototype.measureText=function(g){return this.__ctx.font=this.font,this.__ctx.measureText(g)},a.prototype.arc=function(g,v,C,A,_,O){if(A!==_){A=A%(2*Math.PI),_=_%(2*Math.PI),A===_&&(_=(_+2*Math.PI-.001*(O?-1:1))%(2*Math.PI));var R=g+C*Math.cos(_),I=v+C*Math.sin(_),N=g+C*Math.cos(A),L=v+C*Math.sin(A),B=O?0:1,w=0,P=_-A;P<0&&(P+=2*Math.PI),O?w=P>Math.PI?0:1:w=P>Math.PI?1:0;var T=Math.hypot(this.__transformMatrix.a,this.__transformMatrix.b),D=Math.hypot(this.__transformMatrix.c,this.__transformMatrix.d);this.lineTo(N,L),this.__addPathCommand(c("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:C*T,ry:C*D,xAxisRotation:0,largeArcFlag:w,sweepFlag:B,endX:this.__matrixTransform(R,I).x,endY:this.__matrixTransform(R,I).y})),this.__currentPosition={x:R,y:I}}},a.prototype.ellipse=function(g,v,C,A,_,O,R,I){if(O!==R){var N=this.__matrixTransform(g,v);g=N.x,v=N.y;var L=this.__getTransformScale();C=C*L.x,A=A*L.y,_=_+this.__getTransformRotation(),O=O%(2*Math.PI),R=R%(2*Math.PI),O===R&&(R=(R+2*Math.PI-.001*(I?-1:1))%(2*Math.PI));var B=g+Math.cos(-_)*C*Math.cos(R)+Math.sin(-_)*A*Math.sin(R),w=v-Math.sin(-_)*C*Math.cos(R)+Math.cos(-_)*A*Math.sin(R),P=g+Math.cos(-_)*C*Math.cos(O)+Math.sin(-_)*A*Math.sin(O),T=v-Math.sin(-_)*C*Math.cos(O)+Math.cos(-_)*A*Math.sin(O),D=I?0:1,M=0,k=R-O;k<0&&(k+=2*Math.PI),I?M=k>Math.PI?0:1:M=k>Math.PI?1:0;var V=this.__transformMatrix;this.resetTransform(),this.lineTo(P,T),this.__transformMatrix=V,this.__addPathCommand(c("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:C,ry:A,xAxisRotation:_*(180/Math.PI),largeArcFlag:M,sweepFlag:D,endX:B,endY:w})),this.__currentPosition={x:B,y:w}}},a.prototype.clip=function(){var g=this.__closestGroupOrSvg(),v=this.__createElement("clipPath"),C=h(this.__ids),A=this.__createElement("g");this.__applyCurrentDefaultPath(),g.removeChild(this.__currentElement),v.setAttribute("id",C),v.appendChild(this.__currentElement),this.__defs.appendChild(v),g.setAttribute("clip-path",c("url(#{id})",{id:C})),g.appendChild(A),this.__currentElement=A},a.prototype.drawImage=function(){var g=Array.prototype.slice.call(arguments),v=g[0],C,A,_,O,R=0,I=0,N,L,B,w,P,T,D,M,k,V;if(g.length===3)C=g[1],A=g[2],N=v.width,L=v.height,_=N,O=L;else if(g.length===5)C=g[1],A=g[2],_=g[3],O=g[4],N=v.width,L=v.height;else if(g.length===9)R=g[1],I=g[2],N=g[3],L=g[4],C=g[5],A=g[6],_=g[7],O=g[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);B=this.__closestGroupOrSvg(),this.__currentElement;const W=this.getTransform().translate(C,A);if(v instanceof a){if(w=v.getSvg().cloneNode(!0),w.childNodes&&w.childNodes.length>1){for(P=w.childNodes[0];P.childNodes.length;)V=P.childNodes[0].getAttribute("id"),this.__ids[V]=V,this.__defs.appendChild(P.childNodes[0]);T=w.childNodes[1],T&&(this.__applyTransformation(T,W),B.appendChild(T))}}else(v.nodeName==="CANVAS"||v.nodeName==="IMG")&&(D=this.__createElement("image"),D.setAttribute("width",_),D.setAttribute("height",O),D.setAttribute("preserveAspectRatio","none"),(R||I||N!==v.width||L!==v.height)&&(M=this.__document.createElement("canvas"),M.width=_,M.height=O,k=M.getContext("2d"),k.drawImage(v,R,I,N,L,0,0,_,O),v=M),this.__applyTransformation(D,W),D.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",v.nodeName==="CANVAS"?v.toDataURL():v.getAttribute("src")),B.appendChild(D))},a.prototype.createPattern=function(g,v){var C=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),A=h(this.__ids),_;return C.setAttribute("id",A),C.setAttribute("width",g.width),C.setAttribute("height",g.height),C.setAttribute("patternUnits","userSpaceOnUse"),g.nodeName==="CANVAS"||g.nodeName==="IMG"?(_=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),_.setAttribute("width",g.width),_.setAttribute("height",g.height),_.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",g.nodeName==="CANVAS"?g.toDataURL():g.getAttribute("src")),C.appendChild(_),this.__defs.appendChild(C)):g instanceof a&&(C.appendChild(g.__root.childNodes[1]),this.__defs.appendChild(C)),new l(C,this)},a.prototype.setLineDash=function(g){g&&g.length>0?this.lineDash=g.join(","):this.lineDash=null},a.prototype.setTransform=function(g,v,C,A,_,O){g instanceof DOMMatrix?this.__transformMatrix=new DOMMatrix([g.a,g.b,g.c,g.d,g.e,g.f]):this.__transformMatrix=new DOMMatrix([g,v,C,A,_,O])},a.prototype.getTransform=function(){let{a:g,b:v,c:C,d:A,e:_,f:O}=this.__transformMatrix;return new DOMMatrix([g,v,C,A,_,O])},a.prototype.resetTransform=function(){this.setTransform(1,0,0,1,0,0)},a.prototype.scale=function(g,v){if(v===void 0&&(v=g),isNaN(g)||isNaN(v)||!isFinite(g)||!isFinite(v))return;let C=this.getTransform().scale(g,v);this.setTransform(C)},a.prototype.rotate=function(g){let v=this.getTransform().multiply(new DOMMatrix([Math.cos(g),Math.sin(g),-Math.sin(g),Math.cos(g),0,0]));this.setTransform(v)},a.prototype.translate=function(g,v){const C=this.getTransform().translate(g,v);this.setTransform(C)},a.prototype.transform=function(g,v,C,A,_,O){const R=this.getTransform().multiply(new DOMMatrix([g,v,C,A,_,O]));this.setTransform(R)},a.prototype.__matrixTransform=function(g,v){return new DOMPoint(g,v).matrixTransform(this.__transformMatrix)},a.prototype.__getTransformScale=function(){return{x:Math.hypot(this.__transformMatrix.a,this.__transformMatrix.b),y:Math.hypot(this.__transformMatrix.c,this.__transformMatrix.d)}},a.prototype.__getTransformRotation=function(){return Math.atan2(this.__transformMatrix.b,this.__transformMatrix.a)},a.prototype.getImageData=function(g,v,C,A,_){return t.getImageData(this.getSvg(),this.width,this.height,g,v,C,A,_)},a.prototype.drawFocusRing=function(){},a.prototype.createImageData=function(){},a.prototype.putImageData=function(){},a.prototype.globalCompositeOperation=function(){},a})();function i(o){this.ctx=new r(o),this.svg=this.ctx.__root;var a=this.svg,s=this,l=document.createElement("div");l.style.display="inline-block",l.appendChild(a),this.wrapper=l,Object.defineProperty(this,"className",{get:function(){return l.getAttribute("class")||""},set:function(u){return l.setAttribute("class",u)}}),Object.defineProperty(this,"tagName",{get:function(){return"CANVAS"},set:function(){}}),["width","height"].forEach(function(u){Object.defineProperty(s,u,{get:function(){return a.getAttribute(u)|0},set:function(c){if(!(isNaN(c)||typeof c>"u"))return s.ctx[u]=c,a.setAttribute(u,c),l[u]=c}})}),["style","id"].forEach(function(u){Object.defineProperty(s,u,{get:function(){return l[u]},set:function(c){if(typeof c<"u")return l[u]=c}})}),["getBoundingClientRect"].forEach(function(u){s[u]=function(){return a[u]()}})}return i.prototype.getContext=function(o){if(o!=="2d")throw new Error("Unsupported type of context for SVGCanvas");return this.ctx},i.prototype.toObjectURL=function(){var o=new XMLSerializer().serializeToString(this.svg),a=new Blob([o],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(a)},i.prototype.toDataURL=function(o,a,s){return t.toDataURL(this.svg,this.width,this.height,o,a,s)},i.prototype.addEventListener=function(){return this.svg.addEventListener.apply(this.svg,arguments)},i.prototype.getElement=function(){return this.wrapper},i.prototype.getAttribute=function(o){return this.wrapper.getAttribute(o)},i.prototype.setAttribute=function(o,a){this.wrapper.setAttribute(o,a)},va.Context=r,va.Element=i,va}var z_=W_();const Vg=async n=>new Promise(e=>setTimeout(e,n));async function X_(n,e=!1,{onBefore:t,onAfter:r}={}){const i=n.getLayers()[0];t&&t([n,i]),await Vg(200);const o=i.canvas.context._context,a=i.canvas.context._context=new z_.Context({height:n.height(),width:n.width(),ctx:o});n.draw();let s=a.getSerializedSvg();return s=e?new Blob([s],{type:"image/svg+xml;charset=utf-8"}):s,i.canvas.context._context=o,r&&r([n,i]),await Vg(200),n.draw(),s}function Y1(n){return window.Konva.stages.find(e=>e.attrs.id===n)}function hs(n,e,t,r,i=!0,o=!1){U_();const a=Y1(n);a.width(e),a.height(t),a.scale({x:r,y:r}),o&&(a.find("Rect").map(s=>{s.strokeWidth(s.strokeWidth()*r)}),a.find("Line").map(s=>{s.strokeWidth(s.strokeWidth()*r)}),a.find("Circle").map(s=>{s.strokeWidth(s.strokeWidth()*r)}),a.find("Ellipse").map(s=>{s.strokeWidth(s.strokeWidth()*r)})),i||$_()}function U_(){const n=document.getElementsByClassName("konvajs-content");n[0].style.visibility="hidden"}function $_(){const n=document.getElementsByClassName("konvajs-content");n[0].style.visibility="visible"}function Y_(n){const e=new DOMParser().parseFromString(n,"image/svg+xml");return e.querySelectorAll("rect").forEach(t=>{const r=(t.getAttribute("fill")||"").trim().toLowerCase(),i=r==="#ffffff"||r==="#fff"||r==="white",o=(t.getAttribute("stroke")||"none").trim().toLowerCase();i&&(o==="none"||o==="")&&t.remove()}),new XMLSerializer().serializeToString(e.documentElement)}async function Z_(n){const e=Y1(n),t=3;e.find("Transformer").forEach(o=>o.destroy());function r(o){const{r:a,g:s,b:l,a:u}=Z1(o.stroke());o.strokeScaleEnabled(!0),o.stroke(`rgb(${a},${s},${l})`),o.strokeWidth(t)}e.find("Rect").map(o=>{r(o)}),e.find("Line").map(o=>{r(o)}),e.find("Circle").map(o=>{r(o)}),e.find("Ellipse").map(o=>{r(o)});let i=await X_(e,!1);return i=Y_(i),i=i.replaceAll('"',"'"),i}const J_=[0,2,5,10,20,50],Qt={DRAW:"draw",IMAGE:"image",POI:"poi",TARGET:"target"},yt={CURSOR:"cursor",DELETE:"delete",EDIT:"edit",IMAGE:"image",PAN:"pan",SHAPE:"shapes",TEXT:"text"},we={ARROW:"arrow",CIRCLE:"circle",ELLIPSE:"ellipse",FREEHAND:"freehand",IMAGE:"image",POI:"poi",POLYGON:"polygon",RECTANGLE:"rectangle",SHAPES:"shapes"},Ti={fill:"#1e88e5",stroke:"#ffffff",strokeWidth:2};function rp(n,e){const t=Math.min(n,e);return!Number.isFinite(t)||t<=0?10:Math.min(40,Math.max(6,t*.015))}function ip(n){return Object.values(we).find(e=>e===n)}const Z1=(n="rgba(255,255,255,0.5)")=>window.Konva.Util.colorToRGBA(n),K_=(n={r:255,g:255,b:255,a:.5})=>`rgba(${n.r},${n.g},${n.b},${n.a})`,Ge={IIIF_TYPE:"iiif",JOURNEY_TYPE:"journey",MULTIPLE_BODY_TYPE:"multiple_body",NESTED_MAP_TYPE:"nestedMap",POI_TYPE:"poi",TAGGING_TYPE:"tagging",TEXT_TYPE:"text"},Wg={expert:Ge.IIIF_TYPE,journey:Ge.JOURNEY_TYPE,note:Ge.MULTIPLE_BODY_TYPE,poi:Ge.POI_TYPE,tag:Ge.TAGGING_TYPE},Yt={AUDIO:"Audio",IMAGE:"Image",UNKNOWN:"Unknown",VIDEO:"Video"},Q_={activeTool:yt.SHAPE,closedMode:"closed",fillColor:"rgba(83,162, 235, 0.5)",image:{id:""},imageEvent:null,strokeColor:"rgba(20,82,168,1)",strokeWidth:2},Ln={activeTool:yt.EDIT,closedMode:"closed",fillColor:"rgba(100,100,100, 0)",image:{id:null},imageEvent:null,strokeColor:"rgba(255,0, 0, 0.5)",strokeWidth:5},J1="target",Os="layer";function zg(){return new Date().toLocaleString([navigator.language],{dateStyle:"short",timeStyle:"short"})}async function K1(n,e,t,r){const i=o=>(t(n,e.annotationPageId,o),o);return r?.maeData?r.id?(r.lastSavedDate=zg(),r.lastEditor=e.getStorageAdapterUser(),console.log("Annotation to update",r),e.update(r).then(i)):(r.id=`${n}/annotation/${ln()}`,r.creationDate=zg(),r.creator=e.getStorageAdapterUser(),r?.maeData?.manifestNetwork&&(r.id=`${r.id}#${r.maeData.manifestNetwork}`),console.log("Annotation to create",r),e.create(r).then(i)):r.id?e.update(r).then(i):(r.id=`${n}/annotation/${ln()}`,e.create(r).then(i))}const Q1=In.styled(Ll)(({theme:n})=>({"&:first-of-type":{borderRadius:n.shape.borderRadius},"&:not(:first-of-type)":{borderRadius:n.shape.borderRadius},border:"none",margin:n.spacing(.5),"& .MuiToggleButton-root":{borderRadius:n.shape.borderRadius,color:n.palette.text.primary,transition:"transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease","&:hover":{transform:"translateY(-1px)",boxShadow:n.shadows[1]}},"& .MuiToggleButton-root.Mui-selected":{backgroundColor:n.palette.primary.main,color:n.palette.primary.contrastText,boxShadow:n.shadows[3],transform:"scale(1.03)","&:hover":{backgroundColor:n.palette.primary.dark}}}));function eA(n){return!1}const tA=n=>n.strokeColor===Ln.strokeColor&&n.fillColor===Ln.fillColor,nA=n=>n.type===we.RECTANGLE,rA=n=>{if(n.length!==1)return!1;const e=n[0];return nA(e)&&(!e?.rotation||e.rotation===0)&&tA(e)},iA=(n,e)=>{console.info("Implement target as string on fullSizeCanvas.");const t=n.target;return`${e}#${t.tend?`xywh=${t.fullCanvaXYWH}&t=${t.tstart},${t.tend}`:`xywh=${t.fullCanvaXYWH}`}`},oA=(n,e,t)=>{console.info("Implement target as string with one shape (rectangle)");let{x:r,y:i,width:o,height:a,scaleX:s,scaleY:l}=t;return o<0&&(o=-o,r-=o),a<0&&(a=-a,i-=a),`${e}#${n.tend?`xywh=${r},${i},${o*s},${a*l}&t=${n.tstart},${n.tend}`:`xywh=${r},${i},${o*s},${a*l}`}`},ex=(n,e)=>({selector:{type:"PointSelector",x:e.x,y:e.y},source:n}),tx=(n,e)=>{const t=`${n.tend?`t=${n.tstart},${n.tend}`:""}`;return{selector:[{type:"SvgSelector",value:n.svg},{type:"FragmentSelector",value:`${e}#${t}`}],source:e}},aA=(n,e,t=null,r=null)=>{const i=n.target,{templateType:o}=n;switch(o){case Ge.IIIF_TYPE:return i;case Ge.POI_TYPE:case Ge.NESTED_MAP_TYPE:return ex(e,i.drawingState.shapes[0]);case Ge.TAGGING_TYPE:case Ge.TEXT_TYPE:case Ge.MULTIPLE_BODY_TYPE:return rA(i.drawingState.shapes)?(console.info("Simple target detected"),oA(i,e,i.drawingState.shapes[0])):(console.info("Implement target as SVG/Fragment with shapes"),tx(i,e));default:return iA(n,e)}},sA=n=>{const e={purpose:"describing",type:"TextualBody",value:""},t=a=>{const s=structuredClone(e);return s.value=a.value||"",s},r=a=>{const s=structuredClone(e);return s.value=a||"",s};let i="",o={};return n["dbf:kind"]==="POI"?i=n["dbf:linkedMap"]?Ge.NESTED_MAP_TYPE:Ge.POI_TYPE:n["dbf:kind"]==="Journey"?i=Ge.JOURNEY_TYPE:n.motivation==="tagging"||Array.isArray(n.motivation)&&n.motivation.includes("tagging")?i=Ge.TAGGING_TYPE:(i=Ge.MULTIPLE_BODY_TYPE,n.bodyValue?o=r(n.bodyValue):n.body&&(o=Array.isArray(n.body)?n.body.map(t):t(n.body))),[i,o]},nx=n=>{const e=n.documentElement,t=document.createElement("div");t.style.position="absolute",t.style.left="-99999px",t.style.width="0",t.style.height="0",t.style.overflow="hidden",t.style.pointerEvents="none",document.body.appendChild(t);const r=document.importNode(e,!0),i="http://www.w3.org/2000/svg",o=document.createElementNS(i,"svg");for(const l of r.attributes||[])o.setAttribute(l.name,l.value);const a=document.createElementNS(i,"g");for(;r.firstChild;)a.appendChild(r.firstChild);o.appendChild(a),t.appendChild(o),t.offsetWidth;const s=a.getBBox();return document.body.removeChild(t),s},lA=({x:n,y:e,w:t,h:r,fullW:i=void 0,fullH:o=void 0})=>{n=parseFloat(n),e=parseFloat(e),t=parseFloat(t),r=parseFloat(r),o?o=parseFloat(o):i&&(i=parseFloat(i));const a=i&&o?`width='${i}' height='${o}'`:"";if([n,e,t,r].some(s=>typeof s!="number"))throw new Error(`xywhToSvg: x,y,w,h must be floats (got x=${n}, y=${e}, w=${t}, h=${r})`);return`<svg
|
|
2
2
|
version='1.1'
|
|
3
3
|
xmlns='http://www.w3.org/2000/svg'
|
|
4
4
|
xmlns:xlink='http://www.w3.org/1999/xlink'
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
stroke-dasharray=''
|
|
17
17
|
/>
|
|
18
18
|
</g></g>
|
|
19
|
-
</svg>`},
|
|
19
|
+
</svg>`},js=1.5,uA=n=>{const[e]=n;if(n.length===2){const[,r]=n;return`M ${e.x},${e.y} L ${r.x},${r.y}`}const t=n.slice(0,-1).map((r,i)=>{const o=n[i-1]??r,a=n[i+1],s=n[i+2]??a,l=r.x+(a.x-o.x)*js/6,u=r.y+(a.y-o.y)*js/6,c=a.x-(s.x-r.x)*js/6,h=a.y-(s.y-r.y)*js/6;return`C ${l},${u} ${c},${h} ${a.x},${a.y}`});return`M ${e.x},${e.y} ${t.join(" ")}`},cA="15,10",dA=({points:n,fullW:e,fullH:t})=>{const r=parseFloat(e),i=parseFloat(t);if(!Number.isFinite(r)||!Number.isFinite(i))throw new Error(`smoothCurveToSvg: fullW,fullH must be floats (got fullW=${r}, fullH=${i})`);const o=uA(n);return`<svg
|
|
20
20
|
version='1.1'
|
|
21
21
|
xmlns='http://www.w3.org/2000/svg'
|
|
22
22
|
xmlns:xlink='http://www.w3.org/1999/xlink'
|
|
@@ -27,30 +27,30 @@
|
|
|
27
27
|
<path
|
|
28
28
|
d='${o}'
|
|
29
29
|
fill='none'
|
|
30
|
-
stroke='${
|
|
30
|
+
stroke='${Ti.fill}'
|
|
31
31
|
stroke-width='${Ln.strokeWidth}'
|
|
32
32
|
stroke-miterlimit='10'
|
|
33
|
-
stroke-dasharray='${
|
|
33
|
+
stroke-dasharray='${cA}'
|
|
34
34
|
/>
|
|
35
35
|
</g></g>
|
|
36
|
-
</svg>`},YA=n=>{const[e,t,r,i]=n.value.replace("xywh=","").split(",").map(parseFloat),o={id:hn(),rotation:0,scaleX:1,scaleY:1,x:e,y:t,width:r,height:i,type:Te.RECTANGLE,fill:Ln.fillColor,stroke:Ln.strokeColor,strokeWidth:Ln.strokeWidth};return{drawingState:JSON.stringify({currentShape:o,shapes:[o],isDrawing:!1}),svg:zA({x:e,y:t,w:r,h:i})}},ZA=(n,e)=>{const t=H1(n),r={fill:Yo.fill,id:hn(),radius:Math.max(t.width,t.height)/2,rotation:0,scaleX:1,scaleY:1,stroke:Yo.stroke,strokeWidth:Yo.strokeWidth,type:Te.POI,x:t.x+t.width/2,y:t.y+t.height/2},i={drawingState:JSON.stringify({currentShape:r,isDrawing:!1,shapes:[r]}),svg:e},o=n.querySelector("svg").getAttribute("width")||void 0,a=n.querySelector("svg").getAttribute("height")||void 0;return o&&a&&(i.fullCanvaXYWH=`0,0,${o},${a}`),i},JA=n=>{const e={...Yo,id:hn(),radius:P1(),rotation:0,scaleX:1,scaleY:1,type:Te.POI,x:n.x,y:n.y};return{drawingState:JSON.stringify({currentShape:e,isDrawing:!1,shapes:[e]})}},KA=(n,e)=>{const r=new DOMParser().parseFromString(n.value,"image/svg+xml");if(e===Ge.POI_TYPE||e===Ge.NESTED_MAP_TYPE)return ZA(r,n.value);const i=H1(r),o=r.querySelector("svg").getAttribute("width")||void 0,a=r.querySelector("svg").getAttribute("height")||void 0,s={id:hn(),rotation:0,scaleX:1,scaleY:1,x:i.x,y:i.y,width:i.width,height:i.height,type:Te.RECTANGLE,fill:r.querySelector("path[fill]")?.getAttribute("fill")||Ln.fillColor,stroke:r.querySelector("path[stroke]")?.getAttribute("stroke")||Ln.strokeColor,strokeWidth:r.querySelector("path[stroke-width]")?.getAttribute("stroke-width")||Ln.strokeWidth},l={drawingState:JSON.stringify({currentShape:s,shapes:[s],isDrawing:!1}),svg:n.value};return o&&a&&(l.fullCanvaXYWH=`0,0,${o},${a}`),l},QA=(n,e,t)=>{const r=["SvgSelector","FragmentSelector","PointSelector"],i=Array.isArray(n.selector)?n.selector:[n.selector];for(const o of i)try{if(o.type==="SvgSelector")return KA(o,t);if(o.type==="FragmentSelector")return YA(o);if(o.type==="PointSelector")return JA(o)}catch(a){console.error(`Error generating maeData from selector ${o.type}, attempting to fallback to other selector`,a)}return console.error(`On annotation '${e}': none of the selector types in the annotation are unsupported: ${i.map(o=>o.type)}. Supported selectors are: [${r}].`),{}};function kl(n){if(!n.maeData||Object.keys(n.maeData||{}).length===0)try{const e={target:{},templateType:"",tags:[],textBody:{}},[t,r]=WA(n);return e.templateType=t,e.textBody=r,e.target=QA(n.target,n.id,t),n.maeData=e,n}catch(e){return console.error("Error generating maeData from annotation",e),n}return n}const ta=n=>{if(!n)return!0;const e=n.trim();return e===""?!0:e.replace(/<[^>]*>/g,"").trim()===""},ll=()=>`${new Date().toLocaleString()}`,e_=[Ge.TAGGING_TYPE,Ge.TEXT_TYPE,Ge.MULTIPLE_BODY_TYPE,Ge.POI_TYPE,Ge.NESTED_MAP_TYPE],hs=async(n,e,t,r)=>{const i=n;return i.maeData.target={drawingState:i.maeData.target.drawingState,fullCanvaXYWH:i.maeData.target.fullCanvaXYWH,scale:i.maeData.target.scale,tend:i.maeData.target.tend,tstart:i.maeData.target.tstart},console.info("Annotation state target",i.maeData.target),e_.includes(i.maeData.templateType)&&i.maeData.target.drawingState.shapes.length>0&&(i.maeData.target.svg=await NA(t)),LA(i.maeData),i.maeData.target.scale=r.getMediaTrueHeight()/r.getDisplayedMediaHeight()*r.getZoom(),i.target=VA(i.maeData,e.id,t,r.getScale()),i.maeData.target.drawingState=JSON.stringify(i.maeData.target.drawingState),i},V1=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=n;return i.body&&!Array.isArray(i.body)&&ta(i.body.value)&&(i.body.value=ll()),hs(i,e,t,r)},W1=n=>{const e=n;return e.maeData?.textBody&&ta(e.maeData.textBody.value)&&(e.maeData.textBody.value=ll()),e.body=[e.maeData.textBody],e.body.push(...e.maeData.tags.map(t=>({id:t.value,purpose:"tagging",type:"TextualBody",value:t.value}))),e},t_=async(n,e,t,r)=>{const i=n;return n.maeData.templateType===Ge.IIIF_TYPE?n:(i.body&&!Array.isArray(i.body)&&ta(i.body.value)&&(i.body.value=ll()),i.maeData.templateType===Ge.MULTIPLE_BODY_TYPE?W1(i):i.maeData?.textBody&&ta(i.maeData.textBody.value)&&(i.maeData.textBody.value=ll()),hs(i,e,t,r))};function kg(n){const e={chars:n.value};return n.purpose==="tagging"?e["@type"]="oa:Tag":e["@type"]="dctypes:Text",n.format&&(e.format=n.format),n.language&&(e.language=n.language),n.purpose&&(e.motivation=n.purpose),e}function Lg(n){switch(n.type){case"SvgSelector":return{"@type":"oa:SvgSelector",value:n.value};case"FragmentSelector":return{"@type":"oa:FragmentSelector",value:n.value};case"PointSelector":return{"@type":"oa:PointSelector",x:n.x,y:n.y};default:return null}}function n_(n){const e={"@context":"https://iiif.io/api/presentation/2/context.json","@type":"oa:Annotation",maeData:n.maeData||{},motivation:"oa:commenting"};if(n.id?.startsWith("http")&&(e["@id"]=n.id),Array.isArray(n.body)?e.resource=n.body.map(t=>kg(t)):e.resource=kg(n.body),typeof n.target=="object"&&!Array.isArray(n.target)&&n.target!==null?e.on={"@type":"oa:SpecificResource",full:n.target.source?.id||n.target.id||n.target.source}:e.on=n.target,n.target.selector){if(Array.isArray(n.target.selector)){const t=n.target.selector.map(r=>Lg(r));e.on.selector={"@type":"oa:Choice",default:t[0],item:t[1]}}else e.on.selector=Lg(n.target.selector);n.target.source?.partOf&&(e.on.within={"@id":n.target.source.partOf.id,"@type":"sc:Manifest"})}return e}function Pg(n){const e={type:"TextualBody",value:n.chars};return n.motivation&&(e.purpose=n.motivation),n.format&&(e.format=n.format),n.language&&(e.language=n.language),n["@type"]==="oa:Tag"&&(e.purpose="tagging"),e}function lf(n){switch(n["@type"]){case"oa:SvgSelector":return{type:"SvgSelector",value:n.value};case"oa:FragmentSelector":return{type:"FragmentSelector",value:n.value};case"oa:PointSelector":return{type:"PointSelector",x:n.x,y:n.y};case"oa:Choice":return[lf(n.default),lf(n.item)];default:return null}}function r_(n){const e={id:n["@id"],maeData:n.maeData||{},motivation:"commenting",type:"Annotation"};Array.isArray(n.resource)?e.body=n.resource.map(r=>Pg(r)):n.resource?e.body=Pg(n.resource):e.body={};let t=n.on;return Array.isArray(t)&&([t]=t),e.target={selector:lf(t.selector),source:t.full},t.within&&(e.target.source={id:t.full,partOf:{id:t.within["@id"],type:"Manifest"},type:"Canvas"}),e}function i_(n,e){if(Array.isArray(n)){const t=n.map(r=>r_(r));return{id:e,items:t,type:"AnnotationPage"}}return n}class z1{constructor(e,t){this.annotationPageId=e,t?this.user=t:this.user=ul}getStorageAdapterUser(){return this.user}async create(e){const t={id:this.annotationPageId,items:[],type:"AnnotationPage"},r=await this.all()||t;return r.items.push(e),localStorage.setItem(this.annotationPageId,JSON.stringify(r)),console.log("CREATE ANNOTATION",r),r}async update(e){const t=await this.all();if(t){const r=t.items.findIndex(i=>i.id===e.id);return t.items.splice(r,1,e),localStorage.setItem(this.annotationPageId,JSON.stringify(t)),console.log("UPDATE ANNOTATION",t),t}return null}async delete(e){const t=await this.all();return t&&(t.items=t.items.filter(r=>r.id!==e)),localStorage.setItem(this.annotationPageId,JSON.stringify(t)),t}async get(e){const t=await this.all();return t?t.items.find(r=>r.id===e):null}async all(){const e=JSON.parse(localStorage.getItem(this.annotationPageId));return e&&(e.items=e.items.map(kl)),e}}const ul="Anonymous",o_={add_a_circle:"إضافة دائرة",add_a_free_hand_shape:"إضافة شكل حر",add_a_line:"إضافة خط",add_a_rectangle:"إضافة مستطيل",add_an_arrow_shape:"إضافة شكل سهم",add_an_ellipse:"إضافة شكل بيضاوي",add_image_from_url:"إضافة صورة من رابط URL",anonymous:"مجهول",applyMerge:"تطبيق",arrow:"سهم",border_color:"لون الحدود",cancel:"إلغاء",circle:"دائرة",click_on_canvas_to_write:" انقر على اللوحة للكتابة",click_to_delete_shape:"انقر على الشكل لحذفه",confirmTemplateSelectionContent:"تحتوي ملاحظتك بالفعل على محتوى. راجع القالب أدناه، ثم عدّل ملاحظتك لدمج ما تحتاجه.",confirmTemplateSelectionTitle:"دمج القالب مع ملاحظتك",container_size:"حجم الحاوية",create_annotation:"إنشاء تعليق توضيحي",createdByOn:"أنشأه {{creator}}، {{creationDate}}",currentNoteContent:"ملاحظتك",debugAnnotation:"تصحيح التعليق التوضيحي في وحدة التحكم",delete:"حذف",delete_all:"حذف الكل",deleteAnnotation:"حذف",detected_media_type:"تم اكتشاف نوع الوسائط {{mediaType}}.",document:"مستند",drawings_and_text_in_overlay:"رسومات ونص في الطبقة العلوية",edit:"تعديل",edit_annotation:"تعديل التعليق التوضيحي",edit_iiif_json_code:"تعديل كود IIIF JSON مباشرة",ellipse:"شكل بيضاوي",expert_mode:"وضع الخبير",export_annotation:"تصدير التعليقات التوضيحية",export_annotation_for:"تصدير التعليق التوضيحي لـ {{label}}",export_local_annotation:"تصدير التعليقات التوضيحية المحلية للعناصر المرئية",fill_color:"لون التعبئة",freehand:"رسم حر",image:"صورة",image_displayed:"الصورة المعروضة",image_in_overlay_with_note:"صورة في الطبقة العلوية مع ملاحظة",image_true_size:"الحجم الحقيقي للصورة",imageUrl:"رابط الصورة",journey:"مسار",journey_description:"سلسلة مرتبة من نقاط الاهتمام، بعنوان ووصف اختياري",journey_description_placeholder:"صف هذا المسار…",journey_description_section:"الوصف",journey_hint:"Use the left annotation list to associate POIs to journey and order them",journey_language:"اللغة",journey_media_ar:"الوسائط (عربي)",journey_media_en:"الوسائط (إنجليزي)",journey_media_keep_same:"استخدام نفس الوسائط لكلا اللغتين",journey_title:"العنوان",journey_title_required:"أدخل عنوانًا لكل لغة.",lastEditedByOn:"آخر تعديل بواسطة {{lastEditor}}، {{lastSavedDate}}",line:"خط",line_weight:"سمك الخط",loading_failed:"فشل التحميل",maev_github_link:"https://github.com/SCENE-CE/mirador-annotation-editor-video",manifest_link:"تعليق توضيحي على البيان",manifest_link_with_note:"بيان مع ملاحظة",manifest_url:"رابط البيان",map_relation_no_results:"لا توجد خرائط مطابقة",map_relation_search_prompt:"ابدأ الكتابة للبحث عن خرائط",media_not_supported:"الوسائط غير مدعومة",media_not_supported_text:"الوسائط التي تحاول التعليق عليها غير مدعومة حاليًا في هذا النظام",metadata:"البيانات الوصفية",move_to_journey:"نقل إلى مسار",nested_map:"خريطة متداخلة",nested_map_description:"نقطة اهتمام تفتح خريطة أخرى عند النقر عليها",nested_map_linked_map:"الخريطة المرتبطة",nested_map_linked_map_required:"اختر خريطة لربط هذه النقطة بها.",new_annotation:"تعليق توضيحي جديد",no_annotation:"لا توجد تعليقات توضيحية مخزنة بعد.",note:"ملاحظة",object_list:"قائمة العناصر",onlyOneImageAllowed:"يُسمح بصورة واحدة فقط",openNestedMap:"فتح الخريطة",overlay:"الطبقة العلوية",poi:"نقطة اهتمام",poi_click_to_place:"انقر على الصورة لوضع علامة نقطة الاهتمام. انقر مرة أخرى لتحريكها.",poi_description:"نقطة اهتمام لها موقع ووصف وروابط اختيارية",poi_description_placeholder:"صف نقطة الاهتمام هذه…",poi_description_section:"الوصف",poi_language:"اللغة",poi_latitude:"خط العرض",poi_latitude_invalid:"يجب أن يكون خط العرض بين -90 و90.",poi_longitude:"خط الطول",poi_longitude_invalid:"يجب أن يكون خط الطول بين -180 و180.",poi_media_ar:"الوسائط (عربي)",poi_media_en:"الوسائط (إنجليزي)",poi_media_keep_same:"استخدام نفس الوسائط لكلا اللغتين",poi_media_no_results:"لا توجد نتائج مطابقة",poi_media_search_prompt:"ابدأ الكتابة للبحث",poi_media_source_iiif_image:"صورة IIIF",poi_media_source_media_item:"عنصر الوسائط",poi_media_source_upload:"مكتبة الوسائط",poi_target_must_be_point:"انقر على الصورة لتحديد موقع نقطة الاهتمام هذه.",poi_title:"العنوان",poi_title_required:"أدخل عنوانًا لكل لغة.",polygon:"مضلع",previewAnnotation:"معاينة",pressEnterOrClickFirstPointToClose:'انقر على النقطة الأولى أو اضغط "Shift" لإغلاق المضلع، أو "Tab" لتركه مفتوحًا',pressEnterToAddTag:'أضف الوسم واضغط "Enter"',pressEscapeToFinish:'اضغط "Esc" لإنهاء الخط',rectangle:"مستطيل",refresh_journey_path:"تحديث المسار",remove_from_journey:"إزالة من المسار",replace:"استبدال",save:"حفظ",saving:"جارٍ الحفظ…",scale:"المقياس",select_cursor:"مؤشر التحديد",selected_object:"العنصر المحدد",selectedTemplateContent:"القالب المحدد",shape:"شكل",shape_selection:"رسم الأشكال",shapes:"الأشكال",spatialTarget:"الأشكال",style:"النمط",style_selection:"اختيار النمط",switch_view:"التبديل إلى العرض الفردي",switch_view_content:`لا يمكن تعديل التعليقات التوضيحية إلا في عرض اللوحة الفردية.
|
|
37
|
-
هل تريد التبديل إلى عرض فردي الآن؟`,switch_view_h2:"التبديل إلى عرض فردي؟",tag:"وسم",tag_with_target:"وسم بموقع مستهدف",tags:"الوسوم",tagsPlaceholder:"أضف وسومًا ...",target:"الموقع المستهدف",text:"نص",textual_note_with_target:"ملاحظة نصية بموقع مستهدف",tool_selection:"اختيار الأداة",unsupported_media_message:"نوع وسائط اللوحة الحالية غير مدعوم من محرر التعليقات التوضيحية.",useTemplate:"استخدام قالب",video_annotation_instruction:"إذا كنت تريد التعليق على وسائط الفيديو، يجب عليك تثبيت MAEV لإنشاء وتعديل التعليقات التوضيحية على الفيديو:",your_tag_here:"أضف وسمك هنا:",zoom:"تكبير/تصغير"},
|
|
38
|
-
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"},
|
|
39
|
-
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"},Kf={ar:o_,en:a_,fr:s_},l_=In.styled("div")(()=>({display:"flex"}));function X1({targetProps:n,TargetComponent:e,annotationEditCompanionWindowIsOpened:t}){const{t:r}=Bn.useTranslation(),[i,o]=m.useState(!1),[a,s]=m.useState(!1),[l,u]=m.useState(null),[c,h]=m.useState(!1),f=xn.useDispatch();m.useEffect(()=>{const T=D=>h(D.detail.saving);return document.addEventListener(af,T),()=>document.removeEventListener(af,T)},[]);const b=(T,D)=>{u(n.windowId),f(be.addCompanionWindow(n.windowId,{content:T,...D}))};m.useEffect(()=>{},[t]);const x=()=>{f(be.setWindowViewType(n.windowId,"single"))},w=xn.useSelector(T=>be.getWindowViewType(T,{windowId:n.windowId})),g=xn.useSelector(T=>be.getVisibleCanvases(T,{windowId:n.windowId})),y=xn.useSelector(T=>T.config),C=m.useCallback(T=>{b("annotationCreation",{position:"right"})},[n.windowId]),A=m.useCallback(()=>{s(!a)},[a]),_=m.useCallback(T=>{o(!i)},[i]),N=y?.annotation?.adapter&&y.annotation.adapter("poke"),O=y.annotation&&N instanceof z1&&y.annotation.exportLocalStorageAnnotations;return p.jsxs(l_,{children:[p.jsx(e,{...n}),y?.annotation?.readonly===!0?null:p.jsxs(p.Fragment,{children:[p.jsx(q.Tooltip,{title:p.jsx(Ii,{label:r("create_annotation"),action:"create"}),children:p.jsx("span",{children:p.jsx(be.MiradorMenuButton,{"aria-label":r("create_annotation"),onClick:w==="single"?C:A,size:"small",disabled:!t,children:p.jsx(dA,{})})})}),c&&p.jsx(q.Tooltip,{title:r("saving"),children:p.jsx(q.CircularProgress,{"aria-label":r("saving"),size:16,sx:{alignSelf:"center",mx:1}})})]}),a&&p.jsx(Zf,{open:a,handleClose:A,switchToSingleCanvasView:x,t:r}),O&&p.jsx(q.Tooltip,{title:r("export_local_annotation"),children:p.jsx("div",{children:p.jsx(be.MiradorMenuButton,{"aria-label":"Export local annotations for visible items",onClick:_,size:"small",children:p.jsx(D1,{})})})}),O&&p.jsx(M1,{canvases:g,config:y,handleClose:_,open:i})]})}X1.propTypes={annotationEditCompanionWindowIsOpened:d.bool.isRequired,canvases:d.arrayOf(d.shape({id:d.string,index:d.number})).isRequired,config:d.shape({annotation:d.shape({adapter:d.func,exportLocalStorageAnnotations:d.bool,readonly:d.bool})}).isRequired,t:d.func.isRequired,TargetComponent:d.oneOfType([d.func,d.node]).isRequired,targetProps:d.object.isRequired,windowViewType:d.string.isRequired};function u_(n,{targetProps:{windowId:e}}){const t=be.getCompanionWindowsForContent(n,{content:"annotationCreation",windowId:e});let r=!0;return Object.keys(t).length!==0&&(r=!1),{annotationEditCompanionWindowIsOpened:r,canvases:be.getVisibleCanvases(n,{windowId:e}),config:n.config,windowViewType:be.getWindowViewType(n,{windowId:e})}}const U1={component:X1,config:{translations:Kf},mapStateToProps:u_,mode:"wrap",target:"AnnotationSettings"},c_=new Set(["INPUT","TEXTAREA","SELECT"]),d_=n=>c_.has(n?.tagName)||n?.isContentEditable;let fo=null;function h_(){const n=xn.useStore();return m.useEffect(()=>{fo&&(document.removeEventListener("keydown",fo),fo=null);const e=t=>{if(d_(t.target))return;const r=Object.values(sf).find(s=>s.keys.includes(t.key));if(!r)return;const i=n.getState(),o=be.getFocusedWindowId(i);if(!o)return;const a=be.getConfig(i);a?.annotation?.readonly||(t.preventDefault(),r.handler({config:a,dispatch:n.dispatch,state:i,windowId:o}))};return fo=e,document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e),fo===e&&(fo=null)}},[n]),null}function $1({PluginComponents:n=[],TargetComponent:e,targetProps:t}){return p.jsxs(p.Fragment,{children:[p.jsx(h_,{}),p.jsx(e,{...t,PluginComponents:n})]})}$1.propTypes={PluginComponents:d.array.isRequired,TargetComponent:d.oneOfType([d.func,d.node]).isRequired,targetProps:d.object.isRequired};const Y1={component:$1,mode:"wrap",target:"Window"},Z1=at.createSvgIcon(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"),f_=at.createSvgIcon(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"),J1=at.createSvgIcon(p.jsx("path",{d:"m20.5 3-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5M15 19l-6-2.11V5l6 2.11z"}),"Map"),p_=at.createSvgIcon(p.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),g_=at.createSvgIcon(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");var pu,Bg;function Qf(){if(Bg)return pu;Bg=1;function n(e,t){for(var r=-1,i=t.length,o=e.length;++r<i;)e[o+r]=t[r];return e}return pu=n,pu}var gu,Fg;function K1(){if(Fg)return gu;Fg=1;var n=typeof ar=="object"&&ar&&ar.Object===Object&&ar;return gu=n,gu}var mu,Gg;function Wr(){if(Gg)return mu;Gg=1;var n=K1(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return mu=t,mu}var bu,qg;function ua(){if(qg)return bu;qg=1;var n=Wr(),e=n.Symbol;return bu=e,bu}var vu,Hg;function m_(){if(Hg)return vu;Hg=1;var n=ua(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,i=n?n.toStringTag:void 0;function o(a){var s=t.call(a,i),l=a[i];try{a[i]=void 0;var u=!0}catch{}var c=r.call(a);return u&&(s?a[i]=l:delete a[i]),c}return vu=o,vu}var yu,Vg;function b_(){if(Vg)return yu;Vg=1;var n=Object.prototype,e=n.toString;function t(r){return e.call(r)}return yu=t,yu}var xu,Wg;function Ki(){if(Wg)return xu;Wg=1;var n=ua(),e=m_(),t=b_(),r="[object Null]",i="[object Undefined]",o=n?n.toStringTag:void 0;function a(s){return s==null?s===void 0?i:r:o&&o in Object(s)?e(s):t(s)}return xu=a,xu}var Cu,zg;function ii(){if(zg)return Cu;zg=1;function n(e){return e!=null&&typeof e=="object"}return Cu=n,Cu}var Eu,Xg;function v_(){if(Xg)return Eu;Xg=1;var n=Ki(),e=ii(),t="[object Arguments]";function r(i){return e(i)&&n(i)==t}return Eu=r,Eu}var wu,Ug;function ep(){if(Ug)return wu;Ug=1;var n=v_(),e=ii(),t=Object.prototype,r=t.hasOwnProperty,i=t.propertyIsEnumerable,o=n((function(){return arguments})())?n:function(a){return e(a)&&r.call(a,"callee")&&!i.call(a,"callee")};return wu=o,wu}var Au,$g;function ur(){if($g)return Au;$g=1;var n=Array.isArray;return Au=n,Au}var _u,Yg;function y_(){if(Yg)return _u;Yg=1;var n=ua(),e=ep(),t=ur(),r=n?n.isConcatSpreadable:void 0;function i(o){return t(o)||e(o)||!!(r&&o&&o[r])}return _u=i,_u}var Tu,Zg;function x_(){if(Zg)return Tu;Zg=1;var n=Qf(),e=y_();function t(r,i,o,a,s){var l=-1,u=r.length;for(o||(o=e),s||(s=[]);++l<u;){var c=r[l];i>0&&o(c)?i>1?t(c,i-1,o,a,s):n(s,c):a||(s[s.length]=c)}return s}return Tu=t,Tu}var Iu,Jg;function C_(){if(Jg)return Iu;Jg=1;var n=x_();function e(t){var r=t==null?0:t.length;return r?n(t,1):[]}return Iu=e,Iu}var E_=C_();const Kg=la(E_),w_=at.createSvgIcon(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"),Q1=at.createSvgIcon(p.jsx("path",{d:"M19 15.18V7c0-2.21-1.79-4-4-4s-4 1.79-4 4v10c0 1.1-.9 2-2 2s-2-.9-2-2V8.82C8.16 8.4 9 7.3 9 6c0-1.66-1.34-3-3-3S3 4.34 3 6c0 1.3.84 2.4 2 2.82V17c0 2.21 1.79 4 4 4s4-1.79 4-4V7c0-1.1.9-2 2-2s2 .9 2 2v8.18c-1.16.41-2 1.51-2 2.82 0 1.66 1.34 3 3 3s3-1.34 3-3c0-1.3-.84-2.4-2-2.82"}),"Route"),A_=at.createSvgIcon(p.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),ex=m.createContext(),tx="tooltip",nx="section";function tp({creator:n,creationDate:e,lastEditor:t,lastSavedDate:r,displayMode:i,t:o}){if(!n||!e)return null;const a=n!==ul?n:o("anonymous"),s=t!==ul?t:o("anonymous");return p.jsxs(p.Fragment,{children:[i===nx&&p.jsx(Ne,{variant:"formSectionTitle",children:o("metadata")}),i===tx&&p.jsx("h1",{children:o("metadata")}),p.jsx(Ne,{children:o("createdByOn",{creationDate:e,creator:a})}),r&&t&&p.jsx(Ne,{children:o("lastEditedByOn",{lastEditor:s,lastSavedDate:r})})]})}tp.propTypes={creationDate:d.string.isRequired,creator:d.string.isRequired,displayMode:d.string.isRequired,lastEditor:d.string.isRequired,lastSavedDate:d.string.isRequired,t:d.func.isRequired};const Qg=(n,e)=>n.order===e.order?n.id.localeCompare(e.id):n.order===null||n.order===void 0?1:e.order===null||e.order===void 0?-1:n.order-e.order,rx=(n=[])=>{const e=n.filter(o=>o["dbf:kind"]==="Journey"),t={},r=[];n.filter(o=>o["dbf:kind"]!=="Journey").forEach(o=>{const a=o["dbf:journey"];a?.id?(t[a.id]??=[]).push(o):r.push(o)}),Object.values(t).forEach(o=>o.sort((a,s)=>Qg({id:a.id,order:a["dbf:journey"]?.order},{id:s.id,order:s["dbf:journey"]?.order})));const i=[...e.map(o=>({id:o.id,item:o,kind:"Journey",order:o["dbf:order"],pois:t[o.id]??[]})),...r.map(o=>({id:o.id,item:o,kind:"POI",order:o["dbf:order"]}))];return i.sort(Qg),i},em=(n,e)=>{const t=(Array.isArray(n?.body)?n.body:[]).filter(i=>i?.purpose==="identifying"&&i?.type==="TextualBody");return((t.find(i=>i.language===e)??t[0])?.value??"").trim()},tm=(n,e)=>{const t={...n,"dbf:order":e};return n["dbf:kind"]==="POI"&&n["dbf:journey"]&&(t["dbf:journey"]=null),t},ix=(n,e,t)=>({...n,"dbf:journey":{id:e,order:t}}),__=n=>n.maeData?.target?n:kl({...n}),T_=n=>{const t=__(n).maeData?.target;if(!t?.drawingState)return null;const i=(typeof t.drawingState=="string"?JSON.parse(t.drawingState):t.drawingState)?.shapes?.[0];return typeof i?.x!="number"||typeof i?.y!="number"?null:{fullCanvaXYWH:t.fullCanvaXYWH,x:i.x,y:i.y}},I_=n=>{const t=Math.max(...n.map(i=>i.x))+50,r=Math.max(...n.map(i=>i.y))+50;return[t,r]},S_=n=>typeof n.target=="string"?n.target:n.target?.source,uf=(n,e,t)=>{const r=rx(e).find(c=>c.kind==="Journey"&&c.id===n);if(!r)return null;const i=t??S_(r.item),o=[];let a;if(r.pois.forEach(c=>{const h=T_(c);h&&(o.push({x:h.x,y:h.y}),a??=h.fullCanvaXYWH)}),o.length<2||!i)return{...r.item,target:i??r.item.target};const[s,l]=a?a.split(",").slice(2):I_(o),u=$A({fullH:l,fullW:s,points:o});return{...r.item,target:q1({svg:u},i)}},Ll=m.forwardRef((n,e)=>{const t=In.useTheme(),[r,i]=m.useState(!1),[o,a]=m.useState(null),s=m.useContext(ex),{currentJourneyId:l,journeys:u,onMoveToJourney:c,...h}=n,f=m.useMemo(()=>{const{annotationid:T}=n,{canvases:D,annotationsOnCanvases:M}=s;let L;return D.some(E=>(M[E.id]&&Object.entries(M[E.id]).forEach(([S,I])=>{if(I.json&&I.json.items&&(L=I.json.items.find(P=>P.id===T),L))return L}),L)),L},[n.annotationid,s.canvases,s.annotationsOnCanvases]),b=()=>{const{canvases:T,receiveAnnotation:D,storageAdapter:M}=s,{annotationid:L}=n,E=f?.["dbf:journey"]?.id??null;T.forEach(S=>{const I=M(S.id);I.delete(L).then(P=>{if(D(S.id,I.annotationPageId,P),!E||!P?.items)return;const B=uf(E,P.items,S.id);B&&I.update(B).then(F=>{D(S.id,I.annotationPageId,F)})})})},x=()=>{const{annotationsOnCanvases:T,canvases:D,receiveAnnotation:M,storageAdapter:L}=s,{annotationid:E}=n;D.forEach(S=>{const I=T[S.id];I&&Object.values(I).forEach(P=>{const B=P?.json?.items;if(!B?.some(V=>V.id===E))return;const F=uf(E,B,S.id);if(!F)return;const G=L(S.id);G.update(F).then(V=>{M(S.id,G.annotationPageId,V)})})})},w=()=>{const{addCompanionWindow:T}=s,{annotationid:D}=n;T("annotationCreation",{annotationid:D,position:"right"})},g=()=>{const{addCompanionWindow:T}=s,{annotationid:D}=n;T("mapsPoiPreview",{annotationid:D,position:"right"})},y=()=>{s.config?.annotation?.openLinkedMap?.(f?.["dbf:linkedMap"])},C=()=>{const{annotationsOnCanvases:T,canvases:D}=s,{annotationid:M}=n,L=D.map(E=>T[E.id]?Kg(Object.entries(T[E.id]).map(([S,I])=>I.json&&I.json.items?I.json.items.filter(P=>P.maeData).map(P=>P.id):[])):[]);return Kg(L).includes(M)},A=T=>{a(T.currentTarget)},_=()=>a(null),N=T=>{c?.(T),_()},{t:O}=Bn.useTranslation();return p.jsxs("div",{onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:"mirador-annotation-list-item","data-testid":"mirador-annotation-list-item",ref:e,children:[r&&C()&&p.jsx("div",{children:p.jsxs(Dl,{"aria-label":"annotation tools",size:"small",sx:{bgcolor:t.palette.background.paper,borderRadius:t.shape.borderRadius,boxShadow:t.shadows[2],position:"absolute",right:0,zIndex:t.zIndex.modal+1},children:[s.config?.annotation.debug&&p.jsx(q.Tooltip,{title:O("debugAnnotation"),children:p.jsx("span",{children:p.jsx(Ft,{"aria-label":"Debug",onClick:()=>console.log(f),value:"debug",children:p.jsx(g_,{})})})}),!!f?.creator&&p.jsx(q.Tooltip,{title:p.jsx(tp,{creator:f.creator,creationDate:f.creationDate,lastEditor:f.lastEditor,lastSavedDate:f.lastSavedDate,displayMode:tx,t:O}),children:p.jsx("span",{children:p.jsx(Ft,{"aria-label":"Metadata",value:"metadata",children:p.jsx(w_,{})})})}),!!f?.["dbf:linkedMap"]&&p.jsx(q.Tooltip,{title:O("openNestedMap"),children:p.jsx("span",{children:p.jsx(Ft,{"aria-label":"Open nested map",onClick:y,value:"open-nested-map",children:p.jsx(J1,{})})})}),!f?.["dbf:linkedMap"]&&!!f?.["dbf:kind"]&&p.jsx(q.Tooltip,{title:O("previewAnnotation"),children:p.jsx("span",{children:p.jsx(Ft,{"aria-label":"Preview",onClick:g,value:"preview",disabled:!s.annotationPreviewCompanionWindowIsOpened,children:p.jsx(p_,{})})})}),s.config?.annotation?.readonly!==!0&&f?.["dbf:kind"]==="Journey"&&p.jsx(q.Tooltip,{title:O("refresh_journey_path"),children:p.jsx("span",{children:p.jsx(Ft,{"aria-label":"Refresh path",onClick:x,value:"refresh-path",disabled:!s.annotationEditCompanionWindowIsOpened,children:p.jsx(A_,{})})})}),s.config?.annotation?.readonly!==!0&&!!u&&(u.length>0||!!l)&&p.jsx(q.Tooltip,{title:O("move_to_journey"),children:p.jsx("span",{children:p.jsx(Ft,{"aria-label":"Move to journey",onClick:A,value:"move-to-journey",disabled:!s.annotationEditCompanionWindowIsOpened,children:p.jsx(Q1,{})})})}),s.config?.annotation?.readonly!==!0&&[p.jsx(q.Tooltip,{title:O("edit_annotation"),children:p.jsx("span",{children:p.jsx(Ft,{"aria-label":"Edit",onClick:s.windowViewType==="single"?w:s.toggleSingleCanvasDialogOpen,value:"edit",disabled:!s.annotationEditCompanionWindowIsOpened,children:p.jsx(f_,{})})})},"edit"),p.jsx(q.Tooltip,{title:p.jsx(Ii,{label:O("deleteAnnotation"),action:"delete"}),children:p.jsx("span",{children:p.jsx(Ft,{"aria-label":"Delete",onClick:b,value:"delete",disabled:!s.annotationEditCompanionWindowIsOpened,children:p.jsx(Z1,{})})})},"delete")]]})}),!!u&&p.jsxs(sA,{anchorEl:o,onClose:_,open:!!o,children:[!!l&&[p.jsx(sl,{onClick:()=>N(null),children:O("remove_from_journey")},"none"),p.jsx(lA,{},"divider")],u.map(T=>p.jsx(sl,{onClick:()=>N(T.id),selected:T.id===l,children:T.title},T.id))]}),p.jsx("li",{...h,children:n.children})]})});Ll.propTypes={annotationEditCompanionWindowIsOpened:d.bool.isRequired,annotationid:d.string.isRequired,children:d.oneOfType([d.func,d.node]).isRequired,currentJourneyId:d.string,journeys:d.arrayOf(d.shape({id:d.string.isRequired,title:d.string.isRequired})),onMoveToJourney:d.func};Ll.defaultProps={currentJourneyId:null,journeys:void 0,onMoveToJourney:void 0};var Su={exports:{}};function cf(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function R_(n){if(Array.isArray(n))return cf(n)}function O_(n,e,t){return(e=P_(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lr(){return lr=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},lr.apply(null,arguments)}function N_(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function j_(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
40
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Gr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?nm(Object(t),!0).forEach(function(r){O_(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):nm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function D_(n,e){if(n==null)return{};var t,r,i=M_(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function M_(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function k_(n){return R_(n)||N_(n)||B_(n)||j_()}function L_(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function P_(n){var e=L_(n,"string");return typeof e=="symbol"?e:e+""}function df(n){"@babel/helpers - typeof";return df=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},df(n)}function B_(n,e){if(n){if(typeof n=="string")return cf(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?cf(n,e):void 0}}var F_="1.15.7";function ti(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var oi=ti(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),fs=ti(/Edge/i),rm=ti(/firefox/i),Ja=ti(/safari/i)&&!ti(/chrome/i)&&!ti(/android/i),np=ti(/iP(ad|od|hone)/i),ox=ti(/chrome/i)&&ti(/android/i),ax={capture:!1,passive:!1};function We(n,e,t){n.addEventListener(e,t,!oi&&ax)}function Ve(n,e,t){n.removeEventListener(e,t,!oi&&ax)}function cl(n,e){if(e){if(e[0]===">"&&(e=e.substring(1)),n)try{if(n.matches)return n.matches(e);if(n.msMatchesSelector)return n.msMatchesSelector(e);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(e)}catch{return!1}return!1}}function sx(n){return n.host&&n!==document&&n.host.nodeType&&n.host!==n?n.host:n.parentNode}function kn(n,e,t,r){if(n){t=t||document;do{if(e!=null&&(e[0]===">"?n.parentNode===t&&cl(n,e):cl(n,e))||r&&n===t)return n;if(n===t)break}while(n=sx(n))}return null}var im=/\s+/g;function Mt(n,e,t){if(n&&e)if(n.classList)n.classList[t?"add":"remove"](e);else{var r=(" "+n.className+" ").replace(im," ").replace(" "+e+" "," ");n.className=(r+(t?" "+e:"")).replace(im," ")}}function he(n,e,t){var r=n&&n.style;if(r){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(t=n.currentStyle),e===void 0?t:t[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=t+(typeof t=="string"?"":"px")}}function zi(n,e){var t="";if(typeof n=="string")t=n;else do{var r=he(n,"transform");r&&r!=="none"&&(t=r+" "+t)}while(!e&&(n=n.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(t)}function lx(n,e,t){if(n){var r=n.getElementsByTagName(e),i=0,o=r.length;if(t)for(;i<o;i++)t(r[i],i);return r}return[]}function Fr(){var n=document.scrollingElement;return n||document.documentElement}function Tt(n,e,t,r,i){if(!(!n.getBoundingClientRect&&n!==window)){var o,a,s,l,u,c,h;if(n!==window&&n.parentNode&&n!==Fr()?(o=n.getBoundingClientRect(),a=o.top,s=o.left,l=o.bottom,u=o.right,c=o.height,h=o.width):(a=0,s=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,h=window.innerWidth),(e||t)&&n!==window&&(i=i||n.parentNode,!oi))do if(i&&i.getBoundingClientRect&&(he(i,"transform")!=="none"||t&&he(i,"position")!=="static")){var f=i.getBoundingClientRect();a-=f.top+parseInt(he(i,"border-top-width")),s-=f.left+parseInt(he(i,"border-left-width")),l=a+o.height,u=s+o.width;break}while(i=i.parentNode);if(r&&n!==window){var b=zi(i||n),x=b&&b.a,w=b&&b.d;b&&(a/=w,s/=x,h/=x,c/=w,l=a+c,u=s+h)}return{top:a,left:s,bottom:l,right:u,width:h,height:c}}}function om(n,e,t){for(var r=wi(n,!0),i=Tt(n)[e];r;){var o=Tt(r)[t],a=void 0;if(a=i>=o,!a)return r;if(r===Fr())break;r=wi(r,!1)}return!1}function na(n,e,t,r){for(var i=0,o=0,a=n.children;o<a.length;){if(a[o].style.display!=="none"&&a[o]!==Oe.ghost&&(r||a[o]!==Oe.dragged)&&kn(a[o],t.draggable,n,!1)){if(i===e)return a[o];i++}o++}return null}function rp(n,e){for(var t=n.lastElementChild;t&&(t===Oe.ghost||he(t,"display")==="none"||e&&!cl(t,e));)t=t.previousElementSibling;return t||null}function Bt(n,e){var t=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==Oe.clone&&(!e||cl(n,e))&&t++;return t}function am(n){var e=0,t=0,r=Fr();if(n)do{var i=zi(n),o=i.a,a=i.d;e+=n.scrollLeft*o,t+=n.scrollTop*a}while(n!==r&&(n=n.parentNode));return[e,t]}function G_(n,e){for(var t in n)if(n.hasOwnProperty(t)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===n[t][r])return Number(t)}return-1}function wi(n,e){if(!n||!n.getBoundingClientRect)return Fr();var t=n,r=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var i=he(t);if(t.clientWidth<t.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return Fr();if(r||e)return t;r=!0}}while(t=t.parentNode);return Fr()}function q_(n,e){if(n&&e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function Ru(n,e){return Math.round(n.top)===Math.round(e.top)&&Math.round(n.left)===Math.round(e.left)&&Math.round(n.height)===Math.round(e.height)&&Math.round(n.width)===Math.round(e.width)}var Ka;function ux(n,e){return function(){if(!Ka){var t=arguments,r=this;t.length===1?n.call(r,t[0]):n.apply(r,t),Ka=setTimeout(function(){Ka=void 0},e)}}}function H_(){clearTimeout(Ka),Ka=void 0}function cx(n,e,t){n.scrollLeft+=e,n.scrollTop+=t}function ip(n){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(n).cloneNode(!0):t?t(n).clone(!0)[0]:n.cloneNode(!0)}function sm(n,e){he(n,"position","absolute"),he(n,"top",e.top),he(n,"left",e.left),he(n,"width",e.width),he(n,"height",e.height)}function Ou(n){he(n,"position",""),he(n,"top",""),he(n,"left",""),he(n,"width",""),he(n,"height","")}function dx(n,e,t){var r={};return Array.from(n.children).forEach(function(i){var o,a,s,l;if(!(!kn(i,e.draggable,n,!1)||i.animated||i===t)){var u=Tt(i);r.left=Math.min((o=r.left)!==null&&o!==void 0?o:1/0,u.left),r.top=Math.min((a=r.top)!==null&&a!==void 0?a:1/0,u.top),r.right=Math.max((s=r.right)!==null&&s!==void 0?s:-1/0,u.right),r.bottom=Math.max((l=r.bottom)!==null&&l!==void 0?l:-1/0,u.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var fn="Sortable"+new Date().getTime();function V_(){var n=[],e;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(i){if(!(he(i,"display")==="none"||i===Oe.ghost)){n.push({target:i,rect:Tt(i)});var o=Gr({},n[n.length-1].rect);if(i.thisAnimationDuration){var a=zi(i,!0);a&&(o.top-=a.f,o.left-=a.e)}i.fromRect=o}})}},addAnimationState:function(r){n.push(r)},removeAnimationState:function(r){n.splice(G_(n,{target:r}),1)},animateAll:function(r){var i=this;if(!this.options.animation){clearTimeout(e),typeof r=="function"&&r();return}var o=!1,a=0;n.forEach(function(s){var l=0,u=s.target,c=u.fromRect,h=Tt(u),f=u.prevFromRect,b=u.prevToRect,x=s.rect,w=zi(u,!0);w&&(h.top-=w.f,h.left-=w.e),u.toRect=h,u.thisAnimationDuration&&Ru(f,h)&&!Ru(c,h)&&(x.top-h.top)/(x.left-h.left)===(c.top-h.top)/(c.left-h.left)&&(l=z_(x,f,b,i.options)),Ru(h,c)||(u.prevFromRect=c,u.prevToRect=h,l||(l=i.options.animation),i.animate(u,x,h,l)),l&&(o=!0,a=Math.max(a,l),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},l),u.thisAnimationDuration=l)}),clearTimeout(e),o?e=setTimeout(function(){typeof r=="function"&&r()},a):typeof r=="function"&&r(),n=[]},animate:function(r,i,o,a){if(a){he(r,"transition",""),he(r,"transform","");var s=zi(this.el),l=s&&s.a,u=s&&s.d,c=(i.left-o.left)/(l||1),h=(i.top-o.top)/(u||1);r.animatingX=!!c,r.animatingY=!!h,he(r,"transform","translate3d("+c+"px,"+h+"px,0)"),this.forRepaintDummy=W_(r),he(r,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),he(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){he(r,"transition",""),he(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},a)}}}}function W_(n){return n.offsetWidth}function z_(n,e,t,r){return Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*r.animation}var po=[],Nu={initializeByDefault:!0},ps={mount:function(e){for(var t in Nu)Nu.hasOwnProperty(t)&&!(t in e)&&(e[t]=Nu[t]);po.forEach(function(r){if(r.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),po.push(e)},pluginEvent:function(e,t,r){var i=this;this.eventCanceled=!1,r.cancel=function(){i.eventCanceled=!0};var o=e+"Global";po.forEach(function(a){t[a.pluginName]&&(t[a.pluginName][o]&&t[a.pluginName][o](Gr({sortable:t},r)),t.options[a.pluginName]&&t[a.pluginName][e]&&t[a.pluginName][e](Gr({sortable:t},r)))})},initializePlugins:function(e,t,r,i){po.forEach(function(s){var l=s.pluginName;if(!(!e.options[l]&&!s.initializeByDefault)){var u=new s(e,t,e.options);u.sortable=e,u.options=e.options,e[l]=u,lr(r,u.defaults)}});for(var o in e.options)if(e.options.hasOwnProperty(o)){var a=this.modifyOption(e,o,e.options[o]);typeof a<"u"&&(e.options[o]=a)}},getEventProperties:function(e,t){var r={};return po.forEach(function(i){typeof i.eventProperties=="function"&&lr(r,i.eventProperties.call(t[i.pluginName],e))}),r},modifyOption:function(e,t,r){var i;return po.forEach(function(o){e[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[t]=="function"&&(i=o.optionListeners[t].call(e[o.pluginName],r))}),i}};function Da(n){var e=n.sortable,t=n.rootEl,r=n.name,i=n.targetEl,o=n.cloneEl,a=n.toEl,s=n.fromEl,l=n.oldIndex,u=n.newIndex,c=n.oldDraggableIndex,h=n.newDraggableIndex,f=n.originalEvent,b=n.putSortable,x=n.extraEventProperties;if(e=e||t&&t[fn],!!e){var w,g=e.options,y="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!oi&&!fs?w=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(w=document.createEvent("Event"),w.initEvent(r,!0,!0)),w.to=a||t,w.from=s||t,w.item=i||t,w.clone=o,w.oldIndex=l,w.newIndex=u,w.oldDraggableIndex=c,w.newDraggableIndex=h,w.originalEvent=f,w.pullMode=b?b.lastPutMode:void 0;var C=Gr(Gr({},x),ps.getEventProperties(r,e));for(var A in C)w[A]=C[A];t&&t.dispatchEvent(w),g[y]&&g[y].call(e,w)}}var X_=["evt"],Nn=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,o=D_(r,X_);ps.pluginEvent.bind(Oe)(e,t,Gr({dragEl:ne,parentEl:Pt,ghostEl:Be,rootEl:St,nextEl:Gi,lastDownEl:el,cloneEl:Dt,cloneHidden:Ci,dragStarted:Ma,putSortable:dn,activeSortable:Oe.active,originalEvent:i,oldIndex:$o,oldDraggableIndex:Qa,newIndex:Xn,newDraggableIndex:xi,hideGhostForTarget:gx,unhideGhostForTarget:mx,cloneNowHidden:function(){Ci=!0},cloneNowShown:function(){Ci=!1},dispatchSortableEvent:function(s){_n({sortable:t,name:s,originalEvent:i})}},o))};function _n(n){Da(Gr({putSortable:dn,cloneEl:Dt,targetEl:ne,rootEl:St,oldIndex:$o,oldDraggableIndex:Qa,newIndex:Xn,newDraggableIndex:xi},n))}var ne,Pt,Be,St,Gi,el,Dt,Ci,$o,Xn,Qa,xi,Os,dn,wo=!1,dl=!1,hl=[],ki,mr,ju,Du,lm,um,Ma,go,es,ts=!1,Ns=!1,tl,bn,Mu=[],hf=!1,fl=[],Pl=typeof document<"u",js=np,cm=fs||oi?"cssFloat":"float",U_=Pl&&!ox&&!np&&"draggable"in document.createElement("div"),hx=(function(){if(Pl){if(oi)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}})(),fx=function(e,t){var r=he(e),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),o=na(e,0,t),a=na(e,1,t),s=o&&he(o),l=a&&he(a),u=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Tt(o).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Tt(a).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&s.float&&s.float!=="none"){var h=s.float==="left"?"left":"right";return a&&(l.clear==="both"||l.clear===h)?"vertical":"horizontal"}return o&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||u>=i&&r[cm]==="none"||a&&r[cm]==="none"&&u+c>i)?"vertical":"horizontal"},$_=function(e,t,r){var i=r?e.left:e.top,o=r?e.right:e.bottom,a=r?e.width:e.height,s=r?t.left:t.top,l=r?t.right:t.bottom,u=r?t.width:t.height;return i===s||o===l||i+a/2===s+u/2},Y_=function(e,t){var r;return hl.some(function(i){var o=i[fn].options.emptyInsertThreshold;if(!(!o||rp(i))){var a=Tt(i),s=e>=a.left-o&&e<=a.right+o,l=t>=a.top-o&&t<=a.bottom+o;if(s&&l)return r=i}}),r},px=function(e){function t(o,a){return function(s,l,u,c){var h=s.options.group.name&&l.options.group.name&&s.options.group.name===l.options.group.name;if(o==null&&(a||h))return!0;if(o==null||o===!1)return!1;if(a&&o==="clone")return o;if(typeof o=="function")return t(o(s,l,u,c),a)(s,l,u,c);var f=(a?s:l).options.group.name;return o===!0||typeof o=="string"&&o===f||o.join&&o.indexOf(f)>-1}}var r={},i=e.group;(!i||df(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=t(i.pull,!0),r.checkPut=t(i.put),r.revertClone=i.revertClone,e.group=r},gx=function(){!hx&&Be&&he(Be,"display","none")},mx=function(){!hx&&Be&&he(Be,"display","")};Pl&&!ox&&document.addEventListener("click",function(n){if(dl)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),dl=!1,!1},!0);var Li=function(e){if(ne){e=e.touches?e.touches[0]:e;var t=Y_(e.clientX,e.clientY);if(t){var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);r.target=r.rootEl=t,r.preventDefault=void 0,r.stopPropagation=void 0,t[fn]._onDragOver(r)}}},Z_=function(e){ne&&ne.parentNode[fn]._isOutsideThisEl(e.target)};function Oe(n,e){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=e=lr({},e),n[fn]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return fx(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,s){a.setData("Text",s.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Oe.supportPointer!==!1&&"PointerEvent"in window&&(!Ja||np),emptyInsertThreshold:5};ps.initializePlugins(this,n,t);for(var r in t)!(r in e)&&(e[r]=t[r]);px(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:U_,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?We(n,"pointerdown",this._onTapStart):(We(n,"mousedown",this._onTapStart),We(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(We(n,"dragover",this),We(n,"dragenter",this)),hl.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),lr(this,V_())}Oe.prototype={constructor:Oe,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(go=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,ne):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,r=this.el,i=this.options,o=i.preventOnFilter,a=e.type,s=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(s||e).target,u=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=i.filter;if(iT(r),!ne&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Ja&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=kn(l,i.draggable,r,!1),!(l&&l.animated)&&el!==l)){if($o=Bt(l),Qa=Bt(l,i.draggable),typeof c=="function"){if(c.call(this,e,l,this)){_n({sortable:t,rootEl:u,name:"filter",targetEl:l,toEl:r,fromEl:r}),Nn("filter",t,{evt:e}),o&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(h){if(h=kn(u,h.trim(),r,!1),h)return _n({sortable:t,rootEl:h,name:"filter",targetEl:l,fromEl:r,toEl:r}),Nn("filter",t,{evt:e}),!0}),c)){o&&e.preventDefault();return}i.handle&&!kn(u,i.handle,r,!1)||this._prepareDragStart(e,s,l)}}},_prepareDragStart:function(e,t,r){var i=this,o=i.el,a=i.options,s=o.ownerDocument,l;if(r&&!ne&&r.parentNode===o){var u=Tt(r);if(St=o,ne=r,Pt=ne.parentNode,Gi=ne.nextSibling,el=r,Os=a.group,Oe.dragged=ne,ki={target:ne,clientX:(t||e).clientX,clientY:(t||e).clientY},lm=ki.clientX-u.left,um=ki.clientY-u.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,ne.style["will-change"]="all",l=function(){if(Nn("delayEnded",i,{evt:e}),Oe.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!rm&&i.nativeDraggable&&(ne.draggable=!0),i._triggerDragStart(e,t),_n({sortable:i,name:"choose",originalEvent:e}),Mt(ne,a.chosenClass,!0)},a.ignore.split(",").forEach(function(c){lx(ne,c.trim(),ku)}),We(s,"dragover",Li),We(s,"mousemove",Li),We(s,"touchmove",Li),a.supportPointer?(We(s,"pointerup",i._onDrop),!this.nativeDraggable&&We(s,"pointercancel",i._onDrop)):(We(s,"mouseup",i._onDrop),We(s,"touchend",i._onDrop),We(s,"touchcancel",i._onDrop)),rm&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ne.draggable=!0),Nn("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(fs||oi))){if(Oe.eventCanceled){this._onDrop();return}a.supportPointer?(We(s,"pointerup",i._disableDelayedDrag),We(s,"pointercancel",i._disableDelayedDrag)):(We(s,"mouseup",i._disableDelayedDrag),We(s,"touchend",i._disableDelayedDrag),We(s,"touchcancel",i._disableDelayedDrag)),We(s,"mousemove",i._delayedDragTouchMoveHandler),We(s,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&We(s,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(l,a.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ne&&ku(ne),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Ve(e,"mouseup",this._disableDelayedDrag),Ve(e,"touchend",this._disableDelayedDrag),Ve(e,"touchcancel",this._disableDelayedDrag),Ve(e,"pointerup",this._disableDelayedDrag),Ve(e,"pointercancel",this._disableDelayedDrag),Ve(e,"mousemove",this._delayedDragTouchMoveHandler),Ve(e,"touchmove",this._delayedDragTouchMoveHandler),Ve(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?We(document,"pointermove",this._onTouchMove):t?We(document,"touchmove",this._onTouchMove):We(document,"mousemove",this._onTouchMove):(We(ne,"dragend",this),We(St,"dragstart",this._onDragStart));try{document.selection?nl(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(wo=!1,St&&ne){Nn("dragStarted",this,{evt:t}),this.nativeDraggable&&We(document,"dragover",Z_);var r=this.options;!e&&Mt(ne,r.dragClass,!1),Mt(ne,r.ghostClass,!0),Oe.active=this,e&&this._appendGhost(),_n({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(mr){this._lastX=mr.clientX,this._lastY=mr.clientY,gx();for(var e=document.elementFromPoint(mr.clientX,mr.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(mr.clientX,mr.clientY),e!==t);)t=e;if(ne.parentNode[fn]._isOutsideThisEl(e),t)do{if(t[fn]){var r=void 0;if(r=t[fn]._onDragOver({clientX:mr.clientX,clientY:mr.clientY,target:e,rootEl:t}),r&&!this.options.dragoverBubble)break}e=t}while(t=sx(t));mx()}},_onTouchMove:function(e){if(ki){var t=this.options,r=t.fallbackTolerance,i=t.fallbackOffset,o=e.touches?e.touches[0]:e,a=Be&&zi(Be,!0),s=Be&&a&&a.a,l=Be&&a&&a.d,u=js&&bn&&am(bn),c=(o.clientX-ki.clientX+i.x)/(s||1)+(u?u[0]-Mu[0]:0)/(s||1),h=(o.clientY-ki.clientY+i.y)/(l||1)+(u?u[1]-Mu[1]:0)/(l||1);if(!Oe.active&&!wo){if(r&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<r)return;this._onDragStart(e,!0)}if(Be){a?(a.e+=c-(ju||0),a.f+=h-(Du||0)):a={a:1,b:0,c:0,d:1,e:c,f:h};var f="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");he(Be,"webkitTransform",f),he(Be,"mozTransform",f),he(Be,"msTransform",f),he(Be,"transform",f),ju=c,Du=h,mr=o}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Be){var e=this.options.fallbackOnBody?document.body:St,t=Tt(ne,!0,js,!0,e),r=this.options;if(js){for(bn=e;he(bn,"position")==="static"&&he(bn,"transform")==="none"&&bn!==document;)bn=bn.parentNode;bn!==document.body&&bn!==document.documentElement?(bn===document&&(bn=Fr()),t.top+=bn.scrollTop,t.left+=bn.scrollLeft):bn=Fr(),Mu=am(bn)}Be=ne.cloneNode(!0),Mt(Be,r.ghostClass,!1),Mt(Be,r.fallbackClass,!0),Mt(Be,r.dragClass,!0),he(Be,"transition",""),he(Be,"transform",""),he(Be,"box-sizing","border-box"),he(Be,"margin",0),he(Be,"top",t.top),he(Be,"left",t.left),he(Be,"width",t.width),he(Be,"height",t.height),he(Be,"opacity","0.8"),he(Be,"position",js?"absolute":"fixed"),he(Be,"zIndex","100000"),he(Be,"pointerEvents","none"),Oe.ghost=Be,e.appendChild(Be),he(Be,"transform-origin",lm/parseInt(Be.style.width)*100+"% "+um/parseInt(Be.style.height)*100+"%")}},_onDragStart:function(e,t){var r=this,i=e.dataTransfer,o=r.options;if(Nn("dragStart",this,{evt:e}),Oe.eventCanceled){this._onDrop();return}Nn("setupClone",this),Oe.eventCanceled||(Dt=ip(ne),Dt.removeAttribute("id"),Dt.draggable=!1,Dt.style["will-change"]="",this._hideClone(),Mt(Dt,this.options.chosenClass,!1),Oe.clone=Dt),r.cloneId=nl(function(){Nn("clone",r),!Oe.eventCanceled&&(r.options.removeCloneOnHide||St.insertBefore(Dt,ne),r._hideClone(),_n({sortable:r,name:"clone"}))}),!t&&Mt(ne,o.dragClass,!0),t?(dl=!0,r._loopId=setInterval(r._emulateDragOver,50)):(Ve(document,"mouseup",r._onDrop),Ve(document,"touchend",r._onDrop),Ve(document,"touchcancel",r._onDrop),i&&(i.effectAllowed="move",o.setData&&o.setData.call(r,i,ne)),We(document,"drop",r),he(ne,"transform","translateZ(0)")),wo=!0,r._dragStartId=nl(r._dragStarted.bind(r,t,e)),We(document,"selectstart",r),Ma=!0,window.getSelection().removeAllRanges(),Ja&&he(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,r=e.target,i,o,a,s=this.options,l=s.group,u=Oe.active,c=Os===l,h=s.sort,f=dn||u,b,x=this,w=!1;if(hf)return;function g(V,z){Nn(V,x,Gr({evt:e,isOwner:c,axis:b?"vertical":"horizontal",revert:a,dragRect:i,targetRect:o,canSort:h,fromSortable:f,target:r,completed:C,onMove:function(J,Y){return Ds(St,t,ne,i,J,Tt(J),e,Y)},changed:A},z))}function y(){g("dragOverAnimationCapture"),x.captureAnimationState(),x!==f&&f.captureAnimationState()}function C(V){return g("dragOverCompleted",{insertion:V}),V&&(c?u._hideClone():u._showClone(x),x!==f&&(Mt(ne,dn?dn.options.ghostClass:u.options.ghostClass,!1),Mt(ne,s.ghostClass,!0)),dn!==x&&x!==Oe.active?dn=x:x===Oe.active&&dn&&(dn=null),f===x&&(x._ignoreWhileAnimating=r),x.animateAll(function(){g("dragOverAnimationComplete"),x._ignoreWhileAnimating=null}),x!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(r===ne&&!ne.animated||r===t&&!r.animated)&&(go=null),!s.dragoverBubble&&!e.rootEl&&r!==document&&(ne.parentNode[fn]._isOutsideThisEl(e.target),!V&&Li(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),w=!0}function A(){Xn=Bt(ne),xi=Bt(ne,s.draggable),_n({sortable:x,name:"change",toEl:t,newIndex:Xn,newDraggableIndex:xi,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),r=kn(r,s.draggable,t,!0),g("dragOver"),Oe.eventCanceled)return w;if(ne.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||x._ignoreWhileAnimating===r)return C(!1);if(dl=!1,u&&!s.disabled&&(c?h||(a=Pt!==St):dn===this||(this.lastPutMode=Os.checkPull(this,u,ne,e))&&l.checkPut(this,u,ne,e))){if(b=this._getDirection(e,r)==="vertical",i=Tt(ne),g("dragOverValid"),Oe.eventCanceled)return w;if(a)return Pt=St,y(),this._hideClone(),g("revert"),Oe.eventCanceled||(Gi?St.insertBefore(ne,Gi):St.appendChild(ne)),C(!0);var _=rp(t,s.draggable);if(!_||eT(e,b,this)&&!_.animated){if(_===ne)return C(!1);if(_&&t===e.target&&(r=_),r&&(o=Tt(r)),Ds(St,t,ne,i,r,o,e,!!r)!==!1)return y(),_&&_.nextSibling?t.insertBefore(ne,_.nextSibling):t.appendChild(ne),Pt=t,A(),C(!0)}else if(_&&Q_(e,b,this)){var N=na(t,0,s,!0);if(N===ne)return C(!1);if(r=N,o=Tt(r),Ds(St,t,ne,i,r,o,e,!1)!==!1)return y(),t.insertBefore(ne,N),Pt=t,A(),C(!0)}else if(r.parentNode===t){o=Tt(r);var O=0,T,D=ne.parentNode!==t,M=!$_(ne.animated&&ne.toRect||i,r.animated&&r.toRect||o,b),L=b?"top":"left",E=om(r,"top","top")||om(ne,"top","top"),S=E?E.scrollTop:void 0;go!==r&&(T=o[L],ts=!1,Ns=!M&&s.invertSwap||D),O=tT(e,r,o,b,M?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,Ns,go===r);var I;if(O!==0){var P=Bt(ne);do P-=O,I=Pt.children[P];while(I&&(he(I,"display")==="none"||I===Be))}if(O===0||I===r)return C(!1);go=r,es=O;var B=r.nextElementSibling,F=!1;F=O===1;var G=Ds(St,t,ne,i,r,o,e,F);if(G!==!1)return(G===1||G===-1)&&(F=G===1),hf=!0,setTimeout(K_,30),y(),F&&!B?t.appendChild(ne):r.parentNode.insertBefore(ne,F?B:r),E&&cx(E,0,S-E.scrollTop),Pt=ne.parentNode,T!==void 0&&!Ns&&(tl=Math.abs(T-Tt(r)[L])),A(),C(!0)}if(t.contains(ne))return C(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ve(document,"mousemove",this._onTouchMove),Ve(document,"touchmove",this._onTouchMove),Ve(document,"pointermove",this._onTouchMove),Ve(document,"dragover",Li),Ve(document,"mousemove",Li),Ve(document,"touchmove",Li)},_offUpEvents:function(){var e=this.el.ownerDocument;Ve(e,"mouseup",this._onDrop),Ve(e,"touchend",this._onDrop),Ve(e,"pointerup",this._onDrop),Ve(e,"pointercancel",this._onDrop),Ve(e,"touchcancel",this._onDrop),Ve(document,"selectstart",this)},_onDrop:function(e){var t=this.el,r=this.options;if(Xn=Bt(ne),xi=Bt(ne,r.draggable),Nn("drop",this,{evt:e}),Pt=ne&&ne.parentNode,Xn=Bt(ne),xi=Bt(ne,r.draggable),Oe.eventCanceled){this._nulling();return}wo=!1,Ns=!1,ts=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ff(this.cloneId),ff(this._dragStartId),this.nativeDraggable&&(Ve(document,"drop",this),Ve(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ja&&he(document.body,"user-select",""),he(ne,"transform",""),e&&(Ma&&(e.cancelable&&e.preventDefault(),!r.dropBubble&&e.stopPropagation()),Be&&Be.parentNode&&Be.parentNode.removeChild(Be),(St===Pt||dn&&dn.lastPutMode!=="clone")&&Dt&&Dt.parentNode&&Dt.parentNode.removeChild(Dt),ne&&(this.nativeDraggable&&Ve(ne,"dragend",this),ku(ne),ne.style["will-change"]="",Ma&&!wo&&Mt(ne,dn?dn.options.ghostClass:this.options.ghostClass,!1),Mt(ne,this.options.chosenClass,!1),_n({sortable:this,name:"unchoose",toEl:Pt,newIndex:null,newDraggableIndex:null,originalEvent:e}),St!==Pt?(Xn>=0&&(_n({rootEl:Pt,name:"add",toEl:Pt,fromEl:St,originalEvent:e}),_n({sortable:this,name:"remove",toEl:Pt,originalEvent:e}),_n({rootEl:Pt,name:"sort",toEl:Pt,fromEl:St,originalEvent:e}),_n({sortable:this,name:"sort",toEl:Pt,originalEvent:e})),dn&&dn.save()):Xn!==$o&&Xn>=0&&(_n({sortable:this,name:"update",toEl:Pt,originalEvent:e}),_n({sortable:this,name:"sort",toEl:Pt,originalEvent:e})),Oe.active&&((Xn==null||Xn===-1)&&(Xn=$o,xi=Qa),_n({sortable:this,name:"end",toEl:Pt,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Nn("nulling",this),St=ne=Pt=Be=Gi=Dt=el=Ci=ki=mr=Ma=Xn=xi=$o=Qa=go=es=dn=Os=Oe.dragged=Oe.ghost=Oe.clone=Oe.active=null;var e=this.el;fl.forEach(function(t){e.contains(t)&&(t.checked=!0)}),fl.length=ju=Du=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":ne&&(this._onDragOver(e),J_(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,r=this.el.children,i=0,o=r.length,a=this.options;i<o;i++)t=r[i],kn(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||rT(t));return e},sort:function(e,t){var r={},i=this.el;this.toArray().forEach(function(o,a){var s=i.children[a];kn(s,this.options.draggable,i,!1)&&(r[o]=s)},this),t&&this.captureAnimationState(),e.forEach(function(o){r[o]&&(i.removeChild(r[o]),i.appendChild(r[o]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return kn(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var r=this.options;if(t===void 0)return r[e];var i=ps.modifyOption(this,e,t);typeof i<"u"?r[e]=i:r[e]=t,e==="group"&&px(r)},destroy:function(){Nn("destroy",this);var e=this.el;e[fn]=null,Ve(e,"mousedown",this._onTapStart),Ve(e,"touchstart",this._onTapStart),Ve(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ve(e,"dragover",this),Ve(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),hl.splice(hl.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Ci){if(Nn("hideClone",this),Oe.eventCanceled)return;he(Dt,"display","none"),this.options.removeCloneOnHide&&Dt.parentNode&&Dt.parentNode.removeChild(Dt),Ci=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Ci){if(Nn("showClone",this),Oe.eventCanceled)return;ne.parentNode==St&&!this.options.group.revertClone?St.insertBefore(Dt,ne):Gi?St.insertBefore(Dt,Gi):St.appendChild(Dt),this.options.group.revertClone&&this.animate(ne,Dt),he(Dt,"display",""),Ci=!1}}};function J_(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function Ds(n,e,t,r,i,o,a,s){var l,u=n[fn],c=u.options.onMove,h;return window.CustomEvent&&!oi&&!fs?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=n,l.dragged=t,l.draggedRect=r,l.related=i||e,l.relatedRect=o||Tt(e),l.willInsertAfter=s,l.originalEvent=a,n.dispatchEvent(l),c&&(h=c.call(u,l,a)),h}function ku(n){n.draggable=!1}function K_(){hf=!1}function Q_(n,e,t){var r=Tt(na(t.el,0,t.options,!0)),i=dx(t.el,t.options,Be),o=10;return e?n.clientX<i.left-o||n.clientY<r.top&&n.clientX<r.right:n.clientY<i.top-o||n.clientY<r.bottom&&n.clientX<r.left}function eT(n,e,t){var r=Tt(rp(t.el,t.options.draggable)),i=dx(t.el,t.options,Be),o=10;return e?n.clientX>i.right+o||n.clientY>r.bottom&&n.clientX>r.left:n.clientY>i.bottom+o||n.clientX>r.right&&n.clientY>r.top}function tT(n,e,t,r,i,o,a,s){var l=r?n.clientY:n.clientX,u=r?t.height:t.width,c=r?t.top:t.left,h=r?t.bottom:t.right,f=!1;if(!a){if(s&&tl<u*i){if(!ts&&(es===1?l>c+u*o/2:l<h-u*o/2)&&(ts=!0),ts)f=!0;else if(es===1?l<c+tl:l>h-tl)return-es}else if(l>c+u*(1-i)/2&&l<h-u*(1-i)/2)return nT(e)}return f=f||a,f&&(l<c+u*o/2||l>h-u*o/2)?l>c+u/2?1:-1:0}function nT(n){return Bt(ne)<Bt(n)?1:-1}function rT(n){for(var e=n.tagName+n.className+n.src+n.href+n.textContent,t=e.length,r=0;t--;)r+=e.charCodeAt(t);return r.toString(36)}function iT(n){fl.length=0;for(var e=n.getElementsByTagName("input"),t=e.length;t--;){var r=e[t];r.checked&&fl.push(r)}}function nl(n){return setTimeout(n,0)}function ff(n){return clearTimeout(n)}Pl&&We(document,"touchmove",function(n){(Oe.active||wo)&&n.cancelable&&n.preventDefault()});Oe.utils={on:We,off:Ve,css:he,find:lx,is:function(e,t){return!!kn(e,t,e,!1)},extend:q_,throttle:ux,closest:kn,toggleClass:Mt,clone:ip,index:Bt,nextTick:nl,cancelNextTick:ff,detectDirection:fx,getChild:na,expando:fn};Oe.get=function(n){return n[fn]};Oe.mount=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(Oe.utils=Gr(Gr({},Oe.utils),r.utils)),ps.mount(r)})};Oe.create=function(n,e){return new Oe(n,e)};Oe.version=F_;var Ut=[],ka,pf,gf=!1,Lu,Pu,pl,La;function oT(){function n(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return n.prototype={dragStarted:function(t){var r=t.originalEvent;this.sortable.nativeDraggable?We(document,"dragover",this._handleAutoScroll):this.options.supportPointer?We(document,"pointermove",this._handleFallbackAutoScroll):r.touches?We(document,"touchmove",this._handleFallbackAutoScroll):We(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var r=t.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?Ve(document,"dragover",this._handleAutoScroll):(Ve(document,"pointermove",this._handleFallbackAutoScroll),Ve(document,"touchmove",this._handleFallbackAutoScroll),Ve(document,"mousemove",this._handleFallbackAutoScroll)),dm(),rl(),H_()},nulling:function(){pl=pf=ka=gf=La=Lu=Pu=null,Ut.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,r){var i=this,o=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,s=document.elementFromPoint(o,a);if(pl=t,r||this.options.forceAutoScrollFallback||fs||oi||Ja){Bu(t,this.options,s,r);var l=wi(s,!0);gf&&(!La||o!==Lu||a!==Pu)&&(La&&dm(),La=setInterval(function(){var u=wi(document.elementFromPoint(o,a),!0);u!==l&&(l=u,rl()),Bu(t,i.options,u,r)},10),Lu=o,Pu=a)}else{if(!this.options.bubbleScroll||wi(s,!0)===Fr()){rl();return}Bu(t,this.options,wi(s,!1),!1)}}},lr(n,{pluginName:"scroll",initializeByDefault:!0})}function rl(){Ut.forEach(function(n){clearInterval(n.pid)}),Ut=[]}function dm(){clearInterval(La)}var Bu=ux(function(n,e,t,r){if(e.scroll){var i=(n.touches?n.touches[0]:n).clientX,o=(n.touches?n.touches[0]:n).clientY,a=e.scrollSensitivity,s=e.scrollSpeed,l=Fr(),u=!1,c;pf!==t&&(pf=t,rl(),ka=e.scroll,c=e.scrollFn,ka===!0&&(ka=wi(t,!0)));var h=0,f=ka;do{var b=f,x=Tt(b),w=x.top,g=x.bottom,y=x.left,C=x.right,A=x.width,_=x.height,N=void 0,O=void 0,T=b.scrollWidth,D=b.scrollHeight,M=he(b),L=b.scrollLeft,E=b.scrollTop;b===l?(N=A<T&&(M.overflowX==="auto"||M.overflowX==="scroll"||M.overflowX==="visible"),O=_<D&&(M.overflowY==="auto"||M.overflowY==="scroll"||M.overflowY==="visible")):(N=A<T&&(M.overflowX==="auto"||M.overflowX==="scroll"),O=_<D&&(M.overflowY==="auto"||M.overflowY==="scroll"));var S=N&&(Math.abs(C-i)<=a&&L+A<T)-(Math.abs(y-i)<=a&&!!L),I=O&&(Math.abs(g-o)<=a&&E+_<D)-(Math.abs(w-o)<=a&&!!E);if(!Ut[h])for(var P=0;P<=h;P++)Ut[P]||(Ut[P]={});(Ut[h].vx!=S||Ut[h].vy!=I||Ut[h].el!==b)&&(Ut[h].el=b,Ut[h].vx=S,Ut[h].vy=I,clearInterval(Ut[h].pid),(S!=0||I!=0)&&(u=!0,Ut[h].pid=setInterval((function(){r&&this.layer===0&&Oe.active._onTouchMove(pl);var B=Ut[this.layer].vy?Ut[this.layer].vy*s:0,F=Ut[this.layer].vx?Ut[this.layer].vx*s:0;typeof c=="function"&&c.call(Oe.dragged.parentNode[fn],F,B,n,pl,Ut[this.layer].el)!=="continue"||cx(Ut[this.layer].el,F,B)}).bind({layer:h}),24))),h++}while(e.bubbleScroll&&f!==l&&(f=wi(f,!1)));gf=u}},30),bx=function(e){var t=e.originalEvent,r=e.putSortable,i=e.dragEl,o=e.activeSortable,a=e.dispatchSortableEvent,s=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(t){var u=r||o;s();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,h=document.elementFromPoint(c.clientX,c.clientY);l(),u&&!u.el.contains(h)&&(a("spill"),this.onSpill({dragEl:i,putSortable:r}))}};function op(){}op.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,r=e.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var i=na(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),r&&r.animateAll()},drop:bx};lr(op,{pluginName:"revertOnSpill"});function ap(){}ap.prototype={onSpill:function(e){var t=e.dragEl,r=e.putSortable,i=r||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:bx};lr(ap,{pluginName:"removeOnSpill"});var nr;function aT(){function n(){this.defaults={swapClass:"sortable-swap-highlight"}}return n.prototype={dragStart:function(t){var r=t.dragEl;nr=r},dragOverValid:function(t){var r=t.completed,i=t.target,o=t.onMove,a=t.activeSortable,s=t.changed,l=t.cancel;if(a.options.swap){var u=this.sortable.el,c=this.options;if(i&&i!==u){var h=nr;o(i)!==!1?(Mt(i,c.swapClass,!0),nr=i):nr=null,h&&h!==nr&&Mt(h,c.swapClass,!1)}s(),r(!0),l()}},drop:function(t){var r=t.activeSortable,i=t.putSortable,o=t.dragEl,a=i||this.sortable,s=this.options;nr&&Mt(nr,s.swapClass,!1),nr&&(s.swap||i&&i.options.swap)&&o!==nr&&(a.captureAnimationState(),a!==r&&r.captureAnimationState(),sT(o,nr),a.animateAll(),a!==r&&r.animateAll())},nulling:function(){nr=null}},lr(n,{pluginName:"swap",eventProperties:function(){return{swapItem:nr}}})}function sT(n,e){var t=n.parentNode,r=e.parentNode,i,o;!t||!r||t.isEqualNode(e)||r.isEqualNode(n)||(i=Bt(n),o=Bt(e),t.isEqualNode(r)&&i<o&&o++,t.insertBefore(e,t.children[i]),r.insertBefore(n,r.children[o]))}var Pe=[],Wn=[],va,br,ya=!1,jn=!1,mo=!1,Ct,xa,Ms;function lT(){function n(e){for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this));e.options.avoidImplicitDeselect||(e.options.supportPointer?We(document,"pointerup",this._deselectMultiDrag):(We(document,"mouseup",this._deselectMultiDrag),We(document,"touchend",this._deselectMultiDrag))),We(document,"keydown",this._checkKeyDown),We(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(i,o){var a="";Pe.length&&br===e?Pe.forEach(function(s,l){a+=(l?", ":"")+s.textContent}):a=o.textContent,i.setData("Text",a)}}}return n.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){var r=t.dragEl;Ct=r},delayEnded:function(){this.isMultiDrag=~Pe.indexOf(Ct)},setupClone:function(t){var r=t.sortable,i=t.cancel;if(this.isMultiDrag){for(var o=0;o<Pe.length;o++)Wn.push(ip(Pe[o])),Wn[o].sortableIndex=Pe[o].sortableIndex,Wn[o].draggable=!1,Wn[o].style["will-change"]="",Mt(Wn[o],this.options.selectedClass,!1),Pe[o]===Ct&&Mt(Wn[o],this.options.chosenClass,!1);r._hideClone(),i()}},clone:function(t){var r=t.sortable,i=t.rootEl,o=t.dispatchSortableEvent,a=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||Pe.length&&br===r&&(hm(!0,i),o("clone"),a()))},showClone:function(t){var r=t.cloneNowShown,i=t.rootEl,o=t.cancel;this.isMultiDrag&&(hm(!1,i),Wn.forEach(function(a){he(a,"display","")}),r(),Ms=!1,o())},hideClone:function(t){var r=this;t.sortable;var i=t.cloneNowHidden,o=t.cancel;this.isMultiDrag&&(Wn.forEach(function(a){he(a,"display","none"),r.options.removeCloneOnHide&&a.parentNode&&a.parentNode.removeChild(a)}),i(),Ms=!0,o())},dragStartGlobal:function(t){t.sortable,!this.isMultiDrag&&br&&br.multiDrag._deselectMultiDrag(),Pe.forEach(function(r){r.sortableIndex=Bt(r)}),Pe=Pe.sort(function(r,i){return r.sortableIndex-i.sortableIndex}),mo=!0},dragStarted:function(t){var r=this,i=t.sortable;if(this.isMultiDrag){if(this.options.sort&&(i.captureAnimationState(),this.options.animation)){Pe.forEach(function(a){a!==Ct&&he(a,"position","absolute")});var o=Tt(Ct,!1,!0,!0);Pe.forEach(function(a){a!==Ct&&sm(a,o)}),jn=!0,ya=!0}i.animateAll(function(){jn=!1,ya=!1,r.options.animation&&Pe.forEach(function(a){Ou(a)}),r.options.sort&&ks()})}},dragOver:function(t){var r=t.target,i=t.completed,o=t.cancel;jn&&~Pe.indexOf(r)&&(i(!1),o())},revert:function(t){var r=t.fromSortable,i=t.rootEl,o=t.sortable,a=t.dragRect;Pe.length>1&&(Pe.forEach(function(s){o.addAnimationState({target:s,rect:jn?Tt(s):a}),Ou(s),s.fromRect=a,r.removeAnimationState(s)}),jn=!1,uT(!this.options.removeCloneOnHide,i))},dragOverCompleted:function(t){var r=t.sortable,i=t.isOwner,o=t.insertion,a=t.activeSortable,s=t.parentEl,l=t.putSortable,u=this.options;if(o){if(i&&a._hideClone(),ya=!1,u.animation&&Pe.length>1&&(jn||!i&&!a.options.sort&&!l)){var c=Tt(Ct,!1,!0,!0);Pe.forEach(function(f){f!==Ct&&(sm(f,c),s.appendChild(f))}),jn=!0}if(!i)if(jn||ks(),Pe.length>1){var h=Ms;a._showClone(r),a.options.animation&&!Ms&&h&&Wn.forEach(function(f){a.addAnimationState({target:f,rect:xa}),f.fromRect=xa,f.thisAnimationDuration=null})}else a._showClone(r)}},dragOverAnimationCapture:function(t){var r=t.dragRect,i=t.isOwner,o=t.activeSortable;if(Pe.forEach(function(s){s.thisAnimationDuration=null}),o.options.animation&&!i&&o.multiDrag.isMultiDrag){xa=lr({},r);var a=zi(Ct,!0);xa.top-=a.f,xa.left-=a.e}},dragOverAnimationComplete:function(){jn&&(jn=!1,ks())},drop:function(t){var r=t.originalEvent,i=t.rootEl,o=t.parentEl,a=t.sortable,s=t.dispatchSortableEvent,l=t.oldIndex,u=t.putSortable,c=u||this.sortable;if(r){var h=this.options,f=o.children;if(!mo)if(h.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),Mt(Ct,h.selectedClass,!~Pe.indexOf(Ct)),~Pe.indexOf(Ct))Pe.splice(Pe.indexOf(Ct),1),va=null,Da({sortable:a,rootEl:i,name:"deselect",targetEl:Ct,originalEvent:r});else{if(Pe.push(Ct),Da({sortable:a,rootEl:i,name:"select",targetEl:Ct,originalEvent:r}),r.shiftKey&&va&&a.el.contains(va)){var b=Bt(va),x=Bt(Ct);~b&&~x&&b!==x&&(function(){var C,A;x>b?(A=b,C=x):(A=x,C=b+1);for(var _=h.filter;A<C;A++)if(!~Pe.indexOf(f[A])&&kn(f[A],h.draggable,o,!1)){var N=_&&(typeof _=="function"?_.call(a,r,f[A],a):_.split(",").some(function(O){return kn(f[A],O.trim(),o,!1)}));N||(Mt(f[A],h.selectedClass,!0),Pe.push(f[A]),Da({sortable:a,rootEl:i,name:"select",targetEl:f[A],originalEvent:r}))}})()}else va=Ct;br=c}if(mo&&this.isMultiDrag){if(jn=!1,(o[fn].options.sort||o!==i)&&Pe.length>1){var w=Tt(Ct),g=Bt(Ct,":not(."+this.options.selectedClass+")");if(!ya&&h.animation&&(Ct.thisAnimationDuration=null),c.captureAnimationState(),!ya&&(h.animation&&(Ct.fromRect=w,Pe.forEach(function(C){if(C.thisAnimationDuration=null,C!==Ct){var A=jn?Tt(C):w;C.fromRect=A,c.addAnimationState({target:C,rect:A})}})),ks(),Pe.forEach(function(C){f[g]?o.insertBefore(C,f[g]):o.appendChild(C),g++}),l===Bt(Ct))){var y=!1;Pe.forEach(function(C){if(C.sortableIndex!==Bt(C)){y=!0;return}}),y&&(s("update"),s("sort"))}Pe.forEach(function(C){Ou(C)}),c.animateAll()}br=c}(i===o||u&&u.lastPutMode!=="clone")&&Wn.forEach(function(C){C.parentNode&&C.parentNode.removeChild(C)})}},nullingGlobal:function(){this.isMultiDrag=mo=!1,Wn.length=0},destroyGlobal:function(){this._deselectMultiDrag(),Ve(document,"pointerup",this._deselectMultiDrag),Ve(document,"mouseup",this._deselectMultiDrag),Ve(document,"touchend",this._deselectMultiDrag),Ve(document,"keydown",this._checkKeyDown),Ve(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(typeof mo<"u"&&mo)&&br===this.sortable&&!(t&&kn(t.target,this.options.draggable,this.sortable.el,!1))&&!(t&&t.button!==0))for(;Pe.length;){var r=Pe[0];Mt(r,this.options.selectedClass,!1),Pe.shift(),Da({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:r,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},lr(n,{pluginName:"multiDrag",utils:{select:function(t){var r=t.parentNode[fn];!r||!r.options.multiDrag||~Pe.indexOf(t)||(br&&br!==r&&(br.multiDrag._deselectMultiDrag(),br=r),Mt(t,r.options.selectedClass,!0),Pe.push(t))},deselect:function(t){var r=t.parentNode[fn],i=Pe.indexOf(t);!r||!r.options.multiDrag||!~i||(Mt(t,r.options.selectedClass,!1),Pe.splice(i,1))}},eventProperties:function(){var t=this,r=[],i=[];return Pe.forEach(function(o){r.push({multiDragElement:o,index:o.sortableIndex});var a;jn&&o!==Ct?a=-1:jn?a=Bt(o,":not(."+t.options.selectedClass+")"):a=Bt(o),i.push({multiDragElement:o,index:a})}),{items:k_(Pe),clones:[].concat(Wn),oldIndicies:r,newIndicies:i}},optionListeners:{multiDragKey:function(t){return t=t.toLowerCase(),t==="ctrl"?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function uT(n,e){Pe.forEach(function(t,r){var i=e.children[t.sortableIndex+(n?Number(r):0)];i?e.insertBefore(t,i):e.appendChild(t)})}function hm(n,e){Wn.forEach(function(t,r){var i=e.children[t.sortableIndex+(n?Number(r):0)];i?e.insertBefore(t,i):e.appendChild(t)})}function ks(){Pe.forEach(function(n){n!==Ct&&n.parentNode&&n.parentNode.removeChild(n)})}Oe.mount(new oT);Oe.mount(ap,op);const cT=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:lT,Sortable:Oe,Swap:aT,default:Oe},Symbol.toStringTag,{value:"Module"})),dT=k1(cT);var Fu={exports:{}};var fm;function hT(){return fm||(fm=1,(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var r=[],i=0;i<arguments.length;i++){var o=arguments[i];if(o){var a=typeof o;if(a==="string"||a==="number")r.push(o);else if(Array.isArray(o)){if(o.length){var s=t.apply(null,o);s&&r.push(s)}}else if(a==="object")if(o.toString===Object.prototype.toString)for(var l in o)e.call(o,l)&&o[l]&&r.push(l);else r.push(o.toString())}}return r.join(" ")}n.exports?(t.default=t,n.exports=t):window.classNames=t})()})(Fu)),Fu.exports}var fT=process.env.NODE_ENV==="production",Gu="Invariant failed";function pT(n,e){if(!n){if(fT)throw new Error(Gu);var t=typeof e=="function"?e():e,r=t?Gu+": "+t:Gu;throw new Error(r)}}const gT=Object.freeze(Object.defineProperty({__proto__:null,default:pT},Symbol.toStringTag,{value:"Module"})),mT=k1(gT);var pm;function bT(){return pm||(pm=1,(function(n){var e=dT,t=hT(),r=m,i=mT;function o(O){return O&&O.__esModule?O.default:O}function a(O,T,D,M){Object.defineProperty(O,T,{get:D,set:M,enumerable:!0,configurable:!0})}function s(O,T){return Object.keys(T).forEach(function(D){D==="default"||D==="__esModule"||O.hasOwnProperty(D)||Object.defineProperty(O,D,{enumerable:!0,get:function(){return T[D]}})}),O}a(n.exports,"Sortable",()=>$882b6d93070905b3$re_export$Sortable),a(n.exports,"Direction",()=>$882b6d93070905b3$re_export$Direction),a(n.exports,"DOMRect",()=>$882b6d93070905b3$re_export$DOMRect),a(n.exports,"GroupOptions",()=>$882b6d93070905b3$re_export$GroupOptions),a(n.exports,"MoveEvent",()=>$882b6d93070905b3$re_export$MoveEvent),a(n.exports,"Options",()=>$882b6d93070905b3$re_export$Options),a(n.exports,"PullResult",()=>$882b6d93070905b3$re_export$PullResult),a(n.exports,"PutResult",()=>$882b6d93070905b3$re_export$PutResult),a(n.exports,"SortableEvent",()=>$882b6d93070905b3$re_export$SortableEvent),a(n.exports,"SortableOptions",()=>$882b6d93070905b3$re_export$SortableOptions),a(n.exports,"Utils",()=>$882b6d93070905b3$re_export$Utils),a(n.exports,"ReactSortable",()=>_);function l(O){O.parentElement!==null&&O.parentElement.removeChild(O)}function u(O,T,D){const M=O.children[D]||null;O.insertBefore(T,M)}function c(O){O.forEach(T=>l(T.element))}function h(O){O.forEach(T=>{u(T.parentElement,T.element,T.oldIndex)})}function f(O,T){const D=g(O),M={parentElement:O.from};let L=[];switch(D){case"normal":L=[{element:O.item,newIndex:O.newIndex,oldIndex:O.oldIndex,parentElement:O.from}];break;case"swap":const I={element:O.item,oldIndex:O.oldIndex,newIndex:O.newIndex,...M},P={element:O.swapItem,oldIndex:O.newIndex,newIndex:O.oldIndex,...M};L=[I,P];break;case"multidrag":L=O.oldIndicies.map((B,F)=>({element:B.multiDragElement,oldIndex:B.index,newIndex:O.newIndicies[F].index,...M}));break}return y(L,T)}function b(O,T){const D=x(O,T);return w(O,D)}function x(O,T){const D=[...T];return O.concat().reverse().forEach(M=>D.splice(M.oldIndex,1)),D}function w(O,T,D,M){const L=[...T];return O.forEach(E=>{const S=M&&D&&M(E.item,D);L.splice(E.newIndex,0,S||E.item)}),L}function g(O){return O.oldIndicies&&O.oldIndicies.length>0?"multidrag":O.swapItem?"swap":"normal"}function y(O,T){return O.map(M=>({...M,item:T[M.oldIndex]})).sort((M,L)=>M.oldIndex-L.oldIndex)}function C(O){const{list:T,setList:D,children:M,tag:L,style:E,className:S,clone:I,onAdd:P,onChange:B,onChoose:F,onClone:G,onEnd:V,onFilter:z,onRemove:W,onSort:J,onStart:Y,onUnchoose:ee,onUpdate:K,onMove:X,onSpill:ie,onSelect:de,onDeselect:oe,...me}=O;return me}const A={dragging:null};class _ extends r.Component{static defaultProps={clone:T=>T};constructor(T){super(T),this.ref=(0,r.createRef)();const D=[...T.list].map(M=>Object.assign(M,{chosen:!1,selected:!1}));T.setList(D,this.sortable,A),o(i)(!T.plugins,`
|
|
36
|
+
</svg>`},hA=n=>{const[e,t,r,i]=n.value.replace("xywh=","").split(",").map(parseFloat),o={id:ln(),rotation:0,scaleX:1,scaleY:1,x:e,y:t,width:r,height:i,type:we.RECTANGLE,fill:Ln.fillColor,stroke:Ln.strokeColor,strokeWidth:Ln.strokeWidth};return{drawingState:JSON.stringify({currentShape:o,shapes:[o],isDrawing:!1}),svg:lA({x:e,y:t,w:r,h:i})}},fA=(n,e)=>{const t=nx(n),r={fill:Ti.fill,id:ln(),radius:Math.max(t.width,t.height)/2,rotation:0,scaleX:1,scaleY:1,stroke:Ti.stroke,strokeWidth:Ti.strokeWidth,type:we.POI,x:t.x+t.width/2,y:t.y+t.height/2},i={drawingState:JSON.stringify({currentShape:r,isDrawing:!1,shapes:[r]}),svg:e},o=n.querySelector("svg").getAttribute("width")||void 0,a=n.querySelector("svg").getAttribute("height")||void 0;return o&&a&&(i.fullCanvaXYWH=`0,0,${o},${a}`),i},pA=n=>{const e={...Ti,id:ln(),radius:rp(),rotation:0,scaleX:1,scaleY:1,type:we.POI,x:n.x,y:n.y};return{drawingState:JSON.stringify({currentShape:e,isDrawing:!1,shapes:[e]})}},gA=(n,e)=>{const r=new DOMParser().parseFromString(n.value,"image/svg+xml");if(e===Ge.POI_TYPE||e===Ge.NESTED_MAP_TYPE)return fA(r,n.value);const i=nx(r),o=r.querySelector("svg").getAttribute("width")||void 0,a=r.querySelector("svg").getAttribute("height")||void 0,s={id:ln(),rotation:0,scaleX:1,scaleY:1,x:i.x,y:i.y,width:i.width,height:i.height,type:we.RECTANGLE,fill:r.querySelector("path[fill]")?.getAttribute("fill")||Ln.fillColor,stroke:r.querySelector("path[stroke]")?.getAttribute("stroke")||Ln.strokeColor,strokeWidth:r.querySelector("path[stroke-width]")?.getAttribute("stroke-width")||Ln.strokeWidth},l={drawingState:JSON.stringify({currentShape:s,shapes:[s],isDrawing:!1}),svg:n.value};return o&&a&&(l.fullCanvaXYWH=`0,0,${o},${a}`),l},mA=(n,e,t)=>{const r=["SvgSelector","FragmentSelector","PointSelector"],i=Array.isArray(n.selector)?n.selector:[n.selector];for(const o of i)try{if(o.type==="SvgSelector")return gA(o,t);if(o.type==="FragmentSelector")return hA(o);if(o.type==="PointSelector")return pA(o)}catch(a){console.error(`Error generating maeData from selector ${o.type}, attempting to fallback to other selector`,a)}return console.error(`On annotation '${e}': none of the selector types in the annotation are unsupported: ${i.map(o=>o.type)}. Supported selectors are: [${r}].`),{}};function fs(n){if(!n.maeData||Object.keys(n.maeData||{}).length===0)try{const e={target:{},templateType:"",tags:[],textBody:{}},[t,r]=sA(n);return e.templateType=t,e.textBody=r,e.target=mA(n.target,n.id,t),n.maeData=e,n}catch(e){return console.error("Error generating maeData from annotation",e),n}return n}const ra=n=>{if(!n)return!0;const e=n.trim();return e===""?!0:e.replace(/<[^>]*>/g,"").trim()===""},cl=()=>`${new Date().toLocaleString()}`,bA=[Ge.TAGGING_TYPE,Ge.TEXT_TYPE,Ge.MULTIPLE_BODY_TYPE,Ge.POI_TYPE,Ge.NESTED_MAP_TYPE],ps=async(n,e,t,r)=>{const i=n;return i.maeData.target={drawingState:i.maeData.target.drawingState,fullCanvaXYWH:i.maeData.target.fullCanvaXYWH,scale:i.maeData.target.scale,tend:i.maeData.target.tend,tstart:i.maeData.target.tstart},console.info("Annotation state target",i.maeData.target),bA.includes(i.maeData.templateType)&&i.maeData.target.drawingState.shapes.length>0&&(i.maeData.target.svg=await Z_(t)),eA(i.maeData),i.maeData.target.scale=r.getMediaTrueHeight()/r.getDisplayedMediaHeight()*r.getZoom(),i.target=aA(i.maeData,e.id,t,r.getScale()),i.maeData.target.drawingState=JSON.stringify(i.maeData.target.drawingState),i},rx=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=n;return i.body&&!Array.isArray(i.body)&&ra(i.body.value)&&(i.body.value=cl()),ps(i,e,t,r)},ix=n=>{const e=n;return e.maeData?.textBody&&ra(e.maeData.textBody.value)&&(e.maeData.textBody.value=cl()),e.body=[e.maeData.textBody],e.body.push(...e.maeData.tags.map(t=>({id:t.value,purpose:"tagging",type:"TextualBody",value:t.value}))),e},vA=async(n,e,t,r)=>{const i=n;return n.maeData.templateType===Ge.IIIF_TYPE?n:(i.body&&!Array.isArray(i.body)&&ra(i.body.value)&&(i.body.value=cl()),i.maeData.templateType===Ge.MULTIPLE_BODY_TYPE?ix(i):i.maeData?.textBody&&ra(i.maeData.textBody.value)&&(i.maeData.textBody.value=cl()),ps(i,e,t,r))};function Xg(n){const e={chars:n.value};return n.purpose==="tagging"?e["@type"]="oa:Tag":e["@type"]="dctypes:Text",n.format&&(e.format=n.format),n.language&&(e.language=n.language),n.purpose&&(e.motivation=n.purpose),e}function Ug(n){switch(n.type){case"SvgSelector":return{"@type":"oa:SvgSelector",value:n.value};case"FragmentSelector":return{"@type":"oa:FragmentSelector",value:n.value};case"PointSelector":return{"@type":"oa:PointSelector",x:n.x,y:n.y};default:return null}}function yA(n){const e={"@context":"https://iiif.io/api/presentation/2/context.json","@type":"oa:Annotation",maeData:n.maeData||{},motivation:"oa:commenting"};if(n.id?.startsWith("http")&&(e["@id"]=n.id),Array.isArray(n.body)?e.resource=n.body.map(t=>Xg(t)):e.resource=Xg(n.body),typeof n.target=="object"&&!Array.isArray(n.target)&&n.target!==null?e.on={"@type":"oa:SpecificResource",full:n.target.source?.id||n.target.id||n.target.source}:e.on=n.target,n.target.selector){if(Array.isArray(n.target.selector)){const t=n.target.selector.map(r=>Ug(r));e.on.selector={"@type":"oa:Choice",default:t[0],item:t[1]}}else e.on.selector=Ug(n.target.selector);n.target.source?.partOf&&(e.on.within={"@id":n.target.source.partOf.id,"@type":"sc:Manifest"})}return e}function $g(n){const e={type:"TextualBody",value:n.chars};return n.motivation&&(e.purpose=n.motivation),n.format&&(e.format=n.format),n.language&&(e.language=n.language),n["@type"]==="oa:Tag"&&(e.purpose="tagging"),e}function pf(n){switch(n["@type"]){case"oa:SvgSelector":return{type:"SvgSelector",value:n.value};case"oa:FragmentSelector":return{type:"FragmentSelector",value:n.value};case"oa:PointSelector":return{type:"PointSelector",x:n.x,y:n.y};case"oa:Choice":return[pf(n.default),pf(n.item)];default:return null}}function xA(n){const e={id:n["@id"],maeData:n.maeData||{},motivation:"commenting",type:"Annotation"};Array.isArray(n.resource)?e.body=n.resource.map(r=>$g(r)):n.resource?e.body=$g(n.resource):e.body={};let t=n.on;return Array.isArray(t)&&([t]=t),e.target={selector:pf(t.selector),source:t.full},t.within&&(e.target.source={id:t.full,partOf:{id:t.within["@id"],type:"Manifest"},type:"Canvas"}),e}function CA(n,e){if(Array.isArray(n)){const t=n.map(r=>xA(r));return{id:e,items:t,type:"AnnotationPage"}}return n}class ox{constructor(e,t){this.annotationPageId=e,t?this.user=t:this.user=dl}getStorageAdapterUser(){return this.user}async create(e){const t={id:this.annotationPageId,items:[],type:"AnnotationPage"},r=await this.all()||t;return r.items.push(e),localStorage.setItem(this.annotationPageId,JSON.stringify(r)),console.log("CREATE ANNOTATION",r),r}async update(e){const t=await this.all();if(t){const r=t.items.findIndex(i=>i.id===e.id);return t.items.splice(r,1,e),localStorage.setItem(this.annotationPageId,JSON.stringify(t)),console.log("UPDATE ANNOTATION",t),t}return null}async delete(e){const t=await this.all();return t&&(t.items=t.items.filter(r=>r.id!==e)),localStorage.setItem(this.annotationPageId,JSON.stringify(t)),t}async get(e){const t=await this.all();return t?t.items.find(r=>r.id===e):null}async all(){const e=JSON.parse(localStorage.getItem(this.annotationPageId));return e&&(e.items=e.items.map(fs)),e}}const dl="Anonymous",EA={add_a_circle:"إضافة دائرة",add_a_free_hand_shape:"إضافة شكل حر",add_a_line:"إضافة خط",add_a_rectangle:"إضافة مستطيل",add_an_arrow_shape:"إضافة شكل سهم",add_an_ellipse:"إضافة شكل بيضاوي",add_image_from_url:"إضافة صورة من رابط URL",anonymous:"مجهول",applyMerge:"تطبيق",arrow:"سهم",border_color:"لون الحدود",cancel:"إلغاء",circle:"دائرة",click_on_canvas_to_write:" انقر على اللوحة للكتابة",click_to_delete_shape:"انقر على الشكل لحذفه",confirmTemplateSelectionContent:"تحتوي ملاحظتك بالفعل على محتوى. راجع القالب أدناه، ثم عدّل ملاحظتك لدمج ما تحتاجه.",confirmTemplateSelectionTitle:"دمج القالب مع ملاحظتك",container_size:"حجم الحاوية",create_annotation:"إنشاء تعليق توضيحي",createdByOn:"أنشأه {{creator}}، {{creationDate}}",currentNoteContent:"ملاحظتك",debugAnnotation:"تصحيح التعليق التوضيحي في وحدة التحكم",delete:"حذف",delete_all:"حذف الكل",deleteAnnotation:"حذف",detected_media_type:"تم اكتشاف نوع الوسائط {{mediaType}}.",document:"مستند",drawings_and_text_in_overlay:"رسومات ونص في الطبقة العلوية",edit:"تعديل",edit_annotation:"تعديل التعليق التوضيحي",edit_iiif_json_code:"تعديل كود IIIF JSON مباشرة",ellipse:"شكل بيضاوي",expert_mode:"وضع الخبير",export_annotation:"تصدير التعليقات التوضيحية",export_annotation_for:"تصدير التعليق التوضيحي لـ {{label}}",export_local_annotation:"تصدير التعليقات التوضيحية المحلية للعناصر المرئية",fill_color:"لون التعبئة",freehand:"رسم حر",image:"صورة",image_displayed:"الصورة المعروضة",image_in_overlay_with_note:"صورة في الطبقة العلوية مع ملاحظة",image_true_size:"الحجم الحقيقي للصورة",imageUrl:"رابط الصورة",journey:"مسار",journey_description:"سلسلة مرتبة من نقاط الاهتمام، بعنوان ووصف اختياري",journey_description_placeholder:"صف هذا المسار…",journey_description_section:"الوصف",journey_hint:"Use the left annotation list to associate POIs to journey and order them",journey_language:"اللغة",journey_media_ar:"الوسائط (عربي)",journey_media_en:"الوسائط (إنجليزي)",journey_media_keep_same:"استخدام نفس الوسائط لكلا اللغتين",journey_title:"العنوان",journey_title_required:"أدخل عنوانًا لكل لغة.",lastEditedByOn:"آخر تعديل بواسطة {{lastEditor}}، {{lastSavedDate}}",line:"خط",line_weight:"سمك الخط",loading_failed:"فشل التحميل",maev_github_link:"https://github.com/SCENE-CE/mirador-annotation-editor-video",manifest_link:"تعليق توضيحي على البيان",manifest_link_with_note:"بيان مع ملاحظة",manifest_url:"رابط البيان",map_relation_no_results:"لا توجد خرائط مطابقة",map_relation_search_prompt:"ابدأ الكتابة للبحث عن خرائط",media_not_supported:"الوسائط غير مدعومة",media_not_supported_text:"الوسائط التي تحاول التعليق عليها غير مدعومة حاليًا في هذا النظام",metadata:"البيانات الوصفية",move_to_journey:"نقل إلى مسار",nested_map:"خريطة متداخلة",nested_map_description:"نقطة اهتمام تفتح خريطة أخرى عند النقر عليها",nested_map_linked_map:"الخريطة المرتبطة",nested_map_linked_map_required:"اختر خريطة لربط هذه النقطة بها.",new_annotation:"تعليق توضيحي جديد",no_annotation:"لا توجد تعليقات توضيحية مخزنة بعد.",note:"ملاحظة",object_list:"قائمة العناصر",onlyOneImageAllowed:"يُسمح بصورة واحدة فقط",openNestedMap:"فتح الخريطة",overlay:"الطبقة العلوية",poi:"نقطة اهتمام",poi_click_to_place:"انقر على الصورة لوضع علامة نقطة الاهتمام. انقر مرة أخرى لتحريكها.",poi_description:"نقطة اهتمام لها موقع ووصف وروابط اختيارية",poi_description_placeholder:"صف نقطة الاهتمام هذه…",poi_description_section:"الوصف",poi_language:"اللغة",poi_latitude:"خط العرض",poi_latitude_invalid:"يجب أن يكون خط العرض بين -90 و90.",poi_longitude:"خط الطول",poi_longitude_invalid:"يجب أن يكون خط الطول بين -180 و180.",poi_media_ar:"الوسائط (عربي)",poi_media_en:"الوسائط (إنجليزي)",poi_media_keep_same:"استخدام نفس الوسائط لكلا اللغتين",poi_media_no_results:"لا توجد نتائج مطابقة",poi_media_search_prompt:"ابدأ الكتابة للبحث",poi_media_source_iiif_image:"صورة IIIF",poi_media_source_media_item:"عنصر الوسائط",poi_media_source_upload:"مكتبة الوسائط",poi_mode:"التفاعل مع الخريطة",poi_mode_move:"التنقل في الخريطة",poi_mode_target:"وضع النقطة",poi_move_hint:"اسحب للتنقل في الخريطة. انتقل إلى أداة التحديد أعلى الخريطة لوضع النقطة أو تحريكها.",pois_mode_target:"تحريك النقاط",poi_target_must_be_point:"انقر على الصورة لتحديد موقع نقطة الاهتمام هذه.",poi_title:"العنوان",poi_title_required:"أدخل عنوانًا لكل لغة.",polygon:"مضلع",previewAnnotation:"معاينة",pressEnterOrClickFirstPointToClose:'انقر على النقطة الأولى أو اضغط "Shift" لإغلاق المضلع، أو "Tab" لتركه مفتوحًا',pressEnterToAddTag:'أضف الوسم واضغط "Enter"',pressEscapeToFinish:'اضغط "Esc" لإنهاء الخط',rectangle:"مستطيل",refresh_journey_path:"تحديث المسار",remove_from_journey:"إزالة من المسار",replace:"استبدال",save:"حفظ",saving:"جارٍ الحفظ…",scale:"المقياس",select_cursor:"مؤشر التحديد",selected_object:"العنصر المحدد",selectedTemplateContent:"القالب المحدد",shape:"شكل",shape_selection:"رسم الأشكال",shapes:"الأشكال",spatialTarget:"الأشكال",style:"النمط",style_selection:"اختيار النمط",switch_view:"التبديل إلى العرض الفردي",switch_view_content:`لا يمكن تعديل التعليقات التوضيحية إلا في عرض اللوحة الفردية.
|
|
37
|
+
هل تريد التبديل إلى عرض فردي الآن؟`,switch_view_h2:"التبديل إلى عرض فردي؟",tag:"وسم",tag_with_target:"وسم بموقع مستهدف",tags:"الوسوم",tagsPlaceholder:"أضف وسومًا ...",target:"الموقع المستهدف",text:"نص",textual_note_with_target:"ملاحظة نصية بموقع مستهدف",tool_selection:"اختيار الأداة",unsupported_media_message:"نوع وسائط اللوحة الحالية غير مدعوم من محرر التعليقات التوضيحية.",useTemplate:"استخدام قالب",video_annotation_instruction:"إذا كنت تريد التعليق على وسائط الفيديو، يجب عليك تثبيت MAEV لإنشاء وتعديل التعليقات التوضيحية على الفيديو:",your_tag_here:"أضف وسمك هنا:",zoom:"تكبير/تصغير"},wA={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",journey:"Journey",journey_description:"An ordered sequence of POIs, with a title and optional description",journey_description_placeholder:"Describe this journey…",journey_description_section:"Description",journey_hint:"Use the left annotation list to associate POIs to journey and order them",journey_language:"Language",journey_media_ar:"Media (Arabic)",journey_media_en:"Media (English)",journey_media_keep_same:"Keep same media for both languages",journey_title:"Title",journey_title_required:"Enter a title in each language.",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",map_relation_no_results:"No matching maps",map_relation_search_prompt:"Start typing to search maps",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",move_to_journey:"Move to journey",nested_map:"Nested map",nested_map_description:"Point of interest that opens another map when clicked",nested_map_linked_map:"Linked map",nested_map_linked_map_required:"Choose a map for this point to link to.",new_annotation:"New annotation",no_annotation:"No annotations stored yet.",note:"Note",object_list:"Object list",onlyOneImageAllowed:"Only one image is allowed",openNestedMap:"Open map",overlay:"Overlay",poi:"POI",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_placeholder:"Describe this point of interest…",poi_description_section:"Description",poi_language:"Language",poi_latitude:"Latitude",poi_latitude_invalid:"Latitude must be between -90 and 90.",poi_longitude:"Longitude",poi_longitude_invalid:"Longitude must be between -180 and 180.",poi_media_ar:"Media (Arabic)",poi_media_en:"Media (English)",poi_media_keep_same:"Keep same media for both languages",poi_media_no_results:"No matching results",poi_media_search_prompt:"Start typing to search",poi_media_source_iiif_image:"IIIF image",poi_media_source_media_item:"Media item",poi_media_source_upload:"Media library",poi_mode:"Map interaction",poi_mode_move:"Move around the map",poi_mode_target:"Place the point",poi_move_hint:"Drag to move around the map. Switch to the target tool, top right of the map, to place or move the point.",pois_mode_target:"Move the points",poi_target_must_be_point:"Click on the image to set this POI's location.",poi_title:"Title",poi_title_required:"Enter a title in each language.",polygon:"Polygon",previewAnnotation:"Preview",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",refresh_journey_path:"Refresh path",remove_from_journey:"Remove from journey",replace:"Replace",save:"Save",saving:"Saving…",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.
|
|
38
|
+
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"},_A={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",journey:"Parcours",journey_description:"Une séquence ordonnée de POI, avec un titre et une description optionnelle",journey_description_placeholder:"Décrivez ce parcours…",journey_description_section:"Description",journey_hint:"Utiliser la liste d`annotation à gauche pour associer des POis à un Journey ou les ordonner",journey_language:"Langue",journey_media_ar:"Média (arabe)",journey_media_en:"Média (anglais)",journey_media_keep_same:"Utiliser le même média pour les deux langues",journey_title:"Titre",journey_title_required:"Saisissez un titre dans chaque langue.",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",map_relation_no_results:"Aucune carte correspondante",map_relation_search_prompt:"Commencez à taper pour rechercher des cartes",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",move_to_journey:"Déplacer vers un parcours",nested_map:"Carte imbriquée",nested_map_description:"Point d'intérêt qui ouvre une autre carte au clic",nested_map_linked_map:"Carte liée",nested_map_linked_map_required:"Choisissez une carte vers laquelle ce point doit renvoyer.",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",openNestedMap:"Ouvrir la carte",overlay:"Dessin",poi:"POI",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_placeholder:"Décrivez ce point d'intérêt…",poi_description_section:"Description",poi_language:"Langue",poi_latitude:"Latitude",poi_latitude_invalid:"La latitude doit être comprise entre -90 et 90.",poi_longitude:"Longitude",poi_longitude_invalid:"La longitude doit être comprise entre -180 et 180.",poi_media_ar:"Média (arabe)",poi_media_en:"Média (anglais)",poi_media_keep_same:"Utiliser le même média pour les deux langues",poi_media_no_results:"Aucun résultat correspondant",poi_media_search_prompt:"Commencez à taper pour rechercher",poi_media_source_iiif_image:"Image IIIF",poi_media_source_media_item:"Élément média",poi_media_source_upload:"Bibliothèque média",poi_mode:"Interaction avec la carte",poi_mode_move:"Se déplacer sur la carte",poi_mode_target:"Placer le point",poi_move_hint:"Faites glisser pour vous déplacer sur la carte. Passez à l'outil cible, en haut à droite de la carte, pour placer ou déplacer le point.",pois_mode_target:"Déplacer les points",poi_target_must_be_point:"Cliquez sur l'image pour définir la position de ce POI.",poi_title:"Titre",poi_title_required:"Saisissez un titre dans chaque langue.",polygon:"Polygone",previewAnnotation:"Aperçu",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",refresh_journey_path:"Actualiser le tracé",remove_from_journey:"Retirer du parcours",replace:"Remplacer",save:"Sauvegarder",saving:"Enregistrement…",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.
|
|
39
|
+
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"},Fl={ar:EA,en:wA,fr:_A},AA=In.styled("div")(()=>({display:"flex"}));function ax({targetProps:n,TargetComponent:e,annotationEditCompanionWindowIsOpened:t}){const{t:r}=Rn.useTranslation(),[i,o]=m.useState(!1),[a,s]=m.useState(!1),[l,u]=m.useState(null),[c,h]=m.useState(!1),p=xn.useDispatch();m.useEffect(()=>{const I=N=>h(N.detail.saving);return document.addEventListener(hf,I),()=>document.removeEventListener(hf,I)},[]);const b=(I,N)=>{u(n.windowId),p(pe.addCompanionWindow(n.windowId,{content:I,...N}))};m.useEffect(()=>{},[t]);const x=()=>{p(pe.setWindowViewType(n.windowId,"single"))},E=xn.useSelector(I=>pe.getWindowViewType(I,{windowId:n.windowId})),g=xn.useSelector(I=>pe.getVisibleCanvases(I,{windowId:n.windowId})),v=xn.useSelector(I=>I.config),C=m.useCallback(I=>{b("annotationCreation",{position:"right"})},[n.windowId]),A=m.useCallback(()=>{s(!a)},[a]),_=m.useCallback(I=>{o(!i)},[i]),O=v?.annotation?.adapter&&v.annotation.adapter("poke"),R=v.annotation&&O instanceof ox&&v.annotation.exportLocalStorageAnnotations;return f.jsxs(AA,{children:[f.jsx(e,{...n}),v?.annotation?.readonly===!0?null:f.jsxs(f.Fragment,{children:[f.jsx(G.Tooltip,{title:f.jsx(Ri,{label:r("create_annotation"),action:"create"}),children:f.jsx("span",{children:f.jsx(pe.MiradorMenuButton,{"aria-label":r("create_annotation"),onClick:E==="single"?C:A,size:"small",disabled:!t,children:f.jsx(O_,{})})})}),c&&f.jsx(G.Tooltip,{title:r("saving"),children:f.jsx(G.CircularProgress,{"aria-label":r("saving"),size:16,sx:{alignSelf:"center",mx:1}})})]}),a&&f.jsx(np,{open:a,handleClose:A,switchToSingleCanvasView:x,t:r}),R&&f.jsx(G.Tooltip,{title:r("export_local_annotation"),children:f.jsx("div",{children:f.jsx(pe.MiradorMenuButton,{"aria-label":"Export local annotations for visible items",onClick:_,size:"small",children:f.jsx(X1,{})})})}),R&&f.jsx(U1,{canvases:g,config:v,handleClose:_,open:i})]})}ax.propTypes={annotationEditCompanionWindowIsOpened:d.bool.isRequired,canvases:d.arrayOf(d.shape({id:d.string,index:d.number})).isRequired,config:d.shape({annotation:d.shape({adapter:d.func,exportLocalStorageAnnotations:d.bool,readonly:d.bool})}).isRequired,t:d.func.isRequired,TargetComponent:d.oneOfType([d.func,d.node]).isRequired,targetProps:d.object.isRequired,windowViewType:d.string.isRequired};function TA(n,{targetProps:{windowId:e}}){const t=pe.getCompanionWindowsForContent(n,{content:"annotationCreation",windowId:e});let r=!0;return Object.keys(t).length!==0&&(r=!1),{annotationEditCompanionWindowIsOpened:r,canvases:pe.getVisibleCanvases(n,{windowId:e}),config:n.config,windowViewType:pe.getWindowViewType(n,{windowId:e})}}const sx={component:ax,config:{translations:Fl},mapStateToProps:TA,mode:"wrap",target:"AnnotationSettings"},IA=new Set(["INPUT","TEXTAREA","SELECT"]),SA=n=>IA.has(n?.tagName)||n?.isContentEditable;let mo=null;function RA(){const n=xn.useStore();return m.useEffect(()=>{mo&&(document.removeEventListener("keydown",mo),mo=null);const e=t=>{if(SA(t.target))return;const r=Object.values(ff).find(s=>s.keys.includes(t.key));if(!r)return;const i=n.getState(),o=pe.getFocusedWindowId(i);if(!o)return;const a=pe.getConfig(i);a?.annotation?.readonly||(t.preventDefault(),r.handler({config:a,dispatch:n.dispatch,state:i,windowId:o}))};return mo=e,document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e),mo===e&&(mo=null)}},[n]),null}function lx({PluginComponents:n=[],TargetComponent:e,targetProps:t}){return f.jsxs(f.Fragment,{children:[f.jsx(RA,{}),f.jsx(e,{...t,PluginComponents:n})]})}lx.propTypes={PluginComponents:d.array.isRequired,TargetComponent:d.oneOfType([d.func,d.node]).isRequired,targetProps:d.object.isRequired};const ux={component:lx,mode:"wrap",target:"Window"},cx=tt.createSvgIcon(f.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"),OA=tt.createSvgIcon(f.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"),dx=tt.createSvgIcon(f.jsx("path",{d:"m20.5 3-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5M15 19l-6-2.11V5l6 2.11z"}),"Map"),jA=tt.createSvgIcon(f.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),NA=tt.createSvgIcon(f.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");var vu,Yg;function op(){if(Yg)return vu;Yg=1;function n(e,t){for(var r=-1,i=t.length,o=e.length;++r<i;)e[o+r]=t[r];return e}return vu=n,vu}var yu,Zg;function hx(){if(Zg)return yu;Zg=1;var n=typeof sr=="object"&&sr&&sr.Object===Object&&sr;return yu=n,yu}var xu,Jg;function zr(){if(Jg)return xu;Jg=1;var n=hx(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=n||e||Function("return this")();return xu=t,xu}var Cu,Kg;function ca(){if(Kg)return Cu;Kg=1;var n=zr(),e=n.Symbol;return Cu=e,Cu}var Eu,Qg;function DA(){if(Qg)return Eu;Qg=1;var n=ca(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,i=n?n.toStringTag:void 0;function o(a){var s=t.call(a,i),l=a[i];try{a[i]=void 0;var u=!0}catch{}var c=r.call(a);return u&&(s?a[i]=l:delete a[i]),c}return Eu=o,Eu}var wu,em;function MA(){if(em)return wu;em=1;var n=Object.prototype,e=n.toString;function t(r){return e.call(r)}return wu=t,wu}var _u,tm;function to(){if(tm)return _u;tm=1;var n=ca(),e=DA(),t=MA(),r="[object Null]",i="[object Undefined]",o=n?n.toStringTag:void 0;function a(s){return s==null?s===void 0?i:r:o&&o in Object(s)?e(s):t(s)}return _u=a,_u}var Au,nm;function oi(){if(nm)return Au;nm=1;function n(e){return e!=null&&typeof e=="object"}return Au=n,Au}var Tu,rm;function kA(){if(rm)return Tu;rm=1;var n=to(),e=oi(),t="[object Arguments]";function r(i){return e(i)&&n(i)==t}return Tu=r,Tu}var Iu,im;function ap(){if(im)return Iu;im=1;var n=kA(),e=oi(),t=Object.prototype,r=t.hasOwnProperty,i=t.propertyIsEnumerable,o=n((function(){return arguments})())?n:function(a){return e(a)&&r.call(a,"callee")&&!i.call(a,"callee")};return Iu=o,Iu}var Su,om;function cr(){if(om)return Su;om=1;var n=Array.isArray;return Su=n,Su}var Ru,am;function PA(){if(am)return Ru;am=1;var n=ca(),e=ap(),t=cr(),r=n?n.isConcatSpreadable:void 0;function i(o){return t(o)||e(o)||!!(r&&o&&o[r])}return Ru=i,Ru}var Ou,sm;function LA(){if(sm)return Ou;sm=1;var n=op(),e=PA();function t(r,i,o,a,s){var l=-1,u=r.length;for(o||(o=e),s||(s=[]);++l<u;){var c=r[l];i>0&&o(c)?i>1?t(c,i-1,o,a,s):n(s,c):a||(s[s.length]=c)}return s}return Ou=t,Ou}var ju,lm;function BA(){if(lm)return ju;lm=1;var n=LA();function e(t){var r=t==null?0:t.length;return r?n(t,1):[]}return ju=e,ju}var FA=BA();const um=eo(FA),GA=tt.createSvgIcon(f.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"),fx=tt.createSvgIcon(f.jsx("path",{d:"M19 15.18V7c0-2.21-1.79-4-4-4s-4 1.79-4 4v10c0 1.1-.9 2-2 2s-2-.9-2-2V8.82C8.16 8.4 9 7.3 9 6c0-1.66-1.34-3-3-3S3 4.34 3 6c0 1.3.84 2.4 2 2.82V17c0 2.21 1.79 4 4 4s4-1.79 4-4V7c0-1.1.9-2 2-2s2 .9 2 2v8.18c-1.16.41-2 1.51-2 2.82 0 1.66 1.34 3 3 3s3-1.34 3-3c0-1.3-.84-2.4-2-2.82"}),"Route"),qA=tt.createSvgIcon(f.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),px=m.createContext(),gx="tooltip",mx="section";function sp({creator:n,creationDate:e,lastEditor:t,lastSavedDate:r,displayMode:i,t:o}){if(!n||!e)return null;const a=n!==dl?n:o("anonymous"),s=t!==dl?t:o("anonymous");return f.jsxs(f.Fragment,{children:[i===mx&&f.jsx(je,{variant:"formSectionTitle",children:o("metadata")}),i===gx&&f.jsx("h1",{children:o("metadata")}),f.jsx(je,{children:o("createdByOn",{creationDate:e,creator:a})}),r&&t&&f.jsx(je,{children:o("lastEditedByOn",{lastEditor:s,lastSavedDate:r})})]})}sp.propTypes={creationDate:d.string.isRequired,creator:d.string.isRequired,displayMode:d.string.isRequired,lastEditor:d.string.isRequired,lastSavedDate:d.string.isRequired,t:d.func.isRequired};const cm=(n,e)=>n.order===e.order?n.id.localeCompare(e.id):n.order===null||n.order===void 0?1:e.order===null||e.order===void 0?-1:n.order-e.order,bx=(n=[])=>{const e=n.filter(o=>o["dbf:kind"]==="Journey"),t={},r=[];n.filter(o=>o["dbf:kind"]!=="Journey").forEach(o=>{const a=o["dbf:journey"];a?.id?(t[a.id]??=[]).push(o):r.push(o)}),Object.values(t).forEach(o=>o.sort((a,s)=>cm({id:a.id,order:a["dbf:journey"]?.order},{id:s.id,order:s["dbf:journey"]?.order})));const i=[...e.map(o=>({id:o.id,item:o,kind:"Journey",order:o["dbf:order"],pois:t[o.id]??[]})),...r.map(o=>({id:o.id,item:o,kind:"POI",order:o["dbf:order"]}))];return i.sort(cm),i},dm=(n,e)=>{const t=(Array.isArray(n?.body)?n.body:[]).filter(i=>i?.purpose==="identifying"&&i?.type==="TextualBody");return((t.find(i=>i.language===e)??t[0])?.value??"").trim()},hm=(n,e)=>{const t={...n,"dbf:order":e};return n["dbf:kind"]==="POI"&&n["dbf:journey"]&&(t["dbf:journey"]=null),t},vx=(n,e,t)=>({...n,"dbf:journey":{id:e,order:t}}),HA=n=>n.maeData?.target?n:fs({...n}),yx=n=>{const t=HA(n).maeData?.target;if(!t?.drawingState)return null;const i=(typeof t.drawingState=="string"?JSON.parse(t.drawingState):t.drawingState)?.shapes?.[0];return typeof i?.x!="number"||typeof i?.y!="number"?null:{fullCanvaXYWH:t.fullCanvaXYWH,x:i.x,y:i.y}},VA=n=>{const t=Math.max(...n.map(i=>i.x))+50,r=Math.max(...n.map(i=>i.y))+50;return[t,r]},WA=n=>typeof n.target=="string"?n.target:n.target?.source,hl=(n,e,t)=>{const r=bx(e).find(c=>c.kind==="Journey"&&c.id===n);if(!r)return null;const i=t??WA(r.item),o=[];let a;if(r.pois.forEach(c=>{const h=yx(c);h&&(o.push({x:h.x,y:h.y}),a??=h.fullCanvaXYWH)}),o.length<2||!i)return{...r.item,target:i??r.item.target};const[s,l]=a?a.split(",").slice(2):VA(o),u=dA({fullH:l,fullW:s,points:o});return{...r.item,target:tx({svg:u},i)}},fm=n=>[].concat(n?.selector??[]).find(e=>e?.type==="SvgSelector")?.value??null,lp=(n,e)=>{const t=fm(n),r=fm(e);return t===null||r===null?t===r:t===r&&n.source===e.source},xx=async(n,e,t,r,i)=>{if(!n||!e?.items)return;const o=hl(n,e.items,t);if(!o)return;const a=e.items.find(l=>l.id===n);if(a&&lp(a.target,o.target))return;const s=await r.update(o);i(t,r.annotationPageId,s)},Gl=m.forwardRef((n,e)=>{const t=In.useTheme(),[r,i]=m.useState(!1),[o,a]=m.useState(null),s=m.useContext(px),{currentJourneyId:l,journeys:u,onMoveToJourney:c,...h}=n,p=m.useMemo(()=>{const{annotationid:B}=n,{canvases:w,annotationsOnCanvases:P}=s;let T;return w.some(D=>(P[D.id]&&Object.entries(P[D.id]).forEach(([M,k])=>{if(k.json&&k.json.items&&(T=k.json.items.find(V=>V.id===B),T))return T}),T)),T},[n.annotationid,s.canvases,s.annotationsOnCanvases]),b=()=>{const{canvases:B,receiveAnnotation:w,storageAdapter:P}=s,{annotationid:T}=n,D=p?.["dbf:journey"]?.id??null;B.forEach(M=>{const k=P(M.id);k.delete(T).then(V=>{if(w(M.id,k.annotationPageId,V),!D||!V?.items)return;const W=hl(D,V.items,M.id);if(!W)return;const Y=V.items.find(q=>q.id===D);Y&&lp(Y.target,W.target)||k.update(W).then(q=>{w(M.id,k.annotationPageId,q)})})})},x=()=>{const{annotationsOnCanvases:B,canvases:w,receiveAnnotation:P,storageAdapter:T}=s,{annotationid:D}=n;w.forEach(M=>{const k=B[M.id];k&&Object.values(k).forEach(V=>{const W=V?.json?.items;if(!W?.some(J=>J.id===D))return;const Y=hl(D,W,M.id);if(!Y)return;const q=T(M.id);q.update(Y).then(J=>{P(M.id,q.annotationPageId,J)})})})},E=()=>{const{addCompanionWindow:B}=s,{annotationid:w}=n;B("annotationCreation",{annotationid:w,position:"right"})},g=()=>{const{addCompanionWindow:B}=s,{annotationid:w}=n;B("mapsPoiPreview",{annotationid:w,position:"right"})},v=p?.["dbf:linkedMap"],C=s.config?.annotation?.openLinkedMap,A=!!v&&(!!C||!!v.manifestId),_=()=>{C?C(v):s.addWindow({manifestId:v.manifestId})},O=()=>{const{annotationsOnCanvases:B,canvases:w}=s,{annotationid:P}=n,T=w.map(D=>B[D.id]?um(Object.entries(B[D.id]).map(([M,k])=>k.json&&k.json.items?k.json.items.filter(V=>V.maeData).map(V=>V.id):[])):[]);return um(T).includes(P)},R=B=>{a(B.currentTarget)},I=()=>a(null),N=B=>{c?.(B),I()},{t:L}=Rn.useTranslation();return f.jsxs("div",{onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:"mirador-annotation-list-item","data-testid":"mirador-annotation-list-item",ref:e,children:[r&&O()&&f.jsx("div",{children:f.jsxs(Ll,{"aria-label":"annotation tools",size:"small",sx:{bgcolor:t.palette.background.paper,borderRadius:t.shape.borderRadius,boxShadow:t.shadows[2],position:"absolute",right:0,zIndex:t.zIndex.modal+1},children:[s.config?.annotation.debug&&f.jsx(G.Tooltip,{title:L("debugAnnotation"),children:f.jsx("span",{children:f.jsx(Gt,{"aria-label":"Debug",onClick:()=>console.log(p),value:"debug",children:f.jsx(NA,{})})})}),!!p?.creator&&f.jsx(G.Tooltip,{title:f.jsx(sp,{creator:p.creator,creationDate:p.creationDate,lastEditor:p.lastEditor,lastSavedDate:p.lastSavedDate,displayMode:gx,t:L}),children:f.jsx("span",{children:f.jsx(Gt,{"aria-label":"Metadata",value:"metadata",children:f.jsx(GA,{})})})}),A&&f.jsx(G.Tooltip,{title:L("openNestedMap"),children:f.jsx("span",{children:f.jsx(Gt,{"aria-label":"Open nested map",onClick:_,value:"open-nested-map",children:f.jsx(dx,{})})})}),!p?.["dbf:linkedMap"]&&!!p?.["dbf:kind"]&&f.jsx(G.Tooltip,{title:L("previewAnnotation"),children:f.jsx("span",{children:f.jsx(Gt,{"aria-label":"Preview",onClick:g,value:"preview",disabled:!s.annotationPreviewCompanionWindowIsOpened,children:f.jsx(jA,{})})})}),s.config?.annotation?.readonly!==!0&&p?.["dbf:kind"]==="Journey"&&f.jsx(G.Tooltip,{title:L("refresh_journey_path"),children:f.jsx("span",{children:f.jsx(Gt,{"aria-label":"Refresh path",onClick:x,value:"refresh-path",disabled:!s.annotationEditCompanionWindowIsOpened,children:f.jsx(qA,{})})})}),s.config?.annotation?.readonly!==!0&&!!u&&(u.length>0||!!l)&&f.jsx(G.Tooltip,{title:L("move_to_journey"),children:f.jsx("span",{children:f.jsx(Gt,{"aria-label":"Move to journey",onClick:R,value:"move-to-journey",disabled:!s.annotationEditCompanionWindowIsOpened,children:f.jsx(fx,{})})})}),s.config?.annotation?.readonly!==!0&&[f.jsx(G.Tooltip,{title:L("edit_annotation"),children:f.jsx("span",{children:f.jsx(Gt,{"aria-label":"Edit",onClick:s.windowViewType==="single"?E:s.toggleSingleCanvasDialogOpen,value:"edit",disabled:!s.annotationEditCompanionWindowIsOpened,children:f.jsx(OA,{})})})},"edit"),f.jsx(G.Tooltip,{title:f.jsx(Ri,{label:L("deleteAnnotation"),action:"delete"}),children:f.jsx("span",{children:f.jsx(Gt,{"aria-label":"Delete",onClick:b,value:"delete",disabled:!s.annotationEditCompanionWindowIsOpened,children:f.jsx(cx,{})})})},"delete")]]})}),!!u&&f.jsxs(T_,{anchorEl:o,onClose:I,open:!!o,children:[!!l&&[f.jsx(ul,{onClick:()=>N(null),children:L("remove_from_journey")},"none"),f.jsx(I_,{},"divider")],u.map(B=>f.jsx(ul,{onClick:()=>N(B.id),selected:B.id===l,children:B.title},B.id))]}),f.jsx("li",{...h,children:n.children})]})});Gl.propTypes={annotationEditCompanionWindowIsOpened:d.bool.isRequired,annotationid:d.string.isRequired,children:d.oneOfType([d.func,d.node]).isRequired,currentJourneyId:d.string,journeys:d.arrayOf(d.shape({id:d.string.isRequired,title:d.string.isRequired})),onMoveToJourney:d.func};Gl.defaultProps={currentJourneyId:null,journeys:void 0,onMoveToJourney:void 0};var Nu,pm;function zA(){if(pm)return Nu;pm=1;function n(){this.__data__=[],this.size=0}return Nu=n,Nu}var Du,gm;function up(){if(gm)return Du;gm=1;function n(e,t){return e===t||e!==e&&t!==t}return Du=n,Du}var Mu,mm;function ql(){if(mm)return Mu;mm=1;var n=up();function e(t,r){for(var i=t.length;i--;)if(n(t[i][0],r))return i;return-1}return Mu=e,Mu}var ku,bm;function XA(){if(bm)return ku;bm=1;var n=ql(),e=Array.prototype,t=e.splice;function r(i){var o=this.__data__,a=n(o,i);if(a<0)return!1;var s=o.length-1;return a==s?o.pop():t.call(o,a,1),--this.size,!0}return ku=r,ku}var Pu,vm;function UA(){if(vm)return Pu;vm=1;var n=ql();function e(t){var r=this.__data__,i=n(r,t);return i<0?void 0:r[i][1]}return Pu=e,Pu}var Lu,ym;function $A(){if(ym)return Lu;ym=1;var n=ql();function e(t){return n(this.__data__,t)>-1}return Lu=e,Lu}var Bu,xm;function YA(){if(xm)return Bu;xm=1;var n=ql();function e(t,r){var i=this.__data__,o=n(i,t);return o<0?(++this.size,i.push([t,r])):i[o][1]=r,this}return Bu=e,Bu}var Fu,Cm;function Hl(){if(Cm)return Fu;Cm=1;var n=zA(),e=XA(),t=UA(),r=$A(),i=YA();function o(a){var s=-1,l=a==null?0:a.length;for(this.clear();++s<l;){var u=a[s];this.set(u[0],u[1])}}return o.prototype.clear=n,o.prototype.delete=e,o.prototype.get=t,o.prototype.has=r,o.prototype.set=i,Fu=o,Fu}var Gu,Em;function ZA(){if(Em)return Gu;Em=1;var n=Hl();function e(){this.__data__=new n,this.size=0}return Gu=e,Gu}var qu,wm;function JA(){if(wm)return qu;wm=1;function n(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}return qu=n,qu}var Hu,_m;function KA(){if(_m)return Hu;_m=1;function n(e){return this.__data__.get(e)}return Hu=n,Hu}var Vu,Am;function QA(){if(Am)return Vu;Am=1;function n(e){return this.__data__.has(e)}return Vu=n,Vu}var Wu,Tm;function da(){if(Tm)return Wu;Tm=1;function n(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return Wu=n,Wu}var zu,Im;function Cx(){if(Im)return zu;Im=1;var n=to(),e=da(),t="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function a(s){if(!e(s))return!1;var l=n(s);return l==r||l==i||l==t||l==o}return zu=a,zu}var Xu,Sm;function eT(){if(Sm)return Xu;Sm=1;var n=zr(),e=n["__core-js_shared__"];return Xu=e,Xu}var Uu,Rm;function tT(){if(Rm)return Uu;Rm=1;var n=eT(),e=(function(){var r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function t(r){return!!e&&e in r}return Uu=t,Uu}var $u,Om;function Ex(){if(Om)return $u;Om=1;var n=Function.prototype,e=n.toString;function t(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return $u=t,$u}var Yu,jm;function nT(){if(jm)return Yu;jm=1;var n=Cx(),e=tT(),t=da(),r=Ex(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(p){if(!t(p)||e(p))return!1;var b=n(p)?c:o;return b.test(r(p))}return Yu=h,Yu}var Zu,Nm;function rT(){if(Nm)return Zu;Nm=1;function n(e,t){return e?.[t]}return Zu=n,Zu}var Ju,Dm;function no(){if(Dm)return Ju;Dm=1;var n=nT(),e=rT();function t(r,i){var o=e(r,i);return n(o)?o:void 0}return Ju=t,Ju}var Ku,Mm;function cp(){if(Mm)return Ku;Mm=1;var n=no(),e=zr(),t=n(e,"Map");return Ku=t,Ku}var Qu,km;function Vl(){if(km)return Qu;km=1;var n=no(),e=n(Object,"create");return Qu=e,Qu}var ec,Pm;function iT(){if(Pm)return ec;Pm=1;var n=Vl();function e(){this.__data__=n?n(null):{},this.size=0}return ec=e,ec}var tc,Lm;function oT(){if(Lm)return tc;Lm=1;function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return tc=n,tc}var nc,Bm;function aT(){if(Bm)return nc;Bm=1;var n=Vl(),e="__lodash_hash_undefined__",t=Object.prototype,r=t.hasOwnProperty;function i(o){var a=this.__data__;if(n){var s=a[o];return s===e?void 0:s}return r.call(a,o)?a[o]:void 0}return nc=i,nc}var rc,Fm;function sT(){if(Fm)return rc;Fm=1;var n=Vl(),e=Object.prototype,t=e.hasOwnProperty;function r(i){var o=this.__data__;return n?o[i]!==void 0:t.call(o,i)}return rc=r,rc}var ic,Gm;function lT(){if(Gm)return ic;Gm=1;var n=Vl(),e="__lodash_hash_undefined__";function t(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=n&&i===void 0?e:i,this}return ic=t,ic}var oc,qm;function uT(){if(qm)return oc;qm=1;var n=iT(),e=oT(),t=aT(),r=sT(),i=lT();function o(a){var s=-1,l=a==null?0:a.length;for(this.clear();++s<l;){var u=a[s];this.set(u[0],u[1])}}return o.prototype.clear=n,o.prototype.delete=e,o.prototype.get=t,o.prototype.has=r,o.prototype.set=i,oc=o,oc}var ac,Hm;function cT(){if(Hm)return ac;Hm=1;var n=uT(),e=Hl(),t=cp();function r(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}return ac=r,ac}var sc,Vm;function dT(){if(Vm)return sc;Vm=1;function n(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return sc=n,sc}var lc,Wm;function Wl(){if(Wm)return lc;Wm=1;var n=dT();function e(t,r){var i=t.__data__;return n(r)?i[typeof r=="string"?"string":"hash"]:i.map}return lc=e,lc}var uc,zm;function hT(){if(zm)return uc;zm=1;var n=Wl();function e(t){var r=n(this,t).delete(t);return this.size-=r?1:0,r}return uc=e,uc}var cc,Xm;function fT(){if(Xm)return cc;Xm=1;var n=Wl();function e(t){return n(this,t).get(t)}return cc=e,cc}var dc,Um;function pT(){if(Um)return dc;Um=1;var n=Wl();function e(t){return n(this,t).has(t)}return dc=e,dc}var hc,$m;function gT(){if($m)return hc;$m=1;var n=Wl();function e(t,r){var i=n(this,t),o=i.size;return i.set(t,r),this.size+=i.size==o?0:1,this}return hc=e,hc}var fc,Ym;function dp(){if(Ym)return fc;Ym=1;var n=cT(),e=hT(),t=fT(),r=pT(),i=gT();function o(a){var s=-1,l=a==null?0:a.length;for(this.clear();++s<l;){var u=a[s];this.set(u[0],u[1])}}return o.prototype.clear=n,o.prototype.delete=e,o.prototype.get=t,o.prototype.has=r,o.prototype.set=i,fc=o,fc}var pc,Zm;function mT(){if(Zm)return pc;Zm=1;var n=Hl(),e=cp(),t=dp(),r=200;function i(o,a){var s=this.__data__;if(s instanceof n){var l=s.__data__;if(!e||l.length<r-1)return l.push([o,a]),this.size=++s.size,this;s=this.__data__=new t(l)}return s.set(o,a),this.size=s.size,this}return pc=i,pc}var gc,Jm;function hp(){if(Jm)return gc;Jm=1;var n=Hl(),e=ZA(),t=JA(),r=KA(),i=QA(),o=mT();function a(s){var l=this.__data__=new n(s);this.size=l.size}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=i,a.prototype.set=o,gc=a,gc}var mc,Km;function bT(){if(Km)return mc;Km=1;var n="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,n),this}return mc=e,mc}var bc,Qm;function vT(){if(Qm)return bc;Qm=1;function n(e){return this.__data__.has(e)}return bc=n,bc}var vc,eb;function yT(){if(eb)return vc;eb=1;var n=dp(),e=bT(),t=vT();function r(i){var o=-1,a=i==null?0:i.length;for(this.__data__=new n;++o<a;)this.add(i[o])}return r.prototype.add=r.prototype.push=e,r.prototype.has=t,vc=r,vc}var yc,tb;function xT(){if(tb)return yc;tb=1;function n(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}return yc=n,yc}var xc,nb;function CT(){if(nb)return xc;nb=1;function n(e,t){return e.has(t)}return xc=n,xc}var Cc,rb;function wx(){if(rb)return Cc;rb=1;var n=yT(),e=xT(),t=CT(),r=1,i=2;function o(a,s,l,u,c,h){var p=l&r,b=a.length,x=s.length;if(b!=x&&!(p&&x>b))return!1;var E=h.get(a),g=h.get(s);if(E&&g)return E==s&&g==a;var v=-1,C=!0,A=l&i?new n:void 0;for(h.set(a,s),h.set(s,a);++v<b;){var _=a[v],O=s[v];if(u)var R=p?u(O,_,v,s,a,h):u(_,O,v,a,s,h);if(R!==void 0){if(R)continue;C=!1;break}if(A){if(!e(s,function(I,N){if(!t(A,N)&&(_===I||c(_,I,l,u,h)))return A.push(N)})){C=!1;break}}else if(!(_===O||c(_,O,l,u,h))){C=!1;break}}return h.delete(a),h.delete(s),C}return Cc=o,Cc}var Ec,ib;function _x(){if(ib)return Ec;ib=1;var n=zr(),e=n.Uint8Array;return Ec=e,Ec}var wc,ob;function ET(){if(ob)return wc;ob=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i,o){r[++t]=[o,i]}),r}return wc=n,wc}var _c,ab;function wT(){if(ab)return _c;ab=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}return _c=n,_c}var Ac,sb;function _T(){if(sb)return Ac;sb=1;var n=ca(),e=_x(),t=up(),r=wx(),i=ET(),o=wT(),a=1,s=2,l="[object Boolean]",u="[object Date]",c="[object Error]",h="[object Map]",p="[object Number]",b="[object RegExp]",x="[object Set]",E="[object String]",g="[object Symbol]",v="[object ArrayBuffer]",C="[object DataView]",A=n?n.prototype:void 0,_=A?A.valueOf:void 0;function O(R,I,N,L,B,w,P){switch(N){case C:if(R.byteLength!=I.byteLength||R.byteOffset!=I.byteOffset)return!1;R=R.buffer,I=I.buffer;case v:return!(R.byteLength!=I.byteLength||!w(new e(R),new e(I)));case l:case u:case p:return t(+R,+I);case c:return R.name==I.name&&R.message==I.message;case b:case E:return R==I+"";case h:var T=i;case x:var D=L&a;if(T||(T=o),R.size!=I.size&&!D)return!1;var M=P.get(R);if(M)return M==I;L|=s,P.set(R,I);var k=r(T(R),T(I),L,B,w,P);return P.delete(R),k;case g:if(_)return _.call(R)==_.call(I)}return!1}return Ac=O,Ac}var Tc,lb;function Ax(){if(lb)return Tc;lb=1;var n=op(),e=cr();function t(r,i,o){var a=i(r);return e(r)?a:n(a,o(r))}return Tc=t,Tc}var Ic,ub;function AT(){if(ub)return Ic;ub=1;function n(e,t){for(var r=-1,i=e==null?0:e.length,o=0,a=[];++r<i;){var s=e[r];t(s,r,e)&&(a[o++]=s)}return a}return Ic=n,Ic}var Sc,cb;function Tx(){if(cb)return Sc;cb=1;function n(){return[]}return Sc=n,Sc}var Rc,db;function fp(){if(db)return Rc;db=1;var n=AT(),e=Tx(),t=Object.prototype,r=t.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(a){return a==null?[]:(a=Object(a),n(i(a),function(s){return r.call(a,s)}))}:e;return Rc=o,Rc}var Oc,hb;function TT(){if(hb)return Oc;hb=1;function n(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}return Oc=n,Oc}var Ma={exports:{}},jc,fb;function IT(){if(fb)return jc;fb=1;function n(){return!1}return jc=n,jc}Ma.exports;var pb;function pp(){return pb||(pb=1,(function(n,e){var t=zr(),r=IT(),i=e&&!e.nodeType&&e,o=i&&!0&&n&&!n.nodeType&&n,a=o&&o.exports===i,s=a?t.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;n.exports=u})(Ma,Ma.exports)),Ma.exports}var Nc,gb;function Ix(){if(gb)return Nc;gb=1;var n=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(r,i){var o=typeof r;return i=i??n,!!i&&(o=="number"||o!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return Nc=t,Nc}var Dc,mb;function gp(){if(mb)return Dc;mb=1;var n=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=n}return Dc=e,Dc}var Mc,bb;function ST(){if(bb)return Mc;bb=1;var n=to(),e=gp(),t=oi(),r="[object Arguments]",i="[object Array]",o="[object Boolean]",a="[object Date]",s="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",h="[object Object]",p="[object RegExp]",b="[object Set]",x="[object String]",E="[object WeakMap]",g="[object ArrayBuffer]",v="[object DataView]",C="[object Float32Array]",A="[object Float64Array]",_="[object Int8Array]",O="[object Int16Array]",R="[object Int32Array]",I="[object Uint8Array]",N="[object Uint8ClampedArray]",L="[object Uint16Array]",B="[object Uint32Array]",w={};w[C]=w[A]=w[_]=w[O]=w[R]=w[I]=w[N]=w[L]=w[B]=!0,w[r]=w[i]=w[g]=w[o]=w[v]=w[a]=w[s]=w[l]=w[u]=w[c]=w[h]=w[p]=w[b]=w[x]=w[E]=!1;function P(T){return t(T)&&e(T.length)&&!!w[n(T)]}return Mc=P,Mc}var kc,vb;function mp(){if(vb)return kc;vb=1;function n(e){return function(t){return e(t)}}return kc=n,kc}var ka={exports:{}};ka.exports;var yb;function bp(){return yb||(yb=1,(function(n,e){var t=hx(),r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,o=i&&i.exports===r,a=o&&t.process,s=(function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}})();n.exports=s})(ka,ka.exports)),ka.exports}var Pc,xb;function Sx(){if(xb)return Pc;xb=1;var n=ST(),e=mp(),t=bp(),r=t&&t.isTypedArray,i=r?e(r):n;return Pc=i,Pc}var Lc,Cb;function Rx(){if(Cb)return Lc;Cb=1;var n=TT(),e=ap(),t=cr(),r=pp(),i=Ix(),o=Sx(),a=Object.prototype,s=a.hasOwnProperty;function l(u,c){var h=t(u),p=!h&&e(u),b=!h&&!p&&r(u),x=!h&&!p&&!b&&o(u),E=h||p||b||x,g=E?n(u.length,String):[],v=g.length;for(var C in u)(c||s.call(u,C))&&!(E&&(C=="length"||b&&(C=="offset"||C=="parent")||x&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||i(C,v)))&&g.push(C);return g}return Lc=l,Lc}var Bc,Eb;function vp(){if(Eb)return Bc;Eb=1;var n=Object.prototype;function e(t){var r=t&&t.constructor,i=typeof r=="function"&&r.prototype||n;return t===i}return Bc=e,Bc}var Fc,wb;function Ox(){if(wb)return Fc;wb=1;function n(e,t){return function(r){return e(t(r))}}return Fc=n,Fc}var Gc,_b;function RT(){if(_b)return Gc;_b=1;var n=Ox(),e=n(Object.keys,Object);return Gc=e,Gc}var qc,Ab;function OT(){if(Ab)return qc;Ab=1;var n=vp(),e=RT(),t=Object.prototype,r=t.hasOwnProperty;function i(o){if(!n(o))return e(o);var a=[];for(var s in Object(o))r.call(o,s)&&s!="constructor"&&a.push(s);return a}return qc=i,qc}var Hc,Tb;function zl(){if(Tb)return Hc;Tb=1;var n=Cx(),e=gp();function t(r){return r!=null&&e(r.length)&&!n(r)}return Hc=t,Hc}var Vc,Ib;function gs(){if(Ib)return Vc;Ib=1;var n=Rx(),e=OT(),t=zl();function r(i){return t(i)?n(i):e(i)}return Vc=r,Vc}var Wc,Sb;function jx(){if(Sb)return Wc;Sb=1;var n=Ax(),e=fp(),t=gs();function r(i){return n(i,t,e)}return Wc=r,Wc}var zc,Rb;function jT(){if(Rb)return zc;Rb=1;var n=jx(),e=1,t=Object.prototype,r=t.hasOwnProperty;function i(o,a,s,l,u,c){var h=s&e,p=n(o),b=p.length,x=n(a),E=x.length;if(b!=E&&!h)return!1;for(var g=b;g--;){var v=p[g];if(!(h?v in a:r.call(a,v)))return!1}var C=c.get(o),A=c.get(a);if(C&&A)return C==a&&A==o;var _=!0;c.set(o,a),c.set(a,o);for(var O=h;++g<b;){v=p[g];var R=o[v],I=a[v];if(l)var N=h?l(I,R,v,a,o,c):l(R,I,v,o,a,c);if(!(N===void 0?R===I||u(R,I,s,l,c):N)){_=!1;break}O||(O=v=="constructor")}if(_&&!O){var L=o.constructor,B=a.constructor;L!=B&&"constructor"in o&&"constructor"in a&&!(typeof L=="function"&&L instanceof L&&typeof B=="function"&&B instanceof B)&&(_=!1)}return c.delete(o),c.delete(a),_}return zc=i,zc}var Xc,Ob;function NT(){if(Ob)return Xc;Ob=1;var n=no(),e=zr(),t=n(e,"DataView");return Xc=t,Xc}var Uc,jb;function DT(){if(jb)return Uc;jb=1;var n=no(),e=zr(),t=n(e,"Promise");return Uc=t,Uc}var $c,Nb;function MT(){if(Nb)return $c;Nb=1;var n=no(),e=zr(),t=n(e,"Set");return $c=t,$c}var Yc,Db;function kT(){if(Db)return Yc;Db=1;var n=no(),e=zr(),t=n(e,"WeakMap");return Yc=t,Yc}var Zc,Mb;function Xl(){if(Mb)return Zc;Mb=1;var n=NT(),e=cp(),t=DT(),r=MT(),i=kT(),o=to(),a=Ex(),s="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",h="[object WeakMap]",p="[object DataView]",b=a(n),x=a(e),E=a(t),g=a(r),v=a(i),C=o;return(n&&C(new n(new ArrayBuffer(1)))!=p||e&&C(new e)!=s||t&&C(t.resolve())!=u||r&&C(new r)!=c||i&&C(new i)!=h)&&(C=function(A){var _=o(A),O=_==l?A.constructor:void 0,R=O?a(O):"";if(R)switch(R){case b:return p;case x:return s;case E:return u;case g:return c;case v:return h}return _}),Zc=C,Zc}var Jc,kb;function PT(){if(kb)return Jc;kb=1;var n=hp(),e=wx(),t=_T(),r=jT(),i=Xl(),o=cr(),a=pp(),s=Sx(),l=1,u="[object Arguments]",c="[object Array]",h="[object Object]",p=Object.prototype,b=p.hasOwnProperty;function x(E,g,v,C,A,_){var O=o(E),R=o(g),I=O?c:i(E),N=R?c:i(g);I=I==u?h:I,N=N==u?h:N;var L=I==h,B=N==h,w=I==N;if(w&&a(E)){if(!a(g))return!1;O=!0,L=!1}if(w&&!L)return _||(_=new n),O||s(E)?e(E,g,v,C,A,_):t(E,g,I,v,C,A,_);if(!(v&l)){var P=L&&b.call(E,"__wrapped__"),T=B&&b.call(g,"__wrapped__");if(P||T){var D=P?E.value():E,M=T?g.value():g;return _||(_=new n),A(D,M,v,C,_)}}return w?(_||(_=new n),r(E,g,v,C,A,_)):!1}return Jc=x,Jc}var Kc,Pb;function yp(){if(Pb)return Kc;Pb=1;var n=PT(),e=oi();function t(r,i,o,a,s){return r===i?!0:r==null||i==null||!e(r)&&!e(i)?r!==r&&i!==i:n(r,i,o,a,t,s)}return Kc=t,Kc}var Qc,Lb;function LT(){if(Lb)return Qc;Lb=1;var n=yp();function e(t,r){return n(t,r)}return Qc=e,Qc}var BT=LT();const FT=eo(BT);var ed={exports:{}};function gf(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function GT(n){if(Array.isArray(n))return gf(n)}function qT(n,e,t){return(e=$T(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ur(){return ur=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ur.apply(null,arguments)}function HT(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function VT(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
40
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bb(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function qr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bb(Object(t),!0).forEach(function(r){qT(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bb(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function WT(n,e){if(n==null)return{};var t,r,i=zT(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function zT(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function XT(n){return GT(n)||HT(n)||YT(n)||VT()}function UT(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function $T(n){var e=UT(n,"string");return typeof e=="symbol"?e:e+""}function mf(n){"@babel/helpers - typeof";return mf=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},mf(n)}function YT(n,e){if(n){if(typeof n=="string")return gf(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gf(n,e):void 0}}var ZT="1.15.7";function ni(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var ai=ni(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ms=ni(/Edge/i),Fb=ni(/firefox/i),Ka=ni(/safari/i)&&!ni(/chrome/i)&&!ni(/android/i),xp=ni(/iP(ad|od|hone)/i),Nx=ni(/chrome/i)&&ni(/android/i),Dx={capture:!1,passive:!1};function We(n,e,t){n.addEventListener(e,t,!ai&&Dx)}function Ve(n,e,t){n.removeEventListener(e,t,!ai&&Dx)}function fl(n,e){if(e){if(e[0]===">"&&(e=e.substring(1)),n)try{if(n.matches)return n.matches(e);if(n.msMatchesSelector)return n.msMatchesSelector(e);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(e)}catch{return!1}return!1}}function Mx(n){return n.host&&n!==document&&n.host.nodeType&&n.host!==n?n.host:n.parentNode}function Pn(n,e,t,r){if(n){t=t||document;do{if(e!=null&&(e[0]===">"?n.parentNode===t&&fl(n,e):fl(n,e))||r&&n===t)return n;if(n===t)break}while(n=Mx(n))}return null}var Gb=/\s+/g;function Mt(n,e,t){if(n&&e)if(n.classList)n.classList[t?"add":"remove"](e);else{var r=(" "+n.className+" ").replace(Gb," ").replace(" "+e+" "," ");n.className=(r+(t?" "+e:"")).replace(Gb," ")}}function he(n,e,t){var r=n&&n.style;if(r){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(t=n.currentStyle),e===void 0?t:t[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=t+(typeof t=="string"?"":"px")}}function Ui(n,e){var t="";if(typeof n=="string")t=n;else do{var r=he(n,"transform");r&&r!=="none"&&(t=r+" "+t)}while(!e&&(n=n.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(t)}function kx(n,e,t){if(n){var r=n.getElementsByTagName(e),i=0,o=r.length;if(t)for(;i<o;i++)t(r[i],i);return r}return[]}function Gr(){var n=document.scrollingElement;return n||document.documentElement}function It(n,e,t,r,i){if(!(!n.getBoundingClientRect&&n!==window)){var o,a,s,l,u,c,h;if(n!==window&&n.parentNode&&n!==Gr()?(o=n.getBoundingClientRect(),a=o.top,s=o.left,l=o.bottom,u=o.right,c=o.height,h=o.width):(a=0,s=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,h=window.innerWidth),(e||t)&&n!==window&&(i=i||n.parentNode,!ai))do if(i&&i.getBoundingClientRect&&(he(i,"transform")!=="none"||t&&he(i,"position")!=="static")){var p=i.getBoundingClientRect();a-=p.top+parseInt(he(i,"border-top-width")),s-=p.left+parseInt(he(i,"border-left-width")),l=a+o.height,u=s+o.width;break}while(i=i.parentNode);if(r&&n!==window){var b=Ui(i||n),x=b&&b.a,E=b&&b.d;b&&(a/=E,s/=x,h/=x,c/=E,l=a+c,u=s+h)}return{top:a,left:s,bottom:l,right:u,width:h,height:c}}}function qb(n,e,t){for(var r=_i(n,!0),i=It(n)[e];r;){var o=It(r)[t],a=void 0;if(a=i>=o,!a)return r;if(r===Gr())break;r=_i(r,!1)}return!1}function ia(n,e,t,r){for(var i=0,o=0,a=n.children;o<a.length;){if(a[o].style.display!=="none"&&a[o]!==Oe.ghost&&(r||a[o]!==Oe.dragged)&&Pn(a[o],t.draggable,n,!1)){if(i===e)return a[o];i++}o++}return null}function Cp(n,e){for(var t=n.lastElementChild;t&&(t===Oe.ghost||he(t,"display")==="none"||e&&!fl(t,e));)t=t.previousElementSibling;return t||null}function Ft(n,e){var t=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==Oe.clone&&(!e||fl(n,e))&&t++;return t}function Hb(n){var e=0,t=0,r=Gr();if(n)do{var i=Ui(n),o=i.a,a=i.d;e+=n.scrollLeft*o,t+=n.scrollTop*a}while(n!==r&&(n=n.parentNode));return[e,t]}function JT(n,e){for(var t in n)if(n.hasOwnProperty(t)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===n[t][r])return Number(t)}return-1}function _i(n,e){if(!n||!n.getBoundingClientRect)return Gr();var t=n,r=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var i=he(t);if(t.clientWidth<t.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return Gr();if(r||e)return t;r=!0}}while(t=t.parentNode);return Gr()}function KT(n,e){if(n&&e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function td(n,e){return Math.round(n.top)===Math.round(e.top)&&Math.round(n.left)===Math.round(e.left)&&Math.round(n.height)===Math.round(e.height)&&Math.round(n.width)===Math.round(e.width)}var Qa;function Px(n,e){return function(){if(!Qa){var t=arguments,r=this;t.length===1?n.call(r,t[0]):n.apply(r,t),Qa=setTimeout(function(){Qa=void 0},e)}}}function QT(){clearTimeout(Qa),Qa=void 0}function Lx(n,e,t){n.scrollLeft+=e,n.scrollTop+=t}function Ep(n){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(n).cloneNode(!0):t?t(n).clone(!0)[0]:n.cloneNode(!0)}function Vb(n,e){he(n,"position","absolute"),he(n,"top",e.top),he(n,"left",e.left),he(n,"width",e.width),he(n,"height",e.height)}function nd(n){he(n,"position",""),he(n,"top",""),he(n,"left",""),he(n,"width",""),he(n,"height","")}function Bx(n,e,t){var r={};return Array.from(n.children).forEach(function(i){var o,a,s,l;if(!(!Pn(i,e.draggable,n,!1)||i.animated||i===t)){var u=It(i);r.left=Math.min((o=r.left)!==null&&o!==void 0?o:1/0,u.left),r.top=Math.min((a=r.top)!==null&&a!==void 0?a:1/0,u.top),r.right=Math.max((s=r.right)!==null&&s!==void 0?s:-1/0,u.right),r.bottom=Math.max((l=r.bottom)!==null&&l!==void 0?l:-1/0,u.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var fn="Sortable"+new Date().getTime();function eI(){var n=[],e;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(i){if(!(he(i,"display")==="none"||i===Oe.ghost)){n.push({target:i,rect:It(i)});var o=qr({},n[n.length-1].rect);if(i.thisAnimationDuration){var a=Ui(i,!0);a&&(o.top-=a.f,o.left-=a.e)}i.fromRect=o}})}},addAnimationState:function(r){n.push(r)},removeAnimationState:function(r){n.splice(JT(n,{target:r}),1)},animateAll:function(r){var i=this;if(!this.options.animation){clearTimeout(e),typeof r=="function"&&r();return}var o=!1,a=0;n.forEach(function(s){var l=0,u=s.target,c=u.fromRect,h=It(u),p=u.prevFromRect,b=u.prevToRect,x=s.rect,E=Ui(u,!0);E&&(h.top-=E.f,h.left-=E.e),u.toRect=h,u.thisAnimationDuration&&td(p,h)&&!td(c,h)&&(x.top-h.top)/(x.left-h.left)===(c.top-h.top)/(c.left-h.left)&&(l=nI(x,p,b,i.options)),td(h,c)||(u.prevFromRect=c,u.prevToRect=h,l||(l=i.options.animation),i.animate(u,x,h,l)),l&&(o=!0,a=Math.max(a,l),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},l),u.thisAnimationDuration=l)}),clearTimeout(e),o?e=setTimeout(function(){typeof r=="function"&&r()},a):typeof r=="function"&&r(),n=[]},animate:function(r,i,o,a){if(a){he(r,"transition",""),he(r,"transform","");var s=Ui(this.el),l=s&&s.a,u=s&&s.d,c=(i.left-o.left)/(l||1),h=(i.top-o.top)/(u||1);r.animatingX=!!c,r.animatingY=!!h,he(r,"transform","translate3d("+c+"px,"+h+"px,0)"),this.forRepaintDummy=tI(r),he(r,"transition","transform "+a+"ms"+(this.options.easing?" "+this.options.easing:"")),he(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){he(r,"transition",""),he(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},a)}}}}function tI(n){return n.offsetWidth}function nI(n,e,t,r){return Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*r.animation}var bo=[],rd={initializeByDefault:!0},bs={mount:function(e){for(var t in rd)rd.hasOwnProperty(t)&&!(t in e)&&(e[t]=rd[t]);bo.forEach(function(r){if(r.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),bo.push(e)},pluginEvent:function(e,t,r){var i=this;this.eventCanceled=!1,r.cancel=function(){i.eventCanceled=!0};var o=e+"Global";bo.forEach(function(a){t[a.pluginName]&&(t[a.pluginName][o]&&t[a.pluginName][o](qr({sortable:t},r)),t.options[a.pluginName]&&t[a.pluginName][e]&&t[a.pluginName][e](qr({sortable:t},r)))})},initializePlugins:function(e,t,r,i){bo.forEach(function(s){var l=s.pluginName;if(!(!e.options[l]&&!s.initializeByDefault)){var u=new s(e,t,e.options);u.sortable=e,u.options=e.options,e[l]=u,ur(r,u.defaults)}});for(var o in e.options)if(e.options.hasOwnProperty(o)){var a=this.modifyOption(e,o,e.options[o]);typeof a<"u"&&(e.options[o]=a)}},getEventProperties:function(e,t){var r={};return bo.forEach(function(i){typeof i.eventProperties=="function"&&ur(r,i.eventProperties.call(t[i.pluginName],e))}),r},modifyOption:function(e,t,r){var i;return bo.forEach(function(o){e[o.pluginName]&&o.optionListeners&&typeof o.optionListeners[t]=="function"&&(i=o.optionListeners[t].call(e[o.pluginName],r))}),i}};function Pa(n){var e=n.sortable,t=n.rootEl,r=n.name,i=n.targetEl,o=n.cloneEl,a=n.toEl,s=n.fromEl,l=n.oldIndex,u=n.newIndex,c=n.oldDraggableIndex,h=n.newDraggableIndex,p=n.originalEvent,b=n.putSortable,x=n.extraEventProperties;if(e=e||t&&t[fn],!!e){var E,g=e.options,v="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!ai&&!ms?E=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(E=document.createEvent("Event"),E.initEvent(r,!0,!0)),E.to=a||t,E.from=s||t,E.item=i||t,E.clone=o,E.oldIndex=l,E.newIndex=u,E.oldDraggableIndex=c,E.newDraggableIndex=h,E.originalEvent=p,E.pullMode=b?b.lastPutMode:void 0;var C=qr(qr({},x),bs.getEventProperties(r,e));for(var A in C)E[A]=C[A];t&&t.dispatchEvent(E),g[v]&&g[v].call(e,E)}}var rI=["evt"],Nn=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,o=WT(r,rI);bs.pluginEvent.bind(Oe)(e,t,qr({dragEl:ne,parentEl:Bt,ghostEl:Be,rootEl:St,nextEl:Hi,lastDownEl:nl,cloneEl:Dt,cloneHidden:Ei,dragStarted:La,putSortable:hn,activeSortable:Oe.active,originalEvent:i,oldIndex:Jo,oldDraggableIndex:es,newIndex:Xn,newDraggableIndex:Ci,hideGhostForTarget:Hx,unhideGhostForTarget:Vx,cloneNowHidden:function(){Ei=!0},cloneNowShown:function(){Ei=!1},dispatchSortableEvent:function(s){An({sortable:t,name:s,originalEvent:i})}},o))};function An(n){Pa(qr({putSortable:hn,cloneEl:Dt,targetEl:ne,rootEl:St,oldIndex:Jo,oldDraggableIndex:es,newIndex:Xn,newDraggableIndex:Ci},n))}var ne,Bt,Be,St,Hi,nl,Dt,Ei,Jo,Xn,es,Ci,Ns,hn,To=!1,pl=!1,gl=[],Li,br,id,od,Wb,zb,La,vo,ts,ns=!1,Ds=!1,rl,bn,ad=[],bf=!1,ml=[],Ul=typeof document<"u",Ms=xp,Xb=ms||ai?"cssFloat":"float",iI=Ul&&!Nx&&!xp&&"draggable"in document.createElement("div"),Fx=(function(){if(Ul){if(ai)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}})(),Gx=function(e,t){var r=he(e),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),o=ia(e,0,t),a=ia(e,1,t),s=o&&he(o),l=a&&he(a),u=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+It(o).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+It(a).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&s.float&&s.float!=="none"){var h=s.float==="left"?"left":"right";return a&&(l.clear==="both"||l.clear===h)?"vertical":"horizontal"}return o&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||u>=i&&r[Xb]==="none"||a&&r[Xb]==="none"&&u+c>i)?"vertical":"horizontal"},oI=function(e,t,r){var i=r?e.left:e.top,o=r?e.right:e.bottom,a=r?e.width:e.height,s=r?t.left:t.top,l=r?t.right:t.bottom,u=r?t.width:t.height;return i===s||o===l||i+a/2===s+u/2},aI=function(e,t){var r;return gl.some(function(i){var o=i[fn].options.emptyInsertThreshold;if(!(!o||Cp(i))){var a=It(i),s=e>=a.left-o&&e<=a.right+o,l=t>=a.top-o&&t<=a.bottom+o;if(s&&l)return r=i}}),r},qx=function(e){function t(o,a){return function(s,l,u,c){var h=s.options.group.name&&l.options.group.name&&s.options.group.name===l.options.group.name;if(o==null&&(a||h))return!0;if(o==null||o===!1)return!1;if(a&&o==="clone")return o;if(typeof o=="function")return t(o(s,l,u,c),a)(s,l,u,c);var p=(a?s:l).options.group.name;return o===!0||typeof o=="string"&&o===p||o.join&&o.indexOf(p)>-1}}var r={},i=e.group;(!i||mf(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=t(i.pull,!0),r.checkPut=t(i.put),r.revertClone=i.revertClone,e.group=r},Hx=function(){!Fx&&Be&&he(Be,"display","none")},Vx=function(){!Fx&&Be&&he(Be,"display","")};Ul&&!Nx&&document.addEventListener("click",function(n){if(pl)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),pl=!1,!1},!0);var Bi=function(e){if(ne){e=e.touches?e.touches[0]:e;var t=aI(e.clientX,e.clientY);if(t){var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);r.target=r.rootEl=t,r.preventDefault=void 0,r.stopPropagation=void 0,t[fn]._onDragOver(r)}}},sI=function(e){ne&&ne.parentNode[fn]._isOutsideThisEl(e.target)};function Oe(n,e){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=e=ur({},e),n[fn]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Gx(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,s){a.setData("Text",s.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Oe.supportPointer!==!1&&"PointerEvent"in window&&(!Ka||xp),emptyInsertThreshold:5};bs.initializePlugins(this,n,t);for(var r in t)!(r in e)&&(e[r]=t[r]);qx(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:iI,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?We(n,"pointerdown",this._onTapStart):(We(n,"mousedown",this._onTapStart),We(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(We(n,"dragover",this),We(n,"dragenter",this)),gl.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),ur(this,eI())}Oe.prototype={constructor:Oe,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(vo=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,ne):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,r=this.el,i=this.options,o=i.preventOnFilter,a=e.type,s=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(s||e).target,u=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=i.filter;if(gI(r),!ne&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Ka&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=Pn(l,i.draggable,r,!1),!(l&&l.animated)&&nl!==l)){if(Jo=Ft(l),es=Ft(l,i.draggable),typeof c=="function"){if(c.call(this,e,l,this)){An({sortable:t,rootEl:u,name:"filter",targetEl:l,toEl:r,fromEl:r}),Nn("filter",t,{evt:e}),o&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(h){if(h=Pn(u,h.trim(),r,!1),h)return An({sortable:t,rootEl:h,name:"filter",targetEl:l,fromEl:r,toEl:r}),Nn("filter",t,{evt:e}),!0}),c)){o&&e.preventDefault();return}i.handle&&!Pn(u,i.handle,r,!1)||this._prepareDragStart(e,s,l)}}},_prepareDragStart:function(e,t,r){var i=this,o=i.el,a=i.options,s=o.ownerDocument,l;if(r&&!ne&&r.parentNode===o){var u=It(r);if(St=o,ne=r,Bt=ne.parentNode,Hi=ne.nextSibling,nl=r,Ns=a.group,Oe.dragged=ne,Li={target:ne,clientX:(t||e).clientX,clientY:(t||e).clientY},Wb=Li.clientX-u.left,zb=Li.clientY-u.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,ne.style["will-change"]="all",l=function(){if(Nn("delayEnded",i,{evt:e}),Oe.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Fb&&i.nativeDraggable&&(ne.draggable=!0),i._triggerDragStart(e,t),An({sortable:i,name:"choose",originalEvent:e}),Mt(ne,a.chosenClass,!0)},a.ignore.split(",").forEach(function(c){kx(ne,c.trim(),sd)}),We(s,"dragover",Bi),We(s,"mousemove",Bi),We(s,"touchmove",Bi),a.supportPointer?(We(s,"pointerup",i._onDrop),!this.nativeDraggable&&We(s,"pointercancel",i._onDrop)):(We(s,"mouseup",i._onDrop),We(s,"touchend",i._onDrop),We(s,"touchcancel",i._onDrop)),Fb&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ne.draggable=!0),Nn("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(ms||ai))){if(Oe.eventCanceled){this._onDrop();return}a.supportPointer?(We(s,"pointerup",i._disableDelayedDrag),We(s,"pointercancel",i._disableDelayedDrag)):(We(s,"mouseup",i._disableDelayedDrag),We(s,"touchend",i._disableDelayedDrag),We(s,"touchcancel",i._disableDelayedDrag)),We(s,"mousemove",i._delayedDragTouchMoveHandler),We(s,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&We(s,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(l,a.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ne&&sd(ne),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Ve(e,"mouseup",this._disableDelayedDrag),Ve(e,"touchend",this._disableDelayedDrag),Ve(e,"touchcancel",this._disableDelayedDrag),Ve(e,"pointerup",this._disableDelayedDrag),Ve(e,"pointercancel",this._disableDelayedDrag),Ve(e,"mousemove",this._delayedDragTouchMoveHandler),Ve(e,"touchmove",this._delayedDragTouchMoveHandler),Ve(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?We(document,"pointermove",this._onTouchMove):t?We(document,"touchmove",this._onTouchMove):We(document,"mousemove",this._onTouchMove):(We(ne,"dragend",this),We(St,"dragstart",this._onDragStart));try{document.selection?il(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(To=!1,St&&ne){Nn("dragStarted",this,{evt:t}),this.nativeDraggable&&We(document,"dragover",sI);var r=this.options;!e&&Mt(ne,r.dragClass,!1),Mt(ne,r.ghostClass,!0),Oe.active=this,e&&this._appendGhost(),An({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(br){this._lastX=br.clientX,this._lastY=br.clientY,Hx();for(var e=document.elementFromPoint(br.clientX,br.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(br.clientX,br.clientY),e!==t);)t=e;if(ne.parentNode[fn]._isOutsideThisEl(e),t)do{if(t[fn]){var r=void 0;if(r=t[fn]._onDragOver({clientX:br.clientX,clientY:br.clientY,target:e,rootEl:t}),r&&!this.options.dragoverBubble)break}e=t}while(t=Mx(t));Vx()}},_onTouchMove:function(e){if(Li){var t=this.options,r=t.fallbackTolerance,i=t.fallbackOffset,o=e.touches?e.touches[0]:e,a=Be&&Ui(Be,!0),s=Be&&a&&a.a,l=Be&&a&&a.d,u=Ms&&bn&&Hb(bn),c=(o.clientX-Li.clientX+i.x)/(s||1)+(u?u[0]-ad[0]:0)/(s||1),h=(o.clientY-Li.clientY+i.y)/(l||1)+(u?u[1]-ad[1]:0)/(l||1);if(!Oe.active&&!To){if(r&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<r)return;this._onDragStart(e,!0)}if(Be){a?(a.e+=c-(id||0),a.f+=h-(od||0)):a={a:1,b:0,c:0,d:1,e:c,f:h};var p="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");he(Be,"webkitTransform",p),he(Be,"mozTransform",p),he(Be,"msTransform",p),he(Be,"transform",p),id=c,od=h,br=o}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Be){var e=this.options.fallbackOnBody?document.body:St,t=It(ne,!0,Ms,!0,e),r=this.options;if(Ms){for(bn=e;he(bn,"position")==="static"&&he(bn,"transform")==="none"&&bn!==document;)bn=bn.parentNode;bn!==document.body&&bn!==document.documentElement?(bn===document&&(bn=Gr()),t.top+=bn.scrollTop,t.left+=bn.scrollLeft):bn=Gr(),ad=Hb(bn)}Be=ne.cloneNode(!0),Mt(Be,r.ghostClass,!1),Mt(Be,r.fallbackClass,!0),Mt(Be,r.dragClass,!0),he(Be,"transition",""),he(Be,"transform",""),he(Be,"box-sizing","border-box"),he(Be,"margin",0),he(Be,"top",t.top),he(Be,"left",t.left),he(Be,"width",t.width),he(Be,"height",t.height),he(Be,"opacity","0.8"),he(Be,"position",Ms?"absolute":"fixed"),he(Be,"zIndex","100000"),he(Be,"pointerEvents","none"),Oe.ghost=Be,e.appendChild(Be),he(Be,"transform-origin",Wb/parseInt(Be.style.width)*100+"% "+zb/parseInt(Be.style.height)*100+"%")}},_onDragStart:function(e,t){var r=this,i=e.dataTransfer,o=r.options;if(Nn("dragStart",this,{evt:e}),Oe.eventCanceled){this._onDrop();return}Nn("setupClone",this),Oe.eventCanceled||(Dt=Ep(ne),Dt.removeAttribute("id"),Dt.draggable=!1,Dt.style["will-change"]="",this._hideClone(),Mt(Dt,this.options.chosenClass,!1),Oe.clone=Dt),r.cloneId=il(function(){Nn("clone",r),!Oe.eventCanceled&&(r.options.removeCloneOnHide||St.insertBefore(Dt,ne),r._hideClone(),An({sortable:r,name:"clone"}))}),!t&&Mt(ne,o.dragClass,!0),t?(pl=!0,r._loopId=setInterval(r._emulateDragOver,50)):(Ve(document,"mouseup",r._onDrop),Ve(document,"touchend",r._onDrop),Ve(document,"touchcancel",r._onDrop),i&&(i.effectAllowed="move",o.setData&&o.setData.call(r,i,ne)),We(document,"drop",r),he(ne,"transform","translateZ(0)")),To=!0,r._dragStartId=il(r._dragStarted.bind(r,t,e)),We(document,"selectstart",r),La=!0,window.getSelection().removeAllRanges(),Ka&&he(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,r=e.target,i,o,a,s=this.options,l=s.group,u=Oe.active,c=Ns===l,h=s.sort,p=hn||u,b,x=this,E=!1;if(bf)return;function g(W,Y){Nn(W,x,qr({evt:e,isOwner:c,axis:b?"vertical":"horizontal",revert:a,dragRect:i,targetRect:o,canSort:h,fromSortable:p,target:r,completed:C,onMove:function(J,X){return ks(St,t,ne,i,J,It(J),e,X)},changed:A},Y))}function v(){g("dragOverAnimationCapture"),x.captureAnimationState(),x!==p&&p.captureAnimationState()}function C(W){return g("dragOverCompleted",{insertion:W}),W&&(c?u._hideClone():u._showClone(x),x!==p&&(Mt(ne,hn?hn.options.ghostClass:u.options.ghostClass,!1),Mt(ne,s.ghostClass,!0)),hn!==x&&x!==Oe.active?hn=x:x===Oe.active&&hn&&(hn=null),p===x&&(x._ignoreWhileAnimating=r),x.animateAll(function(){g("dragOverAnimationComplete"),x._ignoreWhileAnimating=null}),x!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(r===ne&&!ne.animated||r===t&&!r.animated)&&(vo=null),!s.dragoverBubble&&!e.rootEl&&r!==document&&(ne.parentNode[fn]._isOutsideThisEl(e.target),!W&&Bi(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),E=!0}function A(){Xn=Ft(ne),Ci=Ft(ne,s.draggable),An({sortable:x,name:"change",toEl:t,newIndex:Xn,newDraggableIndex:Ci,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),r=Pn(r,s.draggable,t,!0),g("dragOver"),Oe.eventCanceled)return E;if(ne.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||x._ignoreWhileAnimating===r)return C(!1);if(pl=!1,u&&!s.disabled&&(c?h||(a=Bt!==St):hn===this||(this.lastPutMode=Ns.checkPull(this,u,ne,e))&&l.checkPut(this,u,ne,e))){if(b=this._getDirection(e,r)==="vertical",i=It(ne),g("dragOverValid"),Oe.eventCanceled)return E;if(a)return Bt=St,v(),this._hideClone(),g("revert"),Oe.eventCanceled||(Hi?St.insertBefore(ne,Hi):St.appendChild(ne)),C(!0);var _=Cp(t,s.draggable);if(!_||dI(e,b,this)&&!_.animated){if(_===ne)return C(!1);if(_&&t===e.target&&(r=_),r&&(o=It(r)),ks(St,t,ne,i,r,o,e,!!r)!==!1)return v(),_&&_.nextSibling?t.insertBefore(ne,_.nextSibling):t.appendChild(ne),Bt=t,A(),C(!0)}else if(_&&cI(e,b,this)){var O=ia(t,0,s,!0);if(O===ne)return C(!1);if(r=O,o=It(r),ks(St,t,ne,i,r,o,e,!1)!==!1)return v(),t.insertBefore(ne,O),Bt=t,A(),C(!0)}else if(r.parentNode===t){o=It(r);var R=0,I,N=ne.parentNode!==t,L=!oI(ne.animated&&ne.toRect||i,r.animated&&r.toRect||o,b),B=b?"top":"left",w=qb(r,"top","top")||qb(ne,"top","top"),P=w?w.scrollTop:void 0;vo!==r&&(I=o[B],ns=!1,Ds=!L&&s.invertSwap||N),R=hI(e,r,o,b,L?1:s.swapThreshold,s.invertedSwapThreshold==null?s.swapThreshold:s.invertedSwapThreshold,Ds,vo===r);var T;if(R!==0){var D=Ft(ne);do D-=R,T=Bt.children[D];while(T&&(he(T,"display")==="none"||T===Be))}if(R===0||T===r)return C(!1);vo=r,ts=R;var M=r.nextElementSibling,k=!1;k=R===1;var V=ks(St,t,ne,i,r,o,e,k);if(V!==!1)return(V===1||V===-1)&&(k=V===1),bf=!0,setTimeout(uI,30),v(),k&&!M?t.appendChild(ne):r.parentNode.insertBefore(ne,k?M:r),w&&Lx(w,0,P-w.scrollTop),Bt=ne.parentNode,I!==void 0&&!Ds&&(rl=Math.abs(I-It(r)[B])),A(),C(!0)}if(t.contains(ne))return C(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ve(document,"mousemove",this._onTouchMove),Ve(document,"touchmove",this._onTouchMove),Ve(document,"pointermove",this._onTouchMove),Ve(document,"dragover",Bi),Ve(document,"mousemove",Bi),Ve(document,"touchmove",Bi)},_offUpEvents:function(){var e=this.el.ownerDocument;Ve(e,"mouseup",this._onDrop),Ve(e,"touchend",this._onDrop),Ve(e,"pointerup",this._onDrop),Ve(e,"pointercancel",this._onDrop),Ve(e,"touchcancel",this._onDrop),Ve(document,"selectstart",this)},_onDrop:function(e){var t=this.el,r=this.options;if(Xn=Ft(ne),Ci=Ft(ne,r.draggable),Nn("drop",this,{evt:e}),Bt=ne&&ne.parentNode,Xn=Ft(ne),Ci=Ft(ne,r.draggable),Oe.eventCanceled){this._nulling();return}To=!1,Ds=!1,ns=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),vf(this.cloneId),vf(this._dragStartId),this.nativeDraggable&&(Ve(document,"drop",this),Ve(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ka&&he(document.body,"user-select",""),he(ne,"transform",""),e&&(La&&(e.cancelable&&e.preventDefault(),!r.dropBubble&&e.stopPropagation()),Be&&Be.parentNode&&Be.parentNode.removeChild(Be),(St===Bt||hn&&hn.lastPutMode!=="clone")&&Dt&&Dt.parentNode&&Dt.parentNode.removeChild(Dt),ne&&(this.nativeDraggable&&Ve(ne,"dragend",this),sd(ne),ne.style["will-change"]="",La&&!To&&Mt(ne,hn?hn.options.ghostClass:this.options.ghostClass,!1),Mt(ne,this.options.chosenClass,!1),An({sortable:this,name:"unchoose",toEl:Bt,newIndex:null,newDraggableIndex:null,originalEvent:e}),St!==Bt?(Xn>=0&&(An({rootEl:Bt,name:"add",toEl:Bt,fromEl:St,originalEvent:e}),An({sortable:this,name:"remove",toEl:Bt,originalEvent:e}),An({rootEl:Bt,name:"sort",toEl:Bt,fromEl:St,originalEvent:e}),An({sortable:this,name:"sort",toEl:Bt,originalEvent:e})),hn&&hn.save()):Xn!==Jo&&Xn>=0&&(An({sortable:this,name:"update",toEl:Bt,originalEvent:e}),An({sortable:this,name:"sort",toEl:Bt,originalEvent:e})),Oe.active&&((Xn==null||Xn===-1)&&(Xn=Jo,Ci=es),An({sortable:this,name:"end",toEl:Bt,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Nn("nulling",this),St=ne=Bt=Be=Hi=Dt=nl=Ei=Li=br=La=Xn=Ci=Jo=es=vo=ts=hn=Ns=Oe.dragged=Oe.ghost=Oe.clone=Oe.active=null;var e=this.el;ml.forEach(function(t){e.contains(t)&&(t.checked=!0)}),ml.length=id=od=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":ne&&(this._onDragOver(e),lI(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,r=this.el.children,i=0,o=r.length,a=this.options;i<o;i++)t=r[i],Pn(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||pI(t));return e},sort:function(e,t){var r={},i=this.el;this.toArray().forEach(function(o,a){var s=i.children[a];Pn(s,this.options.draggable,i,!1)&&(r[o]=s)},this),t&&this.captureAnimationState(),e.forEach(function(o){r[o]&&(i.removeChild(r[o]),i.appendChild(r[o]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Pn(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var r=this.options;if(t===void 0)return r[e];var i=bs.modifyOption(this,e,t);typeof i<"u"?r[e]=i:r[e]=t,e==="group"&&qx(r)},destroy:function(){Nn("destroy",this);var e=this.el;e[fn]=null,Ve(e,"mousedown",this._onTapStart),Ve(e,"touchstart",this._onTapStart),Ve(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ve(e,"dragover",this),Ve(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),gl.splice(gl.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Ei){if(Nn("hideClone",this),Oe.eventCanceled)return;he(Dt,"display","none"),this.options.removeCloneOnHide&&Dt.parentNode&&Dt.parentNode.removeChild(Dt),Ei=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Ei){if(Nn("showClone",this),Oe.eventCanceled)return;ne.parentNode==St&&!this.options.group.revertClone?St.insertBefore(Dt,ne):Hi?St.insertBefore(Dt,Hi):St.appendChild(Dt),this.options.group.revertClone&&this.animate(ne,Dt),he(Dt,"display",""),Ei=!1}}};function lI(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function ks(n,e,t,r,i,o,a,s){var l,u=n[fn],c=u.options.onMove,h;return window.CustomEvent&&!ai&&!ms?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=n,l.dragged=t,l.draggedRect=r,l.related=i||e,l.relatedRect=o||It(e),l.willInsertAfter=s,l.originalEvent=a,n.dispatchEvent(l),c&&(h=c.call(u,l,a)),h}function sd(n){n.draggable=!1}function uI(){bf=!1}function cI(n,e,t){var r=It(ia(t.el,0,t.options,!0)),i=Bx(t.el,t.options,Be),o=10;return e?n.clientX<i.left-o||n.clientY<r.top&&n.clientX<r.right:n.clientY<i.top-o||n.clientY<r.bottom&&n.clientX<r.left}function dI(n,e,t){var r=It(Cp(t.el,t.options.draggable)),i=Bx(t.el,t.options,Be),o=10;return e?n.clientX>i.right+o||n.clientY>r.bottom&&n.clientX>r.left:n.clientY>i.bottom+o||n.clientX>r.right&&n.clientY>r.top}function hI(n,e,t,r,i,o,a,s){var l=r?n.clientY:n.clientX,u=r?t.height:t.width,c=r?t.top:t.left,h=r?t.bottom:t.right,p=!1;if(!a){if(s&&rl<u*i){if(!ns&&(ts===1?l>c+u*o/2:l<h-u*o/2)&&(ns=!0),ns)p=!0;else if(ts===1?l<c+rl:l>h-rl)return-ts}else if(l>c+u*(1-i)/2&&l<h-u*(1-i)/2)return fI(e)}return p=p||a,p&&(l<c+u*o/2||l>h-u*o/2)?l>c+u/2?1:-1:0}function fI(n){return Ft(ne)<Ft(n)?1:-1}function pI(n){for(var e=n.tagName+n.className+n.src+n.href+n.textContent,t=e.length,r=0;t--;)r+=e.charCodeAt(t);return r.toString(36)}function gI(n){ml.length=0;for(var e=n.getElementsByTagName("input"),t=e.length;t--;){var r=e[t];r.checked&&ml.push(r)}}function il(n){return setTimeout(n,0)}function vf(n){return clearTimeout(n)}Ul&&We(document,"touchmove",function(n){(Oe.active||To)&&n.cancelable&&n.preventDefault()});Oe.utils={on:We,off:Ve,css:he,find:kx,is:function(e,t){return!!Pn(e,t,e,!1)},extend:KT,throttle:Px,closest:Pn,toggleClass:Mt,clone:Ep,index:Ft,nextTick:il,cancelNextTick:vf,detectDirection:Gx,getChild:ia,expando:fn};Oe.get=function(n){return n[fn]};Oe.mount=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(Oe.utils=qr(qr({},Oe.utils),r.utils)),bs.mount(r)})};Oe.create=function(n,e){return new Oe(n,e)};Oe.version=ZT;var $t=[],Ba,yf,xf=!1,ld,ud,bl,Fa;function mI(){function n(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return n.prototype={dragStarted:function(t){var r=t.originalEvent;this.sortable.nativeDraggable?We(document,"dragover",this._handleAutoScroll):this.options.supportPointer?We(document,"pointermove",this._handleFallbackAutoScroll):r.touches?We(document,"touchmove",this._handleFallbackAutoScroll):We(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var r=t.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?Ve(document,"dragover",this._handleAutoScroll):(Ve(document,"pointermove",this._handleFallbackAutoScroll),Ve(document,"touchmove",this._handleFallbackAutoScroll),Ve(document,"mousemove",this._handleFallbackAutoScroll)),Ub(),ol(),QT()},nulling:function(){bl=yf=Ba=xf=Fa=ld=ud=null,$t.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,r){var i=this,o=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,s=document.elementFromPoint(o,a);if(bl=t,r||this.options.forceAutoScrollFallback||ms||ai||Ka){cd(t,this.options,s,r);var l=_i(s,!0);xf&&(!Fa||o!==ld||a!==ud)&&(Fa&&Ub(),Fa=setInterval(function(){var u=_i(document.elementFromPoint(o,a),!0);u!==l&&(l=u,ol()),cd(t,i.options,u,r)},10),ld=o,ud=a)}else{if(!this.options.bubbleScroll||_i(s,!0)===Gr()){ol();return}cd(t,this.options,_i(s,!1),!1)}}},ur(n,{pluginName:"scroll",initializeByDefault:!0})}function ol(){$t.forEach(function(n){clearInterval(n.pid)}),$t=[]}function Ub(){clearInterval(Fa)}var cd=Px(function(n,e,t,r){if(e.scroll){var i=(n.touches?n.touches[0]:n).clientX,o=(n.touches?n.touches[0]:n).clientY,a=e.scrollSensitivity,s=e.scrollSpeed,l=Gr(),u=!1,c;yf!==t&&(yf=t,ol(),Ba=e.scroll,c=e.scrollFn,Ba===!0&&(Ba=_i(t,!0)));var h=0,p=Ba;do{var b=p,x=It(b),E=x.top,g=x.bottom,v=x.left,C=x.right,A=x.width,_=x.height,O=void 0,R=void 0,I=b.scrollWidth,N=b.scrollHeight,L=he(b),B=b.scrollLeft,w=b.scrollTop;b===l?(O=A<I&&(L.overflowX==="auto"||L.overflowX==="scroll"||L.overflowX==="visible"),R=_<N&&(L.overflowY==="auto"||L.overflowY==="scroll"||L.overflowY==="visible")):(O=A<I&&(L.overflowX==="auto"||L.overflowX==="scroll"),R=_<N&&(L.overflowY==="auto"||L.overflowY==="scroll"));var P=O&&(Math.abs(C-i)<=a&&B+A<I)-(Math.abs(v-i)<=a&&!!B),T=R&&(Math.abs(g-o)<=a&&w+_<N)-(Math.abs(E-o)<=a&&!!w);if(!$t[h])for(var D=0;D<=h;D++)$t[D]||($t[D]={});($t[h].vx!=P||$t[h].vy!=T||$t[h].el!==b)&&($t[h].el=b,$t[h].vx=P,$t[h].vy=T,clearInterval($t[h].pid),(P!=0||T!=0)&&(u=!0,$t[h].pid=setInterval((function(){r&&this.layer===0&&Oe.active._onTouchMove(bl);var M=$t[this.layer].vy?$t[this.layer].vy*s:0,k=$t[this.layer].vx?$t[this.layer].vx*s:0;typeof c=="function"&&c.call(Oe.dragged.parentNode[fn],k,M,n,bl,$t[this.layer].el)!=="continue"||Lx($t[this.layer].el,k,M)}).bind({layer:h}),24))),h++}while(e.bubbleScroll&&p!==l&&(p=_i(p,!1)));xf=u}},30),Wx=function(e){var t=e.originalEvent,r=e.putSortable,i=e.dragEl,o=e.activeSortable,a=e.dispatchSortableEvent,s=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(t){var u=r||o;s();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,h=document.elementFromPoint(c.clientX,c.clientY);l(),u&&!u.el.contains(h)&&(a("spill"),this.onSpill({dragEl:i,putSortable:r}))}};function wp(){}wp.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,r=e.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var i=ia(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),r&&r.animateAll()},drop:Wx};ur(wp,{pluginName:"revertOnSpill"});function _p(){}_p.prototype={onSpill:function(e){var t=e.dragEl,r=e.putSortable,i=r||this.sortable;i.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),i.animateAll()},drop:Wx};ur(_p,{pluginName:"removeOnSpill"});var nr;function bI(){function n(){this.defaults={swapClass:"sortable-swap-highlight"}}return n.prototype={dragStart:function(t){var r=t.dragEl;nr=r},dragOverValid:function(t){var r=t.completed,i=t.target,o=t.onMove,a=t.activeSortable,s=t.changed,l=t.cancel;if(a.options.swap){var u=this.sortable.el,c=this.options;if(i&&i!==u){var h=nr;o(i)!==!1?(Mt(i,c.swapClass,!0),nr=i):nr=null,h&&h!==nr&&Mt(h,c.swapClass,!1)}s(),r(!0),l()}},drop:function(t){var r=t.activeSortable,i=t.putSortable,o=t.dragEl,a=i||this.sortable,s=this.options;nr&&Mt(nr,s.swapClass,!1),nr&&(s.swap||i&&i.options.swap)&&o!==nr&&(a.captureAnimationState(),a!==r&&r.captureAnimationState(),vI(o,nr),a.animateAll(),a!==r&&r.animateAll())},nulling:function(){nr=null}},ur(n,{pluginName:"swap",eventProperties:function(){return{swapItem:nr}}})}function vI(n,e){var t=n.parentNode,r=e.parentNode,i,o;!t||!r||t.isEqualNode(e)||r.isEqualNode(n)||(i=Ft(n),o=Ft(e),t.isEqualNode(r)&&i<o&&o++,t.insertBefore(e,t.children[i]),r.insertBefore(n,r.children[o]))}var Le=[],Wn=[],ya,vr,xa=!1,Dn=!1,yo=!1,Et,Ca,Ps;function yI(){function n(e){for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this));e.options.avoidImplicitDeselect||(e.options.supportPointer?We(document,"pointerup",this._deselectMultiDrag):(We(document,"mouseup",this._deselectMultiDrag),We(document,"touchend",this._deselectMultiDrag))),We(document,"keydown",this._checkKeyDown),We(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(i,o){var a="";Le.length&&vr===e?Le.forEach(function(s,l){a+=(l?", ":"")+s.textContent}):a=o.textContent,i.setData("Text",a)}}}return n.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){var r=t.dragEl;Et=r},delayEnded:function(){this.isMultiDrag=~Le.indexOf(Et)},setupClone:function(t){var r=t.sortable,i=t.cancel;if(this.isMultiDrag){for(var o=0;o<Le.length;o++)Wn.push(Ep(Le[o])),Wn[o].sortableIndex=Le[o].sortableIndex,Wn[o].draggable=!1,Wn[o].style["will-change"]="",Mt(Wn[o],this.options.selectedClass,!1),Le[o]===Et&&Mt(Wn[o],this.options.chosenClass,!1);r._hideClone(),i()}},clone:function(t){var r=t.sortable,i=t.rootEl,o=t.dispatchSortableEvent,a=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||Le.length&&vr===r&&($b(!0,i),o("clone"),a()))},showClone:function(t){var r=t.cloneNowShown,i=t.rootEl,o=t.cancel;this.isMultiDrag&&($b(!1,i),Wn.forEach(function(a){he(a,"display","")}),r(),Ps=!1,o())},hideClone:function(t){var r=this;t.sortable;var i=t.cloneNowHidden,o=t.cancel;this.isMultiDrag&&(Wn.forEach(function(a){he(a,"display","none"),r.options.removeCloneOnHide&&a.parentNode&&a.parentNode.removeChild(a)}),i(),Ps=!0,o())},dragStartGlobal:function(t){t.sortable,!this.isMultiDrag&&vr&&vr.multiDrag._deselectMultiDrag(),Le.forEach(function(r){r.sortableIndex=Ft(r)}),Le=Le.sort(function(r,i){return r.sortableIndex-i.sortableIndex}),yo=!0},dragStarted:function(t){var r=this,i=t.sortable;if(this.isMultiDrag){if(this.options.sort&&(i.captureAnimationState(),this.options.animation)){Le.forEach(function(a){a!==Et&&he(a,"position","absolute")});var o=It(Et,!1,!0,!0);Le.forEach(function(a){a!==Et&&Vb(a,o)}),Dn=!0,xa=!0}i.animateAll(function(){Dn=!1,xa=!1,r.options.animation&&Le.forEach(function(a){nd(a)}),r.options.sort&&Ls()})}},dragOver:function(t){var r=t.target,i=t.completed,o=t.cancel;Dn&&~Le.indexOf(r)&&(i(!1),o())},revert:function(t){var r=t.fromSortable,i=t.rootEl,o=t.sortable,a=t.dragRect;Le.length>1&&(Le.forEach(function(s){o.addAnimationState({target:s,rect:Dn?It(s):a}),nd(s),s.fromRect=a,r.removeAnimationState(s)}),Dn=!1,xI(!this.options.removeCloneOnHide,i))},dragOverCompleted:function(t){var r=t.sortable,i=t.isOwner,o=t.insertion,a=t.activeSortable,s=t.parentEl,l=t.putSortable,u=this.options;if(o){if(i&&a._hideClone(),xa=!1,u.animation&&Le.length>1&&(Dn||!i&&!a.options.sort&&!l)){var c=It(Et,!1,!0,!0);Le.forEach(function(p){p!==Et&&(Vb(p,c),s.appendChild(p))}),Dn=!0}if(!i)if(Dn||Ls(),Le.length>1){var h=Ps;a._showClone(r),a.options.animation&&!Ps&&h&&Wn.forEach(function(p){a.addAnimationState({target:p,rect:Ca}),p.fromRect=Ca,p.thisAnimationDuration=null})}else a._showClone(r)}},dragOverAnimationCapture:function(t){var r=t.dragRect,i=t.isOwner,o=t.activeSortable;if(Le.forEach(function(s){s.thisAnimationDuration=null}),o.options.animation&&!i&&o.multiDrag.isMultiDrag){Ca=ur({},r);var a=Ui(Et,!0);Ca.top-=a.f,Ca.left-=a.e}},dragOverAnimationComplete:function(){Dn&&(Dn=!1,Ls())},drop:function(t){var r=t.originalEvent,i=t.rootEl,o=t.parentEl,a=t.sortable,s=t.dispatchSortableEvent,l=t.oldIndex,u=t.putSortable,c=u||this.sortable;if(r){var h=this.options,p=o.children;if(!yo)if(h.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),Mt(Et,h.selectedClass,!~Le.indexOf(Et)),~Le.indexOf(Et))Le.splice(Le.indexOf(Et),1),ya=null,Pa({sortable:a,rootEl:i,name:"deselect",targetEl:Et,originalEvent:r});else{if(Le.push(Et),Pa({sortable:a,rootEl:i,name:"select",targetEl:Et,originalEvent:r}),r.shiftKey&&ya&&a.el.contains(ya)){var b=Ft(ya),x=Ft(Et);~b&&~x&&b!==x&&(function(){var C,A;x>b?(A=b,C=x):(A=x,C=b+1);for(var _=h.filter;A<C;A++)if(!~Le.indexOf(p[A])&&Pn(p[A],h.draggable,o,!1)){var O=_&&(typeof _=="function"?_.call(a,r,p[A],a):_.split(",").some(function(R){return Pn(p[A],R.trim(),o,!1)}));O||(Mt(p[A],h.selectedClass,!0),Le.push(p[A]),Pa({sortable:a,rootEl:i,name:"select",targetEl:p[A],originalEvent:r}))}})()}else ya=Et;vr=c}if(yo&&this.isMultiDrag){if(Dn=!1,(o[fn].options.sort||o!==i)&&Le.length>1){var E=It(Et),g=Ft(Et,":not(."+this.options.selectedClass+")");if(!xa&&h.animation&&(Et.thisAnimationDuration=null),c.captureAnimationState(),!xa&&(h.animation&&(Et.fromRect=E,Le.forEach(function(C){if(C.thisAnimationDuration=null,C!==Et){var A=Dn?It(C):E;C.fromRect=A,c.addAnimationState({target:C,rect:A})}})),Ls(),Le.forEach(function(C){p[g]?o.insertBefore(C,p[g]):o.appendChild(C),g++}),l===Ft(Et))){var v=!1;Le.forEach(function(C){if(C.sortableIndex!==Ft(C)){v=!0;return}}),v&&(s("update"),s("sort"))}Le.forEach(function(C){nd(C)}),c.animateAll()}vr=c}(i===o||u&&u.lastPutMode!=="clone")&&Wn.forEach(function(C){C.parentNode&&C.parentNode.removeChild(C)})}},nullingGlobal:function(){this.isMultiDrag=yo=!1,Wn.length=0},destroyGlobal:function(){this._deselectMultiDrag(),Ve(document,"pointerup",this._deselectMultiDrag),Ve(document,"mouseup",this._deselectMultiDrag),Ve(document,"touchend",this._deselectMultiDrag),Ve(document,"keydown",this._checkKeyDown),Ve(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(typeof yo<"u"&&yo)&&vr===this.sortable&&!(t&&Pn(t.target,this.options.draggable,this.sortable.el,!1))&&!(t&&t.button!==0))for(;Le.length;){var r=Le[0];Mt(r,this.options.selectedClass,!1),Le.shift(),Pa({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:r,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},ur(n,{pluginName:"multiDrag",utils:{select:function(t){var r=t.parentNode[fn];!r||!r.options.multiDrag||~Le.indexOf(t)||(vr&&vr!==r&&(vr.multiDrag._deselectMultiDrag(),vr=r),Mt(t,r.options.selectedClass,!0),Le.push(t))},deselect:function(t){var r=t.parentNode[fn],i=Le.indexOf(t);!r||!r.options.multiDrag||!~i||(Mt(t,r.options.selectedClass,!1),Le.splice(i,1))}},eventProperties:function(){var t=this,r=[],i=[];return Le.forEach(function(o){r.push({multiDragElement:o,index:o.sortableIndex});var a;Dn&&o!==Et?a=-1:Dn?a=Ft(o,":not(."+t.options.selectedClass+")"):a=Ft(o),i.push({multiDragElement:o,index:a})}),{items:XT(Le),clones:[].concat(Wn),oldIndicies:r,newIndicies:i}},optionListeners:{multiDragKey:function(t){return t=t.toLowerCase(),t==="ctrl"?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function xI(n,e){Le.forEach(function(t,r){var i=e.children[t.sortableIndex+(n?Number(r):0)];i?e.insertBefore(t,i):e.appendChild(t)})}function $b(n,e){Wn.forEach(function(t,r){var i=e.children[t.sortableIndex+(n?Number(r):0)];i?e.insertBefore(t,i):e.appendChild(t)})}function Ls(){Le.forEach(function(n){n!==Et&&n.parentNode&&n.parentNode.removeChild(n)})}Oe.mount(new mI);Oe.mount(_p,wp);const CI=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:yI,Sortable:Oe,Swap:bI,default:Oe},Symbol.toStringTag,{value:"Module"})),EI=$1(CI);var dd={exports:{}};var Yb;function wI(){return Yb||(Yb=1,(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var r=[],i=0;i<arguments.length;i++){var o=arguments[i];if(o){var a=typeof o;if(a==="string"||a==="number")r.push(o);else if(Array.isArray(o)){if(o.length){var s=t.apply(null,o);s&&r.push(s)}}else if(a==="object")if(o.toString===Object.prototype.toString)for(var l in o)e.call(o,l)&&o[l]&&r.push(l);else r.push(o.toString())}}return r.join(" ")}n.exports?(t.default=t,n.exports=t):window.classNames=t})()})(dd)),dd.exports}var _I=process.env.NODE_ENV==="production",hd="Invariant failed";function AI(n,e){if(!n){if(_I)throw new Error(hd);var t=typeof e=="function"?e():e,r=t?hd+": "+t:hd;throw new Error(r)}}const TI=Object.freeze(Object.defineProperty({__proto__:null,default:AI},Symbol.toStringTag,{value:"Module"})),II=$1(TI);var Zb;function SI(){return Zb||(Zb=1,(function(n){var e=EI,t=wI(),r=m,i=II;function o(R){return R&&R.__esModule?R.default:R}function a(R,I,N,L){Object.defineProperty(R,I,{get:N,set:L,enumerable:!0,configurable:!0})}function s(R,I){return Object.keys(I).forEach(function(N){N==="default"||N==="__esModule"||R.hasOwnProperty(N)||Object.defineProperty(R,N,{enumerable:!0,get:function(){return I[N]}})}),R}a(n.exports,"Sortable",()=>$882b6d93070905b3$re_export$Sortable),a(n.exports,"Direction",()=>$882b6d93070905b3$re_export$Direction),a(n.exports,"DOMRect",()=>$882b6d93070905b3$re_export$DOMRect),a(n.exports,"GroupOptions",()=>$882b6d93070905b3$re_export$GroupOptions),a(n.exports,"MoveEvent",()=>$882b6d93070905b3$re_export$MoveEvent),a(n.exports,"Options",()=>$882b6d93070905b3$re_export$Options),a(n.exports,"PullResult",()=>$882b6d93070905b3$re_export$PullResult),a(n.exports,"PutResult",()=>$882b6d93070905b3$re_export$PutResult),a(n.exports,"SortableEvent",()=>$882b6d93070905b3$re_export$SortableEvent),a(n.exports,"SortableOptions",()=>$882b6d93070905b3$re_export$SortableOptions),a(n.exports,"Utils",()=>$882b6d93070905b3$re_export$Utils),a(n.exports,"ReactSortable",()=>_);function l(R){R.parentElement!==null&&R.parentElement.removeChild(R)}function u(R,I,N){const L=R.children[N]||null;R.insertBefore(I,L)}function c(R){R.forEach(I=>l(I.element))}function h(R){R.forEach(I=>{u(I.parentElement,I.element,I.oldIndex)})}function p(R,I){const N=g(R),L={parentElement:R.from};let B=[];switch(N){case"normal":B=[{element:R.item,newIndex:R.newIndex,oldIndex:R.oldIndex,parentElement:R.from}];break;case"swap":const T={element:R.item,oldIndex:R.oldIndex,newIndex:R.newIndex,...L},D={element:R.swapItem,oldIndex:R.newIndex,newIndex:R.oldIndex,...L};B=[T,D];break;case"multidrag":B=R.oldIndicies.map((M,k)=>({element:M.multiDragElement,oldIndex:M.index,newIndex:R.newIndicies[k].index,...L}));break}return v(B,I)}function b(R,I){const N=x(R,I);return E(R,N)}function x(R,I){const N=[...I];return R.concat().reverse().forEach(L=>N.splice(L.oldIndex,1)),N}function E(R,I,N,L){const B=[...I];return R.forEach(w=>{const P=L&&N&&L(w.item,N);B.splice(w.newIndex,0,P||w.item)}),B}function g(R){return R.oldIndicies&&R.oldIndicies.length>0?"multidrag":R.swapItem?"swap":"normal"}function v(R,I){return R.map(L=>({...L,item:I[L.oldIndex]})).sort((L,B)=>L.oldIndex-B.oldIndex)}function C(R){const{list:I,setList:N,children:L,tag:B,style:w,className:P,clone:T,onAdd:D,onChange:M,onChoose:k,onClone:V,onEnd:W,onFilter:Y,onRemove:q,onSort:J,onStart:X,onUnchoose:Q,onUpdate:K,onMove:z,onSpill:re,onSelect:de,onDeselect:oe,...be}=R;return be}const A={dragging:null};class _ extends r.Component{static defaultProps={clone:I=>I};constructor(I){super(I),this.ref=(0,r.createRef)();const N=[...I.list].map(L=>Object.assign(L,{chosen:!1,selected:!1}));I.setList(N,this.sortable,A),o(i)(!I.plugins,`
|
|
41
41
|
Plugins prop is no longer supported.
|
|
42
42
|
Instead, mount it with "Sortable.mount(new MultiDrag())"
|
|
43
43
|
Please read the updated README.md at https://github.com/SortableJS/react-sortablejs.
|
|
44
|
-
`)}componentDidMount(){if(this.ref.current===null)return;const
|
|
44
|
+
`)}componentDidMount(){if(this.ref.current===null)return;const I=this.makeOptions();o(e).create(this.ref.current,I)}componentDidUpdate(I){I.disabled!==this.props.disabled&&this.sortable&&this.sortable.option("disabled",this.props.disabled)}render(){const{tag:I,style:N,className:L,id:B}=this.props,w={style:N,className:L,id:B},P=!I||I===null?"div":I;return(0,r.createElement)(P,{ref:this.ref,...w},this.getChildren())}getChildren(){const{children:I,dataIdAttr:N,selectedClass:L="sortable-selected",chosenClass:B="sortable-chosen",dragClass:w="sortable-drag",fallbackClass:P="sortable-falback",ghostClass:T="sortable-ghost",swapClass:D="sortable-swap-highlight",filter:M="sortable-filter",list:k}=this.props;if(!I||I==null)return null;const V=N||"data-id";return r.Children.map(I,(W,Y)=>{if(W===void 0)return;const q=k[Y]||{},{className:J}=W.props,X=typeof M=="string"&&{[M.replace(".","")]:!!q.filtered},Q=o(t)(J,{[L]:q.selected,[B]:q.chosen,...X});return(0,r.cloneElement)(W,{[V]:W.key,className:Q})})}get sortable(){const I=this.ref.current;if(I===null)return null;const N=Object.keys(I).find(L=>L.includes("Sortable"));return N?I[N]:null}makeOptions(){const I=["onAdd","onChoose","onDeselect","onEnd","onRemove","onSelect","onSpill","onStart","onUnchoose","onUpdate"],N=["onChange","onClone","onFilter","onSort"],L=C(this.props);return I.forEach(w=>L[w]=this.prepareOnHandlerPropAndDOM(w)),N.forEach(w=>L[w]=this.prepareOnHandlerProp(w)),{...L,onMove:(w,P)=>{const{onMove:T}=this.props,D=w.willInsertAfter||-1;if(!T)return D;const M=T(w,P,this.sortable,A);return typeof M>"u"?!1:M}}}prepareOnHandlerPropAndDOM(I){return N=>{this.callOnHandlerProp(N,I),this[I](N)}}prepareOnHandlerProp(I){return N=>{this.callOnHandlerProp(N,I)}}callOnHandlerProp(I,N){const L=this.props[N];L&&L(I,this.sortable,A)}onAdd(I){const{list:N,setList:L,clone:B}=this.props,w=[...A.dragging.props.list],P=p(I,w);c(P);const T=E(P,N,I,B).map(D=>Object.assign(D,{selected:!1}));L(T,this.sortable,A)}onRemove(I){const{list:N,setList:L}=this.props,B=g(I),w=p(I,N);h(w);let P=[...N];if(I.pullMode!=="clone")P=x(w,P);else{let T=w;switch(B){case"multidrag":T=w.map((D,M)=>({...D,element:I.clones[M]}));break;case"normal":T=w.map(D=>({...D,element:I.clone}));break;default:o(i)(!0,`mode "${B}" cannot clone. Please remove "props.clone" from <ReactSortable/> when using the "${B}" plugin`)}c(T),w.forEach(D=>{const M=D.oldIndex,k=this.props.clone(D.item,I);P.splice(M,1,k)})}P=P.map(T=>Object.assign(T,{selected:!1})),L(P,this.sortable,A)}onUpdate(I){const{list:N,setList:L}=this.props,B=p(I,N);c(B),h(B);const w=b(B,N);return L(w,this.sortable,A)}onStart(){A.dragging=this}onEnd(){A.dragging=null}onChoose(I){const{list:N,setList:L}=this.props,B=N.map((w,P)=>{let T=w;return P===I.oldIndex&&(T=Object.assign(w,{chosen:!0})),T});L(B,this.sortable,A)}onUnchoose(I){const{list:N,setList:L}=this.props,B=N.map((w,P)=>{let T=w;return P===I.oldIndex&&(T=Object.assign(T,{chosen:!1})),T});L(B,this.sortable,A)}onSpill(I){const{removeOnSpill:N,revertOnSpill:L}=this.props;N&&!L&&l(I.item)}onSelect(I){const{list:N,setList:L}=this.props,B=N.map(w=>Object.assign(w,{selected:!1}));I.newIndicies.forEach(w=>{const P=w.index;if(P===-1){console.log(`"${I.type}" had indice of "${w.index}", which is probably -1 and doesn't usually happen here.`),console.log(I);return}B[P].selected=!0}),L(B,this.sortable,A)}onDeselect(I){const{list:N,setList:L}=this.props,B=N.map(w=>Object.assign(w,{selected:!1}));I.newIndicies.forEach(w=>{const P=w.index;P!==-1&&(B[P].selected=!0)}),L(B,this.sortable,A)}}var O={};s(n.exports,O)})(ed)),ed.exports}var zx=SI();const RI=tt.createSvgIcon(f.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields"),OI=tt.createSvgIcon(f.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"),jI=tt.createSvgIcon(f.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");function NI(n){return f.jsx(z1,{...n,children:f.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("path",{clipRule:"evenodd",d:"M12 2C8.14 2 5 5.14 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.86-3.14-7-7-7zm0 4a3 3 0 1 1 0 6 3 3 0 0 1 0-6z",fill:"currentColor",fillRule:"evenodd"}),f.jsx("circle",{cx:"12",cy:"9",fill:"currentColor",r:"1.15"})]})})}function Xx(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]])}return t}function Io(n,e,t,r){return new(t||(t=Promise))(function(i,o){function a(u){try{l(r.next(u))}catch(c){o(c)}}function s(u){try{l(r.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(h){h(c)})).then(a,s)}l((r=r.apply(n,[])).next())})}const Ux=n=>n.split(/(\.|\[\d+\])/).filter(e=>e!=="."&&e!=="").map(e=>{const t=/\[(\d+)\]/.exec(e);return t?Number(t[1]):e}),oa=(n,e,t)=>{const r=Array.isArray(e)?e:Ux(e);if(r.length===0)return n;const i=r[0];if(Array.isArray(n)&&typeof i!="number"&&n.length>0)return n.map(a=>oa(a,r));if(typeof n!="object"||n===null||!(i in n))return DI(n,i);const o=n[i];return r.length===1?o:oa(o,r.slice(1))},DI=(n,e,t)=>{throw new Error(`Unable to extract object property
|
|
45
45
|
Looking for property: ${e}
|
|
46
|
-
In object: ${JSON.stringify(n)}`)},
|
|
47
|
-
Couldn't access "${t}" in ${JSON.stringify(n)}`)},
|
|
48
|
-
`?t+".":t;return
|
|
49
|
-
`);r(u)}},a))},styles:n})},kT=n=>{var{isEditing:e,path:t,enumType:r}=n,i=yx(n,["isEditing","path","enumType"]);const{getStyles:o}=zr(),a=Qi(t),{value:s,setValue:l,nodeData:u,handleEdit:c,handleKeyboard:h,keyboardCommon:f}=i;return e&&r?p.jsxs("div",{className:"jer-select jer-select-enums",children:[p.jsx("select",{name:`${a}-value-select`,className:"jer-select-inner",onChange:b=>l(b.target.value),value:s,autoFocus:!0,onKeyDown:b=>{h(b,Object.assign({stringConfirm:c},f))},children:r.values.map(b=>p.jsx("option",{value:b,children:b},b))}),p.jsx("span",{className:"focus"})]}):e?p.jsx(MT,Object.assign({styles:o("input",u),pathString:a},i,{setValue:i.setValue})):p.jsx(DT,Object.assign({pathString:a,styles:o("string",u)},i))},LT=({value:n,setValue:e,isEditing:t,path:r,setIsEditing:i,handleEdit:o,nodeData:a,handleKeyboard:s,keyboardCommon:l})=>{const{getStyles:u}=zr();return t?p.jsx("input",{className:"jer-input-number",type:"text",name:Qi(r),value:n,onChange:c=>e(c.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:c=>setTimeout(()=>c.target.select(),10),onKeyDown:c=>s(c,Object.assign({numberConfirm:o,numberUp:()=>e(Number(n)+1),numberDown:()=>e(Number(n)-1)},l)),style:Object.assign({width:String(n).length/1.5+2+"em"},u("input",a))}):p.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-number",style:u("number",a),children:n})},PT=({value:n,setValue:e,isEditing:t,path:r,setIsEditing:i,handleEdit:o,nodeData:a,handleKeyboard:s,keyboardCommon:l})=>{const{getStyles:u}=zr();return typeof n!="boolean"?null:t?p.jsx("input",{className:"jer-input-boolean",type:"checkbox",name:Qi(r),checked:n,onChange:()=>e(!n),onKeyDown:c=>{c.key===" "&&c.preventDefault(),s(c,Object.assign({booleanConfirm:o,booleanToggle:()=>e(!n)},l))},autoFocus:!0}):p.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-boolean",style:u("boolean",a),children:String(n)})},BT=(n,e)=>{const t=m.useRef(void 0),r=m.useRef(e);m.useEffect(()=>{r.current=e},[e]);const i=o=>{r.current(o)};m.useEffect(()=>{if(window.clearTimeout(t.current),n)return t.current=window.setTimeout(()=>{window.addEventListener("keydown",i)},100),()=>{window.clearTimeout(t.current),window.removeEventListener("keydown",i)}},[n])},FT=({value:n,isEditing:e,setIsEditing:t,handleEdit:r,nodeData:i,handleKeyboard:o,keyboardCommon:a})=>{const{getStyles:s}=zr();return BT(e,l=>o(l,Object.assign({confirm:r},a))),p.jsx("div",{onDoubleClick:()=>t(!0),className:"jer-value-null",style:s("null",i),children:String(n)})},GT=({value:n})=>{let e="Error!";switch(typeof n){case"string":n===vf&&(e="Function");break;case"undefined":e="Undefined";break;case"symbol":e="Symbol"}return p.jsx("span",{className:"jer-value-invalid",children:e})},qT=({size:n,style:e,className:t})=>p.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:t,style:e,children:[p.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),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"})]}),HT=({size:n,style:e,className:t})=>p.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:t,style:e,transform:"translate(0, 0.5)",children:[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"}),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"})]}),VT=({size:n,style:e,className:t})=>p.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:t,style:e,children: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"})}),WT=({size:n,style:e,className:t})=>p.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:n,height:n,className:t,style:e,children:[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"}),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"}),p.jsx("path",{d:"M15 10l-4 4 4 4"})]}),zT=({size:n,style:e,className:t})=>p.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:n,height:n,className:t,style:e,children:[p.jsx("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),p.jsx("path",{d:"M22 4L12 14.01l-3-3"})]}),XT=({size:n,style:e,className:t})=>p.jsx("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:t,style:e,children: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"})}),UT=({size:n,style:e,className:t})=>p.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:n,height:n,className:t,style:e,children: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"})}),Wi=({name:n,nodeData:e})=>{var t,r,i,o,a,s,l;const{getStyles:u,icons:c}=zr(),h={size:"1.4em",className:"jer-icon"};switch(n){case"add":return(t=c?.add)!==null&&t!==void 0?t:p.jsx(qT,Object.assign({},h,{style:u("iconAdd",e)}));case"edit":return(r=c?.edit)!==null&&r!==void 0?r:p.jsx(HT,Object.assign({},h,{style:u("iconEdit",e)}));case"delete":return(i=c?.delete)!==null&&i!==void 0?i:p.jsx(VT,Object.assign({},h,{style:u("iconDelete",e),size:"1.45em"}));case"copy":return(o=c?.copy)!==null&&o!==void 0?o:p.jsx(WT,Object.assign({},h,{style:u("iconCopy",e),size:"1.2em"}));case"ok":return(a=c?.ok)!==null&&a!==void 0?a:p.jsx(zT,Object.assign({},h,{style:Object.assign({fontSize:"90%"},u("iconOk",e))}));case"cancel":return(s=c?.cancel)!==null&&s!==void 0?s:p.jsx(XT,Object.assign({},h,{style:Object.assign({fontSize:"130%"},u("iconCancel",e))}));case"chevron":return(l=c?.chevron)!==null&&l!==void 0?l:p.jsx(UT,{size:"1em",style:u("iconCollection",e)});default:return p.jsx(p.Fragment,{})}},Rx=({startEdit:n,handleDelete:e,handleAdd:t,enableClipboard:r,type:i,customButtons:o,nodeData:a,translate:s,keyboardControls:l,handleKeyboard:u,editConfirmRef:c,getNewKeyOptions:h,jsonStringify:f,onEditEvent:b,showIconTooltips:x})=>{const{getStyles:w}=zr(),g=s("KEY_NEW",a),[y,C]=m.useState(g),[A,_]=m.useState(!1),{key:N,path:O,value:T}=a,D=Array.isArray(A),M=L=>{var E;if(b&&b(L?[...O,null]:null,L),!L)return void _(!1);const S=Object.keys(ra(a.fullData,O)),I=h?(E=h(a))===null||E===void 0?void 0:E.filter(P=>!S.includes(P)):null;I&&C(""),_(I==null||I)};return p.jsxs("div",{className:"jer-edit-buttons",style:{opacity:A?1:void 0},onClick:L=>L.stopPropagation(),children:[r&&p.jsx("div",{onClick:L=>{var E;L.stopPropagation();let S,I,P="value",B="",F=null;if(r){const G=sp(L);if(G&&l.clipboardModifier.includes(G)?(S=$T(O),B=S,P="path"):(S=T,B=typeof S=="object"?f(T):String(S)),!navigator.clipboard)return void(typeof r=="function"&&r({success:!1,value:S,stringValue:B,path:O,key:N,type:P,errorMessage:"Can't access clipboard API"}));(E=navigator.clipboard)===null||E===void 0||E.writeText(B).then(()=>I=!0).catch(V=>{I=!1,F=V.message}).finally(()=>{typeof r=="function"&&r({success:I,errorMessage:F,value:S,stringValue:B,path:O,key:N,type:P})})}},className:"jer-copy-pulse",title:x?s("TOOLTIP_COPY",a):"",children:p.jsx(Wi,{name:"copy",nodeData:a})}),n&&p.jsx("div",{onClick:n,title:x?s("TOOLTIP_EDIT",a):"",children:p.jsx(Wi,{name:"edit",nodeData:a})}),e&&p.jsx("div",{onClick:e,title:x?s("TOOLTIP_DELETE",a):"",children:p.jsx(Wi,{name:"delete",nodeData:a})}),t&&p.jsx("div",{onClick:()=>{i==="object"?M(!0):t("")},title:x?s("TOOLTIP_ADD",a):"",children:p.jsx(Wi,{name:"add",nodeData:a})}),o?.map(({Element:L,onClick:E},S)=>p.jsx("div",{onClick:I=>E&&E(a,I),children:p.jsx(L,{nodeData:a})},S)),A&&t&&i==="object"&&p.jsxs(p.Fragment,{children:[D?p.jsxs("div",{className:"jer-select jer-select-keys",children:[p.jsxs("select",{name:"new-key-select",className:"jer-select-inner",onChange:L=>{t(L.target.value),M(!1)},defaultValue:"",autoFocus:!0,onKeyDown:L=>{u(L,{cancel:()=>M(!1)})},children:[p.jsx("option",{value:"",disabled:!0,children:A.length>0?s("KEY_SELECT",a):s("NO_KEY_OPTIONS",a)}),A.map(L=>p.jsx("option",{value:L,children:L},L))]}),p.jsx("span",{className:"focus"})]}):p.jsx("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:y,onChange:L=>C(L.target.value),autoFocus:!0,onFocus:L=>L.target.select(),onKeyDown:L=>{u(L,{stringConfirm:()=>{t&&(M(!1),t(y),C(g))},cancel:()=>{M(!1),C(g)}})},style:w("input",a)}),p.jsx(up,{onOk:()=>{D&&!y||(M(!1),t(y))},onCancel:()=>{M(!1)},nodeData:a,editConfirmRef:c,hideOk:D})]})]})},up=({onOk:n,onCancel:e,nodeData:t,editConfirmRef:r,hideOk:i=!1})=>p.jsxs("div",{className:"jer-confirm-buttons",children:[!i&&p.jsx("div",{onClick:n,ref:r,children:p.jsx(Wi,{name:"ok",nodeData:t})}),p.jsx("div",{onClick:e,children:p.jsx(Wi,{name:"cancel",nodeData:t})})]}),$T=n=>n.reduce((e,t)=>typeof t=="number"?`${e}[${t}]`:e===""?t:`${e}.${t}`,""),YT=["string","number","boolean","null","object","array"],Ox=({props:n,collapsed:e})=>{const{data:t,nodeData:r,parentData:i,onEdit:o,onError:a,showErrorMessages:s,restrictEditFilter:l,restrictDeleteFilter:u,restrictAddFilter:c,restrictDragFilter:h,translate:f,errorMessageTimeout:b}=n,{currentlyEditingElement:x,setCurrentlyEditingElement:w}=Xi(),[g,y]=m.useState(null),C=Object.assign(Object.assign({},r),{collapsed:e}),{path:A,key:_,size:N}=C,O=Qi(A),T=!l(C),D=!u(C),M=!c(C),L=!h(C)&&D&&x===null,E=V=>{s&&(y(V),setTimeout(()=>y(null),b)),console.warn("Error",V)},S=m.useCallback((V,z)=>{E(V.message),a&&a({currentData:C.fullData,errorValue:z,currentValue:t,name:_,path:A,error:V})},[a,s]),I=x===O,P=x===`key_${O}`,B=typeof A.slice(-1)[0]=="number",F={isEditing:I,isEditingKey:P,isArray:B,canEditKey:i!==null&&T&&M&&D&&!B},G=_===""&&A.length>0?f("EMPTY_STRING",C):null;return{pathString:O,nodeData:C,path:A,name:_,size:N,canEdit:T,canDelete:D,canAdd:M,canDrag:L,error:g,showError:E,onError:S,setError:y,handleEditKey:V=>{if(w(null),_===V||!i)return;const z=A.slice(0,-1);if(Object.keys(i).includes(V))return void S({code:"KEY_EXISTS",message:f("ERROR_KEY_EXISTS",C)},V);const W=Object.fromEntries(Object.entries(i).map(([J,Y])=>J===_?[V,Y]:[J,Y]));o(W,z).then(J=>{J&&S({code:"UPDATE_ERROR",message:J},V)})},derivedValues:F,emptyStringKey:G}},Nx=({canDrag:n,canDragOnto:e,path:t,nodeData:r,onMove:i,onError:o,translate:a})=>{const{getStyles:s}=zr(),{dragSource:l,setDragSource:u}=Xi(),[c,h]=m.useState(!1),f=Qi(t),b=m.useMemo(()=>n?{onDragStart:y=>{y.stopPropagation(),u({path:t,pathString:f})},onDragEnd:y=>{y.stopPropagation(),u({path:null,pathString:null})}}:{},[n,f]),x=m.useMemo(()=>y=>e?{onDragOver:C=>{C.stopPropagation(),C.preventDefault()},onDrop:C=>{C.stopPropagation(),g(y),u({path:null,pathString:null}),h(!1)},onDragEnter:C=>{var A;C.stopPropagation(),f.startsWith((A=l.pathString)!==null&&A!==void 0?A:"")||h(y)},onDragExit:C=>{C.stopPropagation(),h(!1)}}:{},[l,e,f]),w=m.useMemo(()=>e&&l.pathString!==null?p.jsx("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:t.length}},x("below"))):null,[l,e,t.length]),g=y=>{var C,A;const _=(C=l.path)===null||C===void 0?void 0:C.slice(-1)[0],N=(A=l.path)===null||A===void 0?void 0:A.slice(0,-1).join("."),O=t.slice(0,-1).join(""),{parentData:T}=r;typeof _=="string"&&T&&!Array.isArray(T)&&Object.keys(T).includes(_)&&_ in T&&N!==O?o({code:"KEY_EXISTS",message:a("ERROR_KEY_EXISTS",r)},_):i(l.path,t,y).then(D=>{D&&o({code:"UPDATE_ERROR",message:D},r.value)})};return{dragSourceProps:b,getDropTargetProps:x,BottomDropTarget:w,DropTargetPadding:({position:y,nodeData:C})=>c===y?p.jsx("div",{className:"jer-drag-n-drop-padding",style:s("dropZone",C)}):null,handleDrop:g}},ZT=(n,e,t,r)=>{var i,o,a;if(!e.current)return 0;const s=parseInt((i=getComputedStyle(t.current).getPropertyValue("line-height"))!==null&&i!==void 0?i:"16px"),l=((a=(o=e.current)===null||o===void 0?void 0:o.offsetWidth)!==null&&a!==void 0?a:0)/(.5*s),u=r(n).replace(/\\n/g,`
|
|
46
|
+
In object: ${JSON.stringify(n)}`)},Wi=(n,e,t,r,i)=>{if(!r)throw new Error(i??`Invalid property path: ${e}
|
|
47
|
+
Couldn't access "${t}" in ${JSON.stringify(n)}`)},Jb=n=>typeof n=="object"&&n!==null&&!Array.isArray(n),al=n=>Array.isArray(n),$x=(n,e)=>n.filter((t,r)=>r!==e),MI=(n,e,t,r={})=>{const{remove:i=!1,createNew:o=!0,noError:a=!1}=r,s=n,l=typeof(u=e)=="string"?u:typeof u=="number"?String(u):u.reduce((p,b)=>typeof b=="number"?`${p}[${b}]`:p===""?b:`${p}.${b}`,"");var u;const c=Object.assign(Object.assign({},r),{remove:i,createNew:o,noError:a,fullData:s,fullPath:l}),h=Array.isArray(e)?e:Ux(e);return al(n)&&i&&h.length===1?$x(n,h[0]):Ga(n,h,t,c)},Ga=(n,e,t,r)=>{const i=Jb(n)?Object.assign({},n):null,o=al(n)?[...n]:null;if(e.length===0)return n;if(!i&&!o)throw new Error("Can't assign property -- invalid input object");const{createNew:a,remove:s,noError:l,fullData:u,fullPath:c}=r,h=e[0];if(o&&typeof h=="string")return o.map(E=>Ga(E,e,t,r));if(e.length===1){if(i&&typeof h=="string"){const E=kI(i,h,t,r);return E??i}return o&&typeof h=="number"?(PI(o,h,t,r),o):(Wi(u,c,h,l),n)}const p=i||o||[];if(s&&e.length===2&&typeof e[1]=="number"){const E=p[h],g=e[1];return al(E)?p[h]=$x(E,g):Wi(u,c,h,l,"Trying to remove an indexed item from an object that is not an array"),p}const b=e.slice(1);if(h in n){if(x=p[h],!al(x)&&!Jb(x)){if(!a)return Wi(u,c,h,l),p;p[h]={}}return p[h]=Ga(p[h],b,t,r),p}var x;if(a){const E=typeof b[0]=="number"?[]:{};if(i)return p[h]=E,p[h]=Ga(p[h],b,t,r),p;if(o&&Array.isArray(p)){p.push(E);const g=p.length-1;return p[g]=Ga(p[g],b,t,r),p}}return Wi(u,c,h,l),p},kI=(n,e,t,r)=>{const{remove:i,createNew:o,noError:a,insertAfter:s,insertBefore:l,fullData:u,fullPath:c}=r;if(l!==void 0||s!==void 0){const p=Object.entries(n);let b=1/0;return b=typeof l=="number"?l:typeof s=="number"?s:p.findIndex(([x])=>x===(l??s)),s!==void 0&&b++,p.splice(b,0,[e,t]),Object.fromEntries(p)}const h=e in n;i?h?delete n[e]:Wi(u,c,e,a):o||h?n[e]=t:Wi(u,c,e,a)},PI=(n,e,t,r)=>{const{noError:i,fullData:o,fullPath:a,createNew:s,insert:l}=r;l&&n.splice(e,0,t),e in n?n[e]=t:s?n.push(t):Wi(o,a,e,i)},Yx=({className:n,name:e,value:t,setValue:r,handleKeyPress:i,styles:o,textAreaRef:a})=>{if(typeof t!="string")return null;const s=t.slice(-1)===`
|
|
48
|
+
`?t+".":t;return f.jsxs("div",{style:{display:"grid"},children:[f.jsx("textarea",{id:`${e}_textarea`,ref:a,style:Object.assign({height:"auto",gridArea:"1 / 1 / 2 / 2",overflowY:"auto",whiteSpace:"pre-wrap"},o),rows:1,className:n,name:`${e}_textarea`,value:t,onChange:l=>r(l.target.value),autoFocus:!0,onFocus:l=>{t.length<40&&l.target.select()},onKeyDown:i}),f.jsx("span",{className:n,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"},o),children:s})]})},aa=n=>n!==null&&typeof n=="object",Zx=(n,e,t,r="")=>{if(!t&&!r)return!0;switch(n){case"collection":if(t){if(t(e,r))return!0;if(!Cf(r,e,t))return!1}if(!t&&r&&!Cf(r,e))return!1;break;case"value":if(t&&!t(e,r)||!t&&r&&!sa(e,r))return!1}return!0},Cf=(n="",e,t=sa)=>{const r=e.value;return Object.entries(r).some(([i,o])=>{const a=[...e.path,i],s=Object.assign(Object.assign({},e),{key:i,path:a,level:e.level+1,value:o,size:a.length,parentData:r});return aa(o)?Cf(n,s,t):t(s,n)})},sa=(n,e="")=>{const{value:t}=n;if(t===null&&"null".includes(e.toLowerCase()))return!0;switch(typeof t){case"string":return t.toLowerCase().includes(e.toLowerCase());case"number":return!!String(t).includes(e);case"boolean":return t?"true".includes(e.toLowerCase())||e==="1":"false".includes(e.toLowerCase())||e==="0";default:return!1}},Kb=({key:n,path:e},t="")=>!!sa({value:n},t)||!!e.some(r=>sa({value:r},t)),ro=(n,e)=>(e??"")+n.map(t=>t===""?"\0":t).join("."),Ap=n=>n.shiftKey?"Shift":n.metaKey?"Meta":n.ctrlKey?"Control":n.altKey?"Alt":void 0,LI=(n,e,t)=>{const r=n.key,i=Ap(n);if(Array.isArray(e))return!!i&&e.includes(i);const{key:o,modifier:a}=e;return(t!=="stringLineBreak"||r!=="Enter"||i!=="Shift"||o!=="Enter"||!a?.includes("Shift"))&&r===o&&(a===i||Array.isArray(a)&&a.includes(i))},Fi={key:"Enter"},Qb={confirm:Fi,cancel:{key:"Escape"},objectConfirm:Object.assign(Object.assign({},Fi),{modifier:["Meta","Shift","Control"]}),objectLineBreak:Fi,stringConfirm:Fi,stringLineBreak:Object.assign(Object.assign({},Fi),{modifier:["Shift"]}),numberConfirm:Fi,numberUp:{key:"ArrowUp"},numberDown:{key:"ArrowDown"},tabForward:{key:"Tab"},tabBack:{key:"Tab",modifier:"Shift"},booleanConfirm:Fi,booleanToggle:{key:" "},clipboardModifier:["Meta","Control"],collapseModifier:["Alt"]},zi=(n,e,t="next",r)=>{const i=e.slice(0,e.length-1),o=e.slice(-1)[0];if(o===void 0)return null;const a=oa(n,i),s=BI(a);Array.isArray(a)||r(s,({key:c,value:h})=>[c,h]);const l=s.findIndex(c=>c.key===o),u=s[l+(t==="next"?1:-1)];return u?aa(u.value)?Object.keys(u.value).length===0?zi(n,[...i,u.key],t,r):Jx(n,[...i,u.key],t,r):[...i,u.key]:i.length===0?null:zi(n,i,t,r)},Jx=(n,e,t="next",r)=>{const i=oa(n,e);if(!aa(i))return e;const o=Array.isArray(i)?i.map((s,l)=>l):Object.keys(i);r(o,s=>[s,i]);const a=t==="next"?o[0]:o[o.length-1];return Jx(n,[...e,a],t,r)},BI=n=>Array.isArray(n)?n.map((e,t)=>({index:t,value:e,key:t})):Object.entries(n).map(([e,t],r)=>({key:e,value:t,index:r})),Kx=(n,e)=>{var t,r,i,o;const a=n.current,s=(t=a?.selectionStart)!==null&&t!==void 0?t:1/0,l=(r=a?.selectionEnd)!==null&&r!==void 0?r:1/0,u=((i=a?.textContent)===null||i===void 0?void 0:i.slice(0,s))+e+((o=a?.textContent)===null||o===void 0?void 0:o.slice(l));return a.value=u,a?.setSelectionRange(s+1,s+1),u},Ef=n=>{if(n!==Qx){if(Array.isArray(n))return n.map(e=>Ef(e));if(n&&typeof n=="object")for(const e in n)n[e]=Ef(n[e]);return n}},Qx="__undefined__",Tp={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)"}},eC=m.createContext({getStyles:()=>({}),icons:{}}),FI=({theme:n=Tp,icons:e={},docRoot:t,children:r})=>{const i=GI(n,t);return f.jsx(eC.Provider,{value:{getStyles:(o,a)=>typeof i[o]=="function"?i[o](a):i[o],icons:e},children:r})},Xr=()=>m.useContext(eC),GI=(n,e)=>{var t,r,i,o;const a={},s=(Array.isArray(n)?n:[n]).map(c=>qI(c)?fd({fragments:{},styles:c},a):fd(c,a)),l=fd(Tp,{});Object.keys(l).forEach(c=>{const h=c;s.forEach(p=>{p[h]&&(l[h]=Object.assign(Object.assign({},l[h]),p[h]))})});const u=Object.assign({},l);return Object.entries(a).forEach(([c,h])=>{const p=c;u[p]=b=>{const x=h(b)||{};return Object.assign(Object.assign({},l[p]),x)}}),typeof u?.inputHighlight!="function"&&(!((t=u?.inputHighlight)===null||t===void 0)&&t.backgroundColor)&&e.style.setProperty("--jer-highlight-color",(r=u?.inputHighlight)===null||r===void 0?void 0:r.backgroundColor),typeof u?.iconCopy!="function"&&(!((i=u?.iconCopy)===null||i===void 0)&&i.color)&&e.style.setProperty("--jer-icon-copy-color",(o=u?.iconCopy)===null||o===void 0?void 0:o.color),u},fd=(n,e)=>{const{fragments:t,styles:r}=n,i={};return Object.entries(r).forEach(([o,a])=>{const s=(Array.isArray(a)?a:[a]).reduce((l,u)=>{var c,h;if(typeof u=="function")return e[o]=u,Object.assign({},l);if(typeof u=="string"){const p=(c=t?.[u])!==null&&c!==void 0?c:u;return typeof p=="string"?Object.assign(Object.assign({},l),{[(h=HI[o])!==null&&h!==void 0?h:"color"]:p}):Object.assign(Object.assign({},l),p)}return Object.assign(Object.assign({},l),u)},{});i[o]=s}),i},qI=n=>!("styles"in n),HI={container:"backgroundColor",collection:"backgroundColor",collectionInner:"backgroundColor",collectionElement:"backgroundColor",dropZone:"borderColor",inputHighlight:"backgroundColor"},tC=m.createContext(null),VI=({children:n,onEditEvent:e,onCollapse:t})=>{const[r,i]=m.useState(null),[o,a]=m.useState(null),[s,l]=m.useState(null),[u,c]=m.useState({path:null,pathString:null}),h=m.useRef(null),p=m.useRef("next"),b=m.useRef(null);return f.jsx(tC.Provider,{value:{collapseState:r,setCollapseState:x=>{i(x),t&&x!==null&&(Array.isArray(x)?x.forEach(E=>t(E)):t(x)),x!==null&&setTimeout(()=>i(null),2e3)},getMatchingCollapseState:x=>{if(Array.isArray(r)){for(const E of r)if(ev(x,E))return E;return null}return ev(x,r)?r:null},currentlyEditingElement:o,setCurrentlyEditingElement:(x,E)=>{const g=typeof x=="string"||x===null?x:ro(x,E==="key"?"key_":void 0);o!==null&&g!==null&&h.current!==null&&h.current(),a(g),e&&(Array.isArray(x)||x===null)&&e(x,E==="key"),h.current=typeof E=="function"?E:null},areChildrenBeingEdited:x=>o!==null&&o.includes(x),previouslyEditedElement:b.current,setPreviouslyEditedElement:x=>{b.current=x},tabDirection:p.current,setTabDirection:x=>{p.current=x},previousValue:s,setPreviousValue:l,dragSource:u,setDragSource:c},children:n})},$i=()=>{const n=m.useContext(tC);if(!n)throw new Error("Missing Context Provider");return n},ev=(n,e)=>{if(e===null)return!1;if(!e.includeChildren)return e.path.every((t,r)=>n[r]===t)&&e.path.length===n.length;for(const[t,r]of e.path.entries())if(r!==n[t])return!1;return!0},wf="**INVALID_FUNCTION**",WI=({nodeData:n,showStringQuotes:e=!0,stringTruncate:t=200,pathString:r,canEdit:i,setIsEditing:o,styles:a,translate:s,value:l,TextWrapper:u=({children:c})=>c})=>{const c=l??n.value,[h,p]=m.useState(!1),b=e?'"':"",x=c.length>t,E=()=>{i?o(!0):p(!h)};return f.jsxs("div",{id:`${r}_display`,onDoubleClick:E,onClick:g=>{(g.getModifierState("Control")||g.getModifierState("Meta"))&&E()},className:"jer-value-string",style:a,children:[b,x?f.jsxs(f.Fragment,h?{children:[f.jsx(u,{children:f.jsxs("span",{children:[c,b]})}),f.jsxs("span",{className:"jer-string-expansion jer-show-less",onClick:()=>p(!1),children:[" ",s("SHOW_LESS",n)]})]}:{children:[f.jsxs(u,{children:[f.jsx("span",{children:c.slice(0,t-2).trimEnd()})," "]}),f.jsx("span",{className:"jer-string-expansion jer-ellipsis",onClick:()=>p(!0),children:"..."}),b]}):f.jsx(u,{children:`${c}${b}`})]})},zI=({styles:n,pathString:e,value:t,setValue:r,handleEdit:i,handleKeyboard:o,keyboardCommon:a})=>{const s=m.useRef(null);return f.jsx(Yx,{className:"jer-input-text",textAreaRef:s,name:e,value:t,setValue:r,handleKeyPress:l=>{o(l,Object.assign({stringConfirm:i,stringLineBreak:()=>{const u=Kx(s,`
|
|
49
|
+
`);r(u)}},a))},styles:n})},XI=n=>{var{isEditing:e,path:t,enumType:r}=n,i=Xx(n,["isEditing","path","enumType"]);const{getStyles:o}=Xr(),a=ro(t),{value:s,setValue:l,nodeData:u,handleEdit:c,handleKeyboard:h,keyboardCommon:p}=i;return e&&r?f.jsxs("div",{className:"jer-select jer-select-enums",children:[f.jsx("select",{name:`${a}-value-select`,className:"jer-select-inner",onChange:b=>l(b.target.value),value:s,autoFocus:!0,onKeyDown:b=>{h(b,Object.assign({stringConfirm:c},p))},children:r.values.map(b=>f.jsx("option",{value:b,children:b},b))}),f.jsx("span",{className:"focus"})]}):e?f.jsx(zI,Object.assign({styles:o("input",u),pathString:a},i,{setValue:i.setValue})):f.jsx(WI,Object.assign({pathString:a,styles:o("string",u)},i))},UI=({value:n,setValue:e,isEditing:t,path:r,setIsEditing:i,handleEdit:o,nodeData:a,handleKeyboard:s,keyboardCommon:l})=>{const{getStyles:u}=Xr();return t?f.jsx("input",{className:"jer-input-number",type:"text",name:ro(r),value:n,onChange:c=>e(c.target.value.replace(/[^0-9.-]/g,"")),autoFocus:!0,onFocus:c=>setTimeout(()=>c.target.select(),10),onKeyDown:c=>s(c,Object.assign({numberConfirm:o,numberUp:()=>e(Number(n)+1),numberDown:()=>e(Number(n)-1)},l)),style:Object.assign({width:String(n).length/1.5+2+"em"},u("input",a))}):f.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-number",style:u("number",a),children:n})},$I=({value:n,setValue:e,isEditing:t,path:r,setIsEditing:i,handleEdit:o,nodeData:a,handleKeyboard:s,keyboardCommon:l})=>{const{getStyles:u}=Xr();return typeof n!="boolean"?null:t?f.jsx("input",{className:"jer-input-boolean",type:"checkbox",name:ro(r),checked:n,onChange:()=>e(!n),onKeyDown:c=>{c.key===" "&&c.preventDefault(),s(c,Object.assign({booleanConfirm:o,booleanToggle:()=>e(!n)},l))},autoFocus:!0}):f.jsx("span",{onDoubleClick:()=>i(!0),className:"jer-value-boolean",style:u("boolean",a),children:String(n)})},YI=(n,e)=>{const t=m.useRef(void 0),r=m.useRef(e);m.useEffect(()=>{r.current=e},[e]);const i=o=>{r.current(o)};m.useEffect(()=>{if(window.clearTimeout(t.current),n)return t.current=window.setTimeout(()=>{window.addEventListener("keydown",i)},100),()=>{window.clearTimeout(t.current),window.removeEventListener("keydown",i)}},[n])},ZI=({value:n,isEditing:e,setIsEditing:t,handleEdit:r,nodeData:i,handleKeyboard:o,keyboardCommon:a})=>{const{getStyles:s}=Xr();return YI(e,l=>o(l,Object.assign({confirm:r},a))),f.jsx("div",{onDoubleClick:()=>t(!0),className:"jer-value-null",style:s("null",i),children:String(n)})},JI=({value:n})=>{let e="Error!";switch(typeof n){case"string":n===wf&&(e="Function");break;case"undefined":e="Undefined";break;case"symbol":e="Symbol"}return f.jsx("span",{className:"jer-value-invalid",children:e})},KI=({size:n,style:e,className:t})=>f.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:t,style:e,children:[f.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}),f.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"})]}),QI=({size:n,style:e,className:t})=>f.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:t,style:e,transform:"translate(0, 0.5)",children:[f.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"}),f.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"})]}),eS=({size:n,style:e,className:t})=>f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:t,style:e,children:f.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"})}),tS=({size:n,style:e,className:t})=>f.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:n,height:n,className:t,style:e,children:[f.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"}),f.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"}),f.jsx("path",{d:"M15 10l-4 4 4 4"})]}),nS=({size:n,style:e,className:t})=>f.jsxs("svg",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:n,height:n,className:t,style:e,children:[f.jsx("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"}),f.jsx("path",{d:"M22 4L12 14.01l-3-3"})]}),rS=({size:n,style:e,className:t})=>f.jsx("svg",{baseProfile:"tiny",viewBox:"0 0 24 24",fill:"currentColor",width:n,height:n,className:t,style:e,children:f.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"})}),iS=({size:n,style:e,className:t})=>f.jsx("svg",{viewBox:"0 0 512 512",fill:"currentColor",width:n,height:n,className:t,style:e,children:f.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"})}),Xi=({name:n,nodeData:e})=>{var t,r,i,o,a,s,l;const{getStyles:u,icons:c}=Xr(),h={size:"1.4em",className:"jer-icon"};switch(n){case"add":return(t=c?.add)!==null&&t!==void 0?t:f.jsx(KI,Object.assign({},h,{style:u("iconAdd",e)}));case"edit":return(r=c?.edit)!==null&&r!==void 0?r:f.jsx(QI,Object.assign({},h,{style:u("iconEdit",e)}));case"delete":return(i=c?.delete)!==null&&i!==void 0?i:f.jsx(eS,Object.assign({},h,{style:u("iconDelete",e),size:"1.45em"}));case"copy":return(o=c?.copy)!==null&&o!==void 0?o:f.jsx(tS,Object.assign({},h,{style:u("iconCopy",e),size:"1.2em"}));case"ok":return(a=c?.ok)!==null&&a!==void 0?a:f.jsx(nS,Object.assign({},h,{style:Object.assign({fontSize:"90%"},u("iconOk",e))}));case"cancel":return(s=c?.cancel)!==null&&s!==void 0?s:f.jsx(rS,Object.assign({},h,{style:Object.assign({fontSize:"130%"},u("iconCancel",e))}));case"chevron":return(l=c?.chevron)!==null&&l!==void 0?l:f.jsx(iS,{size:"1em",style:u("iconCollection",e)});default:return f.jsx(f.Fragment,{})}},nC=({startEdit:n,handleDelete:e,handleAdd:t,enableClipboard:r,type:i,customButtons:o,nodeData:a,translate:s,keyboardControls:l,handleKeyboard:u,editConfirmRef:c,getNewKeyOptions:h,jsonStringify:p,onEditEvent:b,showIconTooltips:x})=>{const{getStyles:E}=Xr(),g=s("KEY_NEW",a),[v,C]=m.useState(g),[A,_]=m.useState(!1),{key:O,path:R,value:I}=a,N=Array.isArray(A),L=B=>{var w;if(b&&b(B?[...R,null]:null,B),!B)return void _(!1);const P=Object.keys(oa(a.fullData,R)),T=h?(w=h(a))===null||w===void 0?void 0:w.filter(D=>!P.includes(D)):null;T&&C(""),_(T==null||T)};return f.jsxs("div",{className:"jer-edit-buttons",style:{opacity:A?1:void 0},onClick:B=>B.stopPropagation(),children:[r&&f.jsx("div",{onClick:B=>{var w;B.stopPropagation();let P,T,D="value",M="",k=null;if(r){const V=Ap(B);if(V&&l.clipboardModifier.includes(V)?(P=oS(R),M=P,D="path"):(P=I,M=typeof P=="object"?p(I):String(P)),!navigator.clipboard)return void(typeof r=="function"&&r({success:!1,value:P,stringValue:M,path:R,key:O,type:D,errorMessage:"Can't access clipboard API"}));(w=navigator.clipboard)===null||w===void 0||w.writeText(M).then(()=>T=!0).catch(W=>{T=!1,k=W.message}).finally(()=>{typeof r=="function"&&r({success:T,errorMessage:k,value:P,stringValue:M,path:R,key:O,type:D})})}},className:"jer-copy-pulse",title:x?s("TOOLTIP_COPY",a):"",children:f.jsx(Xi,{name:"copy",nodeData:a})}),n&&f.jsx("div",{onClick:n,title:x?s("TOOLTIP_EDIT",a):"",children:f.jsx(Xi,{name:"edit",nodeData:a})}),e&&f.jsx("div",{onClick:e,title:x?s("TOOLTIP_DELETE",a):"",children:f.jsx(Xi,{name:"delete",nodeData:a})}),t&&f.jsx("div",{onClick:()=>{i==="object"?L(!0):t("")},title:x?s("TOOLTIP_ADD",a):"",children:f.jsx(Xi,{name:"add",nodeData:a})}),o?.map(({Element:B,onClick:w},P)=>f.jsx("div",{onClick:T=>w&&w(a,T),children:f.jsx(B,{nodeData:a})},P)),A&&t&&i==="object"&&f.jsxs(f.Fragment,{children:[N?f.jsxs("div",{className:"jer-select jer-select-keys",children:[f.jsxs("select",{name:"new-key-select",className:"jer-select-inner",onChange:B=>{t(B.target.value),L(!1)},defaultValue:"",autoFocus:!0,onKeyDown:B=>{u(B,{cancel:()=>L(!1)})},children:[f.jsx("option",{value:"",disabled:!0,children:A.length>0?s("KEY_SELECT",a):s("NO_KEY_OPTIONS",a)}),A.map(B=>f.jsx("option",{value:B,children:B},B))]}),f.jsx("span",{className:"focus"})]}):f.jsx("input",{className:"jer-input-new-key",type:"text",name:"new-object-key",value:v,onChange:B=>C(B.target.value),autoFocus:!0,onFocus:B=>B.target.select(),onKeyDown:B=>{u(B,{stringConfirm:()=>{t&&(L(!1),t(v),C(g))},cancel:()=>{L(!1),C(g)}})},style:E("input",a)}),f.jsx(Ip,{onOk:()=>{N&&!v||(L(!1),t(v))},onCancel:()=>{L(!1)},nodeData:a,editConfirmRef:c,hideOk:N})]})]})},Ip=({onOk:n,onCancel:e,nodeData:t,editConfirmRef:r,hideOk:i=!1})=>f.jsxs("div",{className:"jer-confirm-buttons",children:[!i&&f.jsx("div",{onClick:n,ref:r,children:f.jsx(Xi,{name:"ok",nodeData:t})}),f.jsx("div",{onClick:e,children:f.jsx(Xi,{name:"cancel",nodeData:t})})]}),oS=n=>n.reduce((e,t)=>typeof t=="number"?`${e}[${t}]`:e===""?t:`${e}.${t}`,""),aS=["string","number","boolean","null","object","array"],rC=({props:n,collapsed:e})=>{const{data:t,nodeData:r,parentData:i,onEdit:o,onError:a,showErrorMessages:s,restrictEditFilter:l,restrictDeleteFilter:u,restrictAddFilter:c,restrictDragFilter:h,translate:p,errorMessageTimeout:b}=n,{currentlyEditingElement:x,setCurrentlyEditingElement:E}=$i(),[g,v]=m.useState(null),C=Object.assign(Object.assign({},r),{collapsed:e}),{path:A,key:_,size:O}=C,R=ro(A),I=!l(C),N=!u(C),L=!c(C),B=!h(C)&&N&&x===null,w=W=>{s&&(v(W),setTimeout(()=>v(null),b)),console.warn("Error",W)},P=m.useCallback((W,Y)=>{w(W.message),a&&a({currentData:C.fullData,errorValue:Y,currentValue:t,name:_,path:A,error:W})},[a,s]),T=x===R,D=x===`key_${R}`,M=typeof A.slice(-1)[0]=="number",k={isEditing:T,isEditingKey:D,isArray:M,canEditKey:i!==null&&I&&L&&N&&!M},V=_===""&&A.length>0?p("EMPTY_STRING",C):null;return{pathString:R,nodeData:C,path:A,name:_,size:O,canEdit:I,canDelete:N,canAdd:L,canDrag:B,error:g,showError:w,onError:P,setError:v,handleEditKey:W=>{if(E(null),_===W||!i)return;const Y=A.slice(0,-1);if(Object.keys(i).includes(W))return void P({code:"KEY_EXISTS",message:p("ERROR_KEY_EXISTS",C)},W);const q=Object.fromEntries(Object.entries(i).map(([J,X])=>J===_?[W,X]:[J,X]));o(q,Y).then(J=>{J&&P({code:"UPDATE_ERROR",message:J},W)})},derivedValues:k,emptyStringKey:V}},iC=({canDrag:n,canDragOnto:e,path:t,nodeData:r,onMove:i,onError:o,translate:a})=>{const{getStyles:s}=Xr(),{dragSource:l,setDragSource:u}=$i(),[c,h]=m.useState(!1),p=ro(t),b=m.useMemo(()=>n?{onDragStart:v=>{v.stopPropagation(),u({path:t,pathString:p})},onDragEnd:v=>{v.stopPropagation(),u({path:null,pathString:null})}}:{},[n,p]),x=m.useMemo(()=>v=>e?{onDragOver:C=>{C.stopPropagation(),C.preventDefault()},onDrop:C=>{C.stopPropagation(),g(v),u({path:null,pathString:null}),h(!1)},onDragEnter:C=>{var A;C.stopPropagation(),p.startsWith((A=l.pathString)!==null&&A!==void 0?A:"")||h(v)},onDragExit:C=>{C.stopPropagation(),h(!1)}}:{},[l,e,p]),E=m.useMemo(()=>e&&l.pathString!==null?f.jsx("div",Object.assign({className:"jer-drop-target-bottom",style:{height:"50%",position:"absolute",width:"100%",top:"50%",zIndex:t.length}},x("below"))):null,[l,e,t.length]),g=v=>{var C,A;const _=(C=l.path)===null||C===void 0?void 0:C.slice(-1)[0],O=(A=l.path)===null||A===void 0?void 0:A.slice(0,-1).join("."),R=t.slice(0,-1).join(""),{parentData:I}=r;typeof _=="string"&&I&&!Array.isArray(I)&&Object.keys(I).includes(_)&&_ in I&&O!==R?o({code:"KEY_EXISTS",message:a("ERROR_KEY_EXISTS",r)},_):i(l.path,t,v).then(N=>{N&&o({code:"UPDATE_ERROR",message:N},r.value)})};return{dragSourceProps:b,getDropTargetProps:x,BottomDropTarget:E,DropTargetPadding:({position:v,nodeData:C})=>c===v?f.jsx("div",{className:"jer-drag-n-drop-padding",style:s("dropZone",C)}):null,handleDrop:g}},sS=(n,e,t,r)=>{var i,o,a;if(!e.current)return 0;const s=parseInt((i=getComputedStyle(t.current).getPropertyValue("line-height"))!==null&&i!==void 0?i:"16px"),l=((a=(o=e.current)===null||o===void 0?void 0:o.offsetWidth)!==null&&a!==void 0?a:0)/(.5*s),u=r(n).replace(/\\n/g,`
|
|
50
50
|
`).split(`
|
|
51
|
-
`).map(c=>Math.ceil(c.length/l)).reduce((c,h)=>c+h,0)*s;return Math.min(u+30,window.innerHeight-50)},gl=({isEditingKey:n,canEditKey:e,pathString:t,path:r,name:i,arrayIndexFromOne:o,handleKeyboard:a,handleEditKey:s,handleCancel:l,handleClick:u,keyValueArray:c,styles:h,getNextOrPrevious:f,emptyStringKey:b,nodeData:x,customNodeData:w,getStyles:g})=>{const{setCurrentlyEditingElement:y}=Xi(),C=typeof i=="number"?String(i+(o?1:0)):i;if(!n){const A=Object.assign(Object.assign({},h),{minWidth:`${Math.min(C.length+1,5)}ch`,flexShrink:C.length>10?1:0});if(w?.CustomKey&&x&&g){const{CustomKey:_,customNodeProps:N}=w;return p.jsx(_,{nodeData:x,name:b??C,path:r,canEditKey:e,handleEditKey:O=>{e&&s(O)},setIsEditingKey:()=>{e&&y(r,"key")},handleClick:u,styles:A,customNodeProps:N,getStyles:g})}return p.jsxs("span",{className:"jer-key-text",style:A,onDoubleClick:()=>e&&y(r,"key"),onClick:u,children:[b?p.jsx("span",{className:"jer-empty-string",children:b}):C,C!==""||b?p.jsx("span",{className:"jer-key-colon",children:":"}):null]})}return p.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:t,defaultValue:C,autoFocus:!0,onFocus:A=>A.target.select(),onKeyDown:A=>a(A,{stringConfirm:()=>s(A.target.value),cancel:l,tabForward:()=>{if(s(A.target.value),c){const _=c?.[0][0];y(_?[...r,_]:f("next"))}else y(r)},tabBack:()=>{s(A.target.value),y(f("prev"))}}),style:{width:C.length/1.5+.5+"em"}})},jx=n=>{const{data:e,parentData:t,onEdit:r,onDelete:i,onChange:o,onMove:a,enableClipboard:s,canDragOnto:l,restrictTypeSelection:u,searchFilter:c,searchText:h,showLabel:f,stringTruncate:b,showStringQuotes:x,arrayIndexFromOne:w,indent:g,translate:y,customNodeDefinitions:C,customNodeData:A,handleKeyboard:_,keyboardControls:N,sort:O,editConfirmRef:T,jsonStringify:D,showIconTooltips:M}=n,{getStyles:L}=zr(),{setCurrentlyEditingElement:E,setCollapseState:S,previouslyEditedElement:I,setPreviouslyEditedElement:P,tabDirection:B,setTabDirection:F,previousValue:G,setPreviousValue:V}=Xi(),[z,W]=m.useState(typeof e=="function"?vf:e),{pathString:J,nodeData:Y,path:ee,name:K,canEdit:X,canDelete:ie,canDrag:de,error:oe,onError:me,handleEditKey:je,emptyStringKey:Le,derivedValues:De}=Ox({props:n}),{dragSourceProps:He,getDropTargetProps:ve,BottomDropTarget:se,DropTargetPadding:Me}=Nx({canDrag:de,canDragOnto:l,path:ee,nodeData:Y,onMove:a,onError:me,translate:y}),[Re,tt]=m.useState(yf(e,A)),Ie=m.useCallback(te=>{if(!o)return void W(te);const _e=o({currentData:Y.fullData,newValue:te,currentValue:z,name:K,path:ee});W(_e)},[o]);m.useEffect(()=>{W(typeof e=="function"?vf:e),tt(yf(e,A))},[e,oe]);const{CustomNode:Ye,customNodeProps:Ue,hideKey:wt,showEditTools:Ke=!0,showOnEdit:gt,showOnView:Ot,passOriginalNode:kt}=A,yt=[...YT,...C.filter(({showInTypesSelector:te=!1,name:_e})=>te&&!!_e).map(({name:te})=>te)],it=m.useMemo(()=>{if(typeof u=="boolean")return u?[]:yt;if(Array.isArray(u))return u;const te=u(Y);return typeof te=="boolean"?te?[]:yt:te},[Y,u]),[mt,pt]=m.useState(((te,_e)=>{var Xe;if(typeof te!="string")return null;const ht=_e.filter(ft=>ft instanceof Object&&ft.enum&&ft.values.includes(te)&&ft.matchPriority);return ht.sort((ft,$e)=>{var nn,Cn;return((nn=$e.matchPriority)!==null&&nn!==void 0?nn:0)-((Cn=ft.matchPriority)!==null&&Cn!==void 0?Cn:0)}),(Xe=ht[0])!==null&&Xe!==void 0?Xe:null})(z,it)),{isEditing:xt}=De,en=wx("value",Y,c,h);if(xt&&(!en||!X)){const te=Vi(Y.fullData,ee,B,O);E(te||I)}if(!en)return null;const st=te=>{let _e;if(E(null),V(null),te===void 0||(Xe=>Xe&&typeof Xe=="object"&&"type"in Xe&&"target"in Xe&&"preventDefault"in Xe&&typeof Xe.preventDefault=="function")(te))switch(Re){case"object":_e={[y("DEFAULT_NEW_KEY",Y)]:z};break;case"array":_e=z??[];break;case"number":{const Xe=Number(z);_e=isNaN(Xe)?0:Xe;break}default:_e=z}else _e=te;r(_e,ee).then(Xe=>{Xe&&me({code:"UPDATE_ERROR",message:Xe},_e)})},lt=()=>{E(null),G===null?(W(e),V(null)):r(G,ee)},{isEditingKey:tn,canEditKey:Rn}=De,Lt=!xt&&oe,bt=xt&&it.length>1,Nt=(Re!=="invalid"||Ye)&&!oe&&Ke,Ce=f&&!wt,ce=Ye&&(xt&>||!xt&&Ot),Ae={value:z,parentData:t,setValue:Ie,isEditing:xt,canEdit:X,setIsEditing:X?()=>E(ee):()=>{},handleEdit:st,handleCancel:lt,path:ee,stringTruncate:b,showStringQuotes:x,nodeData:Y,enumType:mt,translate:y,handleKeyboard:_,keyboardCommon:{cancel:lt,tabForward:()=>{F("next"),P(J);const te=Vi(Y.fullData,ee,"next",O);te&&(st(),E(te))},tabBack:()=>{F("prev"),P(J);const te=Vi(Y.fullData,ee,"prev",O);te&&(st(),E(te))}}},ze={canEditKey:Rn,isEditingKey:tn,pathString:J,path:ee,name:K,arrayIndexFromOne:w,handleKeyboard:_,handleEditKey:je,handleCancel:lt,styles:L("property",Y),getNextOrPrevious:te=>Vi(Y.fullData,ee,te,O),emptyStringKey:Le,nodeData:Y,customNodeData:A,getStyles:L},qe=ce?p.jsx(Ye,Object.assign({},n,{value:z,customNodeProps:Ue,setValue:Ie,handleEdit:st,handleCancel:lt,handleKeyPress:te=>_(te,{stringConfirm:st,cancel:lt}),isEditing:xt,setIsEditing:()=>E(ee),getStyles:L,originalNode:kt?ym(e,Ae):void 0,originalNodeKey:kt?p.jsx(gl,Object.assign({},ze,{customNodeData:void 0})):void 0,canEdit:X,keyboardCommon:Ae.keyboardCommon,onError:me})):ym(e,Ae);return p.jsxs("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:t!==null?g/2+"em":0,position:"relative"},draggable:de},He,ve("above"),{children:[se,p.jsx(Me,{position:"above",nodeData:Y}),p.jsxs("div",{className:"jer-value-main-row",style:{flexWrap:K.length>10?"wrap":"nowrap"},children:[Ce&&p.jsx(gl,Object.assign({},ze)),p.jsxs("div",{className:"jer-value-and-buttons",children:[p.jsx("div",{className:"jer-input-component",children:qe}),xt?p.jsx(up,{onOk:st,onCancel:lt,nodeData:Y,editConfirmRef:T}):Nt&&p.jsx(Rx,{startEdit:X?()=>{V(G),E(ee,lt)}:void 0,handleDelete:ie?()=>{i(z,ee).then(te=>{te&&me({code:"DELETE_ERROR",message:te},z)})}:void 0,enableClipboard:s,translate:y,customButtons:n.customButtons,nodeData:Y,handleKeyboard:_,keyboardControls:N,editConfirmRef:T,jsonStringify:D,showIconTooltips:M}),bt&&p.jsxs("div",{className:"jer-select jer-select-types",children:[p.jsx("select",{name:`${K}-type-select`,className:"jer-select-inner",onChange:te=>(_e=>{const Xe=C.find($e=>$e.name===_e);if(Xe)return r(Xe.defaultValue,ee),tt(_e),pt(null),E(null),void S({path:ee,collapsed:!1,includeChildren:!1});const ht=it.find($e=>$e instanceof Object&&$e.enum===_e);if(ht)return typeof z=="string"&&ht.values.includes(z)||r(ht.values[0],ee).then($e=>{$e&&(me({code:"UPDATE_ERROR",message:$e},ft),E(null))}),void pt(ht);const ft=JT(z,_e,y("DEFAULT_NEW_KEY",Y),A?.CustomNode?y("DEFAULT_STRING",Y):void 0);["string","number","boolean"].includes(_e)||E(null),r(ft,ee).then($e=>{$e?(me({code:"UPDATE_ERROR",message:$e},ft),E(null)):pt(null)})})(te.target.value),value:mt?mt.enum:Re,children:it.map(te=>te instanceof Object&&"enum"in te?p.jsx("option",{value:te.enum,children:te.enum},te.enum):p.jsx("option",{value:te,children:te},te))}),p.jsx("span",{className:"focus"})]}),Lt&&p.jsx("span",{className:"jer-error-slug",style:L("error",Y),children:oe})]})]}),p.jsx(Me,{position:"below",nodeData:Y})]}))},yf=(n,e)=>e?.CustomNode&&e?.name&&e.showInTypesSelector?e.name:typeof n=="string"?"string":typeof n=="number"?"number":typeof n=="boolean"?"boolean":n===null?"null":"invalid",ym=(n,e)=>{const t=yf(n),{value:r}=e;switch(t){case"string":return p.jsx(kT,Object.assign({},e,{value:r}));case"number":return p.jsx(LT,Object.assign({},e,{value:r}));case"boolean":return p.jsx(PT,Object.assign({},e,{value:r}));case"null":return p.jsx(FT,Object.assign({},e));default:return p.jsx(GT,Object.assign({},e))}},JT=(n,e,t,r)=>{switch(e){case"string":return r??String(n);case"number":{const i=Number(n);return isNaN(i)?0:i}case"boolean":return!!n;case"null":return null;case"object":return{[t]:n};case"array":return[n];default:return String(n)}},Dx=(n=[],e)=>{const t=n.filter(({condition:w})=>w(e));if(t.length===0)return{};const r=t[0],{element:i,wrapperElement:o,customKey:a,customNodeProps:s,wrapperProps:l,hideKey:u=!1,showEditTools:c=!0,showOnEdit:h=!1,showOnView:f=!0,showCollectionWrapper:b=!0}=r,x=yx(r,["element","wrapperElement","customKey","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:i,CustomWrapper:o,CustomKey:a,customNodeProps:s,wrapperProps:l,hideKey:u,showEditTools:c,showOnEdit:h,showOnView:f,showCollectionWrapper:b},x)},Mx=n=>{const{getStyles:e}=zr(),{collapseState:t,setCollapseState:r,getMatchingCollapseState:i,currentlyEditingElement:o,setCurrentlyEditingElement:a,areChildrenBeingEdited:s,previousValue:l,setPreviousValue:u}=Xi(),{mainContainerRef:c,data:h,nodeData:f,parentData:b,showCollectionCount:x,onEdit:w,onAdd:g,onDelete:y,canDragOnto:C,collapseFilter:A,collapseAnimationTime:_,onMove:N,enableClipboard:O,onEditEvent:T,showIconTooltips:D,searchFilter:M,searchText:L,indent:E,sort:S,showArrayIndices:I,arrayIndexFromOne:P,defaultValue:B,newKeyOptions:F,translate:G,customNodeDefinitions:V,customNodeData:z,jsonParse:W,jsonStringify:J,TextEditor:Y,keyboardControls:ee,handleKeyboard:K,insertAtTop:X,onCollapse:ie,editConfirmRef:de,collapseClickZones:oe}=n,[me,je]=m.useState(J(h)),Le=A(f),{contentRef:De,isAnimating:He,maxHeight:ve,collapsed:se,animateCollapse:Me,cssTransitionValue:Re}=((ae,Ze,jt,ot,rn)=>{const[Mr,pr]=m.useState(jt?0:void 0),[kr,hi]=m.useState(jt),Lr=m.useRef(!1),wn=m.useRef(null),Kn=m.useRef(0),An=m.useRef(0),Gn=Ze/1e3+"s",Qn=m.useCallback(on=>{var Zr,er;if(kr!==on){switch(window.clearTimeout(An.current),Lr.current=!0,on){case!0:{const fi=(er=(Zr=wn.current)===null||Zr===void 0?void 0:Zr.offsetHeight)!==null&&er!==void 0?er:0;Kn.current=fi,pr(fi),setTimeout(()=>{pr(0)},5);break}case!1:pr(Kn.current||ZT(ae,wn,ot,rn))}hi(!kr),An.current=window.setTimeout(()=>{Lr.current=!1,on||pr(void 0)},Ze)}},[Ze,kr,ae,ot,rn]);return{contentRef:wn,isAnimating:Lr.current,animateCollapse:Qn,maxHeight:Mr,collapsed:kr,cssTransitionValue:Gn}})(h,_,Le,c,J),{pathString:tt,nodeData:Ie,path:Ye,name:Ue,size:wt,canEdit:Ke,canDelete:gt,canAdd:Ot,canDrag:kt,error:yt,setError:it,onError:mt,handleEditKey:pt,emptyStringKey:xt,derivedValues:en}=Ox({props:n,collapsed:se}),{dragSourceProps:st,getDropTargetProps:lt,BottomDropTarget:tn,DropTargetPadding:Rn}=Nx({canDrag:kt,canDragOnto:C,path:Ye,nodeData:Ie,onMove:N,onError:mt,translate:G}),Lt=m.useRef(!Le),{isEditing:bt,isEditingKey:Nt,isArray:Ce,canEditKey:ce}=en;m.useEffect(()=>{je(J(h))},[h]),m.useEffect(()=>{const ae=A(Ie)&&!bt;Lt.current=!ae,Me(ae)},[A]),m.useEffect(()=>{if(t!==null){const ae=i(Ye);ae&&(Lt.current=!0,Me(ae.collapsed))}},[t]);const Ae=m.useRef(null),ze=m.useCallback((ae,Ze)=>{if(typeof B!="function")return B;const jt=B(ae,Ze);return jt!==void 0?jt:null},[B]),qe=m.useCallback(ae=>F?typeof F!="function"?F:F(ae):null,[F]),{CustomNode:te,customNodeProps:_e,CustomWrapper:Xe,wrapperProps:ht={},hideKey:ft,showEditTools:$e=!0,showOnEdit:nn,showOnView:Cn,showCollectionWrapper:cr=!0}=z,dr=s(tt);if(dr&&se&&Me(!1),!(wx("collection",Ie,M,L)||Ie.level===0)&&!dr)return null;const En=Array.isArray(h)?"array":"object",At=En==="array"?{open:"[",close:"]"}:{open:"{",close:"}"},$r=ae=>{if(ae.key==="Tab"&&!ae.getModifierState("Shift")){ae.preventDefault();const Ze=_x(Ae," ");return void je(Ze)}K(ae,{objectConfirm:Nr,cancel:fr})},Zn=ae=>{ae.stopPropagation();const Ze=sp(ae);if(Ze&&ee.collapseModifier.includes(Ze))return Lt.current=!0,void r({collapsed:!se,path:Ye,includeChildren:!0});o&&o.includes(tt)||(Lt.current=!0,r(null),ie&&ie({path:Ye,collapsed:!se,includeChildren:!1}),Me(!se))},Nr=()=>{try{const ae=W(me);if(a(null),u(null),it(null),J(ae)===J(h))return;w(ae,Ye).then(Ze=>{Ze&&mt({code:"UPDATE_ERROR",message:Ze},ae)})}catch{mt({code:"INVALID_JSON",message:G("ERROR_INVALID_JSON",Ie)},me)}},hr=Ye.length>0?()=>{y(h,Ye).then(ae=>{ae&&mt({code:"DELETE_ERROR",message:ae},h)})}:void 0,fr=()=>{a(null),l===null?(it(null),je(J(h)),u(null)):w(l,Ye)},Ht=x==="when-closed"?se:x,vt=!bt&&$e,Jn=(I||!Ce)&&!ft&&Ue!==void 0,Ni=te&&(bt&&nn||!bt&&Cn),jr=Object.entries(h).map(([ae,Ze])=>[En==="array"?Number(ae):ae,Ze]);En==="object"&&S(jr,ae=>ae);const Dr=Lt.current?bt?p.jsxs("div",{className:"jer-collection-text-edit",children:[Y?p.jsx(Y,{value:me,onChange:je,onKeyDown:ae=>K(ae,{objectConfirm:Nr,cancel:fr})}):p.jsx(Ex,{textAreaRef:Ae,className:"jer-collection-text-area",name:tt,value:me,setValue:je,handleKeyPress:$r,styles:e("input",Ie)}),p.jsx("div",{className:"jer-collection-input-button-row",children:p.jsx(up,{onOk:Nr,onCancel:fr,nodeData:Ie,editConfirmRef:de})})]}):jr.map(([ae,Ze],jt)=>{const ot={key:ae,value:Ze,path:[...Ye,ae],level:Ye.length+1,index:jt,size:ia(Ze)?Object.keys(Ze).length:null,parentData:h,fullData:Ie.fullData},rn=Dx(V,ot);return p.jsx("div",{className:"jer-collection-element",style:e("collectionElement",ot),children:ia(Ze)&&!rn?.renderCollectionAsValue?p.jsx(Mx,Object.assign({},n,{data:Ze,parentData:h,nodeData:ot,showCollectionCount:x,canDragOnto:Ke,customNodeData:rn}),ae):p.jsx(jx,Object.assign({},n,{data:Ze,parentData:h,nodeData:ot,canDragOnto:Ke,showLabel:En==="object"||I,customNodeData:rn}),ae)},ae)}):null,Vt=!!cr&&se&&!dr;Vt||(Lt.current=!0);const Yr=Object.assign(Object.assign({},n),{data:h,value:h,parentData:b,nodeData:Ie,setValue:ae=>Ao(void 0,void 0,void 0,function*(){return yield w(ae,Ye)}),handleEdit:Nr,handleCancel:fr,handleKeyPress:$r,isEditing:bt,setIsEditing:()=>a(Ye),getStyles:e,canDragOnto:Ke,canEdit:Ke,keyboardCommon:{},onError:mt}),ji=Ni?p.jsx(te,Object.assign({customNodeProps:_e},Yr,{children:Dr})):Dr,ui=vt&&p.jsx(Rx,{startEdit:Ke?()=>{Lt.current=!0,u(null),a(Ye)}:void 0,handleAdd:Ot?ae=>{Me(!1);const Ze=ze(Ie,ae);if(En==="array"){const jt=X.array?0:h.length,ot=X.array?{insert:!0}:{};g(Ze,[...Ye,jt],ot).then(rn=>{rn&&mt({code:"ADD_ERROR",message:rn},Ze)})}else if(ae in h)mt({code:"KEY_EXISTS",message:G("ERROR_KEY_EXISTS",Ie)},ae);else{const jt=X.object?{insertBefore:0}:{};g(Ze,[...Ye,ae],jt).then(ot=>{ot&&mt({code:"ADD_ERROR",message:ot},Ze)})}}:void 0,handleDelete:gt?hr:void 0,enableClipboard:O,type:En,nodeData:Ie,translate:G,customButtons:n.customButtons,keyboardControls:ee,handleKeyboard:K,getNewKeyOptions:qe,editConfirmRef:de,jsonStringify:J,onEditEvent:T,showIconTooltips:D}),ci={canEditKey:ce,isEditingKey:Nt,pathString:tt,path:Ye,name:Ue,arrayIndexFromOne:P,handleKeyboard:K,handleEditKey:pt,handleCancel:fr,keyValueArray:jr,styles:e("property",Ie),getNextOrPrevious:ae=>Vi(Ie.fullData,Ye,ae,S),handleClick:oe.includes("property")?Zn:ae=>ae.stopPropagation(),emptyStringKey:xt,nodeData:Ie,customNodeData:z,getStyles:e},di=p.jsxs("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(Ye.length===0?0:E/2)+"em"},e("collection",Ie)),{position:"relative"}),draggable:kt},st,lt("above"),{children:[p.jsx("div",{className:"jer-clickzone",style:{width:E/2+1+"em",zIndex:10+2*Ie.level},onClick:oe.includes("left")?Zn:void 0}),!bt&&tn,p.jsx(Rn,{position:"above",nodeData:Ie}),cr?p.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:oe.includes("header")?Zn:void 0,children:[p.jsxs("div",{className:"jer-collection-name",children:[p.jsx("div",{className:"jer-collapse-icon jer-accordion-icon"+(se?" jer-rotate-90":""),style:{zIndex:11+2*Ie.level,transition:Re},onClick:Zn,children:p.jsx(Wi,{name:"chevron",rotate:se,nodeData:Ie})}),Jn&&p.jsx(gl,Object.assign({},ci)),!bt&&p.jsx("span",{className:"jer-brackets jer-bracket-open",style:e("bracket",Ie),children:At.open})]}),!bt&&Ht&&p.jsx("div",{className:"jer-collection-item-count"+(Ht?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},e("itemCount",Ie)),{transition:Re}),children:wt===1?G("ITEM_SINGLE",Object.assign(Object.assign({},Ie),{size:1}),1):G("ITEMS_MULTIPLE",Ie,wt)}),p.jsx("div",{className:"jer-brackets"+(Vt?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},e("bracket",Ie)),{transition:Re}),children:At.close}),ui]}):ft?p.jsx(p.Fragment,{}):p.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[p.jsx(gl,Object.assign({},ci)),ui]}),p.jsxs("div",{className:"jer-collection-inner",style:Object.assign(Object.assign({overflowY:Vt||He?"clip":"visible",maxHeight:dr?void 0:ve},e("collectionInner",Ie)),{transition:Re}),ref:De,children:[ji,p.jsx("div",{className:bt?"jer-collection-error-row":"jer-collection-error-row-edit",children:yt&&p.jsx("span",{className:"jer-error-slug",style:e("error",Ie),children:yt})}),!bt&&cr&&p.jsx("div",{className:"jer-brackets jer-bracket-outside",style:e("bracket",Ie),children:At.close})]}),p.jsx(Rn,{position:"below",nodeData:Ie})]}));return Xe?p.jsx(Xe,Object.assign({customNodeProps:ht},Yr,{children:di})):di},KT={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"},QT=(n,e)=>(t,r,i)=>((o,a,s,l,u)=>{if(a[l]){const h=a[l](s);if(h!==null)return h}const c=l in o?o[l]:KT[l];return u===void 0?c:c?.replace("{{count}}",String(u))})(n,e,r,t,i);var xm=[],Ca=[];(function(n,e){if(n&&typeof document<"u"){var t,r=e.prepend===!0?"prepend":"append",i=e.singleTag===!0,o=typeof e.container=="string"?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(i){var a=xm.indexOf(o);a===-1&&(a=xm.push(o)-1,Ca[a]={}),t=Ca[a]&&Ca[a][r]?Ca[a][r]:Ca[a][r]=s()}else t=s();n.charCodeAt(0)===65279&&(n=n.substring(1)),t.styleSheet?t.styleSheet.cssText+=n:t.appendChild(document.createTextNode(n))}function s(){var l=document.createElement("style");if(l.setAttribute("type","text/css"),e.attributes)for(var u=Object.keys(e.attributes),c=0;c<u.length;c++)l.setAttribute(u[c],e.attributes[u[c]]);var h=r==="prepend"?"afterbegin":"beforeend";return o.insertAdjacentElement(h,l),l}})(':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}',{});const eI=(n,e)=>JSON.stringify(n,e,2),tI=({data:n,setData:e,rootName:t="root",onUpdate:r=()=>{},onEdit:i=r,onDelete:o=r,onAdd:a=r,onChange:s,onError:l,onEditEvent:u,showErrorMessages:c=!0,enableClipboard:h=!0,indent:f=2,collapse:b=!1,collapseAnimationTime:x=300,showCollectionCount:w=!0,restrictEdit:g=!1,restrictDelete:y=!1,restrictAdd:C=!1,restrictTypeSelection:A=!1,restrictDrag:_=!0,viewOnly:N,searchFilter:O,searchText:T,searchDebounceTime:D=350,keySort:M=!1,showArrayIndices:L=!0,arrayIndexFromOne:E=!1,showStringQuotes:S=!0,showIconTooltips:I=!1,defaultValue:P=null,newKeyOptions:B,minWidth:F=250,maxWidth:G="min(600px, 90vw)",rootFontSize:V,stringTruncate:z=250,translations:W={},className:J,id:Y,customText:ee={},customNodeDefinitions:K=[],customButtons:X=[],jsonParse:ie=JSON.parse,jsonStringify:de=eI,TextEditor:oe,errorMessageTimeout:me=2500,keyboardControls:je={},externalTriggers:Le,insertAtTop:De=!1,onCollapse:He,collapseClickZones:ve=["header","left"]})=>{const{getStyles:se}=zr(),{setCurrentlyEditingElement:Me}=Xi(),Re=m.useMemo(()=>wa(b),[b]),tt=m.useMemo(()=>QT(W,ee),[W,ee]),[Ie,Ye]=m.useState(T),[Ue,wt]=(({setData:Ce,data:ce})=>{const[Ae,ze]=m.useState(Ce?void 0:ce),qe=m.useCallback(te=>{Ce?Ce(te):ze(te)},[Ce]);return m.useEffect(()=>{Ce||ze(ce)},[ce]),[Ce?ce:Ae,qe]})({setData:e,data:n}),Ke=m.useRef(null);m.useEffect(()=>{Me(null);const Ce=setTimeout(()=>Ye(T),D);return()=>clearTimeout(Ce)},[T,D]);const gt={key:t,path:[],level:0,index:0,value:Ue,size:typeof Ue=="object"&&Ue!==null?Object.keys(Ue).length:1,parentData:null,fullData:Ue},Ot=(Ce,ce)=>Ao(void 0,void 0,void 0,function*(){const Ae=yield Ce(ce);if(Ae===!0||Ae===void 0)return void wt(ce.newData);const ze=iI(Ae)?Ae:["error",Ae],[qe,te]=ze;if(qe==="error")return wt(ce.currentData),te===!1?tt("ERROR_UPDATE",gt):String(te);wt(te)}),kt=m.useMemo(()=>wa(g,N),[g,N]),yt=m.useMemo(()=>wa(y,N),[y,N]),it=m.useMemo(()=>wa(C,N),[C,N]),mt=m.useMemo(()=>wa(_,N),[_,N]),pt=m.useMemo(()=>rI(O),[O]),xt=m.useMemo(()=>(Ce=>{const ce=Object.assign({},bm);for(const Ae of Object.keys(bm)){const ze=Ae;if(Ce[ze]){const qe=Ce[ze],te=["clipboardModifier","collapseModifier"].includes(Ae)?Array.isArray(qe)?qe:[qe]:typeof qe=="string"?{key:qe}:qe;ce[ze]=te,["stringConfirm","numberConfirm","booleanConfirm"].forEach(_e=>{!Ce[_e]&&Ce.confirm&&(ce[_e]=ce.confirm)})}}return ce})(je),[je]),en=m.useCallback((Ce,ce)=>((Ae,ze,qe)=>{const te=Object.entries(ze);for(const[_e,Xe]of te)if(TT(qe,Ae[_e],_e)){qe.preventDefault(),Xe();break}})(xt,ce,Ce),[xt]),st=m.useMemo(()=>{const Ce=Cm(K,"stringifyReplacer");return ce=>de(ce,Ce)},[K,de]),lt=m.useMemo(()=>{const Ce=Cm(K,"parseReviver");return ce=>{const Ae=ie(ce,Ce);return bf(Ae)}},[K,ie]),tn=m.useRef(null);((Ce,ce)=>{const{setCurrentlyEditingElement:Ae,currentlyEditingElement:ze,setCollapseState:qe}=Xi();m.useEffect(()=>{if(!Ce)return;const{collapse:te,edit:_e}=Ce;te&&qe(te);const Xe=!_e?.path||Qi(_e.path)===ze;switch(_e?.action){case"accept":Xe&&(ce.current&&ce.current.click(),Ae(null));break;case"cancel":Xe&&Ae(null);break;default:_e?.path&&Ae(_e.path)}},[Ce])})(Le,tn);const Rn=m.useCallback((Ce,ce)=>{M!==!1&&(typeof M!="function"?Ce.sort((Ae,ze)=>{const qe=ce(Ae)[0],te=ce(ze)[0];return qe<te?-1:qe>te?1:0}):Ce.sort((Ae,ze)=>M(ce(Ae),ce(ze))))},[M]),Lt=Dx(K,gt),bt={mainContainerRef:Ke,name:t,nodeData:gt,onEdit:(Ce,ce)=>Ao(void 0,void 0,void 0,function*(){const{currentData:Ae,newData:ze,currentValue:qe,newValue:te}=Ea(Ue,ce,Ce,"update");if(qe!==te)return yield Ot(i,{currentData:Ae,newData:ze,currentValue:qe,newValue:te,name:ce.slice(-1)[0],path:ce})}),onDelete:(Ce,ce)=>Ao(void 0,void 0,void 0,function*(){const{currentData:Ae,newData:ze,currentValue:qe,newValue:te}=Ea(Ue,ce,Ce,"delete");return yield Ot(o,{currentData:Ae,newData:ze,currentValue:qe,newValue:te,name:ce.slice(-1)[0],path:ce})}),onAdd:(Ce,ce,Ae)=>Ao(void 0,void 0,void 0,function*(){const{currentData:ze,newData:qe,currentValue:te,newValue:_e}=Ea(Ue,ce,Ce,"add",Ae);return yield Ot(a,{currentData:ze,newData:qe,currentValue:te,newValue:_e,name:ce.slice(-1)[0],path:ce})}),onChange:s,onError:l,onEditEvent:u,showErrorMessages:c,onMove:(Ce,ce,Ae)=>Ao(void 0,void 0,void 0,function*(){if(Ce===null)return;const{currentData:ze,newData:qe,currentValue:te}=Ea(Ue,Ce,"","delete"),_e=Ce.slice(-1)[0],Xe=ce.slice(0,-1),ht=ce.slice(-1)[0];let ft=typeof ht=="number"?Ae==="above"?ht:ht+1:typeof _e=="number"?`arr_${_e}`:_e;Ce.slice(0,-1).join(".")===ce.slice(0,-1).join(".")&&typeof _e=="number"&&typeof ft=="number"&&_e<ft&&(ft-=1);const $e=typeof ft=="number"?{insert:!0}:Ae==="above"?{insertBefore:ht}:{insertAfter:ht},{newData:nn,newValue:Cn}=Ea(qe,[...Xe,ft],te,"add",$e);return yield Ot(i,{currentData:ze,newData:nn,currentValue:te,newValue:Cn,name:ce.slice(-1)[0],path:ce})}),showCollectionCount:w,collapseFilter:Re,collapseAnimationTime:x,restrictEditFilter:kt,restrictDeleteFilter:yt,restrictAddFilter:it,restrictTypeSelection:A,restrictDragFilter:mt,canDragOnto:!1,searchFilter:pt,searchText:Ie,enableClipboard:h,keySort:M,sort:Rn,showArrayIndices:L,arrayIndexFromOne:E,showStringQuotes:S,showIconTooltips:I,indent:f,defaultValue:P,newKeyOptions:B,stringTruncate:z,translate:tt,customNodeDefinitions:K,customNodeData:Lt,customButtons:X,parentData:null,jsonParse:lt,jsonStringify:st,TextEditor:oe,errorMessageTimeout:me,handleKeyboard:en,keyboardControls:xt,insertAtTop:{object:De===!0||De==="object",array:De===!0||De==="array"},onCollapse:He,editConfirmRef:tn,collapseClickZones:ve},Nt=Object.assign(Object.assign({},se("container",gt)),{minWidth:F,maxWidth:G});return Nt.fontSize=V??Nt.fontSize,p.jsx("div",{id:Y,ref:Ke,className:`jer-editor-container ${J??""}`,style:Nt,children:ia(Ue)&&!Lt.renderCollectionAsValue?p.jsx(Mx,Object.assign({data:Ue},bt)):p.jsx(jx,Object.assign({data:Ue,showLabel:!0},bt))})},nI=n=>{var e;const[t,r]=m.useState();return m.useEffect(()=>{const i=document.documentElement;r(i)},[]),t?p.jsx(ST,{theme:(e=n.theme)!==null&&e!==void 0?e:lp,icons:n.icons,docRoot:t,children:p.jsx(jT,{onEditEvent:n.onEditEvent,onCollapse:n.onCollapse,children:p.jsx(tI,Object.assign({},n))})}):null},Ea=(n,e,t,r,i={})=>{if(e.length===0)return{currentData:n,newData:t,currentValue:n,newValue:t};const o=Object.assign({remove:r==="delete"},i),a=r!=="add"?ra(n,e):void 0;return{currentData:n,newData:wT(n,e,t,o),currentValue:a,newValue:r!=="delete"?t:void 0}},wa=(n,e)=>e?()=>!0:typeof n=="boolean"?()=>n:typeof n=="number"?({level:t})=>t>=n:n,rI=n=>{if(n!==void 0)return n==="value"?oa:n==="key"?mm:n==="all"?(e,t)=>oa(e,t)||mm(e,t):n},iI=n=>Array.isArray(n)&&n.length===2&&["error","value"].includes(n[0]),Cm=(n,e)=>{const t=e==="stringifyReplacer"?[r=>r===void 0?Tx:r]:[];if(t.push(...n.map(r=>r[e]).filter(r=>!!r)),t.length!==0)return(r,i)=>{let o=i;for(const a of t)o=a(o);return o}};function cp({annotationState:n,closeFormCompanionWindow:e,saveAnnotation:t,saving:r,t:i}){const o=m.useRef(t);o.current=t;const a=m.useRef(r);return a.current=r,m.useEffect(()=>{const s=()=>{a.current||o.current()};return document.addEventListener(rf,s),()=>document.removeEventListener(rf,s)},[]),p.jsxs(p.Fragment,{children:[n.creator&&n.creationDate&&p.jsx(q.Grid,{container:!0,children:p.jsx(tp,{lastSavedDate:n.lastSavedDate,lastEditor:n.lastEditor,creator:n.creator,creationDate:n.creationDate,displayMode:nx,t:i})}),p.jsx(q.Divider,{sx:{m:1}}),p.jsxs(q.Grid,{sx:{mt:1},container:!0,spacing:1,justifyContent:"flex-end",children:[p.jsx(q.Tooltip,{title:p.jsx(Ii,{label:i("cancel"),action:"escape"}),children:p.jsx(q.Button,{sx:{m:1},disabled:r,onClick:e,children:i("cancel")})}),p.jsx(q.Tooltip,{title:p.jsx(Ii,{label:i("save"),action:"save"}),children:p.jsx(q.Button,{sx:{m:1},variant:"contained",color:"primary",type:"submit",disabled:r,startIcon:r?p.jsx(q.CircularProgress,{color:"inherit",size:16}):void 0,onClick:t,children:i("save")})})]})]})}cp.propTypes={annotationState:d.object.isRequired,closeFormCompanionWindow:d.func.isRequired,saveAnnotation:d.func.isRequired,saving:d.bool,t:d.func.isRequired};cp.defaultProps={saving:!1};function kx({activeTool:n,baseStrokeWidth:e,displayMode:t,handleDragEnd:r,handleDragStart:i,isSelected:o,onShapeClick:a,onTransform:s,shape:l}){const u=m.useRef(),c=m.useRef();m.useEffect(()=>{c.current&&(c.current.nodes([u.current]),c.current.getLayer().batchDraw())},[o]);const h=()=>{a(l)};return p.jsxs(p.Fragment,{children:[p.jsx(Yt.Rect,{dashEnabled:t===sn.TARGET,draggable:n==="cursor"||n==="edit",fill:l.fill,height:l.height,id:l.id,onClick:h,onDragEnd:r,onDragStart:i,onMousedown:h,onTransform:s,ref:u,scaleX:l.scaleX,scaleY:l.scaleY,stroke:l.stroke,strokeScaleEnabled:!1,strokeWidth:l.strokeWidth,width:l.width,x:l.x||0,y:l.y||0}),p.jsx(Yt.Transformer,{ref:c,visible:n==="edit"&&o})]})}kx.propTypes={activeTool:d.string.isRequired,baseStrokeWidth:d.number.isRequired,displayMode:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,height:d.number,id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,text:d.string,type:d.string,width:d.number,x:d.number,y:d.number}).isRequired};function Lx({activeTool:n,handleDragEnd:e,isSelected:t,onShapeClick:r,onTransform:i,shape:o,handleDragStart:a}){const s=m.useRef(),l=m.useRef();m.useEffect(()=>{l.current&&(l.current.nodes([s.current]),l.current.getLayer().batchDraw())},[t]);const u=()=>{r(o)};return p.jsxs(p.Fragment,{children:[p.jsx(Yt.Ellipse,{draggable:n==="cursor"||n==="edit",fill:o.fill,id:o.id,onClick:u,onDragEnd:e,onDragStart:a,onMousedown:u,onTransform:i,radiusX:o.width,radiusY:o.height,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}),p.jsx(Yt.Transformer,{ref:l,visible:n==="edit"&&t})]})}Lx.propTypes={activeTool:d.string.isRequired,baseStrokeWidth:d.number.isRequired,displayMode:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,height:d.number,id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,type:d.string,url:d.string,width:d.number,x:d.number,y:d.number}).isRequired};function Px({shape:n,onShapeClick:e,activeTool:t,isSelected:r,onTransform:i,handleDragEnd:o,handleDragStart:a,text:s}){const l=m.useRef(),u=m.useRef(),c=()=>{e(n)};return m.useEffect(()=>{u.current&&(u.current.nodes([l.current]),u.current.getLayer().batchDraw())},[]),p.jsxs(p.Fragment,{children:[p.jsx(Yt.Text,{ref:l,scaleX:n.scaleX,scaleY:n.scaleY,rotation:n.rotation,x:n.x,y:n.y,fontSize:40,fill:n.fill,text:s,id:n.id,draggable:t==="cursor"||t==="edit",onClick:c,onMousedown:c,onTransform:i,onDragEnd:o,onDragStart:a}),p.jsx(Yt.Transformer,{ref:u,visible:t==="edit"&&r})]})}Px.propTypes={activeTool:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,height:d.number,id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,text:d.string,type:d.string,width:d.number,x:d.number,y:d.number}).isRequired,text:d.string.isRequired};function Bx({onShapeClick:n,shape:e,activeTool:t,isSelected:r,onTransform:i,handleDragEnd:o,handleDragStart:a}){const s=m.useRef(),l=m.useRef();m.useEffect(()=>{l.current&&(l.current.nodes([s.current]),l.current.getLayer().batchDraw())},[r]);const u=()=>{n(e)};return p.jsxs(p.Fragment,{children:[p.jsx(Yt.Arrow,{ref:s,fill:e.fill,scaleX:e.scaleX,scaleY:e.scaleY,rotation:e.rotation,x:e.x,y:e.y,stroke:e.stroke,strokeWidth:e.strokeWidth,points:e.points,id:e.id,draggable:t==="cursor"||t==="edit",onClick:u,onMousedown:u,pointerLength:e.pointerLength,pointerWidth:e.pointerWidth,onTransform:i,onDragEnd:o,onDragStart:a}),p.jsx(Yt.Transformer,{ref:l,visible:t==="edit"&&r})]})}Bx.propTypes={activeTool:d.string.isRequired,handleDragEnd:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,id:d.string,pointerLength:d.number,pointerWidth:d.number,points:d.arrayOf(d.number),rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,type:d.string,url:d.string,x:d.number,y:d.number}).isRequired};function Fx({activeTool:n,handleDragEnd:e,handleDragStart:t,isSelected:r,onShapeClick:i,onTransform:o,shape:a}){const s=m.useRef(),l=m.useRef();m.useEffect(()=>{l.current&&(l.current.nodes([s.current]),l.current.getLayer().batchDraw())},[r,a]);const u=()=>{i(a)};return p.jsxs(p.Fragment,{children:[p.jsx(Yt.Line,{closed:a.closed||!1,draggable:n==="cursor"||n==="edit",fill:a.fill,globalCompositeOperation:"source-over",id:a.id,lineCap:"round",lineJoin:"round",onClick:u,onDragEnd:e,onDragStart:t,onMousedown:u,onTransform:o,points:a.points,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}),p.jsx(Yt.Transformer,{ref:l,visible:n==="edit"&&r})]})}Fx.propTypes={activeTool:d.string.isRequired,baseStrokeWidth:d.number.isRequired,displayMode:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,id:d.string,points:d.arrayOf(d.number),rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,type:d.string,url:d.string,x:d.number,y:d.number}).isRequired};function Gx({activeTool:n,onShapeClick:e,isSelected:t,shape:r,onTransform:i,handleDragEnd:o,handleDragStart:a}){const s=m.useRef(),l=m.useRef();m.useEffect(()=>{l.current&&(l.current.nodes([s.current]),l.current.getLayer().batchDraw())},[t,r]);const u=()=>{e(r)};return p.jsxs(p.Fragment,{children:[p.jsx(Yt.Group,{ref:s,onClick:u,onMousedown:u,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:n==="cursor"||n==="edit",onDragEnd:o,onDragStart:a,id:r.id,children:r.lines.map(c=>p.jsx(Yt.Line,{fill:r.stroke,points:c.points,stroke:r.stroke,strokeWidth:r.strokeWidth,tension:.5,lineCap:"round",lineJoin:"round"},c.points.join(",")))}),p.jsx(Yt.Transformer,{ref:l,visible:n==="edit"&&t})]})}Gx.propTypes={activeTool:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,height:d.number,id:d.string,lines:d.arrayOf({points:d.arrayOf(d.number),stroke:d.string,strokeWidth:d.number,x:d.number,y:d.number}),rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,type:d.string,width:d.number,x:d.number,y:d.number}).isRequired};function qx({activeTool:n,displayMode:e,handleDragEnd:t,handleDragStart:r,isSelected:i,onShapeClick:o,onTransform:a,shape:s}){const l=m.useRef(null),u=m.useRef(null),[c,h]=m.useState(null);m.useEffect(()=>{i&&u.current&&l.current&&(u.current.nodes([l.current]),u.current.getLayer().batchDraw())},[i,c]),m.useEffect(()=>{const b=new window.Image;b.src=s.url,b.onload=()=>{h(b)}},[s.url]);const f=()=>{o(s)};return p.jsxs(p.Fragment,{children:[p.jsx(Yt.Image,{ref:l,scaleX:s.scaleX,scaleY:s.scaleY,rotation:s.rotation,x:s.x,y:s.y,image:c,id:s.id,draggable:n==="cursor"||n==="edit",onClick:f,onMousedown:f,onTransform:a,onDragEnd:t,onDragStart:r}),i&&p.jsx(Yt.Transformer,{rotateEnabled:e!=="image",ref:u,visible:n==="edit"})]})}qx.propTypes={activeTool:d.string.isRequired,displayMode:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,height:d.number,id:d.string,lines:d.arrayOf({points:d.arrayOf(d.number),stroke:d.string,strokeWidth:d.number,x:d.number,y:d.number}),rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,type:d.string,url:d.string,width:d.number,x:d.number,y:d.number}).isRequired};function Hx({activeTool:n,handleDragEnd:e,handleDragStart:t,isSelected:r,onShapeClick:i,onTransform:o,shape:a}){const s=m.useRef(),l=m.useRef();m.useEffect(()=>{l.current&&(l.current.nodes([s.current]),l.current.getLayer().batchDraw())},[r]);const u=()=>{i(a)};return p.jsxs(p.Fragment,{children:[p.jsx(Yt.Circle,{draggable:n==="cursor"||n==="edit",fill:a.fill,id:a.id,onClick:u,onDragEnd:e,onDragStart:t,onMousedown:u,onTransform:o,radius:a.radius,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}),p.jsx(Yt.Transformer,{ref:l,visible:n==="edit"&&r})]})}Hx.propTypes={activeTool:d.string.isRequired,baseStrokeWidth:d.number.isRequired,displayMode:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,height:d.number,id:d.string,radius:d.number,rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,type:d.string,url:d.string,width:d.number,x:d.number,y:d.number}).isRequired};function Vx({handleDragEnd:n,handleDragStart:e,onShapeClick:t,shape:r}){const i=()=>{t(r)};return p.jsx(Yt.Circle,{draggable:!0,fill:r.fill,id:r.id,onClick:i,onDragEnd:n,onDragStart:e,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})}Vx.propTypes={handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,onShapeClick:d.func.isRequired,shape:d.shape({fill:d.string,id:d.string,radius:d.number,rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,x:d.number,y:d.number}).isRequired};function Wx({activeTool:n,baseStrokeWidth:e,displayMode:t,handleDragEnd:r,handleDragStart:i,onShapeClick:o,onTransform:a,scale:s,selectedShapeId:l,shapes:u,trview:c}){const[h,f]=m.useState(null);m.useEffect(()=>{},[u,l]),m.useEffect(()=>{},[h]);const b=x=>{o(x),f(x)};return p.jsx(Yt.Layer,{scaleX:s,scaleY:s,children:u.map(x=>{const w=l===x.id&&c;switch(x.type){case Te.RECTANGLE:return m.createElement(kx,{activeTool:n,displayMode:t,handleDragEnd:r,handleDragStart:i,isSelected:w,onShapeClick:b,onTransform:a,shape:x,key:x.id,displayMode:t,baseStrokeWidth:e});case"text":return m.createElement(Px,{activeTool:n,handleDragEnd:r,handleDragStart:i,isSelected:w,onShapeClick:b,onTransform:a,shape:x,text:x.text,key:x.id});case Te.ELLIPSE:return m.createElement(Lx,{activeTool:n,handleDragEnd:r,handleDragStart:i,isSelected:w,onShapeClick:b,onTransform:a,shape:x,key:x.id,displayMode:t,baseStrokeWidth:e});case Te.CIRCLE:return m.createElement(Hx,{activeTool:n,handleDragEnd:r,handleDragStart:i,isSelected:w,onShapeClick:b,onTransform:a,shape:x,key:x.id,displayMode:t,baseStrokeWidth:e});case Te.POI:return m.createElement(Vx,{handleDragEnd:r,handleDragStart:i,onShapeClick:b,shape:x,key:x.id});case Te.FREEHAND:return m.createElement(Gx,{activeTool:n,handleDragEnd:r,handleDragStart:i,isSelected:w,onShapeClick:b,onTransform:a,shape:x,key:x.id});case Te.POLYGON:return m.createElement(Fx,{activeTool:n,handleDragEnd:r,handleDragStart:i,isSelected:w,onShapeClick:b,onTransform:a,shape:x,key:x.id,displayMode:t,baseStrokeWidth:e});case Te.ARROW:return m.createElement(Bx,{activeTool:n,handleDragEnd:r,handleDragStart:i,isSelected:w,onShapeClick:b,onTransform:a,shape:x,key:x.id});case It.IMAGE:return m.createElement(qx,{activeTool:n,displayMode:t,handleDragEnd:r,handleDragStart:i,isSelected:w,onShapeClick:b,onTransform:a,shape:x,key:x.id})}})})}Wx.propTypes={activeTool:d.string.isRequired,baseStrokeWidth:d.number.isRequired,displayMode:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,scale:d.number.isRequired,selectedShapeId:d.string,shapes:d.arrayOf(d.shape({id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,type:d.string,url:d.string,x:d.number,y:d.number})).isRequired,trview:d.bool.isRequired};function dp({displayMode:n,drawingState:e,playerReferences:t,scale:r,setColorToolFromCurrentShape:i,setDrawingState:o,setToolState:a,tabView:s,toolState:l,updateCurrentShapeInShapes:u,updateScale:c,windowId:h}){const[f,b]=m.useState(!1),[x,w]=m.useState(!1);m.useEffect(()=>{const E=t.media?.current;if(E&&typeof E.addHandler=="function"){const S=()=>c();return E.addHandler("animation",S),E.addHandler("resize",S),c(),()=>{E.removeHandler("animation",S),E.removeHandler("resize",S)}}c()},[t,c]),m.useEffect(()=>{if(l.imageEvent?.id&&!e.currentShape){const E={id:hn(),rotation:0,scaleX:.2,scaleY:.2,type:It.IMAGE,url:l.imageEvent.id,x:60,y:60};o({...e,currentShape:E,shapes:[...e.shapes,E]})}b(!1)},[l]);const g=E=>{if(E.stopPropagation(),!!e.currentShape){if(E.key==="Delete"||E.key==="Backspace"){const S=e.shapes.filter(I=>I.id!==e.currentShape.id);o({...e,currentShape:null,shapes:S}),a({...l,imageEvent:null});return}if(E.key==="Tab"){if(l.activeTool===It.IMAGE)return;l.activeTool===Te.POLYGON&&(e.currentShape.points.splice(-2,2),u({points:[e.currentShape.points],...e.currentShape})),o({...e,currentShape:null,isDrawing:!1});return}if(E.key==="Shift"){if(l.activeTool===Te.POLYGON&&e.isDrawing){e.currentShape.points.splice(-2,2);const S={...e.currentShape,closed:!0};u(S),o({...e,currentShape:S,isDrawing:!1}),b(!1)}return}if(e.currentShape.type==="text"){const S={...e.currentShape};o(I=>({...I,currentShape:S,shapes:I.shapes.map(P=>P.id===S.id?{...P,...S}:P)}))}}};m.useEffect(()=>{if(!f){const E=e[e.shapes.length-1];E&&u(E)}},[e]),m.useEffect(()=>{e.currentShape&&n!==sn.TARGET&&n!==sn.POI&&(e.currentShape.fill=l.fillColor,e.currentShape.stroke=l.strokeColor,e.currentShape.strokeWidth=l.strokeWidth,e.currentShape.text=l.text,u(e.currentShape))},[l]),m.useLayoutEffect(()=>{if(e.shapes.find(E=>E.id===e.currentShape?.id))return window.addEventListener("keydown",g),i({fillColor:e.currentShape.fill,strokeColor:e.currentShape.stroke,strokeWidth:e.currentShape.strokeWidth,text:e.currentShape.text}),()=>{window.removeEventListener("keydown",g)}},[e.currentShape]);const y=async E=>{if(l.activeTool!=="edit"&&l.activeTool!=="cursor"&&l.activeTool!=="delete")return;const S=e.shapes.find(I=>I.id===E.id);if(l.activeTool==="delete"){const I=e.shapes.filter(P=>P.id!==S.id);o({...e,currentShape:null,shapes:I});return}o({...e,currentShape:S}),i({fillColor:S.fill,strokeColor:S.stroke,strokeWidth:S.strokeWidth})},C=E=>{const S=E.target.attrs,I=e.shapes.find(P=>P.id===S.id);Object.assign(I,S),I.type===It.IMAGE&&(I.width=S.image.width*S.scaleX,I.height=S.image.height*S.scaleY),u(I),x||w(!0)},A=E=>{const S=E.currentTarget.attrs,I=e.shapes.find(P=>P.id===S.id);Object.assign(I,S),I.x=S.x,I.y=S.y,I.type===Te.IMAGE&&(I.width=S.image.width*S.scaleX,I.height=S.image.height*S.scaleY)},_=E=>{const S=E.currentTarget.attrs;o({...e,currentShape:e.shapes.find(I=>I.id===S.id)})},N=E=>[Te.RECTANGLE,Te.CIRCLE,Te.ELLIPSE,Te.POLYGON,Te.ARROW,Te.FREEHAND,Te.POI].includes(E)?"crosshair":"default",O=E=>{try{const S=E.target.getStage(),I=S.getRelativePointerPosition();I.x/=r,I.y/=r;let P=null;switch(l.activeTool){case Te.POI:if(E.target!==S)break;P={...Yo,id:hn(),radius:P1(t.getMediaTrueWidth(),t.getMediaTrueHeight()),rotation:0,scaleX:1,scaleY:1,type:l.activeTool,x:I.x,y:I.y},o({currentShape:P,isDrawing:!1,shapes:[P]});break;case Te.RECTANGLE:P={fill:l.fillColor,height:30,id:hn(),scaleX:1,scaleY:1,stroke:l.strokeColor,strokeWidth:l.strokeWidth,type:l.activeTool,width:30,x:I.x,y:I.y},o({currentShape:P,isDrawing:!0,shapes:[...e.shapes,P]});break;case Te.ELLIPSE:P={fill:l.fillColor,height:1,id:hn(),radiusX:1,radiusY:1,rotation:0,scaleX:1,scaleY:1,stroke:l.strokeColor,strokeWidth:l.strokeWidth,type:l.activeTool,width:1,x:I.x,y:I.y},o({currentShape:P,isDrawing:!0,shapes:[...e.shapes,P]});break;case Te.CIRCLE:P={fill:l.fillColor,height:1,id:hn(),radius:1,rotation:0,scaleX:1,scaleY:1,stroke:l.strokeColor,strokeWidth:l.strokeWidth,type:l.activeTool,width:1,x:I.x,y:I.y},o({currentShape:P,isDrawing:!0,shapes:[...e.shapes,P]});break;case It.TEXT:P={fill:l.fillColor,fontSize:20,id:hn(),rotation:0,scaleX:1,scaleY:1,text:"Change me",type:It.TEXT,x:I.x,y:I.y},o({...e,currentShape:P,shapes:[...e.shapes,P]});break;case Te.FREEHAND:P={fill:l.fillColor,id:hn(),lines:[{points:[I.x,I.y,I.x,I.y],stroke:l.strokeColor,strokeWidth:l.strokeWidth,x:0,y:0}],rotation:0,scaleX:1,scaleY:1,stroke:l.strokeColor,strokeWidth:l.strokeWidth,type:Te.FREEHAND,x:0,y:0},o({currentShape:P,isDrawing:!0,shapes:[...e.shapes,P]});break;case Te.POLYGON:if(e.isDrawing){const B=e.currentShape.points[0],F=e.currentShape.points[1],G=15/r;if(Math.sqrt((I.x-B)**2+(I.y-F)**2)<=G&&e.currentShape.points.length>6){const z={...e.currentShape,closed:!0};z.points.splice(-2,2),u(z),o({...e,currentShape:z,isDrawing:!1}),b(!1);break}e.currentShape.points.splice(-2,2,I.x,I.y),e.currentShape.points.push(I.x,I.y),u({points:[e.currentShape.points],...e.currentShape})}else P={fill:l.fillColor,id:hn(),points:[I.x,I.y,I.x,I.y],rotation:0,scaleX:1,scaleY:1,stroke:l.strokeColor,strokeWidth:l.strokeWidth,type:Te.POLYGON,x:0,y:0},o({currentShape:P,isDrawing:!0,shapes:[...e.shapes,P]}),b(!0);break;case Te.ARROW:P={fill:l.fillColor,id:hn(),pointerLength:20,pointerWidth:20,points:[I.x,I.y,I.x,I.y],rotation:0,scaleX:1,scaleY:1,stroke:l.strokeColor,strokeWidth:l.strokeWidth,type:Te.ARROW},o({currentShape:P,isDrawing:!0,shapes:[...e.shapes,P]});break;default:break}}catch(S){console.error("error",S)}},T=E=>{try{if(!e.isDrawing||!e.currentShape)return;const S=E.target.getStage().getRelativePointerPosition();switch(S.x/=r,S.y/=r,l.activeTool){case Te.RECTANGLE:u({...e.currentShape,height:S.y-e.currentShape.y,width:S.x-e.currentShape.x});break;case Te.ELLIPSE:S.x<e.currentShape.x&&(S.x=e.currentShape.x),S.y<e.currentShape.y&&(S.y=e.currentShape.y),u({...e.currentShape,height:S.y-e.currentShape.y,radiusX:(S.x-e.currentShape.x)/2,radiusY:(S.y-e.currentShape.y)/2,width:S.x-e.currentShape.x});break;case Te.CIRCLE:S.x<e.currentShape.x&&(S.x=e.currentShape.x),S.y<e.currentShape.y&&(S.y=e.currentShape.y);const I=Math.sqrt((S.x-e.currentShape.x)**2+(S.y-e.currentShape.y)**2);u({...e.currentShape,radius:I});break;case Te.FREEHAND:e.lines.push({points:[S.x,S.y,S.x,S.y],stroke:l.strokeColor,strokeWidth:l.strokeWidth}),u({...e.currentShape});break;case Te.POLYGON:e.currentShape.points.splice(-2,2,S.x,S.y),u({...e.currentShape});break;case Te.ARROW:u({...e.currentShape,fill:l.fillColor,points:[e.currentShape.points[0],e.currentShape.points[1],S.x,S.y],stroke:l.strokeColor,strokeWidth:l.strokeWidth}),b(!0);break;default:break}}catch(S){console.error("error",S)}},D=E=>{if(e.currentShape&&!x){const S=E.target.getStage();if(E.target===S){const P=e.currentShape.type;a(B=>({...B,activeTool:P}))}}l.activeTool!==Te.POLYGON&&(o({...e,isDrawing:!1}),[Te.RECTANGLE,Te.CIRCLE,Te.ELLIPSE].includes(l.activeTool)&&a({...l,activeTool:It.EDIT})),w(!1)},M=()=>p.jsx(Yt.Stage,{width:t.getDisplayedMediaWidth(),height:t.getDisplayedMediaHeight(),style:{cursor:N(l.activeTool),height:"auto",left:t.getImagePosition().x,objectFit:"contain",overflow:"clip",overflowClipMargin:"content-box",position:"absolute",top:t.getImagePosition().y},onMouseDown:O,onMouseUp:D,onMouseMove:T,id:h,children:p.jsx(Wx,{activeTool:l.activeTool,baseStrokeWidth:t.getTargetStrokeWidth(),displayMode:n,handleDragEnd:A,handleDragStart:_,onShapeClick:y,onTransform:C,scale:r,selectedShapeId:e.currentShape?.id,shapes:e.shapes,trview:s!=="target"})}),L=t.getContainer();return L?j1.createPortal(M(),L):p.jsx(p.Fragment,{})}const Em=d.shape({fill:d.string,id:d.string,lines:{pointerLength:d.number,points:d.arrayOf([d.number]),stroke:d.string,strokeWidth:d.number},pointerLength:d.number,pointerWidth:d.number,points:d.number,rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,text:d.string,type:d.string,url:d.string,x:d.number,y:d.number});dp.propTypes={displayMode:d.string.isRequired,drawingState:d.oneOfType([d.shape({currentShape:Em,isDrawing:d.bool,shapes:d.arrayOf(Em)}),d.arrayOf(d.shape({currentShape:d.shape({id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,type:d.string,url:d.string,x:d.number,y:d.number}),isDrawing:d.bool,shapes:d.arrayOf(d.shape({id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,type:d.string,url:d.string,x:d.number,y:d.number}))}))]).isRequired,playerReferences:d.object.isRequired,scale:d.number.isRequired,setColorToolFromCurrentShape:d.func.isRequired,setDrawingState:d.func.isRequired,setToolState:d.func.isRequired,tabView:d.string.isRequired,toolState:d.object.isRequired,updateCurrentShapeInShapes:d.func.isRequired,updateScale:d.func.isRequired,windowId:d.string.isRequired};const zx={defaultForm:{default:null,type:"string"},defaultTags:{default:[],type:"array"},editMode:{default:!1,type:"boolean"}},oI={array:n=>n?n.split(",").map(e=>e.trim()).filter(Boolean):[],boolean:n=>n==="true",number:n=>{const e=Number(n);return Number.isNaN(e)?null:e},string:n=>n||null};let Ls=null;function aI(){if(!Ls){const n=new URLSearchParams(window.location.search);Ls={},Object.entries(zx).forEach(([e,t])=>{const r=n.get(e);r!==null&&(Ls[e]=oI[t.type](r))})}return Ls}function gs(n){const e=aI(),t={};return Object.entries(zx).forEach(([r,i])=>{r in e?t[r]=e[r]:n?.annotation?.[r]!==void 0?t[r]=n.annotation[r]:t[r]=i.default}),t}function sI(n){return m.useMemo(()=>gs(n),[n])}const lI=at.createSvgIcon(p.jsx("path",{d:"M5 4v3h5.5v12h3V7H19V4z"}),"Title"),Xx=at.createSvgIcon(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"),Ux=at.createSvgIcon(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"),uI=at.createSvgIcon([p.jsx("path",{d:"m12 2-5.5 9h11z"},"0"),p.jsx("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),p.jsx("path",{d:"M3 13.5h8v8H3z"},"2")],"Category");function cI(n){return p.jsx(N1,{...n,children: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: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 "})})})}const dI=at.createSvgIcon(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"),wm=at.createSvgIcon(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"),hI=at.createSvgIcon(p.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward"),fI=at.createSvgIcon(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"),pI=at.createSvgIcon(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"),gI=q.styled("div")(({theme:n})=>({display:"flex",justifyContent:"flex-end",marginTop:"5px"})),mI=q.styled("div")(({theme:n})=>({alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"})),bI=q.styled(q.TextField)(({theme:n})=>({marginBottom:"0",marginTop:"0"}));function $x({imageUrl:n=null,isReadOnly:e,onAddImage:t,onChange:r,t:i}){const o=m.useRef(null),[a,s]=m.useState(!1),l=n===null?"":n;return m.useEffect(()=>{o.current?s(n&&o.current.checkValidity()):s(!!n)},[n]),p.jsx(mI,{children:e?p.jsxs(p.Fragment,{children:[p.jsx(Ne,{children:i("onlyOneImageAllowed")}),a&&p.jsx("img",{src:n,width:"100%",height:"auto",alt:i("loading_failed")})]}):p.jsxs(p.Fragment,{children:[p.jsx(Ne,{variant:"overline",children:i("add_image_from_url")}),p.jsx(bI,{value:l,onChange:u=>r(u.target.value),error:l!==""&&!a,margin:"dense",label:i("imageURL"),type:"url",fullWidth:!0,inputRef:o}),a&&p.jsxs(p.Fragment,{children:[p.jsx("img",{src:n,width:"100%",height:"auto",alt:i("loading_failed")}),p.jsx(gI,{children:p.jsx(q.Button,{variant:"contained",onClick:t,children:p.jsx(pI,{})})})]})]})})}$x.propTypes={imageUrl:d.string,isReadOnly:d.bool.isRequired,onAddImage:d.func.isRequired,onChange:d.func.isRequired,t:d.func.isRequired};const vI=at.createSvgIcon(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"),Hu=at.createSvgIcon(p.jsx("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown"),yI=at.createSvgIcon(p.jsx("path",{d:"M3 17h18v-2H3zm0 3h18v-1H3zm0-7h18v-3H3zm0-9v4h18V4z"}),"LineWeight"),xI=at.createSvgIcon(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");var Dn={},bo={},Vu,Am;function CI(){if(Am)return Vu;Am=1;var n=Ki(),e=ur(),t=ii(),r="[object String]";function i(o){return typeof o=="string"||!e(o)&&t(o)&&n(o)==r}return Vu=i,Vu}var Wu,_m;function EI(){if(_m)return Wu;_m=1;function n(e){return function(t,r,i){for(var o=-1,a=Object(t),s=i(t),l=s.length;l--;){var u=s[e?l:++o];if(r(a[u],u,a)===!1)break}return t}}return Wu=n,Wu}var zu,Tm;function wI(){if(Tm)return zu;Tm=1;var n=EI(),e=n();return zu=e,zu}var Xu,Im;function AI(){if(Im)return Xu;Im=1;function n(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}return Xu=n,Xu}var Ba={exports:{}},Uu,Sm;function _I(){if(Sm)return Uu;Sm=1;function n(){return!1}return Uu=n,Uu}Ba.exports;var Rm;function hp(){return Rm||(Rm=1,(function(n,e){var t=Wr(),r=_I(),i=e&&!e.nodeType&&e,o=i&&!0&&n&&!n.nodeType&&n,a=o&&o.exports===i,s=a?t.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;n.exports=u})(Ba,Ba.exports)),Ba.exports}var $u,Om;function Yx(){if(Om)return $u;Om=1;var n=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(r,i){var o=typeof r;return i=i??n,!!i&&(o=="number"||o!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<i}return $u=t,$u}var Yu,Nm;function fp(){if(Nm)return Yu;Nm=1;var n=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=n}return Yu=e,Yu}var Zu,jm;function TI(){if(jm)return Zu;jm=1;var n=Ki(),e=fp(),t=ii(),r="[object Arguments]",i="[object Array]",o="[object Boolean]",a="[object Date]",s="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",h="[object Object]",f="[object RegExp]",b="[object Set]",x="[object String]",w="[object WeakMap]",g="[object ArrayBuffer]",y="[object DataView]",C="[object Float32Array]",A="[object Float64Array]",_="[object Int8Array]",N="[object Int16Array]",O="[object Int32Array]",T="[object Uint8Array]",D="[object Uint8ClampedArray]",M="[object Uint16Array]",L="[object Uint32Array]",E={};E[C]=E[A]=E[_]=E[N]=E[O]=E[T]=E[D]=E[M]=E[L]=!0,E[r]=E[i]=E[g]=E[o]=E[y]=E[a]=E[s]=E[l]=E[u]=E[c]=E[h]=E[f]=E[b]=E[x]=E[w]=!1;function S(I){return t(I)&&e(I.length)&&!!E[n(I)]}return Zu=S,Zu}var Ju,Dm;function pp(){if(Dm)return Ju;Dm=1;function n(e){return function(t){return e(t)}}return Ju=n,Ju}var Fa={exports:{}};Fa.exports;var Mm;function gp(){return Mm||(Mm=1,(function(n,e){var t=K1(),r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,o=i&&i.exports===r,a=o&&t.process,s=(function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}})();n.exports=s})(Fa,Fa.exports)),Fa.exports}var Ku,km;function Zx(){if(km)return Ku;km=1;var n=TI(),e=pp(),t=gp(),r=t&&t.isTypedArray,i=r?e(r):n;return Ku=i,Ku}var Qu,Lm;function Jx(){if(Lm)return Qu;Lm=1;var n=AI(),e=ep(),t=ur(),r=hp(),i=Yx(),o=Zx(),a=Object.prototype,s=a.hasOwnProperty;function l(u,c){var h=t(u),f=!h&&e(u),b=!h&&!f&&r(u),x=!h&&!f&&!b&&o(u),w=h||f||b||x,g=w?n(u.length,String):[],y=g.length;for(var C in u)(c||s.call(u,C))&&!(w&&(C=="length"||b&&(C=="offset"||C=="parent")||x&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||i(C,y)))&&g.push(C);return g}return Qu=l,Qu}var ec,Pm;function mp(){if(Pm)return ec;Pm=1;var n=Object.prototype;function e(t){var r=t&&t.constructor,i=typeof r=="function"&&r.prototype||n;return t===i}return ec=e,ec}var tc,Bm;function Kx(){if(Bm)return tc;Bm=1;function n(e,t){return function(r){return e(t(r))}}return tc=n,tc}var nc,Fm;function II(){if(Fm)return nc;Fm=1;var n=Kx(),e=n(Object.keys,Object);return nc=e,nc}var rc,Gm;function SI(){if(Gm)return rc;Gm=1;var n=mp(),e=II(),t=Object.prototype,r=t.hasOwnProperty;function i(o){if(!n(o))return e(o);var a=[];for(var s in Object(o))r.call(o,s)&&s!="constructor"&&a.push(s);return a}return rc=i,rc}var ic,qm;function ca(){if(qm)return ic;qm=1;function n(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return ic=n,ic}var oc,Hm;function Qx(){if(Hm)return oc;Hm=1;var n=Ki(),e=ca(),t="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function a(s){if(!e(s))return!1;var l=n(s);return l==r||l==i||l==t||l==o}return oc=a,oc}var ac,Vm;function Bl(){if(Vm)return ac;Vm=1;var n=Qx(),e=fp();function t(r){return r!=null&&e(r.length)&&!n(r)}return ac=t,ac}var sc,Wm;function ms(){if(Wm)return sc;Wm=1;var n=Jx(),e=SI(),t=Bl();function r(i){return t(i)?n(i):e(i)}return sc=r,sc}var lc,zm;function eC(){if(zm)return lc;zm=1;var n=wI(),e=ms();function t(r,i){return r&&n(r,i,e)}return lc=t,lc}var uc,Xm;function tC(){if(Xm)return uc;Xm=1;function n(e){return e}return uc=n,uc}var cc,Um;function RI(){if(Um)return cc;Um=1;var n=tC();function e(t){return typeof t=="function"?t:n}return cc=e,cc}var dc,$m;function bp(){if($m)return dc;$m=1;var n=eC(),e=RI();function t(r,i){return r&&n(r,e(i))}return dc=t,dc}var hc,Ym;function vp(){if(Ym)return hc;Ym=1;var n=Kx(),e=n(Object.getPrototypeOf,Object);return hc=e,hc}var fc,Zm;function OI(){if(Zm)return fc;Zm=1;var n=Ki(),e=vp(),t=ii(),r="[object Object]",i=Function.prototype,o=Object.prototype,a=i.toString,s=o.hasOwnProperty,l=a.call(Object);function u(c){if(!t(c)||n(c)!=r)return!1;var h=e(c);if(h===null)return!0;var f=s.call(h,"constructor")&&h.constructor;return typeof f=="function"&&f instanceof f&&a.call(f)==l}return fc=u,fc}var pc,Jm;function nC(){if(Jm)return pc;Jm=1;function n(e,t){for(var r=-1,i=e==null?0:e.length,o=Array(i);++r<i;)o[r]=t(e[r],r,e);return o}return pc=n,pc}var gc,Km;function NI(){if(Km)return gc;Km=1;function n(){this.__data__=[],this.size=0}return gc=n,gc}var mc,Qm;function yp(){if(Qm)return mc;Qm=1;function n(e,t){return e===t||e!==e&&t!==t}return mc=n,mc}var bc,eb;function Fl(){if(eb)return bc;eb=1;var n=yp();function e(t,r){for(var i=t.length;i--;)if(n(t[i][0],r))return i;return-1}return bc=e,bc}var vc,tb;function jI(){if(tb)return vc;tb=1;var n=Fl(),e=Array.prototype,t=e.splice;function r(i){var o=this.__data__,a=n(o,i);if(a<0)return!1;var s=o.length-1;return a==s?o.pop():t.call(o,a,1),--this.size,!0}return vc=r,vc}var yc,nb;function DI(){if(nb)return yc;nb=1;var n=Fl();function e(t){var r=this.__data__,i=n(r,t);return i<0?void 0:r[i][1]}return yc=e,yc}var xc,rb;function MI(){if(rb)return xc;rb=1;var n=Fl();function e(t){return n(this.__data__,t)>-1}return xc=e,xc}var Cc,ib;function kI(){if(ib)return Cc;ib=1;var n=Fl();function e(t,r){var i=this.__data__,o=n(i,t);return o<0?(++this.size,i.push([t,r])):i[o][1]=r,this}return Cc=e,Cc}var Ec,ob;function Gl(){if(ob)return Ec;ob=1;var n=NI(),e=jI(),t=DI(),r=MI(),i=kI();function o(a){var s=-1,l=a==null?0:a.length;for(this.clear();++s<l;){var u=a[s];this.set(u[0],u[1])}}return o.prototype.clear=n,o.prototype.delete=e,o.prototype.get=t,o.prototype.has=r,o.prototype.set=i,Ec=o,Ec}var wc,ab;function LI(){if(ab)return wc;ab=1;var n=Gl();function e(){this.__data__=new n,this.size=0}return wc=e,wc}var Ac,sb;function PI(){if(sb)return Ac;sb=1;function n(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}return Ac=n,Ac}var _c,lb;function BI(){if(lb)return _c;lb=1;function n(e){return this.__data__.get(e)}return _c=n,_c}var Tc,ub;function FI(){if(ub)return Tc;ub=1;function n(e){return this.__data__.has(e)}return Tc=n,Tc}var Ic,cb;function GI(){if(cb)return Ic;cb=1;var n=Wr(),e=n["__core-js_shared__"];return Ic=e,Ic}var Sc,db;function qI(){if(db)return Sc;db=1;var n=GI(),e=(function(){var r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function t(r){return!!e&&e in r}return Sc=t,Sc}var Rc,hb;function rC(){if(hb)return Rc;hb=1;var n=Function.prototype,e=n.toString;function t(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return Rc=t,Rc}var Oc,fb;function HI(){if(fb)return Oc;fb=1;var n=Qx(),e=qI(),t=ca(),r=rC(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(f){if(!t(f)||e(f))return!1;var b=n(f)?c:o;return b.test(r(f))}return Oc=h,Oc}var Nc,pb;function VI(){if(pb)return Nc;pb=1;function n(e,t){return e?.[t]}return Nc=n,Nc}var jc,gb;function eo(){if(gb)return jc;gb=1;var n=HI(),e=VI();function t(r,i){var o=e(r,i);return n(o)?o:void 0}return jc=t,jc}var Dc,mb;function xp(){if(mb)return Dc;mb=1;var n=eo(),e=Wr(),t=n(e,"Map");return Dc=t,Dc}var Mc,bb;function ql(){if(bb)return Mc;bb=1;var n=eo(),e=n(Object,"create");return Mc=e,Mc}var kc,vb;function WI(){if(vb)return kc;vb=1;var n=ql();function e(){this.__data__=n?n(null):{},this.size=0}return kc=e,kc}var Lc,yb;function zI(){if(yb)return Lc;yb=1;function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Lc=n,Lc}var Pc,xb;function XI(){if(xb)return Pc;xb=1;var n=ql(),e="__lodash_hash_undefined__",t=Object.prototype,r=t.hasOwnProperty;function i(o){var a=this.__data__;if(n){var s=a[o];return s===e?void 0:s}return r.call(a,o)?a[o]:void 0}return Pc=i,Pc}var Bc,Cb;function UI(){if(Cb)return Bc;Cb=1;var n=ql(),e=Object.prototype,t=e.hasOwnProperty;function r(i){var o=this.__data__;return n?o[i]!==void 0:t.call(o,i)}return Bc=r,Bc}var Fc,Eb;function $I(){if(Eb)return Fc;Eb=1;var n=ql(),e="__lodash_hash_undefined__";function t(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=n&&i===void 0?e:i,this}return Fc=t,Fc}var Gc,wb;function YI(){if(wb)return Gc;wb=1;var n=WI(),e=zI(),t=XI(),r=UI(),i=$I();function o(a){var s=-1,l=a==null?0:a.length;for(this.clear();++s<l;){var u=a[s];this.set(u[0],u[1])}}return o.prototype.clear=n,o.prototype.delete=e,o.prototype.get=t,o.prototype.has=r,o.prototype.set=i,Gc=o,Gc}var qc,Ab;function ZI(){if(Ab)return qc;Ab=1;var n=YI(),e=Gl(),t=xp();function r(){this.size=0,this.__data__={hash:new n,map:new(t||e),string:new n}}return qc=r,qc}var Hc,_b;function JI(){if(_b)return Hc;_b=1;function n(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Hc=n,Hc}var Vc,Tb;function Hl(){if(Tb)return Vc;Tb=1;var n=JI();function e(t,r){var i=t.__data__;return n(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Vc=e,Vc}var Wc,Ib;function KI(){if(Ib)return Wc;Ib=1;var n=Hl();function e(t){var r=n(this,t).delete(t);return this.size-=r?1:0,r}return Wc=e,Wc}var zc,Sb;function QI(){if(Sb)return zc;Sb=1;var n=Hl();function e(t){return n(this,t).get(t)}return zc=e,zc}var Xc,Rb;function eS(){if(Rb)return Xc;Rb=1;var n=Hl();function e(t){return n(this,t).has(t)}return Xc=e,Xc}var Uc,Ob;function tS(){if(Ob)return Uc;Ob=1;var n=Hl();function e(t,r){var i=n(this,t),o=i.size;return i.set(t,r),this.size+=i.size==o?0:1,this}return Uc=e,Uc}var $c,Nb;function Cp(){if(Nb)return $c;Nb=1;var n=ZI(),e=KI(),t=QI(),r=eS(),i=tS();function o(a){var s=-1,l=a==null?0:a.length;for(this.clear();++s<l;){var u=a[s];this.set(u[0],u[1])}}return o.prototype.clear=n,o.prototype.delete=e,o.prototype.get=t,o.prototype.has=r,o.prototype.set=i,$c=o,$c}var Yc,jb;function nS(){if(jb)return Yc;jb=1;var n=Gl(),e=xp(),t=Cp(),r=200;function i(o,a){var s=this.__data__;if(s instanceof n){var l=s.__data__;if(!e||l.length<r-1)return l.push([o,a]),this.size=++s.size,this;s=this.__data__=new t(l)}return s.set(o,a),this.size=s.size,this}return Yc=i,Yc}var Zc,Db;function Ep(){if(Db)return Zc;Db=1;var n=Gl(),e=LI(),t=PI(),r=BI(),i=FI(),o=nS();function a(s){var l=this.__data__=new n(s);this.size=l.size}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=i,a.prototype.set=o,Zc=a,Zc}var Jc,Mb;function rS(){if(Mb)return Jc;Mb=1;var n="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,n),this}return Jc=e,Jc}var Kc,kb;function iS(){if(kb)return Kc;kb=1;function n(e){return this.__data__.has(e)}return Kc=n,Kc}var Qc,Lb;function oS(){if(Lb)return Qc;Lb=1;var n=Cp(),e=rS(),t=iS();function r(i){var o=-1,a=i==null?0:i.length;for(this.__data__=new n;++o<a;)this.add(i[o])}return r.prototype.add=r.prototype.push=e,r.prototype.has=t,Qc=r,Qc}var ed,Pb;function aS(){if(Pb)return ed;Pb=1;function n(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}return ed=n,ed}var td,Bb;function sS(){if(Bb)return td;Bb=1;function n(e,t){return e.has(t)}return td=n,td}var nd,Fb;function iC(){if(Fb)return nd;Fb=1;var n=oS(),e=aS(),t=sS(),r=1,i=2;function o(a,s,l,u,c,h){var f=l&r,b=a.length,x=s.length;if(b!=x&&!(f&&x>b))return!1;var w=h.get(a),g=h.get(s);if(w&&g)return w==s&&g==a;var y=-1,C=!0,A=l&i?new n:void 0;for(h.set(a,s),h.set(s,a);++y<b;){var _=a[y],N=s[y];if(u)var O=f?u(N,_,y,s,a,h):u(_,N,y,a,s,h);if(O!==void 0){if(O)continue;C=!1;break}if(A){if(!e(s,function(T,D){if(!t(A,D)&&(_===T||c(_,T,l,u,h)))return A.push(D)})){C=!1;break}}else if(!(_===N||c(_,N,l,u,h))){C=!1;break}}return h.delete(a),h.delete(s),C}return nd=o,nd}var rd,Gb;function oC(){if(Gb)return rd;Gb=1;var n=Wr(),e=n.Uint8Array;return rd=e,rd}var id,qb;function lS(){if(qb)return id;qb=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i,o){r[++t]=[o,i]}),r}return id=n,id}var od,Hb;function uS(){if(Hb)return od;Hb=1;function n(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}return od=n,od}var ad,Vb;function cS(){if(Vb)return ad;Vb=1;var n=ua(),e=oC(),t=yp(),r=iC(),i=lS(),o=uS(),a=1,s=2,l="[object Boolean]",u="[object Date]",c="[object Error]",h="[object Map]",f="[object Number]",b="[object RegExp]",x="[object Set]",w="[object String]",g="[object Symbol]",y="[object ArrayBuffer]",C="[object DataView]",A=n?n.prototype:void 0,_=A?A.valueOf:void 0;function N(O,T,D,M,L,E,S){switch(D){case C:if(O.byteLength!=T.byteLength||O.byteOffset!=T.byteOffset)return!1;O=O.buffer,T=T.buffer;case y:return!(O.byteLength!=T.byteLength||!E(new e(O),new e(T)));case l:case u:case f:return t(+O,+T);case c:return O.name==T.name&&O.message==T.message;case b:case w:return O==T+"";case h:var I=i;case x:var P=M&a;if(I||(I=o),O.size!=T.size&&!P)return!1;var B=S.get(O);if(B)return B==T;M|=s,S.set(O,T);var F=r(I(O),I(T),M,L,E,S);return S.delete(O),F;case g:if(_)return _.call(O)==_.call(T)}return!1}return ad=N,ad}var sd,Wb;function aC(){if(Wb)return sd;Wb=1;var n=Qf(),e=ur();function t(r,i,o){var a=i(r);return e(r)?a:n(a,o(r))}return sd=t,sd}var ld,zb;function dS(){if(zb)return ld;zb=1;function n(e,t){for(var r=-1,i=e==null?0:e.length,o=0,a=[];++r<i;){var s=e[r];t(s,r,e)&&(a[o++]=s)}return a}return ld=n,ld}var ud,Xb;function sC(){if(Xb)return ud;Xb=1;function n(){return[]}return ud=n,ud}var cd,Ub;function wp(){if(Ub)return cd;Ub=1;var n=dS(),e=sC(),t=Object.prototype,r=t.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(a){return a==null?[]:(a=Object(a),n(i(a),function(s){return r.call(a,s)}))}:e;return cd=o,cd}var dd,$b;function lC(){if($b)return dd;$b=1;var n=aC(),e=wp(),t=ms();function r(i){return n(i,t,e)}return dd=r,dd}var hd,Yb;function hS(){if(Yb)return hd;Yb=1;var n=lC(),e=1,t=Object.prototype,r=t.hasOwnProperty;function i(o,a,s,l,u,c){var h=s&e,f=n(o),b=f.length,x=n(a),w=x.length;if(b!=w&&!h)return!1;for(var g=b;g--;){var y=f[g];if(!(h?y in a:r.call(a,y)))return!1}var C=c.get(o),A=c.get(a);if(C&&A)return C==a&&A==o;var _=!0;c.set(o,a),c.set(a,o);for(var N=h;++g<b;){y=f[g];var O=o[y],T=a[y];if(l)var D=h?l(T,O,y,a,o,c):l(O,T,y,o,a,c);if(!(D===void 0?O===T||u(O,T,s,l,c):D)){_=!1;break}N||(N=y=="constructor")}if(_&&!N){var M=o.constructor,L=a.constructor;M!=L&&"constructor"in o&&"constructor"in a&&!(typeof M=="function"&&M instanceof M&&typeof L=="function"&&L instanceof L)&&(_=!1)}return c.delete(o),c.delete(a),_}return hd=i,hd}var fd,Zb;function fS(){if(Zb)return fd;Zb=1;var n=eo(),e=Wr(),t=n(e,"DataView");return fd=t,fd}var pd,Jb;function pS(){if(Jb)return pd;Jb=1;var n=eo(),e=Wr(),t=n(e,"Promise");return pd=t,pd}var gd,Kb;function gS(){if(Kb)return gd;Kb=1;var n=eo(),e=Wr(),t=n(e,"Set");return gd=t,gd}var md,Qb;function mS(){if(Qb)return md;Qb=1;var n=eo(),e=Wr(),t=n(e,"WeakMap");return md=t,md}var bd,ev;function Vl(){if(ev)return bd;ev=1;var n=fS(),e=xp(),t=pS(),r=gS(),i=mS(),o=Ki(),a=rC(),s="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",h="[object WeakMap]",f="[object DataView]",b=a(n),x=a(e),w=a(t),g=a(r),y=a(i),C=o;return(n&&C(new n(new ArrayBuffer(1)))!=f||e&&C(new e)!=s||t&&C(t.resolve())!=u||r&&C(new r)!=c||i&&C(new i)!=h)&&(C=function(A){var _=o(A),N=_==l?A.constructor:void 0,O=N?a(N):"";if(O)switch(O){case b:return f;case x:return s;case w:return u;case g:return c;case y:return h}return _}),bd=C,bd}var vd,tv;function bS(){if(tv)return vd;tv=1;var n=Ep(),e=iC(),t=cS(),r=hS(),i=Vl(),o=ur(),a=hp(),s=Zx(),l=1,u="[object Arguments]",c="[object Array]",h="[object Object]",f=Object.prototype,b=f.hasOwnProperty;function x(w,g,y,C,A,_){var N=o(w),O=o(g),T=N?c:i(w),D=O?c:i(g);T=T==u?h:T,D=D==u?h:D;var M=T==h,L=D==h,E=T==D;if(E&&a(w)){if(!a(g))return!1;N=!0,M=!1}if(E&&!M)return _||(_=new n),N||s(w)?e(w,g,y,C,A,_):t(w,g,T,y,C,A,_);if(!(y&l)){var S=M&&b.call(w,"__wrapped__"),I=L&&b.call(g,"__wrapped__");if(S||I){var P=S?w.value():w,B=I?g.value():g;return _||(_=new n),A(P,B,y,C,_)}}return E?(_||(_=new n),r(w,g,y,C,A,_)):!1}return vd=x,vd}var yd,nv;function uC(){if(nv)return yd;nv=1;var n=bS(),e=ii();function t(r,i,o,a,s){return r===i?!0:r==null||i==null||!e(r)&&!e(i)?r!==r&&i!==i:n(r,i,o,a,t,s)}return yd=t,yd}var xd,rv;function vS(){if(rv)return xd;rv=1;var n=Ep(),e=uC(),t=1,r=2;function i(o,a,s,l){var u=s.length,c=u,h=!l;if(o==null)return!c;for(o=Object(o);u--;){var f=s[u];if(h&&f[2]?f[1]!==o[f[0]]:!(f[0]in o))return!1}for(;++u<c;){f=s[u];var b=f[0],x=o[b],w=f[1];if(h&&f[2]){if(x===void 0&&!(b in o))return!1}else{var g=new n;if(l)var y=l(x,w,b,o,a,g);if(!(y===void 0?e(w,x,t|r,l,g):y))return!1}}return!0}return xd=i,xd}var Cd,iv;function cC(){if(iv)return Cd;iv=1;var n=ca();function e(t){return t===t&&!n(t)}return Cd=e,Cd}var Ed,ov;function yS(){if(ov)return Ed;ov=1;var n=cC(),e=ms();function t(r){for(var i=e(r),o=i.length;o--;){var a=i[o],s=r[a];i[o]=[a,s,n(s)]}return i}return Ed=t,Ed}var wd,av;function dC(){if(av)return wd;av=1;function n(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}return wd=n,wd}var Ad,sv;function xS(){if(sv)return Ad;sv=1;var n=vS(),e=yS(),t=dC();function r(i){var o=e(i);return o.length==1&&o[0][2]?t(o[0][0],o[0][1]):function(a){return a===i||n(a,i,o)}}return Ad=r,Ad}var _d,lv;function Ap(){if(lv)return _d;lv=1;var n=Ki(),e=ii(),t="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&n(i)==t}return _d=r,_d}var Td,uv;function _p(){if(uv)return Td;uv=1;var n=ur(),e=Ap(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,a){if(n(o))return!1;var s=typeof o;return s=="number"||s=="symbol"||s=="boolean"||o==null||e(o)?!0:r.test(o)||!t.test(o)||a!=null&&o in Object(a)}return Td=i,Td}var Id,cv;function CS(){if(cv)return Id;cv=1;var n=Cp(),e="Expected a function";function t(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var o=function(){var a=arguments,s=i?i.apply(this,a):a[0],l=o.cache;if(l.has(s))return l.get(s);var u=r.apply(this,a);return o.cache=l.set(s,u)||l,u};return o.cache=new(t.Cache||n),o}return t.Cache=n,Id=t,Id}var Sd,dv;function ES(){if(dv)return Sd;dv=1;var n=CS(),e=500;function t(r){var i=n(r,function(a){return o.size===e&&o.clear(),a}),o=i.cache;return i}return Sd=t,Sd}var Rd,hv;function wS(){if(hv)return Rd;hv=1;var n=ES(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,r=n(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(e,function(a,s,l,u){o.push(l?u.replace(t,"$1"):s||a)}),o});return Rd=r,Rd}var Od,fv;function AS(){if(fv)return Od;fv=1;var n=ua(),e=nC(),t=ur(),r=Ap(),i=n?n.prototype:void 0,o=i?i.toString:void 0;function a(s){if(typeof s=="string")return s;if(t(s))return e(s,a)+"";if(r(s))return o?o.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return Od=a,Od}var Nd,pv;function _S(){if(pv)return Nd;pv=1;var n=AS();function e(t){return t==null?"":n(t)}return Nd=e,Nd}var jd,gv;function hC(){if(gv)return jd;gv=1;var n=ur(),e=_p(),t=wS(),r=_S();function i(o,a){return n(o)?o:e(o,a)?[o]:t(r(o))}return jd=i,jd}var Dd,mv;function Wl(){if(mv)return Dd;mv=1;var n=Ap();function e(t){if(typeof t=="string"||n(t))return t;var r=t+"";return r=="0"&&1/t==-1/0?"-0":r}return Dd=e,Dd}var Md,bv;function fC(){if(bv)return Md;bv=1;var n=hC(),e=Wl();function t(r,i){i=n(i,r);for(var o=0,a=i.length;r!=null&&o<a;)r=r[e(i[o++])];return o&&o==a?r:void 0}return Md=t,Md}var kd,vv;function TS(){if(vv)return kd;vv=1;var n=fC();function e(t,r,i){var o=t==null?void 0:n(t,r);return o===void 0?i:o}return kd=e,kd}var Ld,yv;function IS(){if(yv)return Ld;yv=1;function n(e,t){return e!=null&&t in Object(e)}return Ld=n,Ld}var Pd,xv;function SS(){if(xv)return Pd;xv=1;var n=hC(),e=ep(),t=ur(),r=Yx(),i=fp(),o=Wl();function a(s,l,u){l=n(l,s);for(var c=-1,h=l.length,f=!1;++c<h;){var b=o(l[c]);if(!(f=s!=null&&u(s,b)))break;s=s[b]}return f||++c!=h?f:(h=s==null?0:s.length,!!h&&i(h)&&r(b,h)&&(t(s)||e(s)))}return Pd=a,Pd}var Bd,Cv;function RS(){if(Cv)return Bd;Cv=1;var n=IS(),e=SS();function t(r,i){return r!=null&&e(r,i,n)}return Bd=t,Bd}var Fd,Ev;function OS(){if(Ev)return Fd;Ev=1;var n=uC(),e=TS(),t=RS(),r=_p(),i=cC(),o=dC(),a=Wl(),s=1,l=2;function u(c,h){return r(c)&&i(h)?o(a(c),h):function(f){var b=e(f,c);return b===void 0&&b===h?t(f,c):n(h,b,s|l)}}return Fd=u,Fd}var Gd,wv;function NS(){if(wv)return Gd;wv=1;function n(e){return function(t){return t?.[e]}}return Gd=n,Gd}var qd,Av;function jS(){if(Av)return qd;Av=1;var n=fC();function e(t){return function(r){return n(r,t)}}return qd=e,qd}var Hd,_v;function DS(){if(_v)return Hd;_v=1;var n=NS(),e=jS(),t=_p(),r=Wl();function i(o){return t(o)?n(r(o)):e(o)}return Hd=i,Hd}var Vd,Tv;function MS(){if(Tv)return Vd;Tv=1;var n=xS(),e=OS(),t=tC(),r=ur(),i=DS();function o(a){return typeof a=="function"?a:a==null?t:typeof a=="object"?r(a)?e(a[0],a[1]):n(a):i(a)}return Vd=o,Vd}var Wd,Iv;function kS(){if(Iv)return Wd;Iv=1;var n=Bl();function e(t,r){return function(i,o){if(i==null)return i;if(!n(i))return t(i,o);for(var a=i.length,s=r?a:-1,l=Object(i);(r?s--:++s<a)&&o(l[s],s,l)!==!1;);return i}}return Wd=e,Wd}var zd,Sv;function LS(){if(Sv)return zd;Sv=1;var n=eC(),e=kS(),t=e(n);return zd=t,zd}var Xd,Rv;function PS(){if(Rv)return Xd;Rv=1;var n=LS(),e=Bl();function t(r,i){var o=-1,a=e(r)?Array(r.length):[];return n(r,function(s,l,u){a[++o]=i(s,l,u)}),a}return Xd=t,Xd}var Ud,Ov;function BS(){if(Ov)return Ud;Ov=1;var n=nC(),e=MS(),t=PS(),r=ur();function i(o,a){var s=r(o)?n:t;return s(o,e(a,3))}return Ud=i,Ud}var Nv;function FS(){if(Nv)return bo;Nv=1,Object.defineProperty(bo,"__esModule",{value:!0}),bo.flattenNames=void 0;var n=CI(),e=l(n),t=bp(),r=l(t),i=OI(),o=l(i),a=BS(),s=l(a);function l(c){return c&&c.__esModule?c:{default:c}}var u=bo.flattenNames=function c(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],f=[];return(0,s.default)(h,function(b){Array.isArray(b)?c(b).map(function(x){return f.push(x)}):(0,o.default)(b)?(0,r.default)(b,function(x,w){x===!0&&f.push(w),f.push(w+"-"+x)}):(0,e.default)(b)&&f.push(b)}),f};return bo.default=u,bo}var vo={},$d,jv;function GS(){if(jv)return $d;jv=1;function n(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}return $d=n,$d}var Yd,Dv;function qS(){if(Dv)return Yd;Dv=1;var n=eo(),e=(function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Yd=e,Yd}var Zd,Mv;function pC(){if(Mv)return Zd;Mv=1;var n=qS();function e(t,r,i){r=="__proto__"&&n?n(t,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[r]=i}return Zd=e,Zd}var Jd,kv;function gC(){if(kv)return Jd;kv=1;var n=pC(),e=yp(),t=Object.prototype,r=t.hasOwnProperty;function i(o,a,s){var l=o[a];(!(r.call(o,a)&&e(l,s))||s===void 0&&!(a in o))&&n(o,a,s)}return Jd=i,Jd}var Kd,Lv;function zl(){if(Lv)return Kd;Lv=1;var n=gC(),e=pC();function t(r,i,o,a){var s=!o;o||(o={});for(var l=-1,u=i.length;++l<u;){var c=i[l],h=a?a(o[c],r[c],c,o,r):void 0;h===void 0&&(h=r[c]),s?e(o,c,h):n(o,c,h)}return o}return Kd=t,Kd}var Qd,Pv;function HS(){if(Pv)return Qd;Pv=1;var n=zl(),e=ms();function t(r,i){return r&&n(i,e(i),r)}return Qd=t,Qd}var eh,Bv;function VS(){if(Bv)return eh;Bv=1;function n(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}return eh=n,eh}var th,Fv;function WS(){if(Fv)return th;Fv=1;var n=ca(),e=mp(),t=VS(),r=Object.prototype,i=r.hasOwnProperty;function o(a){if(!n(a))return t(a);var s=e(a),l=[];for(var u in a)u=="constructor"&&(s||!i.call(a,u))||l.push(u);return l}return th=o,th}var nh,Gv;function Tp(){if(Gv)return nh;Gv=1;var n=Jx(),e=WS(),t=Bl();function r(i){return t(i)?n(i,!0):e(i)}return nh=r,nh}var rh,qv;function zS(){if(qv)return rh;qv=1;var n=zl(),e=Tp();function t(r,i){return r&&n(i,e(i),r)}return rh=t,rh}var Ga={exports:{}};Ga.exports;var Hv;function XS(){return Hv||(Hv=1,(function(n,e){var t=Wr(),r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,o=i&&i.exports===r,a=o?t.Buffer:void 0,s=a?a.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var h=u.length,f=s?s(h):new u.constructor(h);return u.copy(f),f}n.exports=l})(Ga,Ga.exports)),Ga.exports}var ih,Vv;function US(){if(Vv)return ih;Vv=1;function n(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}return ih=n,ih}var oh,Wv;function $S(){if(Wv)return oh;Wv=1;var n=zl(),e=wp();function t(r,i){return n(r,e(r),i)}return oh=t,oh}var ah,zv;function mC(){if(zv)return ah;zv=1;var n=Qf(),e=vp(),t=wp(),r=sC(),i=Object.getOwnPropertySymbols,o=i?function(a){for(var s=[];a;)n(s,t(a)),a=e(a);return s}:r;return ah=o,ah}var sh,Xv;function YS(){if(Xv)return sh;Xv=1;var n=zl(),e=mC();function t(r,i){return n(r,e(r),i)}return sh=t,sh}var lh,Uv;function ZS(){if(Uv)return lh;Uv=1;var n=aC(),e=mC(),t=Tp();function r(i){return n(i,t,e)}return lh=r,lh}var uh,$v;function JS(){if($v)return uh;$v=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&e.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return uh=t,uh}var ch,Yv;function Ip(){if(Yv)return ch;Yv=1;var n=oC();function e(t){var r=new t.constructor(t.byteLength);return new n(r).set(new n(t)),r}return ch=e,ch}var dh,Zv;function KS(){if(Zv)return dh;Zv=1;var n=Ip();function e(t,r){var i=r?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}return dh=e,dh}var hh,Jv;function QS(){if(Jv)return hh;Jv=1;var n=/\w*$/;function e(t){var r=new t.constructor(t.source,n.exec(t));return r.lastIndex=t.lastIndex,r}return hh=e,hh}var fh,Kv;function e2(){if(Kv)return fh;Kv=1;var n=ua(),e=n?n.prototype:void 0,t=e?e.valueOf:void 0;function r(i){return t?Object(t.call(i)):{}}return fh=r,fh}var ph,Qv;function t2(){if(Qv)return ph;Qv=1;var n=Ip();function e(t,r){var i=r?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}return ph=e,ph}var gh,e0;function n2(){if(e0)return gh;e0=1;var n=Ip(),e=KS(),t=QS(),r=e2(),i=t2(),o="[object Boolean]",a="[object Date]",s="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",h="[object String]",f="[object Symbol]",b="[object ArrayBuffer]",x="[object DataView]",w="[object Float32Array]",g="[object Float64Array]",y="[object Int8Array]",C="[object Int16Array]",A="[object Int32Array]",_="[object Uint8Array]",N="[object Uint8ClampedArray]",O="[object Uint16Array]",T="[object Uint32Array]";function D(M,L,E){var S=M.constructor;switch(L){case b:return n(M);case o:case a:return new S(+M);case x:return e(M,E);case w:case g:case y:case C:case A:case _:case N:case O:case T:return i(M,E);case s:return new S;case l:case h:return new S(M);case u:return t(M);case c:return new S;case f:return r(M)}}return gh=D,gh}var mh,t0;function r2(){if(t0)return mh;t0=1;var n=ca(),e=Object.create,t=(function(){function r(){}return function(i){if(!n(i))return{};if(e)return e(i);r.prototype=i;var o=new r;return r.prototype=void 0,o}})();return mh=t,mh}var bh,n0;function i2(){if(n0)return bh;n0=1;var n=r2(),e=vp(),t=mp();function r(i){return typeof i.constructor=="function"&&!t(i)?n(e(i)):{}}return bh=r,bh}var vh,r0;function o2(){if(r0)return vh;r0=1;var n=Vl(),e=ii(),t="[object Map]";function r(i){return e(i)&&n(i)==t}return vh=r,vh}var yh,i0;function a2(){if(i0)return yh;i0=1;var n=o2(),e=pp(),t=gp(),r=t&&t.isMap,i=r?e(r):n;return yh=i,yh}var xh,o0;function s2(){if(o0)return xh;o0=1;var n=Vl(),e=ii(),t="[object Set]";function r(i){return e(i)&&n(i)==t}return xh=r,xh}var Ch,a0;function l2(){if(a0)return Ch;a0=1;var n=s2(),e=pp(),t=gp(),r=t&&t.isSet,i=r?e(r):n;return Ch=i,Ch}var Eh,s0;function u2(){if(s0)return Eh;s0=1;var n=Ep(),e=GS(),t=gC(),r=HS(),i=zS(),o=XS(),a=US(),s=$S(),l=YS(),u=lC(),c=ZS(),h=Vl(),f=JS(),b=n2(),x=i2(),w=ur(),g=hp(),y=a2(),C=ca(),A=l2(),_=ms(),N=Tp(),O=1,T=2,D=4,M="[object Arguments]",L="[object Array]",E="[object Boolean]",S="[object Date]",I="[object Error]",P="[object Function]",B="[object GeneratorFunction]",F="[object Map]",G="[object Number]",V="[object Object]",z="[object RegExp]",W="[object Set]",J="[object String]",Y="[object Symbol]",ee="[object WeakMap]",K="[object ArrayBuffer]",X="[object DataView]",ie="[object Float32Array]",de="[object Float64Array]",oe="[object Int8Array]",me="[object Int16Array]",je="[object Int32Array]",Le="[object Uint8Array]",De="[object Uint8ClampedArray]",He="[object Uint16Array]",ve="[object Uint32Array]",se={};se[M]=se[L]=se[K]=se[X]=se[E]=se[S]=se[ie]=se[de]=se[oe]=se[me]=se[je]=se[F]=se[G]=se[V]=se[z]=se[W]=se[J]=se[Y]=se[Le]=se[De]=se[He]=se[ve]=!0,se[I]=se[P]=se[ee]=!1;function Me(Re,tt,Ie,Ye,Ue,wt){var Ke,gt=tt&O,Ot=tt&T,kt=tt&D;if(Ie&&(Ke=Ue?Ie(Re,Ye,Ue,wt):Ie(Re)),Ke!==void 0)return Ke;if(!C(Re))return Re;var yt=w(Re);if(yt){if(Ke=f(Re),!gt)return a(Re,Ke)}else{var it=h(Re),mt=it==P||it==B;if(g(Re))return o(Re,gt);if(it==V||it==M||mt&&!Ue){if(Ke=Ot||mt?{}:x(Re),!gt)return Ot?l(Re,i(Ke,Re)):s(Re,r(Ke,Re))}else{if(!se[it])return Ue?Re:{};Ke=b(Re,it,gt)}}wt||(wt=new n);var pt=wt.get(Re);if(pt)return pt;wt.set(Re,Ke),A(Re)?Re.forEach(function(st){Ke.add(Me(st,tt,Ie,st,Re,wt))}):y(Re)&&Re.forEach(function(st,lt){Ke.set(lt,Me(st,tt,Ie,lt,Re,wt))});var xt=kt?Ot?c:u:Ot?N:_,en=yt?void 0:xt(Re);return e(en||Re,function(st,lt){en&&(lt=st,st=Re[lt]),t(Ke,lt,Me(st,tt,Ie,lt,Re,wt))}),Ke}return Eh=Me,Eh}var wh,l0;function c2(){if(l0)return wh;l0=1;var n=u2(),e=1,t=4;function r(i){return n(i,e|t)}return wh=r,wh}var u0;function d2(){if(u0)return vo;u0=1,Object.defineProperty(vo,"__esModule",{value:!0}),vo.mergeClasses=void 0;var n=bp(),e=o(n),t=c2(),r=o(t),i=Object.assign||function(s){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(s[c]=u[c])}return s};function o(s){return s&&s.__esModule?s:{default:s}}var a=vo.mergeClasses=function(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=l.default&&(0,r.default)(l.default)||{};return u.map(function(h){var f=l[h];return f&&(0,e.default)(f,function(b,x){c[x]||(c[x]={}),c[x]=i({},c[x],f[x])}),h}),c};return vo.default=a,vo}var yo={},c0;function h2(){if(c0)return yo;c0=1,Object.defineProperty(yo,"__esModule",{value:!0}),yo.autoprefix=void 0;var n=bp(),e=r(n),t=Object.assign||function(a){for(var s=1;s<arguments.length;s++){var l=arguments[s];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a};function r(a){return a&&a.__esModule?a:{default:a}}var i={borderRadius:function(s){return{msBorderRadius:s,MozBorderRadius:s,OBorderRadius:s,WebkitBorderRadius:s,borderRadius:s}},boxShadow:function(s){return{msBoxShadow:s,MozBoxShadow:s,OBoxShadow:s,WebkitBoxShadow:s,boxShadow:s}},userSelect:function(s){return{WebkitTouchCallout:s,KhtmlUserSelect:s,MozUserSelect:s,msUserSelect:s,WebkitUserSelect:s,userSelect:s}},flex:function(s){return{WebkitBoxFlex:s,MozBoxFlex:s,WebkitFlex:s,msFlex:s,flex:s}},flexBasis:function(s){return{WebkitFlexBasis:s,flexBasis:s}},justifyContent:function(s){return{WebkitJustifyContent:s,justifyContent:s}},transition:function(s){return{msTransition:s,MozTransition:s,OTransition:s,WebkitTransition:s,transition:s}},transform:function(s){return{msTransform:s,MozTransform:s,OTransform:s,WebkitTransform:s,transform:s}},absolute:function(s){var l=s&&s.split(" ");return{position:"absolute",top:l&&l[0],right:l&&l[1],bottom:l&&l[2],left:l&&l[3]}},extend:function(s,l){var u=l[s];return u||{extend:s}}},o=yo.autoprefix=function(s){var l={};return(0,e.default)(s,function(u,c){var h={};(0,e.default)(u,function(f,b){var x=i[b];x?h=t({},h,x(f)):h[b]=f}),l[c]=h}),l};return yo.default=o,yo}var xo={},d0;function f2(){if(d0)return xo;d0=1,Object.defineProperty(xo,"__esModule",{value:!0}),xo.hover=void 0;var n=Object.assign||function(l){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&(l[h]=c[h])}return l},e=m,t=r(e);function r(l){return l&&l.__esModule?l:{default:l}}function i(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}function o(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:l}function a(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}var s=xo.hover=function(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(h){a(f,h);function f(){var b,x,w,g;i(this,f);for(var y=arguments.length,C=Array(y),A=0;A<y;A++)C[A]=arguments[A];return g=(x=(w=o(this,(b=f.__proto__||Object.getPrototypeOf(f)).call.apply(b,[this].concat(C))),w),w.state={hover:!1},w.handleMouseOver=function(){return w.setState({hover:!0})},w.handleMouseOut=function(){return w.setState({hover:!1})},w.render=function(){return t.default.createElement(c,{onMouseOver:w.handleMouseOver,onMouseOut:w.handleMouseOut},t.default.createElement(u,n({},w.props,w.state)))},x),o(w,g)}return f})(t.default.Component)};return xo.default=s,xo}var Co={},h0;function p2(){if(h0)return Co;h0=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.active=void 0;var n=Object.assign||function(l){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&(l[h]=c[h])}return l},e=m,t=r(e);function r(l){return l&&l.__esModule?l:{default:l}}function i(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}function o(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:l}function a(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}var s=Co.active=function(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(h){a(f,h);function f(){var b,x,w,g;i(this,f);for(var y=arguments.length,C=Array(y),A=0;A<y;A++)C[A]=arguments[A];return g=(x=(w=o(this,(b=f.__proto__||Object.getPrototypeOf(f)).call.apply(b,[this].concat(C))),w),w.state={active:!1},w.handleMouseDown=function(){return w.setState({active:!0})},w.handleMouseUp=function(){return w.setState({active:!1})},w.render=function(){return t.default.createElement(c,{onMouseDown:w.handleMouseDown,onMouseUp:w.handleMouseUp},t.default.createElement(u,n({},w.props,w.state)))},x),o(w,g)}return f})(t.default.Component)};return Co.default=s,Co}var Ps={},f0;function g2(){if(f0)return Ps;f0=1,Object.defineProperty(Ps,"__esModule",{value:!0});var n=function(t,r){var i={},o=function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i[s]=l};return t===0&&o("first-child"),t===r-1&&o("last-child"),(t===0||t%2===0)&&o("even"),Math.abs(t%2)===1&&o("odd"),o("nth-child",t),i};return Ps.default=n,Ps}var p0;function m2(){if(p0)return Dn;p0=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.ReactCSS=Dn.loop=Dn.handleActive=Dn.handleHover=Dn.hover=void 0;var n=FS(),e=f(n),t=d2(),r=f(t),i=h2(),o=f(i),a=f2(),s=f(a),l=p2(),u=f(l),c=g2(),h=f(c);function f(x){return x&&x.__esModule?x:{default:x}}Dn.hover=s.default,Dn.handleHover=s.default,Dn.handleActive=u.default,Dn.loop=h.default;var b=Dn.ReactCSS=function(w){for(var g=arguments.length,y=Array(g>1?g-1:0),C=1;C<g;C++)y[C-1]=arguments[C];var A=(0,e.default)(y),_=(0,r.default)(w,A);return(0,o.default)(_)};return Dn.default=b,Dn}var Sp=m2();const ke=la(Sp);var b2=function(e,t,r,i,o){var a=o.clientWidth,s=o.clientHeight,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,u=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(o.getBoundingClientRect().left+window.pageXOffset),h=u-(o.getBoundingClientRect().top+window.pageYOffset);if(r==="vertical"){var f=void 0;if(h<0?f=0:h>s?f=1:f=Math.round(h*100/s)/100,t.a!==f)return{h:t.h,s:t.s,l:t.l,a:f,source:"rgb"}}else{var b=void 0;if(c<0?b=0:c>a?b=1:b=Math.round(c*100/a)/100,i!==b)return{h:t.h,s:t.s,l:t.l,a:b,source:"rgb"}}return null},Ah={},v2=function(e,t,r,i){if(typeof document>"u"&&!i)return null;var o=i?new i:document.createElement("canvas");o.width=r*2,o.height=r*2;var a=o.getContext("2d");return a?(a.fillStyle=e,a.fillRect(0,0,o.width,o.height),a.fillStyle=t,a.fillRect(0,0,r,r),a.translate(r,r),a.fillRect(0,0,r,r),o.toDataURL()):null},y2=function(e,t,r,i){var o=e+"-"+t+"-"+r+(i?"-server":"");if(Ah[o])return Ah[o];var a=v2(e,t,r,i);return Ah[o]=a,a},g0=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},da=function(e){var t=e.white,r=e.grey,i=e.size,o=e.renderers,a=e.borderRadius,s=e.boxShadow,l=e.children,u=ke({default:{grid:{borderRadius:a,boxShadow:s,absolute:"0px 0px 0px 0px",background:"url("+y2(t,r,i,o.canvas)+") center left"}}});return m.isValidElement(l)?m.cloneElement(l,g0({},l.props,{style:g0({},l.props.style,u.grid)})):m.createElement("div",{style:u.grid})};da.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var x2=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},C2=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function E2(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function m0(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function w2(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var Rp=(function(n){w2(e,n);function e(){var t,r,i,o;E2(this,e);for(var a=arguments.length,s=Array(a),l=0;l<a;l++)s[l]=arguments[l];return o=(r=(i=m0(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(s))),i),i.handleChange=function(u){var c=b2(u,i.props.hsl,i.props.direction,i.props.a,i.container);c&&typeof i.props.onChange=="function"&&i.props.onChange(c,u)},i.handleMouseDown=function(u){i.handleChange(u),window.addEventListener("mousemove",i.handleChange),window.addEventListener("mouseup",i.handleMouseUp)},i.handleMouseUp=function(){i.unbindEventListeners()},i.unbindEventListeners=function(){window.removeEventListener("mousemove",i.handleChange),window.removeEventListener("mouseup",i.handleMouseUp)},r),m0(i,o)}return C2(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var r=this,i=this.props.rgb,o=ke({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("+i.r+","+i.g+","+i.b+`, 0) 0%,
|
|
51
|
+
`).map(c=>Math.ceil(c.length/l)).reduce((c,h)=>c+h,0)*s;return Math.min(u+30,window.innerHeight-50)},vl=({isEditingKey:n,canEditKey:e,pathString:t,path:r,name:i,arrayIndexFromOne:o,handleKeyboard:a,handleEditKey:s,handleCancel:l,handleClick:u,keyValueArray:c,styles:h,getNextOrPrevious:p,emptyStringKey:b,nodeData:x,customNodeData:E,getStyles:g})=>{const{setCurrentlyEditingElement:v}=$i(),C=typeof i=="number"?String(i+(o?1:0)):i;if(!n){const A=Object.assign(Object.assign({},h),{minWidth:`${Math.min(C.length+1,5)}ch`,flexShrink:C.length>10?1:0});if(E?.CustomKey&&x&&g){const{CustomKey:_,customNodeProps:O}=E;return f.jsx(_,{nodeData:x,name:b??C,path:r,canEditKey:e,handleEditKey:R=>{e&&s(R)},setIsEditingKey:()=>{e&&v(r,"key")},handleClick:u,styles:A,customNodeProps:O,getStyles:g})}return f.jsxs("span",{className:"jer-key-text",style:A,onDoubleClick:()=>e&&v(r,"key"),onClick:u,children:[b?f.jsx("span",{className:"jer-empty-string",children:b}):C,C!==""||b?f.jsx("span",{className:"jer-key-colon",children:":"}):null]})}return f.jsx("input",{className:"jer-input-text jer-key-edit",type:"text",name:t,defaultValue:C,autoFocus:!0,onFocus:A=>A.target.select(),onKeyDown:A=>a(A,{stringConfirm:()=>s(A.target.value),cancel:l,tabForward:()=>{if(s(A.target.value),c){const _=c?.[0][0];v(_?[...r,_]:p("next"))}else v(r)},tabBack:()=>{s(A.target.value),v(p("prev"))}}),style:{width:C.length/1.5+.5+"em"}})},oC=n=>{const{data:e,parentData:t,onEdit:r,onDelete:i,onChange:o,onMove:a,enableClipboard:s,canDragOnto:l,restrictTypeSelection:u,searchFilter:c,searchText:h,showLabel:p,stringTruncate:b,showStringQuotes:x,arrayIndexFromOne:E,indent:g,translate:v,customNodeDefinitions:C,customNodeData:A,handleKeyboard:_,keyboardControls:O,sort:R,editConfirmRef:I,jsonStringify:N,showIconTooltips:L}=n,{getStyles:B}=Xr(),{setCurrentlyEditingElement:w,setCollapseState:P,previouslyEditedElement:T,setPreviouslyEditedElement:D,tabDirection:M,setTabDirection:k,previousValue:V,setPreviousValue:W}=$i(),[Y,q]=m.useState(typeof e=="function"?wf:e),{pathString:J,nodeData:X,path:Q,name:K,canEdit:z,canDelete:re,canDrag:de,error:oe,onError:be,handleEditKey:Ne,emptyStringKey:Pe,derivedValues:De}=rC({props:n}),{dragSourceProps:He,getDropTargetProps:ve,BottomDropTarget:se,DropTargetPadding:Me}=iC({canDrag:de,canDragOnto:l,path:Q,nodeData:X,onMove:a,onError:be,translate:v}),[Re,nt]=m.useState(_f(e,A)),Ie=m.useCallback(te=>{if(!o)return void q(te);const Te=o({currentData:X.fullData,newValue:te,currentValue:Y,name:K,path:Q});q(Te)},[o]);m.useEffect(()=>{q(typeof e=="function"?wf:e),nt(_f(e,A))},[e,oe]);const{CustomNode:Ye,customNodeProps:Ue,hideKey:_t,showEditTools:Ke=!0,showOnEdit:gt,showOnView:Ot,passOriginalNode:Pt}=A,xt=[...aS,...C.filter(({showInTypesSelector:te=!1,name:Te})=>te&&!!Te).map(({name:te})=>te)],ot=m.useMemo(()=>{if(typeof u=="boolean")return u?[]:xt;if(Array.isArray(u))return u;const te=u(X);return typeof te=="boolean"?te?[]:xt:te},[X,u]),[mt,pt]=m.useState(((te,Te)=>{var Xe;if(typeof te!="string")return null;const ht=Te.filter(ft=>ft instanceof Object&&ft.enum&&ft.values.includes(te)&&ft.matchPriority);return ht.sort((ft,$e)=>{var rn,Cn;return((rn=$e.matchPriority)!==null&&rn!==void 0?rn:0)-((Cn=ft.matchPriority)!==null&&Cn!==void 0?Cn:0)}),(Xe=ht[0])!==null&&Xe!==void 0?Xe:null})(Y,ot)),{isEditing:Ct}=De,tn=Zx("value",X,c,h);if(Ct&&(!tn||!z)){const te=zi(X.fullData,Q,M,R);w(te||T)}if(!tn)return null;const st=te=>{let Te;if(w(null),W(null),te===void 0||(Xe=>Xe&&typeof Xe=="object"&&"type"in Xe&&"target"in Xe&&"preventDefault"in Xe&&typeof Xe.preventDefault=="function")(te))switch(Re){case"object":Te={[v("DEFAULT_NEW_KEY",X)]:Y};break;case"array":Te=Y??[];break;case"number":{const Xe=Number(Y);Te=isNaN(Xe)?0:Xe;break}default:Te=Y}else Te=te;r(Te,Q).then(Xe=>{Xe&&be({code:"UPDATE_ERROR",message:Xe},Te)})},lt=()=>{w(null),V===null?(q(e),W(null)):r(V,Q)},{isEditingKey:nn,canEditKey:On}=De,Lt=!Ct&&oe,bt=Ct&&ot.length>1,jt=(Re!=="invalid"||Ye)&&!oe&&Ke,Ce=p&&!_t,ce=Ye&&(Ct&>||!Ct&&Ot),Ae={value:Y,parentData:t,setValue:Ie,isEditing:Ct,canEdit:z,setIsEditing:z?()=>w(Q):()=>{},handleEdit:st,handleCancel:lt,path:Q,stringTruncate:b,showStringQuotes:x,nodeData:X,enumType:mt,translate:v,handleKeyboard:_,keyboardCommon:{cancel:lt,tabForward:()=>{k("next"),D(J);const te=zi(X.fullData,Q,"next",R);te&&(st(),w(te))},tabBack:()=>{k("prev"),D(J);const te=zi(X.fullData,Q,"prev",R);te&&(st(),w(te))}}},ze={canEditKey:On,isEditingKey:nn,pathString:J,path:Q,name:K,arrayIndexFromOne:E,handleKeyboard:_,handleEditKey:Ne,handleCancel:lt,styles:B("property",X),getNextOrPrevious:te=>zi(X.fullData,Q,te,R),emptyStringKey:Pe,nodeData:X,customNodeData:A,getStyles:B},qe=ce?f.jsx(Ye,Object.assign({},n,{value:Y,customNodeProps:Ue,setValue:Ie,handleEdit:st,handleCancel:lt,handleKeyPress:te=>_(te,{stringConfirm:st,cancel:lt}),isEditing:Ct,setIsEditing:()=>w(Q),getStyles:B,originalNode:Pt?tv(e,Ae):void 0,originalNodeKey:Pt?f.jsx(vl,Object.assign({},ze,{customNodeData:void 0})):void 0,canEdit:z,keyboardCommon:Ae.keyboardCommon,onError:be})):tv(e,Ae);return f.jsxs("div",Object.assign({className:"jer-component jer-value-component",style:{marginLeft:t!==null?g/2+"em":0,position:"relative"},draggable:de},He,ve("above"),{children:[se,f.jsx(Me,{position:"above",nodeData:X}),f.jsxs("div",{className:"jer-value-main-row",style:{flexWrap:K.length>10?"wrap":"nowrap"},children:[Ce&&f.jsx(vl,Object.assign({},ze)),f.jsxs("div",{className:"jer-value-and-buttons",children:[f.jsx("div",{className:"jer-input-component",children:qe}),Ct?f.jsx(Ip,{onOk:st,onCancel:lt,nodeData:X,editConfirmRef:I}):jt&&f.jsx(nC,{startEdit:z?()=>{W(V),w(Q,lt)}:void 0,handleDelete:re?()=>{i(Y,Q).then(te=>{te&&be({code:"DELETE_ERROR",message:te},Y)})}:void 0,enableClipboard:s,translate:v,customButtons:n.customButtons,nodeData:X,handleKeyboard:_,keyboardControls:O,editConfirmRef:I,jsonStringify:N,showIconTooltips:L}),bt&&f.jsxs("div",{className:"jer-select jer-select-types",children:[f.jsx("select",{name:`${K}-type-select`,className:"jer-select-inner",onChange:te=>(Te=>{const Xe=C.find($e=>$e.name===Te);if(Xe)return r(Xe.defaultValue,Q),nt(Te),pt(null),w(null),void P({path:Q,collapsed:!1,includeChildren:!1});const ht=ot.find($e=>$e instanceof Object&&$e.enum===Te);if(ht)return typeof Y=="string"&&ht.values.includes(Y)||r(ht.values[0],Q).then($e=>{$e&&(be({code:"UPDATE_ERROR",message:$e},ft),w(null))}),void pt(ht);const ft=lS(Y,Te,v("DEFAULT_NEW_KEY",X),A?.CustomNode?v("DEFAULT_STRING",X):void 0);["string","number","boolean"].includes(Te)||w(null),r(ft,Q).then($e=>{$e?(be({code:"UPDATE_ERROR",message:$e},ft),w(null)):pt(null)})})(te.target.value),value:mt?mt.enum:Re,children:ot.map(te=>te instanceof Object&&"enum"in te?f.jsx("option",{value:te.enum,children:te.enum},te.enum):f.jsx("option",{value:te,children:te},te))}),f.jsx("span",{className:"focus"})]}),Lt&&f.jsx("span",{className:"jer-error-slug",style:B("error",X),children:oe})]})]}),f.jsx(Me,{position:"below",nodeData:X})]}))},_f=(n,e)=>e?.CustomNode&&e?.name&&e.showInTypesSelector?e.name:typeof n=="string"?"string":typeof n=="number"?"number":typeof n=="boolean"?"boolean":n===null?"null":"invalid",tv=(n,e)=>{const t=_f(n),{value:r}=e;switch(t){case"string":return f.jsx(XI,Object.assign({},e,{value:r}));case"number":return f.jsx(UI,Object.assign({},e,{value:r}));case"boolean":return f.jsx($I,Object.assign({},e,{value:r}));case"null":return f.jsx(ZI,Object.assign({},e));default:return f.jsx(JI,Object.assign({},e))}},lS=(n,e,t,r)=>{switch(e){case"string":return r??String(n);case"number":{const i=Number(n);return isNaN(i)?0:i}case"boolean":return!!n;case"null":return null;case"object":return{[t]:n};case"array":return[n];default:return String(n)}},aC=(n=[],e)=>{const t=n.filter(({condition:E})=>E(e));if(t.length===0)return{};const r=t[0],{element:i,wrapperElement:o,customKey:a,customNodeProps:s,wrapperProps:l,hideKey:u=!1,showEditTools:c=!0,showOnEdit:h=!1,showOnView:p=!0,showCollectionWrapper:b=!0}=r,x=Xx(r,["element","wrapperElement","customKey","customNodeProps","wrapperProps","hideKey","showEditTools","showOnEdit","showOnView","showCollectionWrapper"]);return Object.assign({CustomNode:i,CustomWrapper:o,CustomKey:a,customNodeProps:s,wrapperProps:l,hideKey:u,showEditTools:c,showOnEdit:h,showOnView:p,showCollectionWrapper:b},x)},sC=n=>{const{getStyles:e}=Xr(),{collapseState:t,setCollapseState:r,getMatchingCollapseState:i,currentlyEditingElement:o,setCurrentlyEditingElement:a,areChildrenBeingEdited:s,previousValue:l,setPreviousValue:u}=$i(),{mainContainerRef:c,data:h,nodeData:p,parentData:b,showCollectionCount:x,onEdit:E,onAdd:g,onDelete:v,canDragOnto:C,collapseFilter:A,collapseAnimationTime:_,onMove:O,enableClipboard:R,onEditEvent:I,showIconTooltips:N,searchFilter:L,searchText:B,indent:w,sort:P,showArrayIndices:T,arrayIndexFromOne:D,defaultValue:M,newKeyOptions:k,translate:V,customNodeDefinitions:W,customNodeData:Y,jsonParse:q,jsonStringify:J,TextEditor:X,keyboardControls:Q,handleKeyboard:K,insertAtTop:z,onCollapse:re,editConfirmRef:de,collapseClickZones:oe}=n,[be,Ne]=m.useState(J(h)),Pe=A(p),{contentRef:De,isAnimating:He,maxHeight:ve,collapsed:se,animateCollapse:Me,cssTransitionValue:Re}=((ae,Ze,Nt,at,on)=>{const[kr,gr]=m.useState(Nt?0:void 0),[Pr,fi]=m.useState(Nt),Lr=m.useRef(!1),wn=m.useRef(null),Kn=m.useRef(0),_n=m.useRef(0),Gn=Ze/1e3+"s",Qn=m.useCallback(an=>{var Jr,er;if(Pr!==an){switch(window.clearTimeout(_n.current),Lr.current=!0,an){case!0:{const pi=(er=(Jr=wn.current)===null||Jr===void 0?void 0:Jr.offsetHeight)!==null&&er!==void 0?er:0;Kn.current=pi,gr(pi),setTimeout(()=>{gr(0)},5);break}case!1:gr(Kn.current||sS(ae,wn,at,on))}fi(!Pr),_n.current=window.setTimeout(()=>{Lr.current=!1,an||gr(void 0)},Ze)}},[Ze,Pr,ae,at,on]);return{contentRef:wn,isAnimating:Lr.current,animateCollapse:Qn,maxHeight:kr,collapsed:Pr,cssTransitionValue:Gn}})(h,_,Pe,c,J),{pathString:nt,nodeData:Ie,path:Ye,name:Ue,size:_t,canEdit:Ke,canDelete:gt,canAdd:Ot,canDrag:Pt,error:xt,setError:ot,onError:mt,handleEditKey:pt,emptyStringKey:Ct,derivedValues:tn}=rC({props:n,collapsed:se}),{dragSourceProps:st,getDropTargetProps:lt,BottomDropTarget:nn,DropTargetPadding:On}=iC({canDrag:Pt,canDragOnto:C,path:Ye,nodeData:Ie,onMove:O,onError:mt,translate:V}),Lt=m.useRef(!Pe),{isEditing:bt,isEditingKey:jt,isArray:Ce,canEditKey:ce}=tn;m.useEffect(()=>{Ne(J(h))},[h]),m.useEffect(()=>{const ae=A(Ie)&&!bt;Lt.current=!ae,Me(ae)},[A]),m.useEffect(()=>{if(t!==null){const ae=i(Ye);ae&&(Lt.current=!0,Me(ae.collapsed))}},[t]);const Ae=m.useRef(null),ze=m.useCallback((ae,Ze)=>{if(typeof M!="function")return M;const Nt=M(ae,Ze);return Nt!==void 0?Nt:null},[M]),qe=m.useCallback(ae=>k?typeof k!="function"?k:k(ae):null,[k]),{CustomNode:te,customNodeProps:Te,CustomWrapper:Xe,wrapperProps:ht={},hideKey:ft,showEditTools:$e=!0,showOnEdit:rn,showOnView:Cn,showCollectionWrapper:dr=!0}=Y,hr=s(nt);if(hr&&se&&Me(!1),!(Zx("collection",Ie,L,B)||Ie.level===0)&&!hr)return null;const En=Array.isArray(h)?"array":"object",At=En==="array"?{open:"[",close:"]"}:{open:"{",close:"}"},Yr=ae=>{if(ae.key==="Tab"&&!ae.getModifierState("Shift")){ae.preventDefault();const Ze=Kx(Ae," ");return void Ne(Ze)}K(ae,{objectConfirm:Nr,cancel:pr})},Zn=ae=>{ae.stopPropagation();const Ze=Ap(ae);if(Ze&&Q.collapseModifier.includes(Ze))return Lt.current=!0,void r({collapsed:!se,path:Ye,includeChildren:!0});o&&o.includes(nt)||(Lt.current=!0,r(null),re&&re({path:Ye,collapsed:!se,includeChildren:!1}),Me(!se))},Nr=()=>{try{const ae=q(be);if(a(null),u(null),ot(null),J(ae)===J(h))return;E(ae,Ye).then(Ze=>{Ze&&mt({code:"UPDATE_ERROR",message:Ze},ae)})}catch{mt({code:"INVALID_JSON",message:V("ERROR_INVALID_JSON",Ie)},be)}},fr=Ye.length>0?()=>{v(h,Ye).then(ae=>{ae&&mt({code:"DELETE_ERROR",message:ae},h)})}:void 0,pr=()=>{a(null),l===null?(ot(null),Ne(J(h)),u(null)):E(l,Ye)},Vt=x==="when-closed"?se:x,vt=!bt&&$e,Jn=(T||!Ce)&&!ft&&Ue!==void 0,Di=te&&(bt&&rn||!bt&&Cn),Dr=Object.entries(h).map(([ae,Ze])=>[En==="array"?Number(ae):ae,Ze]);En==="object"&&P(Dr,ae=>ae);const Mr=Lt.current?bt?f.jsxs("div",{className:"jer-collection-text-edit",children:[X?f.jsx(X,{value:be,onChange:Ne,onKeyDown:ae=>K(ae,{objectConfirm:Nr,cancel:pr})}):f.jsx(Yx,{textAreaRef:Ae,className:"jer-collection-text-area",name:nt,value:be,setValue:Ne,handleKeyPress:Yr,styles:e("input",Ie)}),f.jsx("div",{className:"jer-collection-input-button-row",children:f.jsx(Ip,{onOk:Nr,onCancel:pr,nodeData:Ie,editConfirmRef:de})})]}):Dr.map(([ae,Ze],Nt)=>{const at={key:ae,value:Ze,path:[...Ye,ae],level:Ye.length+1,index:Nt,size:aa(Ze)?Object.keys(Ze).length:null,parentData:h,fullData:Ie.fullData},on=aC(W,at);return f.jsx("div",{className:"jer-collection-element",style:e("collectionElement",at),children:aa(Ze)&&!on?.renderCollectionAsValue?f.jsx(sC,Object.assign({},n,{data:Ze,parentData:h,nodeData:at,showCollectionCount:x,canDragOnto:Ke,customNodeData:on}),ae):f.jsx(oC,Object.assign({},n,{data:Ze,parentData:h,nodeData:at,canDragOnto:Ke,showLabel:En==="object"||T,customNodeData:on}),ae)},ae)}):null,Wt=!!dr&&se&&!hr;Wt||(Lt.current=!0);const Zr=Object.assign(Object.assign({},n),{data:h,value:h,parentData:b,nodeData:Ie,setValue:ae=>Io(void 0,void 0,void 0,function*(){return yield E(ae,Ye)}),handleEdit:Nr,handleCancel:pr,handleKeyPress:Yr,isEditing:bt,setIsEditing:()=>a(Ye),getStyles:e,canDragOnto:Ke,canEdit:Ke,keyboardCommon:{},onError:mt}),Mi=Di?f.jsx(te,Object.assign({customNodeProps:Te},Zr,{children:Mr})):Mr,ci=vt&&f.jsx(nC,{startEdit:Ke?()=>{Lt.current=!0,u(null),a(Ye)}:void 0,handleAdd:Ot?ae=>{Me(!1);const Ze=ze(Ie,ae);if(En==="array"){const Nt=z.array?0:h.length,at=z.array?{insert:!0}:{};g(Ze,[...Ye,Nt],at).then(on=>{on&&mt({code:"ADD_ERROR",message:on},Ze)})}else if(ae in h)mt({code:"KEY_EXISTS",message:V("ERROR_KEY_EXISTS",Ie)},ae);else{const Nt=z.object?{insertBefore:0}:{};g(Ze,[...Ye,ae],Nt).then(at=>{at&&mt({code:"ADD_ERROR",message:at},Ze)})}}:void 0,handleDelete:gt?fr:void 0,enableClipboard:R,type:En,nodeData:Ie,translate:V,customButtons:n.customButtons,keyboardControls:Q,handleKeyboard:K,getNewKeyOptions:qe,editConfirmRef:de,jsonStringify:J,onEditEvent:I,showIconTooltips:N}),di={canEditKey:ce,isEditingKey:jt,pathString:nt,path:Ye,name:Ue,arrayIndexFromOne:D,handleKeyboard:K,handleEditKey:pt,handleCancel:pr,keyValueArray:Dr,styles:e("property",Ie),getNextOrPrevious:ae=>zi(Ie.fullData,Ye,ae,P),handleClick:oe.includes("property")?Zn:ae=>ae.stopPropagation(),emptyStringKey:Ct,nodeData:Ie,customNodeData:Y,getStyles:e},hi=f.jsxs("div",Object.assign({className:"jer-component jer-collection-component",style:Object.assign(Object.assign({marginLeft:(Ye.length===0?0:w/2)+"em"},e("collection",Ie)),{position:"relative"}),draggable:Pt},st,lt("above"),{children:[f.jsx("div",{className:"jer-clickzone",style:{width:w/2+1+"em",zIndex:10+2*Ie.level},onClick:oe.includes("left")?Zn:void 0}),!bt&&nn,f.jsx(On,{position:"above",nodeData:Ie}),dr?f.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},onClick:oe.includes("header")?Zn:void 0,children:[f.jsxs("div",{className:"jer-collection-name",children:[f.jsx("div",{className:"jer-collapse-icon jer-accordion-icon"+(se?" jer-rotate-90":""),style:{zIndex:11+2*Ie.level,transition:Re},onClick:Zn,children:f.jsx(Xi,{name:"chevron",rotate:se,nodeData:Ie})}),Jn&&f.jsx(vl,Object.assign({},di)),!bt&&f.jsx("span",{className:"jer-brackets jer-bracket-open",style:e("bracket",Ie),children:At.open})]}),!bt&&Vt&&f.jsx("div",{className:"jer-collection-item-count"+(Vt?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},e("itemCount",Ie)),{transition:Re}),children:_t===1?V("ITEM_SINGLE",Object.assign(Object.assign({},Ie),{size:1}),1):V("ITEMS_MULTIPLE",Ie,_t)}),f.jsx("div",{className:"jer-brackets"+(Wt?" jer-visible":" jer-hidden"),style:Object.assign(Object.assign({},e("bracket",Ie)),{transition:Re}),children:At.close}),ci]}):ft?f.jsx(f.Fragment,{}):f.jsxs("div",{className:"jer-collection-header-row",style:{position:"relative"},children:[f.jsx(vl,Object.assign({},di)),ci]}),f.jsxs("div",{className:"jer-collection-inner",style:Object.assign(Object.assign({overflowY:Wt||He?"clip":"visible",maxHeight:hr?void 0:ve},e("collectionInner",Ie)),{transition:Re}),ref:De,children:[Mi,f.jsx("div",{className:bt?"jer-collection-error-row":"jer-collection-error-row-edit",children:xt&&f.jsx("span",{className:"jer-error-slug",style:e("error",Ie),children:xt})}),!bt&&dr&&f.jsx("div",{className:"jer-brackets jer-bracket-outside",style:e("bracket",Ie),children:At.close})]}),f.jsx(On,{position:"below",nodeData:Ie})]}));return Xe?f.jsx(Xe,Object.assign({customNodeProps:ht},Zr,{children:hi})):hi},uS={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"},cS=(n,e)=>(t,r,i)=>((o,a,s,l,u)=>{if(a[l]){const h=a[l](s);if(h!==null)return h}const c=l in o?o[l]:uS[l];return u===void 0?c:c?.replace("{{count}}",String(u))})(n,e,r,t,i);var nv=[],Ea=[];(function(n,e){if(n&&typeof document<"u"){var t,r=e.prepend===!0?"prepend":"append",i=e.singleTag===!0,o=typeof e.container=="string"?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(i){var a=nv.indexOf(o);a===-1&&(a=nv.push(o)-1,Ea[a]={}),t=Ea[a]&&Ea[a][r]?Ea[a][r]:Ea[a][r]=s()}else t=s();n.charCodeAt(0)===65279&&(n=n.substring(1)),t.styleSheet?t.styleSheet.cssText+=n:t.appendChild(document.createTextNode(n))}function s(){var l=document.createElement("style");if(l.setAttribute("type","text/css"),e.attributes)for(var u=Object.keys(e.attributes),c=0;c<u.length;c++)l.setAttribute(u[c],e.attributes[u[c]]);var h=r==="prepend"?"afterbegin":"beforeend";return o.insertAdjacentElement(h,l),l}})(':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}',{});const dS=(n,e)=>JSON.stringify(n,e,2),hS=({data:n,setData:e,rootName:t="root",onUpdate:r=()=>{},onEdit:i=r,onDelete:o=r,onAdd:a=r,onChange:s,onError:l,onEditEvent:u,showErrorMessages:c=!0,enableClipboard:h=!0,indent:p=2,collapse:b=!1,collapseAnimationTime:x=300,showCollectionCount:E=!0,restrictEdit:g=!1,restrictDelete:v=!1,restrictAdd:C=!1,restrictTypeSelection:A=!1,restrictDrag:_=!0,viewOnly:O,searchFilter:R,searchText:I,searchDebounceTime:N=350,keySort:L=!1,showArrayIndices:B=!0,arrayIndexFromOne:w=!1,showStringQuotes:P=!0,showIconTooltips:T=!1,defaultValue:D=null,newKeyOptions:M,minWidth:k=250,maxWidth:V="min(600px, 90vw)",rootFontSize:W,stringTruncate:Y=250,translations:q={},className:J,id:X,customText:Q={},customNodeDefinitions:K=[],customButtons:z=[],jsonParse:re=JSON.parse,jsonStringify:de=dS,TextEditor:oe,errorMessageTimeout:be=2500,keyboardControls:Ne={},externalTriggers:Pe,insertAtTop:De=!1,onCollapse:He,collapseClickZones:ve=["header","left"]})=>{const{getStyles:se}=Xr(),{setCurrentlyEditingElement:Me}=$i(),Re=m.useMemo(()=>_a(b),[b]),nt=m.useMemo(()=>cS(q,Q),[q,Q]),[Ie,Ye]=m.useState(I),[Ue,_t]=(({setData:Ce,data:ce})=>{const[Ae,ze]=m.useState(Ce?void 0:ce),qe=m.useCallback(te=>{Ce?Ce(te):ze(te)},[Ce]);return m.useEffect(()=>{Ce||ze(ce)},[ce]),[Ce?ce:Ae,qe]})({setData:e,data:n}),Ke=m.useRef(null);m.useEffect(()=>{Me(null);const Ce=setTimeout(()=>Ye(I),N);return()=>clearTimeout(Ce)},[I,N]);const gt={key:t,path:[],level:0,index:0,value:Ue,size:typeof Ue=="object"&&Ue!==null?Object.keys(Ue).length:1,parentData:null,fullData:Ue},Ot=(Ce,ce)=>Io(void 0,void 0,void 0,function*(){const Ae=yield Ce(ce);if(Ae===!0||Ae===void 0)return void _t(ce.newData);const ze=gS(Ae)?Ae:["error",Ae],[qe,te]=ze;if(qe==="error")return _t(ce.currentData),te===!1?nt("ERROR_UPDATE",gt):String(te);_t(te)}),Pt=m.useMemo(()=>_a(g,O),[g,O]),xt=m.useMemo(()=>_a(v,O),[v,O]),ot=m.useMemo(()=>_a(C,O),[C,O]),mt=m.useMemo(()=>_a(_,O),[_,O]),pt=m.useMemo(()=>pS(R),[R]),Ct=m.useMemo(()=>(Ce=>{const ce=Object.assign({},Qb);for(const Ae of Object.keys(Qb)){const ze=Ae;if(Ce[ze]){const qe=Ce[ze],te=["clipboardModifier","collapseModifier"].includes(Ae)?Array.isArray(qe)?qe:[qe]:typeof qe=="string"?{key:qe}:qe;ce[ze]=te,["stringConfirm","numberConfirm","booleanConfirm"].forEach(Te=>{!Ce[Te]&&Ce.confirm&&(ce[Te]=ce.confirm)})}}return ce})(Ne),[Ne]),tn=m.useCallback((Ce,ce)=>((Ae,ze,qe)=>{const te=Object.entries(ze);for(const[Te,Xe]of te)if(LI(qe,Ae[Te],Te)){qe.preventDefault(),Xe();break}})(Ct,ce,Ce),[Ct]),st=m.useMemo(()=>{const Ce=rv(K,"stringifyReplacer");return ce=>de(ce,Ce)},[K,de]),lt=m.useMemo(()=>{const Ce=rv(K,"parseReviver");return ce=>{const Ae=re(ce,Ce);return Ef(Ae)}},[K,re]),nn=m.useRef(null);((Ce,ce)=>{const{setCurrentlyEditingElement:Ae,currentlyEditingElement:ze,setCollapseState:qe}=$i();m.useEffect(()=>{if(!Ce)return;const{collapse:te,edit:Te}=Ce;te&&qe(te);const Xe=!Te?.path||ro(Te.path)===ze;switch(Te?.action){case"accept":Xe&&(ce.current&&ce.current.click(),Ae(null));break;case"cancel":Xe&&Ae(null);break;default:Te?.path&&Ae(Te.path)}},[Ce])})(Pe,nn);const On=m.useCallback((Ce,ce)=>{L!==!1&&(typeof L!="function"?Ce.sort((Ae,ze)=>{const qe=ce(Ae)[0],te=ce(ze)[0];return qe<te?-1:qe>te?1:0}):Ce.sort((Ae,ze)=>L(ce(Ae),ce(ze))))},[L]),Lt=aC(K,gt),bt={mainContainerRef:Ke,name:t,nodeData:gt,onEdit:(Ce,ce)=>Io(void 0,void 0,void 0,function*(){const{currentData:Ae,newData:ze,currentValue:qe,newValue:te}=wa(Ue,ce,Ce,"update");if(qe!==te)return yield Ot(i,{currentData:Ae,newData:ze,currentValue:qe,newValue:te,name:ce.slice(-1)[0],path:ce})}),onDelete:(Ce,ce)=>Io(void 0,void 0,void 0,function*(){const{currentData:Ae,newData:ze,currentValue:qe,newValue:te}=wa(Ue,ce,Ce,"delete");return yield Ot(o,{currentData:Ae,newData:ze,currentValue:qe,newValue:te,name:ce.slice(-1)[0],path:ce})}),onAdd:(Ce,ce,Ae)=>Io(void 0,void 0,void 0,function*(){const{currentData:ze,newData:qe,currentValue:te,newValue:Te}=wa(Ue,ce,Ce,"add",Ae);return yield Ot(a,{currentData:ze,newData:qe,currentValue:te,newValue:Te,name:ce.slice(-1)[0],path:ce})}),onChange:s,onError:l,onEditEvent:u,showErrorMessages:c,onMove:(Ce,ce,Ae)=>Io(void 0,void 0,void 0,function*(){if(Ce===null)return;const{currentData:ze,newData:qe,currentValue:te}=wa(Ue,Ce,"","delete"),Te=Ce.slice(-1)[0],Xe=ce.slice(0,-1),ht=ce.slice(-1)[0];let ft=typeof ht=="number"?Ae==="above"?ht:ht+1:typeof Te=="number"?`arr_${Te}`:Te;Ce.slice(0,-1).join(".")===ce.slice(0,-1).join(".")&&typeof Te=="number"&&typeof ft=="number"&&Te<ft&&(ft-=1);const $e=typeof ft=="number"?{insert:!0}:Ae==="above"?{insertBefore:ht}:{insertAfter:ht},{newData:rn,newValue:Cn}=wa(qe,[...Xe,ft],te,"add",$e);return yield Ot(i,{currentData:ze,newData:rn,currentValue:te,newValue:Cn,name:ce.slice(-1)[0],path:ce})}),showCollectionCount:E,collapseFilter:Re,collapseAnimationTime:x,restrictEditFilter:Pt,restrictDeleteFilter:xt,restrictAddFilter:ot,restrictTypeSelection:A,restrictDragFilter:mt,canDragOnto:!1,searchFilter:pt,searchText:Ie,enableClipboard:h,keySort:L,sort:On,showArrayIndices:B,arrayIndexFromOne:w,showStringQuotes:P,showIconTooltips:T,indent:p,defaultValue:D,newKeyOptions:M,stringTruncate:Y,translate:nt,customNodeDefinitions:K,customNodeData:Lt,customButtons:z,parentData:null,jsonParse:lt,jsonStringify:st,TextEditor:oe,errorMessageTimeout:be,handleKeyboard:tn,keyboardControls:Ct,insertAtTop:{object:De===!0||De==="object",array:De===!0||De==="array"},onCollapse:He,editConfirmRef:nn,collapseClickZones:ve},jt=Object.assign(Object.assign({},se("container",gt)),{minWidth:k,maxWidth:V});return jt.fontSize=W??jt.fontSize,f.jsx("div",{id:X,ref:Ke,className:`jer-editor-container ${J??""}`,style:jt,children:aa(Ue)&&!Lt.renderCollectionAsValue?f.jsx(sC,Object.assign({data:Ue},bt)):f.jsx(oC,Object.assign({data:Ue,showLabel:!0},bt))})},fS=n=>{var e;const[t,r]=m.useState();return m.useEffect(()=>{const i=document.documentElement;r(i)},[]),t?f.jsx(FI,{theme:(e=n.theme)!==null&&e!==void 0?e:Tp,icons:n.icons,docRoot:t,children:f.jsx(VI,{onEditEvent:n.onEditEvent,onCollapse:n.onCollapse,children:f.jsx(hS,Object.assign({},n))})}):null},wa=(n,e,t,r,i={})=>{if(e.length===0)return{currentData:n,newData:t,currentValue:n,newValue:t};const o=Object.assign({remove:r==="delete"},i),a=r!=="add"?oa(n,e):void 0;return{currentData:n,newData:MI(n,e,t,o),currentValue:a,newValue:r!=="delete"?t:void 0}},_a=(n,e)=>e?()=>!0:typeof n=="boolean"?()=>n:typeof n=="number"?({level:t})=>t>=n:n,pS=n=>{if(n!==void 0)return n==="value"?sa:n==="key"?Kb:n==="all"?(e,t)=>sa(e,t)||Kb(e,t):n},gS=n=>Array.isArray(n)&&n.length===2&&["error","value"].includes(n[0]),rv=(n,e)=>{const t=e==="stringifyReplacer"?[r=>r===void 0?Qx:r]:[];if(t.push(...n.map(r=>r[e]).filter(r=>!!r)),t.length!==0)return(r,i)=>{let o=i;for(const a of t)o=a(o);return o}};function Sp({annotationState:n,closeFormCompanionWindow:e,saveAnnotation:t,saving:r,t:i}){const o=m.useRef(t);o.current=t;const a=m.useRef(r);return a.current=r,m.useEffect(()=>{const s=()=>{a.current||o.current()};return document.addEventListener(cf,s),()=>document.removeEventListener(cf,s)},[]),f.jsxs(f.Fragment,{children:[n.creator&&n.creationDate&&f.jsx(G.Grid,{container:!0,children:f.jsx(sp,{lastSavedDate:n.lastSavedDate,lastEditor:n.lastEditor,creator:n.creator,creationDate:n.creationDate,displayMode:mx,t:i})}),f.jsx(G.Divider,{sx:{m:1}}),f.jsxs(G.Grid,{sx:{mt:1},container:!0,spacing:1,justifyContent:"flex-end",children:[f.jsx(G.Tooltip,{title:f.jsx(Ri,{label:i("cancel"),action:"escape"}),children:f.jsx(G.Button,{sx:{m:1},disabled:r,onClick:e,children:i("cancel")})}),f.jsx(G.Tooltip,{title:f.jsx(Ri,{label:i("save"),action:"save"}),children:f.jsx(G.Button,{sx:{m:1},variant:"contained",color:"primary",type:"submit",disabled:r,startIcon:r?f.jsx(G.CircularProgress,{color:"inherit",size:16}):void 0,onClick:t,children:i("save")})})]})]})}Sp.propTypes={annotationState:d.object.isRequired,closeFormCompanionWindow:d.func.isRequired,saveAnnotation:d.func.isRequired,saving:d.bool,t:d.func.isRequired};Sp.defaultProps={saving:!1};function lC({activeTool:n,baseStrokeWidth:e,displayMode:t,handleDragEnd:r,handleDragStart:i,isSelected:o,onShapeClick:a,onTransform:s,shape:l}){const u=m.useRef(),c=m.useRef();m.useEffect(()=>{c.current&&(c.current.nodes([u.current]),c.current.getLayer().batchDraw())},[o]);const h=()=>{a(l)};return f.jsxs(f.Fragment,{children:[f.jsx(kt.Rect,{dashEnabled:t===Qt.TARGET,draggable:n==="cursor"||n==="edit",fill:l.fill,height:l.height,id:l.id,onClick:h,onDragEnd:r,onDragStart:i,onMousedown:h,onTransform:s,ref:u,scaleX:l.scaleX,scaleY:l.scaleY,stroke:l.stroke,strokeScaleEnabled:!1,strokeWidth:l.strokeWidth,width:l.width,x:l.x||0,y:l.y||0}),f.jsx(kt.Transformer,{ref:c,visible:n==="edit"&&o})]})}lC.propTypes={activeTool:d.string.isRequired,baseStrokeWidth:d.number.isRequired,displayMode:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,height:d.number,id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,text:d.string,type:d.string,width:d.number,x:d.number,y:d.number}).isRequired};function uC({activeTool:n,handleDragEnd:e,isSelected:t,onShapeClick:r,onTransform:i,shape:o,handleDragStart:a}){const s=m.useRef(),l=m.useRef();m.useEffect(()=>{l.current&&(l.current.nodes([s.current]),l.current.getLayer().batchDraw())},[t]);const u=()=>{r(o)};return f.jsxs(f.Fragment,{children:[f.jsx(kt.Ellipse,{draggable:n==="cursor"||n==="edit",fill:o.fill,id:o.id,onClick:u,onDragEnd:e,onDragStart:a,onMousedown:u,onTransform:i,radiusX:o.width,radiusY:o.height,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}),f.jsx(kt.Transformer,{ref:l,visible:n==="edit"&&t})]})}uC.propTypes={activeTool:d.string.isRequired,baseStrokeWidth:d.number.isRequired,displayMode:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,height:d.number,id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,type:d.string,url:d.string,width:d.number,x:d.number,y:d.number}).isRequired};function cC({shape:n,onShapeClick:e,activeTool:t,isSelected:r,onTransform:i,handleDragEnd:o,handleDragStart:a,text:s}){const l=m.useRef(),u=m.useRef(),c=()=>{e(n)};return m.useEffect(()=>{u.current&&(u.current.nodes([l.current]),u.current.getLayer().batchDraw())},[]),f.jsxs(f.Fragment,{children:[f.jsx(kt.Text,{ref:l,scaleX:n.scaleX,scaleY:n.scaleY,rotation:n.rotation,x:n.x,y:n.y,fontSize:40,fill:n.fill,text:s,id:n.id,draggable:t==="cursor"||t==="edit",onClick:c,onMousedown:c,onTransform:i,onDragEnd:o,onDragStart:a}),f.jsx(kt.Transformer,{ref:u,visible:t==="edit"&&r})]})}cC.propTypes={activeTool:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,height:d.number,id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,text:d.string,type:d.string,width:d.number,x:d.number,y:d.number}).isRequired,text:d.string.isRequired};function dC({onShapeClick:n,shape:e,activeTool:t,isSelected:r,onTransform:i,handleDragEnd:o,handleDragStart:a}){const s=m.useRef(),l=m.useRef();m.useEffect(()=>{l.current&&(l.current.nodes([s.current]),l.current.getLayer().batchDraw())},[r]);const u=()=>{n(e)};return f.jsxs(f.Fragment,{children:[f.jsx(kt.Arrow,{ref:s,fill:e.fill,scaleX:e.scaleX,scaleY:e.scaleY,rotation:e.rotation,x:e.x,y:e.y,stroke:e.stroke,strokeWidth:e.strokeWidth,points:e.points,id:e.id,draggable:t==="cursor"||t==="edit",onClick:u,onMousedown:u,pointerLength:e.pointerLength,pointerWidth:e.pointerWidth,onTransform:i,onDragEnd:o,onDragStart:a}),f.jsx(kt.Transformer,{ref:l,visible:t==="edit"&&r})]})}dC.propTypes={activeTool:d.string.isRequired,handleDragEnd:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,id:d.string,pointerLength:d.number,pointerWidth:d.number,points:d.arrayOf(d.number),rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,type:d.string,url:d.string,x:d.number,y:d.number}).isRequired};function hC({activeTool:n,handleDragEnd:e,handleDragStart:t,isSelected:r,onShapeClick:i,onTransform:o,shape:a}){const s=m.useRef(),l=m.useRef();m.useEffect(()=>{l.current&&(l.current.nodes([s.current]),l.current.getLayer().batchDraw())},[r,a]);const u=()=>{i(a)};return f.jsxs(f.Fragment,{children:[f.jsx(kt.Line,{closed:a.closed||!1,draggable:n==="cursor"||n==="edit",fill:a.fill,globalCompositeOperation:"source-over",id:a.id,lineCap:"round",lineJoin:"round",onClick:u,onDragEnd:e,onDragStart:t,onMousedown:u,onTransform:o,points:a.points,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}),f.jsx(kt.Transformer,{ref:l,visible:n==="edit"&&r})]})}hC.propTypes={activeTool:d.string.isRequired,baseStrokeWidth:d.number.isRequired,displayMode:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,id:d.string,points:d.arrayOf(d.number),rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,type:d.string,url:d.string,x:d.number,y:d.number}).isRequired};function fC({activeTool:n,onShapeClick:e,isSelected:t,shape:r,onTransform:i,handleDragEnd:o,handleDragStart:a}){const s=m.useRef(),l=m.useRef();m.useEffect(()=>{l.current&&(l.current.nodes([s.current]),l.current.getLayer().batchDraw())},[t,r]);const u=()=>{e(r)};return f.jsxs(f.Fragment,{children:[f.jsx(kt.Group,{ref:s,onClick:u,onMousedown:u,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:n==="cursor"||n==="edit",onDragEnd:o,onDragStart:a,id:r.id,children:r.lines.map(c=>f.jsx(kt.Line,{fill:r.stroke,points:c.points,stroke:r.stroke,strokeWidth:r.strokeWidth,tension:.5,lineCap:"round",lineJoin:"round"},c.points.join(",")))}),f.jsx(kt.Transformer,{ref:l,visible:n==="edit"&&t})]})}fC.propTypes={activeTool:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,height:d.number,id:d.string,lines:d.arrayOf({points:d.arrayOf(d.number),stroke:d.string,strokeWidth:d.number,x:d.number,y:d.number}),rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,type:d.string,width:d.number,x:d.number,y:d.number}).isRequired};function pC({activeTool:n,displayMode:e,handleDragEnd:t,handleDragStart:r,isSelected:i,onShapeClick:o,onTransform:a,shape:s}){const l=m.useRef(null),u=m.useRef(null),[c,h]=m.useState(null);m.useEffect(()=>{i&&u.current&&l.current&&(u.current.nodes([l.current]),u.current.getLayer().batchDraw())},[i,c]),m.useEffect(()=>{const b=new window.Image;b.src=s.url,b.onload=()=>{h(b)}},[s.url]);const p=()=>{o(s)};return f.jsxs(f.Fragment,{children:[f.jsx(kt.Image,{ref:l,scaleX:s.scaleX,scaleY:s.scaleY,rotation:s.rotation,x:s.x,y:s.y,image:c,id:s.id,draggable:n==="cursor"||n==="edit",onClick:p,onMousedown:p,onTransform:a,onDragEnd:t,onDragStart:r}),i&&f.jsx(kt.Transformer,{rotateEnabled:e!=="image",ref:u,visible:n==="edit"})]})}pC.propTypes={activeTool:d.string.isRequired,displayMode:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,height:d.number,id:d.string,lines:d.arrayOf({points:d.arrayOf(d.number),stroke:d.string,strokeWidth:d.number,x:d.number,y:d.number}),rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,type:d.string,url:d.string,width:d.number,x:d.number,y:d.number}).isRequired};function gC({activeTool:n,handleDragEnd:e,handleDragStart:t,isSelected:r,onShapeClick:i,onTransform:o,shape:a}){const s=m.useRef(),l=m.useRef();m.useEffect(()=>{l.current&&(l.current.nodes([s.current]),l.current.getLayer().batchDraw())},[r]);const u=()=>{i(a)};return f.jsxs(f.Fragment,{children:[f.jsx(kt.Circle,{draggable:n==="cursor"||n==="edit",fill:a.fill,id:a.id,onClick:u,onDragEnd:e,onDragStart:t,onMousedown:u,onTransform:o,radius:a.radius,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}),f.jsx(kt.Transformer,{ref:l,visible:n==="edit"&&r})]})}gC.propTypes={activeTool:d.string.isRequired,baseStrokeWidth:d.number.isRequired,displayMode:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,isSelected:d.bool.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,shape:d.shape({fill:d.string,height:d.number,id:d.string,radius:d.number,rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,type:d.string,url:d.string,width:d.number,x:d.number,y:d.number}).isRequired};const mS=3,bS=7;function vS(n,e,{fill:t,radius:r,stroke:i}){const o=e.getAbsoluteScale().x||1;n.beginPath(),n.moveTo(-r,0),n.lineTo(r,0),n.moveTo(0,-r),n.lineTo(0,r),n.setAttr("lineCap","round"),n.setAttr("strokeStyle",i),n.setAttr("lineWidth",bS/o),n.stroke(),n.setAttr("strokeStyle",t),n.setAttr("lineWidth",mS/o),n.stroke()}function Rp({handleDragEnd:n,handleDragStart:e,onShapeClick:t,shape:r}){const i=()=>{t(r)},{fill:o,radius:a,stroke:s}=r;return f.jsx(kt.Group,{draggable:!0,id:r.id,onClick:i,onDragEnd:n,onDragStart:e,onMousedown:i,x:r.x,y:r.y,children:f.jsx(kt.Shape,{fill:o,hitFunc:(l,u)=>{l.beginPath(),l.rect(-a,-a,a*2,a*2),l.closePath(),l.fillStrokeShape(u)},sceneFunc:(l,u)=>vS(l,u,{fill:o,radius:a,stroke:s})})})}Rp.propTypes={handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,onShapeClick:d.func.isRequired,shape:d.shape({fill:d.string,id:d.string,radius:d.number,stroke:d.string,x:d.number,y:d.number}).isRequired};function mC({activeTool:n,baseStrokeWidth:e,displayMode:t,handleDragEnd:r,handleDragStart:i,onShapeClick:o,onTransform:a,scale:s,selectedShapeId:l,shapes:u,trview:c}){const[h,p]=m.useState(null);m.useEffect(()=>{},[u,l]),m.useEffect(()=>{},[h]);const b=x=>{o(x),p(x)};return f.jsx(kt.Layer,{scaleX:s,scaleY:s,children:u.map(x=>{const E=l===x.id&&c;switch(x.type){case we.RECTANGLE:return m.createElement(lC,{activeTool:n,displayMode:t,handleDragEnd:r,handleDragStart:i,isSelected:E,onShapeClick:b,onTransform:a,shape:x,key:x.id,displayMode:t,baseStrokeWidth:e});case"text":return m.createElement(cC,{activeTool:n,handleDragEnd:r,handleDragStart:i,isSelected:E,onShapeClick:b,onTransform:a,shape:x,text:x.text,key:x.id});case we.ELLIPSE:return m.createElement(uC,{activeTool:n,handleDragEnd:r,handleDragStart:i,isSelected:E,onShapeClick:b,onTransform:a,shape:x,key:x.id,displayMode:t,baseStrokeWidth:e});case we.CIRCLE:return m.createElement(gC,{activeTool:n,handleDragEnd:r,handleDragStart:i,isSelected:E,onShapeClick:b,onTransform:a,shape:x,key:x.id,displayMode:t,baseStrokeWidth:e});case we.POI:return m.createElement(Rp,{handleDragEnd:r,handleDragStart:i,onShapeClick:b,shape:x,key:x.id});case we.FREEHAND:return m.createElement(fC,{activeTool:n,handleDragEnd:r,handleDragStart:i,isSelected:E,onShapeClick:b,onTransform:a,shape:x,key:x.id});case we.POLYGON:return m.createElement(hC,{activeTool:n,handleDragEnd:r,handleDragStart:i,isSelected:E,onShapeClick:b,onTransform:a,shape:x,key:x.id,displayMode:t,baseStrokeWidth:e});case we.ARROW:return m.createElement(dC,{activeTool:n,handleDragEnd:r,handleDragStart:i,isSelected:E,onShapeClick:b,onTransform:a,shape:x,key:x.id});case yt.IMAGE:return m.createElement(pC,{activeTool:n,displayMode:t,handleDragEnd:r,handleDragStart:i,isSelected:E,onShapeClick:b,onTransform:a,shape:x,key:x.id})}})})}mC.propTypes={activeTool:d.string.isRequired,baseStrokeWidth:d.number.isRequired,displayMode:d.string.isRequired,handleDragEnd:d.func.isRequired,handleDragStart:d.func.isRequired,onShapeClick:d.func.isRequired,onTransform:d.func.isRequired,scale:d.number.isRequired,selectedShapeId:d.string,shapes:d.arrayOf(d.shape({id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,type:d.string,url:d.string,x:d.number,y:d.number})).isRequired,trview:d.bool.isRequired};function Op({displayMode:n,drawingState:e,playerReferences:t,scale:r,setColorToolFromCurrentShape:i,setDrawingState:o,setToolState:a,tabView:s,toolState:l,updateCurrentShapeInShapes:u,updateScale:c,windowId:h}){const[p,b]=m.useState(!1),[x,E]=m.useState(!1);m.useEffect(()=>{const T=t.media?.current;if(T&&typeof T.addHandler=="function"){const D=()=>c();return T.addHandler("animation",D),T.addHandler("resize",D),c(),()=>{T.removeHandler("animation",D),T.removeHandler("resize",D)}}c()},[t,c]),m.useEffect(()=>{if(l.imageEvent?.id&&!e.currentShape){const T={id:ln(),rotation:0,scaleX:.2,scaleY:.2,type:yt.IMAGE,url:l.imageEvent.id,x:60,y:60};o({...e,currentShape:T,shapes:[...e.shapes,T]})}b(!1)},[l]);const g=T=>{if(T.stopPropagation(),!!e.currentShape){if(T.key==="Delete"||T.key==="Backspace"){const D=e.shapes.filter(M=>M.id!==e.currentShape.id);o({...e,currentShape:null,shapes:D}),a({...l,imageEvent:null});return}if(T.key==="Tab"){if(l.activeTool===yt.IMAGE)return;l.activeTool===we.POLYGON&&(e.currentShape.points.splice(-2,2),u({points:[e.currentShape.points],...e.currentShape})),o({...e,currentShape:null,isDrawing:!1});return}if(T.key==="Shift"){if(l.activeTool===we.POLYGON&&e.isDrawing){e.currentShape.points.splice(-2,2);const D={...e.currentShape,closed:!0};u(D),o({...e,currentShape:D,isDrawing:!1}),b(!1)}return}if(e.currentShape.type==="text"){const D={...e.currentShape};o(M=>({...M,currentShape:D,shapes:M.shapes.map(k=>k.id===D.id?{...k,...D}:k)}))}}};m.useEffect(()=>{if(!p){const T=e[e.shapes.length-1];T&&u(T)}},[e]),m.useEffect(()=>{e.currentShape&&n!==Qt.TARGET&&n!==Qt.POI&&(e.currentShape.fill=l.fillColor,e.currentShape.stroke=l.strokeColor,e.currentShape.strokeWidth=l.strokeWidth,e.currentShape.text=l.text,u(e.currentShape))},[l]),m.useLayoutEffect(()=>{if(e.shapes.find(T=>T.id===e.currentShape?.id))return window.addEventListener("keydown",g),i({fillColor:e.currentShape.fill,strokeColor:e.currentShape.stroke,strokeWidth:e.currentShape.strokeWidth,text:e.currentShape.text}),()=>{window.removeEventListener("keydown",g)}},[e.currentShape]);const v=async T=>{if(l.activeTool!=="edit"&&l.activeTool!=="cursor"&&l.activeTool!=="delete")return;const D=e.shapes.find(M=>M.id===T.id);if(l.activeTool==="delete"){const M=e.shapes.filter(k=>k.id!==D.id);o({...e,currentShape:null,shapes:M});return}o({...e,currentShape:D}),i({fillColor:D.fill,strokeColor:D.stroke,strokeWidth:D.strokeWidth})},C=T=>{const D=T.target.attrs,M=e.shapes.find(k=>k.id===D.id);Object.assign(M,D),M.type===yt.IMAGE&&(M.width=D.image.width*D.scaleX,M.height=D.image.height*D.scaleY),u(M),x||E(!0)},A=T=>{const D=T.currentTarget.attrs,M=e.shapes.find(k=>k.id===D.id);Object.assign(M,D),M.x=D.x,M.y=D.y,M.type===we.IMAGE&&(M.width=D.image.width*D.scaleX,M.height=D.image.height*D.scaleY)},_=T=>{const D=T.currentTarget.attrs;o({...e,currentShape:e.shapes.find(M=>M.id===D.id)})},O=T=>[we.RECTANGLE,we.CIRCLE,we.ELLIPSE,we.POLYGON,we.ARROW,we.FREEHAND,we.POI].includes(T)?"crosshair":"default",R=T=>{try{const D=T.target.getStage(),M=D.getRelativePointerPosition();M.x/=r,M.y/=r;let k=null;switch(l.activeTool){case we.POI:if(T.target!==D)break;k={...Ti,id:ln(),radius:rp(t.getMediaTrueWidth(),t.getMediaTrueHeight()),rotation:0,scaleX:1,scaleY:1,type:l.activeTool,x:M.x,y:M.y},o({currentShape:k,isDrawing:!1,shapes:[k]});break;case we.RECTANGLE:k={fill:l.fillColor,height:30,id:ln(),scaleX:1,scaleY:1,stroke:l.strokeColor,strokeWidth:l.strokeWidth,type:l.activeTool,width:30,x:M.x,y:M.y},o({currentShape:k,isDrawing:!0,shapes:[...e.shapes,k]});break;case we.ELLIPSE:k={fill:l.fillColor,height:1,id:ln(),radiusX:1,radiusY:1,rotation:0,scaleX:1,scaleY:1,stroke:l.strokeColor,strokeWidth:l.strokeWidth,type:l.activeTool,width:1,x:M.x,y:M.y},o({currentShape:k,isDrawing:!0,shapes:[...e.shapes,k]});break;case we.CIRCLE:k={fill:l.fillColor,height:1,id:ln(),radius:1,rotation:0,scaleX:1,scaleY:1,stroke:l.strokeColor,strokeWidth:l.strokeWidth,type:l.activeTool,width:1,x:M.x,y:M.y},o({currentShape:k,isDrawing:!0,shapes:[...e.shapes,k]});break;case yt.TEXT:k={fill:l.fillColor,fontSize:20,id:ln(),rotation:0,scaleX:1,scaleY:1,text:"Change me",type:yt.TEXT,x:M.x,y:M.y},o({...e,currentShape:k,shapes:[...e.shapes,k]});break;case we.FREEHAND:k={fill:l.fillColor,id:ln(),lines:[{points:[M.x,M.y,M.x,M.y],stroke:l.strokeColor,strokeWidth:l.strokeWidth,x:0,y:0}],rotation:0,scaleX:1,scaleY:1,stroke:l.strokeColor,strokeWidth:l.strokeWidth,type:we.FREEHAND,x:0,y:0},o({currentShape:k,isDrawing:!0,shapes:[...e.shapes,k]});break;case we.POLYGON:if(e.isDrawing){const V=e.currentShape.points[0],W=e.currentShape.points[1],Y=15/r;if(Math.sqrt((M.x-V)**2+(M.y-W)**2)<=Y&&e.currentShape.points.length>6){const J={...e.currentShape,closed:!0};J.points.splice(-2,2),u(J),o({...e,currentShape:J,isDrawing:!1}),b(!1);break}e.currentShape.points.splice(-2,2,M.x,M.y),e.currentShape.points.push(M.x,M.y),u({points:[e.currentShape.points],...e.currentShape})}else k={fill:l.fillColor,id:ln(),points:[M.x,M.y,M.x,M.y],rotation:0,scaleX:1,scaleY:1,stroke:l.strokeColor,strokeWidth:l.strokeWidth,type:we.POLYGON,x:0,y:0},o({currentShape:k,isDrawing:!0,shapes:[...e.shapes,k]}),b(!0);break;case we.ARROW:k={fill:l.fillColor,id:ln(),pointerLength:20,pointerWidth:20,points:[M.x,M.y,M.x,M.y],rotation:0,scaleX:1,scaleY:1,stroke:l.strokeColor,strokeWidth:l.strokeWidth,type:we.ARROW},o({currentShape:k,isDrawing:!0,shapes:[...e.shapes,k]});break;default:break}}catch(D){console.error("error",D)}},I=T=>{try{if(!e.isDrawing||!e.currentShape)return;const D=T.target.getStage().getRelativePointerPosition();switch(D.x/=r,D.y/=r,l.activeTool){case we.RECTANGLE:u({...e.currentShape,height:D.y-e.currentShape.y,width:D.x-e.currentShape.x});break;case we.ELLIPSE:D.x<e.currentShape.x&&(D.x=e.currentShape.x),D.y<e.currentShape.y&&(D.y=e.currentShape.y),u({...e.currentShape,height:D.y-e.currentShape.y,radiusX:(D.x-e.currentShape.x)/2,radiusY:(D.y-e.currentShape.y)/2,width:D.x-e.currentShape.x});break;case we.CIRCLE:D.x<e.currentShape.x&&(D.x=e.currentShape.x),D.y<e.currentShape.y&&(D.y=e.currentShape.y);const M=Math.sqrt((D.x-e.currentShape.x)**2+(D.y-e.currentShape.y)**2);u({...e.currentShape,radius:M});break;case we.FREEHAND:e.lines.push({points:[D.x,D.y,D.x,D.y],stroke:l.strokeColor,strokeWidth:l.strokeWidth}),u({...e.currentShape});break;case we.POLYGON:e.currentShape.points.splice(-2,2,D.x,D.y),u({...e.currentShape});break;case we.ARROW:u({...e.currentShape,fill:l.fillColor,points:[e.currentShape.points[0],e.currentShape.points[1],D.x,D.y],stroke:l.strokeColor,strokeWidth:l.strokeWidth}),b(!0);break;default:break}}catch(D){console.error("error",D)}},N=T=>{if(e.currentShape&&!x){const D=T.target.getStage();if(T.target===D){const k=e.currentShape.type;a(V=>({...V,activeTool:k}))}}l.activeTool!==we.POLYGON&&(o({...e,isDrawing:!1}),[we.RECTANGLE,we.CIRCLE,we.ELLIPSE].includes(l.activeTool)&&a({...l,activeTool:yt.EDIT})),E(!1)},L=T=>{const D=t.media?.current?.canvas;D&&(T.evt.preventDefault(),D.dispatchEvent(new WheelEvent(T.evt.type,T.evt)))},B=l.activeTool===yt.PAN,w=()=>f.jsx(kt.Stage,{width:t.getDisplayedMediaWidth(),height:t.getDisplayedMediaHeight(),style:{cursor:O(l.activeTool),height:"auto",left:t.getImagePosition().x,objectFit:"contain",overflow:"clip",overflowClipMargin:"content-box",pointerEvents:B?"none":void 0,position:"absolute",top:t.getImagePosition().y},onMouseDown:R,onMouseUp:N,onMouseMove:I,onWheel:n===Qt.POI?L:void 0,id:h,children:f.jsx(mC,{activeTool:l.activeTool,baseStrokeWidth:t.getTargetStrokeWidth(),displayMode:n,handleDragEnd:A,handleDragStart:_,onShapeClick:v,onTransform:C,scale:r,selectedShapeId:e.currentShape?.id,shapes:e.shapes,trview:s!=="target"})}),P=t.getContainer();return P?ep.createPortal(w(),P):f.jsx(f.Fragment,{})}const iv=d.shape({fill:d.string,id:d.string,lines:{pointerLength:d.number,points:d.arrayOf([d.number]),stroke:d.string,strokeWidth:d.number},pointerLength:d.number,pointerWidth:d.number,points:d.number,rotation:d.number,scaleX:d.number,scaleY:d.number,stroke:d.string,strokeWidth:d.number,text:d.string,type:d.string,url:d.string,x:d.number,y:d.number});Op.propTypes={displayMode:d.string.isRequired,drawingState:d.oneOfType([d.shape({currentShape:iv,isDrawing:d.bool,shapes:d.arrayOf(iv)}),d.arrayOf(d.shape({currentShape:d.shape({id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,type:d.string,url:d.string,x:d.number,y:d.number}),isDrawing:d.bool,shapes:d.arrayOf(d.shape({id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,type:d.string,url:d.string,x:d.number,y:d.number}))}))]).isRequired,playerReferences:d.object.isRequired,scale:d.number.isRequired,setColorToolFromCurrentShape:d.func.isRequired,setDrawingState:d.func.isRequired,setToolState:d.func.isRequired,tabView:d.string.isRequired,toolState:d.object.isRequired,updateCurrentShapeInShapes:d.func.isRequired,updateScale:d.func.isRequired,windowId:d.string.isRequired};const bC={defaultForm:{default:null,type:"string"},defaultTags:{default:[],type:"array"},editMode:{default:!1,type:"boolean"}},yS={array:n=>n?n.split(",").map(e=>e.trim()).filter(Boolean):[],boolean:n=>n==="true",number:n=>{const e=Number(n);return Number.isNaN(e)?null:e},string:n=>n||null};let Bs=null;function xS(){if(!Bs){const n=new URLSearchParams(window.location.search);Bs={},Object.entries(bC).forEach(([e,t])=>{const r=n.get(e);r!==null&&(Bs[e]=yS[t.type](r))})}return Bs}function vs(n){const e=xS(),t={};return Object.entries(bC).forEach(([r,i])=>{r in e?t[r]=e[r]:n?.annotation?.[r]!==void 0?t[r]=n.annotation[r]:t[r]=i.default}),t}function CS(n){return m.useMemo(()=>vs(n),[n])}const ES=tt.createSvgIcon(f.jsx("path",{d:"M5 4v3h5.5v12h3V7H19V4z"}),"Title"),vC=tt.createSvgIcon(f.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"),yC=tt.createSvgIcon(f.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=tt.createSvgIcon([f.jsx("path",{d:"m12 2-5.5 9h11z"},"0"),f.jsx("circle",{cx:"17.5",cy:"17.5",r:"4.5"},"1"),f.jsx("path",{d:"M3 13.5h8v8H3z"},"2")],"Category");function _S(n){return f.jsx(z1,{...n,children:f.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:f.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 "})})})}const AS=tt.createSvgIcon(f.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"),ov=tt.createSvgIcon(f.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"),TS=tt.createSvgIcon(f.jsx("path",{d:"M6 6v2h8.59L5 17.59 6.41 19 16 9.41V18h2V6z"}),"ArrowOutward"),IS=tt.createSvgIcon(f.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"),SS=tt.createSvgIcon(f.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"),RS=G.styled("div")(({theme:n})=>({display:"flex",justifyContent:"flex-end",marginTop:"5px"})),OS=G.styled("div")(({theme:n})=>({alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"})),jS=G.styled(G.TextField)(({theme:n})=>({marginBottom:"0",marginTop:"0"}));function xC({imageUrl:n=null,isReadOnly:e,onAddImage:t,onChange:r,t:i}){const o=m.useRef(null),[a,s]=m.useState(!1),l=n===null?"":n;return m.useEffect(()=>{o.current?s(n&&o.current.checkValidity()):s(!!n)},[n]),f.jsx(OS,{children:e?f.jsxs(f.Fragment,{children:[f.jsx(je,{children:i("onlyOneImageAllowed")}),a&&f.jsx("img",{src:n,width:"100%",height:"auto",alt:i("loading_failed")})]}):f.jsxs(f.Fragment,{children:[f.jsx(je,{variant:"overline",children:i("add_image_from_url")}),f.jsx(jS,{value:l,onChange:u=>r(u.target.value),error:l!==""&&!a,margin:"dense",label:i("imageURL"),type:"url",fullWidth:!0,inputRef:o}),a&&f.jsxs(f.Fragment,{children:[f.jsx("img",{src:n,width:"100%",height:"auto",alt:i("loading_failed")}),f.jsx(RS,{children:f.jsx(G.Button,{variant:"contained",onClick:t,children:f.jsx(SS,{})})})]})]})})}xC.propTypes={imageUrl:d.string,isReadOnly:d.bool.isRequired,onAddImage:d.func.isRequired,onChange:d.func.isRequired,t:d.func.isRequired};const NS=tt.createSvgIcon(f.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"),pd=tt.createSvgIcon(f.jsx("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown"),DS=tt.createSvgIcon(f.jsx("path",{d:"M3 17h18v-2H3zm0 3h18v-1H3zm0-7h18v-3H3zm0-9v4h18V4z"}),"LineWeight"),MS=tt.createSvgIcon(f.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");var Mn={},xo={},gd,av;function kS(){if(av)return gd;av=1;var n=to(),e=cr(),t=oi(),r="[object String]";function i(o){return typeof o=="string"||!e(o)&&t(o)&&n(o)==r}return gd=i,gd}var md,sv;function PS(){if(sv)return md;sv=1;function n(e){return function(t,r,i){for(var o=-1,a=Object(t),s=i(t),l=s.length;l--;){var u=s[e?l:++o];if(r(a[u],u,a)===!1)break}return t}}return md=n,md}var bd,lv;function LS(){if(lv)return bd;lv=1;var n=PS(),e=n();return bd=e,bd}var vd,uv;function CC(){if(uv)return vd;uv=1;var n=LS(),e=gs();function t(r,i){return r&&n(r,i,e)}return vd=t,vd}var yd,cv;function EC(){if(cv)return yd;cv=1;function n(e){return e}return yd=n,yd}var xd,dv;function BS(){if(dv)return xd;dv=1;var n=EC();function e(t){return typeof t=="function"?t:n}return xd=e,xd}var Cd,hv;function jp(){if(hv)return Cd;hv=1;var n=CC(),e=BS();function t(r,i){return r&&n(r,e(i))}return Cd=t,Cd}var Ed,fv;function Np(){if(fv)return Ed;fv=1;var n=Ox(),e=n(Object.getPrototypeOf,Object);return Ed=e,Ed}var wd,pv;function FS(){if(pv)return wd;pv=1;var n=to(),e=Np(),t=oi(),r="[object Object]",i=Function.prototype,o=Object.prototype,a=i.toString,s=o.hasOwnProperty,l=a.call(Object);function u(c){if(!t(c)||n(c)!=r)return!1;var h=e(c);if(h===null)return!0;var p=s.call(h,"constructor")&&h.constructor;return typeof p=="function"&&p instanceof p&&a.call(p)==l}return wd=u,wd}var _d,gv;function wC(){if(gv)return _d;gv=1;function n(e,t){for(var r=-1,i=e==null?0:e.length,o=Array(i);++r<i;)o[r]=t(e[r],r,e);return o}return _d=n,_d}var Ad,mv;function GS(){if(mv)return Ad;mv=1;var n=hp(),e=yp(),t=1,r=2;function i(o,a,s,l){var u=s.length,c=u,h=!l;if(o==null)return!c;for(o=Object(o);u--;){var p=s[u];if(h&&p[2]?p[1]!==o[p[0]]:!(p[0]in o))return!1}for(;++u<c;){p=s[u];var b=p[0],x=o[b],E=p[1];if(h&&p[2]){if(x===void 0&&!(b in o))return!1}else{var g=new n;if(l)var v=l(x,E,b,o,a,g);if(!(v===void 0?e(E,x,t|r,l,g):v))return!1}}return!0}return Ad=i,Ad}var Td,bv;function _C(){if(bv)return Td;bv=1;var n=da();function e(t){return t===t&&!n(t)}return Td=e,Td}var Id,vv;function qS(){if(vv)return Id;vv=1;var n=_C(),e=gs();function t(r){for(var i=e(r),o=i.length;o--;){var a=i[o],s=r[a];i[o]=[a,s,n(s)]}return i}return Id=t,Id}var Sd,yv;function AC(){if(yv)return Sd;yv=1;function n(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}return Sd=n,Sd}var Rd,xv;function HS(){if(xv)return Rd;xv=1;var n=GS(),e=qS(),t=AC();function r(i){var o=e(i);return o.length==1&&o[0][2]?t(o[0][0],o[0][1]):function(a){return a===i||n(a,i,o)}}return Rd=r,Rd}var Od,Cv;function Dp(){if(Cv)return Od;Cv=1;var n=to(),e=oi(),t="[object Symbol]";function r(i){return typeof i=="symbol"||e(i)&&n(i)==t}return Od=r,Od}var jd,Ev;function Mp(){if(Ev)return jd;Ev=1;var n=cr(),e=Dp(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,a){if(n(o))return!1;var s=typeof o;return s=="number"||s=="symbol"||s=="boolean"||o==null||e(o)?!0:r.test(o)||!t.test(o)||a!=null&&o in Object(a)}return jd=i,jd}var Nd,wv;function VS(){if(wv)return Nd;wv=1;var n=dp(),e="Expected a function";function t(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var o=function(){var a=arguments,s=i?i.apply(this,a):a[0],l=o.cache;if(l.has(s))return l.get(s);var u=r.apply(this,a);return o.cache=l.set(s,u)||l,u};return o.cache=new(t.Cache||n),o}return t.Cache=n,Nd=t,Nd}var Dd,_v;function WS(){if(_v)return Dd;_v=1;var n=VS(),e=500;function t(r){var i=n(r,function(a){return o.size===e&&o.clear(),a}),o=i.cache;return i}return Dd=t,Dd}var Md,Av;function zS(){if(Av)return Md;Av=1;var n=WS(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,r=n(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(e,function(a,s,l,u){o.push(l?u.replace(t,"$1"):s||a)}),o});return Md=r,Md}var kd,Tv;function XS(){if(Tv)return kd;Tv=1;var n=ca(),e=wC(),t=cr(),r=Dp(),i=n?n.prototype:void 0,o=i?i.toString:void 0;function a(s){if(typeof s=="string")return s;if(t(s))return e(s,a)+"";if(r(s))return o?o.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return kd=a,kd}var Pd,Iv;function US(){if(Iv)return Pd;Iv=1;var n=XS();function e(t){return t==null?"":n(t)}return Pd=e,Pd}var Ld,Sv;function TC(){if(Sv)return Ld;Sv=1;var n=cr(),e=Mp(),t=zS(),r=US();function i(o,a){return n(o)?o:e(o,a)?[o]:t(r(o))}return Ld=i,Ld}var Bd,Rv;function $l(){if(Rv)return Bd;Rv=1;var n=Dp();function e(t){if(typeof t=="string"||n(t))return t;var r=t+"";return r=="0"&&1/t==-1/0?"-0":r}return Bd=e,Bd}var Fd,Ov;function IC(){if(Ov)return Fd;Ov=1;var n=TC(),e=$l();function t(r,i){i=n(i,r);for(var o=0,a=i.length;r!=null&&o<a;)r=r[e(i[o++])];return o&&o==a?r:void 0}return Fd=t,Fd}var Gd,jv;function $S(){if(jv)return Gd;jv=1;var n=IC();function e(t,r,i){var o=t==null?void 0:n(t,r);return o===void 0?i:o}return Gd=e,Gd}var qd,Nv;function YS(){if(Nv)return qd;Nv=1;function n(e,t){return e!=null&&t in Object(e)}return qd=n,qd}var Hd,Dv;function ZS(){if(Dv)return Hd;Dv=1;var n=TC(),e=ap(),t=cr(),r=Ix(),i=gp(),o=$l();function a(s,l,u){l=n(l,s);for(var c=-1,h=l.length,p=!1;++c<h;){var b=o(l[c]);if(!(p=s!=null&&u(s,b)))break;s=s[b]}return p||++c!=h?p:(h=s==null?0:s.length,!!h&&i(h)&&r(b,h)&&(t(s)||e(s)))}return Hd=a,Hd}var Vd,Mv;function JS(){if(Mv)return Vd;Mv=1;var n=YS(),e=ZS();function t(r,i){return r!=null&&e(r,i,n)}return Vd=t,Vd}var Wd,kv;function KS(){if(kv)return Wd;kv=1;var n=yp(),e=$S(),t=JS(),r=Mp(),i=_C(),o=AC(),a=$l(),s=1,l=2;function u(c,h){return r(c)&&i(h)?o(a(c),h):function(p){var b=e(p,c);return b===void 0&&b===h?t(p,c):n(h,b,s|l)}}return Wd=u,Wd}var zd,Pv;function QS(){if(Pv)return zd;Pv=1;function n(e){return function(t){return t?.[e]}}return zd=n,zd}var Xd,Lv;function e2(){if(Lv)return Xd;Lv=1;var n=IC();function e(t){return function(r){return n(r,t)}}return Xd=e,Xd}var Ud,Bv;function t2(){if(Bv)return Ud;Bv=1;var n=QS(),e=e2(),t=Mp(),r=$l();function i(o){return t(o)?n(r(o)):e(o)}return Ud=i,Ud}var $d,Fv;function n2(){if(Fv)return $d;Fv=1;var n=HS(),e=KS(),t=EC(),r=cr(),i=t2();function o(a){return typeof a=="function"?a:a==null?t:typeof a=="object"?r(a)?e(a[0],a[1]):n(a):i(a)}return $d=o,$d}var Yd,Gv;function r2(){if(Gv)return Yd;Gv=1;var n=zl();function e(t,r){return function(i,o){if(i==null)return i;if(!n(i))return t(i,o);for(var a=i.length,s=r?a:-1,l=Object(i);(r?s--:++s<a)&&o(l[s],s,l)!==!1;);return i}}return Yd=e,Yd}var Zd,qv;function i2(){if(qv)return Zd;qv=1;var n=CC(),e=r2(),t=e(n);return Zd=t,Zd}var Jd,Hv;function o2(){if(Hv)return Jd;Hv=1;var n=i2(),e=zl();function t(r,i){var o=-1,a=e(r)?Array(r.length):[];return n(r,function(s,l,u){a[++o]=i(s,l,u)}),a}return Jd=t,Jd}var Kd,Vv;function a2(){if(Vv)return Kd;Vv=1;var n=wC(),e=n2(),t=o2(),r=cr();function i(o,a){var s=r(o)?n:t;return s(o,e(a,3))}return Kd=i,Kd}var Wv;function s2(){if(Wv)return xo;Wv=1,Object.defineProperty(xo,"__esModule",{value:!0}),xo.flattenNames=void 0;var n=kS(),e=l(n),t=jp(),r=l(t),i=FS(),o=l(i),a=a2(),s=l(a);function l(c){return c&&c.__esModule?c:{default:c}}var u=xo.flattenNames=function c(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=[];return(0,s.default)(h,function(b){Array.isArray(b)?c(b).map(function(x){return p.push(x)}):(0,o.default)(b)?(0,r.default)(b,function(x,E){x===!0&&p.push(E),p.push(E+"-"+x)}):(0,e.default)(b)&&p.push(b)}),p};return xo.default=u,xo}var Co={},Qd,zv;function l2(){if(zv)return Qd;zv=1;function n(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}return Qd=n,Qd}var eh,Xv;function u2(){if(Xv)return eh;Xv=1;var n=no(),e=(function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch{}})();return eh=e,eh}var th,Uv;function SC(){if(Uv)return th;Uv=1;var n=u2();function e(t,r,i){r=="__proto__"&&n?n(t,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[r]=i}return th=e,th}var nh,$v;function RC(){if($v)return nh;$v=1;var n=SC(),e=up(),t=Object.prototype,r=t.hasOwnProperty;function i(o,a,s){var l=o[a];(!(r.call(o,a)&&e(l,s))||s===void 0&&!(a in o))&&n(o,a,s)}return nh=i,nh}var rh,Yv;function Yl(){if(Yv)return rh;Yv=1;var n=RC(),e=SC();function t(r,i,o,a){var s=!o;o||(o={});for(var l=-1,u=i.length;++l<u;){var c=i[l],h=a?a(o[c],r[c],c,o,r):void 0;h===void 0&&(h=r[c]),s?e(o,c,h):n(o,c,h)}return o}return rh=t,rh}var ih,Zv;function c2(){if(Zv)return ih;Zv=1;var n=Yl(),e=gs();function t(r,i){return r&&n(i,e(i),r)}return ih=t,ih}var oh,Jv;function d2(){if(Jv)return oh;Jv=1;function n(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}return oh=n,oh}var ah,Kv;function h2(){if(Kv)return ah;Kv=1;var n=da(),e=vp(),t=d2(),r=Object.prototype,i=r.hasOwnProperty;function o(a){if(!n(a))return t(a);var s=e(a),l=[];for(var u in a)u=="constructor"&&(s||!i.call(a,u))||l.push(u);return l}return ah=o,ah}var sh,Qv;function kp(){if(Qv)return sh;Qv=1;var n=Rx(),e=h2(),t=zl();function r(i){return t(i)?n(i,!0):e(i)}return sh=r,sh}var lh,e0;function f2(){if(e0)return lh;e0=1;var n=Yl(),e=kp();function t(r,i){return r&&n(i,e(i),r)}return lh=t,lh}var qa={exports:{}};qa.exports;var t0;function p2(){return t0||(t0=1,(function(n,e){var t=zr(),r=e&&!e.nodeType&&e,i=r&&!0&&n&&!n.nodeType&&n,o=i&&i.exports===r,a=o?t.Buffer:void 0,s=a?a.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var h=u.length,p=s?s(h):new u.constructor(h);return u.copy(p),p}n.exports=l})(qa,qa.exports)),qa.exports}var uh,n0;function g2(){if(n0)return uh;n0=1;function n(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}return uh=n,uh}var ch,r0;function m2(){if(r0)return ch;r0=1;var n=Yl(),e=fp();function t(r,i){return n(r,e(r),i)}return ch=t,ch}var dh,i0;function OC(){if(i0)return dh;i0=1;var n=op(),e=Np(),t=fp(),r=Tx(),i=Object.getOwnPropertySymbols,o=i?function(a){for(var s=[];a;)n(s,t(a)),a=e(a);return s}:r;return dh=o,dh}var hh,o0;function b2(){if(o0)return hh;o0=1;var n=Yl(),e=OC();function t(r,i){return n(r,e(r),i)}return hh=t,hh}var fh,a0;function v2(){if(a0)return fh;a0=1;var n=Ax(),e=OC(),t=kp();function r(i){return n(i,t,e)}return fh=r,fh}var ph,s0;function y2(){if(s0)return ph;s0=1;var n=Object.prototype,e=n.hasOwnProperty;function t(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&e.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return ph=t,ph}var gh,l0;function Pp(){if(l0)return gh;l0=1;var n=_x();function e(t){var r=new t.constructor(t.byteLength);return new n(r).set(new n(t)),r}return gh=e,gh}var mh,u0;function x2(){if(u0)return mh;u0=1;var n=Pp();function e(t,r){var i=r?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}return mh=e,mh}var bh,c0;function C2(){if(c0)return bh;c0=1;var n=/\w*$/;function e(t){var r=new t.constructor(t.source,n.exec(t));return r.lastIndex=t.lastIndex,r}return bh=e,bh}var vh,d0;function E2(){if(d0)return vh;d0=1;var n=ca(),e=n?n.prototype:void 0,t=e?e.valueOf:void 0;function r(i){return t?Object(t.call(i)):{}}return vh=r,vh}var yh,h0;function w2(){if(h0)return yh;h0=1;var n=Pp();function e(t,r){var i=r?n(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}return yh=e,yh}var xh,f0;function _2(){if(f0)return xh;f0=1;var n=Pp(),e=x2(),t=C2(),r=E2(),i=w2(),o="[object Boolean]",a="[object Date]",s="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",h="[object String]",p="[object Symbol]",b="[object ArrayBuffer]",x="[object DataView]",E="[object Float32Array]",g="[object Float64Array]",v="[object Int8Array]",C="[object Int16Array]",A="[object Int32Array]",_="[object Uint8Array]",O="[object Uint8ClampedArray]",R="[object Uint16Array]",I="[object Uint32Array]";function N(L,B,w){var P=L.constructor;switch(B){case b:return n(L);case o:case a:return new P(+L);case x:return e(L,w);case E:case g:case v:case C:case A:case _:case O:case R:case I:return i(L,w);case s:return new P;case l:case h:return new P(L);case u:return t(L);case c:return new P;case p:return r(L)}}return xh=N,xh}var Ch,p0;function A2(){if(p0)return Ch;p0=1;var n=da(),e=Object.create,t=(function(){function r(){}return function(i){if(!n(i))return{};if(e)return e(i);r.prototype=i;var o=new r;return r.prototype=void 0,o}})();return Ch=t,Ch}var Eh,g0;function T2(){if(g0)return Eh;g0=1;var n=A2(),e=Np(),t=vp();function r(i){return typeof i.constructor=="function"&&!t(i)?n(e(i)):{}}return Eh=r,Eh}var wh,m0;function I2(){if(m0)return wh;m0=1;var n=Xl(),e=oi(),t="[object Map]";function r(i){return e(i)&&n(i)==t}return wh=r,wh}var _h,b0;function S2(){if(b0)return _h;b0=1;var n=I2(),e=mp(),t=bp(),r=t&&t.isMap,i=r?e(r):n;return _h=i,_h}var Ah,v0;function R2(){if(v0)return Ah;v0=1;var n=Xl(),e=oi(),t="[object Set]";function r(i){return e(i)&&n(i)==t}return Ah=r,Ah}var Th,y0;function O2(){if(y0)return Th;y0=1;var n=R2(),e=mp(),t=bp(),r=t&&t.isSet,i=r?e(r):n;return Th=i,Th}var Ih,x0;function j2(){if(x0)return Ih;x0=1;var n=hp(),e=l2(),t=RC(),r=c2(),i=f2(),o=p2(),a=g2(),s=m2(),l=b2(),u=jx(),c=v2(),h=Xl(),p=y2(),b=_2(),x=T2(),E=cr(),g=pp(),v=S2(),C=da(),A=O2(),_=gs(),O=kp(),R=1,I=2,N=4,L="[object Arguments]",B="[object Array]",w="[object Boolean]",P="[object Date]",T="[object Error]",D="[object Function]",M="[object GeneratorFunction]",k="[object Map]",V="[object Number]",W="[object Object]",Y="[object RegExp]",q="[object Set]",J="[object String]",X="[object Symbol]",Q="[object WeakMap]",K="[object ArrayBuffer]",z="[object DataView]",re="[object Float32Array]",de="[object Float64Array]",oe="[object Int8Array]",be="[object Int16Array]",Ne="[object Int32Array]",Pe="[object Uint8Array]",De="[object Uint8ClampedArray]",He="[object Uint16Array]",ve="[object Uint32Array]",se={};se[L]=se[B]=se[K]=se[z]=se[w]=se[P]=se[re]=se[de]=se[oe]=se[be]=se[Ne]=se[k]=se[V]=se[W]=se[Y]=se[q]=se[J]=se[X]=se[Pe]=se[De]=se[He]=se[ve]=!0,se[T]=se[D]=se[Q]=!1;function Me(Re,nt,Ie,Ye,Ue,_t){var Ke,gt=nt&R,Ot=nt&I,Pt=nt&N;if(Ie&&(Ke=Ue?Ie(Re,Ye,Ue,_t):Ie(Re)),Ke!==void 0)return Ke;if(!C(Re))return Re;var xt=E(Re);if(xt){if(Ke=p(Re),!gt)return a(Re,Ke)}else{var ot=h(Re),mt=ot==D||ot==M;if(g(Re))return o(Re,gt);if(ot==W||ot==L||mt&&!Ue){if(Ke=Ot||mt?{}:x(Re),!gt)return Ot?l(Re,i(Ke,Re)):s(Re,r(Ke,Re))}else{if(!se[ot])return Ue?Re:{};Ke=b(Re,ot,gt)}}_t||(_t=new n);var pt=_t.get(Re);if(pt)return pt;_t.set(Re,Ke),A(Re)?Re.forEach(function(st){Ke.add(Me(st,nt,Ie,st,Re,_t))}):v(Re)&&Re.forEach(function(st,lt){Ke.set(lt,Me(st,nt,Ie,lt,Re,_t))});var Ct=Pt?Ot?c:u:Ot?O:_,tn=xt?void 0:Ct(Re);return e(tn||Re,function(st,lt){tn&&(lt=st,st=Re[lt]),t(Ke,lt,Me(st,nt,Ie,lt,Re,_t))}),Ke}return Ih=Me,Ih}var Sh,C0;function N2(){if(C0)return Sh;C0=1;var n=j2(),e=1,t=4;function r(i){return n(i,e|t)}return Sh=r,Sh}var E0;function D2(){if(E0)return Co;E0=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.mergeClasses=void 0;var n=jp(),e=o(n),t=N2(),r=o(t),i=Object.assign||function(s){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(s[c]=u[c])}return s};function o(s){return s&&s.__esModule?s:{default:s}}var a=Co.mergeClasses=function(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=l.default&&(0,r.default)(l.default)||{};return u.map(function(h){var p=l[h];return p&&(0,e.default)(p,function(b,x){c[x]||(c[x]={}),c[x]=i({},c[x],p[x])}),h}),c};return Co.default=a,Co}var Eo={},w0;function M2(){if(w0)return Eo;w0=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.autoprefix=void 0;var n=jp(),e=r(n),t=Object.assign||function(a){for(var s=1;s<arguments.length;s++){var l=arguments[s];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a};function r(a){return a&&a.__esModule?a:{default:a}}var i={borderRadius:function(s){return{msBorderRadius:s,MozBorderRadius:s,OBorderRadius:s,WebkitBorderRadius:s,borderRadius:s}},boxShadow:function(s){return{msBoxShadow:s,MozBoxShadow:s,OBoxShadow:s,WebkitBoxShadow:s,boxShadow:s}},userSelect:function(s){return{WebkitTouchCallout:s,KhtmlUserSelect:s,MozUserSelect:s,msUserSelect:s,WebkitUserSelect:s,userSelect:s}},flex:function(s){return{WebkitBoxFlex:s,MozBoxFlex:s,WebkitFlex:s,msFlex:s,flex:s}},flexBasis:function(s){return{WebkitFlexBasis:s,flexBasis:s}},justifyContent:function(s){return{WebkitJustifyContent:s,justifyContent:s}},transition:function(s){return{msTransition:s,MozTransition:s,OTransition:s,WebkitTransition:s,transition:s}},transform:function(s){return{msTransform:s,MozTransform:s,OTransform:s,WebkitTransform:s,transform:s}},absolute:function(s){var l=s&&s.split(" ");return{position:"absolute",top:l&&l[0],right:l&&l[1],bottom:l&&l[2],left:l&&l[3]}},extend:function(s,l){var u=l[s];return u||{extend:s}}},o=Eo.autoprefix=function(s){var l={};return(0,e.default)(s,function(u,c){var h={};(0,e.default)(u,function(p,b){var x=i[b];x?h=t({},h,x(p)):h[b]=p}),l[c]=h}),l};return Eo.default=o,Eo}var wo={},_0;function k2(){if(_0)return wo;_0=1,Object.defineProperty(wo,"__esModule",{value:!0}),wo.hover=void 0;var n=Object.assign||function(l){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&(l[h]=c[h])}return l},e=m,t=r(e);function r(l){return l&&l.__esModule?l:{default:l}}function i(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}function o(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:l}function a(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}var s=wo.hover=function(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(h){a(p,h);function p(){var b,x,E,g;i(this,p);for(var v=arguments.length,C=Array(v),A=0;A<v;A++)C[A]=arguments[A];return g=(x=(E=o(this,(b=p.__proto__||Object.getPrototypeOf(p)).call.apply(b,[this].concat(C))),E),E.state={hover:!1},E.handleMouseOver=function(){return E.setState({hover:!0})},E.handleMouseOut=function(){return E.setState({hover:!1})},E.render=function(){return t.default.createElement(c,{onMouseOver:E.handleMouseOver,onMouseOut:E.handleMouseOut},t.default.createElement(u,n({},E.props,E.state)))},x),o(E,g)}return p})(t.default.Component)};return wo.default=s,wo}var _o={},A0;function P2(){if(A0)return _o;A0=1,Object.defineProperty(_o,"__esModule",{value:!0}),_o.active=void 0;var n=Object.assign||function(l){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&(l[h]=c[h])}return l},e=m,t=r(e);function r(l){return l&&l.__esModule?l:{default:l}}function i(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}function o(l,u){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:l}function a(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);l.prototype=Object.create(u&&u.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(l,u):l.__proto__=u)}var s=_o.active=function(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(h){a(p,h);function p(){var b,x,E,g;i(this,p);for(var v=arguments.length,C=Array(v),A=0;A<v;A++)C[A]=arguments[A];return g=(x=(E=o(this,(b=p.__proto__||Object.getPrototypeOf(p)).call.apply(b,[this].concat(C))),E),E.state={active:!1},E.handleMouseDown=function(){return E.setState({active:!0})},E.handleMouseUp=function(){return E.setState({active:!1})},E.render=function(){return t.default.createElement(c,{onMouseDown:E.handleMouseDown,onMouseUp:E.handleMouseUp},t.default.createElement(u,n({},E.props,E.state)))},x),o(E,g)}return p})(t.default.Component)};return _o.default=s,_o}var Fs={},T0;function L2(){if(T0)return Fs;T0=1,Object.defineProperty(Fs,"__esModule",{value:!0});var n=function(t,r){var i={},o=function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i[s]=l};return t===0&&o("first-child"),t===r-1&&o("last-child"),(t===0||t%2===0)&&o("even"),Math.abs(t%2)===1&&o("odd"),o("nth-child",t),i};return Fs.default=n,Fs}var I0;function B2(){if(I0)return Mn;I0=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.ReactCSS=Mn.loop=Mn.handleActive=Mn.handleHover=Mn.hover=void 0;var n=s2(),e=p(n),t=D2(),r=p(t),i=M2(),o=p(i),a=k2(),s=p(a),l=P2(),u=p(l),c=L2(),h=p(c);function p(x){return x&&x.__esModule?x:{default:x}}Mn.hover=s.default,Mn.handleHover=s.default,Mn.handleActive=u.default,Mn.loop=h.default;var b=Mn.ReactCSS=function(E){for(var g=arguments.length,v=Array(g>1?g-1:0),C=1;C<g;C++)v[C-1]=arguments[C];var A=(0,e.default)(v),_=(0,r.default)(E,A);return(0,o.default)(_)};return Mn.default=b,Mn}var Lp=B2();const ke=eo(Lp);var F2=function(e,t,r,i,o){var a=o.clientWidth,s=o.clientHeight,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,u=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(o.getBoundingClientRect().left+window.pageXOffset),h=u-(o.getBoundingClientRect().top+window.pageYOffset);if(r==="vertical"){var p=void 0;if(h<0?p=0:h>s?p=1:p=Math.round(h*100/s)/100,t.a!==p)return{h:t.h,s:t.s,l:t.l,a:p,source:"rgb"}}else{var b=void 0;if(c<0?b=0:c>a?b=1:b=Math.round(c*100/a)/100,i!==b)return{h:t.h,s:t.s,l:t.l,a:b,source:"rgb"}}return null},Rh={},G2=function(e,t,r,i){if(typeof document>"u"&&!i)return null;var o=i?new i:document.createElement("canvas");o.width=r*2,o.height=r*2;var a=o.getContext("2d");return a?(a.fillStyle=e,a.fillRect(0,0,o.width,o.height),a.fillStyle=t,a.fillRect(0,0,r,r),a.translate(r,r),a.fillRect(0,0,r,r),o.toDataURL()):null},q2=function(e,t,r,i){var o=e+"-"+t+"-"+r+(i?"-server":"");if(Rh[o])return Rh[o];var a=G2(e,t,r,i);return Rh[o]=a,a},S0=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ha=function(e){var t=e.white,r=e.grey,i=e.size,o=e.renderers,a=e.borderRadius,s=e.boxShadow,l=e.children,u=ke({default:{grid:{borderRadius:a,boxShadow:s,absolute:"0px 0px 0px 0px",background:"url("+q2(t,r,i,o.canvas)+") center left"}}});return m.isValidElement(l)?m.cloneElement(l,S0({},l.props,{style:S0({},l.props.style,u.grid)})):m.createElement("div",{style:u.grid})};ha.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var H2=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},V2=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function W2(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function R0(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function z2(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var Bp=(function(n){z2(e,n);function e(){var t,r,i,o;W2(this,e);for(var a=arguments.length,s=Array(a),l=0;l<a;l++)s[l]=arguments[l];return o=(r=(i=R0(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(s))),i),i.handleChange=function(u){var c=F2(u,i.props.hsl,i.props.direction,i.props.a,i.container);c&&typeof i.props.onChange=="function"&&i.props.onChange(c,u)},i.handleMouseDown=function(u){i.handleChange(u),window.addEventListener("mousemove",i.handleChange),window.addEventListener("mouseup",i.handleMouseUp)},i.handleMouseUp=function(){i.unbindEventListeners()},i.unbindEventListeners=function(){window.removeEventListener("mousemove",i.handleChange),window.removeEventListener("mouseup",i.handleMouseUp)},r),R0(i,o)}return V2(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var r=this,i=this.props.rgb,o=ke({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("+i.r+","+i.g+","+i.b+`, 0) 0%,
|
|
52
52
|
rgba(`+i.r+","+i.g+","+i.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:i.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("+i.r+","+i.g+","+i.b+`, 0) 0%,
|
|
53
|
-
rgba(`+i.r+","+i.g+","+i.b+", 1) 100%)"},pointer:{left:0,top:i.a*100+"%"}},overwrite:
|
|
53
|
+
rgba(`+i.r+","+i.g+","+i.b+", 1) 100%)"},pointer:{left:0,top:i.a*100+"%"}},overwrite:H2({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return m.createElement("div",{style:o.alpha},m.createElement("div",{style:o.checkboard},m.createElement(ha,{renderers:this.props.renderers})),m.createElement("div",{style:o.gradient}),m.createElement("div",{style:o.container,ref:function(s){return r.container=s},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},m.createElement("div",{style:o.pointer},this.props.pointer?m.createElement(this.props.pointer,this.props):m.createElement("div",{style:o.slider}))))}}]),e})(m.PureComponent||m.Component),X2=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function U2(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $2(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Y2(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function Z2(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var J2=1,jC=38,K2=40,Q2=[jC,K2],eR=function(e){return Q2.indexOf(e)>-1},tR=function(e){return Number(String(e).replace(/%/g,""))},nR=1,Je=(function(n){Z2(e,n);function e(t){$2(this,e);var r=Y2(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(i){r.setUpdatedValue(i.target.value,i)},r.handleKeyDown=function(i){var o=tR(i.target.value);if(!isNaN(o)&&eR(i.keyCode)){var a=r.getArrowOffset(),s=i.keyCode===jC?o+a:o-a;r.setUpdatedValue(s,i)}},r.handleDrag=function(i){if(r.props.dragLabel){var o=Math.round(r.props.value+i.movementX);o>=0&&o<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(o),i)}},r.handleMouseDown=function(i){r.props.dragLabel&&(i.preventDefault(),r.handleDrag(i),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(t.value).toUpperCase(),blurValue:String(t.value).toUpperCase()},r.inputId="rc-editable-input-"+nR++,r}return X2(e,[{key:"componentDidUpdate",value:function(r,i){this.props.value!==this.state.value&&(r.value!==this.props.value||i.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(r){return U2({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||J2}},{key:"setUpdatedValue",value:function(r,i){var o=this.props.label?this.getValueObjectWithLabel(r):r;this.props.onChange&&this.props.onChange(o,i),this.setState({value:r})}},{key:"render",value:function(){var r=this,i=ke({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 m.createElement("div",{style:i.wrap},m.createElement("input",{id:this.inputId,style:i.input,ref:function(a){return r.input=a},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?m.createElement("label",{htmlFor:this.inputId,style:i.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e})(m.PureComponent||m.Component),rR=function(e,t,r,i){var o=i.clientWidth,a=i.clientHeight,s=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,u=s-(i.getBoundingClientRect().left+window.pageXOffset),c=l-(i.getBoundingClientRect().top+window.pageYOffset);if(t==="vertical"){var h=void 0;if(c<0)h=359;else if(c>a)h=0;else{var p=-(c*100/a)+100;h=360*p/100}if(r.h!==h)return{h,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var b=void 0;if(u<0)b=0;else if(u>o)b=359;else{var x=u*100/o;b=360*x/100}if(r.h!==b)return{h:b,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},iR=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function oR(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function O0(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function aR(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var fa=(function(n){aR(e,n);function e(){var t,r,i,o;oR(this,e);for(var a=arguments.length,s=Array(a),l=0;l<a;l++)s[l]=arguments[l];return o=(r=(i=O0(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(s))),i),i.handleChange=function(u){var c=rR(u,i.props.direction,i.props.hsl,i.container);c&&typeof i.props.onChange=="function"&&i.props.onChange(c,u)},i.handleMouseDown=function(u){i.handleChange(u),window.addEventListener("mousemove",i.handleChange),window.addEventListener("mouseup",i.handleMouseUp)},i.handleMouseUp=function(){i.unbindEventListeners()},r),O0(i,o)}return iR(e,[{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 r=this,i=this.props.direction,o=i===void 0?"horizontal":i,a=ke({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:o==="vertical"});return m.createElement("div",{style:a.hue},m.createElement("div",{className:"hue-"+o,style:a.container,ref:function(l){return r.container=l},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},m.createElement("style",null,`
|
|
54
54
|
.hue-horizontal {
|
|
55
55
|
background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0
|
|
56
56
|
33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
|
@@ -64,8 +64,8 @@ Couldn't access "${t}" in ${JSON.stringify(n)}`)},gm=n=>typeof n=="object"&&n!==
|
|
|
64
64
|
background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,
|
|
65
65
|
#0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
|
66
66
|
}
|
|
67
|
-
`),m.createElement("div",{style:a.pointer},this.props.pointer?m.createElement(this.props.pointer,this.props):m.createElement("div",{style:a.slider}))))}}]),e})(m.PureComponent||m.Component);function F2(){this.__data__=[],this.size=0}function bs(n,e){return n===e||n!==n&&e!==e}function Xl(n,e){for(var t=n.length;t--;)if(bs(n[t][0],e))return t;return-1}var G2=Array.prototype,q2=G2.splice;function H2(n){var e=this.__data__,t=Xl(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():q2.call(e,t,1),--this.size,!0}function V2(n){var e=this.__data__,t=Xl(e,n);return t<0?void 0:e[t][1]}function W2(n){return Xl(this.__data__,n)>-1}function z2(n,e){var t=this.__data__,r=Xl(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function ai(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}ai.prototype.clear=F2;ai.prototype.delete=H2;ai.prototype.get=V2;ai.prototype.has=W2;ai.prototype.set=z2;function X2(){this.__data__=new ai,this.size=0}function U2(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function $2(n){return this.__data__.get(n)}function Y2(n){return this.__data__.has(n)}var vC=typeof global=="object"&&global&&global.Object===Object&&global,Z2=typeof self=="object"&&self&&self.Object===Object&&self,Sr=vC||Z2||Function("return this")(),qr=Sr.Symbol,yC=Object.prototype,J2=yC.hasOwnProperty,K2=yC.toString,Aa=qr?qr.toStringTag:void 0;function Q2(n){var e=J2.call(n,Aa),t=n[Aa];try{n[Aa]=void 0;var r=!0}catch{}var i=K2.call(n);return r&&(e?n[Aa]=t:delete n[Aa]),i}var eR=Object.prototype,tR=eR.toString;function nR(n){return tR.call(n)}var rR="[object Null]",iR="[object Undefined]",v0=qr?qr.toStringTag:void 0;function to(n){return n==null?n===void 0?iR:rR:v0&&v0 in Object(n)?Q2(n):nR(n)}function $n(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var oR="[object AsyncFunction]",aR="[object Function]",sR="[object GeneratorFunction]",lR="[object Proxy]";function Op(n){if(!$n(n))return!1;var e=to(n);return e==aR||e==sR||e==oR||e==lR}var _h=Sr["__core-js_shared__"],y0=(function(){var n=/[^.]+$/.exec(_h&&_h.keys&&_h.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function uR(n){return!!y0&&y0 in n}var cR=Function.prototype,dR=cR.toString;function no(n){if(n!=null){try{return dR.call(n)}catch{}try{return n+""}catch{}}return""}var hR=/[\\^$.*+?()[\]{}|]/g,fR=/^\[object .+?Constructor\]$/,pR=Function.prototype,gR=Object.prototype,mR=pR.toString,bR=gR.hasOwnProperty,vR=RegExp("^"+mR.call(bR).replace(hR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yR(n){if(!$n(n)||uR(n))return!1;var e=Op(n)?vR:fR;return e.test(no(n))}function xR(n,e){return n?.[e]}function ro(n,e){var t=xR(n,e);return yR(t)?t:void 0}var is=ro(Sr,"Map"),os=ro(Object,"create");function CR(){this.__data__=os?os(null):{},this.size=0}function ER(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var wR="__lodash_hash_undefined__",AR=Object.prototype,_R=AR.hasOwnProperty;function TR(n){var e=this.__data__;if(os){var t=e[n];return t===wR?void 0:t}return _R.call(e,n)?e[n]:void 0}var IR=Object.prototype,SR=IR.hasOwnProperty;function RR(n){var e=this.__data__;return os?e[n]!==void 0:SR.call(e,n)}var OR="__lodash_hash_undefined__";function NR(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=os&&e===void 0?OR:e,this}function Ui(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Ui.prototype.clear=CR;Ui.prototype.delete=ER;Ui.prototype.get=TR;Ui.prototype.has=RR;Ui.prototype.set=NR;function jR(){this.size=0,this.__data__={hash:new Ui,map:new(is||ai),string:new Ui}}function DR(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Ul(n,e){var t=n.__data__;return DR(e)?t[typeof e=="string"?"string":"hash"]:t.map}function MR(n){var e=Ul(this,n).delete(n);return this.size-=e?1:0,e}function kR(n){return Ul(this,n).get(n)}function LR(n){return Ul(this,n).has(n)}function PR(n,e){var t=Ul(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function si(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}si.prototype.clear=jR;si.prototype.delete=MR;si.prototype.get=kR;si.prototype.has=LR;si.prototype.set=PR;var BR=200;function FR(n,e){var t=this.__data__;if(t instanceof ai){var r=t.__data__;if(!is||r.length<BR-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new si(r)}return t.set(n,e),this.size=t.size,this}function _r(n){var e=this.__data__=new ai(n);this.size=e.size}_r.prototype.clear=X2;_r.prototype.delete=U2;_r.prototype.get=$2;_r.prototype.has=Y2;_r.prototype.set=FR;var ml=(function(){try{var n=ro(Object,"defineProperty");return n({},"",{}),n}catch{}})();function Np(n,e,t){e=="__proto__"&&ml?ml(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function xf(n,e,t){(t!==void 0&&!bs(n[e],t)||t===void 0&&!(e in n))&&Np(n,e,t)}function GR(n){return function(e,t,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[++i];if(t(o[l],l,o)===!1)break}return e}}var xC=GR(),CC=typeof exports=="object"&&exports&&!exports.nodeType&&exports,x0=CC&&typeof module=="object"&&module&&!module.nodeType&&module,qR=x0&&x0.exports===CC,C0=qR?Sr.Buffer:void 0,E0=C0?C0.allocUnsafe:void 0;function EC(n,e){if(e)return n.slice();var t=n.length,r=E0?E0(t):new n.constructor(t);return n.copy(r),r}var bl=Sr.Uint8Array;function jp(n){var e=new n.constructor(n.byteLength);return new bl(e).set(new bl(n)),e}function wC(n,e){var t=e?jp(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function HR(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var w0=Object.create,VR=(function(){function n(){}return function(e){if(!$n(e))return{};if(w0)return w0(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}})();function AC(n,e){return function(t){return n(e(t))}}var _C=AC(Object.getPrototypeOf,Object),WR=Object.prototype;function Dp(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||WR;return n===t}function TC(n){return typeof n.constructor=="function"&&!Dp(n)?VR(_C(n)):{}}function Hr(n){return n!=null&&typeof n=="object"}var zR="[object Arguments]";function A0(n){return Hr(n)&&to(n)==zR}var IC=Object.prototype,XR=IC.hasOwnProperty,UR=IC.propertyIsEnumerable,vl=A0((function(){return arguments})())?A0:function(n){return Hr(n)&&XR.call(n,"callee")&&!UR.call(n,"callee")},Pn=Array.isArray,$R=9007199254740991;function Mp(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=$R}function fa(n){return n!=null&&Mp(n.length)&&!Op(n)}function YR(n){return Hr(n)&&fa(n)}function ZR(){return!1}var SC=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_0=SC&&typeof module=="object"&&module&&!module.nodeType&&module,JR=_0&&_0.exports===SC,T0=JR?Sr.Buffer:void 0,KR=T0?T0.isBuffer:void 0,as=KR||ZR,QR="[object Object]",eO=Function.prototype,tO=Object.prototype,RC=eO.toString,nO=tO.hasOwnProperty,rO=RC.call(Object);function iO(n){if(!Hr(n)||to(n)!=QR)return!1;var e=_C(n);if(e===null)return!0;var t=nO.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&RC.call(t)==rO}var oO="[object Arguments]",aO="[object Array]",sO="[object Boolean]",lO="[object Date]",uO="[object Error]",cO="[object Function]",dO="[object Map]",hO="[object Number]",fO="[object Object]",pO="[object RegExp]",gO="[object Set]",mO="[object String]",bO="[object WeakMap]",vO="[object ArrayBuffer]",yO="[object DataView]",xO="[object Float32Array]",CO="[object Float64Array]",EO="[object Int8Array]",wO="[object Int16Array]",AO="[object Int32Array]",_O="[object Uint8Array]",TO="[object Uint8ClampedArray]",IO="[object Uint16Array]",SO="[object Uint32Array]",_t={};_t[xO]=_t[CO]=_t[EO]=_t[wO]=_t[AO]=_t[_O]=_t[TO]=_t[IO]=_t[SO]=!0;_t[oO]=_t[aO]=_t[vO]=_t[sO]=_t[yO]=_t[lO]=_t[uO]=_t[cO]=_t[dO]=_t[hO]=_t[fO]=_t[pO]=_t[gO]=_t[mO]=_t[bO]=!1;function RO(n){return Hr(n)&&Mp(n.length)&&!!_t[to(n)]}function kp(n){return function(e){return n(e)}}var OC=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ns=OC&&typeof module=="object"&&module&&!module.nodeType&&module,OO=ns&&ns.exports===OC,Th=OO&&vC.process,aa=(function(){try{var n=ns&&ns.require&&ns.require("util").types;return n||Th&&Th.binding&&Th.binding("util")}catch{}})(),I0=aa&&aa.isTypedArray,Lp=I0?kp(I0):RO;function Cf(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}var NO=Object.prototype,jO=NO.hasOwnProperty;function NC(n,e,t){var r=n[e];(!(jO.call(n,e)&&bs(r,t))||t===void 0&&!(e in n))&&Np(n,e,t)}function DO(n,e,t,r){var i=!t;t||(t={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=void 0;l===void 0&&(l=n[s]),i?Np(t,s,l):NC(t,s,l)}return t}function MO(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var kO=9007199254740991,LO=/^(?:0|[1-9]\d*)$/;function Pp(n,e){var t=typeof n;return e=e??kO,!!e&&(t=="number"||t!="symbol"&&LO.test(n))&&n>-1&&n%1==0&&n<e}var PO=Object.prototype,BO=PO.hasOwnProperty;function jC(n,e){var t=Pn(n),r=!t&&vl(n),i=!t&&!r&&as(n),o=!t&&!r&&!i&&Lp(n),a=t||r||i||o,s=a?MO(n.length,String):[],l=s.length;for(var u in n)(e||BO.call(n,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Pp(u,l)))&&s.push(u);return s}function FO(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var GO=Object.prototype,qO=GO.hasOwnProperty;function HO(n){if(!$n(n))return FO(n);var e=Dp(n),t=[];for(var r in n)r=="constructor"&&(e||!qO.call(n,r))||t.push(r);return t}function DC(n){return fa(n)?jC(n,!0):HO(n)}function VO(n){return DO(n,DC(n))}function WO(n,e,t,r,i,o,a){var s=Cf(n,t),l=Cf(e,t),u=a.get(l);if(u){xf(n,t,u);return}var c=o?o(s,l,t+"",n,e,a):void 0,h=c===void 0;if(h){var f=Pn(l),b=!f&&as(l),x=!f&&!b&&Lp(l);c=l,f||b||x?Pn(s)?c=s:YR(s)?c=HR(s):b?(h=!1,c=EC(l,!0)):x?(h=!1,c=wC(l,!0)):c=[]:iO(l)||vl(l)?(c=s,vl(s)?c=VO(s):(!$n(s)||Op(s))&&(c=TC(l))):h=!1}h&&(a.set(l,c),i(c,l,r,o,a),a.delete(l)),xf(n,t,c)}function MC(n,e,t,r,i){n!==e&&xC(e,function(o,a){if(i||(i=new _r),$n(o))WO(n,e,a,t,MC,r,i);else{var s=r?r(Cf(n,a),o,a+"",n,e,i):void 0;s===void 0&&(s=o),xf(n,a,s)}},DC)}function $l(n){return n}function zO(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}var S0=Math.max;function XO(n,e,t){return e=S0(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,o=S0(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=t(a),zO(n,this,s)}}function UO(n){return function(){return n}}var $O=ml?function(n,e){return ml(n,"toString",{configurable:!0,enumerable:!1,value:UO(e),writable:!0})}:$l,YO=800,ZO=16,JO=Date.now;function KO(n){var e=0,t=0;return function(){var r=JO(),i=ZO-(r-t);if(t=r,i>0){if(++e>=YO)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}var QO=KO($O);function e5(n,e){return QO(XO(n,e,$l),n+"")}function t5(n,e,t){if(!$n(t))return!1;var r=typeof e;return(r=="number"?fa(t)&&Pp(e,t.length):r=="string"&&e in t)?bs(t[e],n):!1}function n5(n){return e5(function(e,t){var r=-1,i=t.length,o=i>1?t[i-1]:void 0,a=i>2?t[2]:void 0;for(o=n.length>3&&typeof o=="function"?(i--,o):void 0,a&&t5(t[0],t[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=t[r];s&&n(e,s,r,o)}return e})}var Gt=n5(function(n,e,t){MC(n,e,t)}),vs=function(e){var t=e.zDepth,r=e.radius,i=e.background,o=e.children,a=e.styles,s=a===void 0?{}:a,l=ke(Gt({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:r,background:i}},"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%"}}},s),{"zDepth-1":t===1});return m.createElement("div",{style:l.wrap},m.createElement("div",{style:l.bg}),m.createElement("div",{style:l.content},o))};vs.propTypes={background:d.string,zDepth:d.oneOf([0,1,2,3,4,5]),radius:d.number,styles:d.object};vs.defaultProps={background:"#fff",zDepth:1,radius:2,styles:{}};var Ih=function(){return Sr.Date.now()},r5=/\s/;function i5(n){for(var e=n.length;e--&&r5.test(n.charAt(e)););return e}var o5=/^\s+/;function a5(n){return n&&n.slice(0,i5(n)+1).replace(o5,"")}var s5="[object Symbol]";function Yl(n){return typeof n=="symbol"||Hr(n)&&to(n)==s5}var R0=NaN,l5=/^[-+]0x[0-9a-f]+$/i,u5=/^0b[01]+$/i,c5=/^0o[0-7]+$/i,d5=parseInt;function O0(n){if(typeof n=="number")return n;if(Yl(n))return R0;if($n(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=$n(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=a5(n);var t=u5.test(n);return t||c5.test(n)?d5(n.slice(2),t?2:8):l5.test(n)?R0:+n}var h5="Expected a function",f5=Math.max,p5=Math.min;function kC(n,e,t){var r,i,o,a,s,l,u=0,c=!1,h=!1,f=!0;if(typeof n!="function")throw new TypeError(h5);e=O0(e)||0,$n(t)&&(c=!!t.leading,h="maxWait"in t,o=h?f5(O0(t.maxWait)||0,e):o,f="trailing"in t?!!t.trailing:f);function b(O){var T=r,D=i;return r=i=void 0,u=O,a=n.apply(D,T),a}function x(O){return u=O,s=setTimeout(y,e),c?b(O):a}function w(O){var T=O-l,D=O-u,M=e-T;return h?p5(M,o-D):M}function g(O){var T=O-l,D=O-u;return l===void 0||T>=e||T<0||h&&D>=o}function y(){var O=Ih();if(g(O))return C(O);s=setTimeout(y,w(O))}function C(O){return s=void 0,f&&r?b(O):(r=i=void 0,a)}function A(){s!==void 0&&clearTimeout(s),u=0,r=l=i=s=void 0}function _(){return s===void 0?a:C(Ih())}function N(){var O=Ih(),T=g(O);if(r=arguments,i=this,l=O,T){if(s===void 0)return x(l);if(h)return clearTimeout(s),s=setTimeout(y,e),b(l)}return s===void 0&&(s=setTimeout(y,e)),a}return N.cancel=A,N.flush=_,N}var g5="Expected a function";function m5(n,e,t){var r=!0,i=!0;if(typeof n!="function")throw new TypeError(g5);return $n(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),kC(n,e,{leading:r,maxWait:e,trailing:i})}var b5=function(e,t,r){var i=r.getBoundingClientRect(),o=i.width,a=i.height,s=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,u=s-(r.getBoundingClientRect().left+window.pageXOffset),c=l-(r.getBoundingClientRect().top+window.pageYOffset);u<0?u=0:u>o&&(u=o),c<0?c=0:c>a&&(c=a);var h=u/o,f=1-c/a;return{h:t.h,s:h,v:f,a:t.a,source:"hsv"}},v5=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function y5(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function x5(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function C5(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var Zl=(function(n){C5(e,n);function e(t){y5(this,e);var r=x5(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.handleChange=function(i){typeof r.props.onChange=="function"&&r.throttle(r.props.onChange,b5(i,r.props.hsl,r.container),i)},r.handleMouseDown=function(i){r.handleChange(i);var o=r.getContainerRenderWindow();o.addEventListener("mousemove",r.handleChange),o.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.throttle=m5(function(i,o,a){i(o,a)},50),r}return v5(e,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var r=this.container,i=window;!i.document.contains(r)&&i.parent!==i;)i=i.parent;return i}},{key:"unbindEventListeners",value:function(){var r=this.getContainerRenderWindow();r.removeEventListener("mousemove",this.handleChange),r.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var r=this,i=this.props.style||{},o=i.color,a=i.white,s=i.black,l=i.pointer,u=i.circle,c=ke({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),
|
|
68
|
-
0 0 1px 2px rgba(0,0,0,.4)`,borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:o,white:a,black:s,pointer:l,circle:u}},{custom:!!this.props.style});return m.createElement("div",{style:c.color,ref:function(
|
|
67
|
+
`),m.createElement("div",{style:a.pointer},this.props.pointer?m.createElement(this.props.pointer,this.props):m.createElement("div",{style:a.slider}))))}}]),e})(m.PureComponent||m.Component);function sR(){this.__data__=[],this.size=0}function ys(n,e){return n===e||n!==n&&e!==e}function Zl(n,e){for(var t=n.length;t--;)if(ys(n[t][0],e))return t;return-1}var lR=Array.prototype,uR=lR.splice;function cR(n){var e=this.__data__,t=Zl(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():uR.call(e,t,1),--this.size,!0}function dR(n){var e=this.__data__,t=Zl(e,n);return t<0?void 0:e[t][1]}function hR(n){return Zl(this.__data__,n)>-1}function fR(n,e){var t=this.__data__,r=Zl(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function si(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}si.prototype.clear=sR;si.prototype.delete=cR;si.prototype.get=dR;si.prototype.has=hR;si.prototype.set=fR;function pR(){this.__data__=new si,this.size=0}function gR(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function mR(n){return this.__data__.get(n)}function bR(n){return this.__data__.has(n)}var NC=typeof global=="object"&&global&&global.Object===Object&&global,vR=typeof self=="object"&&self&&self.Object===Object&&self,Rr=NC||vR||Function("return this")(),Hr=Rr.Symbol,DC=Object.prototype,yR=DC.hasOwnProperty,xR=DC.toString,Aa=Hr?Hr.toStringTag:void 0;function CR(n){var e=yR.call(n,Aa),t=n[Aa];try{n[Aa]=void 0;var r=!0}catch{}var i=xR.call(n);return r&&(e?n[Aa]=t:delete n[Aa]),i}var ER=Object.prototype,wR=ER.toString;function _R(n){return wR.call(n)}var AR="[object Null]",TR="[object Undefined]",j0=Hr?Hr.toStringTag:void 0;function io(n){return n==null?n===void 0?TR:AR:j0&&j0 in Object(n)?CR(n):_R(n)}function $n(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var IR="[object AsyncFunction]",SR="[object Function]",RR="[object GeneratorFunction]",OR="[object Proxy]";function Fp(n){if(!$n(n))return!1;var e=io(n);return e==SR||e==RR||e==IR||e==OR}var Oh=Rr["__core-js_shared__"],N0=(function(){var n=/[^.]+$/.exec(Oh&&Oh.keys&&Oh.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function jR(n){return!!N0&&N0 in n}var NR=Function.prototype,DR=NR.toString;function oo(n){if(n!=null){try{return DR.call(n)}catch{}try{return n+""}catch{}}return""}var MR=/[\\^$.*+?()[\]{}|]/g,kR=/^\[object .+?Constructor\]$/,PR=Function.prototype,LR=Object.prototype,BR=PR.toString,FR=LR.hasOwnProperty,GR=RegExp("^"+BR.call(FR).replace(MR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qR(n){if(!$n(n)||jR(n))return!1;var e=Fp(n)?GR:kR;return e.test(oo(n))}function HR(n,e){return n?.[e]}function ao(n,e){var t=HR(n,e);return qR(t)?t:void 0}var os=ao(Rr,"Map"),as=ao(Object,"create");function VR(){this.__data__=as?as(null):{},this.size=0}function WR(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var zR="__lodash_hash_undefined__",XR=Object.prototype,UR=XR.hasOwnProperty;function $R(n){var e=this.__data__;if(as){var t=e[n];return t===zR?void 0:t}return UR.call(e,n)?e[n]:void 0}var YR=Object.prototype,ZR=YR.hasOwnProperty;function JR(n){var e=this.__data__;return as?e[n]!==void 0:ZR.call(e,n)}var KR="__lodash_hash_undefined__";function QR(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=as&&e===void 0?KR:e,this}function Yi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Yi.prototype.clear=VR;Yi.prototype.delete=WR;Yi.prototype.get=$R;Yi.prototype.has=JR;Yi.prototype.set=QR;function eO(){this.size=0,this.__data__={hash:new Yi,map:new(os||si),string:new Yi}}function tO(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Jl(n,e){var t=n.__data__;return tO(e)?t[typeof e=="string"?"string":"hash"]:t.map}function nO(n){var e=Jl(this,n).delete(n);return this.size-=e?1:0,e}function rO(n){return Jl(this,n).get(n)}function iO(n){return Jl(this,n).has(n)}function oO(n,e){var t=Jl(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function li(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}li.prototype.clear=eO;li.prototype.delete=nO;li.prototype.get=rO;li.prototype.has=iO;li.prototype.set=oO;var aO=200;function sO(n,e){var t=this.__data__;if(t instanceof si){var r=t.__data__;if(!os||r.length<aO-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new li(r)}return t.set(n,e),this.size=t.size,this}function Tr(n){var e=this.__data__=new si(n);this.size=e.size}Tr.prototype.clear=pR;Tr.prototype.delete=gR;Tr.prototype.get=mR;Tr.prototype.has=bR;Tr.prototype.set=sO;var yl=(function(){try{var n=ao(Object,"defineProperty");return n({},"",{}),n}catch{}})();function Gp(n,e,t){e=="__proto__"&&yl?yl(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Af(n,e,t){(t!==void 0&&!ys(n[e],t)||t===void 0&&!(e in n))&&Gp(n,e,t)}function lO(n){return function(e,t,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[++i];if(t(o[l],l,o)===!1)break}return e}}var MC=lO(),kC=typeof exports=="object"&&exports&&!exports.nodeType&&exports,D0=kC&&typeof module=="object"&&module&&!module.nodeType&&module,uO=D0&&D0.exports===kC,M0=uO?Rr.Buffer:void 0,k0=M0?M0.allocUnsafe:void 0;function PC(n,e){if(e)return n.slice();var t=n.length,r=k0?k0(t):new n.constructor(t);return n.copy(r),r}var xl=Rr.Uint8Array;function qp(n){var e=new n.constructor(n.byteLength);return new xl(e).set(new xl(n)),e}function LC(n,e){var t=e?qp(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function cO(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var P0=Object.create,dO=(function(){function n(){}return function(e){if(!$n(e))return{};if(P0)return P0(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}})();function BC(n,e){return function(t){return n(e(t))}}var FC=BC(Object.getPrototypeOf,Object),hO=Object.prototype;function Hp(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||hO;return n===t}function GC(n){return typeof n.constructor=="function"&&!Hp(n)?dO(FC(n)):{}}function Vr(n){return n!=null&&typeof n=="object"}var fO="[object Arguments]";function L0(n){return Vr(n)&&io(n)==fO}var qC=Object.prototype,pO=qC.hasOwnProperty,gO=qC.propertyIsEnumerable,Cl=L0((function(){return arguments})())?L0:function(n){return Vr(n)&&pO.call(n,"callee")&&!gO.call(n,"callee")},Bn=Array.isArray,mO=9007199254740991;function Vp(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=mO}function pa(n){return n!=null&&Vp(n.length)&&!Fp(n)}function bO(n){return Vr(n)&&pa(n)}function vO(){return!1}var HC=typeof exports=="object"&&exports&&!exports.nodeType&&exports,B0=HC&&typeof module=="object"&&module&&!module.nodeType&&module,yO=B0&&B0.exports===HC,F0=yO?Rr.Buffer:void 0,xO=F0?F0.isBuffer:void 0,ss=xO||vO,CO="[object Object]",EO=Function.prototype,wO=Object.prototype,VC=EO.toString,_O=wO.hasOwnProperty,AO=VC.call(Object);function TO(n){if(!Vr(n)||io(n)!=CO)return!1;var e=FC(n);if(e===null)return!0;var t=_O.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&VC.call(t)==AO}var IO="[object Arguments]",SO="[object Array]",RO="[object Boolean]",OO="[object Date]",jO="[object Error]",NO="[object Function]",DO="[object Map]",MO="[object Number]",kO="[object Object]",PO="[object RegExp]",LO="[object Set]",BO="[object String]",FO="[object WeakMap]",GO="[object ArrayBuffer]",qO="[object DataView]",HO="[object Float32Array]",VO="[object Float64Array]",WO="[object Int8Array]",zO="[object Int16Array]",XO="[object Int32Array]",UO="[object Uint8Array]",$O="[object Uint8ClampedArray]",YO="[object Uint16Array]",ZO="[object Uint32Array]",Tt={};Tt[HO]=Tt[VO]=Tt[WO]=Tt[zO]=Tt[XO]=Tt[UO]=Tt[$O]=Tt[YO]=Tt[ZO]=!0;Tt[IO]=Tt[SO]=Tt[GO]=Tt[RO]=Tt[qO]=Tt[OO]=Tt[jO]=Tt[NO]=Tt[DO]=Tt[MO]=Tt[kO]=Tt[PO]=Tt[LO]=Tt[BO]=Tt[FO]=!1;function JO(n){return Vr(n)&&Vp(n.length)&&!!Tt[io(n)]}function Wp(n){return function(e){return n(e)}}var WC=typeof exports=="object"&&exports&&!exports.nodeType&&exports,rs=WC&&typeof module=="object"&&module&&!module.nodeType&&module,KO=rs&&rs.exports===WC,jh=KO&&NC.process,la=(function(){try{var n=rs&&rs.require&&rs.require("util").types;return n||jh&&jh.binding&&jh.binding("util")}catch{}})(),G0=la&&la.isTypedArray,zp=G0?Wp(G0):JO;function Tf(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}var QO=Object.prototype,e5=QO.hasOwnProperty;function zC(n,e,t){var r=n[e];(!(e5.call(n,e)&&ys(r,t))||t===void 0&&!(e in n))&&Gp(n,e,t)}function t5(n,e,t,r){var i=!t;t||(t={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=void 0;l===void 0&&(l=n[s]),i?Gp(t,s,l):zC(t,s,l)}return t}function n5(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var r5=9007199254740991,i5=/^(?:0|[1-9]\d*)$/;function Xp(n,e){var t=typeof n;return e=e??r5,!!e&&(t=="number"||t!="symbol"&&i5.test(n))&&n>-1&&n%1==0&&n<e}var o5=Object.prototype,a5=o5.hasOwnProperty;function XC(n,e){var t=Bn(n),r=!t&&Cl(n),i=!t&&!r&&ss(n),o=!t&&!r&&!i&&zp(n),a=t||r||i||o,s=a?n5(n.length,String):[],l=s.length;for(var u in n)(e||a5.call(n,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Xp(u,l)))&&s.push(u);return s}function s5(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var l5=Object.prototype,u5=l5.hasOwnProperty;function c5(n){if(!$n(n))return s5(n);var e=Hp(n),t=[];for(var r in n)r=="constructor"&&(e||!u5.call(n,r))||t.push(r);return t}function UC(n){return pa(n)?XC(n,!0):c5(n)}function d5(n){return t5(n,UC(n))}function h5(n,e,t,r,i,o,a){var s=Tf(n,t),l=Tf(e,t),u=a.get(l);if(u){Af(n,t,u);return}var c=o?o(s,l,t+"",n,e,a):void 0,h=c===void 0;if(h){var p=Bn(l),b=!p&&ss(l),x=!p&&!b&&zp(l);c=l,p||b||x?Bn(s)?c=s:bO(s)?c=cO(s):b?(h=!1,c=PC(l,!0)):x?(h=!1,c=LC(l,!0)):c=[]:TO(l)||Cl(l)?(c=s,Cl(s)?c=d5(s):(!$n(s)||Fp(s))&&(c=GC(l))):h=!1}h&&(a.set(l,c),i(c,l,r,o,a),a.delete(l)),Af(n,t,c)}function $C(n,e,t,r,i){n!==e&&MC(e,function(o,a){if(i||(i=new Tr),$n(o))h5(n,e,a,t,$C,r,i);else{var s=r?r(Tf(n,a),o,a+"",n,e,i):void 0;s===void 0&&(s=o),Af(n,a,s)}},UC)}function Kl(n){return n}function f5(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}var q0=Math.max;function p5(n,e,t){return e=q0(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,o=q0(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=t(a),f5(n,this,s)}}function g5(n){return function(){return n}}var m5=yl?function(n,e){return yl(n,"toString",{configurable:!0,enumerable:!1,value:g5(e),writable:!0})}:Kl,b5=800,v5=16,y5=Date.now;function x5(n){var e=0,t=0;return function(){var r=y5(),i=v5-(r-t);if(t=r,i>0){if(++e>=b5)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}var C5=x5(m5);function E5(n,e){return C5(p5(n,e,Kl),n+"")}function w5(n,e,t){if(!$n(t))return!1;var r=typeof e;return(r=="number"?pa(t)&&Xp(e,t.length):r=="string"&&e in t)?ys(t[e],n):!1}function _5(n){return E5(function(e,t){var r=-1,i=t.length,o=i>1?t[i-1]:void 0,a=i>2?t[2]:void 0;for(o=n.length>3&&typeof o=="function"?(i--,o):void 0,a&&w5(t[0],t[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=t[r];s&&n(e,s,r,o)}return e})}var qt=_5(function(n,e,t){$C(n,e,t)}),xs=function(e){var t=e.zDepth,r=e.radius,i=e.background,o=e.children,a=e.styles,s=a===void 0?{}:a,l=ke(qt({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:r,background:i}},"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%"}}},s),{"zDepth-1":t===1});return m.createElement("div",{style:l.wrap},m.createElement("div",{style:l.bg}),m.createElement("div",{style:l.content},o))};xs.propTypes={background:d.string,zDepth:d.oneOf([0,1,2,3,4,5]),radius:d.number,styles:d.object};xs.defaultProps={background:"#fff",zDepth:1,radius:2,styles:{}};var Nh=function(){return Rr.Date.now()},A5=/\s/;function T5(n){for(var e=n.length;e--&&A5.test(n.charAt(e)););return e}var I5=/^\s+/;function S5(n){return n&&n.slice(0,T5(n)+1).replace(I5,"")}var R5="[object Symbol]";function Ql(n){return typeof n=="symbol"||Vr(n)&&io(n)==R5}var H0=NaN,O5=/^[-+]0x[0-9a-f]+$/i,j5=/^0b[01]+$/i,N5=/^0o[0-7]+$/i,D5=parseInt;function V0(n){if(typeof n=="number")return n;if(Ql(n))return H0;if($n(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=$n(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=S5(n);var t=j5.test(n);return t||N5.test(n)?D5(n.slice(2),t?2:8):O5.test(n)?H0:+n}var M5="Expected a function",k5=Math.max,P5=Math.min;function YC(n,e,t){var r,i,o,a,s,l,u=0,c=!1,h=!1,p=!0;if(typeof n!="function")throw new TypeError(M5);e=V0(e)||0,$n(t)&&(c=!!t.leading,h="maxWait"in t,o=h?k5(V0(t.maxWait)||0,e):o,p="trailing"in t?!!t.trailing:p);function b(R){var I=r,N=i;return r=i=void 0,u=R,a=n.apply(N,I),a}function x(R){return u=R,s=setTimeout(v,e),c?b(R):a}function E(R){var I=R-l,N=R-u,L=e-I;return h?P5(L,o-N):L}function g(R){var I=R-l,N=R-u;return l===void 0||I>=e||I<0||h&&N>=o}function v(){var R=Nh();if(g(R))return C(R);s=setTimeout(v,E(R))}function C(R){return s=void 0,p&&r?b(R):(r=i=void 0,a)}function A(){s!==void 0&&clearTimeout(s),u=0,r=l=i=s=void 0}function _(){return s===void 0?a:C(Nh())}function O(){var R=Nh(),I=g(R);if(r=arguments,i=this,l=R,I){if(s===void 0)return x(l);if(h)return clearTimeout(s),s=setTimeout(v,e),b(l)}return s===void 0&&(s=setTimeout(v,e)),a}return O.cancel=A,O.flush=_,O}var L5="Expected a function";function B5(n,e,t){var r=!0,i=!0;if(typeof n!="function")throw new TypeError(L5);return $n(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),YC(n,e,{leading:r,maxWait:e,trailing:i})}var F5=function(e,t,r){var i=r.getBoundingClientRect(),o=i.width,a=i.height,s=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,u=s-(r.getBoundingClientRect().left+window.pageXOffset),c=l-(r.getBoundingClientRect().top+window.pageYOffset);u<0?u=0:u>o&&(u=o),c<0?c=0:c>a&&(c=a);var h=u/o,p=1-c/a;return{h:t.h,s:h,v:p,a:t.a,source:"hsv"}},G5=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function q5(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function H5(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function V5(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var eu=(function(n){V5(e,n);function e(t){q5(this,e);var r=H5(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.handleChange=function(i){typeof r.props.onChange=="function"&&r.throttle(r.props.onChange,F5(i,r.props.hsl,r.container),i)},r.handleMouseDown=function(i){r.handleChange(i);var o=r.getContainerRenderWindow();o.addEventListener("mousemove",r.handleChange),o.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.throttle=B5(function(i,o,a){i(o,a)},50),r}return G5(e,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var r=this.container,i=window;!i.document.contains(r)&&i.parent!==i;)i=i.parent;return i}},{key:"unbindEventListeners",value:function(){var r=this.getContainerRenderWindow();r.removeEventListener("mousemove",this.handleChange),r.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var r=this,i=this.props.style||{},o=i.color,a=i.white,s=i.black,l=i.pointer,u=i.circle,c=ke({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),
|
|
68
|
+
0 0 1px 2px rgba(0,0,0,.4)`,borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:o,white:a,black:s,pointer:l,circle:u}},{custom:!!this.props.style});return m.createElement("div",{style:c.color,ref:function(p){return r.container=p},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},m.createElement("style",null,`
|
|
69
69
|
.saturation-white {
|
|
70
70
|
background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));
|
|
71
71
|
background: linear-gradient(to right, #fff, rgba(255,255,255,0));
|
|
@@ -74,60 +74,60 @@ Couldn't access "${t}" in ${JSON.stringify(n)}`)},gm=n=>typeof n=="object"&&n!==
|
|
|
74
74
|
background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));
|
|
75
75
|
background: linear-gradient(to top, #000, rgba(0,0,0,0));
|
|
76
76
|
}
|
|
77
|
-
`),m.createElement("div",{style:c.white,className:"saturation-white"},m.createElement("div",{style:c.black,className:"saturation-black"}),m.createElement("div",{style:c.pointer},this.props.pointer?m.createElement(this.props.pointer,this.props):m.createElement("div",{style:c.circle}))))}}]),e})(m.PureComponent||m.Component);function LC(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var E5=AC(Object.keys,Object),w5=Object.prototype,A5=w5.hasOwnProperty;function _5(n){if(!Dp(n))return E5(n);var e=[];for(var t in Object(n))A5.call(n,t)&&t!="constructor"&&e.push(t);return e}function Bp(n){return fa(n)?jC(n):_5(n)}function T5(n,e){return n&&xC(n,e,Bp)}function I5(n,e){return function(t,r){if(t==null)return t;if(!fa(t))return n(t,r);for(var i=t.length,o=-1,a=Object(t);++o<i&&r(a[o],o,a)!==!1;);return t}}var PC=I5(T5);function S5(n){return typeof n=="function"?n:$l}function R5(n,e){var t=Pn(n)?LC:PC;return t(n,S5(e))}function yl(n){"@babel/helpers - typeof";return yl=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},yl(n)}var O5=/^\s+/,N5=/\s+$/;function ge(n,e){if(n=n||"",e=e||{},n instanceof ge)return n;if(!(this instanceof ge))return new ge(n,e);var t=j5(n);this._originalInput=n,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.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=t.ok}ge.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,r,i,o,a,s;return t=e.r/255,r=e.g/255,i=e.b/255,t<=.03928?o=t/12.92:o=Math.pow((t+.055)/1.055,2.4),r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),.2126*o+.7152*a+.0722*s},setAlpha:function(e){return this._a=BC(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=j0(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=j0(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+r+"%, "+i+"%)":"hsva("+t+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=N0(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=N0(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+r+"%, "+i+"%)":"hsla("+t+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return D0(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return L5(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(Rt(this._r,255)*100)+"%",g:Math.round(Rt(this._g,255)*100)+"%",b:Math.round(Rt(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Rt(this._r,255)*100)+"%, "+Math.round(Rt(this._g,255)*100)+"%, "+Math.round(Rt(this._b,255)*100)+"%)":"rgba("+Math.round(Rt(this._r,255)*100)+"%, "+Math.round(Rt(this._g,255)*100)+"%, "+Math.round(Rt(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:$5[D0(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t="#"+M0(this._r,this._g,this._b,this._a),r=t,i=this._gradientType?"GradientType = 1, ":"";if(e){var o=ge(e);r="#"+M0(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,i=this._a<1&&this._a>=0,o=!t&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return ge(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(G5,arguments)},brighten:function(){return this._applyModification(q5,arguments)},darken:function(){return this._applyModification(H5,arguments)},desaturate:function(){return this._applyModification(P5,arguments)},saturate:function(){return this._applyModification(B5,arguments)},greyscale:function(){return this._applyModification(F5,arguments)},spin:function(){return this._applyModification(V5,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(X5,arguments)},complement:function(){return this._applyCombination(W5,arguments)},monochromatic:function(){return this._applyCombination(U5,arguments)},splitcomplement:function(){return this._applyCombination(z5,arguments)},triad:function(){return this._applyCombination(k0,[3])},tetrad:function(){return this._applyCombination(k0,[4])}};ge.fromRatio=function(n,e){if(yl(n)=="object"){var t={};for(var r in n)n.hasOwnProperty(r)&&(r==="a"?t[r]=n[r]:t[r]=qa(n[r]));n=t}return ge(n,e)};function j5(n){var e={r:0,g:0,b:0},t=1,r=null,i=null,o=null,a=!1,s=!1;return typeof n=="string"&&(n=K5(n)),yl(n)=="object"&&(Qr(n.r)&&Qr(n.g)&&Qr(n.b)?(e=D5(n.r,n.g,n.b),a=!0,s=String(n.r).substr(-1)==="%"?"prgb":"rgb"):Qr(n.h)&&Qr(n.s)&&Qr(n.v)?(r=qa(n.s),i=qa(n.v),e=k5(n.h,r,i),a=!0,s="hsv"):Qr(n.h)&&Qr(n.s)&&Qr(n.l)&&(r=qa(n.s),o=qa(n.l),e=M5(n.h,r,o),a=!0,s="hsl"),n.hasOwnProperty("a")&&(t=n.a)),t=BC(t),{ok:a,format:n.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}function D5(n,e,t){return{r:Rt(n,255)*255,g:Rt(e,255)*255,b:Rt(t,255)*255}}function N0(n,e,t){n=Rt(n,255),e=Rt(e,255),t=Rt(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),o,a,s=(r+i)/2;if(r==i)o=a=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case n:o=(e-t)/l+(e<t?6:0);break;case e:o=(t-n)/l+2;break;case t:o=(n-e)/l+4;break}o/=6}return{h:o,s:a,l:s}}function M5(n,e,t){var r,i,o;n=Rt(n,360),e=Rt(e,100),t=Rt(t,100);function a(u,c,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?u+(c-u)*6*h:h<1/2?c:h<2/3?u+(c-u)*(2/3-h)*6:u}if(e===0)r=i=o=t;else{var s=t<.5?t*(1+e):t+e-t*e,l=2*t-s;r=a(l,s,n+1/3),i=a(l,s,n),o=a(l,s,n-1/3)}return{r:r*255,g:i*255,b:o*255}}function j0(n,e,t){n=Rt(n,255),e=Rt(e,255),t=Rt(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),o,a,s=r,l=r-i;if(a=r===0?0:l/r,r==i)o=0;else{switch(r){case n:o=(e-t)/l+(e<t?6:0);break;case e:o=(t-n)/l+2;break;case t:o=(n-e)/l+4;break}o/=6}return{h:o,s:a,v:s}}function k5(n,e,t){n=Rt(n,360)*6,e=Rt(e,100),t=Rt(t,100);var r=Math.floor(n),i=n-r,o=t*(1-e),a=t*(1-i*e),s=t*(1-(1-i)*e),l=r%6,u=[t,a,o,o,s,t][l],c=[s,t,t,a,o,o][l],h=[o,o,s,t,t,a][l];return{r:u*255,g:c*255,b:h*255}}function D0(n,e,t,r){var i=[Ar(Math.round(n).toString(16)),Ar(Math.round(e).toString(16)),Ar(Math.round(t).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 L5(n,e,t,r,i){var o=[Ar(Math.round(n).toString(16)),Ar(Math.round(e).toString(16)),Ar(Math.round(t).toString(16)),Ar(FC(r))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function M0(n,e,t,r){var i=[Ar(FC(r)),Ar(Math.round(n).toString(16)),Ar(Math.round(e).toString(16)),Ar(Math.round(t).toString(16))];return i.join("")}ge.equals=function(n,e){return!n||!e?!1:ge(n).toRgbString()==ge(e).toRgbString()};ge.random=function(){return ge.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function P5(n,e){e=e===0?0:e||10;var t=ge(n).toHsl();return t.s-=e/100,t.s=Jl(t.s),ge(t)}function B5(n,e){e=e===0?0:e||10;var t=ge(n).toHsl();return t.s+=e/100,t.s=Jl(t.s),ge(t)}function F5(n){return ge(n).desaturate(100)}function G5(n,e){e=e===0?0:e||10;var t=ge(n).toHsl();return t.l+=e/100,t.l=Jl(t.l),ge(t)}function q5(n,e){e=e===0?0:e||10;var t=ge(n).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),ge(t)}function H5(n,e){e=e===0?0:e||10;var t=ge(n).toHsl();return t.l-=e/100,t.l=Jl(t.l),ge(t)}function V5(n,e){var t=ge(n).toHsl(),r=(t.h+e)%360;return t.h=r<0?360+r:r,ge(t)}function W5(n){var e=ge(n).toHsl();return e.h=(e.h+180)%360,ge(e)}function k0(n,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=ge(n).toHsl(),r=[ge(n)],i=360/e,o=1;o<e;o++)r.push(ge({h:(t.h+o*i)%360,s:t.s,l:t.l}));return r}function z5(n){var e=ge(n).toHsl(),t=e.h;return[ge(n),ge({h:(t+72)%360,s:e.s,l:e.l}),ge({h:(t+216)%360,s:e.s,l:e.l})]}function X5(n,e,t){e=e||6,t=t||30;var r=ge(n).toHsl(),i=360/t,o=[ge(n)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(ge(r));return o}function U5(n,e){e=e||6;for(var t=ge(n).toHsv(),r=t.h,i=t.s,o=t.v,a=[],s=1/e;e--;)a.push(ge({h:r,s:i,v:o})),o=(o+s)%1;return a}ge.mix=function(n,e,t){t=t===0?0:t||50;var r=ge(n).toRgb(),i=ge(e).toRgb(),o=t/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return ge(a)};ge.readability=function(n,e){var t=ge(n),r=ge(e);return(Math.max(t.getLuminance(),r.getLuminance())+.05)/(Math.min(t.getLuminance(),r.getLuminance())+.05)};ge.isReadable=function(n,e,t){var r=ge.readability(n,e),i,o;switch(o=!1,i=Q5(t),i.level+i.size){case"AAsmall":case"AAAlarge":o=r>=4.5;break;case"AAlarge":o=r>=3;break;case"AAAsmall":o=r>=7;break}return o};ge.mostReadable=function(n,e,t){var r=null,i=0,o,a,s,l;t=t||{},a=t.includeFallbackColors,s=t.level,l=t.size;for(var u=0;u<e.length;u++)o=ge.readability(n,e[u]),o>i&&(i=o,r=ge(e[u]));return ge.isReadable(n,r,{level:s,size:l})||!a?r:(t.includeFallbackColors=!1,ge.mostReadable(n,["#fff","#000"],t))};var Ef=ge.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"},$5=ge.hexNames=Y5(Ef);function Y5(n){var e={};for(var t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function BC(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Rt(n,e){Z5(n)&&(n="100%");var t=J5(n);return n=Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(n*e,10)/100),Math.abs(n-e)<1e-6?1:n%e/parseFloat(e)}function Jl(n){return Math.min(1,Math.max(0,n))}function zn(n){return parseInt(n,16)}function Z5(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function J5(n){return typeof n=="string"&&n.indexOf("%")!=-1}function Ar(n){return n.length==1?"0"+n:""+n}function qa(n){return n<=1&&(n=n*100+"%"),n}function FC(n){return Math.round(parseFloat(n)*255).toString(16)}function L0(n){return zn(n)/255}var yr=(function(){var n="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+n+")",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),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 Qr(n){return!!yr.CSS_UNIT.exec(n)}function K5(n){n=n.replace(O5,"").replace(N5,"").toLowerCase();var e=!1;if(Ef[n])n=Ef[n],e=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=yr.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=yr.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=yr.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=yr.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=yr.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=yr.hsva.exec(n))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=yr.hex8.exec(n))?{r:zn(t[1]),g:zn(t[2]),b:zn(t[3]),a:L0(t[4]),format:e?"name":"hex8"}:(t=yr.hex6.exec(n))?{r:zn(t[1]),g:zn(t[2]),b:zn(t[3]),format:e?"name":"hex"}:(t=yr.hex4.exec(n))?{r:zn(t[1]+""+t[1]),g:zn(t[2]+""+t[2]),b:zn(t[3]+""+t[3]),a:L0(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=yr.hex3.exec(n))?{r:zn(t[1]+""+t[1]),g:zn(t[2]+""+t[2]),b:zn(t[3]+""+t[3]),format:e?"name":"hex"}:!1}function Q5(n){var e,t;return n=n||{level:"AA",size:"small"},e=(n.level||"AA").toUpperCase(),t=(n.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}var P0=function(e){var t=["r","g","b","a","h","s","l","v"],r=0,i=0;return R5(t,function(o){if(e[o]&&(r+=1,isNaN(e[o])||(i+=1),o==="s"||o==="l")){var a=/^\d+%$/;a.test(e[o])&&(i+=1)}}),r===i?e:!1},Ha=function(e,t){var r=e.hex?ge(e.hex):ge(e),i=r.toHsl(),o=r.toHsv(),a=r.toRgb(),s=r.toHex();i.s===0&&(i.h=t||0,o.h=t||0);var l=s==="000000"&&a.a===0;return{hsl:i,hex:l?"transparent":"#"+s,rgb:a,hsv:o,oldHue:e.h||t||i.h,source:e.source}},Si=function(e){if(e==="transparent")return!0;var t=String(e).charAt(0)==="#"?1:0;return e.length!==4+t&&e.length<7+t&&ge(e).isValid()},Fp=function(e){if(!e)return"#fff";var t=Ha(e);if(t.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(t.rgb.r*299+t.rgb.g*587+t.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},Sh=function(e,t){var r=e.replace("°","");return ge(t+" ("+r+")")._ok},_a=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},eN=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function tN(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function nN(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function rN(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var Fn=function(e){var t=(function(r){rN(i,r);function i(o){tN(this,i);var a=nN(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));return a.handleChange=function(s,l){var u=P0(s);if(u){var c=Ha(s,s.h||a.state.oldHue);a.setState(c),a.props.onChangeComplete&&a.debounce(a.props.onChangeComplete,c,l),a.props.onChange&&a.props.onChange(c,l)}},a.handleSwatchHover=function(s,l){var u=P0(s);if(u){var c=Ha(s,s.h||a.state.oldHue);a.props.onSwatchHover&&a.props.onSwatchHover(c,l)}},a.state=_a({},Ha(o.color,0)),a.debounce=kC(function(s,l,u){s(l,u)},100),a}return eN(i,[{key:"render",value:function(){var a={};return this.props.onSwatchHover&&(a.onSwatchHover=this.handleSwatchHover),m.createElement(e,_a({},this.props,this.state,{onChange:this.handleChange},a))}}],[{key:"getDerivedStateFromProps",value:function(a,s){return _a({},Ha(a.color,s.oldHue))}}]),i})(m.PureComponent||m.Component);return t.propTypes=_a({},e.propTypes),t.defaultProps=_a({},e.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),t},iN=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},oN=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function aN(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function B0(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function sN(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var lN=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(r){sN(i,r);function i(){var o,a,s,l;aN(this,i);for(var u=arguments.length,c=Array(u),h=0;h<u;h++)c[h]=arguments[h];return l=(a=(s=B0(this,(o=i.__proto__||Object.getPrototypeOf(i)).call.apply(o,[this].concat(c))),s),s.state={focus:!1},s.handleFocus=function(){return s.setState({focus:!0})},s.handleBlur=function(){return s.setState({focus:!1})},a),B0(s,l)}return oN(i,[{key:"render",value:function(){return m.createElement(t,{onFocus:this.handleFocus,onBlur:this.handleBlur},m.createElement(e,iN({},this.props,this.state)))}}]),i})(m.Component)},F0=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},uN=13,cN=function(e){var t=e.color,r=e.style,i=e.onClick,o=i===void 0?function(){}:i,a=e.onHover,s=e.title,l=s===void 0?t:s,u=e.children,c=e.focus,h=e.focusStyle,f=h===void 0?{}:h,b=t==="transparent",x=ke({default:{swatch:F0({background:t,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},r,c?f:{})}}),w=function(_){return o(t,_)},g=function(_){return _.keyCode===uN&&o(t,_)},y=function(_){return a(t,_)},C={};return a&&(C.onMouseOver=y),m.createElement("div",F0({style:x.swatch,onClick:w,title:l,tabIndex:0,onKeyDown:g},C),u,b&&m.createElement(da,{borderRadius:x.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))};const io=lN(cN);var dN=function(e){var t=e.direction,r=ke({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 m.createElement("div",{style:r.picker})},hN=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},GC=function(e){var t=e.rgb,r=e.hsl,i=e.width,o=e.height,a=e.onChange,s=e.direction,l=e.style,u=e.renderers,c=e.pointer,h=e.className,f=h===void 0?"":h,b=ke({default:{picker:{position:"relative",width:i,height:o},alpha:{radius:"2px",style:l}}});return m.createElement("div",{style:b.picker,className:"alpha-picker "+f},m.createElement(Rp,hN({},b.alpha,{rgb:t,hsl:r,pointer:c,renderers:u,onChange:a,direction:s})))};GC.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:dN};Fn(GC);function qC(n,e){for(var t=-1,r=n==null?0:n.length,i=Array(r);++t<r;)i[t]=e(n[t],t,n);return i}var fN="__lodash_hash_undefined__";function pN(n){return this.__data__.set(n,fN),this}function gN(n){return this.__data__.has(n)}function xl(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new si;++e<t;)this.add(n[e])}xl.prototype.add=xl.prototype.push=pN;xl.prototype.has=gN;function mN(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function bN(n,e){return n.has(e)}var vN=1,yN=2;function HC(n,e,t,r,i,o){var a=t&vN,s=n.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(n),c=o.get(e);if(u&&c)return u==e&&c==n;var h=-1,f=!0,b=t&yN?new xl:void 0;for(o.set(n,e),o.set(e,n);++h<s;){var x=n[h],w=e[h];if(r)var g=a?r(w,x,h,e,n,o):r(x,w,h,n,e,o);if(g!==void 0){if(g)continue;f=!1;break}if(b){if(!mN(e,function(y,C){if(!bN(b,C)&&(x===y||i(x,y,t,r,o)))return b.push(C)})){f=!1;break}}else if(!(x===w||i(x,w,t,r,o))){f=!1;break}}return o.delete(n),o.delete(e),f}function xN(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function CN(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var EN=1,wN=2,AN="[object Boolean]",_N="[object Date]",TN="[object Error]",IN="[object Map]",SN="[object Number]",RN="[object RegExp]",ON="[object Set]",NN="[object String]",jN="[object Symbol]",DN="[object ArrayBuffer]",MN="[object DataView]",G0=qr?qr.prototype:void 0,Rh=G0?G0.valueOf:void 0;function kN(n,e,t,r,i,o,a){switch(t){case MN:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case DN:return!(n.byteLength!=e.byteLength||!o(new bl(n),new bl(e)));case AN:case _N:case SN:return bs(+n,+e);case TN:return n.name==e.name&&n.message==e.message;case RN:case NN:return n==e+"";case IN:var s=xN;case ON:var l=r&EN;if(s||(s=CN),n.size!=e.size&&!l)return!1;var u=a.get(n);if(u)return u==e;r|=wN,a.set(n,e);var c=HC(s(n),s(e),r,i,o,a);return a.delete(n),c;case jN:if(Rh)return Rh.call(n)==Rh.call(e)}return!1}function LN(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}function PN(n,e,t){var r=e(n);return Pn(n)?r:LN(r,t(n))}function BN(n,e){for(var t=-1,r=n==null?0:n.length,i=0,o=[];++t<r;){var a=n[t];e(a,t,n)&&(o[i++]=a)}return o}function FN(){return[]}var GN=Object.prototype,qN=GN.propertyIsEnumerable,q0=Object.getOwnPropertySymbols,HN=q0?function(n){return n==null?[]:(n=Object(n),BN(q0(n),function(e){return qN.call(n,e)}))}:FN;function wf(n){return PN(n,Bp,HN)}var VN=1,WN=Object.prototype,zN=WN.hasOwnProperty;function XN(n,e,t,r,i,o){var a=t&VN,s=wf(n),l=s.length,u=wf(e),c=u.length;if(l!=c&&!a)return!1;for(var h=l;h--;){var f=s[h];if(!(a?f in e:zN.call(e,f)))return!1}var b=o.get(n),x=o.get(e);if(b&&x)return b==e&&x==n;var w=!0;o.set(n,e),o.set(e,n);for(var g=a;++h<l;){f=s[h];var y=n[f],C=e[f];if(r)var A=a?r(C,y,f,e,n,o):r(y,C,f,n,e,o);if(!(A===void 0?y===C||i(y,C,t,r,o):A)){w=!1;break}g||(g=f=="constructor")}if(w&&!g){var _=n.constructor,N=e.constructor;_!=N&&"constructor"in n&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof N=="function"&&N instanceof N)&&(w=!1)}return o.delete(n),o.delete(e),w}var Af=ro(Sr,"DataView"),_f=ro(Sr,"Promise"),Tf=ro(Sr,"Set"),If=ro(Sr,"WeakMap"),H0="[object Map]",UN="[object Object]",V0="[object Promise]",W0="[object Set]",z0="[object WeakMap]",X0="[object DataView]",$N=no(Af),YN=no(is),ZN=no(_f),JN=no(Tf),KN=no(If),Cr=to;(Af&&Cr(new Af(new ArrayBuffer(1)))!=X0||is&&Cr(new is)!=H0||_f&&Cr(_f.resolve())!=V0||Tf&&Cr(new Tf)!=W0||If&&Cr(new If)!=z0)&&(Cr=function(n){var e=to(n),t=e==UN?n.constructor:void 0,r=t?no(t):"";if(r)switch(r){case $N:return X0;case YN:return H0;case ZN:return V0;case JN:return W0;case KN:return z0}return e});var QN=1,U0="[object Arguments]",$0="[object Array]",Bs="[object Object]",ej=Object.prototype,Y0=ej.hasOwnProperty;function tj(n,e,t,r,i,o){var a=Pn(n),s=Pn(e),l=a?$0:Cr(n),u=s?$0:Cr(e);l=l==U0?Bs:l,u=u==U0?Bs:u;var c=l==Bs,h=u==Bs,f=l==u;if(f&&as(n)){if(!as(e))return!1;a=!0,c=!1}if(f&&!c)return o||(o=new _r),a||Lp(n)?HC(n,e,t,r,i,o):kN(n,e,l,t,r,i,o);if(!(t&QN)){var b=c&&Y0.call(n,"__wrapped__"),x=h&&Y0.call(e,"__wrapped__");if(b||x){var w=b?n.value():n,g=x?e.value():e;return o||(o=new _r),i(w,g,t,r,o)}}return f?(o||(o=new _r),XN(n,e,t,r,i,o)):!1}function Kl(n,e,t,r,i){return n===e?!0:n==null||e==null||!Hr(n)&&!Hr(e)?n!==n&&e!==e:tj(n,e,t,r,Kl,i)}var nj=1,rj=2;function ij(n,e,t,r){var i=t.length,o=i;if(n==null)return!o;for(n=Object(n);i--;){var a=t[i];if(a[2]?a[1]!==n[a[0]]:!(a[0]in n))return!1}for(;++i<o;){a=t[i];var s=a[0],l=n[s],u=a[1];if(a[2]){if(l===void 0&&!(s in n))return!1}else{var c=new _r,h;if(!(h===void 0?Kl(u,l,nj|rj,r,c):h))return!1}}return!0}function VC(n){return n===n&&!$n(n)}function oj(n){for(var e=Bp(n),t=e.length;t--;){var r=e[t],i=n[r];e[t]=[r,i,VC(i)]}return e}function WC(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function aj(n){var e=oj(n);return e.length==1&&e[0][2]?WC(e[0][0],e[0][1]):function(t){return t===n||ij(t,n,e)}}var sj=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lj=/^\w*$/;function Gp(n,e){if(Pn(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||Yl(n)?!0:lj.test(n)||!sj.test(n)||e!=null&&n in Object(e)}var uj="Expected a function";function qp(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(uj);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=t.cache;if(o.has(i))return o.get(i);var a=n.apply(this,r);return t.cache=o.set(i,a)||o,a};return t.cache=new(qp.Cache||si),t}qp.Cache=si;var cj=500;function dj(n){var e=qp(n,function(r){return t.size===cj&&t.clear(),r}),t=e.cache;return e}var hj=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fj=/\\(\\)?/g,pj=dj(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(hj,function(t,r,i,o){e.push(i?o.replace(fj,"$1"):r||t)}),e}),Z0=qr?qr.prototype:void 0,J0=Z0?Z0.toString:void 0;function zC(n){if(typeof n=="string")return n;if(Pn(n))return qC(n,zC)+"";if(Yl(n))return J0?J0.call(n):"";var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function gj(n){return n==null?"":zC(n)}function XC(n,e){return Pn(n)?n:Gp(n,e)?[n]:pj(gj(n))}function Ql(n){if(typeof n=="string"||Yl(n))return n;var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function UC(n,e){e=XC(e,n);for(var t=0,r=e.length;n!=null&&t<r;)n=n[Ql(e[t++])];return t&&t==r?n:void 0}function mj(n,e,t){var r=n==null?void 0:UC(n,e);return r===void 0?t:r}function bj(n,e){return n!=null&&e in Object(n)}function vj(n,e,t){e=XC(e,n);for(var r=-1,i=e.length,o=!1;++r<i;){var a=Ql(e[r]);if(!(o=n!=null&&t(n,a)))break;n=n[a]}return o||++r!=i?o:(i=n==null?0:n.length,!!i&&Mp(i)&&Pp(a,i)&&(Pn(n)||vl(n)))}function yj(n,e){return n!=null&&vj(n,e,bj)}var xj=1,Cj=2;function Ej(n,e){return Gp(n)&&VC(e)?WC(Ql(n),e):function(t){var r=mj(t,n);return r===void 0&&r===e?yj(t,n):Kl(e,r,xj|Cj)}}function wj(n){return function(e){return e?.[n]}}function Aj(n){return function(e){return UC(e,n)}}function _j(n){return Gp(n)?wj(Ql(n)):Aj(n)}function Tj(n){return typeof n=="function"?n:n==null?$l:typeof n=="object"?Pn(n)?Ej(n[0],n[1]):aj(n):_j(n)}function Ij(n,e){var t=-1,r=fa(n)?Array(n.length):[];return PC(n,function(i,o,a){r[++t]=e(i,o,a)}),r}function oo(n,e){var t=Pn(n)?qC:Ij;return t(n,Tj(e))}var Sj=function(e){var t=e.colors,r=e.onClick,i=e.onSwatchHover,o=ke({default:{swatches:{marginRight:"-10px"},swatch:{width:"22px",height:"22px",float:"left",marginRight:"10px",marginBottom:"10px",borderRadius:"4px"},clear:{clear:"both"}}});return m.createElement("div",{style:o.swatches},oo(t,function(a){return m.createElement(io,{key:a,color:a,style:o.swatch,onClick:r,onHover:i,focusStyle:{boxShadow:"0 0 4px "+a}})}),m.createElement("div",{style:o.clear}))},Hp=function(e){var t=e.onChange,r=e.onSwatchHover,i=e.hex,o=e.colors,a=e.width,s=e.triangle,l=e.styles,u=l===void 0?{}:l,c=e.className,h=c===void 0?"":c,f=i==="transparent",b=function(g,y){Si(g)&&t({hex:g,source:"hex"},y)},x=ke(Gt({default:{card:{width:a,background:"#fff",boxShadow:"0 1px rgba(0,0,0,.1)",borderRadius:"6px",position:"relative"},head:{height:"110px",background:i,borderRadius:"6px 6px 0 0",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},body:{padding:"10px"},label:{fontSize:"18px",color:Fp(i),position:"relative"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 10px 10px 10px",borderColor:"transparent transparent "+i+" 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"}}},u),{"hide-triangle":s==="hide"});return m.createElement("div",{style:x.card,className:"block-picker "+h},m.createElement("div",{style:x.triangle}),m.createElement("div",{style:x.head},f&&m.createElement(da,{borderRadius:"6px 6px 0 0"}),m.createElement("div",{style:x.label},i)),m.createElement("div",{style:x.body},m.createElement(Sj,{colors:o,onClick:b,onSwatchHover:r}),m.createElement(Je,{style:{input:x.input},value:i,onChange:b})))};Hp.propTypes={width:d.oneOfType([d.string,d.number]),colors:d.arrayOf(d.string),triangle:d.oneOf(["top","hide"]),styles:d.object};Hp.defaultProps={width:170,colors:["#D9E3F0","#F47373","#697689","#37D67A","#2CCCE4","#555555","#dce775","#ff8a65","#ba68c8"],triangle:"top",styles:{}};Fn(Hp);var _o={100:"#ffcdd2",300:"#e57373",500:"#f44336",700:"#d32f2f",900:"#b71c1c"},To={100:"#f8bbd0",300:"#f06292",500:"#e91e63",700:"#c2185b",900:"#880e4f"},Io={100:"#e1bee7",300:"#ba68c8",500:"#9c27b0",700:"#7b1fa2",900:"#4a148c"},So={100:"#d1c4e9",300:"#9575cd",500:"#673ab7",700:"#512da8",900:"#311b92"},Ro={100:"#c5cae9",300:"#7986cb",500:"#3f51b5",700:"#303f9f",900:"#1a237e"},Oo={100:"#bbdefb",300:"#64b5f6",500:"#2196f3",700:"#1976d2",900:"#0d47a1"},No={100:"#b3e5fc",300:"#4fc3f7",500:"#03a9f4",700:"#0288d1",900:"#01579b"},jo={100:"#b2ebf2",300:"#4dd0e1",500:"#00bcd4",700:"#0097a7",900:"#006064"},Do={100:"#b2dfdb",300:"#4db6ac",500:"#009688",700:"#00796b",900:"#004d40"},Va={100:"#c8e6c9",300:"#81c784",500:"#4caf50",700:"#388e3c"},Mo={100:"#dcedc8",300:"#aed581",500:"#8bc34a",700:"#689f38",900:"#33691e"},ko={100:"#f0f4c3",300:"#dce775",500:"#cddc39",700:"#afb42b",900:"#827717"},Lo={100:"#fff9c4",300:"#fff176",500:"#ffeb3b",700:"#fbc02d",900:"#f57f17"},Po={100:"#ffecb3",300:"#ffd54f",500:"#ffc107",700:"#ffa000",900:"#ff6f00"},Bo={100:"#ffe0b2",300:"#ffb74d",500:"#ff9800",700:"#f57c00",900:"#e65100"},Fo={100:"#ffccbc",300:"#ff8a65",500:"#ff5722",700:"#e64a19",900:"#bf360c"},Go={100:"#d7ccc8",300:"#a1887f",500:"#795548",700:"#5d4037",900:"#3e2723"},qo={100:"#cfd8dc",300:"#90a4ae",500:"#607d8b",700:"#455a64",900:"#263238"},$C=function(e){var t=e.color,r=e.onClick,i=e.onSwatchHover,o=e.hover,a=e.active,s=e.circleSize,l=e.circleSpacing,u=ke({default:{swatch:{width:s,height:s,marginRight:l,marginBottom:l,transform:"scale(1)",transition:"100ms transform ease"},Swatch:{borderRadius:"50%",background:"transparent",boxShadow:"inset 0 0 0 "+(s/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:o,active:a});return m.createElement("div",{style:u.swatch},m.createElement(io,{style:u.Swatch,color:t,onClick:r,onHover:i,focusStyle:{boxShadow:u.Swatch.boxShadow+", 0 0 5px "+t}}))};$C.defaultProps={circleSize:28,circleSpacing:14};const Rj=Sp.handleHover($C);var Vp=function(e){var t=e.width,r=e.onChange,i=e.onSwatchHover,o=e.colors,a=e.hex,s=e.circleSize,l=e.styles,u=l===void 0?{}:l,c=e.circleSpacing,h=e.className,f=h===void 0?"":h,b=ke(Gt({default:{card:{width:t,display:"flex",flexWrap:"wrap",marginRight:-c,marginBottom:-c}}},u)),x=function(g,y){return r({hex:g,source:"hex"},y)};return m.createElement("div",{style:b.card,className:"circle-picker "+f},oo(o,function(w){return m.createElement(Rj,{key:w,color:w,onClick:x,onSwatchHover:i,active:a===w.toLowerCase(),circleSize:s,circleSpacing:c})}))};Vp.propTypes={width:d.oneOfType([d.string,d.number]),circleSize:d.number,circleSpacing:d.number,styles:d.object};Vp.defaultProps={width:252,circleSize:28,circleSpacing:14,colors:[_o[500],To[500],Io[500],So[500],Ro[500],Oo[500],No[500],jo[500],Do[500],Va[500],Mo[500],ko[500],Lo[500],Po[500],Bo[500],Fo[500],Go[500],qo[500]],styles:{}};Fn(Vp);function K0(n){return n===void 0}var Fs={},Q0;function Oj(){if(Q0)return Fs;Q0=1,Object.defineProperty(Fs,"__esModule",{value:!0});var n=Object.assign||function(a){for(var s=1;s<arguments.length;s++){var l=arguments[s];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},e=m,t=r(e);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s){var l={};for(var u in a)s.indexOf(u)>=0||Object.prototype.hasOwnProperty.call(a,u)&&(l[u]=a[u]);return l}var o=24;return Fs.default=function(a){var s=a.fill,l=s===void 0?"currentColor":s,u=a.width,c=u===void 0?o:u,h=a.height,f=h===void 0?o:h,b=a.style,x=b===void 0?{}:b,w=i(a,["fill","width","height","style"]);return t.default.createElement("svg",n({viewBox:"0 0 "+o+" "+o,style:n({fill:l,width:c,height:f},x)},w),t.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"}))},Fs}var Nj=Oj();const jj=la(Nj);var Dj=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function Mj(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function kj(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function Lj(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var YC=(function(n){Lj(e,n);function e(t){Mj(this,e);var r=kj(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.toggleViews=function(){r.state.view==="hex"?r.setState({view:"rgb"}):r.state.view==="rgb"?r.setState({view:"hsl"}):r.state.view==="hsl"&&(r.props.hsl.a===1?r.setState({view:"hex"}):r.setState({view:"rgb"}))},r.handleChange=function(i,o){i.hex?Si(i.hex)&&r.props.onChange({hex:i.hex,source:"hex"},o):i.r||i.g||i.b?r.props.onChange({r:i.r||r.props.rgb.r,g:i.g||r.props.rgb.g,b:i.b||r.props.rgb.b,source:"rgb"},o):i.a?(i.a<0?i.a=0:i.a>1&&(i.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(i.a*100)/100,source:"rgb"},o)):(i.h||i.s||i.l)&&(typeof i.s=="string"&&i.s.includes("%")&&(i.s=i.s.replace("%","")),typeof i.l=="string"&&i.l.includes("%")&&(i.l=i.l.replace("%","")),i.s==1?i.s=.01:i.l==1&&(i.l=.01),r.props.onChange({h:i.h||r.props.hsl.h,s:Number(K0(i.s)?r.props.hsl.s:i.s),l:Number(K0(i.l)?r.props.hsl.l:i.l),source:"hsl"},o))},r.showHighlight=function(i){i.currentTarget.style.background="#eee"},r.hideHighlight=function(i){i.currentTarget.style.background="transparent"},t.hsl.a!==1&&t.view==="hex"?r.state={view:"rgb"}:r.state={view:t.view},r}return Dj(e,[{key:"render",value:function(){var r=this,i=ke({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),o=void 0;return this.state.view==="hex"?o=m.createElement("div",{style:i.fields,className:"flexbox-fix"},m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?o=m.createElement("div",{style:i.fields,className:"flexbox-fix"},m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),m.createElement("div",{style:i.alpha},m.createElement(Je,{style:{input:i.input,label:i.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(o=m.createElement("div",{style:i.fields,className:"flexbox-fix"},m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),m.createElement("div",{style:i.alpha},m.createElement(Je,{style:{input:i.input,label:i.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),m.createElement("div",{style:i.wrap,className:"flexbox-fix"},o,m.createElement("div",{style:i.toggle},m.createElement("div",{style:i.icon,onClick:this.toggleViews,ref:function(s){return r.icon=s}},m.createElement(jj,{style:i.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.hsl.a!==1&&i.view==="hex"?{view:"rgb"}:null}}]),e})(m.Component);YC.defaultProps={view:"hex"};var ey=function(){var e=ke({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 m.createElement("div",{style:e.picker})},Pj=function(){var e=ke({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return m.createElement("div",{style:e.picker})},Wp=function(e){var t=e.width,r=e.onChange,i=e.disableAlpha,o=e.rgb,a=e.hsl,s=e.hsv,l=e.hex,u=e.renderers,c=e.styles,h=c===void 0?{}:c,f=e.className,b=f===void 0?"":f,x=e.defaultView,w=ke(Gt({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("+o.r+", "+o.g+", "+o.b+", "+o.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"}}},h),{disableAlpha:i});return m.createElement("div",{style:w.picker,className:"chrome-picker "+b},m.createElement("div",{style:w.saturation},m.createElement(Zl,{style:w.Saturation,hsl:a,hsv:s,pointer:Pj,onChange:r})),m.createElement("div",{style:w.body},m.createElement("div",{style:w.controls,className:"flexbox-fix"},m.createElement("div",{style:w.color},m.createElement("div",{style:w.swatch},m.createElement("div",{style:w.active}),m.createElement(da,{renderers:u}))),m.createElement("div",{style:w.toggles},m.createElement("div",{style:w.hue},m.createElement(ha,{style:w.Hue,hsl:a,pointer:ey,onChange:r})),m.createElement("div",{style:w.alpha},m.createElement(Rp,{style:w.Alpha,rgb:o,hsl:a,pointer:ey,renderers:u,onChange:r})))),m.createElement(YC,{rgb:o,hsl:a,hex:l,view:x,onChange:r,disableAlpha:i})))};Wp.propTypes={width:d.oneOfType([d.string,d.number]),disableAlpha:d.bool,styles:d.object,defaultView:d.oneOf(["hex","rgb","hsl"])};Wp.defaultProps={width:225,disableAlpha:!1,styles:{}};Fn(Wp);var Bj=function(e){var t=e.color,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,a=e.active,s=ke({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:Fp(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 m.createElement(io,{style:s.color,color:t,onClick:i,onHover:o,focusStyle:{boxShadow:"0 0 4px "+t}},m.createElement("div",{style:s.dot}))},Fj=function(e){var t=e.hex,r=e.rgb,i=e.onChange,o=ke({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(l,u){l.r||l.g||l.b?i({r:l.r||r.r,g:l.g||r.g,b:l.b||r.b,source:"rgb"},u):i({hex:l.hex,source:"hex"},u)};return m.createElement("div",{style:o.fields,className:"flexbox-fix"},m.createElement("div",{style:o.active}),m.createElement(Je,{style:{wrap:o.HEXwrap,input:o.HEXinput,label:o.HEXlabel},label:"hex",value:t,onChange:a}),m.createElement(Je,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"r",value:r.r,onChange:a}),m.createElement(Je,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"g",value:r.g,onChange:a}),m.createElement(Je,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"b",value:r.b,onChange:a}))},zp=function(e){var t=e.onChange,r=e.onSwatchHover,i=e.colors,o=e.hex,a=e.rgb,s=e.styles,l=s===void 0?{}:s,u=e.className,c=u===void 0?"":u,h=ke(Gt({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},l)),f=function(x,w){x.hex?Si(x.hex)&&t({hex:x.hex,source:"hex"},w):t(x,w)};return m.createElement(vs,{style:h.Compact,styles:l},m.createElement("div",{style:h.compact,className:"compact-picker "+c},m.createElement("div",null,oo(i,function(b){return m.createElement(Bj,{key:b,color:b,active:b.toLowerCase()===o,onClick:f,onSwatchHover:r})}),m.createElement("div",{style:h.clear})),m.createElement(Fj,{hex:o,rgb:a,onChange:f})))};zp.propTypes={colors:d.arrayOf(d.string),styles:d.object};zp.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"],styles:{}};Fn(zp);var Gj=function(e){var t=e.hover,r=e.color,i=e.onClick,o=e.onSwatchHover,a={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},s=ke({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:a}},{hover:t});return m.createElement("div",{style:s.swatch},m.createElement(io,{color:r,onClick:i,onHover:o,focusStyle:a}))};const qj=Sp.handleHover(Gj);var Xp=function(e){var t=e.width,r=e.colors,i=e.onChange,o=e.onSwatchHover,a=e.triangle,s=e.styles,l=s===void 0?{}:s,u=e.className,c=u===void 0?"":u,h=ke(Gt({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)"}}},l),{"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(x,w){return i({hex:x,source:"hex"},w)};return m.createElement("div",{style:h.card,className:"github-picker "+c},m.createElement("div",{style:h.triangleShadow}),m.createElement("div",{style:h.triangle}),oo(r,function(b){return m.createElement(qj,{color:b,key:b,onClick:f,onSwatchHover:o})}))};Xp.propTypes={width:d.oneOfType([d.string,d.number]),colors:d.arrayOf(d.string),triangle:d.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:d.object};Xp.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};Fn(Xp);var Hj=function(e){var t=e.direction,r=ke({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 m.createElement("div",{style:r.picker})},Vj=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Up=function(e){var t=e.width,r=e.height,i=e.onChange,o=e.hsl,a=e.direction,s=e.pointer,l=e.styles,u=l===void 0?{}:l,c=e.className,h=c===void 0?"":c,f=ke(Gt({default:{picker:{position:"relative",width:t,height:r},hue:{radius:"2px"}}},u)),b=function(w){return i({a:1,h:w.h,l:.5,s:1})};return m.createElement("div",{style:f.picker,className:"hue-picker "+h},m.createElement(ha,Vj({},f.hue,{hsl:o,pointer:s,onChange:b,direction:a})))};Up.propTypes={styles:d.object};Up.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:Hj,styles:{}};Fn(Up);var Wj=function(e){var t=e.onChange,r=e.hex,i=e.rgb,o=e.styles,a=o===void 0?{}:o,s=e.className,l=s===void 0?"":s,u=ke(Gt({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 "+r,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)),c=function(f,b){f.hex?Si(f.hex)&&t({hex:f.hex,source:"hex"},b):(f.r||f.g||f.b)&&t({r:f.r||i.r,g:f.g||i.g,b:f.b||i.b,source:"rgb"},b)};return m.createElement(vs,{styles:a},m.createElement("div",{style:u.material,className:"material-picker "+l},m.createElement(Je,{style:{wrap:u.HEXwrap,input:u.HEXinput,label:u.HEXlabel},label:"hex",value:r,onChange:c}),m.createElement("div",{style:u.split,className:"flexbox-fix"},m.createElement("div",{style:u.third},m.createElement(Je,{style:{wrap:u.RGBwrap,input:u.RGBinput,label:u.RGBlabel},label:"r",value:i.r,onChange:c})),m.createElement("div",{style:u.third},m.createElement(Je,{style:{wrap:u.RGBwrap,input:u.RGBinput,label:u.RGBlabel},label:"g",value:i.g,onChange:c})),m.createElement("div",{style:u.third},m.createElement(Je,{style:{wrap:u.RGBwrap,input:u.RGBinput,label:u.RGBlabel},label:"b",value:i.b,onChange:c})))))};Fn(Wj);var zj=function(e){var t=e.onChange,r=e.rgb,i=e.hsv,o=e.hex,a=ke({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"}}}),s=function(u,c){u["#"]?Si(u["#"])&&t({hex:u["#"],source:"hex"},c):u.r||u.g||u.b?t({r:u.r||r.r,g:u.g||r.g,b:u.b||r.b,source:"rgb"},c):(u.h||u.s||u.v)&&t({h:u.h||i.h,s:u.s||i.s,v:u.v||i.v,source:"hsv"},c)};return m.createElement("div",{style:a.fields},m.createElement(Je,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"h",value:Math.round(i.h),onChange:s}),m.createElement(Je,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"s",value:Math.round(i.s*100),onChange:s}),m.createElement(Je,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"v",value:Math.round(i.v*100),onChange:s}),m.createElement("div",{style:a.divider}),m.createElement(Je,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"r",value:r.r,onChange:s}),m.createElement(Je,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"g",value:r.g,onChange:s}),m.createElement(Je,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"b",value:r.b,onChange:s}),m.createElement("div",{style:a.divider}),m.createElement(Je,{style:{wrap:a.HEXwrap,input:a.HEXinput,label:a.HEXlabel},label:"#",value:o.replace("#",""),onChange:s}),m.createElement("div",{style:a.fieldSymbols},m.createElement("div",{style:a.symbol},"°"),m.createElement("div",{style:a.symbol},"%"),m.createElement("div",{style:a.symbol},"%")))},Xj=function(e){var t=e.hsl,r=ke({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 m.createElement("div",{style:r.picker})},Uj=function(){var e=ke({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 m.createElement("div",{style:e.pointer},m.createElement("div",{style:e.left},m.createElement("div",{style:e.leftInside})),m.createElement("div",{style:e.right},m.createElement("div",{style:e.rightInside})))},ty=function(e){var t=e.onClick,r=e.label,i=e.children,o=e.active,a=ke({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:o});return m.createElement("div",{style:a.button,onClick:t},r||i)},$j=function(e){var t=e.rgb,r=e.currentColor,i=ke({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:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return m.createElement("div",null,m.createElement("div",{style:i.label},"new"),m.createElement("div",{style:i.swatches},m.createElement("div",{style:i.new}),m.createElement("div",{style:i.current})),m.createElement("div",{style:i.label},"current"))},Yj=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function Zj(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Jj(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function Kj(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var $p=(function(n){Kj(e,n);function e(t){Zj(this,e);var r=Jj(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.state={currentColor:t.hex},r}return Yj(e,[{key:"render",value:function(){var r=this.props,i=r.styles,o=i===void 0?{}:i,a=r.className,s=a===void 0?"":a,l=ke(Gt({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"}}},o));return m.createElement("div",{style:l.picker,className:"photoshop-picker "+s},m.createElement("div",{style:l.head},this.props.header),m.createElement("div",{style:l.body,className:"flexbox-fix"},m.createElement("div",{style:l.saturation},m.createElement(Zl,{hsl:this.props.hsl,hsv:this.props.hsv,pointer:Xj,onChange:this.props.onChange})),m.createElement("div",{style:l.hue},m.createElement(ha,{direction:"vertical",hsl:this.props.hsl,pointer:Uj,onChange:this.props.onChange})),m.createElement("div",{style:l.controls},m.createElement("div",{style:l.top,className:"flexbox-fix"},m.createElement("div",{style:l.previews},m.createElement($j,{rgb:this.props.rgb,currentColor:this.state.currentColor})),m.createElement("div",{style:l.actions},m.createElement(ty,{label:"OK",onClick:this.props.onAccept,active:!0}),m.createElement(ty,{label:"Cancel",onClick:this.props.onCancel}),m.createElement(zj,{onChange:this.props.onChange,rgb:this.props.rgb,hsv:this.props.hsv,hex:this.props.hex}))))))}}]),e})(m.Component);$p.propTypes={header:d.string,styles:d.object};$p.defaultProps={header:"Color Picker",styles:{}};Fn($p);var Qj=function(e){var t=e.onChange,r=e.rgb,i=e.hsl,o=e.hex,a=e.disableAlpha,s=ke({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}),l=function(c,h){c.hex?Si(c.hex)&&t({hex:c.hex,source:"hex"},h):c.r||c.g||c.b?t({r:c.r||r.r,g:c.g||r.g,b:c.b||r.b,a:r.a,source:"rgb"},h):c.a&&(c.a<0?c.a=0:c.a>100&&(c.a=100),c.a/=100,t({h:i.h,s:i.s,l:i.l,a:c.a,source:"rgb"},h))};return m.createElement("div",{style:s.fields,className:"flexbox-fix"},m.createElement("div",{style:s.double},m.createElement(Je,{style:{input:s.input,label:s.label},label:"hex",value:o.replace("#",""),onChange:l})),m.createElement("div",{style:s.single},m.createElement(Je,{style:{input:s.input,label:s.label},label:"r",value:r.r,onChange:l,dragLabel:"true",dragMax:"255"})),m.createElement("div",{style:s.single},m.createElement(Je,{style:{input:s.input,label:s.label},label:"g",value:r.g,onChange:l,dragLabel:"true",dragMax:"255"})),m.createElement("div",{style:s.single},m.createElement(Je,{style:{input:s.input,label:s.label},label:"b",value:r.b,onChange:l,dragLabel:"true",dragMax:"255"})),m.createElement("div",{style:s.alpha},m.createElement(Je,{style:{input:s.input,label:s.label},label:"a",value:Math.round(r.a*100),onChange:l,dragLabel:"true",dragMax:"100"})))},eD=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ZC=function(e){var t=e.colors,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,a=ke({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}),s=function(u,c){i({hex:u,source:"hex"},c)};return m.createElement("div",{style:a.colors,className:"flexbox-fix"},t.map(function(l){var u=typeof l=="string"?{color:l}:l,c=""+u.color+(u.title||"");return m.createElement("div",{key:c,style:a.swatchWrap},m.createElement(io,eD({},u,{style:a.swatch,onClick:s,onHover:o,focusStyle:{boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px "+u.color}})))}))};ZC.propTypes={colors:d.arrayOf(d.oneOfType([d.string,d.shape({color:d.string,title:d.string})])).isRequired};var tD=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Yp=function(e){var t=e.width,r=e.rgb,i=e.hex,o=e.hsv,a=e.hsl,s=e.onChange,l=e.onSwatchHover,u=e.disableAlpha,c=e.presetColors,h=e.renderers,f=e.styles,b=f===void 0?{}:f,x=e.className,w=x===void 0?"":x,g=ke(Gt({default:tD({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("+r.r+","+r.g+","+r.b+","+r.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)"}},b),disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},b),{disableAlpha:u});return m.createElement("div",{style:g.picker,className:"sketch-picker "+w},m.createElement("div",{style:g.saturation},m.createElement(Zl,{style:g.Saturation,hsl:a,hsv:o,onChange:s})),m.createElement("div",{style:g.controls,className:"flexbox-fix"},m.createElement("div",{style:g.sliders},m.createElement("div",{style:g.hue},m.createElement(ha,{style:g.Hue,hsl:a,onChange:s})),m.createElement("div",{style:g.alpha},m.createElement(Rp,{style:g.Alpha,rgb:r,hsl:a,renderers:h,onChange:s}))),m.createElement("div",{style:g.color},m.createElement(da,null),m.createElement("div",{style:g.activeColor}))),m.createElement(Qj,{rgb:r,hsl:a,hex:i,onChange:s,disableAlpha:u}),m.createElement(ZC,{colors:c,onClick:s,onSwatchHover:l}))};Yp.propTypes={disableAlpha:d.bool,width:d.oneOfType([d.string,d.number]),styles:d.object};Yp.defaultProps={disableAlpha:!1,width:200,styles:{},presetColors:["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]};const nD=Fn(Yp);var Ta=function(e){var t=e.hsl,r=e.offset,i=e.onClick,o=i===void 0?function(){}:i,a=e.active,s=e.first,l=e.last,u=ke({default:{swatch:{height:"12px",background:"hsl("+t.h+", 50%, "+r*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:s,last:l}),c=function(f){return o({h:t.h,s:.5,l:r,source:"hsl"},f)};return m.createElement("div",{style:u.swatch,onClick:c})},rD=function(e){var t=e.onClick,r=e.hsl,i=ke({default:{swatches:{marginTop:"20px"},swatch:{boxSizing:"border-box",width:"20%",paddingRight:"1px",float:"left"},clear:{clear:"both"}}}),o=.1;return m.createElement("div",{style:i.swatches},m.createElement("div",{style:i.swatch},m.createElement(Ta,{hsl:r,offset:".80",active:Math.abs(r.l-.8)<o&&Math.abs(r.s-.5)<o,onClick:t,first:!0})),m.createElement("div",{style:i.swatch},m.createElement(Ta,{hsl:r,offset:".65",active:Math.abs(r.l-.65)<o&&Math.abs(r.s-.5)<o,onClick:t})),m.createElement("div",{style:i.swatch},m.createElement(Ta,{hsl:r,offset:".50",active:Math.abs(r.l-.5)<o&&Math.abs(r.s-.5)<o,onClick:t})),m.createElement("div",{style:i.swatch},m.createElement(Ta,{hsl:r,offset:".35",active:Math.abs(r.l-.35)<o&&Math.abs(r.s-.5)<o,onClick:t})),m.createElement("div",{style:i.swatch},m.createElement(Ta,{hsl:r,offset:".20",active:Math.abs(r.l-.2)<o&&Math.abs(r.s-.5)<o,onClick:t,last:!0})),m.createElement("div",{style:i.clear}))},iD=function(){var e=ke({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 m.createElement("div",{style:e.picker})},Zp=function(e){var t=e.hsl,r=e.onChange,i=e.pointer,o=e.styles,a=o===void 0?{}:o,s=e.className,l=s===void 0?"":s,u=ke(Gt({default:{hue:{height:"12px",position:"relative"},Hue:{radius:"2px"}}},a));return m.createElement("div",{style:u.wrap||{},className:"slider-picker "+l},m.createElement("div",{style:u.hue},m.createElement(ha,{style:u.Hue,hsl:t,pointer:i,onChange:r})),m.createElement("div",{style:u.swatches},m.createElement(rD,{hsl:t,onClick:r})))};Zp.propTypes={styles:d.object};Zp.defaultProps={pointer:iD,styles:{}};Fn(Zp);var Gs={},ny;function oD(){if(ny)return Gs;ny=1,Object.defineProperty(Gs,"__esModule",{value:!0});var n=Object.assign||function(a){for(var s=1;s<arguments.length;s++){var l=arguments[s];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},e=m,t=r(e);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s){var l={};for(var u in a)s.indexOf(u)>=0||Object.prototype.hasOwnProperty.call(a,u)&&(l[u]=a[u]);return l}var o=24;return Gs.default=function(a){var s=a.fill,l=s===void 0?"currentColor":s,u=a.width,c=u===void 0?o:u,h=a.height,f=h===void 0?o:h,b=a.style,x=b===void 0?{}:b,w=i(a,["fill","width","height","style"]);return t.default.createElement("svg",n({viewBox:"0 0 "+o+" "+o,style:n({fill:l,width:c,height:f},x)},w),t.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},Gs}var aD=oD();const sD=la(aD);var lD=function(e){var t=e.color,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,a=e.first,s=e.last,l=e.active,u=ke({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:t,marginBottom:"1px"},check:{color:Fp(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:s,active:l,"color-#FFFFFF":t==="#FFFFFF",transparent:t==="transparent"});return m.createElement(io,{color:t,style:u.color,onClick:i,onHover:o,focusStyle:{boxShadow:"0 0 4px "+t}},m.createElement("div",{style:u.check},m.createElement(sD,null)))},uD=function(e){var t=e.onClick,r=e.onSwatchHover,i=e.group,o=e.active,a=ke({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return m.createElement("div",{style:a.group},oo(i,function(s,l){return m.createElement(lD,{key:s,color:s,active:s.toLowerCase()===o,first:l===0,last:l===i.length-1,onClick:t,onSwatchHover:r})}))},Jp=function(e){var t=e.width,r=e.height,i=e.onChange,o=e.onSwatchHover,a=e.colors,s=e.hex,l=e.styles,u=l===void 0?{}:l,c=e.className,h=c===void 0?"":c,f=ke(Gt({default:{picker:{width:t,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},u)),b=function(w,g){return i({hex:w,source:"hex"},g)};return m.createElement("div",{style:f.picker,className:"swatches-picker "+h},m.createElement(vs,null,m.createElement("div",{style:f.overflow},m.createElement("div",{style:f.body},oo(a,function(x){return m.createElement(uD,{key:x.toString(),group:x,active:s,onClick:b,onSwatchHover:o})}),m.createElement("div",{style:f.clear})))))};Jp.propTypes={width:d.oneOfType([d.string,d.number]),height:d.oneOfType([d.string,d.number]),colors:d.arrayOf(d.arrayOf(d.string)),styles:d.object};Jp.defaultProps={width:320,height:240,colors:[[_o[900],_o[700],_o[500],_o[300],_o[100]],[To[900],To[700],To[500],To[300],To[100]],[Io[900],Io[700],Io[500],Io[300],Io[100]],[So[900],So[700],So[500],So[300],So[100]],[Ro[900],Ro[700],Ro[500],Ro[300],Ro[100]],[Oo[900],Oo[700],Oo[500],Oo[300],Oo[100]],[No[900],No[700],No[500],No[300],No[100]],[jo[900],jo[700],jo[500],jo[300],jo[100]],[Do[900],Do[700],Do[500],Do[300],Do[100]],["#194D33",Va[700],Va[500],Va[300],Va[100]],[Mo[900],Mo[700],Mo[500],Mo[300],Mo[100]],[ko[900],ko[700],ko[500],ko[300],ko[100]],[Lo[900],Lo[700],Lo[500],Lo[300],Lo[100]],[Po[900],Po[700],Po[500],Po[300],Po[100]],[Bo[900],Bo[700],Bo[500],Bo[300],Bo[100]],[Fo[900],Fo[700],Fo[500],Fo[300],Fo[100]],[Go[900],Go[700],Go[500],Go[300],Go[100]],[qo[900],qo[700],qo[500],qo[300],qo[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};Fn(Jp);var Kp=function(e){var t=e.onChange,r=e.onSwatchHover,i=e.hex,o=e.colors,a=e.width,s=e.triangle,l=e.styles,u=l===void 0?{}:l,c=e.className,h=c===void 0?"":c,f=ke(Gt({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"}}},u),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right"}),b=function(w,g){Si(w)&&t({hex:w,source:"hex"},g)};return m.createElement("div",{style:f.card,className:"twitter-picker "+h},m.createElement("div",{style:f.triangleShadow}),m.createElement("div",{style:f.triangle}),m.createElement("div",{style:f.body},oo(o,function(x,w){return m.createElement(io,{key:w,color:x,hex:x,style:f.swatch,onClick:b,onHover:r,focusStyle:{boxShadow:"0 0 4px "+x}})}),m.createElement("div",{style:f.hash},"#"),m.createElement(Je,{label:null,style:{input:f.input},value:i.replace("#",""),onChange:b}),m.createElement("div",{style:f.clear})))};Kp.propTypes={width:d.oneOfType([d.string,d.number]),triangle:d.oneOf(["hide","top-left","top-right"]),colors:d.arrayOf(d.string),styles:d.object};Kp.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};Fn(Kp);var Qp=function(e){var t=ke({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 m.createElement("div",{style:t.picker})};Qp.propTypes={hsl:d.shape({h:d.number,s:d.number,l:d.number,a:d.number})};Qp.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var eg=function(e){var t=ke({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 m.createElement("div",{style:t.picker})};eg.propTypes={hsl:d.shape({h:d.number,s:d.number,l:d.number,a:d.number})};eg.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var cD=function(e){var t=e.onChange,r=e.rgb,i=e.hsl,o=e.hex,a=e.hsv,s=function(b,x){if(b.hex)Si(b.hex)&&t({hex:b.hex,source:"hex"},x);else if(b.rgb){var w=b.rgb.split(",");Sh(b.rgb,"rgb")&&t({r:w[0],g:w[1],b:w[2],a:1,source:"rgb"},x)}else if(b.hsv){var g=b.hsv.split(",");Sh(b.hsv,"hsv")&&(g[2]=g[2].replace("%",""),g[1]=g[1].replace("%",""),g[0]=g[0].replace("°",""),g[1]==1?g[1]=.01:g[2]==1&&(g[2]=.01),t({h:Number(g[0]),s:Number(g[1]),v:Number(g[2]),source:"hsv"},x))}else if(b.hsl){var y=b.hsl.split(",");Sh(b.hsl,"hsl")&&(y[2]=y[2].replace("%",""),y[1]=y[1].replace("%",""),y[0]=y[0].replace("°",""),h[1]==1?h[1]=.01:h[2]==1&&(h[2]=.01),t({h:Number(y[0]),s:Number(y[1]),v:Number(y[2]),source:"hsl"},x))}},l=ke({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"}}}),u=r.r+", "+r.g+", "+r.b,c=Math.round(i.h)+"°, "+Math.round(i.s*100)+"%, "+Math.round(i.l*100)+"%",h=Math.round(a.h)+"°, "+Math.round(a.s*100)+"%, "+Math.round(a.v*100)+"%";return m.createElement("div",{style:l.wrap,className:"flexbox-fix"},m.createElement("div",{style:l.fields},m.createElement("div",{style:l.double},m.createElement(Je,{style:{input:l.input,label:l.label},label:"hex",value:o,onChange:s})),m.createElement("div",{style:l.column},m.createElement("div",{style:l.single},m.createElement(Je,{style:{input:l.input2,label:l.label2},label:"rgb",value:u,onChange:s})),m.createElement("div",{style:l.single},m.createElement(Je,{style:{input:l.input2,label:l.label2},label:"hsv",value:h,onChange:s})),m.createElement("div",{style:l.single},m.createElement(Je,{style:{input:l.input2,label:l.label2},label:"hsl",value:c,onChange:s})))))},tg=function(e){var t=e.width,r=e.onChange,i=e.rgb,o=e.hsl,a=e.hsv,s=e.hex,l=e.header,u=e.styles,c=u===void 0?{}:u,h=e.className,f=h===void 0?"":h,b=ke(Gt({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("+i.r+", "+i.g+", "+i.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"}}},c));return m.createElement("div",{style:b.picker,className:"google-picker "+f},m.createElement("div",{style:b.head},l),m.createElement("div",{style:b.swatch}),m.createElement("div",{style:b.saturation},m.createElement(Zl,{hsl:o,hsv:a,pointer:Qp,onChange:r})),m.createElement("div",{style:b.body},m.createElement("div",{style:b.controls,className:"flexbox-fix"},m.createElement("div",{style:b.hue},m.createElement(ha,{style:b.Hue,hsl:o,radius:"4px",pointer:eg,onChange:r}))),m.createElement(cD,{rgb:i,hsl:o,hex:s,hsv:a,onChange:r})))};tg.propTypes={width:d.oneOfType([d.string,d.number]),styles:d.object,header:d.string};tg.defaultProps={width:652,styles:{},header:"Color picker"};Fn(tg);function Sf({closeChooseColor:n,currentColor:e,handleCloseLineWeight:t,handleLineWeightSelect:r,openChooseColor:i,openChooseLineWeight:o,toolOptions:a,toolState:s,updateColor:l}){const{t:u}=Bn.useTranslation();return p.jsxs(q.Grid,{container:!0,spacing:1,children:[p.jsx(q.Grid,{size:{xs:12},children:p.jsx(Ne,{variant:"overline",children:u("style")})}),p.jsx(q.Grid,{size:{xs:12},children:p.jsxs(Dl,{"aria-label":u("style_selection"),size:"small",children:[s.activeTool!==It.TEXT&&[p.jsxs(Ft,{value:"strokeColor","aria-label":u("border_color"),onClick:i,children:[p.jsx(q.Tooltip,{title:u("border_color"),children:p.jsx("span",{children:p.jsx(vI,{style:{fill:s.strokeColor}})})}),p.jsx(Hu,{})]},"strokeColor"),p.jsxs(Ft,{value:"lineWeight","aria-label":u("line_weight"),onClick:o,children:[p.jsx(q.Tooltip,{title:u("line_weight"),children:p.jsx("span",{children:p.jsx(yI,{})})}),p.jsx(Hu,{})]},"lineWeight")],p.jsxs(Ft,{value:"fillColor","aria-label":u("fill_color"),onClick:i,children:[p.jsx(q.Tooltip,{title:u("fill_color"),children:p.jsx("span",{children:p.jsx(xI,{})})}),p.jsx(Hu,{})]})]})}),p.jsx(q.Popover,{open:a.lineWeightPopoverOpen,anchorEl:a.popoverLineWeightAnchorEl,children:p.jsx("div",{children:p.jsx(q.ClickAwayListener,{onClickAway:t,children:p.jsx(q.MenuList,{autoFocus:!0,role:"listbox",children:jA.map(c=>p.jsx(q.MenuItem,{onClick:r,value:c,selected:c===s.strokeWidth,role:"option","aria-selected":c===s.strokeWidth,children:c},c))})})})}),p.jsx(q.Popover,{open:a.colorPopoverOpen,anchorEl:a.popoverAnchorEl,onClose:n,children:p.jsx(nD,{disableAlpha:!1,color:e,onChange:l})})]})}Sf.propTypes={closeChooseColor:bi.func.isRequired,currentColor:bi.string.isRequired,handleCloseLineWeight:bi.func.isRequired,handleLineWeightSelect:bi.func.isRequired,openChooseColor:bi.func.isRequired,openChooseLineWeight:bi.func.isRequired,toolOptions:bi.shape({colorPopoverOpen:d.bool,currentColorType:d.any,lineWeightPopoverOpen:d.bool,popoverAnchorEl:d.any,popoverLineWeightAnchorEl:d.any}).isRequired,toolState:d.shape({activeTool:d.string.isRequired,closedMode:d.string.isRequired,fillColor:d.string,image:d.shape({id:d.string}),strokeColor:d.string.isRequired,strokeWidth:d.number.isRequired,text:d.string,textBody:d.string,updateColor:d.func}).isRequired,updateColor:bi.func.isRequired};function Rf({currentShape:n,displayMode:e,setToolState:t,t:r,toolState:i}){const[o,a]=m.useState({colorPopoverOpen:!1,currentColorType:null,lineWeightPopoverOpen:!1,popoverAnchorEl:null,popoverLineWeightAnchorEl:null}),s=o.currentColorType?B1(i[o.currentColorType]):"rgba(255, 0, 0, 0.5)",l=_=>{a({...o,lineWeightPopoverOpen:!0,popoverLineWeightAnchorEl:_.currentTarget})},u=_=>{a({...o,lineWeightPopoverOpen:!1,popoverLineWeightAnchorEl:null}),t({...i,strokeWidth:_.currentTarget.value})},c=_=>{a({...o,colorPopoverOpen:!1,currentColorType:null,popoverAnchorEl:null})},h=_=>{a({...o,colorPopoverOpen:!0,currentColorType:_.currentTarget.value,popoverAnchorEl:_.currentTarget})},f=_=>{a({...o,lineWeightPopoverOpen:!1,popoverLineWeightAnchorEl:null})},b=_=>{t({...i,closedMode:_.currentTarget.value})},x=_=>{t({...i,[o.currentColorType]:DA(_.rgb)})},w=(_,N)=>{t({...i,image:{...i.image,id:_}})},g=()=>{const _={id:i?.image?.id,uuid:hn()};t({...i,image:{id:null},imageEvent:_})},y=_=>{const N=_.target.value;t({...i,text:N})},A=xn.useSelector(_=>be.getConfig(_)).annotation?.allowTargetShapesStyling===!0;return p.jsxs("div",{children:[(e===sn.DRAW||A&&e===sn.TARGET)&&Jf(i.activeTool)&&p.jsx(q.Grid,{container:!0,children:p.jsx(Sf,{currentColor:s,changeClosedMode:b,closeChooseColor:c,handleCloseLineWeight:f,handleLineWeightSelect:u,openChooseColor:h,openChooseLineWeight:l,updateColor:x,toolOptions:o,toolState:i})}),i.activeTool===It.TEXT&&p.jsxs(q.Grid,{container:!0,direction:"column",spacing:1,children:[p.jsx(q.Grid,{children:p.jsx(Ne,{variant:"overline",children:r("text")})}),n?p.jsxs(p.Fragment,{children:[p.jsx(q.Grid,{children:p.jsx(q.TextField,{value:i.text,placeholder:r("text"),fullwidth:!0,onChange:y})}),p.jsx(q.Grid,{children:p.jsx(Sf,{changeClosedMode:b,closeChooseColor:c,currentColor:s,handleCloseLineWeight:f,handleLineWeightSelect:u,openChooseColor:h,openChooseLineWeight:l,toolOptions:o,toolState:i,updateColor:x})})]}):p.jsx(q.Grid,{children:p.jsx(Ne,{children:r("click_on_canvas_to_write")})})]}),i.activeTool===It.IMAGE&&p.jsx(q.Grid,{container:!0,children:p.jsx($x,{size:{xs:8},imageUrl:i.image?.id,onChange:w,isReadOnly:!!n,onAddImage:g,t:r})}),i.activeTool===Te.POLYGON&&p.jsx(Ne,{children:r("pressEnterOrClickFirstPointToClose")})]})}Rf.propTypes={currentShape:d.object.isRequired,displayMode:d.string.isRequired,setToolState:d.func.isRequired,t:d.func.isRequired,toolState:d.shape({activeTool:d.string.isRequired,closedMode:d.string.isRequired,fillColor:d.string,image:d.shape({id:d.string}),strokeColor:d.string.isRequired,strokeWidth:d.number.isRequired,text:d.string,textBody:d.string,updateColor:d.func}).isRequired};const dD=In.styled(q.ListItem)(({theme:n})=>({display:"flex",justifyContent:"space-between"}));function JC({currentShapeId:n,deleteShape:e,shapes:t,t:r,updateCurrentShapeInShapes:i}){return p.jsx(O1,{children:t.map(o=>p.jsxs(m.Fragment,{children:[p.jsx(sl,{disableGutters:!0,children:p.jsxs(dD,{children:[p.jsx(Ne,{component:"span",sx:{color:"black",cursor:"pointer",fontWeight:o.id===n?"bold":void 0},onClick:()=>i(o),children:r(o.type)}),p.jsx(q.Tooltip,{title:p.jsx(Ii,{label:r("delete"),action:"delete"}),children:p.jsx(q.IconButton,{onClick:()=>e(o.id),edge:"end","aria-label":"delete",children:p.jsx(Z1,{})})})]})}),p.jsx(q.Divider,{component:"li"})]},o.id))})}JC.propTypes={currentShapeId:d.string.isRequired,deleteShape:d.func.isRequired,shapes:d.array.isRequired,t:d.func.isRequired,updateCurrentShapeInShapes:d.func.isRequired};function KC({currentShape:n,deleteShape:e,displayMode:t,setToolState:r,shapes:i,t:o,toolState:a,updateCurrentShapeInShapes:s}){const l=(h,f)=>{if(!f)return;const b=f===It.SHAPE?Te.RECTANGLE:f;r(x=>x.activeTool===b?x:{...x,activeTool:b})},u=h=>{if(r(f=>({...f,...h,activeTool:It.EDIT})),n){const f={};Object.prototype.hasOwnProperty.call(h,"strokeWidth")&&h.strokeWidth!==n.strokeWidth&&(f.strokeWidth=h.strokeWidth),Object.prototype.hasOwnProperty.call(h,"strokeColor")&&h.strokeColor!==n.stroke&&(f.stroke=h.strokeColor),Object.prototype.hasOwnProperty.call(h,"fillColor")&&h.fillColor!==n.fill&&(f.fill=h.fillColor),Object.prototype.hasOwnProperty.call(h,"text")&&h.text!==n.text&&(f.text=h.text),Object.prototype.hasOwnProperty.call(h,"image")&&h.image?.id!==n.url&&(f.url=h.image?.id??null),Object.keys(f).length&&s({...n,...f})}};m.useEffect(()=>{a.activeTool===It.SHAPE&&r(h=>({...h,activeTool:Te.RECTANGLE}))},[a.activeTool,r]);const c=m.useMemo(()=>n?{...a,activeTool:n.type,closedMode:n.closedMode,fillColor:n.fill,image:{id:n.url},strokeColor:n.stroke,strokeWidth:n.strokeWidth,text:n.text}:a,[a,n]);return p.jsxs(p.Fragment,{children:[a.activeTool===It.EDIT&&p.jsxs(p.Fragment,{children:[n&&(t===sn.DRAW||t===sn.TARGET)&&p.jsxs("div",{children:[p.jsx(Ne,{variant:"subFormSectionTitle",children:o("selected_object")}),p.jsx(Rf,{t:o,toolState:c,setToolState:u,displayMode:t,currentShape:n})]}),t===sn.DRAW&&i.length>0&&p.jsxs(p.Fragment,{children:[p.jsx(Ne,{variant:"subFormSectionTitle",children:o("object_list")}),p.jsx(JC,{currentShapeId:n?.id,shapes:i,deleteShape:e,updateCurrentShapeInShapes:s,t:o})]})]}),Jf(a.activeTool)&&p.jsxs(G1,{value:a.activeTool,exclusive:!0,onChange:l,"aria-label":o("tool_selection"),size:"small","data-testid":"tool_selection",children:[t!==sn.IMAGE&&p.jsx(q.Tooltip,{title:o("rectangle"),children:p.jsx(Ft,{value:Te.RECTANGLE,"aria-label":o("add_a_rectangle"),children:p.jsx(dI,{})})}),t===sn.TARGET&&p.jsx(q.Tooltip,{title:o("circle"),children:p.jsx(Ft,{value:Te.CIRCLE,"aria-label":o("add_a_circle"),children:p.jsx(wm,{})})}),t!==sn.IMAGE&&p.jsx("div",{children:p.jsx(q.Tooltip,{title:o("line"),children:p.jsx(Ft,{value:Te.POLYGON,"aria-label":o("add_a_line"),children:p.jsx(fI,{})})})}),t===sn.DRAW&&p.jsxs(p.Fragment,{children:[p.jsx(q.Tooltip,{title:"Ellipse shape",children:p.jsx(Ft,{value:Te.ELLIPSE,"aria-label":o("add_an_ellipse"),children:p.jsx(wm,{})})}),p.jsx(q.Tooltip,{title:o("arrow"),children:p.jsx(Ft,{value:Te.ARROW,"aria-label":o("add_an_arrow_shape"),children:p.jsx(hI,{})})})]})]}),a.activeTool===It.DELETE&&p.jsxs(p.Fragment,{children:[p.jsx(Ne,{variant:"overline",children:o("delete")}),p.jsx("p",{children:o("click_to_delete_shape")}),p.jsxs(q.Button,{onClick:()=>e(),children:[p.jsx("span",{children:o("delete_all")}),p.jsx(Ux,{color:"red"})]})]}),p.jsx(Rf,{t:o,toolState:a,setToolState:r,displayMode:t,currentShape:n})]})}KC.propTypes={currentShape:d.object.isRequired,deleteShape:d.func.isRequired,displayMode:d.string.isRequired,setToolState:d.func.isRequired,shapes:d.array.isRequired,t:d.func.isRequired,toolState:d.shape({activeTool:d.string.isRequired,closedMode:d.string.isRequired,fillColor:d.string.isRequired,image:d.shape({id:d.string}).isRequired,strokeColor:d.string.isRequired,strokeWidth:d.number.isRequired,updateColor:d.func.isRequired}).isRequired,updateCurrentShapeInShapes:d.func.isRequired};const hD=In.styled(q.Grid)(({})=>({display:"flex",flexDirection:"column"}));function QC({displayMode:n,setToolState:e,toolState:t,deleteShape:r,currentShape:i,updateCurrentShapeInShapes:o,setViewTool:a,shapes:s,t:l}){m.useEffect(()=>{},[t.fillColor,t.strokeColor,t.strokeWidth]);const u=m.useCallback((f,b)=>{b&&(n?(e(x=>x.activeTool===b?x:{...x,activeTool:b}),b!==It.EDIT&&o(null)):(b===It.SHAPE&&e({...MA,activeTool:b}),o(null)))},[n,e,o]),c=m.useCallback(f=>()=>{a(f)},[a]),{activeTool:h}=t;return p.jsx(q.Grid,{container:!0,children:p.jsxs(hD,{item:!0,xs:12,children:[p.jsxs(G1,{value:h,exclusive:!0,onChange:u,"aria-label":l("tool_selection"),size:"small",children:[n!==sn.IMAGE&&p.jsx(q.Tooltip,{title:l("shape_selection"),children:p.jsx(Ft,{value:Jf(h)?h:It.SHAPE,"aria-label":l("select_cursor"),onClick:c(Ss),children:p.jsx(uI,{})})}),n===sn.DRAW&&p.jsx(q.Tooltip,{title:l("text"),children:p.jsx(Ft,{value:It.TEXT,"aria-label":l("select_text"),onClick:c(Ss),children:p.jsx(lI,{})})}),n===sn.IMAGE&&p.jsx(q.Tooltip,{title:l("image"),children:p.jsx(Ft,{value:It.IMAGE,"aria-label":l("select_cursor"),onClick:c(Ss),children:p.jsx(Xx,{})})}),p.jsx(q.Tooltip,{title:l("edit"),children:p.jsx(Ft,{value:It.EDIT,"aria-label":l("select_cursor"),onClick:c(F1),children:p.jsx(cI,{})})}),p.jsx(q.Tooltip,{title:p.jsx(Ii,{label:l("delete"),action:"delete"}),children:p.jsx(Ft,{value:It.DELETE,"aria-label":l("select_cursor"),onClick:c(Ss),children:p.jsx(Ux,{})})})]}),p.jsx(KC,{currentShape:i,deleteShape:r,displayMode:n,setToolState:e,shapes:s,t:l,toolState:t,updateCurrentShapeInShapes:o})]})})}QC.propTypes={currentShape:d.shape({id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,type:d.string,url:d.string,x:d.number,y:d.number}).isRequired,deleteShape:d.func.isRequired,displayMode:d.string.isRequired,setToolState:d.func.isRequired,setViewTool:d.func.isRequired,shapes:d.arrayOf(d.shape({id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,type:d.string,url:d.string,x:d.number,y:d.number})).isRequired,t:d.func.isRequired,toolState:d.shape({activeTool:d.string.isRequired,closedMode:d.string.isRequired,fillColor:d.string.isRequired,image:d.shape({id:d.string}).isRequired,strokeColor:d.string.isRequired,strokeWidth:d.number.isRequired,updateColor:d.func.isRequired}).isRequired,updateCurrentShapeInShapes:d.func.isRequired};function eE({playerReferences:n,setTargetDrawingState:e,targetDrawingState:t,windowId:r}){const{t:i}=Bn.useTranslation(),o=xn.useSelector(_=>be.getConfig(_)),{editMode:a}=gs(o),[s,l]=m.useState(()=>{const _=Array.isArray(t?.shapes)?t.shapes:[];return{currentShape:null,isDrawing:!1,shapes:_,...t,...a&&_.length>0?{currentShape:_[0]}:{}}}),u=Array.isArray(t?.shapes)&&t.shapes.length>0,[c,h]=m.useState(u?Ln:{...Ln,activeTool:It.SHAPE}),[,f]=m.useState(F1),[b,x]=m.useState(n.getScale()),w=m.useCallback(()=>{const _=n.getScale();x(N=>N===_?N:_)},[n]),g=m.useRef(s.shapes);m.useLayoutEffect(()=>{const _=g.current,N=s.shapes;_!==N&&(_&&N&&_.length===N.length&&_.every((O,T)=>O===N[T])||(g.current=N,e({drawingState:s})))},[s.shapes,e,s]);const y=m.useCallback(_=>{l(N=>{if(!_)return N.shapes.length===0&&N.currentShape==null?N:{...N,currentShape:null,shapes:[]};const O=N.shapes.filter(T=>T.id!==_);return O.length===N.shapes.length?N:{...N,currentShape:null,shapes:O}})},[]),C=m.useRef(s);C.current=s,m.useEffect(()=>{const _=()=>{const{currentShape:N,shapes:O}=C.current;if(N){const T=O.filter(D=>D.id!==N.id);l(D=>({...D,currentShape:null,shapes:T}))}};return document.addEventListener(of,_),()=>document.removeEventListener(of,_)},[]);const A=m.useCallback(_=>{setTimeout(()=>{l(N=>{if(!_)return N.currentShape==null?N:{...N,currentShape:null};const O=N.shapes.findIndex(T=>T.id===_.id);if(O!==-1){if(N.shapes[O]===_&&N.currentShape===_)return N;const D=N.shapes===void 0?[]:[...N.shapes];return D[O]=_,{...N,currentShape:_,shapes:D}}return{...N,currentShape:_,shapes:[...N.shapes||[],_]}})},0)},[]);return p.jsx(q.Grid,{container:!0,direction:"column",children:p.jsxs(q.Grid,{container:!0,direction:"column",children:[p.jsx(Ne,{variant:"subFormSectionTitle",children:i("spatialTarget")}),p.jsxs(q.Grid,{direction:"row",spacing:2,children:[p.jsx(dp,{displayMode:sn.TARGET,drawingState:s,playerReferences:n,scale:b,setColorToolFromCurrentShape:()=>{},setDrawingState:l,tabView:"edit",toolState:c,updateCurrentShapeInShapes:A,updateScale:w,windowId:r,setToolState:h}),p.jsx(QC,{toolState:c,deleteShape:y,setToolState:h,shapes:s.shapes,currentShape:s.currentShape,setViewTool:f,t:i,displayMode:sn.TARGET,updateCurrentShapeInShapes:A})]})]})})}eE.propTypes={playerReferences:d.object.isRequired,setTargetDrawingState:d.func.isRequired,targetDrawingState:d.object.isRequired,windowId:d.string.isRequired};const fD={activeTool:Te.POI},ry=()=>{};function tE({playerReferences:n,setTargetDrawingState:e,targetDrawingState:t,windowId:r}){const{t:i}=Bn.useTranslation(),[o,a]=m.useState(()=>{const f=Array.isArray(t?.shapes)?t.shapes:[];return{currentShape:null,isDrawing:!1,shapes:f,...t,...f.length>0?{currentShape:f[0]}:{}}}),[s,l]=m.useState(n.getScale()),u=m.useCallback(()=>{const f=n.getScale();l(b=>b===f?b:f)},[n]),c=m.useRef(o.shapes);m.useLayoutEffect(()=>{const f=c.current,b=o.shapes;f!==b&&(c.current=b,e({drawingState:o}))},[o.shapes,e,o]);const h=m.useCallback(f=>{setTimeout(()=>{a(b=>f?b.currentShape===f&&b.shapes[0]===f?b:{...b,currentShape:f,shapes:[f]}:b.currentShape==null?b:{...b,currentShape:null})},0)},[]);return p.jsxs(q.Grid,{container:!0,direction:"column",children:[p.jsx(q.Typography,{variant:"subFormSectionTitle",children:i("poi_click_to_place")}),p.jsx(q.Grid,{container:!0,direction:"row",spacing:2,children:p.jsx(dp,{displayMode:sn.POI,drawingState:o,playerReferences:n,scale:s,setColorToolFromCurrentShape:ry,setDrawingState:a,setToolState:ry,tabView:"edit",toolState:fD,updateCurrentShapeInShapes:h,updateScale:u,windowId:r})})]})}tE.propTypes={playerReferences:d.object.isRequired,setTargetDrawingState:d.func.isRequired,targetDrawingState:d.object.isRequired,windowId:d.string.isRequired};function ng({onChangeTarget:n,spatialTarget:e,pointOnly:t,playerReferences:r,target:i,windowId:o}){const{t:a}=Bn.useTranslation(),s=r.getMediaType(),l=m.useMemo(()=>{if(i)return i;const c={drawingState:{currentShape:null,isDrawing:!1,shapes:[]}};return s===$t.IMAGE&&(c.fullCanvaXYWH=`0,0,${r.getMediaTrueWidth()},${r.getMediaTrueHeight()}`),c},[i,s,r]);m.useEffect(()=>{i||n(l)},[i,l,n]);const u=c=>{n({...l,...c})};return e?p.jsxs(q.Grid,{container:!0,direction:"column",spacing:1,children:[p.jsx(q.Grid,{children:!t&&p.jsx(q.Typography,{variant:"formSectionTitle",children:a("target")})}),e&&s!==$t.AUDIO&&p.jsx(q.Grid,{container:!0,direction:"column",children:t?p.jsx(tE,{playerReferences:r,setTargetDrawingState:u,targetDrawingState:l.drawingState,windowId:o}):p.jsx(eE,{playerReferences:r,setTargetDrawingState:u,targetDrawingState:l.drawingState,windowId:o})})]}):null}ng.propTypes={onChangeTarget:d.func.isRequired,playerReferences:d.object.isRequired,pointOnly:d.bool,spatialTarget:d.bool.isRequired,target:d.object,windowId:d.string.isRequired};ng.defaultProps={pointOnly:!1};var pD=Object.prototype,gD=pD.hasOwnProperty;function mD(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&gD.call(n,"index")&&(t.index=n.index,t.input=n.input),t}function bD(n,e){var t=jp(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var vD=/\w*$/;function yD(n){var e=new n.constructor(n.source,vD.exec(n));return e.lastIndex=n.lastIndex,e}var iy=qr?qr.prototype:void 0,oy=iy?iy.valueOf:void 0;function xD(n){return oy?Object(oy.call(n)):{}}var CD="[object Boolean]",ED="[object Date]",wD="[object Map]",AD="[object Number]",_D="[object RegExp]",TD="[object Set]",ID="[object String]",SD="[object Symbol]",RD="[object ArrayBuffer]",OD="[object DataView]",ND="[object Float32Array]",jD="[object Float64Array]",DD="[object Int8Array]",MD="[object Int16Array]",kD="[object Int32Array]",LD="[object Uint8Array]",PD="[object Uint8ClampedArray]",BD="[object Uint16Array]",FD="[object Uint32Array]";function GD(n,e,t){var r=n.constructor;switch(e){case RD:return jp(n);case CD:case ED:return new r(+n);case OD:return bD(n);case ND:case jD:case DD:case MD:case kD:case LD:case PD:case BD:case FD:return wC(n,t);case wD:return new r;case AD:case ID:return new r(n);case _D:return yD(n);case TD:return new r;case SD:return xD(n)}}var qD="[object Map]";function HD(n){return Hr(n)&&Cr(n)==qD}var ay=aa&&aa.isMap,VD=ay?kp(ay):HD,WD="[object Set]";function zD(n){return Hr(n)&&Cr(n)==WD}var sy=aa&&aa.isSet,XD=sy?kp(sy):zD,UD=1,nE="[object Arguments]",$D="[object Array]",YD="[object Boolean]",ZD="[object Date]",JD="[object Error]",rE="[object Function]",KD="[object GeneratorFunction]",QD="[object Map]",e4="[object Number]",iE="[object Object]",t4="[object RegExp]",n4="[object Set]",r4="[object String]",i4="[object Symbol]",o4="[object WeakMap]",a4="[object ArrayBuffer]",s4="[object DataView]",l4="[object Float32Array]",u4="[object Float64Array]",c4="[object Int8Array]",d4="[object Int16Array]",h4="[object Int32Array]",f4="[object Uint8Array]",p4="[object Uint8ClampedArray]",g4="[object Uint16Array]",m4="[object Uint32Array]",Et={};Et[nE]=Et[$D]=Et[a4]=Et[s4]=Et[YD]=Et[ZD]=Et[l4]=Et[u4]=Et[c4]=Et[d4]=Et[h4]=Et[QD]=Et[e4]=Et[iE]=Et[t4]=Et[n4]=Et[r4]=Et[i4]=Et[f4]=Et[p4]=Et[g4]=Et[m4]=!0;Et[JD]=Et[rE]=Et[o4]=!1;function ol(n,e,t,r,i,o){var a,s=e&UD;if(a!==void 0)return a;if(!$n(n))return n;var l=Pn(n);if(l)a=mD(n);else{var u=Cr(n),c=u==rE||u==KD;if(as(n))return EC(n,s);if(u==iE||u==nE||c&&!i)a=c?{}:TC(n);else{if(!Et[u])return i?n:{};a=GD(n,u,s)}}o||(o=new _r);var h=o.get(n);if(h)return h;o.set(n,a),XD(n)?n.forEach(function(x){a.add(ol(x,e,t,x,n,o))}):VD(n)&&n.forEach(function(x,w){a.set(w,ol(x,e,t,w,n,o))});var f=wf,b=l?void 0:f(n);return LC(b||n,function(x,w){b&&(w=x,x=n[w]),NC(a,w,ol(x,e,t,w,n,o))}),a}var b4=1,v4=4;function Zo(n){return ol(n,b4|v4)}function Ei(n,e){return Kl(n,e)}var pe=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(pe||{});class Vr{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const i=pe.TYPE&pe.ATTRIBUTE;this.scope=r.scope!=null?r.scope&pe.LEVEL|i:pe.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(t=>t.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){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class Jo extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const oE=class Of{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 r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(e,t,r){const i=this.query(t);if(i==null)throw new Jo(`Unable to create ${t} blot`);const o=i,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:o.create(r),s=new o(e,a,r);return Of.blots.set(s.domNode,s),s}find(e,t=!1){return Of.find(e,t)}query(e,t=pe.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&pe.LEVEL&pe.BLOCK?r=this.types.block:e&pe.LEVEL&pe.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(i=>(r=this.classes[i],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&t&pe.LEVEL&r.scope&&t&pe.TYPE&r.scope?r:null}register(...e){return e.map(t=>{const r="blotName"in t,i="attrName"in t;if(!r&&!i)throw new Jo("Invalid definition");if(r&&t.blotName==="abstract")throw new Jo("Cannot register abstract class");const o=r?t.blotName:i?t.attrName:void 0;return this.types[o]=t,i?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):r&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(a=>a.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(a=>{(this.tags[a]==null||t.className==null)&&(this.tags[a]=t)}))),t})}};oE.blots=new WeakMap;let sa=oE;function ly(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class y4 extends Vr{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(t=>t.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){ly(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(ly(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const Rr=y4;function Oh(n){const e=n.split("-"),t=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+t}class x4 extends Vr{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[Oh(this.keyName)]=t,!0):!1}remove(e){e.style[Oh(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Oh(this.keyName)];return this.canAdd(e,t)?t:""}}const Ri=x4;class C4{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=sa.find(this.domNode);if(e==null)return;const t=Vr.keys(this.domNode),r=Rr.keys(this.domNode),i=Ri.keys(this.domNode);t.concat(r).concat(i).forEach(o=>{const a=e.scroll.query(o,pe.ATTRIBUTE);a instanceof Vr&&(this.attributes[a.attrName]=a)})}copy(e){Object.keys(this.attributes).forEach(t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}}const eu=C4,aE=class{constructor(e,t){this.scroll=e,this.domNode=t,sa.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Jo("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?t=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?t=document.createElement(r):t=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(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),sa.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,i){const o=this.isolate(e,t);if(this.scroll.query(r,pe.BLOT)!=null&&i)o.wrap(r,i);else if(this.scroll.query(r,pe.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);o.wrap(a),a.format(r,i)}}insertAt(e,t,r){const i=r==null?this.scroll.create("text",t):this.scroll.create(t,r),o=this.split(e);this.parent.insertBefore(i,o||void 0)}isolate(e,t){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(t),r}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){const r=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new Jo(`Cannot wrap ${e}`);return r.appendChild(this),r}};aE.blotName="abstract";let sE=aE;const lE=class extends sE{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 r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};lE.scope=pe.INLINE_BLOT;let E4=lE;const yn=E4;class w4{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),i=0;for(;r;){if(r===e)return i;i+=1,r=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,r=this.head;for(;r!=null;){if(r===e)return t;t+=r.length(),r=r.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-=1)}iterator(e=this.head){return()=>{const t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){const r=this.iterator();let i=r();for(;i;){const o=i.length();if(e<o||t&&e===o&&(i.next==null||i.next.length()!==0))return[i,e];e-=o,i=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[i,o]=this.find(e);let a=e-o;const s=this.iterator(i);let l=s();for(;l&&a<e+t;){const u=l.length();e>a?r(l,e-a,Math.min(t,a+u-e)):r(l,0,Math.min(u,e+t-a)),a+=u,l=s()}}map(e){return this.reduce((t,r)=>(t.push(e(r)),t),[])}reduce(e,t){const r=this.iterator();let i=r();for(;i;)t=e(t,i),i=r();return t}}function uy(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(pe.INLINE);return Array.from(n.childNodes).forEach(i=>{r.domNode.appendChild(i)}),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const uE=class yi extends sE{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(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,yi.uiClass&&this.uiNode.classList.add(yi.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new w4,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=uy(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof Jo)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(r,i,o)=>{r.deleteAt(i,o)})}descendant(e,t=0){const[r,i]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,i]:r instanceof yi?r.descendant(e,i):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let i=[],o=r;return this.children.forEachAt(t,r,(a,s,l)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&i.push(a),a instanceof yi&&(i=i.concat(a.descendants(e,s,o))),o-=l}),i}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(t=>{e||this.statics.allowedChildren.some(r=>t instanceof r)||(t.statics.scope===pe.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof yi?t.unwrap():t.remove())})}formatAt(e,t,r,i){this.children.forEachAt(e,t,(o,a,s)=>{o.formatAt(a,s,r,i)})}insertAt(e,t,r){const[i,o]=this.children.find(e);if(i)i.insertAt(o,t,r);else{const a=r==null?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(a)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(r=>{e.insertBefore(r,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){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[r,i]=this.children.find(e,t),o=[[this,e]];return r instanceof yi?o.concat(r.path(i,t)):(r!=null&&o.push([r,i]),o)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return r instanceof yi&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(i,o,a)=>{const s=i.split(o,t);s!=null&&r.appendChild(s)}),r}splitAfter(e){const 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){const r=[],i=[];e.forEach(o=>{o.target===this.domNode&&o.type==="childList"&&(r.push(...o.addedNodes),i.push(...o.removedNodes))}),i.forEach(o=>{if(o.parentNode!=null&&o.tagName!=="IFRAME"&&document.body.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(o);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()}),r.filter(o=>o.parentNode===this.domNode&&o!==this.uiNode).sort((o,a)=>o===a?0:o.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(o=>{let a=null;o.nextSibling!=null&&(a=this.scroll.find(o.nextSibling));const s=uy(o,this.scroll);(s.next!==a||s.next==null)&&(s.parent!=null&&s.parent.removeChild(this),this.insertBefore(s,a||void 0))}),this.enforceAllowedChildren()}};uE.uiClass="";let A4=uE;const Tr=A4;function _4(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const Ho=class Vo extends Tr{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Vo.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new eu(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(r=>{r instanceof Vo||(r=r.wrap(Vo.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,pe.INLINE);if(r==null)return;r instanceof Vr?this.attributes.attribute(r,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,i){this.formats()[r]!=null||this.scroll.query(r,pe.ATTRIBUTE)?this.isolate(e,t).format(r,i):super.formatAt(e,t,r,i)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const r=this.next;r instanceof Vo&&r.prev===this&&_4(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof Vo&&this.attributes.move(r),r}};Ho.allowedChildren=[Ho,yn],Ho.blotName="inline",Ho.scope=pe.INLINE_BLOT,Ho.tagName="SPAN";let T4=Ho;const rg=T4,Wo=class Nf extends Tr{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Nf.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new eu(this.domNode)}format(e,t){const r=this.scroll.query(e,pe.BLOCK);r!=null&&(r instanceof Vr?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(Nf.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,i){this.scroll.query(r,pe.BLOCK)!=null?this.format(r,i):super.formatAt(e,t,r,i)}insertAt(e,t,r){if(r==null||this.scroll.query(t,pe.INLINE)!=null)super.insertAt(e,t,r);else{const i=this.split(e);if(i!=null){const o=this.scroll.create(t,r);i.parent.insertBefore(o,i)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};Wo.blotName="block",Wo.scope=pe.BLOCK_BLOT,Wo.tagName="P",Wo.allowedChildren=[rg,Wo,yn];let I4=Wo;const ss=I4,jf=class extends Tr{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,i){super.formatAt(e,t,r,i),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};jf.blotName="container",jf.scope=pe.BLOCK_BLOT;let S4=jf;const tu=S4;class R4 extends yn{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,i){e===0&&t===this.length()?this.format(r,i):super.formatAt(e,t,r,i)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Yn=R4,O4={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},N4=100,zo=class extends Tr{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,O4),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=pe.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(r=>{r.remove()}):super.deleteAt(e,t)}formatAt(e,t,r,i){this.update(),super.formatAt(e,t,r,i)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const o=(l,u=!0)=>{l==null||l===this||l.domNode.parentNode!=null&&(r.has(l.domNode)||r.set(l.domNode,[]),u&&o(l.parent))},a=l=>{r.has(l.domNode)&&(l instanceof Tr&&l.children.forEach(a),r.delete(l.domNode),l.optimize(t))};let s=e;for(let l=0;s.length>0;l+=1){if(l>=N4)throw new Error("[Parchment] Maximum optimize iterations reached");for(s.forEach(u=>{const c=this.find(u.target,!0);c!=null&&(c.domNode===u.target&&(u.type==="childList"?(o(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach(h=>{const f=this.find(h,!1);o(f,!1),f instanceof Tr&&f.children.forEach(b=>{o(b,!1)})})):u.type==="attributes"&&o(c.prev)),o(c))}),this.children.forEach(a),s=Array.from(this.observer.takeRecords()),i=s.slice();i.length>0;)e.push(i.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(i=>{const o=this.find(i.target,!0);return o==null?null:r.has(o.domNode)?(r.get(o.domNode).push(i),null):(r.set(o.domNode,[i]),o)}).forEach(i=>{i!=null&&i!==this&&r.has(i.domNode)&&i.update(r.get(i.domNode)||[],t)}),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};zo.blotName="scroll",zo.defaultChild=ss,zo.allowedChildren=[ss,tu],zo.scope=pe.BLOCK_BLOT,zo.tagName="DIV";let j4=zo;const ig=j4,Df=class cE extends yn{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,r){r==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof cE&&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}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Df.blotName="text",Df.scope=pe.INLINE_BLOT;let D4=Df;const Cl=D4,M4=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Vr,AttributorStore:eu,BlockBlot:ss,ClassAttributor:Rr,ContainerBlot:tu,EmbedBlot:Yn,InlineBlot:rg,LeafBlot:yn,ParentBlot:Tr,Registry:sa,Scope:pe,ScrollBlot:ig,StyleAttributor:Ri,TextBlot:Cl},Symbol.toStringTag,{value:"Module"}));var qs={exports:{}},Nh,cy;function k4(){if(cy)return Nh;cy=1;var n=-1,e=1,t=0;function r(E,S,I,P,B){if(E===S)return E?[[t,E]]:[];if(I!=null){var F=M(E,S,I);if(F)return F}var G=s(E,S),V=E.substring(0,G);E=E.substring(G),S=S.substring(G),G=u(E,S);var z=E.substring(E.length-G);E=E.substring(0,E.length-G),S=S.substring(0,S.length-G);var W=i(E,S);return V&&W.unshift([t,V]),z&&W.push([t,z]),C(W,B),P&&h(W),W}function i(E,S){var I;if(!E)return[[e,S]];if(!S)return[[n,E]];var P=E.length>S.length?E:S,B=E.length>S.length?S:E,F=P.indexOf(B);if(F!==-1)return I=[[e,P.substring(0,F)],[t,B],[e,P.substring(F+B.length)]],E.length>S.length&&(I[0][0]=I[2][0]=n),I;if(B.length===1)return[[n,E],[e,S]];var G=c(E,S);if(G){var V=G[0],z=G[1],W=G[2],J=G[3],Y=G[4],ee=r(V,W),K=r(z,J);return ee.concat([[t,Y]],K)}return o(E,S)}function o(E,S){for(var I=E.length,P=S.length,B=Math.ceil((I+P)/2),F=B,G=2*B,V=new Array(G),z=new Array(G),W=0;W<G;W++)V[W]=-1,z[W]=-1;V[F+1]=0,z[F+1]=0;for(var J=I-P,Y=J%2!==0,ee=0,K=0,X=0,ie=0,de=0;de<B;de++){for(var oe=-de+ee;oe<=de-K;oe+=2){var me=F+oe,je;oe===-de||oe!==de&&V[me-1]<V[me+1]?je=V[me+1]:je=V[me-1]+1;for(var Le=je-oe;je<I&&Le<P&&E.charAt(je)===S.charAt(Le);)je++,Le++;if(V[me]=je,je>I)K+=2;else if(Le>P)ee+=2;else if(Y){var De=F+J-oe;if(De>=0&&De<G&&z[De]!==-1){var He=I-z[De];if(je>=He)return a(E,S,je,Le)}}}for(var ve=-de+X;ve<=de-ie;ve+=2){var De=F+ve,He;ve===-de||ve!==de&&z[De-1]<z[De+1]?He=z[De+1]:He=z[De-1]+1;for(var se=He-ve;He<I&&se<P&&E.charAt(I-He-1)===S.charAt(P-se-1);)He++,se++;if(z[De]=He,He>I)ie+=2;else if(se>P)X+=2;else if(!Y){var me=F+J-ve;if(me>=0&&me<G&&V[me]!==-1){var je=V[me],Le=F+je-me;if(He=I-He,je>=He)return a(E,S,je,Le)}}}}return[[n,E],[e,S]]}function a(E,S,I,P){var B=E.substring(0,I),F=S.substring(0,P),G=E.substring(I),V=S.substring(P),z=r(B,F),W=r(G,V);return z.concat(W)}function s(E,S){if(!E||!S||E.charAt(0)!==S.charAt(0))return 0;for(var I=0,P=Math.min(E.length,S.length),B=P,F=0;I<B;)E.substring(F,B)==S.substring(F,B)?(I=B,F=I):P=B,B=Math.floor((P-I)/2+I);return A(E.charCodeAt(B-1))&&B--,B}function l(E,S){var I=E.length,P=S.length;if(I==0||P==0)return 0;I>P?E=E.substring(I-P):I<P&&(S=S.substring(0,I));var B=Math.min(I,P);if(E==S)return B;for(var F=0,G=1;;){var V=E.substring(B-G),z=S.indexOf(V);if(z==-1)return F;G+=z,(z==0||E.substring(B-G)==S.substring(0,G))&&(F=G,G++)}}function u(E,S){if(!E||!S||E.slice(-1)!==S.slice(-1))return 0;for(var I=0,P=Math.min(E.length,S.length),B=P,F=0;I<B;)E.substring(E.length-B,E.length-F)==S.substring(S.length-B,S.length-F)?(I=B,F=I):P=B,B=Math.floor((P-I)/2+I);return _(E.charCodeAt(E.length-B))&&B--,B}function c(E,S){var I=E.length>S.length?E:S,P=E.length>S.length?S:E;if(I.length<4||P.length*2<I.length)return null;function B(K,X,ie){for(var de=K.substring(ie,ie+Math.floor(K.length/4)),oe=-1,me="",je,Le,De,He;(oe=X.indexOf(de,oe+1))!==-1;){var ve=s(K.substring(ie),X.substring(oe)),se=u(K.substring(0,ie),X.substring(0,oe));me.length<se+ve&&(me=X.substring(oe-se,oe)+X.substring(oe,oe+ve),je=K.substring(0,ie-se),Le=K.substring(ie+ve),De=X.substring(0,oe-se),He=X.substring(oe+ve))}return me.length*2>=K.length?[je,Le,De,He,me]:null}var F=B(I,P,Math.ceil(I.length/4)),G=B(I,P,Math.ceil(I.length/2)),V;if(!F&&!G)return null;G?F?V=F[4].length>G[4].length?F:G:V=G:V=F;var z,W,J,Y;E.length>S.length?(z=V[0],W=V[1],J=V[2],Y=V[3]):(J=V[0],Y=V[1],z=V[2],W=V[3]);var ee=V[4];return[z,W,J,Y,ee]}function h(E){for(var S=!1,I=[],P=0,B=null,F=0,G=0,V=0,z=0,W=0;F<E.length;)E[F][0]==t?(I[P++]=F,G=z,V=W,z=0,W=0,B=E[F][1]):(E[F][0]==e?z+=E[F][1].length:W+=E[F][1].length,B&&B.length<=Math.max(G,V)&&B.length<=Math.max(z,W)&&(E.splice(I[P-1],0,[n,B]),E[I[P-1]+1][0]=e,P--,P--,F=P>0?I[P-1]:-1,G=0,V=0,z=0,W=0,B=null,S=!0)),F++;for(S&&C(E),y(E),F=1;F<E.length;){if(E[F-1][0]==n&&E[F][0]==e){var J=E[F-1][1],Y=E[F][1],ee=l(J,Y),K=l(Y,J);ee>=K?(ee>=J.length/2||ee>=Y.length/2)&&(E.splice(F,0,[t,Y.substring(0,ee)]),E[F-1][1]=J.substring(0,J.length-ee),E[F+1][1]=Y.substring(ee),F++):(K>=J.length/2||K>=Y.length/2)&&(E.splice(F,0,[t,J.substring(0,K)]),E[F-1][0]=e,E[F-1][1]=Y.substring(0,Y.length-K),E[F+1][0]=n,E[F+1][1]=J.substring(K),F++),F++}F++}}var f=/[^a-zA-Z0-9]/,b=/\s/,x=/[\r\n]/,w=/\n\r?\n$/,g=/^\r?\n\r?\n/;function y(E){function S(K,X){if(!K||!X)return 6;var ie=K.charAt(K.length-1),de=X.charAt(0),oe=ie.match(f),me=de.match(f),je=oe&&ie.match(b),Le=me&&de.match(b),De=je&&ie.match(x),He=Le&&de.match(x),ve=De&&K.match(w),se=He&&X.match(g);return ve||se?5:De||He?4:oe&&!je&&Le?3:je||Le?2:oe||me?1:0}for(var I=1;I<E.length-1;){if(E[I-1][0]==t&&E[I+1][0]==t){var P=E[I-1][1],B=E[I][1],F=E[I+1][1],G=u(P,B);if(G){var V=B.substring(B.length-G);P=P.substring(0,P.length-G),B=V+B.substring(0,B.length-G),F=V+F}for(var z=P,W=B,J=F,Y=S(P,B)+S(B,F);B.charAt(0)===F.charAt(0);){P+=B.charAt(0),B=B.substring(1)+F.charAt(0),F=F.substring(1);var ee=S(P,B)+S(B,F);ee>=Y&&(Y=ee,z=P,W=B,J=F)}E[I-1][1]!=z&&(z?E[I-1][1]=z:(E.splice(I-1,1),I--),E[I][1]=W,J?E[I+1][1]=J:(E.splice(I+1,1),I--))}I++}}function C(E,S){E.push([t,""]);for(var I=0,P=0,B=0,F="",G="",V;I<E.length;){if(I<E.length-1&&!E[I][1]){E.splice(I,1);continue}switch(E[I][0]){case e:B++,G+=E[I][1],I++;break;case n:P++,F+=E[I][1],I++;break;case t:var z=I-B-P-1;if(S){if(z>=0&&O(E[z][1])){var W=E[z][1].slice(-1);if(E[z][1]=E[z][1].slice(0,-1),F=W+F,G=W+G,!E[z][1]){E.splice(z,1),I--;var J=z-1;E[J]&&E[J][0]===e&&(B++,G=E[J][1]+G,J--),E[J]&&E[J][0]===n&&(P++,F=E[J][1]+F,J--),z=J}}if(N(E[I][1])){var W=E[I][1].charAt(0);E[I][1]=E[I][1].slice(1),F+=W,G+=W}}if(I<E.length-1&&!E[I][1]){E.splice(I,1);break}if(F.length>0||G.length>0){F.length>0&&G.length>0&&(V=s(G,F),V!==0&&(z>=0?E[z][1]+=G.substring(0,V):(E.splice(0,0,[t,G.substring(0,V)]),I++),G=G.substring(V),F=F.substring(V)),V=u(G,F),V!==0&&(E[I][1]=G.substring(G.length-V)+E[I][1],G=G.substring(0,G.length-V),F=F.substring(0,F.length-V)));var Y=B+P;F.length===0&&G.length===0?(E.splice(I-Y,Y),I=I-Y):F.length===0?(E.splice(I-Y,Y,[e,G]),I=I-Y+1):G.length===0?(E.splice(I-Y,Y,[n,F]),I=I-Y+1):(E.splice(I-Y,Y,[n,F],[e,G]),I=I-Y+2)}I!==0&&E[I-1][0]===t?(E[I-1][1]+=E[I][1],E.splice(I,1)):I++,B=0,P=0,F="",G="";break}}E[E.length-1][1]===""&&E.pop();var ee=!1;for(I=1;I<E.length-1;)E[I-1][0]===t&&E[I+1][0]===t&&(E[I][1].substring(E[I][1].length-E[I-1][1].length)===E[I-1][1]?(E[I][1]=E[I-1][1]+E[I][1].substring(0,E[I][1].length-E[I-1][1].length),E[I+1][1]=E[I-1][1]+E[I+1][1],E.splice(I-1,1),ee=!0):E[I][1].substring(0,E[I+1][1].length)==E[I+1][1]&&(E[I-1][1]+=E[I+1][1],E[I][1]=E[I][1].substring(E[I+1][1].length)+E[I+1][1],E.splice(I+1,1),ee=!0)),I++;ee&&C(E,S)}function A(E){return E>=55296&&E<=56319}function _(E){return E>=56320&&E<=57343}function N(E){return _(E.charCodeAt(0))}function O(E){return A(E.charCodeAt(E.length-1))}function T(E){for(var S=[],I=0;I<E.length;I++)E[I][1].length>0&&S.push(E[I]);return S}function D(E,S,I,P){return O(E)||N(P)?null:T([[t,E],[n,S],[e,I],[t,P]])}function M(E,S,I){var P=typeof I=="number"?{index:I,length:0}:I.oldRange,B=typeof I=="number"?null:I.newRange,F=E.length,G=S.length;if(P.length===0&&(B===null||B.length===0)){var V=P.index,z=E.slice(0,V),W=E.slice(V),J=B?B.index:null;e:{var Y=V+G-F;if(J!==null&&J!==Y||Y<0||Y>G)break e;var ee=S.slice(0,Y),K=S.slice(Y);if(K!==W)break e;var X=Math.min(V,Y),ie=z.slice(0,X),de=ee.slice(0,X);if(ie!==de)break e;var oe=z.slice(X),me=ee.slice(X);return D(ie,oe,me,W)}e:{if(J!==null&&J!==V)break e;var je=V,ee=S.slice(0,je),K=S.slice(je);if(ee!==z)break e;var Le=Math.min(F-je,G-je),De=W.slice(W.length-Le),He=K.slice(K.length-Le);if(De!==He)break e;var oe=W.slice(0,W.length-Le),me=K.slice(0,K.length-Le);return D(z,oe,me,De)}}if(P.length>0&&B&&B.length===0)e:{var ie=E.slice(0,P.index),De=E.slice(P.index+P.length),X=ie.length,Le=De.length;if(G<X+Le)break e;var de=S.slice(0,X),He=S.slice(G-Le);if(ie!==de||De!==He)break e;var oe=E.slice(X,F-Le),me=S.slice(X,G-Le);return D(ie,oe,me,De)}return null}function L(E,S,I,P){return r(E,S,I,P,!0)}return L.INSERT=e,L.DELETE=n,L.EQUAL=t,Nh=L,Nh}var Wa={exports:{}};Wa.exports;var dy;function dE(){return dy||(dy=1,(function(n,e){var t=200,r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",c="[object Function]",h="[object GeneratorFunction]",f="[object Map]",b="[object Number]",x="[object Object]",w="[object Promise]",g="[object RegExp]",y="[object Set]",C="[object String]",A="[object Symbol]",_="[object WeakMap]",N="[object ArrayBuffer]",O="[object DataView]",T="[object Float32Array]",D="[object Float64Array]",M="[object Int8Array]",L="[object Int16Array]",E="[object Int32Array]",S="[object Uint8Array]",I="[object Uint8ClampedArray]",P="[object Uint16Array]",B="[object Uint32Array]",F=/[\\^$.*+?()[\]{}|]/g,G=/\w*$/,V=/^\[object .+?Constructor\]$/,z=/^(?:0|[1-9]\d*)$/,W={};W[o]=W[a]=W[N]=W[O]=W[s]=W[l]=W[T]=W[D]=W[M]=W[L]=W[E]=W[f]=W[b]=W[x]=W[g]=W[y]=W[C]=W[A]=W[S]=W[I]=W[P]=W[B]=!0,W[u]=W[c]=W[_]=!1;var J=typeof ar=="object"&&ar&&ar.Object===Object&&ar,Y=typeof self=="object"&&self&&self.Object===Object&&self,ee=J||Y||Function("return this")(),K=e&&!e.nodeType&&e,X=K&&!0&&n&&!n.nodeType&&n,ie=X&&X.exports===K;function de(v,R){return v.set(R[0],R[1]),v}function oe(v,R){return v.add(R),v}function me(v,R){for(var k=-1,U=v?v.length:0;++k<U&&R(v[k],k,v)!==!1;);return v}function je(v,R){for(var k=-1,U=R.length,Fe=v.length;++k<U;)v[Fe+k]=R[k];return v}function Le(v,R,k,U){for(var Fe=-1,ye=v?v.length:0;++Fe<ye;)k=R(k,v[Fe],Fe,v);return k}function De(v,R){for(var k=-1,U=Array(v);++k<v;)U[k]=R(k);return U}function He(v,R){return v?.[R]}function ve(v){var R=!1;if(v!=null&&typeof v.toString!="function")try{R=!!(v+"")}catch{}return R}function se(v){var R=-1,k=Array(v.size);return v.forEach(function(U,Fe){k[++R]=[Fe,U]}),k}function Me(v,R){return function(k){return v(R(k))}}function Re(v){var R=-1,k=Array(v.size);return v.forEach(function(U){k[++R]=U}),k}var tt=Array.prototype,Ie=Function.prototype,Ye=Object.prototype,Ue=ee["__core-js_shared__"],wt=(function(){var v=/[^.]+$/.exec(Ue&&Ue.keys&&Ue.keys.IE_PROTO||"");return v?"Symbol(src)_1."+v:""})(),Ke=Ie.toString,gt=Ye.hasOwnProperty,Ot=Ye.toString,kt=RegExp("^"+Ke.call(gt).replace(F,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yt=ie?ee.Buffer:void 0,it=ee.Symbol,mt=ee.Uint8Array,pt=Me(Object.getPrototypeOf,Object),xt=Object.create,en=Ye.propertyIsEnumerable,st=tt.splice,lt=Object.getOwnPropertySymbols,tn=yt?yt.isBuffer:void 0,Rn=Me(Object.keys,Object),Lt=qn(ee,"DataView"),bt=qn(ee,"Map"),Nt=qn(ee,"Promise"),Ce=qn(ee,"Set"),ce=qn(ee,"WeakMap"),Ae=qn(Object,"create"),ze=$(Lt),qe=$(bt),te=$(Nt),_e=$(Ce),Xe=$(ce),ht=it?it.prototype:void 0,ft=ht?ht.valueOf:void 0;function $e(v){var R=-1,k=v?v.length:0;for(this.clear();++R<k;){var U=v[R];this.set(U[0],U[1])}}function nn(){this.__data__=Ae?Ae(null):{}}function Cn(v){return this.has(v)&&delete this.__data__[v]}function cr(v){var R=this.__data__;if(Ae){var k=R[v];return k===r?void 0:k}return gt.call(R,v)?R[v]:void 0}function dr(v){var R=this.__data__;return Ae?R[v]!==void 0:gt.call(R,v)}function En(v,R){var k=this.__data__;return k[v]=Ae&&R===void 0?r:R,this}$e.prototype.clear=nn,$e.prototype.delete=Cn,$e.prototype.get=cr,$e.prototype.has=dr,$e.prototype.set=En;function At(v){var R=-1,k=v?v.length:0;for(this.clear();++R<k;){var U=v[R];this.set(U[0],U[1])}}function $r(){this.__data__=[]}function Zn(v){var R=this.__data__,k=jt(R,v);if(k<0)return!1;var U=R.length-1;return k==U?R.pop():st.call(R,k,1),!0}function Nr(v){var R=this.__data__,k=jt(R,v);return k<0?void 0:R[k][1]}function hr(v){return jt(this.__data__,v)>-1}function fr(v,R){var k=this.__data__,U=jt(k,v);return U<0?k.push([v,R]):k[U][1]=R,this}At.prototype.clear=$r,At.prototype.delete=Zn,At.prototype.get=Nr,At.prototype.has=hr,At.prototype.set=fr;function Ht(v){var R=-1,k=v?v.length:0;for(this.clear();++R<k;){var U=v[R];this.set(U[0],U[1])}}function vt(){this.__data__={hash:new $e,map:new(bt||At),string:new $e}}function Jn(v){return Pr(this,v).delete(v)}function Ni(v){return Pr(this,v).get(v)}function jr(v){return Pr(this,v).has(v)}function Dr(v,R){return Pr(this,v).set(v,R),this}Ht.prototype.clear=vt,Ht.prototype.delete=Jn,Ht.prototype.get=Ni,Ht.prototype.has=jr,Ht.prototype.set=Dr;function Vt(v){this.__data__=new At(v)}function Yr(){this.__data__=new At}function ji(v){return this.__data__.delete(v)}function ui(v){return this.__data__.get(v)}function ci(v){return this.__data__.has(v)}function di(v,R){var k=this.__data__;if(k instanceof At){var U=k.__data__;if(!bt||U.length<t-1)return U.push([v,R]),this;k=this.__data__=new Ht(U)}return k.set(v,R),this}Vt.prototype.clear=Yr,Vt.prototype.delete=ji,Vt.prototype.get=ui,Vt.prototype.has=ci,Vt.prototype.set=di;function ae(v,R){var k=nt(v)||Ee(v)?De(v.length,String):[],U=k.length,Fe=!!U;for(var ye in v)gt.call(v,ye)&&!(Fe&&(ye=="length"||Di(ye,U)))&&k.push(ye);return k}function Ze(v,R,k){var U=v[R];(!(gt.call(v,R)&&le(U,k))||k===void 0&&!(R in v))&&(v[R]=k)}function jt(v,R){for(var k=v.length;k--;)if(le(v[k][0],R))return k;return-1}function ot(v,R){return v&&pi(R,ma(R),v)}function rn(v,R,k,U,Fe,ye,rt){var Qe;if(U&&(Qe=ye?U(v,Fe,ye,rt):U(v)),Qe!==void 0)return Qe;if(!Br(v))return v;var zt=nt(v);if(zt){if(Qe=ga(v),!R)return fi(v,Qe)}else{var ct=gr(v),gn=ct==c||ct==h;if(Jt(v))return wn(v,R);if(ct==x||ct==o||gn&&!ye){if(ve(v))return ye?v:{};if(Qe=Hn(gn?{}:v),!R)return co(v,ot(Qe,v))}else{if(!W[ct])return ye?v:{};Qe=gi(v,ct,rn,R)}}rt||(rt=new Vt);var On=rt.get(v);if(On)return On;if(rt.set(v,Qe),!zt)var Kt=k?ho(v):ma(v);return me(Kt||v,function(mn,un){Kt&&(un=mn,mn=v[un]),Ze(Qe,un,rn(mn,R,k,U,un,v,rt))}),Qe}function Mr(v){return Br(v)?xt(v):{}}function pr(v,R,k){var U=R(v);return nt(v)?U:je(U,k(v))}function kr(v){return Ot.call(v)}function hi(v){if(!Br(v)||j(v))return!1;var R=Jr(v)||ve(v)?kt:V;return R.test($(v))}function Lr(v){if(!H(v))return Rn(v);var R=[];for(var k in Object(v))gt.call(v,k)&&k!="constructor"&&R.push(k);return R}function wn(v,R){if(R)return v.slice();var k=new v.constructor(v.length);return v.copy(k),k}function Kn(v){var R=new v.constructor(v.byteLength);return new mt(R).set(new mt(v)),R}function An(v,R){var k=R?Kn(v.buffer):v.buffer;return new v.constructor(k,v.byteOffset,v.byteLength)}function Gn(v,R,k){var U=R?k(se(v),!0):se(v);return Le(U,de,new v.constructor)}function Qn(v){var R=new v.constructor(v.source,G.exec(v));return R.lastIndex=v.lastIndex,R}function on(v,R,k){var U=R?k(Re(v),!0):Re(v);return Le(U,oe,new v.constructor)}function Zr(v){return ft?Object(ft.call(v)):{}}function er(v,R){var k=R?Kn(v.buffer):v.buffer;return new v.constructor(k,v.byteOffset,v.length)}function fi(v,R){var k=-1,U=v.length;for(R||(R=Array(U));++k<U;)R[k]=v[k];return R}function pi(v,R,k,U){k||(k={});for(var Fe=-1,ye=R.length;++Fe<ye;){var rt=R[Fe],Qe=void 0;Ze(k,rt,Qe===void 0?v[rt]:Qe)}return k}function co(v,R){return pi(v,tr(v),R)}function ho(v){return pr(v,ma,tr)}function Pr(v,R){var k=v.__data__;return Q(R)?k[typeof R=="string"?"string":"hash"]:k.map}function qn(v,R){var k=He(v,R);return hi(k)?k:void 0}var tr=lt?Me(lt,Object):cu,gr=kr;(Lt&&gr(new Lt(new ArrayBuffer(1)))!=O||bt&&gr(new bt)!=f||Nt&&gr(Nt.resolve())!=w||Ce&&gr(new Ce)!=y||ce&&gr(new ce)!=_)&&(gr=function(v){var R=Ot.call(v),k=R==x?v.constructor:void 0,U=k?$(k):void 0;if(U)switch(U){case ze:return O;case qe:return f;case te:return w;case _e:return y;case Xe:return _}return R});function ga(v){var R=v.length,k=v.constructor(R);return R&&typeof v[0]=="string"&>.call(v,"index")&&(k.index=v.index,k.input=v.input),k}function Hn(v){return typeof v.constructor=="function"&&!H(v)?Mr(pt(v)):{}}function gi(v,R,k,U){var Fe=v.constructor;switch(R){case N:return Kn(v);case s:case l:return new Fe(+v);case O:return An(v,U);case T:case D:case M:case L:case E:case S:case I:case P:case B:return er(v,U);case f:return Gn(v,U,k);case b:case C:return new Fe(v);case g:return Qn(v);case y:return on(v,U,k);case A:return Zr(v)}}function Di(v,R){return R=R??i,!!R&&(typeof v=="number"||z.test(v))&&v>-1&&v%1==0&&v<R}function Q(v){var R=typeof v;return R=="string"||R=="number"||R=="symbol"||R=="boolean"?v!=="__proto__":v===null}function j(v){return!!wt&&wt in v}function H(v){var R=v&&v.constructor,k=typeof R=="function"&&R.prototype||Ye;return v===k}function $(v){if(v!=null){try{return Ke.call(v)}catch{}try{return v+""}catch{}}return""}function re(v){return rn(v,!0,!0)}function le(v,R){return v===R||v!==v&&R!==R}function Ee(v){return an(v)&>.call(v,"callee")&&(!en.call(v,"callee")||Ot.call(v)==o)}var nt=Array.isArray;function ut(v){return v!=null&&Wt(v.length)&&!Jr(v)}function an(v){return _s(v)&&ut(v)}var Jt=tn||du;function Jr(v){var R=Br(v)?Ot.call(v):"";return R==c||R==h}function Wt(v){return typeof v=="number"&&v>-1&&v%1==0&&v<=i}function Br(v){var R=typeof v;return!!v&&(R=="object"||R=="function")}function _s(v){return!!v&&typeof v=="object"}function ma(v){return ut(v)?ae(v):Lr(v)}function cu(){return[]}function du(){return!1}n.exports=re})(Wa,Wa.exports)),Wa.exports}var za={exports:{}};za.exports;var hy;function hE(){return hy||(hy=1,(function(n,e){var t=200,r="__lodash_hash_undefined__",i=1,o=2,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",h="[object Date]",f="[object Error]",b="[object Function]",x="[object GeneratorFunction]",w="[object Map]",g="[object Number]",y="[object Null]",C="[object Object]",A="[object Promise]",_="[object Proxy]",N="[object RegExp]",O="[object Set]",T="[object String]",D="[object Symbol]",M="[object Undefined]",L="[object WeakMap]",E="[object ArrayBuffer]",S="[object DataView]",I="[object Float32Array]",P="[object Float64Array]",B="[object Int8Array]",F="[object Int16Array]",G="[object Int32Array]",V="[object Uint8Array]",z="[object Uint8ClampedArray]",W="[object Uint16Array]",J="[object Uint32Array]",Y=/[\\^$.*+?()[\]{}|]/g,ee=/^\[object .+?Constructor\]$/,K=/^(?:0|[1-9]\d*)$/,X={};X[I]=X[P]=X[B]=X[F]=X[G]=X[V]=X[z]=X[W]=X[J]=!0,X[s]=X[l]=X[E]=X[c]=X[S]=X[h]=X[f]=X[b]=X[w]=X[g]=X[C]=X[N]=X[O]=X[T]=X[L]=!1;var ie=typeof ar=="object"&&ar&&ar.Object===Object&&ar,de=typeof self=="object"&&self&&self.Object===Object&&self,oe=ie||de||Function("return this")(),me=e&&!e.nodeType&&e,je=me&&!0&&n&&!n.nodeType&&n,Le=je&&je.exports===me,De=Le&&ie.process,He=(function(){try{return De&&De.binding&&De.binding("util")}catch{}})(),ve=He&&He.isTypedArray;function se(v,R){for(var k=-1,U=v==null?0:v.length,Fe=0,ye=[];++k<U;){var rt=v[k];R(rt,k,v)&&(ye[Fe++]=rt)}return ye}function Me(v,R){for(var k=-1,U=R.length,Fe=v.length;++k<U;)v[Fe+k]=R[k];return v}function Re(v,R){for(var k=-1,U=v==null?0:v.length;++k<U;)if(R(v[k],k,v))return!0;return!1}function tt(v,R){for(var k=-1,U=Array(v);++k<v;)U[k]=R(k);return U}function Ie(v){return function(R){return v(R)}}function Ye(v,R){return v.has(R)}function Ue(v,R){return v?.[R]}function wt(v){var R=-1,k=Array(v.size);return v.forEach(function(U,Fe){k[++R]=[Fe,U]}),k}function Ke(v,R){return function(k){return v(R(k))}}function gt(v){var R=-1,k=Array(v.size);return v.forEach(function(U){k[++R]=U}),k}var Ot=Array.prototype,kt=Function.prototype,yt=Object.prototype,it=oe["__core-js_shared__"],mt=kt.toString,pt=yt.hasOwnProperty,xt=(function(){var v=/[^.]+$/.exec(it&&it.keys&&it.keys.IE_PROTO||"");return v?"Symbol(src)_1."+v:""})(),en=yt.toString,st=RegExp("^"+mt.call(pt).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lt=Le?oe.Buffer:void 0,tn=oe.Symbol,Rn=oe.Uint8Array,Lt=yt.propertyIsEnumerable,bt=Ot.splice,Nt=tn?tn.toStringTag:void 0,Ce=Object.getOwnPropertySymbols,ce=lt?lt.isBuffer:void 0,Ae=Ke(Object.keys,Object),ze=tr(oe,"DataView"),qe=tr(oe,"Map"),te=tr(oe,"Promise"),_e=tr(oe,"Set"),Xe=tr(oe,"WeakMap"),ht=tr(Object,"create"),ft=$(ze),$e=$(qe),nn=$(te),Cn=$(_e),cr=$(Xe),dr=tn?tn.prototype:void 0,En=dr?dr.valueOf:void 0;function At(v){var R=-1,k=v==null?0:v.length;for(this.clear();++R<k;){var U=v[R];this.set(U[0],U[1])}}function $r(){this.__data__=ht?ht(null):{},this.size=0}function Zn(v){var R=this.has(v)&&delete this.__data__[v];return this.size-=R?1:0,R}function Nr(v){var R=this.__data__;if(ht){var k=R[v];return k===r?void 0:k}return pt.call(R,v)?R[v]:void 0}function hr(v){var R=this.__data__;return ht?R[v]!==void 0:pt.call(R,v)}function fr(v,R){var k=this.__data__;return this.size+=this.has(v)?0:1,k[v]=ht&&R===void 0?r:R,this}At.prototype.clear=$r,At.prototype.delete=Zn,At.prototype.get=Nr,At.prototype.has=hr,At.prototype.set=fr;function Ht(v){var R=-1,k=v==null?0:v.length;for(this.clear();++R<k;){var U=v[R];this.set(U[0],U[1])}}function vt(){this.__data__=[],this.size=0}function Jn(v){var R=this.__data__,k=wn(R,v);if(k<0)return!1;var U=R.length-1;return k==U?R.pop():bt.call(R,k,1),--this.size,!0}function Ni(v){var R=this.__data__,k=wn(R,v);return k<0?void 0:R[k][1]}function jr(v){return wn(this.__data__,v)>-1}function Dr(v,R){var k=this.__data__,U=wn(k,v);return U<0?(++this.size,k.push([v,R])):k[U][1]=R,this}Ht.prototype.clear=vt,Ht.prototype.delete=Jn,Ht.prototype.get=Ni,Ht.prototype.has=jr,Ht.prototype.set=Dr;function Vt(v){var R=-1,k=v==null?0:v.length;for(this.clear();++R<k;){var U=v[R];this.set(U[0],U[1])}}function Yr(){this.size=0,this.__data__={hash:new At,map:new(qe||Ht),string:new At}}function ji(v){var R=qn(this,v).delete(v);return this.size-=R?1:0,R}function ui(v){return qn(this,v).get(v)}function ci(v){return qn(this,v).has(v)}function di(v,R){var k=qn(this,v),U=k.size;return k.set(v,R),this.size+=k.size==U?0:1,this}Vt.prototype.clear=Yr,Vt.prototype.delete=ji,Vt.prototype.get=ui,Vt.prototype.has=ci,Vt.prototype.set=di;function ae(v){var R=-1,k=v==null?0:v.length;for(this.__data__=new Vt;++R<k;)this.add(v[R])}function Ze(v){return this.__data__.set(v,r),this}function jt(v){return this.__data__.has(v)}ae.prototype.add=ae.prototype.push=Ze,ae.prototype.has=jt;function ot(v){var R=this.__data__=new Ht(v);this.size=R.size}function rn(){this.__data__=new Ht,this.size=0}function Mr(v){var R=this.__data__,k=R.delete(v);return this.size=R.size,k}function pr(v){return this.__data__.get(v)}function kr(v){return this.__data__.has(v)}function hi(v,R){var k=this.__data__;if(k instanceof Ht){var U=k.__data__;if(!qe||U.length<t-1)return U.push([v,R]),this.size=++k.size,this;k=this.__data__=new Vt(U)}return k.set(v,R),this.size=k.size,this}ot.prototype.clear=rn,ot.prototype.delete=Mr,ot.prototype.get=pr,ot.prototype.has=kr,ot.prototype.set=hi;function Lr(v,R){var k=Ee(v),U=!k&&le(v),Fe=!k&&!U&&ut(v),ye=!k&&!U&&!Fe&&_s(v),rt=k||U||Fe||ye,Qe=rt?tt(v.length,String):[],zt=Qe.length;for(var ct in v)pt.call(v,ct)&&!(rt&&(ct=="length"||Fe&&(ct=="offset"||ct=="parent")||ye&&(ct=="buffer"||ct=="byteLength"||ct=="byteOffset")||gi(ct,zt)))&&Qe.push(ct);return Qe}function wn(v,R){for(var k=v.length;k--;)if(re(v[k][0],R))return k;return-1}function Kn(v,R,k){var U=R(v);return Ee(v)?U:Me(U,k(v))}function An(v){return v==null?v===void 0?M:y:Nt&&Nt in Object(v)?gr(v):H(v)}function Gn(v){return Br(v)&&An(v)==s}function Qn(v,R,k,U,Fe){return v===R?!0:v==null||R==null||!Br(v)&&!Br(R)?v!==v&&R!==R:on(v,R,k,U,Qn,Fe)}function on(v,R,k,U,Fe,ye){var rt=Ee(v),Qe=Ee(R),zt=rt?l:Hn(v),ct=Qe?l:Hn(R);zt=zt==s?C:zt,ct=ct==s?C:ct;var gn=zt==C,On=ct==C,Kt=zt==ct;if(Kt&&ut(v)){if(!ut(R))return!1;rt=!0,gn=!1}if(Kt&&!gn)return ye||(ye=new ot),rt||_s(v)?pi(v,R,k,U,Fe,ye):co(v,R,zt,k,U,Fe,ye);if(!(k&i)){var mn=gn&&pt.call(v,"__wrapped__"),un=On&&pt.call(R,"__wrapped__");if(mn||un){var mi=mn?v.value():v,Kr=un?R.value():R;return ye||(ye=new ot),Fe(mi,Kr,k,U,ye)}}return Kt?(ye||(ye=new ot),ho(v,R,k,U,Fe,ye)):!1}function Zr(v){if(!Wt(v)||Q(v))return!1;var R=Jt(v)?st:ee;return R.test($(v))}function er(v){return Br(v)&&Jr(v.length)&&!!X[An(v)]}function fi(v){if(!j(v))return Ae(v);var R=[];for(var k in Object(v))pt.call(v,k)&&k!="constructor"&&R.push(k);return R}function pi(v,R,k,U,Fe,ye){var rt=k&i,Qe=v.length,zt=R.length;if(Qe!=zt&&!(rt&&zt>Qe))return!1;var ct=ye.get(v);if(ct&&ye.get(R))return ct==R;var gn=-1,On=!0,Kt=k&o?new ae:void 0;for(ye.set(v,R),ye.set(R,v);++gn<Qe;){var mn=v[gn],un=R[gn];if(U)var mi=rt?U(un,mn,gn,R,v,ye):U(mn,un,gn,v,R,ye);if(mi!==void 0){if(mi)continue;On=!1;break}if(Kt){if(!Re(R,function(Kr,Mi){if(!Ye(Kt,Mi)&&(mn===Kr||Fe(mn,Kr,k,U,ye)))return Kt.push(Mi)})){On=!1;break}}else if(!(mn===un||Fe(mn,un,k,U,ye))){On=!1;break}}return ye.delete(v),ye.delete(R),On}function co(v,R,k,U,Fe,ye,rt){switch(k){case S:if(v.byteLength!=R.byteLength||v.byteOffset!=R.byteOffset)return!1;v=v.buffer,R=R.buffer;case E:return!(v.byteLength!=R.byteLength||!ye(new Rn(v),new Rn(R)));case c:case h:case g:return re(+v,+R);case f:return v.name==R.name&&v.message==R.message;case N:case T:return v==R+"";case w:var Qe=wt;case O:var zt=U&i;if(Qe||(Qe=gt),v.size!=R.size&&!zt)return!1;var ct=rt.get(v);if(ct)return ct==R;U|=o,rt.set(v,R);var gn=pi(Qe(v),Qe(R),U,Fe,ye,rt);return rt.delete(v),gn;case D:if(En)return En.call(v)==En.call(R)}return!1}function ho(v,R,k,U,Fe,ye){var rt=k&i,Qe=Pr(v),zt=Qe.length,ct=Pr(R),gn=ct.length;if(zt!=gn&&!rt)return!1;for(var On=zt;On--;){var Kt=Qe[On];if(!(rt?Kt in R:pt.call(R,Kt)))return!1}var mn=ye.get(v);if(mn&&ye.get(R))return mn==R;var un=!0;ye.set(v,R),ye.set(R,v);for(var mi=rt;++On<zt;){Kt=Qe[On];var Kr=v[Kt],Mi=R[Kt];if(U)var Sg=rt?U(Mi,Kr,Kt,R,v,ye):U(Kr,Mi,Kt,v,R,ye);if(!(Sg===void 0?Kr===Mi||Fe(Kr,Mi,k,U,ye):Sg)){un=!1;break}mi||(mi=Kt=="constructor")}if(un&&!mi){var Ts=v.constructor,Is=R.constructor;Ts!=Is&&"constructor"in v&&"constructor"in R&&!(typeof Ts=="function"&&Ts instanceof Ts&&typeof Is=="function"&&Is instanceof Is)&&(un=!1)}return ye.delete(v),ye.delete(R),un}function Pr(v){return Kn(v,ma,ga)}function qn(v,R){var k=v.__data__;return Di(R)?k[typeof R=="string"?"string":"hash"]:k.map}function tr(v,R){var k=Ue(v,R);return Zr(k)?k:void 0}function gr(v){var R=pt.call(v,Nt),k=v[Nt];try{v[Nt]=void 0;var U=!0}catch{}var Fe=en.call(v);return U&&(R?v[Nt]=k:delete v[Nt]),Fe}var ga=Ce?function(v){return v==null?[]:(v=Object(v),se(Ce(v),function(R){return Lt.call(v,R)}))}:cu,Hn=An;(ze&&Hn(new ze(new ArrayBuffer(1)))!=S||qe&&Hn(new qe)!=w||te&&Hn(te.resolve())!=A||_e&&Hn(new _e)!=O||Xe&&Hn(new Xe)!=L)&&(Hn=function(v){var R=An(v),k=R==C?v.constructor:void 0,U=k?$(k):"";if(U)switch(U){case ft:return S;case $e:return w;case nn:return A;case Cn:return O;case cr:return L}return R});function gi(v,R){return R=R??a,!!R&&(typeof v=="number"||K.test(v))&&v>-1&&v%1==0&&v<R}function Di(v){var R=typeof v;return R=="string"||R=="number"||R=="symbol"||R=="boolean"?v!=="__proto__":v===null}function Q(v){return!!xt&&xt in v}function j(v){var R=v&&v.constructor,k=typeof R=="function"&&R.prototype||yt;return v===k}function H(v){return en.call(v)}function $(v){if(v!=null){try{return mt.call(v)}catch{}try{return v+""}catch{}}return""}function re(v,R){return v===R||v!==v&&R!==R}var le=Gn((function(){return arguments})())?Gn:function(v){return Br(v)&&pt.call(v,"callee")&&!Lt.call(v,"callee")},Ee=Array.isArray;function nt(v){return v!=null&&Jr(v.length)&&!Jt(v)}var ut=ce||du;function an(v,R){return Qn(v,R)}function Jt(v){if(!Wt(v))return!1;var R=An(v);return R==b||R==x||R==u||R==_}function Jr(v){return typeof v=="number"&&v>-1&&v%1==0&&v<=a}function Wt(v){var R=typeof v;return v!=null&&(R=="object"||R=="function")}function Br(v){return v!=null&&typeof v=="object"}var _s=ve?Ie(ve):er;function ma(v){return nt(v)?Lr(v):fi(v)}function cu(){return[]}function du(){return!1}n.exports=an})(za,za.exports)),za.exports}var Hs={},fy;function L4(){if(fy)return Hs;fy=1,Object.defineProperty(Hs,"__esModule",{value:!0});const n=dE(),e=hE();var t;return(function(r){function i(l={},u={},c=!1){typeof l!="object"&&(l={}),typeof u!="object"&&(u={});let h=n(u);c||(h=Object.keys(h).reduce((f,b)=>(h[b]!=null&&(f[b]=h[b]),f),{}));for(const f in l)l[f]!==void 0&&u[f]===void 0&&(h[f]=l[f]);return Object.keys(h).length>0?h:void 0}r.compose=i;function o(l={},u={}){typeof l!="object"&&(l={}),typeof u!="object"&&(u={});const c=Object.keys(l).concat(Object.keys(u)).reduce((h,f)=>(e(l[f],u[f])||(h[f]=u[f]===void 0?null:u[f]),h),{});return Object.keys(c).length>0?c:void 0}r.diff=o;function a(l={},u={}){l=l||{};const c=Object.keys(u).reduce((h,f)=>(u[f]!==l[f]&&l[f]!==void 0&&(h[f]=u[f]),h),{});return Object.keys(l).reduce((h,f)=>(l[f]!==u[f]&&u[f]===void 0&&(h[f]=null),h),c)}r.invert=a;function s(l,u,c=!1){if(typeof l!="object")return u;if(typeof u!="object")return;if(!c)return u;const h=Object.keys(u).reduce((f,b)=>(l[b]===void 0&&(f[b]=u[b]),f),{});return Object.keys(h).length>0?h:void 0}r.transform=s})(t||(t={})),Hs.default=t,Hs}var Vs={},py;function fE(){if(py)return Vs;py=1,Object.defineProperty(Vs,"__esModule",{value:!0});var n;return(function(e){function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t})(n||(n={})),Vs.default=n,Vs}var Ws={},gy;function P4(){if(gy)return Ws;gy=1,Object.defineProperty(Ws,"__esModule",{value:!0});const n=fE();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const i=this.ops[this.index];if(i){const o=this.offset,a=n.default.length(i);if(r>=a-o?(r=a-o,this.index+=1,this.offset=0):this.offset+=r,typeof i.delete=="number")return{delete:r};{const s={};return i.attributes&&(s.attributes=i.attributes),typeof i.retain=="number"?s.retain=r:typeof i.retain=="object"&&i.retain!==null?s.retain=i.retain:typeof i.insert=="string"?s.insert=i.insert.substr(o,r):s.insert=i.insert,s}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,i=this.index,o=this.next(),a=this.ops.slice(this.index);return this.offset=r,this.index=i,[o].concat(a)}}else return[]}}return Ws.default=e,Ws}var my;function B4(){return my||(my=1,(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=k4(),r=dE(),i=hE(),o=L4();e.AttributeMap=o.default;const a=fE();e.Op=a.default;const s=P4();e.OpIterator=s.default;const l="\0",u=(h,f)=>{if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const b=Object.keys(h)[0];if(!b||b!==Object.keys(f)[0])throw new Error(`embed types not matched: ${b} != ${Object.keys(f)[0]}`);return[b,h[b],f[b]]};class c{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,b){this.handlers[f]=b}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const b=this.handlers[f];if(!b)throw new Error(`no handlers for embed type "${f}"`);return b}insert(f,b){const x={};return typeof f=="string"&&f.length===0?this:(x.insert=f,b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(x.attributes=b),this.push(x))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,b){if(typeof f=="number"&&f<=0)return this;const x={retain:f};return b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(x.attributes=b),this.push(x)}push(f){let b=this.ops.length,x=this.ops[b-1];if(f=r(f),typeof x=="object"){if(typeof f.delete=="number"&&typeof x.delete=="number")return this.ops[b-1]={delete:x.delete+f.delete},this;if(typeof x.delete=="number"&&f.insert!=null&&(b-=1,x=this.ops[b-1],typeof x!="object"))return this.ops.unshift(f),this;if(i(f.attributes,x.attributes)){if(typeof f.insert=="string"&&typeof x.insert=="string")return this.ops[b-1]={insert:x.insert+f.insert},typeof f.attributes=="object"&&(this.ops[b-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof x.retain=="number")return this.ops[b-1]={retain:x.retain+f.retain},typeof f.attributes=="object"&&(this.ops[b-1].attributes=f.attributes),this}}return b===this.ops.length?this.ops.push(f):this.ops.splice(b,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const b=[],x=[];return this.forEach(w=>{(f(w)?b:x).push(w)}),[b,x]}reduce(f,b){return this.ops.reduce(f,b)}changeLength(){return this.reduce((f,b)=>b.insert?f+a.default.length(b):b.delete?f-b.delete:f,0)}length(){return this.reduce((f,b)=>f+a.default.length(b),0)}slice(f=0,b=1/0){const x=[],w=new s.default(this.ops);let g=0;for(;g<b&&w.hasNext();){let y;g<f?y=w.next(f-g):(y=w.next(b-g),x.push(y)),g+=a.default.length(y)}return new c(x)}compose(f){const b=new s.default(this.ops),x=new s.default(f.ops),w=[],g=x.peek();if(g!=null&&typeof g.retain=="number"&&g.attributes==null){let C=g.retain;for(;b.peekType()==="insert"&&b.peekLength()<=C;)C-=b.peekLength(),w.push(b.next());g.retain-C>0&&x.next(g.retain-C)}const y=new c(w);for(;b.hasNext()||x.hasNext();)if(x.peekType()==="insert")y.push(x.next());else if(b.peekType()==="delete")y.push(b.next());else{const C=Math.min(b.peekLength(),x.peekLength()),A=b.next(C),_=x.next(C);if(_.retain){const N={};if(typeof A.retain=="number")N.retain=typeof _.retain=="number"?C:_.retain;else if(typeof _.retain=="number")A.retain==null?N.insert=A.insert:N.retain=A.retain;else{const T=A.retain==null?"insert":"retain",[D,M,L]=u(A[T],_.retain),E=c.getHandler(D);N[T]={[D]:E.compose(M,L,T==="retain")}}const O=o.default.compose(A.attributes,_.attributes,typeof A.retain=="number");if(O&&(N.attributes=O),y.push(N),!x.hasNext()&&i(y.ops[y.ops.length-1],N)){const T=new c(b.rest());return y.concat(T).chop()}}else typeof _.delete=="number"&&(typeof A.retain=="number"||typeof A.retain=="object"&&A.retain!==null)&&y.push(_)}return y.chop()}concat(f){const b=new c(this.ops.slice());return f.ops.length>0&&(b.push(f.ops[0]),b.ops=b.ops.concat(f.ops.slice(1))),b}diff(f,b){if(this.ops===f.ops)return new c;const x=[this,f].map(A=>A.map(_=>{if(_.insert!=null)return typeof _.insert=="string"?_.insert:l;const N=A===f?"on":"with";throw new Error("diff() called "+N+" non-document")}).join("")),w=new c,g=t(x[0],x[1],b,!0),y=new s.default(this.ops),C=new s.default(f.ops);return g.forEach(A=>{let _=A[1].length;for(;_>0;){let N=0;switch(A[0]){case t.INSERT:N=Math.min(C.peekLength(),_),w.push(C.next(N));break;case t.DELETE:N=Math.min(_,y.peekLength()),y.next(N),w.delete(N);break;case t.EQUAL:N=Math.min(y.peekLength(),C.peekLength(),_);const O=y.next(N),T=C.next(N);i(O.insert,T.insert)?w.retain(N,o.default.diff(O.attributes,T.attributes)):w.push(T).delete(N);break}_-=N}}),w.chop()}eachLine(f,b=`
|
|
78
|
-
`){const x=new s.default(this.ops);let
|
|
79
|
-
`),o=i.shift();o.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),o):this.children.tail.insertAt(this.children.tail.length(),o),this.cache={});let a=this;i.reduce((s,l)=>(a=a.split(s,!0),a.insertAt(0,l),l.length),e+o.length)}insertBefore(e,t){const{head:r}=this.children;super.insertBefore(e,t),r instanceof
|
|
80
|
-
`),o=i.pop(),a=i.map(l=>{const u=this.scroll.create(pn.blotName);return u.insertAt(0,l),u}),s=this.split(e);a.forEach(l=>{this.parent.insertBefore(l,s)}),o&&this.parent.insertBefore(this.scroll.create("text",o),s)}}
|
|
81
|
-
`,rr(n))}function rr(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:rr(n.parent,e,t)}class Er extends Yn{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\uFEFF";static value(){}constructor(e,t,r){super(e,t),this.selection=r,this.textNode=document.createTextNode(Er.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let r=this,i=0;for(;r!=null&&r.statics.scope!==pe.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=Er.CONTENTS.length,r.optimize(),r.formatAt(i,Er.CONTENTS.length,e,t),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;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof Ir?this.prev:null,r=t?t.length():0,i=this.next instanceof Ir?this.next:null,o=i?i.text:"",{textNode:a}=this,s=a.data.split(Er.CONTENTS).join("");a.data=Er.CONTENTS;let l;if(t)l=t,(s||i)&&(t.insertAt(t.length(),s+o),i&&i.remove());else if(i)l=i,i.insertAt(0,s);else{const u=document.createTextNode(s);l=this.scroll.create(u),this.parent.insertBefore(l,this)}if(this.remove(),e){const u=(f,b)=>t&&f===t.domNode?b:f===a?r+b-1:i&&f===i.domNode?r+s.length+b:null,c=u(e.start.node,e.start.offset),h=u(e.end.node,e.end.offset);if(c!==null&&h!==null)return{startNode:l.domNode,startOffset:c,endNode:l.domNode,endOffset:h}}return null}update(e,t){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=Er.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var jh={exports:{}},vy;function G4(){return vy||(vy=1,(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function i(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function o(l,u,c,h,f){if(typeof c!="function")throw new TypeError("The listener must be a function");var b=new i(c,h||l,f),x=t?t+u:u;return l._events[x]?l._events[x].fn?l._events[x]=[l._events[x],b]:l._events[x].push(b):(l._events[x]=b,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],c,h;if(this._eventsCount===0)return u;for(h in c=this._events)e.call(c,h)&&u.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},s.prototype.listeners=function(u){var c=t?t+u:u,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var f=0,b=h.length,x=new Array(b);f<b;f++)x[f]=h[f].fn;return x},s.prototype.listenerCount=function(u){var c=t?t+u:u,h=this._events[c];return h?h.fn?1:h.length:0},s.prototype.emit=function(u,c,h,f,b,x){var w=t?t+u:u;if(!this._events[w])return!1;var g=this._events[w],y=arguments.length,C,A;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,c),!0;case 3:return g.fn.call(g.context,c,h),!0;case 4:return g.fn.call(g.context,c,h,f),!0;case 5:return g.fn.call(g.context,c,h,f,b),!0;case 6:return g.fn.call(g.context,c,h,f,b,x),!0}for(A=1,C=new Array(y-1);A<y;A++)C[A-1]=arguments[A];g.fn.apply(g.context,C)}else{var _=g.length,N;for(A=0;A<_;A++)switch(g[A].once&&this.removeListener(u,g[A].fn,void 0,!0),y){case 1:g[A].fn.call(g[A].context);break;case 2:g[A].fn.call(g[A].context,c);break;case 3:g[A].fn.call(g[A].context,c,h);break;case 4:g[A].fn.call(g[A].context,c,h,f);break;default:if(!C)for(N=1,C=new Array(y-1);N<y;N++)C[N-1]=arguments[N];g[A].fn.apply(g[A].context,C)}}return!0},s.prototype.on=function(u,c,h){return o(this,u,c,h,!1)},s.prototype.once=function(u,c,h){return o(this,u,c,h,!0)},s.prototype.removeListener=function(u,c,h,f){var b=t?t+u:u;if(!this._events[b])return this;if(!c)return a(this,b),this;var x=this._events[b];if(x.fn)x.fn===c&&(!f||x.once)&&(!h||x.context===h)&&a(this,b);else{for(var w=0,g=[],y=x.length;w<y;w++)(x[w].fn!==c||f&&!x[w].once||h&&x[w].context!==h)&&g.push(x[w]);g.length?this._events[b]=g.length===1?g[0]:g:a(this,b)}return this},s.prototype.removeAllListeners=function(u){var c;return u?(c=t?t+u:u,this._events[c]&&a(this,c)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=t,s.EventEmitter=s,n.exports=s})(jh)),jh.exports}var q4=G4();const H4=la(q4),Mf=new WeakMap,kf=["error","warn","log","info"];let Lf="warn";function gE(n){if(Lf&&kf.indexOf(n)<=kf.indexOf(Lf)){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];console[n](...t)}}function li(n){return kf.reduce((e,t)=>(e[t]=gE.bind(console,t,n),e),{})}li.level=n=>{Lf=n};gE.level=li.level;const Dh=li("quill:events"),V4=["selectionchange","mousedown","mouseup","click"];V4.forEach(n=>{document.addEventListener(n,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(i=>{const o=Mf.get(i);o&&o.emitter&&o.emitter.handleDOM(...t)})})});class ue extends H4{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",Dh.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Dh.log.call(Dh,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];(this.domListeners[e.type]||[]).forEach(o=>{let{node:a,handler:s}=o;(e.target===a||a.contains(e.target))&&s(e,...r)})}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}const Mh=li("quill:selection");class $i{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class W4{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 $i(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,ue.sources.USER),1)}),this.emitter.on(ue.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(ue.events.SCROLL_UPDATE,(i,o)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const a=o.some(s=>s.type==="characterData"||s.type==="childList"||s.type==="attributes"&&s.target===this.root);this.update(a?ue.sources.SILENT:i)}catch{}})}),this.emitter.on(ue.events.SCROLL_OPTIMIZE,(r,i)=>{if(i.range){const{startNode:o,startOffset:a,endNode:s,endOffset:l}=i.range;this.setNativeRange(o,a,s,l),this.update(ue.sources.SILENT)}}),this.update(ue.sources.SILENT)}handleComposition(){this.emitter.on(ue.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(ue.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const 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(ue.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,pe.BLOCK))){if(r.start.node!==this.cursor.textNode){const i=this.scroll.find(r.start.node,!1);if(i==null)return;if(i instanceof yn){const o=i.split(r.start.offset);i.parent.insertBefore(this.cursor,o)}else i.insertBefore(this.cursor,r.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;const r=this.scroll.length();e=Math.min(e,r-1),t=Math.min(e+t,r-1)-e;let i,[o,a]=this.scroll.leaf(e);if(o==null)return null;if(t>0&&a===o.length()){const[c]=this.scroll.leaf(e+1);if(c){const[h]=this.scroll.line(e),[f]=this.scroll.line(e+1);h===f&&(o=c,a=0)}}[i,a]=o.position(a,!0);const s=document.createRange();if(t>0)return s.setStart(i,a),[o,a]=this.scroll.leaf(e+t),o==null?null:([i,a]=o.position(a,!0),s.setEnd(i,a),s.getBoundingClientRect());let l="left",u;if(i instanceof Text){if(!i.data.length)return null;a<i.data.length?(s.setStart(i,a),s.setEnd(i,a+1)):(s.setStart(i,a-1),s.setEnd(i,a),l="right"),u=s.getBoundingClientRect()}else{if(!(o.domNode instanceof Element))return null;u=o.domNode.getBoundingClientRect(),a>0&&(l="right")}return{bottom:u.top+u.height,height:u.height,left:u[l],right:u[l],top:u.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const r=this.normalizeNative(t);return Mh.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&kh(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const r=t.map(a=>{const[s,l]=a,u=this.scroll.find(s,!0),c=u.offset(this.scroll);return l===0?c:u instanceof yn?c+u.index(s,l):c+u.length()}),i=Math.min(Math.max(...r),this.scroll.length()-1),o=Math.min(i,...r);return new $i(o,i-o)}normalizeNative(e){if(!kh(this.root,e.startContainer)||!e.collapsed&&!kh(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(r=>{let{node:i,offset:o}=r;for(;!(i instanceof Text)&&i.childNodes.length>0;)if(i.childNodes.length>o)i=i.childNodes[o],o=0;else if(i.childNodes.length===o)i=i.lastChild,i instanceof Text?o=i.data.length:i.childNodes.length>0?o=i.childNodes.length:o=i.childNodes.length+1;else break;r.node=i,r.offset=o}),t}rangeToNative(e){const t=this.scroll.length(),r=(i,o)=>{i=Math.min(t-1,i);const[a,s]=this.scroll.leaf(i);return a?a.position(s,o):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Mh.info("setNativeRange",e,t,r,i),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:s}=this.getNativeRange()||{};if(s==null||o||e!==s.startContainer||t!==s.startOffset||r!==s.endContainer||i!==s.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(i=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const l=document.createRange();l.setStart(e,t),l.setEnd(r,i),a.removeAllRanges(),a.addRange(l)}}else a.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ue.sources.API;if(typeof t=="string"&&(r=t,t=!1),Mh.info("setRange",e),e!=null){const i=this.rangeToNative(e);this.setNativeRange(...i,t)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ue.sources.USER;const t=this.lastRange,[r,i]=this.getRange();if(this.lastRange=r,this.lastNative=i,this.lastRange!=null&&(this.savedRange=this.lastRange),!Ei(t,this.lastRange)){if(!this.composing&&i!=null&&i.native.collapsed&&i.start.node!==this.cursor.textNode){const a=this.cursor.restore();a&&this.setNativeRange(a.startNode,a.startOffset,a.endNode,a.endOffset)}const o=[ue.events.SELECTION_CHANGE,Zo(this.lastRange),Zo(t),e];this.emitter.emit(ue.events.EDITOR_CHANGE,...o),e!==ue.sources.SILENT&&this.emitter.emit(...o)}}}function kh(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const z4=/^[ -~]*$/;class X4{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=yy(e),i=new fe;return $4(r.ops.slice()).reduce((a,s)=>{const l=sr.Op.length(s);let u=s.attributes||{},c=!1,h=!1;if(s.insert!=null){if(i.retain(l),typeof s.insert=="string"){const x=s.insert;h=!x.endsWith(`
|
|
82
|
-
`)&&(t<=a||!!this.scroll.descendant(
|
|
83
|
-
`&&(c=!0):g instanceof Yn&&g.statics.scope===
|
|
77
|
+
`),m.createElement("div",{style:c.white,className:"saturation-white"},m.createElement("div",{style:c.black,className:"saturation-black"}),m.createElement("div",{style:c.pointer},this.props.pointer?m.createElement(this.props.pointer,this.props):m.createElement("div",{style:c.circle}))))}}]),e})(m.PureComponent||m.Component);function ZC(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var W5=BC(Object.keys,Object),z5=Object.prototype,X5=z5.hasOwnProperty;function U5(n){if(!Hp(n))return W5(n);var e=[];for(var t in Object(n))X5.call(n,t)&&t!="constructor"&&e.push(t);return e}function Up(n){return pa(n)?XC(n):U5(n)}function $5(n,e){return n&&MC(n,e,Up)}function Y5(n,e){return function(t,r){if(t==null)return t;if(!pa(t))return n(t,r);for(var i=t.length,o=-1,a=Object(t);++o<i&&r(a[o],o,a)!==!1;);return t}}var JC=Y5($5);function Z5(n){return typeof n=="function"?n:Kl}function J5(n,e){var t=Bn(n)?ZC:JC;return t(n,Z5(e))}function El(n){"@babel/helpers - typeof";return El=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},El(n)}var K5=/^\s+/,Q5=/\s+$/;function me(n,e){if(n=n||"",e=e||{},n instanceof me)return n;if(!(this instanceof me))return new me(n,e);var t=ej(n);this._originalInput=n,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.format,this._gradientType=e.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=t.ok}me.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,r,i,o,a,s;return t=e.r/255,r=e.g/255,i=e.b/255,t<=.03928?o=t/12.92:o=Math.pow((t+.055)/1.055,2.4),r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),.2126*o+.7152*a+.0722*s},setAlpha:function(e){return this._a=KC(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=z0(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=z0(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+r+"%, "+i+"%)":"hsva("+t+", "+r+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=W0(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=W0(this._r,this._g,this._b),t=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+r+"%, "+i+"%)":"hsla("+t+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return X0(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return ij(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(Rt(this._r,255)*100)+"%",g:Math.round(Rt(this._g,255)*100)+"%",b:Math.round(Rt(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Rt(this._r,255)*100)+"%, "+Math.round(Rt(this._g,255)*100)+"%, "+Math.round(Rt(this._b,255)*100)+"%)":"rgba("+Math.round(Rt(this._r,255)*100)+"%, "+Math.round(Rt(this._g,255)*100)+"%, "+Math.round(Rt(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:mj[X0(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t="#"+U0(this._r,this._g,this._b,this._a),r=t,i=this._gradientType?"GradientType = 1, ":"";if(e){var o=me(e);r="#"+U0(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,i=this._a<1&&this._a>=0,o=!t&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return me(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(lj,arguments)},brighten:function(){return this._applyModification(uj,arguments)},darken:function(){return this._applyModification(cj,arguments)},desaturate:function(){return this._applyModification(oj,arguments)},saturate:function(){return this._applyModification(aj,arguments)},greyscale:function(){return this._applyModification(sj,arguments)},spin:function(){return this._applyModification(dj,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(pj,arguments)},complement:function(){return this._applyCombination(hj,arguments)},monochromatic:function(){return this._applyCombination(gj,arguments)},splitcomplement:function(){return this._applyCombination(fj,arguments)},triad:function(){return this._applyCombination($0,[3])},tetrad:function(){return this._applyCombination($0,[4])}};me.fromRatio=function(n,e){if(El(n)=="object"){var t={};for(var r in n)n.hasOwnProperty(r)&&(r==="a"?t[r]=n[r]:t[r]=Ha(n[r]));n=t}return me(n,e)};function ej(n){var e={r:0,g:0,b:0},t=1,r=null,i=null,o=null,a=!1,s=!1;return typeof n=="string"&&(n=xj(n)),El(n)=="object"&&(ei(n.r)&&ei(n.g)&&ei(n.b)?(e=tj(n.r,n.g,n.b),a=!0,s=String(n.r).substr(-1)==="%"?"prgb":"rgb"):ei(n.h)&&ei(n.s)&&ei(n.v)?(r=Ha(n.s),i=Ha(n.v),e=rj(n.h,r,i),a=!0,s="hsv"):ei(n.h)&&ei(n.s)&&ei(n.l)&&(r=Ha(n.s),o=Ha(n.l),e=nj(n.h,r,o),a=!0,s="hsl"),n.hasOwnProperty("a")&&(t=n.a)),t=KC(t),{ok:a,format:n.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}function tj(n,e,t){return{r:Rt(n,255)*255,g:Rt(e,255)*255,b:Rt(t,255)*255}}function W0(n,e,t){n=Rt(n,255),e=Rt(e,255),t=Rt(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),o,a,s=(r+i)/2;if(r==i)o=a=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case n:o=(e-t)/l+(e<t?6:0);break;case e:o=(t-n)/l+2;break;case t:o=(n-e)/l+4;break}o/=6}return{h:o,s:a,l:s}}function nj(n,e,t){var r,i,o;n=Rt(n,360),e=Rt(e,100),t=Rt(t,100);function a(u,c,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?u+(c-u)*6*h:h<1/2?c:h<2/3?u+(c-u)*(2/3-h)*6:u}if(e===0)r=i=o=t;else{var s=t<.5?t*(1+e):t+e-t*e,l=2*t-s;r=a(l,s,n+1/3),i=a(l,s,n),o=a(l,s,n-1/3)}return{r:r*255,g:i*255,b:o*255}}function z0(n,e,t){n=Rt(n,255),e=Rt(e,255),t=Rt(t,255);var r=Math.max(n,e,t),i=Math.min(n,e,t),o,a,s=r,l=r-i;if(a=r===0?0:l/r,r==i)o=0;else{switch(r){case n:o=(e-t)/l+(e<t?6:0);break;case e:o=(t-n)/l+2;break;case t:o=(n-e)/l+4;break}o/=6}return{h:o,s:a,v:s}}function rj(n,e,t){n=Rt(n,360)*6,e=Rt(e,100),t=Rt(t,100);var r=Math.floor(n),i=n-r,o=t*(1-e),a=t*(1-i*e),s=t*(1-(1-i)*e),l=r%6,u=[t,a,o,o,s,t][l],c=[s,t,t,a,o,o][l],h=[o,o,s,t,t,a][l];return{r:u*255,g:c*255,b:h*255}}function X0(n,e,t,r){var i=[Ar(Math.round(n).toString(16)),Ar(Math.round(e).toString(16)),Ar(Math.round(t).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 ij(n,e,t,r,i){var o=[Ar(Math.round(n).toString(16)),Ar(Math.round(e).toString(16)),Ar(Math.round(t).toString(16)),Ar(QC(r))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function U0(n,e,t,r){var i=[Ar(QC(r)),Ar(Math.round(n).toString(16)),Ar(Math.round(e).toString(16)),Ar(Math.round(t).toString(16))];return i.join("")}me.equals=function(n,e){return!n||!e?!1:me(n).toRgbString()==me(e).toRgbString()};me.random=function(){return me.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function oj(n,e){e=e===0?0:e||10;var t=me(n).toHsl();return t.s-=e/100,t.s=tu(t.s),me(t)}function aj(n,e){e=e===0?0:e||10;var t=me(n).toHsl();return t.s+=e/100,t.s=tu(t.s),me(t)}function sj(n){return me(n).desaturate(100)}function lj(n,e){e=e===0?0:e||10;var t=me(n).toHsl();return t.l+=e/100,t.l=tu(t.l),me(t)}function uj(n,e){e=e===0?0:e||10;var t=me(n).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),me(t)}function cj(n,e){e=e===0?0:e||10;var t=me(n).toHsl();return t.l-=e/100,t.l=tu(t.l),me(t)}function dj(n,e){var t=me(n).toHsl(),r=(t.h+e)%360;return t.h=r<0?360+r:r,me(t)}function hj(n){var e=me(n).toHsl();return e.h=(e.h+180)%360,me(e)}function $0(n,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=me(n).toHsl(),r=[me(n)],i=360/e,o=1;o<e;o++)r.push(me({h:(t.h+o*i)%360,s:t.s,l:t.l}));return r}function fj(n){var e=me(n).toHsl(),t=e.h;return[me(n),me({h:(t+72)%360,s:e.s,l:e.l}),me({h:(t+216)%360,s:e.s,l:e.l})]}function pj(n,e,t){e=e||6,t=t||30;var r=me(n).toHsl(),i=360/t,o=[me(n)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(me(r));return o}function gj(n,e){e=e||6;for(var t=me(n).toHsv(),r=t.h,i=t.s,o=t.v,a=[],s=1/e;e--;)a.push(me({h:r,s:i,v:o})),o=(o+s)%1;return a}me.mix=function(n,e,t){t=t===0?0:t||50;var r=me(n).toRgb(),i=me(e).toRgb(),o=t/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return me(a)};me.readability=function(n,e){var t=me(n),r=me(e);return(Math.max(t.getLuminance(),r.getLuminance())+.05)/(Math.min(t.getLuminance(),r.getLuminance())+.05)};me.isReadable=function(n,e,t){var r=me.readability(n,e),i,o;switch(o=!1,i=Cj(t),i.level+i.size){case"AAsmall":case"AAAlarge":o=r>=4.5;break;case"AAlarge":o=r>=3;break;case"AAAsmall":o=r>=7;break}return o};me.mostReadable=function(n,e,t){var r=null,i=0,o,a,s,l;t=t||{},a=t.includeFallbackColors,s=t.level,l=t.size;for(var u=0;u<e.length;u++)o=me.readability(n,e[u]),o>i&&(i=o,r=me(e[u]));return me.isReadable(n,r,{level:s,size:l})||!a?r:(t.includeFallbackColors=!1,me.mostReadable(n,["#fff","#000"],t))};var If=me.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"},mj=me.hexNames=bj(If);function bj(n){var e={};for(var t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function KC(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function Rt(n,e){vj(n)&&(n="100%");var t=yj(n);return n=Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(n*e,10)/100),Math.abs(n-e)<1e-6?1:n%e/parseFloat(e)}function tu(n){return Math.min(1,Math.max(0,n))}function zn(n){return parseInt(n,16)}function vj(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function yj(n){return typeof n=="string"&&n.indexOf("%")!=-1}function Ar(n){return n.length==1?"0"+n:""+n}function Ha(n){return n<=1&&(n=n*100+"%"),n}function QC(n){return Math.round(parseFloat(n)*255).toString(16)}function Y0(n){return zn(n)/255}var xr=(function(){var n="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+n+")",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),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 ei(n){return!!xr.CSS_UNIT.exec(n)}function xj(n){n=n.replace(K5,"").replace(Q5,"").toLowerCase();var e=!1;if(If[n])n=If[n],e=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=xr.rgb.exec(n))?{r:t[1],g:t[2],b:t[3]}:(t=xr.rgba.exec(n))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=xr.hsl.exec(n))?{h:t[1],s:t[2],l:t[3]}:(t=xr.hsla.exec(n))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=xr.hsv.exec(n))?{h:t[1],s:t[2],v:t[3]}:(t=xr.hsva.exec(n))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=xr.hex8.exec(n))?{r:zn(t[1]),g:zn(t[2]),b:zn(t[3]),a:Y0(t[4]),format:e?"name":"hex8"}:(t=xr.hex6.exec(n))?{r:zn(t[1]),g:zn(t[2]),b:zn(t[3]),format:e?"name":"hex"}:(t=xr.hex4.exec(n))?{r:zn(t[1]+""+t[1]),g:zn(t[2]+""+t[2]),b:zn(t[3]+""+t[3]),a:Y0(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=xr.hex3.exec(n))?{r:zn(t[1]+""+t[1]),g:zn(t[2]+""+t[2]),b:zn(t[3]+""+t[3]),format:e?"name":"hex"}:!1}function Cj(n){var e,t;return n=n||{level:"AA",size:"small"},e=(n.level||"AA").toUpperCase(),t=(n.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}var Z0=function(e){var t=["r","g","b","a","h","s","l","v"],r=0,i=0;return J5(t,function(o){if(e[o]&&(r+=1,isNaN(e[o])||(i+=1),o==="s"||o==="l")){var a=/^\d+%$/;a.test(e[o])&&(i+=1)}}),r===i?e:!1},Va=function(e,t){var r=e.hex?me(e.hex):me(e),i=r.toHsl(),o=r.toHsv(),a=r.toRgb(),s=r.toHex();i.s===0&&(i.h=t||0,o.h=t||0);var l=s==="000000"&&a.a===0;return{hsl:i,hex:l?"transparent":"#"+s,rgb:a,hsv:o,oldHue:e.h||t||i.h,source:e.source}},Oi=function(e){if(e==="transparent")return!0;var t=String(e).charAt(0)==="#"?1:0;return e.length!==4+t&&e.length<7+t&&me(e).isValid()},$p=function(e){if(!e)return"#fff";var t=Va(e);if(t.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(t.rgb.r*299+t.rgb.g*587+t.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},Dh=function(e,t){var r=e.replace("°","");return me(t+" ("+r+")")._ok},Ta=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ej=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function wj(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function _j(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function Aj(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var Fn=function(e){var t=(function(r){Aj(i,r);function i(o){wj(this,i);var a=_j(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));return a.handleChange=function(s,l){var u=Z0(s);if(u){var c=Va(s,s.h||a.state.oldHue);a.setState(c),a.props.onChangeComplete&&a.debounce(a.props.onChangeComplete,c,l),a.props.onChange&&a.props.onChange(c,l)}},a.handleSwatchHover=function(s,l){var u=Z0(s);if(u){var c=Va(s,s.h||a.state.oldHue);a.props.onSwatchHover&&a.props.onSwatchHover(c,l)}},a.state=Ta({},Va(o.color,0)),a.debounce=YC(function(s,l,u){s(l,u)},100),a}return Ej(i,[{key:"render",value:function(){var a={};return this.props.onSwatchHover&&(a.onSwatchHover=this.handleSwatchHover),m.createElement(e,Ta({},this.props,this.state,{onChange:this.handleChange},a))}}],[{key:"getDerivedStateFromProps",value:function(a,s){return Ta({},Va(a.color,s.oldHue))}}]),i})(m.PureComponent||m.Component);return t.propTypes=Ta({},e.propTypes),t.defaultProps=Ta({},e.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),t},Tj=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ij=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function Sj(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function J0(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function Rj(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var Oj=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(r){Rj(i,r);function i(){var o,a,s,l;Sj(this,i);for(var u=arguments.length,c=Array(u),h=0;h<u;h++)c[h]=arguments[h];return l=(a=(s=J0(this,(o=i.__proto__||Object.getPrototypeOf(i)).call.apply(o,[this].concat(c))),s),s.state={focus:!1},s.handleFocus=function(){return s.setState({focus:!0})},s.handleBlur=function(){return s.setState({focus:!1})},a),J0(s,l)}return Ij(i,[{key:"render",value:function(){return m.createElement(t,{onFocus:this.handleFocus,onBlur:this.handleBlur},m.createElement(e,Tj({},this.props,this.state)))}}]),i})(m.Component)},K0=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},jj=13,Nj=function(e){var t=e.color,r=e.style,i=e.onClick,o=i===void 0?function(){}:i,a=e.onHover,s=e.title,l=s===void 0?t:s,u=e.children,c=e.focus,h=e.focusStyle,p=h===void 0?{}:h,b=t==="transparent",x=ke({default:{swatch:K0({background:t,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},r,c?p:{})}}),E=function(_){return o(t,_)},g=function(_){return _.keyCode===jj&&o(t,_)},v=function(_){return a(t,_)},C={};return a&&(C.onMouseOver=v),m.createElement("div",K0({style:x.swatch,onClick:E,title:l,tabIndex:0,onKeyDown:g},C),u,b&&m.createElement(ha,{borderRadius:x.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))};const so=Oj(Nj);var Dj=function(e){var t=e.direction,r=ke({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 m.createElement("div",{style:r.picker})},Mj=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},eE=function(e){var t=e.rgb,r=e.hsl,i=e.width,o=e.height,a=e.onChange,s=e.direction,l=e.style,u=e.renderers,c=e.pointer,h=e.className,p=h===void 0?"":h,b=ke({default:{picker:{position:"relative",width:i,height:o},alpha:{radius:"2px",style:l}}});return m.createElement("div",{style:b.picker,className:"alpha-picker "+p},m.createElement(Bp,Mj({},b.alpha,{rgb:t,hsl:r,pointer:c,renderers:u,onChange:a,direction:s})))};eE.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:Dj};Fn(eE);function tE(n,e){for(var t=-1,r=n==null?0:n.length,i=Array(r);++t<r;)i[t]=e(n[t],t,n);return i}var kj="__lodash_hash_undefined__";function Pj(n){return this.__data__.set(n,kj),this}function Lj(n){return this.__data__.has(n)}function wl(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new li;++e<t;)this.add(n[e])}wl.prototype.add=wl.prototype.push=Pj;wl.prototype.has=Lj;function Bj(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function Fj(n,e){return n.has(e)}var Gj=1,qj=2;function nE(n,e,t,r,i,o){var a=t&Gj,s=n.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(n),c=o.get(e);if(u&&c)return u==e&&c==n;var h=-1,p=!0,b=t&qj?new wl:void 0;for(o.set(n,e),o.set(e,n);++h<s;){var x=n[h],E=e[h];if(r)var g=a?r(E,x,h,e,n,o):r(x,E,h,n,e,o);if(g!==void 0){if(g)continue;p=!1;break}if(b){if(!Bj(e,function(v,C){if(!Fj(b,C)&&(x===v||i(x,v,t,r,o)))return b.push(C)})){p=!1;break}}else if(!(x===E||i(x,E,t,r,o))){p=!1;break}}return o.delete(n),o.delete(e),p}function Hj(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function Vj(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var Wj=1,zj=2,Xj="[object Boolean]",Uj="[object Date]",$j="[object Error]",Yj="[object Map]",Zj="[object Number]",Jj="[object RegExp]",Kj="[object Set]",Qj="[object String]",eN="[object Symbol]",tN="[object ArrayBuffer]",nN="[object DataView]",Q0=Hr?Hr.prototype:void 0,Mh=Q0?Q0.valueOf:void 0;function rN(n,e,t,r,i,o,a){switch(t){case nN:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case tN:return!(n.byteLength!=e.byteLength||!o(new xl(n),new xl(e)));case Xj:case Uj:case Zj:return ys(+n,+e);case $j:return n.name==e.name&&n.message==e.message;case Jj:case Qj:return n==e+"";case Yj:var s=Hj;case Kj:var l=r&Wj;if(s||(s=Vj),n.size!=e.size&&!l)return!1;var u=a.get(n);if(u)return u==e;r|=zj,a.set(n,e);var c=nE(s(n),s(e),r,i,o,a);return a.delete(n),c;case eN:if(Mh)return Mh.call(n)==Mh.call(e)}return!1}function iN(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}function oN(n,e,t){var r=e(n);return Bn(n)?r:iN(r,t(n))}function aN(n,e){for(var t=-1,r=n==null?0:n.length,i=0,o=[];++t<r;){var a=n[t];e(a,t,n)&&(o[i++]=a)}return o}function sN(){return[]}var lN=Object.prototype,uN=lN.propertyIsEnumerable,ey=Object.getOwnPropertySymbols,cN=ey?function(n){return n==null?[]:(n=Object(n),aN(ey(n),function(e){return uN.call(n,e)}))}:sN;function Sf(n){return oN(n,Up,cN)}var dN=1,hN=Object.prototype,fN=hN.hasOwnProperty;function pN(n,e,t,r,i,o){var a=t&dN,s=Sf(n),l=s.length,u=Sf(e),c=u.length;if(l!=c&&!a)return!1;for(var h=l;h--;){var p=s[h];if(!(a?p in e:fN.call(e,p)))return!1}var b=o.get(n),x=o.get(e);if(b&&x)return b==e&&x==n;var E=!0;o.set(n,e),o.set(e,n);for(var g=a;++h<l;){p=s[h];var v=n[p],C=e[p];if(r)var A=a?r(C,v,p,e,n,o):r(v,C,p,n,e,o);if(!(A===void 0?v===C||i(v,C,t,r,o):A)){E=!1;break}g||(g=p=="constructor")}if(E&&!g){var _=n.constructor,O=e.constructor;_!=O&&"constructor"in n&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof O=="function"&&O instanceof O)&&(E=!1)}return o.delete(n),o.delete(e),E}var Rf=ao(Rr,"DataView"),Of=ao(Rr,"Promise"),jf=ao(Rr,"Set"),Nf=ao(Rr,"WeakMap"),ty="[object Map]",gN="[object Object]",ny="[object Promise]",ry="[object Set]",iy="[object WeakMap]",oy="[object DataView]",mN=oo(Rf),bN=oo(os),vN=oo(Of),yN=oo(jf),xN=oo(Nf),Er=io;(Rf&&Er(new Rf(new ArrayBuffer(1)))!=oy||os&&Er(new os)!=ty||Of&&Er(Of.resolve())!=ny||jf&&Er(new jf)!=ry||Nf&&Er(new Nf)!=iy)&&(Er=function(n){var e=io(n),t=e==gN?n.constructor:void 0,r=t?oo(t):"";if(r)switch(r){case mN:return oy;case bN:return ty;case vN:return ny;case yN:return ry;case xN:return iy}return e});var CN=1,ay="[object Arguments]",sy="[object Array]",Gs="[object Object]",EN=Object.prototype,ly=EN.hasOwnProperty;function wN(n,e,t,r,i,o){var a=Bn(n),s=Bn(e),l=a?sy:Er(n),u=s?sy:Er(e);l=l==ay?Gs:l,u=u==ay?Gs:u;var c=l==Gs,h=u==Gs,p=l==u;if(p&&ss(n)){if(!ss(e))return!1;a=!0,c=!1}if(p&&!c)return o||(o=new Tr),a||zp(n)?nE(n,e,t,r,i,o):rN(n,e,l,t,r,i,o);if(!(t&CN)){var b=c&&ly.call(n,"__wrapped__"),x=h&&ly.call(e,"__wrapped__");if(b||x){var E=b?n.value():n,g=x?e.value():e;return o||(o=new Tr),i(E,g,t,r,o)}}return p?(o||(o=new Tr),pN(n,e,t,r,i,o)):!1}function nu(n,e,t,r,i){return n===e?!0:n==null||e==null||!Vr(n)&&!Vr(e)?n!==n&&e!==e:wN(n,e,t,r,nu,i)}var _N=1,AN=2;function TN(n,e,t,r){var i=t.length,o=i;if(n==null)return!o;for(n=Object(n);i--;){var a=t[i];if(a[2]?a[1]!==n[a[0]]:!(a[0]in n))return!1}for(;++i<o;){a=t[i];var s=a[0],l=n[s],u=a[1];if(a[2]){if(l===void 0&&!(s in n))return!1}else{var c=new Tr,h;if(!(h===void 0?nu(u,l,_N|AN,r,c):h))return!1}}return!0}function rE(n){return n===n&&!$n(n)}function IN(n){for(var e=Up(n),t=e.length;t--;){var r=e[t],i=n[r];e[t]=[r,i,rE(i)]}return e}function iE(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function SN(n){var e=IN(n);return e.length==1&&e[0][2]?iE(e[0][0],e[0][1]):function(t){return t===n||TN(t,n,e)}}var RN=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ON=/^\w*$/;function Yp(n,e){if(Bn(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||Ql(n)?!0:ON.test(n)||!RN.test(n)||e!=null&&n in Object(e)}var jN="Expected a function";function Zp(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(jN);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=t.cache;if(o.has(i))return o.get(i);var a=n.apply(this,r);return t.cache=o.set(i,a)||o,a};return t.cache=new(Zp.Cache||li),t}Zp.Cache=li;var NN=500;function DN(n){var e=Zp(n,function(r){return t.size===NN&&t.clear(),r}),t=e.cache;return e}var MN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kN=/\\(\\)?/g,PN=DN(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(MN,function(t,r,i,o){e.push(i?o.replace(kN,"$1"):r||t)}),e}),uy=Hr?Hr.prototype:void 0,cy=uy?uy.toString:void 0;function oE(n){if(typeof n=="string")return n;if(Bn(n))return tE(n,oE)+"";if(Ql(n))return cy?cy.call(n):"";var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function LN(n){return n==null?"":oE(n)}function aE(n,e){return Bn(n)?n:Yp(n,e)?[n]:PN(LN(n))}function ru(n){if(typeof n=="string"||Ql(n))return n;var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function sE(n,e){e=aE(e,n);for(var t=0,r=e.length;n!=null&&t<r;)n=n[ru(e[t++])];return t&&t==r?n:void 0}function BN(n,e,t){var r=n==null?void 0:sE(n,e);return r===void 0?t:r}function FN(n,e){return n!=null&&e in Object(n)}function GN(n,e,t){e=aE(e,n);for(var r=-1,i=e.length,o=!1;++r<i;){var a=ru(e[r]);if(!(o=n!=null&&t(n,a)))break;n=n[a]}return o||++r!=i?o:(i=n==null?0:n.length,!!i&&Vp(i)&&Xp(a,i)&&(Bn(n)||Cl(n)))}function qN(n,e){return n!=null&&GN(n,e,FN)}var HN=1,VN=2;function WN(n,e){return Yp(n)&&rE(e)?iE(ru(n),e):function(t){var r=BN(t,n);return r===void 0&&r===e?qN(t,n):nu(e,r,HN|VN)}}function zN(n){return function(e){return e?.[n]}}function XN(n){return function(e){return sE(e,n)}}function UN(n){return Yp(n)?zN(ru(n)):XN(n)}function $N(n){return typeof n=="function"?n:n==null?Kl:typeof n=="object"?Bn(n)?WN(n[0],n[1]):SN(n):UN(n)}function YN(n,e){var t=-1,r=pa(n)?Array(n.length):[];return JC(n,function(i,o,a){r[++t]=e(i,o,a)}),r}function lo(n,e){var t=Bn(n)?tE:YN;return t(n,$N(e))}var ZN=function(e){var t=e.colors,r=e.onClick,i=e.onSwatchHover,o=ke({default:{swatches:{marginRight:"-10px"},swatch:{width:"22px",height:"22px",float:"left",marginRight:"10px",marginBottom:"10px",borderRadius:"4px"},clear:{clear:"both"}}});return m.createElement("div",{style:o.swatches},lo(t,function(a){return m.createElement(so,{key:a,color:a,style:o.swatch,onClick:r,onHover:i,focusStyle:{boxShadow:"0 0 4px "+a}})}),m.createElement("div",{style:o.clear}))},Jp=function(e){var t=e.onChange,r=e.onSwatchHover,i=e.hex,o=e.colors,a=e.width,s=e.triangle,l=e.styles,u=l===void 0?{}:l,c=e.className,h=c===void 0?"":c,p=i==="transparent",b=function(g,v){Oi(g)&&t({hex:g,source:"hex"},v)},x=ke(qt({default:{card:{width:a,background:"#fff",boxShadow:"0 1px rgba(0,0,0,.1)",borderRadius:"6px",position:"relative"},head:{height:"110px",background:i,borderRadius:"6px 6px 0 0",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},body:{padding:"10px"},label:{fontSize:"18px",color:$p(i),position:"relative"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 10px 10px 10px",borderColor:"transparent transparent "+i+" 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"}}},u),{"hide-triangle":s==="hide"});return m.createElement("div",{style:x.card,className:"block-picker "+h},m.createElement("div",{style:x.triangle}),m.createElement("div",{style:x.head},p&&m.createElement(ha,{borderRadius:"6px 6px 0 0"}),m.createElement("div",{style:x.label},i)),m.createElement("div",{style:x.body},m.createElement(ZN,{colors:o,onClick:b,onSwatchHover:r}),m.createElement(Je,{style:{input:x.input},value:i,onChange:b})))};Jp.propTypes={width:d.oneOfType([d.string,d.number]),colors:d.arrayOf(d.string),triangle:d.oneOf(["top","hide"]),styles:d.object};Jp.defaultProps={width:170,colors:["#D9E3F0","#F47373","#697689","#37D67A","#2CCCE4","#555555","#dce775","#ff8a65","#ba68c8"],triangle:"top",styles:{}};Fn(Jp);var So={100:"#ffcdd2",300:"#e57373",500:"#f44336",700:"#d32f2f",900:"#b71c1c"},Ro={100:"#f8bbd0",300:"#f06292",500:"#e91e63",700:"#c2185b",900:"#880e4f"},Oo={100:"#e1bee7",300:"#ba68c8",500:"#9c27b0",700:"#7b1fa2",900:"#4a148c"},jo={100:"#d1c4e9",300:"#9575cd",500:"#673ab7",700:"#512da8",900:"#311b92"},No={100:"#c5cae9",300:"#7986cb",500:"#3f51b5",700:"#303f9f",900:"#1a237e"},Do={100:"#bbdefb",300:"#64b5f6",500:"#2196f3",700:"#1976d2",900:"#0d47a1"},Mo={100:"#b3e5fc",300:"#4fc3f7",500:"#03a9f4",700:"#0288d1",900:"#01579b"},ko={100:"#b2ebf2",300:"#4dd0e1",500:"#00bcd4",700:"#0097a7",900:"#006064"},Po={100:"#b2dfdb",300:"#4db6ac",500:"#009688",700:"#00796b",900:"#004d40"},Wa={100:"#c8e6c9",300:"#81c784",500:"#4caf50",700:"#388e3c"},Lo={100:"#dcedc8",300:"#aed581",500:"#8bc34a",700:"#689f38",900:"#33691e"},Bo={100:"#f0f4c3",300:"#dce775",500:"#cddc39",700:"#afb42b",900:"#827717"},Fo={100:"#fff9c4",300:"#fff176",500:"#ffeb3b",700:"#fbc02d",900:"#f57f17"},Go={100:"#ffecb3",300:"#ffd54f",500:"#ffc107",700:"#ffa000",900:"#ff6f00"},qo={100:"#ffe0b2",300:"#ffb74d",500:"#ff9800",700:"#f57c00",900:"#e65100"},Ho={100:"#ffccbc",300:"#ff8a65",500:"#ff5722",700:"#e64a19",900:"#bf360c"},Vo={100:"#d7ccc8",300:"#a1887f",500:"#795548",700:"#5d4037",900:"#3e2723"},Wo={100:"#cfd8dc",300:"#90a4ae",500:"#607d8b",700:"#455a64",900:"#263238"},lE=function(e){var t=e.color,r=e.onClick,i=e.onSwatchHover,o=e.hover,a=e.active,s=e.circleSize,l=e.circleSpacing,u=ke({default:{swatch:{width:s,height:s,marginRight:l,marginBottom:l,transform:"scale(1)",transition:"100ms transform ease"},Swatch:{borderRadius:"50%",background:"transparent",boxShadow:"inset 0 0 0 "+(s/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:o,active:a});return m.createElement("div",{style:u.swatch},m.createElement(so,{style:u.Swatch,color:t,onClick:r,onHover:i,focusStyle:{boxShadow:u.Swatch.boxShadow+", 0 0 5px "+t}}))};lE.defaultProps={circleSize:28,circleSpacing:14};const JN=Lp.handleHover(lE);var Kp=function(e){var t=e.width,r=e.onChange,i=e.onSwatchHover,o=e.colors,a=e.hex,s=e.circleSize,l=e.styles,u=l===void 0?{}:l,c=e.circleSpacing,h=e.className,p=h===void 0?"":h,b=ke(qt({default:{card:{width:t,display:"flex",flexWrap:"wrap",marginRight:-c,marginBottom:-c}}},u)),x=function(g,v){return r({hex:g,source:"hex"},v)};return m.createElement("div",{style:b.card,className:"circle-picker "+p},lo(o,function(E){return m.createElement(JN,{key:E,color:E,onClick:x,onSwatchHover:i,active:a===E.toLowerCase(),circleSize:s,circleSpacing:c})}))};Kp.propTypes={width:d.oneOfType([d.string,d.number]),circleSize:d.number,circleSpacing:d.number,styles:d.object};Kp.defaultProps={width:252,circleSize:28,circleSpacing:14,colors:[So[500],Ro[500],Oo[500],jo[500],No[500],Do[500],Mo[500],ko[500],Po[500],Wa[500],Lo[500],Bo[500],Fo[500],Go[500],qo[500],Ho[500],Vo[500],Wo[500]],styles:{}};Fn(Kp);function dy(n){return n===void 0}var qs={},hy;function KN(){if(hy)return qs;hy=1,Object.defineProperty(qs,"__esModule",{value:!0});var n=Object.assign||function(a){for(var s=1;s<arguments.length;s++){var l=arguments[s];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},e=m,t=r(e);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s){var l={};for(var u in a)s.indexOf(u)>=0||Object.prototype.hasOwnProperty.call(a,u)&&(l[u]=a[u]);return l}var o=24;return qs.default=function(a){var s=a.fill,l=s===void 0?"currentColor":s,u=a.width,c=u===void 0?o:u,h=a.height,p=h===void 0?o:h,b=a.style,x=b===void 0?{}:b,E=i(a,["fill","width","height","style"]);return t.default.createElement("svg",n({viewBox:"0 0 "+o+" "+o,style:n({fill:l,width:c,height:p},x)},E),t.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"}))},qs}var QN=KN();const eD=eo(QN);var tD=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function nD(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function rD(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function iD(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var uE=(function(n){iD(e,n);function e(t){nD(this,e);var r=rD(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.toggleViews=function(){r.state.view==="hex"?r.setState({view:"rgb"}):r.state.view==="rgb"?r.setState({view:"hsl"}):r.state.view==="hsl"&&(r.props.hsl.a===1?r.setState({view:"hex"}):r.setState({view:"rgb"}))},r.handleChange=function(i,o){i.hex?Oi(i.hex)&&r.props.onChange({hex:i.hex,source:"hex"},o):i.r||i.g||i.b?r.props.onChange({r:i.r||r.props.rgb.r,g:i.g||r.props.rgb.g,b:i.b||r.props.rgb.b,source:"rgb"},o):i.a?(i.a<0?i.a=0:i.a>1&&(i.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(i.a*100)/100,source:"rgb"},o)):(i.h||i.s||i.l)&&(typeof i.s=="string"&&i.s.includes("%")&&(i.s=i.s.replace("%","")),typeof i.l=="string"&&i.l.includes("%")&&(i.l=i.l.replace("%","")),i.s==1?i.s=.01:i.l==1&&(i.l=.01),r.props.onChange({h:i.h||r.props.hsl.h,s:Number(dy(i.s)?r.props.hsl.s:i.s),l:Number(dy(i.l)?r.props.hsl.l:i.l),source:"hsl"},o))},r.showHighlight=function(i){i.currentTarget.style.background="#eee"},r.hideHighlight=function(i){i.currentTarget.style.background="transparent"},t.hsl.a!==1&&t.view==="hex"?r.state={view:"rgb"}:r.state={view:t.view},r}return tD(e,[{key:"render",value:function(){var r=this,i=ke({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),o=void 0;return this.state.view==="hex"?o=m.createElement("div",{style:i.fields,className:"flexbox-fix"},m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?o=m.createElement("div",{style:i.fields,className:"flexbox-fix"},m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),m.createElement("div",{style:i.alpha},m.createElement(Je,{style:{input:i.input,label:i.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(o=m.createElement("div",{style:i.fields,className:"flexbox-fix"},m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),m.createElement("div",{style:i.field},m.createElement(Je,{style:{input:i.input,label:i.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),m.createElement("div",{style:i.alpha},m.createElement(Je,{style:{input:i.input,label:i.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),m.createElement("div",{style:i.wrap,className:"flexbox-fix"},o,m.createElement("div",{style:i.toggle},m.createElement("div",{style:i.icon,onClick:this.toggleViews,ref:function(s){return r.icon=s}},m.createElement(eD,{style:i.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.hsl.a!==1&&i.view==="hex"?{view:"rgb"}:null}}]),e})(m.Component);uE.defaultProps={view:"hex"};var fy=function(){var e=ke({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 m.createElement("div",{style:e.picker})},oD=function(){var e=ke({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return m.createElement("div",{style:e.picker})},Qp=function(e){var t=e.width,r=e.onChange,i=e.disableAlpha,o=e.rgb,a=e.hsl,s=e.hsv,l=e.hex,u=e.renderers,c=e.styles,h=c===void 0?{}:c,p=e.className,b=p===void 0?"":p,x=e.defaultView,E=ke(qt({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("+o.r+", "+o.g+", "+o.b+", "+o.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"}}},h),{disableAlpha:i});return m.createElement("div",{style:E.picker,className:"chrome-picker "+b},m.createElement("div",{style:E.saturation},m.createElement(eu,{style:E.Saturation,hsl:a,hsv:s,pointer:oD,onChange:r})),m.createElement("div",{style:E.body},m.createElement("div",{style:E.controls,className:"flexbox-fix"},m.createElement("div",{style:E.color},m.createElement("div",{style:E.swatch},m.createElement("div",{style:E.active}),m.createElement(ha,{renderers:u}))),m.createElement("div",{style:E.toggles},m.createElement("div",{style:E.hue},m.createElement(fa,{style:E.Hue,hsl:a,pointer:fy,onChange:r})),m.createElement("div",{style:E.alpha},m.createElement(Bp,{style:E.Alpha,rgb:o,hsl:a,pointer:fy,renderers:u,onChange:r})))),m.createElement(uE,{rgb:o,hsl:a,hex:l,view:x,onChange:r,disableAlpha:i})))};Qp.propTypes={width:d.oneOfType([d.string,d.number]),disableAlpha:d.bool,styles:d.object,defaultView:d.oneOf(["hex","rgb","hsl"])};Qp.defaultProps={width:225,disableAlpha:!1,styles:{}};Fn(Qp);var aD=function(e){var t=e.color,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,a=e.active,s=ke({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:$p(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 m.createElement(so,{style:s.color,color:t,onClick:i,onHover:o,focusStyle:{boxShadow:"0 0 4px "+t}},m.createElement("div",{style:s.dot}))},sD=function(e){var t=e.hex,r=e.rgb,i=e.onChange,o=ke({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(l,u){l.r||l.g||l.b?i({r:l.r||r.r,g:l.g||r.g,b:l.b||r.b,source:"rgb"},u):i({hex:l.hex,source:"hex"},u)};return m.createElement("div",{style:o.fields,className:"flexbox-fix"},m.createElement("div",{style:o.active}),m.createElement(Je,{style:{wrap:o.HEXwrap,input:o.HEXinput,label:o.HEXlabel},label:"hex",value:t,onChange:a}),m.createElement(Je,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"r",value:r.r,onChange:a}),m.createElement(Je,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"g",value:r.g,onChange:a}),m.createElement(Je,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"b",value:r.b,onChange:a}))},eg=function(e){var t=e.onChange,r=e.onSwatchHover,i=e.colors,o=e.hex,a=e.rgb,s=e.styles,l=s===void 0?{}:s,u=e.className,c=u===void 0?"":u,h=ke(qt({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},l)),p=function(x,E){x.hex?Oi(x.hex)&&t({hex:x.hex,source:"hex"},E):t(x,E)};return m.createElement(xs,{style:h.Compact,styles:l},m.createElement("div",{style:h.compact,className:"compact-picker "+c},m.createElement("div",null,lo(i,function(b){return m.createElement(aD,{key:b,color:b,active:b.toLowerCase()===o,onClick:p,onSwatchHover:r})}),m.createElement("div",{style:h.clear})),m.createElement(sD,{hex:o,rgb:a,onChange:p})))};eg.propTypes={colors:d.arrayOf(d.string),styles:d.object};eg.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"],styles:{}};Fn(eg);var lD=function(e){var t=e.hover,r=e.color,i=e.onClick,o=e.onSwatchHover,a={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},s=ke({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:a}},{hover:t});return m.createElement("div",{style:s.swatch},m.createElement(so,{color:r,onClick:i,onHover:o,focusStyle:a}))};const uD=Lp.handleHover(lD);var tg=function(e){var t=e.width,r=e.colors,i=e.onChange,o=e.onSwatchHover,a=e.triangle,s=e.styles,l=s===void 0?{}:s,u=e.className,c=u===void 0?"":u,h=ke(qt({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)"}}},l),{"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"}),p=function(x,E){return i({hex:x,source:"hex"},E)};return m.createElement("div",{style:h.card,className:"github-picker "+c},m.createElement("div",{style:h.triangleShadow}),m.createElement("div",{style:h.triangle}),lo(r,function(b){return m.createElement(uD,{color:b,key:b,onClick:p,onSwatchHover:o})}))};tg.propTypes={width:d.oneOfType([d.string,d.number]),colors:d.arrayOf(d.string),triangle:d.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:d.object};tg.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};Fn(tg);var cD=function(e){var t=e.direction,r=ke({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 m.createElement("div",{style:r.picker})},dD=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ng=function(e){var t=e.width,r=e.height,i=e.onChange,o=e.hsl,a=e.direction,s=e.pointer,l=e.styles,u=l===void 0?{}:l,c=e.className,h=c===void 0?"":c,p=ke(qt({default:{picker:{position:"relative",width:t,height:r},hue:{radius:"2px"}}},u)),b=function(E){return i({a:1,h:E.h,l:.5,s:1})};return m.createElement("div",{style:p.picker,className:"hue-picker "+h},m.createElement(fa,dD({},p.hue,{hsl:o,pointer:s,onChange:b,direction:a})))};ng.propTypes={styles:d.object};ng.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:cD,styles:{}};Fn(ng);var hD=function(e){var t=e.onChange,r=e.hex,i=e.rgb,o=e.styles,a=o===void 0?{}:o,s=e.className,l=s===void 0?"":s,u=ke(qt({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 "+r,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)),c=function(p,b){p.hex?Oi(p.hex)&&t({hex:p.hex,source:"hex"},b):(p.r||p.g||p.b)&&t({r:p.r||i.r,g:p.g||i.g,b:p.b||i.b,source:"rgb"},b)};return m.createElement(xs,{styles:a},m.createElement("div",{style:u.material,className:"material-picker "+l},m.createElement(Je,{style:{wrap:u.HEXwrap,input:u.HEXinput,label:u.HEXlabel},label:"hex",value:r,onChange:c}),m.createElement("div",{style:u.split,className:"flexbox-fix"},m.createElement("div",{style:u.third},m.createElement(Je,{style:{wrap:u.RGBwrap,input:u.RGBinput,label:u.RGBlabel},label:"r",value:i.r,onChange:c})),m.createElement("div",{style:u.third},m.createElement(Je,{style:{wrap:u.RGBwrap,input:u.RGBinput,label:u.RGBlabel},label:"g",value:i.g,onChange:c})),m.createElement("div",{style:u.third},m.createElement(Je,{style:{wrap:u.RGBwrap,input:u.RGBinput,label:u.RGBlabel},label:"b",value:i.b,onChange:c})))))};Fn(hD);var fD=function(e){var t=e.onChange,r=e.rgb,i=e.hsv,o=e.hex,a=ke({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"}}}),s=function(u,c){u["#"]?Oi(u["#"])&&t({hex:u["#"],source:"hex"},c):u.r||u.g||u.b?t({r:u.r||r.r,g:u.g||r.g,b:u.b||r.b,source:"rgb"},c):(u.h||u.s||u.v)&&t({h:u.h||i.h,s:u.s||i.s,v:u.v||i.v,source:"hsv"},c)};return m.createElement("div",{style:a.fields},m.createElement(Je,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"h",value:Math.round(i.h),onChange:s}),m.createElement(Je,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"s",value:Math.round(i.s*100),onChange:s}),m.createElement(Je,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"v",value:Math.round(i.v*100),onChange:s}),m.createElement("div",{style:a.divider}),m.createElement(Je,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"r",value:r.r,onChange:s}),m.createElement(Je,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"g",value:r.g,onChange:s}),m.createElement(Je,{style:{wrap:a.RGBwrap,input:a.RGBinput,label:a.RGBlabel},label:"b",value:r.b,onChange:s}),m.createElement("div",{style:a.divider}),m.createElement(Je,{style:{wrap:a.HEXwrap,input:a.HEXinput,label:a.HEXlabel},label:"#",value:o.replace("#",""),onChange:s}),m.createElement("div",{style:a.fieldSymbols},m.createElement("div",{style:a.symbol},"°"),m.createElement("div",{style:a.symbol},"%"),m.createElement("div",{style:a.symbol},"%")))},pD=function(e){var t=e.hsl,r=ke({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 m.createElement("div",{style:r.picker})},gD=function(){var e=ke({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 m.createElement("div",{style:e.pointer},m.createElement("div",{style:e.left},m.createElement("div",{style:e.leftInside})),m.createElement("div",{style:e.right},m.createElement("div",{style:e.rightInside})))},py=function(e){var t=e.onClick,r=e.label,i=e.children,o=e.active,a=ke({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:o});return m.createElement("div",{style:a.button,onClick:t},r||i)},mD=function(e){var t=e.rgb,r=e.currentColor,i=ke({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:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return m.createElement("div",null,m.createElement("div",{style:i.label},"new"),m.createElement("div",{style:i.swatches},m.createElement("div",{style:i.new}),m.createElement("div",{style:i.current})),m.createElement("div",{style:i.label},"current"))},bD=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})();function vD(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function yD(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n}function xD(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)}var rg=(function(n){xD(e,n);function e(t){vD(this,e);var r=yD(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.state={currentColor:t.hex},r}return bD(e,[{key:"render",value:function(){var r=this.props,i=r.styles,o=i===void 0?{}:i,a=r.className,s=a===void 0?"":a,l=ke(qt({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"}}},o));return m.createElement("div",{style:l.picker,className:"photoshop-picker "+s},m.createElement("div",{style:l.head},this.props.header),m.createElement("div",{style:l.body,className:"flexbox-fix"},m.createElement("div",{style:l.saturation},m.createElement(eu,{hsl:this.props.hsl,hsv:this.props.hsv,pointer:pD,onChange:this.props.onChange})),m.createElement("div",{style:l.hue},m.createElement(fa,{direction:"vertical",hsl:this.props.hsl,pointer:gD,onChange:this.props.onChange})),m.createElement("div",{style:l.controls},m.createElement("div",{style:l.top,className:"flexbox-fix"},m.createElement("div",{style:l.previews},m.createElement(mD,{rgb:this.props.rgb,currentColor:this.state.currentColor})),m.createElement("div",{style:l.actions},m.createElement(py,{label:"OK",onClick:this.props.onAccept,active:!0}),m.createElement(py,{label:"Cancel",onClick:this.props.onCancel}),m.createElement(fD,{onChange:this.props.onChange,rgb:this.props.rgb,hsv:this.props.hsv,hex:this.props.hex}))))))}}]),e})(m.Component);rg.propTypes={header:d.string,styles:d.object};rg.defaultProps={header:"Color Picker",styles:{}};Fn(rg);var CD=function(e){var t=e.onChange,r=e.rgb,i=e.hsl,o=e.hex,a=e.disableAlpha,s=ke({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}),l=function(c,h){c.hex?Oi(c.hex)&&t({hex:c.hex,source:"hex"},h):c.r||c.g||c.b?t({r:c.r||r.r,g:c.g||r.g,b:c.b||r.b,a:r.a,source:"rgb"},h):c.a&&(c.a<0?c.a=0:c.a>100&&(c.a=100),c.a/=100,t({h:i.h,s:i.s,l:i.l,a:c.a,source:"rgb"},h))};return m.createElement("div",{style:s.fields,className:"flexbox-fix"},m.createElement("div",{style:s.double},m.createElement(Je,{style:{input:s.input,label:s.label},label:"hex",value:o.replace("#",""),onChange:l})),m.createElement("div",{style:s.single},m.createElement(Je,{style:{input:s.input,label:s.label},label:"r",value:r.r,onChange:l,dragLabel:"true",dragMax:"255"})),m.createElement("div",{style:s.single},m.createElement(Je,{style:{input:s.input,label:s.label},label:"g",value:r.g,onChange:l,dragLabel:"true",dragMax:"255"})),m.createElement("div",{style:s.single},m.createElement(Je,{style:{input:s.input,label:s.label},label:"b",value:r.b,onChange:l,dragLabel:"true",dragMax:"255"})),m.createElement("div",{style:s.alpha},m.createElement(Je,{style:{input:s.input,label:s.label},label:"a",value:Math.round(r.a*100),onChange:l,dragLabel:"true",dragMax:"100"})))},ED=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},cE=function(e){var t=e.colors,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,a=ke({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}),s=function(u,c){i({hex:u,source:"hex"},c)};return m.createElement("div",{style:a.colors,className:"flexbox-fix"},t.map(function(l){var u=typeof l=="string"?{color:l}:l,c=""+u.color+(u.title||"");return m.createElement("div",{key:c,style:a.swatchWrap},m.createElement(so,ED({},u,{style:a.swatch,onClick:s,onHover:o,focusStyle:{boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px "+u.color}})))}))};cE.propTypes={colors:d.arrayOf(d.oneOfType([d.string,d.shape({color:d.string,title:d.string})])).isRequired};var wD=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ig=function(e){var t=e.width,r=e.rgb,i=e.hex,o=e.hsv,a=e.hsl,s=e.onChange,l=e.onSwatchHover,u=e.disableAlpha,c=e.presetColors,h=e.renderers,p=e.styles,b=p===void 0?{}:p,x=e.className,E=x===void 0?"":x,g=ke(qt({default:wD({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("+r.r+","+r.g+","+r.b+","+r.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)"}},b),disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},b),{disableAlpha:u});return m.createElement("div",{style:g.picker,className:"sketch-picker "+E},m.createElement("div",{style:g.saturation},m.createElement(eu,{style:g.Saturation,hsl:a,hsv:o,onChange:s})),m.createElement("div",{style:g.controls,className:"flexbox-fix"},m.createElement("div",{style:g.sliders},m.createElement("div",{style:g.hue},m.createElement(fa,{style:g.Hue,hsl:a,onChange:s})),m.createElement("div",{style:g.alpha},m.createElement(Bp,{style:g.Alpha,rgb:r,hsl:a,renderers:h,onChange:s}))),m.createElement("div",{style:g.color},m.createElement(ha,null),m.createElement("div",{style:g.activeColor}))),m.createElement(CD,{rgb:r,hsl:a,hex:i,onChange:s,disableAlpha:u}),m.createElement(cE,{colors:c,onClick:s,onSwatchHover:l}))};ig.propTypes={disableAlpha:d.bool,width:d.oneOfType([d.string,d.number]),styles:d.object};ig.defaultProps={disableAlpha:!1,width:200,styles:{},presetColors:["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]};const _D=Fn(ig);var Ia=function(e){var t=e.hsl,r=e.offset,i=e.onClick,o=i===void 0?function(){}:i,a=e.active,s=e.first,l=e.last,u=ke({default:{swatch:{height:"12px",background:"hsl("+t.h+", 50%, "+r*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:s,last:l}),c=function(p){return o({h:t.h,s:.5,l:r,source:"hsl"},p)};return m.createElement("div",{style:u.swatch,onClick:c})},AD=function(e){var t=e.onClick,r=e.hsl,i=ke({default:{swatches:{marginTop:"20px"},swatch:{boxSizing:"border-box",width:"20%",paddingRight:"1px",float:"left"},clear:{clear:"both"}}}),o=.1;return m.createElement("div",{style:i.swatches},m.createElement("div",{style:i.swatch},m.createElement(Ia,{hsl:r,offset:".80",active:Math.abs(r.l-.8)<o&&Math.abs(r.s-.5)<o,onClick:t,first:!0})),m.createElement("div",{style:i.swatch},m.createElement(Ia,{hsl:r,offset:".65",active:Math.abs(r.l-.65)<o&&Math.abs(r.s-.5)<o,onClick:t})),m.createElement("div",{style:i.swatch},m.createElement(Ia,{hsl:r,offset:".50",active:Math.abs(r.l-.5)<o&&Math.abs(r.s-.5)<o,onClick:t})),m.createElement("div",{style:i.swatch},m.createElement(Ia,{hsl:r,offset:".35",active:Math.abs(r.l-.35)<o&&Math.abs(r.s-.5)<o,onClick:t})),m.createElement("div",{style:i.swatch},m.createElement(Ia,{hsl:r,offset:".20",active:Math.abs(r.l-.2)<o&&Math.abs(r.s-.5)<o,onClick:t,last:!0})),m.createElement("div",{style:i.clear}))},TD=function(){var e=ke({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 m.createElement("div",{style:e.picker})},og=function(e){var t=e.hsl,r=e.onChange,i=e.pointer,o=e.styles,a=o===void 0?{}:o,s=e.className,l=s===void 0?"":s,u=ke(qt({default:{hue:{height:"12px",position:"relative"},Hue:{radius:"2px"}}},a));return m.createElement("div",{style:u.wrap||{},className:"slider-picker "+l},m.createElement("div",{style:u.hue},m.createElement(fa,{style:u.Hue,hsl:t,pointer:i,onChange:r})),m.createElement("div",{style:u.swatches},m.createElement(AD,{hsl:t,onClick:r})))};og.propTypes={styles:d.object};og.defaultProps={pointer:TD,styles:{}};Fn(og);var Hs={},gy;function ID(){if(gy)return Hs;gy=1,Object.defineProperty(Hs,"__esModule",{value:!0});var n=Object.assign||function(a){for(var s=1;s<arguments.length;s++){var l=arguments[s];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},e=m,t=r(e);function r(a){return a&&a.__esModule?a:{default:a}}function i(a,s){var l={};for(var u in a)s.indexOf(u)>=0||Object.prototype.hasOwnProperty.call(a,u)&&(l[u]=a[u]);return l}var o=24;return Hs.default=function(a){var s=a.fill,l=s===void 0?"currentColor":s,u=a.width,c=u===void 0?o:u,h=a.height,p=h===void 0?o:h,b=a.style,x=b===void 0?{}:b,E=i(a,["fill","width","height","style"]);return t.default.createElement("svg",n({viewBox:"0 0 "+o+" "+o,style:n({fill:l,width:c,height:p},x)},E),t.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},Hs}var SD=ID();const RD=eo(SD);var OD=function(e){var t=e.color,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,a=e.first,s=e.last,l=e.active,u=ke({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:t,marginBottom:"1px"},check:{color:$p(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:s,active:l,"color-#FFFFFF":t==="#FFFFFF",transparent:t==="transparent"});return m.createElement(so,{color:t,style:u.color,onClick:i,onHover:o,focusStyle:{boxShadow:"0 0 4px "+t}},m.createElement("div",{style:u.check},m.createElement(RD,null)))},jD=function(e){var t=e.onClick,r=e.onSwatchHover,i=e.group,o=e.active,a=ke({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return m.createElement("div",{style:a.group},lo(i,function(s,l){return m.createElement(OD,{key:s,color:s,active:s.toLowerCase()===o,first:l===0,last:l===i.length-1,onClick:t,onSwatchHover:r})}))},ag=function(e){var t=e.width,r=e.height,i=e.onChange,o=e.onSwatchHover,a=e.colors,s=e.hex,l=e.styles,u=l===void 0?{}:l,c=e.className,h=c===void 0?"":c,p=ke(qt({default:{picker:{width:t,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},u)),b=function(E,g){return i({hex:E,source:"hex"},g)};return m.createElement("div",{style:p.picker,className:"swatches-picker "+h},m.createElement(xs,null,m.createElement("div",{style:p.overflow},m.createElement("div",{style:p.body},lo(a,function(x){return m.createElement(jD,{key:x.toString(),group:x,active:s,onClick:b,onSwatchHover:o})}),m.createElement("div",{style:p.clear})))))};ag.propTypes={width:d.oneOfType([d.string,d.number]),height:d.oneOfType([d.string,d.number]),colors:d.arrayOf(d.arrayOf(d.string)),styles:d.object};ag.defaultProps={width:320,height:240,colors:[[So[900],So[700],So[500],So[300],So[100]],[Ro[900],Ro[700],Ro[500],Ro[300],Ro[100]],[Oo[900],Oo[700],Oo[500],Oo[300],Oo[100]],[jo[900],jo[700],jo[500],jo[300],jo[100]],[No[900],No[700],No[500],No[300],No[100]],[Do[900],Do[700],Do[500],Do[300],Do[100]],[Mo[900],Mo[700],Mo[500],Mo[300],Mo[100]],[ko[900],ko[700],ko[500],ko[300],ko[100]],[Po[900],Po[700],Po[500],Po[300],Po[100]],["#194D33",Wa[700],Wa[500],Wa[300],Wa[100]],[Lo[900],Lo[700],Lo[500],Lo[300],Lo[100]],[Bo[900],Bo[700],Bo[500],Bo[300],Bo[100]],[Fo[900],Fo[700],Fo[500],Fo[300],Fo[100]],[Go[900],Go[700],Go[500],Go[300],Go[100]],[qo[900],qo[700],qo[500],qo[300],qo[100]],[Ho[900],Ho[700],Ho[500],Ho[300],Ho[100]],[Vo[900],Vo[700],Vo[500],Vo[300],Vo[100]],[Wo[900],Wo[700],Wo[500],Wo[300],Wo[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};Fn(ag);var sg=function(e){var t=e.onChange,r=e.onSwatchHover,i=e.hex,o=e.colors,a=e.width,s=e.triangle,l=e.styles,u=l===void 0?{}:l,c=e.className,h=c===void 0?"":c,p=ke(qt({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"}}},u),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right"}),b=function(E,g){Oi(E)&&t({hex:E,source:"hex"},g)};return m.createElement("div",{style:p.card,className:"twitter-picker "+h},m.createElement("div",{style:p.triangleShadow}),m.createElement("div",{style:p.triangle}),m.createElement("div",{style:p.body},lo(o,function(x,E){return m.createElement(so,{key:E,color:x,hex:x,style:p.swatch,onClick:b,onHover:r,focusStyle:{boxShadow:"0 0 4px "+x}})}),m.createElement("div",{style:p.hash},"#"),m.createElement(Je,{label:null,style:{input:p.input},value:i.replace("#",""),onChange:b}),m.createElement("div",{style:p.clear})))};sg.propTypes={width:d.oneOfType([d.string,d.number]),triangle:d.oneOf(["hide","top-left","top-right"]),colors:d.arrayOf(d.string),styles:d.object};sg.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};Fn(sg);var lg=function(e){var t=ke({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 m.createElement("div",{style:t.picker})};lg.propTypes={hsl:d.shape({h:d.number,s:d.number,l:d.number,a:d.number})};lg.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var ug=function(e){var t=ke({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 m.createElement("div",{style:t.picker})};ug.propTypes={hsl:d.shape({h:d.number,s:d.number,l:d.number,a:d.number})};ug.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var ND=function(e){var t=e.onChange,r=e.rgb,i=e.hsl,o=e.hex,a=e.hsv,s=function(b,x){if(b.hex)Oi(b.hex)&&t({hex:b.hex,source:"hex"},x);else if(b.rgb){var E=b.rgb.split(",");Dh(b.rgb,"rgb")&&t({r:E[0],g:E[1],b:E[2],a:1,source:"rgb"},x)}else if(b.hsv){var g=b.hsv.split(",");Dh(b.hsv,"hsv")&&(g[2]=g[2].replace("%",""),g[1]=g[1].replace("%",""),g[0]=g[0].replace("°",""),g[1]==1?g[1]=.01:g[2]==1&&(g[2]=.01),t({h:Number(g[0]),s:Number(g[1]),v:Number(g[2]),source:"hsv"},x))}else if(b.hsl){var v=b.hsl.split(",");Dh(b.hsl,"hsl")&&(v[2]=v[2].replace("%",""),v[1]=v[1].replace("%",""),v[0]=v[0].replace("°",""),h[1]==1?h[1]=.01:h[2]==1&&(h[2]=.01),t({h:Number(v[0]),s:Number(v[1]),v:Number(v[2]),source:"hsl"},x))}},l=ke({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"}}}),u=r.r+", "+r.g+", "+r.b,c=Math.round(i.h)+"°, "+Math.round(i.s*100)+"%, "+Math.round(i.l*100)+"%",h=Math.round(a.h)+"°, "+Math.round(a.s*100)+"%, "+Math.round(a.v*100)+"%";return m.createElement("div",{style:l.wrap,className:"flexbox-fix"},m.createElement("div",{style:l.fields},m.createElement("div",{style:l.double},m.createElement(Je,{style:{input:l.input,label:l.label},label:"hex",value:o,onChange:s})),m.createElement("div",{style:l.column},m.createElement("div",{style:l.single},m.createElement(Je,{style:{input:l.input2,label:l.label2},label:"rgb",value:u,onChange:s})),m.createElement("div",{style:l.single},m.createElement(Je,{style:{input:l.input2,label:l.label2},label:"hsv",value:h,onChange:s})),m.createElement("div",{style:l.single},m.createElement(Je,{style:{input:l.input2,label:l.label2},label:"hsl",value:c,onChange:s})))))},cg=function(e){var t=e.width,r=e.onChange,i=e.rgb,o=e.hsl,a=e.hsv,s=e.hex,l=e.header,u=e.styles,c=u===void 0?{}:u,h=e.className,p=h===void 0?"":h,b=ke(qt({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("+i.r+", "+i.g+", "+i.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"}}},c));return m.createElement("div",{style:b.picker,className:"google-picker "+p},m.createElement("div",{style:b.head},l),m.createElement("div",{style:b.swatch}),m.createElement("div",{style:b.saturation},m.createElement(eu,{hsl:o,hsv:a,pointer:lg,onChange:r})),m.createElement("div",{style:b.body},m.createElement("div",{style:b.controls,className:"flexbox-fix"},m.createElement("div",{style:b.hue},m.createElement(fa,{style:b.Hue,hsl:o,radius:"4px",pointer:ug,onChange:r}))),m.createElement(ND,{rgb:i,hsl:o,hex:s,hsv:a,onChange:r})))};cg.propTypes={width:d.oneOfType([d.string,d.number]),styles:d.object,header:d.string};cg.defaultProps={width:652,styles:{},header:"Color picker"};Fn(cg);function Df({closeChooseColor:n,currentColor:e,handleCloseLineWeight:t,handleLineWeightSelect:r,openChooseColor:i,openChooseLineWeight:o,toolOptions:a,toolState:s,updateColor:l}){const{t:u}=Rn.useTranslation();return f.jsxs(G.Grid,{container:!0,spacing:1,children:[f.jsx(G.Grid,{size:{xs:12},children:f.jsx(je,{variant:"overline",children:u("style")})}),f.jsx(G.Grid,{size:{xs:12},children:f.jsxs(Ll,{"aria-label":u("style_selection"),size:"small",children:[s.activeTool!==yt.TEXT&&[f.jsxs(Gt,{value:"strokeColor","aria-label":u("border_color"),onClick:i,children:[f.jsx(G.Tooltip,{title:u("border_color"),children:f.jsx("span",{children:f.jsx(NS,{style:{fill:s.strokeColor}})})}),f.jsx(pd,{})]},"strokeColor"),f.jsxs(Gt,{value:"lineWeight","aria-label":u("line_weight"),onClick:o,children:[f.jsx(G.Tooltip,{title:u("line_weight"),children:f.jsx("span",{children:f.jsx(DS,{})})}),f.jsx(pd,{})]},"lineWeight")],f.jsxs(Gt,{value:"fillColor","aria-label":u("fill_color"),onClick:i,children:[f.jsx(G.Tooltip,{title:u("fill_color"),children:f.jsx("span",{children:f.jsx(MS,{})})}),f.jsx(pd,{})]})]})}),f.jsx(G.Popover,{open:a.lineWeightPopoverOpen,anchorEl:a.popoverLineWeightAnchorEl,children:f.jsx("div",{children:f.jsx(G.ClickAwayListener,{onClickAway:t,children:f.jsx(G.MenuList,{autoFocus:!0,role:"listbox",children:J_.map(c=>f.jsx(G.MenuItem,{onClick:r,value:c,selected:c===s.strokeWidth,role:"option","aria-selected":c===s.strokeWidth,children:c},c))})})})}),f.jsx(G.Popover,{open:a.colorPopoverOpen,anchorEl:a.popoverAnchorEl,onClose:n,children:f.jsx(_D,{disableAlpha:!1,color:e,onChange:l})})]})}Df.propTypes={closeChooseColor:vi.func.isRequired,currentColor:vi.string.isRequired,handleCloseLineWeight:vi.func.isRequired,handleLineWeightSelect:vi.func.isRequired,openChooseColor:vi.func.isRequired,openChooseLineWeight:vi.func.isRequired,toolOptions:vi.shape({colorPopoverOpen:d.bool,currentColorType:d.any,lineWeightPopoverOpen:d.bool,popoverAnchorEl:d.any,popoverLineWeightAnchorEl:d.any}).isRequired,toolState:d.shape({activeTool:d.string.isRequired,closedMode:d.string.isRequired,fillColor:d.string,image:d.shape({id:d.string}),strokeColor:d.string.isRequired,strokeWidth:d.number.isRequired,text:d.string,textBody:d.string,updateColor:d.func}).isRequired,updateColor:vi.func.isRequired};function Mf({currentShape:n,displayMode:e,setToolState:t,t:r,toolState:i}){const[o,a]=m.useState({colorPopoverOpen:!1,currentColorType:null,lineWeightPopoverOpen:!1,popoverAnchorEl:null,popoverLineWeightAnchorEl:null}),s=o.currentColorType?Z1(i[o.currentColorType]):"rgba(255, 0, 0, 0.5)",l=_=>{a({...o,lineWeightPopoverOpen:!0,popoverLineWeightAnchorEl:_.currentTarget})},u=_=>{a({...o,lineWeightPopoverOpen:!1,popoverLineWeightAnchorEl:null}),t({...i,strokeWidth:_.currentTarget.value})},c=_=>{a({...o,colorPopoverOpen:!1,currentColorType:null,popoverAnchorEl:null})},h=_=>{a({...o,colorPopoverOpen:!0,currentColorType:_.currentTarget.value,popoverAnchorEl:_.currentTarget})},p=_=>{a({...o,lineWeightPopoverOpen:!1,popoverLineWeightAnchorEl:null})},b=_=>{t({...i,closedMode:_.currentTarget.value})},x=_=>{t({...i,[o.currentColorType]:K_(_.rgb)})},E=(_,O)=>{t({...i,image:{...i.image,id:_}})},g=()=>{const _={id:i?.image?.id,uuid:ln()};t({...i,image:{id:null},imageEvent:_})},v=_=>{const O=_.target.value;t({...i,text:O})},A=xn.useSelector(_=>pe.getConfig(_)).annotation?.allowTargetShapesStyling===!0;return f.jsxs("div",{children:[(e===Qt.DRAW||A&&e===Qt.TARGET)&&ip(i.activeTool)&&f.jsx(G.Grid,{container:!0,children:f.jsx(Df,{currentColor:s,changeClosedMode:b,closeChooseColor:c,handleCloseLineWeight:p,handleLineWeightSelect:u,openChooseColor:h,openChooseLineWeight:l,updateColor:x,toolOptions:o,toolState:i})}),i.activeTool===yt.TEXT&&f.jsxs(G.Grid,{container:!0,direction:"column",spacing:1,children:[f.jsx(G.Grid,{children:f.jsx(je,{variant:"overline",children:r("text")})}),n?f.jsxs(f.Fragment,{children:[f.jsx(G.Grid,{children:f.jsx(G.TextField,{value:i.text,placeholder:r("text"),fullwidth:!0,onChange:v})}),f.jsx(G.Grid,{children:f.jsx(Df,{changeClosedMode:b,closeChooseColor:c,currentColor:s,handleCloseLineWeight:p,handleLineWeightSelect:u,openChooseColor:h,openChooseLineWeight:l,toolOptions:o,toolState:i,updateColor:x})})]}):f.jsx(G.Grid,{children:f.jsx(je,{children:r("click_on_canvas_to_write")})})]}),i.activeTool===yt.IMAGE&&f.jsx(G.Grid,{container:!0,children:f.jsx(xC,{size:{xs:8},imageUrl:i.image?.id,onChange:E,isReadOnly:!!n,onAddImage:g,t:r})}),i.activeTool===we.POLYGON&&f.jsx(je,{children:r("pressEnterOrClickFirstPointToClose")})]})}Mf.propTypes={currentShape:d.object.isRequired,displayMode:d.string.isRequired,setToolState:d.func.isRequired,t:d.func.isRequired,toolState:d.shape({activeTool:d.string.isRequired,closedMode:d.string.isRequired,fillColor:d.string,image:d.shape({id:d.string}),strokeColor:d.string.isRequired,strokeWidth:d.number.isRequired,text:d.string,textBody:d.string,updateColor:d.func}).isRequired};const DD=In.styled(G.ListItem)(({theme:n})=>({display:"flex",justifyContent:"space-between"}));function dE({currentShapeId:n,deleteShape:e,shapes:t,t:r,updateCurrentShapeInShapes:i}){return f.jsx(W1,{children:t.map(o=>f.jsxs(m.Fragment,{children:[f.jsx(ul,{disableGutters:!0,children:f.jsxs(DD,{children:[f.jsx(je,{component:"span",sx:{color:"black",cursor:"pointer",fontWeight:o.id===n?"bold":void 0},onClick:()=>i(o),children:r(o.type)}),f.jsx(G.Tooltip,{title:f.jsx(Ri,{label:r("delete"),action:"delete"}),children:f.jsx(G.IconButton,{onClick:()=>e(o.id),edge:"end","aria-label":"delete",children:f.jsx(cx,{})})})]})}),f.jsx(G.Divider,{component:"li"})]},o.id))})}dE.propTypes={currentShapeId:d.string.isRequired,deleteShape:d.func.isRequired,shapes:d.array.isRequired,t:d.func.isRequired,updateCurrentShapeInShapes:d.func.isRequired};function hE({currentShape:n,deleteShape:e,displayMode:t,setToolState:r,shapes:i,t:o,toolState:a,updateCurrentShapeInShapes:s}){const l=(h,p)=>{if(!p)return;const b=p===yt.SHAPE?we.RECTANGLE:p;r(x=>x.activeTool===b?x:{...x,activeTool:b})},u=h=>{if(r(p=>({...p,...h,activeTool:yt.EDIT})),n){const p={};Object.prototype.hasOwnProperty.call(h,"strokeWidth")&&h.strokeWidth!==n.strokeWidth&&(p.strokeWidth=h.strokeWidth),Object.prototype.hasOwnProperty.call(h,"strokeColor")&&h.strokeColor!==n.stroke&&(p.stroke=h.strokeColor),Object.prototype.hasOwnProperty.call(h,"fillColor")&&h.fillColor!==n.fill&&(p.fill=h.fillColor),Object.prototype.hasOwnProperty.call(h,"text")&&h.text!==n.text&&(p.text=h.text),Object.prototype.hasOwnProperty.call(h,"image")&&h.image?.id!==n.url&&(p.url=h.image?.id??null),Object.keys(p).length&&s({...n,...p})}};m.useEffect(()=>{a.activeTool===yt.SHAPE&&r(h=>({...h,activeTool:we.RECTANGLE}))},[a.activeTool,r]);const c=m.useMemo(()=>n?{...a,activeTool:n.type,closedMode:n.closedMode,fillColor:n.fill,image:{id:n.url},strokeColor:n.stroke,strokeWidth:n.strokeWidth,text:n.text}:a,[a,n]);return f.jsxs(f.Fragment,{children:[a.activeTool===yt.EDIT&&f.jsxs(f.Fragment,{children:[n&&(t===Qt.DRAW||t===Qt.TARGET)&&f.jsxs("div",{children:[f.jsx(je,{variant:"subFormSectionTitle",children:o("selected_object")}),f.jsx(Mf,{t:o,toolState:c,setToolState:u,displayMode:t,currentShape:n})]}),t===Qt.DRAW&&i.length>0&&f.jsxs(f.Fragment,{children:[f.jsx(je,{variant:"subFormSectionTitle",children:o("object_list")}),f.jsx(dE,{currentShapeId:n?.id,shapes:i,deleteShape:e,updateCurrentShapeInShapes:s,t:o})]})]}),ip(a.activeTool)&&f.jsxs(Q1,{value:a.activeTool,exclusive:!0,onChange:l,"aria-label":o("tool_selection"),size:"small","data-testid":"tool_selection",children:[t!==Qt.IMAGE&&f.jsx(G.Tooltip,{title:o("rectangle"),children:f.jsx(Gt,{value:we.RECTANGLE,"aria-label":o("add_a_rectangle"),children:f.jsx(AS,{})})}),t===Qt.TARGET&&f.jsx(G.Tooltip,{title:o("circle"),children:f.jsx(Gt,{value:we.CIRCLE,"aria-label":o("add_a_circle"),children:f.jsx(ov,{})})}),t!==Qt.IMAGE&&f.jsx("div",{children:f.jsx(G.Tooltip,{title:o("line"),children:f.jsx(Gt,{value:we.POLYGON,"aria-label":o("add_a_line"),children:f.jsx(IS,{})})})}),t===Qt.DRAW&&f.jsxs(f.Fragment,{children:[f.jsx(G.Tooltip,{title:"Ellipse shape",children:f.jsx(Gt,{value:we.ELLIPSE,"aria-label":o("add_an_ellipse"),children:f.jsx(ov,{})})}),f.jsx(G.Tooltip,{title:o("arrow"),children:f.jsx(Gt,{value:we.ARROW,"aria-label":o("add_an_arrow_shape"),children:f.jsx(TS,{})})})]})]}),a.activeTool===yt.DELETE&&f.jsxs(f.Fragment,{children:[f.jsx(je,{variant:"overline",children:o("delete")}),f.jsx("p",{children:o("click_to_delete_shape")}),f.jsxs(G.Button,{onClick:()=>e(),children:[f.jsx("span",{children:o("delete_all")}),f.jsx(yC,{color:"red"})]})]}),f.jsx(Mf,{t:o,toolState:a,setToolState:r,displayMode:t,currentShape:n})]})}hE.propTypes={currentShape:d.object.isRequired,deleteShape:d.func.isRequired,displayMode:d.string.isRequired,setToolState:d.func.isRequired,shapes:d.array.isRequired,t:d.func.isRequired,toolState:d.shape({activeTool:d.string.isRequired,closedMode:d.string.isRequired,fillColor:d.string.isRequired,image:d.shape({id:d.string}).isRequired,strokeColor:d.string.isRequired,strokeWidth:d.number.isRequired,updateColor:d.func.isRequired}).isRequired,updateCurrentShapeInShapes:d.func.isRequired};const MD=In.styled(G.Grid)(({})=>({display:"flex",flexDirection:"column"}));function fE({displayMode:n,setToolState:e,toolState:t,deleteShape:r,currentShape:i,updateCurrentShapeInShapes:o,setViewTool:a,shapes:s,t:l}){m.useEffect(()=>{},[t.fillColor,t.strokeColor,t.strokeWidth]);const u=m.useCallback((p,b)=>{b&&(n?(e(x=>x.activeTool===b?x:{...x,activeTool:b}),b!==yt.EDIT&&o(null)):(b===yt.SHAPE&&e({...Q_,activeTool:b}),o(null)))},[n,e,o]),c=m.useCallback(p=>()=>{a(p)},[a]),{activeTool:h}=t;return f.jsx(G.Grid,{container:!0,children:f.jsxs(MD,{item:!0,xs:12,children:[f.jsxs(Q1,{value:h,exclusive:!0,onChange:u,"aria-label":l("tool_selection"),size:"small",children:[n!==Qt.IMAGE&&f.jsx(G.Tooltip,{title:l("shape_selection"),children:f.jsx(Gt,{value:ip(h)?h:yt.SHAPE,"aria-label":l("select_cursor"),onClick:c(Os),children:f.jsx(wS,{})})}),n===Qt.DRAW&&f.jsx(G.Tooltip,{title:l("text"),children:f.jsx(Gt,{value:yt.TEXT,"aria-label":l("select_text"),onClick:c(Os),children:f.jsx(ES,{})})}),n===Qt.IMAGE&&f.jsx(G.Tooltip,{title:l("image"),children:f.jsx(Gt,{value:yt.IMAGE,"aria-label":l("select_cursor"),onClick:c(Os),children:f.jsx(vC,{})})}),f.jsx(G.Tooltip,{title:l("edit"),children:f.jsx(Gt,{value:yt.EDIT,"aria-label":l("select_cursor"),onClick:c(J1),children:f.jsx(_S,{})})}),f.jsx(G.Tooltip,{title:f.jsx(Ri,{label:l("delete"),action:"delete"}),children:f.jsx(Gt,{value:yt.DELETE,"aria-label":l("select_cursor"),onClick:c(Os),children:f.jsx(yC,{})})})]}),f.jsx(hE,{currentShape:i,deleteShape:r,displayMode:n,setToolState:e,shapes:s,t:l,toolState:t,updateCurrentShapeInShapes:o})]})})}fE.propTypes={currentShape:d.shape({id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,type:d.string,url:d.string,x:d.number,y:d.number}).isRequired,deleteShape:d.func.isRequired,displayMode:d.string.isRequired,setToolState:d.func.isRequired,setViewTool:d.func.isRequired,shapes:d.arrayOf(d.shape({id:d.string,rotation:d.number,scaleX:d.number,scaleY:d.number,type:d.string,url:d.string,x:d.number,y:d.number})).isRequired,t:d.func.isRequired,toolState:d.shape({activeTool:d.string.isRequired,closedMode:d.string.isRequired,fillColor:d.string.isRequired,image:d.shape({id:d.string}).isRequired,strokeColor:d.string.isRequired,strokeWidth:d.number.isRequired,updateColor:d.func.isRequired}).isRequired,updateCurrentShapeInShapes:d.func.isRequired};function pE({playerReferences:n,setTargetDrawingState:e,targetDrawingState:t,windowId:r}){const{t:i}=Rn.useTranslation(),o=xn.useSelector(_=>pe.getConfig(_)),{editMode:a}=vs(o),[s,l]=m.useState(()=>{const _=Array.isArray(t?.shapes)?t.shapes:[];return{currentShape:null,isDrawing:!1,shapes:_,...t,...a&&_.length>0?{currentShape:_[0]}:{}}}),u=Array.isArray(t?.shapes)&&t.shapes.length>0,[c,h]=m.useState(u?Ln:{...Ln,activeTool:yt.SHAPE}),[,p]=m.useState(J1),[b,x]=m.useState(n.getScale()),E=m.useCallback(()=>{const _=n.getScale();x(O=>O===_?O:_)},[n]),g=m.useRef(s.shapes);m.useLayoutEffect(()=>{const _=g.current,O=s.shapes;_!==O&&(_&&O&&_.length===O.length&&_.every((R,I)=>R===O[I])||(g.current=O,e({drawingState:s})))},[s.shapes,e,s]);const v=m.useCallback(_=>{l(O=>{if(!_)return O.shapes.length===0&&O.currentShape==null?O:{...O,currentShape:null,shapes:[]};const R=O.shapes.filter(I=>I.id!==_);return R.length===O.shapes.length?O:{...O,currentShape:null,shapes:R}})},[]),C=m.useRef(s);C.current=s,m.useEffect(()=>{const _=()=>{const{currentShape:O,shapes:R}=C.current;if(O){const I=R.filter(N=>N.id!==O.id);l(N=>({...N,currentShape:null,shapes:I}))}};return document.addEventListener(df,_),()=>document.removeEventListener(df,_)},[]);const A=m.useCallback(_=>{setTimeout(()=>{l(O=>{if(!_)return O.currentShape==null?O:{...O,currentShape:null};const R=O.shapes.findIndex(I=>I.id===_.id);if(R!==-1){if(O.shapes[R]===_&&O.currentShape===_)return O;const N=O.shapes===void 0?[]:[...O.shapes];return N[R]=_,{...O,currentShape:_,shapes:N}}return{...O,currentShape:_,shapes:[...O.shapes||[],_]}})},0)},[]);return f.jsx(G.Grid,{container:!0,direction:"column",children:f.jsxs(G.Grid,{container:!0,direction:"column",children:[f.jsx(je,{variant:"subFormSectionTitle",children:i("spatialTarget")}),f.jsxs(G.Grid,{direction:"row",spacing:2,children:[f.jsx(Op,{displayMode:Qt.TARGET,drawingState:s,playerReferences:n,scale:b,setColorToolFromCurrentShape:()=>{},setDrawingState:l,tabView:"edit",toolState:c,updateCurrentShapeInShapes:A,updateScale:E,windowId:r,setToolState:h}),f.jsx(fE,{toolState:c,deleteShape:v,setToolState:h,shapes:s.shapes,currentShape:s.currentShape,setViewTool:p,t:i,displayMode:Qt.TARGET,updateCurrentShapeInShapes:A})]})]})})}pE.propTypes={playerReferences:d.object.isRequired,setTargetDrawingState:d.func.isRequired,targetDrawingState:d.object.isRequired,windowId:d.string.isRequired};const gE=tt.createSvgIcon(f.jsx("path",{d:"M23 4v20H10.02L1 14.83 2.9 13 8 15.91V3h3v8h1V0h3v11h1V1h3v10h1V4z"}),"PanToolSharp"),mE=tt.createSvgIcon(f.jsx("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"}),"GpsFixedSharp"),or={MOVE:"move",TARGET:"target"},kD={[or.MOVE]:{activeTool:yt.PAN},[or.TARGET]:{activeTool:we.POI}},my=()=>{};function bE({playerReferences:n,setTargetDrawingState:e,targetDrawingState:t,windowId:r}){const{t:i}=Rn.useTranslation(),[o,a]=m.useState(()=>{const v=Array.isArray(t?.shapes)?t.shapes:[];return{currentShape:null,isDrawing:!1,shapes:v,...t,...v.length>0?{currentShape:v[0]}:{}}}),[s,l]=m.useState(()=>o.shapes.length>0?or.MOVE:or.TARGET),[u,c]=m.useState(n.getScale()),[,h]=m.useReducer(v=>v+1,0),p=m.useCallback(()=>{const v=n.getScale();c(C=>C===v?C:v),h()},[n]),b=m.useRef(o.shapes);m.useLayoutEffect(()=>{const v=b.current,C=o.shapes;v!==C&&(b.current=C,e({drawingState:o}))},[o.shapes,e,o]);const x=m.useCallback(v=>{setTimeout(()=>{a(C=>v?C.currentShape===v&&C.shapes[0]===v?C:{...C,currentShape:v,shapes:[v]}:C.currentShape==null?C:{...C,currentShape:null})},0)},[]),E=n.getContainer?.(),g=f.jsx(G.Paper,{elevation:3,sx:{top:v=>v.spacing(2),insetInlineEnd:v=>v.spacing(2),position:"absolute",zIndex:10},children:f.jsxs(G.ToggleButtonGroup,{"aria-label":i("poi_mode"),exclusive:!0,onChange:(v,C)=>C&&l(C),size:"small",value:s,children:[f.jsx(G.Tooltip,{title:i("poi_mode_move"),children:f.jsx(G.ToggleButton,{"aria-label":i("poi_mode_move"),value:or.MOVE,children:f.jsx(gE,{fontSize:"small"})})}),f.jsx(G.Tooltip,{title:i("poi_mode_target"),children:f.jsx(G.ToggleButton,{"aria-label":i("poi_mode_target"),value:or.TARGET,children:f.jsx(mE,{fontSize:"small"})})})]})});return f.jsxs(G.Grid,{container:!0,direction:"column",children:[f.jsx(G.Typography,{variant:"subFormSectionTitle",children:i(s===or.MOVE?"poi_move_hint":"poi_click_to_place")}),f.jsx(G.Grid,{container:!0,direction:"row",spacing:2,children:f.jsx(Op,{displayMode:Qt.POI,drawingState:o,playerReferences:n,scale:u,setColorToolFromCurrentShape:my,setDrawingState:a,setToolState:my,tabView:"edit",toolState:kD[s],updateCurrentShapeInShapes:x,updateScale:p,windowId:r})}),E&&ep.createPortal(g,E)]})}bE.propTypes={playerReferences:d.object.isRequired,setTargetDrawingState:d.func.isRequired,targetDrawingState:d.object.isRequired,windowId:d.string.isRequired};function dg({onChangeTarget:n,spatialTarget:e,pointOnly:t,playerReferences:r,target:i,windowId:o}){const{t:a}=Rn.useTranslation(),s=r.getMediaType(),l=m.useMemo(()=>{if(i)return i;const c={drawingState:{currentShape:null,isDrawing:!1,shapes:[]}};return s===Yt.IMAGE&&(c.fullCanvaXYWH=`0,0,${r.getMediaTrueWidth()},${r.getMediaTrueHeight()}`),c},[i,s,r]);m.useEffect(()=>{i||n(l)},[i,l,n]);const u=c=>{n({...l,...c})};return e?f.jsxs(G.Grid,{container:!0,direction:"column",spacing:1,children:[f.jsx(G.Grid,{children:!t&&f.jsx(G.Typography,{variant:"formSectionTitle",children:a("target")})}),e&&s!==Yt.AUDIO&&f.jsx(G.Grid,{container:!0,direction:"column",children:t?f.jsx(bE,{playerReferences:r,setTargetDrawingState:u,targetDrawingState:l.drawingState,windowId:o}):f.jsx(pE,{playerReferences:r,setTargetDrawingState:u,targetDrawingState:l.drawingState,windowId:o})})]}):null}dg.propTypes={onChangeTarget:d.func.isRequired,playerReferences:d.object.isRequired,pointOnly:d.bool,spatialTarget:d.bool.isRequired,target:d.object,windowId:d.string.isRequired};dg.defaultProps={pointOnly:!1};var PD=Object.prototype,LD=PD.hasOwnProperty;function BD(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&LD.call(n,"index")&&(t.index=n.index,t.input=n.input),t}function FD(n,e){var t=qp(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var GD=/\w*$/;function qD(n){var e=new n.constructor(n.source,GD.exec(n));return e.lastIndex=n.lastIndex,e}var by=Hr?Hr.prototype:void 0,vy=by?by.valueOf:void 0;function HD(n){return vy?Object(vy.call(n)):{}}var VD="[object Boolean]",WD="[object Date]",zD="[object Map]",XD="[object Number]",UD="[object RegExp]",$D="[object Set]",YD="[object String]",ZD="[object Symbol]",JD="[object ArrayBuffer]",KD="[object DataView]",QD="[object Float32Array]",e4="[object Float64Array]",t4="[object Int8Array]",n4="[object Int16Array]",r4="[object Int32Array]",i4="[object Uint8Array]",o4="[object Uint8ClampedArray]",a4="[object Uint16Array]",s4="[object Uint32Array]";function l4(n,e,t){var r=n.constructor;switch(e){case JD:return qp(n);case VD:case WD:return new r(+n);case KD:return FD(n);case QD:case e4:case t4:case n4:case r4:case i4:case o4:case a4:case s4:return LC(n,t);case zD:return new r;case XD:case YD:return new r(n);case UD:return qD(n);case $D:return new r;case ZD:return HD(n)}}var u4="[object Map]";function c4(n){return Vr(n)&&Er(n)==u4}var yy=la&&la.isMap,d4=yy?Wp(yy):c4,h4="[object Set]";function f4(n){return Vr(n)&&Er(n)==h4}var xy=la&&la.isSet,p4=xy?Wp(xy):f4,g4=1,vE="[object Arguments]",m4="[object Array]",b4="[object Boolean]",v4="[object Date]",y4="[object Error]",yE="[object Function]",x4="[object GeneratorFunction]",C4="[object Map]",E4="[object Number]",xE="[object Object]",w4="[object RegExp]",_4="[object Set]",A4="[object String]",T4="[object Symbol]",I4="[object WeakMap]",S4="[object ArrayBuffer]",R4="[object DataView]",O4="[object Float32Array]",j4="[object Float64Array]",N4="[object Int8Array]",D4="[object Int16Array]",M4="[object Int32Array]",k4="[object Uint8Array]",P4="[object Uint8ClampedArray]",L4="[object Uint16Array]",B4="[object Uint32Array]",wt={};wt[vE]=wt[m4]=wt[S4]=wt[R4]=wt[b4]=wt[v4]=wt[O4]=wt[j4]=wt[N4]=wt[D4]=wt[M4]=wt[C4]=wt[E4]=wt[xE]=wt[w4]=wt[_4]=wt[A4]=wt[T4]=wt[k4]=wt[P4]=wt[L4]=wt[B4]=!0;wt[y4]=wt[yE]=wt[I4]=!1;function sl(n,e,t,r,i,o){var a,s=e&g4;if(a!==void 0)return a;if(!$n(n))return n;var l=Bn(n);if(l)a=BD(n);else{var u=Er(n),c=u==yE||u==x4;if(ss(n))return PC(n,s);if(u==xE||u==vE||c&&!i)a=c?{}:GC(n);else{if(!wt[u])return i?n:{};a=l4(n,u,s)}}o||(o=new Tr);var h=o.get(n);if(h)return h;o.set(n,a),p4(n)?n.forEach(function(x){a.add(sl(x,e,t,x,n,o))}):d4(n)&&n.forEach(function(x,E){a.set(E,sl(x,e,t,E,n,o))});var p=Sf,b=l?void 0:p(n);return ZC(b||n,function(x,E){b&&(E=x,x=n[E]),zC(a,E,sl(x,e,t,E,n,o))}),a}var F4=1,G4=4;function Ko(n){return sl(n,F4|G4)}function wi(n,e){return nu(n,e)}var ge=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(ge||{});class Wr{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const i=ge.TYPE&ge.ATTRIBUTE;this.scope=r.scope!=null?r.scope&ge.LEVEL|i:ge.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(t=>t.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){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class Qo extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const CE=class kf{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 r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(e,t,r){const i=this.query(t);if(i==null)throw new Qo(`Unable to create ${t} blot`);const o=i,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:o.create(r),s=new o(e,a,r);return kf.blots.set(s.domNode,s),s}find(e,t=!1){return kf.find(e,t)}query(e,t=ge.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&ge.LEVEL&ge.BLOCK?r=this.types.block:e&ge.LEVEL&ge.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(i=>(r=this.classes[i],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&t&ge.LEVEL&r.scope&&t&ge.TYPE&r.scope?r:null}register(...e){return e.map(t=>{const r="blotName"in t,i="attrName"in t;if(!r&&!i)throw new Qo("Invalid definition");if(r&&t.blotName==="abstract")throw new Qo("Cannot register abstract class");const o=r?t.blotName:i?t.attrName:void 0;return this.types[o]=t,i?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):r&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(a=>a.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(a=>{(this.tags[a]==null||t.className==null)&&(this.tags[a]=t)}))),t})}};CE.blots=new WeakMap;let ua=CE;function Cy(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class q4 extends Wr{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(t=>t.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){Cy(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(Cy(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const Or=q4;function kh(n){const e=n.split("-"),t=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+t}class H4 extends Wr{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[kh(this.keyName)]=t,!0):!1}remove(e){e.style[kh(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[kh(this.keyName)];return this.canAdd(e,t)?t:""}}const ji=H4;class V4{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=ua.find(this.domNode);if(e==null)return;const t=Wr.keys(this.domNode),r=Or.keys(this.domNode),i=ji.keys(this.domNode);t.concat(r).concat(i).forEach(o=>{const a=e.scroll.query(o,ge.ATTRIBUTE);a instanceof Wr&&(this.attributes[a.attrName]=a)})}copy(e){Object.keys(this.attributes).forEach(t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}}const iu=V4,EE=class{constructor(e,t){this.scroll=e,this.domNode=t,ua.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Qo("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?t=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?t=document.createElement(r):t=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(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),ua.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,i){const o=this.isolate(e,t);if(this.scroll.query(r,ge.BLOT)!=null&&i)o.wrap(r,i);else if(this.scroll.query(r,ge.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);o.wrap(a),a.format(r,i)}}insertAt(e,t,r){const i=r==null?this.scroll.create("text",t):this.scroll.create(t,r),o=this.split(e);this.parent.insertBefore(i,o||void 0)}isolate(e,t){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(t),r}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){const r=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new Qo(`Cannot wrap ${e}`);return r.appendChild(this),r}};EE.blotName="abstract";let wE=EE;const _E=class extends wE{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 r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};_E.scope=ge.INLINE_BLOT;let W4=_E;const yn=W4;class z4{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),i=0;for(;r;){if(r===e)return i;i+=1,r=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,r=this.head;for(;r!=null;){if(r===e)return t;t+=r.length(),r=r.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-=1)}iterator(e=this.head){return()=>{const t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){const r=this.iterator();let i=r();for(;i;){const o=i.length();if(e<o||t&&e===o&&(i.next==null||i.next.length()!==0))return[i,e];e-=o,i=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[i,o]=this.find(e);let a=e-o;const s=this.iterator(i);let l=s();for(;l&&a<e+t;){const u=l.length();e>a?r(l,e-a,Math.min(t,a+u-e)):r(l,0,Math.min(u,e+t-a)),a+=u,l=s()}}map(e){return this.reduce((t,r)=>(t.push(e(r)),t),[])}reduce(e,t){const r=this.iterator();let i=r();for(;i;)t=e(t,i),i=r();return t}}function Ey(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(ge.INLINE);return Array.from(n.childNodes).forEach(i=>{r.domNode.appendChild(i)}),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const AE=class xi extends wE{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(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,xi.uiClass&&this.uiNode.classList.add(xi.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new z4,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=Ey(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof Qo)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(r,i,o)=>{r.deleteAt(i,o)})}descendant(e,t=0){const[r,i]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,i]:r instanceof xi?r.descendant(e,i):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let i=[],o=r;return this.children.forEachAt(t,r,(a,s,l)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&i.push(a),a instanceof xi&&(i=i.concat(a.descendants(e,s,o))),o-=l}),i}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(t=>{e||this.statics.allowedChildren.some(r=>t instanceof r)||(t.statics.scope===ge.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof xi?t.unwrap():t.remove())})}formatAt(e,t,r,i){this.children.forEachAt(e,t,(o,a,s)=>{o.formatAt(a,s,r,i)})}insertAt(e,t,r){const[i,o]=this.children.find(e);if(i)i.insertAt(o,t,r);else{const a=r==null?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(a)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(r=>{e.insertBefore(r,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){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[r,i]=this.children.find(e,t),o=[[this,e]];return r instanceof xi?o.concat(r.path(i,t)):(r!=null&&o.push([r,i]),o)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return r instanceof xi&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(i,o,a)=>{const s=i.split(o,t);s!=null&&r.appendChild(s)}),r}splitAfter(e){const 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){const r=[],i=[];e.forEach(o=>{o.target===this.domNode&&o.type==="childList"&&(r.push(...o.addedNodes),i.push(...o.removedNodes))}),i.forEach(o=>{if(o.parentNode!=null&&o.tagName!=="IFRAME"&&document.body.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(o);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()}),r.filter(o=>o.parentNode===this.domNode&&o!==this.uiNode).sort((o,a)=>o===a?0:o.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(o=>{let a=null;o.nextSibling!=null&&(a=this.scroll.find(o.nextSibling));const s=Ey(o,this.scroll);(s.next!==a||s.next==null)&&(s.parent!=null&&s.parent.removeChild(this),this.insertBefore(s,a||void 0))}),this.enforceAllowedChildren()}};AE.uiClass="";let X4=AE;const Ir=X4;function U4(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const zo=class Xo extends Ir{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Xo.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new iu(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(r=>{r instanceof Xo||(r=r.wrap(Xo.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,ge.INLINE);if(r==null)return;r instanceof Wr?this.attributes.attribute(r,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,i){this.formats()[r]!=null||this.scroll.query(r,ge.ATTRIBUTE)?this.isolate(e,t).format(r,i):super.formatAt(e,t,r,i)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const r=this.next;r instanceof Xo&&r.prev===this&&U4(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof Xo&&this.attributes.move(r),r}};zo.allowedChildren=[zo,yn],zo.blotName="inline",zo.scope=ge.INLINE_BLOT,zo.tagName="SPAN";let $4=zo;const hg=$4,Uo=class Pf extends Ir{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Pf.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new iu(this.domNode)}format(e,t){const r=this.scroll.query(e,ge.BLOCK);r!=null&&(r instanceof Wr?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(Pf.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,i){this.scroll.query(r,ge.BLOCK)!=null?this.format(r,i):super.formatAt(e,t,r,i)}insertAt(e,t,r){if(r==null||this.scroll.query(t,ge.INLINE)!=null)super.insertAt(e,t,r);else{const i=this.split(e);if(i!=null){const o=this.scroll.create(t,r);i.parent.insertBefore(o,i)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};Uo.blotName="block",Uo.scope=ge.BLOCK_BLOT,Uo.tagName="P",Uo.allowedChildren=[hg,Uo,yn];let Y4=Uo;const ls=Y4,Lf=class extends Ir{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,i){super.formatAt(e,t,r,i),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Lf.blotName="container",Lf.scope=ge.BLOCK_BLOT;let Z4=Lf;const ou=Z4;class J4 extends yn{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,i){e===0&&t===this.length()?this.format(r,i):super.formatAt(e,t,r,i)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Yn=J4,K4={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Q4=100,$o=class extends Ir{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,K4),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=ge.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(r=>{r.remove()}):super.deleteAt(e,t)}formatAt(e,t,r,i){this.update(),super.formatAt(e,t,r,i)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let i=Array.from(this.observer.takeRecords());for(;i.length>0;)e.push(i.pop());const o=(l,u=!0)=>{l==null||l===this||l.domNode.parentNode!=null&&(r.has(l.domNode)||r.set(l.domNode,[]),u&&o(l.parent))},a=l=>{r.has(l.domNode)&&(l instanceof Ir&&l.children.forEach(a),r.delete(l.domNode),l.optimize(t))};let s=e;for(let l=0;s.length>0;l+=1){if(l>=Q4)throw new Error("[Parchment] Maximum optimize iterations reached");for(s.forEach(u=>{const c=this.find(u.target,!0);c!=null&&(c.domNode===u.target&&(u.type==="childList"?(o(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach(h=>{const p=this.find(h,!1);o(p,!1),p instanceof Ir&&p.children.forEach(b=>{o(b,!1)})})):u.type==="attributes"&&o(c.prev)),o(c))}),this.children.forEach(a),s=Array.from(this.observer.takeRecords()),i=s.slice();i.length>0;)e.push(i.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(i=>{const o=this.find(i.target,!0);return o==null?null:r.has(o.domNode)?(r.get(o.domNode).push(i),null):(r.set(o.domNode,[i]),o)}).forEach(i=>{i!=null&&i!==this&&r.has(i.domNode)&&i.update(r.get(i.domNode)||[],t)}),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};$o.blotName="scroll",$o.defaultChild=ls,$o.allowedChildren=[ls,ou],$o.scope=ge.BLOCK_BLOT,$o.tagName="DIV";let eM=$o;const fg=eM,Bf=class TE extends yn{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,r){r==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof TE&&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}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Bf.blotName="text",Bf.scope=ge.INLINE_BLOT;let tM=Bf;const _l=tM,nM=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Wr,AttributorStore:iu,BlockBlot:ls,ClassAttributor:Or,ContainerBlot:ou,EmbedBlot:Yn,InlineBlot:hg,LeafBlot:yn,ParentBlot:Ir,Registry:ua,Scope:ge,ScrollBlot:fg,StyleAttributor:ji,TextBlot:_l},Symbol.toStringTag,{value:"Module"}));var Vs={exports:{}},Ph,wy;function rM(){if(wy)return Ph;wy=1;var n=-1,e=1,t=0;function r(w,P,T,D,M){if(w===P)return w?[[t,w]]:[];if(T!=null){var k=L(w,P,T);if(k)return k}var V=s(w,P),W=w.substring(0,V);w=w.substring(V),P=P.substring(V),V=u(w,P);var Y=w.substring(w.length-V);w=w.substring(0,w.length-V),P=P.substring(0,P.length-V);var q=i(w,P);return W&&q.unshift([t,W]),Y&&q.push([t,Y]),C(q,M),D&&h(q),q}function i(w,P){var T;if(!w)return[[e,P]];if(!P)return[[n,w]];var D=w.length>P.length?w:P,M=w.length>P.length?P:w,k=D.indexOf(M);if(k!==-1)return T=[[e,D.substring(0,k)],[t,M],[e,D.substring(k+M.length)]],w.length>P.length&&(T[0][0]=T[2][0]=n),T;if(M.length===1)return[[n,w],[e,P]];var V=c(w,P);if(V){var W=V[0],Y=V[1],q=V[2],J=V[3],X=V[4],Q=r(W,q),K=r(Y,J);return Q.concat([[t,X]],K)}return o(w,P)}function o(w,P){for(var T=w.length,D=P.length,M=Math.ceil((T+D)/2),k=M,V=2*M,W=new Array(V),Y=new Array(V),q=0;q<V;q++)W[q]=-1,Y[q]=-1;W[k+1]=0,Y[k+1]=0;for(var J=T-D,X=J%2!==0,Q=0,K=0,z=0,re=0,de=0;de<M;de++){for(var oe=-de+Q;oe<=de-K;oe+=2){var be=k+oe,Ne;oe===-de||oe!==de&&W[be-1]<W[be+1]?Ne=W[be+1]:Ne=W[be-1]+1;for(var Pe=Ne-oe;Ne<T&&Pe<D&&w.charAt(Ne)===P.charAt(Pe);)Ne++,Pe++;if(W[be]=Ne,Ne>T)K+=2;else if(Pe>D)Q+=2;else if(X){var De=k+J-oe;if(De>=0&&De<V&&Y[De]!==-1){var He=T-Y[De];if(Ne>=He)return a(w,P,Ne,Pe)}}}for(var ve=-de+z;ve<=de-re;ve+=2){var De=k+ve,He;ve===-de||ve!==de&&Y[De-1]<Y[De+1]?He=Y[De+1]:He=Y[De-1]+1;for(var se=He-ve;He<T&&se<D&&w.charAt(T-He-1)===P.charAt(D-se-1);)He++,se++;if(Y[De]=He,He>T)re+=2;else if(se>D)z+=2;else if(!X){var be=k+J-ve;if(be>=0&&be<V&&W[be]!==-1){var Ne=W[be],Pe=k+Ne-be;if(He=T-He,Ne>=He)return a(w,P,Ne,Pe)}}}}return[[n,w],[e,P]]}function a(w,P,T,D){var M=w.substring(0,T),k=P.substring(0,D),V=w.substring(T),W=P.substring(D),Y=r(M,k),q=r(V,W);return Y.concat(q)}function s(w,P){if(!w||!P||w.charAt(0)!==P.charAt(0))return 0;for(var T=0,D=Math.min(w.length,P.length),M=D,k=0;T<M;)w.substring(k,M)==P.substring(k,M)?(T=M,k=T):D=M,M=Math.floor((D-T)/2+T);return A(w.charCodeAt(M-1))&&M--,M}function l(w,P){var T=w.length,D=P.length;if(T==0||D==0)return 0;T>D?w=w.substring(T-D):T<D&&(P=P.substring(0,T));var M=Math.min(T,D);if(w==P)return M;for(var k=0,V=1;;){var W=w.substring(M-V),Y=P.indexOf(W);if(Y==-1)return k;V+=Y,(Y==0||w.substring(M-V)==P.substring(0,V))&&(k=V,V++)}}function u(w,P){if(!w||!P||w.slice(-1)!==P.slice(-1))return 0;for(var T=0,D=Math.min(w.length,P.length),M=D,k=0;T<M;)w.substring(w.length-M,w.length-k)==P.substring(P.length-M,P.length-k)?(T=M,k=T):D=M,M=Math.floor((D-T)/2+T);return _(w.charCodeAt(w.length-M))&&M--,M}function c(w,P){var T=w.length>P.length?w:P,D=w.length>P.length?P:w;if(T.length<4||D.length*2<T.length)return null;function M(K,z,re){for(var de=K.substring(re,re+Math.floor(K.length/4)),oe=-1,be="",Ne,Pe,De,He;(oe=z.indexOf(de,oe+1))!==-1;){var ve=s(K.substring(re),z.substring(oe)),se=u(K.substring(0,re),z.substring(0,oe));be.length<se+ve&&(be=z.substring(oe-se,oe)+z.substring(oe,oe+ve),Ne=K.substring(0,re-se),Pe=K.substring(re+ve),De=z.substring(0,oe-se),He=z.substring(oe+ve))}return be.length*2>=K.length?[Ne,Pe,De,He,be]:null}var k=M(T,D,Math.ceil(T.length/4)),V=M(T,D,Math.ceil(T.length/2)),W;if(!k&&!V)return null;V?k?W=k[4].length>V[4].length?k:V:W=V:W=k;var Y,q,J,X;w.length>P.length?(Y=W[0],q=W[1],J=W[2],X=W[3]):(J=W[0],X=W[1],Y=W[2],q=W[3]);var Q=W[4];return[Y,q,J,X,Q]}function h(w){for(var P=!1,T=[],D=0,M=null,k=0,V=0,W=0,Y=0,q=0;k<w.length;)w[k][0]==t?(T[D++]=k,V=Y,W=q,Y=0,q=0,M=w[k][1]):(w[k][0]==e?Y+=w[k][1].length:q+=w[k][1].length,M&&M.length<=Math.max(V,W)&&M.length<=Math.max(Y,q)&&(w.splice(T[D-1],0,[n,M]),w[T[D-1]+1][0]=e,D--,D--,k=D>0?T[D-1]:-1,V=0,W=0,Y=0,q=0,M=null,P=!0)),k++;for(P&&C(w),v(w),k=1;k<w.length;){if(w[k-1][0]==n&&w[k][0]==e){var J=w[k-1][1],X=w[k][1],Q=l(J,X),K=l(X,J);Q>=K?(Q>=J.length/2||Q>=X.length/2)&&(w.splice(k,0,[t,X.substring(0,Q)]),w[k-1][1]=J.substring(0,J.length-Q),w[k+1][1]=X.substring(Q),k++):(K>=J.length/2||K>=X.length/2)&&(w.splice(k,0,[t,J.substring(0,K)]),w[k-1][0]=e,w[k-1][1]=X.substring(0,X.length-K),w[k+1][0]=n,w[k+1][1]=J.substring(K),k++),k++}k++}}var p=/[^a-zA-Z0-9]/,b=/\s/,x=/[\r\n]/,E=/\n\r?\n$/,g=/^\r?\n\r?\n/;function v(w){function P(K,z){if(!K||!z)return 6;var re=K.charAt(K.length-1),de=z.charAt(0),oe=re.match(p),be=de.match(p),Ne=oe&&re.match(b),Pe=be&&de.match(b),De=Ne&&re.match(x),He=Pe&&de.match(x),ve=De&&K.match(E),se=He&&z.match(g);return ve||se?5:De||He?4:oe&&!Ne&&Pe?3:Ne||Pe?2:oe||be?1:0}for(var T=1;T<w.length-1;){if(w[T-1][0]==t&&w[T+1][0]==t){var D=w[T-1][1],M=w[T][1],k=w[T+1][1],V=u(D,M);if(V){var W=M.substring(M.length-V);D=D.substring(0,D.length-V),M=W+M.substring(0,M.length-V),k=W+k}for(var Y=D,q=M,J=k,X=P(D,M)+P(M,k);M.charAt(0)===k.charAt(0);){D+=M.charAt(0),M=M.substring(1)+k.charAt(0),k=k.substring(1);var Q=P(D,M)+P(M,k);Q>=X&&(X=Q,Y=D,q=M,J=k)}w[T-1][1]!=Y&&(Y?w[T-1][1]=Y:(w.splice(T-1,1),T--),w[T][1]=q,J?w[T+1][1]=J:(w.splice(T+1,1),T--))}T++}}function C(w,P){w.push([t,""]);for(var T=0,D=0,M=0,k="",V="",W;T<w.length;){if(T<w.length-1&&!w[T][1]){w.splice(T,1);continue}switch(w[T][0]){case e:M++,V+=w[T][1],T++;break;case n:D++,k+=w[T][1],T++;break;case t:var Y=T-M-D-1;if(P){if(Y>=0&&R(w[Y][1])){var q=w[Y][1].slice(-1);if(w[Y][1]=w[Y][1].slice(0,-1),k=q+k,V=q+V,!w[Y][1]){w.splice(Y,1),T--;var J=Y-1;w[J]&&w[J][0]===e&&(M++,V=w[J][1]+V,J--),w[J]&&w[J][0]===n&&(D++,k=w[J][1]+k,J--),Y=J}}if(O(w[T][1])){var q=w[T][1].charAt(0);w[T][1]=w[T][1].slice(1),k+=q,V+=q}}if(T<w.length-1&&!w[T][1]){w.splice(T,1);break}if(k.length>0||V.length>0){k.length>0&&V.length>0&&(W=s(V,k),W!==0&&(Y>=0?w[Y][1]+=V.substring(0,W):(w.splice(0,0,[t,V.substring(0,W)]),T++),V=V.substring(W),k=k.substring(W)),W=u(V,k),W!==0&&(w[T][1]=V.substring(V.length-W)+w[T][1],V=V.substring(0,V.length-W),k=k.substring(0,k.length-W)));var X=M+D;k.length===0&&V.length===0?(w.splice(T-X,X),T=T-X):k.length===0?(w.splice(T-X,X,[e,V]),T=T-X+1):V.length===0?(w.splice(T-X,X,[n,k]),T=T-X+1):(w.splice(T-X,X,[n,k],[e,V]),T=T-X+2)}T!==0&&w[T-1][0]===t?(w[T-1][1]+=w[T][1],w.splice(T,1)):T++,M=0,D=0,k="",V="";break}}w[w.length-1][1]===""&&w.pop();var Q=!1;for(T=1;T<w.length-1;)w[T-1][0]===t&&w[T+1][0]===t&&(w[T][1].substring(w[T][1].length-w[T-1][1].length)===w[T-1][1]?(w[T][1]=w[T-1][1]+w[T][1].substring(0,w[T][1].length-w[T-1][1].length),w[T+1][1]=w[T-1][1]+w[T+1][1],w.splice(T-1,1),Q=!0):w[T][1].substring(0,w[T+1][1].length)==w[T+1][1]&&(w[T-1][1]+=w[T+1][1],w[T][1]=w[T][1].substring(w[T+1][1].length)+w[T+1][1],w.splice(T+1,1),Q=!0)),T++;Q&&C(w,P)}function A(w){return w>=55296&&w<=56319}function _(w){return w>=56320&&w<=57343}function O(w){return _(w.charCodeAt(0))}function R(w){return A(w.charCodeAt(w.length-1))}function I(w){for(var P=[],T=0;T<w.length;T++)w[T][1].length>0&&P.push(w[T]);return P}function N(w,P,T,D){return R(w)||O(D)?null:I([[t,w],[n,P],[e,T],[t,D]])}function L(w,P,T){var D=typeof T=="number"?{index:T,length:0}:T.oldRange,M=typeof T=="number"?null:T.newRange,k=w.length,V=P.length;if(D.length===0&&(M===null||M.length===0)){var W=D.index,Y=w.slice(0,W),q=w.slice(W),J=M?M.index:null;e:{var X=W+V-k;if(J!==null&&J!==X||X<0||X>V)break e;var Q=P.slice(0,X),K=P.slice(X);if(K!==q)break e;var z=Math.min(W,X),re=Y.slice(0,z),de=Q.slice(0,z);if(re!==de)break e;var oe=Y.slice(z),be=Q.slice(z);return N(re,oe,be,q)}e:{if(J!==null&&J!==W)break e;var Ne=W,Q=P.slice(0,Ne),K=P.slice(Ne);if(Q!==Y)break e;var Pe=Math.min(k-Ne,V-Ne),De=q.slice(q.length-Pe),He=K.slice(K.length-Pe);if(De!==He)break e;var oe=q.slice(0,q.length-Pe),be=K.slice(0,K.length-Pe);return N(Y,oe,be,De)}}if(D.length>0&&M&&M.length===0)e:{var re=w.slice(0,D.index),De=w.slice(D.index+D.length),z=re.length,Pe=De.length;if(V<z+Pe)break e;var de=P.slice(0,z),He=P.slice(V-Pe);if(re!==de||De!==He)break e;var oe=w.slice(z,k-Pe),be=P.slice(z,V-Pe);return N(re,oe,be,De)}return null}function B(w,P,T,D){return r(w,P,T,D,!0)}return B.INSERT=e,B.DELETE=n,B.EQUAL=t,Ph=B,Ph}var za={exports:{}};za.exports;var _y;function IE(){return _y||(_y=1,(function(n,e){var t=200,r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",c="[object Function]",h="[object GeneratorFunction]",p="[object Map]",b="[object Number]",x="[object Object]",E="[object Promise]",g="[object RegExp]",v="[object Set]",C="[object String]",A="[object Symbol]",_="[object WeakMap]",O="[object ArrayBuffer]",R="[object DataView]",I="[object Float32Array]",N="[object Float64Array]",L="[object Int8Array]",B="[object Int16Array]",w="[object Int32Array]",P="[object Uint8Array]",T="[object Uint8ClampedArray]",D="[object Uint16Array]",M="[object Uint32Array]",k=/[\\^$.*+?()[\]{}|]/g,V=/\w*$/,W=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,q={};q[o]=q[a]=q[O]=q[R]=q[s]=q[l]=q[I]=q[N]=q[L]=q[B]=q[w]=q[p]=q[b]=q[x]=q[g]=q[v]=q[C]=q[A]=q[P]=q[T]=q[D]=q[M]=!0,q[u]=q[c]=q[_]=!1;var J=typeof sr=="object"&&sr&&sr.Object===Object&&sr,X=typeof self=="object"&&self&&self.Object===Object&&self,Q=J||X||Function("return this")(),K=e&&!e.nodeType&&e,z=K&&!0&&n&&!n.nodeType&&n,re=z&&z.exports===K;function de(y,S){return y.set(S[0],S[1]),y}function oe(y,S){return y.add(S),y}function be(y,S){for(var F=-1,U=y?y.length:0;++F<U&&S(y[F],F,y)!==!1;);return y}function Ne(y,S){for(var F=-1,U=S.length,Fe=y.length;++F<U;)y[Fe+F]=S[F];return y}function Pe(y,S,F,U){for(var Fe=-1,ye=y?y.length:0;++Fe<ye;)F=S(F,y[Fe],Fe,y);return F}function De(y,S){for(var F=-1,U=Array(y);++F<y;)U[F]=S(F);return U}function He(y,S){return y?.[S]}function ve(y){var S=!1;if(y!=null&&typeof y.toString!="function")try{S=!!(y+"")}catch{}return S}function se(y){var S=-1,F=Array(y.size);return y.forEach(function(U,Fe){F[++S]=[Fe,U]}),F}function Me(y,S){return function(F){return y(S(F))}}function Re(y){var S=-1,F=Array(y.size);return y.forEach(function(U){F[++S]=U}),F}var nt=Array.prototype,Ie=Function.prototype,Ye=Object.prototype,Ue=Q["__core-js_shared__"],_t=(function(){var y=/[^.]+$/.exec(Ue&&Ue.keys&&Ue.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""})(),Ke=Ie.toString,gt=Ye.hasOwnProperty,Ot=Ye.toString,Pt=RegExp("^"+Ke.call(gt).replace(k,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xt=re?Q.Buffer:void 0,ot=Q.Symbol,mt=Q.Uint8Array,pt=Me(Object.getPrototypeOf,Object),Ct=Object.create,tn=Ye.propertyIsEnumerable,st=nt.splice,lt=Object.getOwnPropertySymbols,nn=xt?xt.isBuffer:void 0,On=Me(Object.keys,Object),Lt=qn(Q,"DataView"),bt=qn(Q,"Map"),jt=qn(Q,"Promise"),Ce=qn(Q,"Set"),ce=qn(Q,"WeakMap"),Ae=qn(Object,"create"),ze=$(Lt),qe=$(bt),te=$(jt),Te=$(Ce),Xe=$(ce),ht=ot?ot.prototype:void 0,ft=ht?ht.valueOf:void 0;function $e(y){var S=-1,F=y?y.length:0;for(this.clear();++S<F;){var U=y[S];this.set(U[0],U[1])}}function rn(){this.__data__=Ae?Ae(null):{}}function Cn(y){return this.has(y)&&delete this.__data__[y]}function dr(y){var S=this.__data__;if(Ae){var F=S[y];return F===r?void 0:F}return gt.call(S,y)?S[y]:void 0}function hr(y){var S=this.__data__;return Ae?S[y]!==void 0:gt.call(S,y)}function En(y,S){var F=this.__data__;return F[y]=Ae&&S===void 0?r:S,this}$e.prototype.clear=rn,$e.prototype.delete=Cn,$e.prototype.get=dr,$e.prototype.has=hr,$e.prototype.set=En;function At(y){var S=-1,F=y?y.length:0;for(this.clear();++S<F;){var U=y[S];this.set(U[0],U[1])}}function Yr(){this.__data__=[]}function Zn(y){var S=this.__data__,F=Nt(S,y);if(F<0)return!1;var U=S.length-1;return F==U?S.pop():st.call(S,F,1),!0}function Nr(y){var S=this.__data__,F=Nt(S,y);return F<0?void 0:S[F][1]}function fr(y){return Nt(this.__data__,y)>-1}function pr(y,S){var F=this.__data__,U=Nt(F,y);return U<0?F.push([y,S]):F[U][1]=S,this}At.prototype.clear=Yr,At.prototype.delete=Zn,At.prototype.get=Nr,At.prototype.has=fr,At.prototype.set=pr;function Vt(y){var S=-1,F=y?y.length:0;for(this.clear();++S<F;){var U=y[S];this.set(U[0],U[1])}}function vt(){this.__data__={hash:new $e,map:new(bt||At),string:new $e}}function Jn(y){return Br(this,y).delete(y)}function Di(y){return Br(this,y).get(y)}function Dr(y){return Br(this,y).has(y)}function Mr(y,S){return Br(this,y).set(y,S),this}Vt.prototype.clear=vt,Vt.prototype.delete=Jn,Vt.prototype.get=Di,Vt.prototype.has=Dr,Vt.prototype.set=Mr;function Wt(y){this.__data__=new At(y)}function Zr(){this.__data__=new At}function Mi(y){return this.__data__.delete(y)}function ci(y){return this.__data__.get(y)}function di(y){return this.__data__.has(y)}function hi(y,S){var F=this.__data__;if(F instanceof At){var U=F.__data__;if(!bt||U.length<t-1)return U.push([y,S]),this;F=this.__data__=new Vt(U)}return F.set(y,S),this}Wt.prototype.clear=Zr,Wt.prototype.delete=Mi,Wt.prototype.get=ci,Wt.prototype.has=di,Wt.prototype.set=hi;function ae(y,S){var F=rt(y)||Ee(y)?De(y.length,String):[],U=F.length,Fe=!!U;for(var ye in y)gt.call(y,ye)&&!(Fe&&(ye=="length"||ki(ye,U)))&&F.push(ye);return F}function Ze(y,S,F){var U=y[S];(!(gt.call(y,S)&&le(U,F))||F===void 0&&!(S in y))&&(y[S]=F)}function Nt(y,S){for(var F=y.length;F--;)if(le(y[F][0],S))return F;return-1}function at(y,S){return y&&gi(S,ba(S),y)}function on(y,S,F,U,Fe,ye,it){var Qe;if(U&&(Qe=ye?U(y,Fe,ye,it):U(y)),Qe!==void 0)return Qe;if(!Fr(y))return y;var Xt=rt(y);if(Xt){if(Qe=ma(y),!S)return pi(y,Qe)}else{var ct=mr(y),gn=ct==c||ct==h;if(Jt(y))return wn(y,S);if(ct==x||ct==o||gn&&!ye){if(ve(y))return ye?y:{};if(Qe=Hn(gn?{}:y),!S)return po(y,at(Qe,y))}else{if(!q[ct])return ye?y:{};Qe=mi(y,ct,on,S)}}it||(it=new Wt);var jn=it.get(y);if(jn)return jn;if(it.set(y,Qe),!Xt)var Kt=F?go(y):ba(y);return be(Kt||y,function(mn,cn){Kt&&(cn=mn,mn=y[cn]),Ze(Qe,cn,on(mn,S,F,U,cn,y,it))}),Qe}function kr(y){return Fr(y)?Ct(y):{}}function gr(y,S,F){var U=S(y);return rt(y)?U:Ne(U,F(y))}function Pr(y){return Ot.call(y)}function fi(y){if(!Fr(y)||j(y))return!1;var S=Kr(y)||ve(y)?Pt:W;return S.test($(y))}function Lr(y){if(!H(y))return On(y);var S=[];for(var F in Object(y))gt.call(y,F)&&F!="constructor"&&S.push(F);return S}function wn(y,S){if(S)return y.slice();var F=new y.constructor(y.length);return y.copy(F),F}function Kn(y){var S=new y.constructor(y.byteLength);return new mt(S).set(new mt(y)),S}function _n(y,S){var F=S?Kn(y.buffer):y.buffer;return new y.constructor(F,y.byteOffset,y.byteLength)}function Gn(y,S,F){var U=S?F(se(y),!0):se(y);return Pe(U,de,new y.constructor)}function Qn(y){var S=new y.constructor(y.source,V.exec(y));return S.lastIndex=y.lastIndex,S}function an(y,S,F){var U=S?F(Re(y),!0):Re(y);return Pe(U,oe,new y.constructor)}function Jr(y){return ft?Object(ft.call(y)):{}}function er(y,S){var F=S?Kn(y.buffer):y.buffer;return new y.constructor(F,y.byteOffset,y.length)}function pi(y,S){var F=-1,U=y.length;for(S||(S=Array(U));++F<U;)S[F]=y[F];return S}function gi(y,S,F,U){F||(F={});for(var Fe=-1,ye=S.length;++Fe<ye;){var it=S[Fe],Qe=void 0;Ze(F,it,Qe===void 0?y[it]:Qe)}return F}function po(y,S){return gi(y,tr(y),S)}function go(y){return gr(y,ba,tr)}function Br(y,S){var F=y.__data__;return ee(S)?F[typeof S=="string"?"string":"hash"]:F.map}function qn(y,S){var F=He(y,S);return fi(F)?F:void 0}var tr=lt?Me(lt,Object):pu,mr=Pr;(Lt&&mr(new Lt(new ArrayBuffer(1)))!=R||bt&&mr(new bt)!=p||jt&&mr(jt.resolve())!=E||Ce&&mr(new Ce)!=v||ce&&mr(new ce)!=_)&&(mr=function(y){var S=Ot.call(y),F=S==x?y.constructor:void 0,U=F?$(F):void 0;if(U)switch(U){case ze:return R;case qe:return p;case te:return E;case Te:return v;case Xe:return _}return S});function ma(y){var S=y.length,F=y.constructor(S);return S&&typeof y[0]=="string"&>.call(y,"index")&&(F.index=y.index,F.input=y.input),F}function Hn(y){return typeof y.constructor=="function"&&!H(y)?kr(pt(y)):{}}function mi(y,S,F,U){var Fe=y.constructor;switch(S){case O:return Kn(y);case s:case l:return new Fe(+y);case R:return _n(y,U);case I:case N:case L:case B:case w:case P:case T:case D:case M:return er(y,U);case p:return Gn(y,U,F);case b:case C:return new Fe(y);case g:return Qn(y);case v:return an(y,U,F);case A:return Jr(y)}}function ki(y,S){return S=S??i,!!S&&(typeof y=="number"||Y.test(y))&&y>-1&&y%1==0&&y<S}function ee(y){var S=typeof y;return S=="string"||S=="number"||S=="symbol"||S=="boolean"?y!=="__proto__":y===null}function j(y){return!!_t&&_t in y}function H(y){var S=y&&y.constructor,F=typeof S=="function"&&S.prototype||Ye;return y===F}function $(y){if(y!=null){try{return Ke.call(y)}catch{}try{return y+""}catch{}}return""}function ie(y){return on(y,!0,!0)}function le(y,S){return y===S||y!==y&&S!==S}function Ee(y){return sn(y)&>.call(y,"callee")&&(!tn.call(y,"callee")||Ot.call(y)==o)}var rt=Array.isArray;function ut(y){return y!=null&&zt(y.length)&&!Kr(y)}function sn(y){return Is(y)&&ut(y)}var Jt=nn||gu;function Kr(y){var S=Fr(y)?Ot.call(y):"";return S==c||S==h}function zt(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=i}function Fr(y){var S=typeof y;return!!y&&(S=="object"||S=="function")}function Is(y){return!!y&&typeof y=="object"}function ba(y){return ut(y)?ae(y):Lr(y)}function pu(){return[]}function gu(){return!1}n.exports=ie})(za,za.exports)),za.exports}var Xa={exports:{}};Xa.exports;var Ay;function SE(){return Ay||(Ay=1,(function(n,e){var t=200,r="__lodash_hash_undefined__",i=1,o=2,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",h="[object Date]",p="[object Error]",b="[object Function]",x="[object GeneratorFunction]",E="[object Map]",g="[object Number]",v="[object Null]",C="[object Object]",A="[object Promise]",_="[object Proxy]",O="[object RegExp]",R="[object Set]",I="[object String]",N="[object Symbol]",L="[object Undefined]",B="[object WeakMap]",w="[object ArrayBuffer]",P="[object DataView]",T="[object Float32Array]",D="[object Float64Array]",M="[object Int8Array]",k="[object Int16Array]",V="[object Int32Array]",W="[object Uint8Array]",Y="[object Uint8ClampedArray]",q="[object Uint16Array]",J="[object Uint32Array]",X=/[\\^$.*+?()[\]{}|]/g,Q=/^\[object .+?Constructor\]$/,K=/^(?:0|[1-9]\d*)$/,z={};z[T]=z[D]=z[M]=z[k]=z[V]=z[W]=z[Y]=z[q]=z[J]=!0,z[s]=z[l]=z[w]=z[c]=z[P]=z[h]=z[p]=z[b]=z[E]=z[g]=z[C]=z[O]=z[R]=z[I]=z[B]=!1;var re=typeof sr=="object"&&sr&&sr.Object===Object&&sr,de=typeof self=="object"&&self&&self.Object===Object&&self,oe=re||de||Function("return this")(),be=e&&!e.nodeType&&e,Ne=be&&!0&&n&&!n.nodeType&&n,Pe=Ne&&Ne.exports===be,De=Pe&&re.process,He=(function(){try{return De&&De.binding&&De.binding("util")}catch{}})(),ve=He&&He.isTypedArray;function se(y,S){for(var F=-1,U=y==null?0:y.length,Fe=0,ye=[];++F<U;){var it=y[F];S(it,F,y)&&(ye[Fe++]=it)}return ye}function Me(y,S){for(var F=-1,U=S.length,Fe=y.length;++F<U;)y[Fe+F]=S[F];return y}function Re(y,S){for(var F=-1,U=y==null?0:y.length;++F<U;)if(S(y[F],F,y))return!0;return!1}function nt(y,S){for(var F=-1,U=Array(y);++F<y;)U[F]=S(F);return U}function Ie(y){return function(S){return y(S)}}function Ye(y,S){return y.has(S)}function Ue(y,S){return y?.[S]}function _t(y){var S=-1,F=Array(y.size);return y.forEach(function(U,Fe){F[++S]=[Fe,U]}),F}function Ke(y,S){return function(F){return y(S(F))}}function gt(y){var S=-1,F=Array(y.size);return y.forEach(function(U){F[++S]=U}),F}var Ot=Array.prototype,Pt=Function.prototype,xt=Object.prototype,ot=oe["__core-js_shared__"],mt=Pt.toString,pt=xt.hasOwnProperty,Ct=(function(){var y=/[^.]+$/.exec(ot&&ot.keys&&ot.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""})(),tn=xt.toString,st=RegExp("^"+mt.call(pt).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lt=Pe?oe.Buffer:void 0,nn=oe.Symbol,On=oe.Uint8Array,Lt=xt.propertyIsEnumerable,bt=Ot.splice,jt=nn?nn.toStringTag:void 0,Ce=Object.getOwnPropertySymbols,ce=lt?lt.isBuffer:void 0,Ae=Ke(Object.keys,Object),ze=tr(oe,"DataView"),qe=tr(oe,"Map"),te=tr(oe,"Promise"),Te=tr(oe,"Set"),Xe=tr(oe,"WeakMap"),ht=tr(Object,"create"),ft=$(ze),$e=$(qe),rn=$(te),Cn=$(Te),dr=$(Xe),hr=nn?nn.prototype:void 0,En=hr?hr.valueOf:void 0;function At(y){var S=-1,F=y==null?0:y.length;for(this.clear();++S<F;){var U=y[S];this.set(U[0],U[1])}}function Yr(){this.__data__=ht?ht(null):{},this.size=0}function Zn(y){var S=this.has(y)&&delete this.__data__[y];return this.size-=S?1:0,S}function Nr(y){var S=this.__data__;if(ht){var F=S[y];return F===r?void 0:F}return pt.call(S,y)?S[y]:void 0}function fr(y){var S=this.__data__;return ht?S[y]!==void 0:pt.call(S,y)}function pr(y,S){var F=this.__data__;return this.size+=this.has(y)?0:1,F[y]=ht&&S===void 0?r:S,this}At.prototype.clear=Yr,At.prototype.delete=Zn,At.prototype.get=Nr,At.prototype.has=fr,At.prototype.set=pr;function Vt(y){var S=-1,F=y==null?0:y.length;for(this.clear();++S<F;){var U=y[S];this.set(U[0],U[1])}}function vt(){this.__data__=[],this.size=0}function Jn(y){var S=this.__data__,F=wn(S,y);if(F<0)return!1;var U=S.length-1;return F==U?S.pop():bt.call(S,F,1),--this.size,!0}function Di(y){var S=this.__data__,F=wn(S,y);return F<0?void 0:S[F][1]}function Dr(y){return wn(this.__data__,y)>-1}function Mr(y,S){var F=this.__data__,U=wn(F,y);return U<0?(++this.size,F.push([y,S])):F[U][1]=S,this}Vt.prototype.clear=vt,Vt.prototype.delete=Jn,Vt.prototype.get=Di,Vt.prototype.has=Dr,Vt.prototype.set=Mr;function Wt(y){var S=-1,F=y==null?0:y.length;for(this.clear();++S<F;){var U=y[S];this.set(U[0],U[1])}}function Zr(){this.size=0,this.__data__={hash:new At,map:new(qe||Vt),string:new At}}function Mi(y){var S=qn(this,y).delete(y);return this.size-=S?1:0,S}function ci(y){return qn(this,y).get(y)}function di(y){return qn(this,y).has(y)}function hi(y,S){var F=qn(this,y),U=F.size;return F.set(y,S),this.size+=F.size==U?0:1,this}Wt.prototype.clear=Zr,Wt.prototype.delete=Mi,Wt.prototype.get=ci,Wt.prototype.has=di,Wt.prototype.set=hi;function ae(y){var S=-1,F=y==null?0:y.length;for(this.__data__=new Wt;++S<F;)this.add(y[S])}function Ze(y){return this.__data__.set(y,r),this}function Nt(y){return this.__data__.has(y)}ae.prototype.add=ae.prototype.push=Ze,ae.prototype.has=Nt;function at(y){var S=this.__data__=new Vt(y);this.size=S.size}function on(){this.__data__=new Vt,this.size=0}function kr(y){var S=this.__data__,F=S.delete(y);return this.size=S.size,F}function gr(y){return this.__data__.get(y)}function Pr(y){return this.__data__.has(y)}function fi(y,S){var F=this.__data__;if(F instanceof Vt){var U=F.__data__;if(!qe||U.length<t-1)return U.push([y,S]),this.size=++F.size,this;F=this.__data__=new Wt(U)}return F.set(y,S),this.size=F.size,this}at.prototype.clear=on,at.prototype.delete=kr,at.prototype.get=gr,at.prototype.has=Pr,at.prototype.set=fi;function Lr(y,S){var F=Ee(y),U=!F&&le(y),Fe=!F&&!U&&ut(y),ye=!F&&!U&&!Fe&&Is(y),it=F||U||Fe||ye,Qe=it?nt(y.length,String):[],Xt=Qe.length;for(var ct in y)pt.call(y,ct)&&!(it&&(ct=="length"||Fe&&(ct=="offset"||ct=="parent")||ye&&(ct=="buffer"||ct=="byteLength"||ct=="byteOffset")||mi(ct,Xt)))&&Qe.push(ct);return Qe}function wn(y,S){for(var F=y.length;F--;)if(ie(y[F][0],S))return F;return-1}function Kn(y,S,F){var U=S(y);return Ee(y)?U:Me(U,F(y))}function _n(y){return y==null?y===void 0?L:v:jt&&jt in Object(y)?mr(y):H(y)}function Gn(y){return Fr(y)&&_n(y)==s}function Qn(y,S,F,U,Fe){return y===S?!0:y==null||S==null||!Fr(y)&&!Fr(S)?y!==y&&S!==S:an(y,S,F,U,Qn,Fe)}function an(y,S,F,U,Fe,ye){var it=Ee(y),Qe=Ee(S),Xt=it?l:Hn(y),ct=Qe?l:Hn(S);Xt=Xt==s?C:Xt,ct=ct==s?C:ct;var gn=Xt==C,jn=ct==C,Kt=Xt==ct;if(Kt&&ut(y)){if(!ut(S))return!1;it=!0,gn=!1}if(Kt&&!gn)return ye||(ye=new at),it||Is(y)?gi(y,S,F,U,Fe,ye):po(y,S,Xt,F,U,Fe,ye);if(!(F&i)){var mn=gn&&pt.call(y,"__wrapped__"),cn=jn&&pt.call(S,"__wrapped__");if(mn||cn){var bi=mn?y.value():y,Qr=cn?S.value():S;return ye||(ye=new at),Fe(bi,Qr,F,U,ye)}}return Kt?(ye||(ye=new at),go(y,S,F,U,Fe,ye)):!1}function Jr(y){if(!zt(y)||ee(y))return!1;var S=Jt(y)?st:Q;return S.test($(y))}function er(y){return Fr(y)&&Kr(y.length)&&!!z[_n(y)]}function pi(y){if(!j(y))return Ae(y);var S=[];for(var F in Object(y))pt.call(y,F)&&F!="constructor"&&S.push(F);return S}function gi(y,S,F,U,Fe,ye){var it=F&i,Qe=y.length,Xt=S.length;if(Qe!=Xt&&!(it&&Xt>Qe))return!1;var ct=ye.get(y);if(ct&&ye.get(S))return ct==S;var gn=-1,jn=!0,Kt=F&o?new ae:void 0;for(ye.set(y,S),ye.set(S,y);++gn<Qe;){var mn=y[gn],cn=S[gn];if(U)var bi=it?U(cn,mn,gn,S,y,ye):U(mn,cn,gn,y,S,ye);if(bi!==void 0){if(bi)continue;jn=!1;break}if(Kt){if(!Re(S,function(Qr,Pi){if(!Ye(Kt,Pi)&&(mn===Qr||Fe(mn,Qr,F,U,ye)))return Kt.push(Pi)})){jn=!1;break}}else if(!(mn===cn||Fe(mn,cn,F,U,ye))){jn=!1;break}}return ye.delete(y),ye.delete(S),jn}function po(y,S,F,U,Fe,ye,it){switch(F){case P:if(y.byteLength!=S.byteLength||y.byteOffset!=S.byteOffset)return!1;y=y.buffer,S=S.buffer;case w:return!(y.byteLength!=S.byteLength||!ye(new On(y),new On(S)));case c:case h:case g:return ie(+y,+S);case p:return y.name==S.name&&y.message==S.message;case O:case I:return y==S+"";case E:var Qe=_t;case R:var Xt=U&i;if(Qe||(Qe=gt),y.size!=S.size&&!Xt)return!1;var ct=it.get(y);if(ct)return ct==S;U|=o,it.set(y,S);var gn=gi(Qe(y),Qe(S),U,Fe,ye,it);return it.delete(y),gn;case N:if(En)return En.call(y)==En.call(S)}return!1}function go(y,S,F,U,Fe,ye){var it=F&i,Qe=Br(y),Xt=Qe.length,ct=Br(S),gn=ct.length;if(Xt!=gn&&!it)return!1;for(var jn=Xt;jn--;){var Kt=Qe[jn];if(!(it?Kt in S:pt.call(S,Kt)))return!1}var mn=ye.get(y);if(mn&&ye.get(S))return mn==S;var cn=!0;ye.set(y,S),ye.set(S,y);for(var bi=it;++jn<Xt;){Kt=Qe[jn];var Qr=y[Kt],Pi=S[Kt];if(U)var Fg=it?U(Pi,Qr,Kt,S,y,ye):U(Qr,Pi,Kt,y,S,ye);if(!(Fg===void 0?Qr===Pi||Fe(Qr,Pi,F,U,ye):Fg)){cn=!1;break}bi||(bi=Kt=="constructor")}if(cn&&!bi){var Ss=y.constructor,Rs=S.constructor;Ss!=Rs&&"constructor"in y&&"constructor"in S&&!(typeof Ss=="function"&&Ss instanceof Ss&&typeof Rs=="function"&&Rs instanceof Rs)&&(cn=!1)}return ye.delete(y),ye.delete(S),cn}function Br(y){return Kn(y,ba,ma)}function qn(y,S){var F=y.__data__;return ki(S)?F[typeof S=="string"?"string":"hash"]:F.map}function tr(y,S){var F=Ue(y,S);return Jr(F)?F:void 0}function mr(y){var S=pt.call(y,jt),F=y[jt];try{y[jt]=void 0;var U=!0}catch{}var Fe=tn.call(y);return U&&(S?y[jt]=F:delete y[jt]),Fe}var ma=Ce?function(y){return y==null?[]:(y=Object(y),se(Ce(y),function(S){return Lt.call(y,S)}))}:pu,Hn=_n;(ze&&Hn(new ze(new ArrayBuffer(1)))!=P||qe&&Hn(new qe)!=E||te&&Hn(te.resolve())!=A||Te&&Hn(new Te)!=R||Xe&&Hn(new Xe)!=B)&&(Hn=function(y){var S=_n(y),F=S==C?y.constructor:void 0,U=F?$(F):"";if(U)switch(U){case ft:return P;case $e:return E;case rn:return A;case Cn:return R;case dr:return B}return S});function mi(y,S){return S=S??a,!!S&&(typeof y=="number"||K.test(y))&&y>-1&&y%1==0&&y<S}function ki(y){var S=typeof y;return S=="string"||S=="number"||S=="symbol"||S=="boolean"?y!=="__proto__":y===null}function ee(y){return!!Ct&&Ct in y}function j(y){var S=y&&y.constructor,F=typeof S=="function"&&S.prototype||xt;return y===F}function H(y){return tn.call(y)}function $(y){if(y!=null){try{return mt.call(y)}catch{}try{return y+""}catch{}}return""}function ie(y,S){return y===S||y!==y&&S!==S}var le=Gn((function(){return arguments})())?Gn:function(y){return Fr(y)&&pt.call(y,"callee")&&!Lt.call(y,"callee")},Ee=Array.isArray;function rt(y){return y!=null&&Kr(y.length)&&!Jt(y)}var ut=ce||gu;function sn(y,S){return Qn(y,S)}function Jt(y){if(!zt(y))return!1;var S=_n(y);return S==b||S==x||S==u||S==_}function Kr(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=a}function zt(y){var S=typeof y;return y!=null&&(S=="object"||S=="function")}function Fr(y){return y!=null&&typeof y=="object"}var Is=ve?Ie(ve):er;function ba(y){return rt(y)?Lr(y):pi(y)}function pu(){return[]}function gu(){return!1}n.exports=sn})(Xa,Xa.exports)),Xa.exports}var Ws={},Ty;function iM(){if(Ty)return Ws;Ty=1,Object.defineProperty(Ws,"__esModule",{value:!0});const n=IE(),e=SE();var t;return(function(r){function i(l={},u={},c=!1){typeof l!="object"&&(l={}),typeof u!="object"&&(u={});let h=n(u);c||(h=Object.keys(h).reduce((p,b)=>(h[b]!=null&&(p[b]=h[b]),p),{}));for(const p in l)l[p]!==void 0&&u[p]===void 0&&(h[p]=l[p]);return Object.keys(h).length>0?h:void 0}r.compose=i;function o(l={},u={}){typeof l!="object"&&(l={}),typeof u!="object"&&(u={});const c=Object.keys(l).concat(Object.keys(u)).reduce((h,p)=>(e(l[p],u[p])||(h[p]=u[p]===void 0?null:u[p]),h),{});return Object.keys(c).length>0?c:void 0}r.diff=o;function a(l={},u={}){l=l||{};const c=Object.keys(u).reduce((h,p)=>(u[p]!==l[p]&&l[p]!==void 0&&(h[p]=u[p]),h),{});return Object.keys(l).reduce((h,p)=>(l[p]!==u[p]&&u[p]===void 0&&(h[p]=null),h),c)}r.invert=a;function s(l,u,c=!1){if(typeof l!="object")return u;if(typeof u!="object")return;if(!c)return u;const h=Object.keys(u).reduce((p,b)=>(l[b]===void 0&&(p[b]=u[b]),p),{});return Object.keys(h).length>0?h:void 0}r.transform=s})(t||(t={})),Ws.default=t,Ws}var zs={},Iy;function RE(){if(Iy)return zs;Iy=1,Object.defineProperty(zs,"__esModule",{value:!0});var n;return(function(e){function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t})(n||(n={})),zs.default=n,zs}var Xs={},Sy;function oM(){if(Sy)return Xs;Sy=1,Object.defineProperty(Xs,"__esModule",{value:!0});const n=RE();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const i=this.ops[this.index];if(i){const o=this.offset,a=n.default.length(i);if(r>=a-o?(r=a-o,this.index+=1,this.offset=0):this.offset+=r,typeof i.delete=="number")return{delete:r};{const s={};return i.attributes&&(s.attributes=i.attributes),typeof i.retain=="number"?s.retain=r:typeof i.retain=="object"&&i.retain!==null?s.retain=i.retain:typeof i.insert=="string"?s.insert=i.insert.substr(o,r):s.insert=i.insert,s}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,i=this.index,o=this.next(),a=this.ops.slice(this.index);return this.offset=r,this.index=i,[o].concat(a)}}else return[]}}return Xs.default=e,Xs}var Ry;function aM(){return Ry||(Ry=1,(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=rM(),r=IE(),i=SE(),o=iM();e.AttributeMap=o.default;const a=RE();e.Op=a.default;const s=oM();e.OpIterator=s.default;const l="\0",u=(h,p)=>{if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);if(typeof p!="object"||p===null)throw new Error(`cannot retain a ${typeof p}`);const b=Object.keys(h)[0];if(!b||b!==Object.keys(p)[0])throw new Error(`embed types not matched: ${b} != ${Object.keys(p)[0]}`);return[b,h[b],p[b]]};class c{constructor(p){Array.isArray(p)?this.ops=p:p!=null&&Array.isArray(p.ops)?this.ops=p.ops:this.ops=[]}static registerEmbed(p,b){this.handlers[p]=b}static unregisterEmbed(p){delete this.handlers[p]}static getHandler(p){const b=this.handlers[p];if(!b)throw new Error(`no handlers for embed type "${p}"`);return b}insert(p,b){const x={};return typeof p=="string"&&p.length===0?this:(x.insert=p,b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(x.attributes=b),this.push(x))}delete(p){return p<=0?this:this.push({delete:p})}retain(p,b){if(typeof p=="number"&&p<=0)return this;const x={retain:p};return b!=null&&typeof b=="object"&&Object.keys(b).length>0&&(x.attributes=b),this.push(x)}push(p){let b=this.ops.length,x=this.ops[b-1];if(p=r(p),typeof x=="object"){if(typeof p.delete=="number"&&typeof x.delete=="number")return this.ops[b-1]={delete:x.delete+p.delete},this;if(typeof x.delete=="number"&&p.insert!=null&&(b-=1,x=this.ops[b-1],typeof x!="object"))return this.ops.unshift(p),this;if(i(p.attributes,x.attributes)){if(typeof p.insert=="string"&&typeof x.insert=="string")return this.ops[b-1]={insert:x.insert+p.insert},typeof p.attributes=="object"&&(this.ops[b-1].attributes=p.attributes),this;if(typeof p.retain=="number"&&typeof x.retain=="number")return this.ops[b-1]={retain:x.retain+p.retain},typeof p.attributes=="object"&&(this.ops[b-1].attributes=p.attributes),this}}return b===this.ops.length?this.ops.push(p):this.ops.splice(b,0,p),this}chop(){const p=this.ops[this.ops.length-1];return p&&typeof p.retain=="number"&&!p.attributes&&this.ops.pop(),this}filter(p){return this.ops.filter(p)}forEach(p){this.ops.forEach(p)}map(p){return this.ops.map(p)}partition(p){const b=[],x=[];return this.forEach(E=>{(p(E)?b:x).push(E)}),[b,x]}reduce(p,b){return this.ops.reduce(p,b)}changeLength(){return this.reduce((p,b)=>b.insert?p+a.default.length(b):b.delete?p-b.delete:p,0)}length(){return this.reduce((p,b)=>p+a.default.length(b),0)}slice(p=0,b=1/0){const x=[],E=new s.default(this.ops);let g=0;for(;g<b&&E.hasNext();){let v;g<p?v=E.next(p-g):(v=E.next(b-g),x.push(v)),g+=a.default.length(v)}return new c(x)}compose(p){const b=new s.default(this.ops),x=new s.default(p.ops),E=[],g=x.peek();if(g!=null&&typeof g.retain=="number"&&g.attributes==null){let C=g.retain;for(;b.peekType()==="insert"&&b.peekLength()<=C;)C-=b.peekLength(),E.push(b.next());g.retain-C>0&&x.next(g.retain-C)}const v=new c(E);for(;b.hasNext()||x.hasNext();)if(x.peekType()==="insert")v.push(x.next());else if(b.peekType()==="delete")v.push(b.next());else{const C=Math.min(b.peekLength(),x.peekLength()),A=b.next(C),_=x.next(C);if(_.retain){const O={};if(typeof A.retain=="number")O.retain=typeof _.retain=="number"?C:_.retain;else if(typeof _.retain=="number")A.retain==null?O.insert=A.insert:O.retain=A.retain;else{const I=A.retain==null?"insert":"retain",[N,L,B]=u(A[I],_.retain),w=c.getHandler(N);O[I]={[N]:w.compose(L,B,I==="retain")}}const R=o.default.compose(A.attributes,_.attributes,typeof A.retain=="number");if(R&&(O.attributes=R),v.push(O),!x.hasNext()&&i(v.ops[v.ops.length-1],O)){const I=new c(b.rest());return v.concat(I).chop()}}else typeof _.delete=="number"&&(typeof A.retain=="number"||typeof A.retain=="object"&&A.retain!==null)&&v.push(_)}return v.chop()}concat(p){const b=new c(this.ops.slice());return p.ops.length>0&&(b.push(p.ops[0]),b.ops=b.ops.concat(p.ops.slice(1))),b}diff(p,b){if(this.ops===p.ops)return new c;const x=[this,p].map(A=>A.map(_=>{if(_.insert!=null)return typeof _.insert=="string"?_.insert:l;const O=A===p?"on":"with";throw new Error("diff() called "+O+" non-document")}).join("")),E=new c,g=t(x[0],x[1],b,!0),v=new s.default(this.ops),C=new s.default(p.ops);return g.forEach(A=>{let _=A[1].length;for(;_>0;){let O=0;switch(A[0]){case t.INSERT:O=Math.min(C.peekLength(),_),E.push(C.next(O));break;case t.DELETE:O=Math.min(_,v.peekLength()),v.next(O),E.delete(O);break;case t.EQUAL:O=Math.min(v.peekLength(),C.peekLength(),_);const R=v.next(O),I=C.next(O);i(R.insert,I.insert)?E.retain(O,o.default.diff(R.attributes,I.attributes)):E.push(I).delete(O);break}_-=O}}),E.chop()}eachLine(p,b=`
|
|
78
|
+
`){const x=new s.default(this.ops);let E=new c,g=0;for(;x.hasNext();){if(x.peekType()!=="insert")return;const v=x.peek(),C=a.default.length(v)-x.peekLength(),A=typeof v.insert=="string"?v.insert.indexOf(b,C)-C:-1;if(A<0)E.push(x.next());else if(A>0)E.push(x.next(A));else{if(p(E,x.next(1).attributes||{},g)===!1)return;g+=1,E=new c}}E.length()>0&&p(E,{},g)}invert(p){const b=new c;return this.reduce((x,E)=>{if(E.insert)b.delete(a.default.length(E));else{if(typeof E.retain=="number"&&E.attributes==null)return b.retain(E.retain),x+E.retain;if(E.delete||typeof E.retain=="number"){const g=E.delete||E.retain;return p.slice(x,x+g).forEach(C=>{E.delete?b.push(C):E.retain&&E.attributes&&b.retain(a.default.length(C),o.default.invert(E.attributes,C.attributes))}),x+g}else if(typeof E.retain=="object"&&E.retain!==null){const g=p.slice(x,x+1),v=new s.default(g.ops).next(),[C,A,_]=u(E.retain,v.insert),O=c.getHandler(C);return b.retain({[C]:O.invert(A,_)},o.default.invert(E.attributes,v.attributes)),x+1}}return x},0),b.chop()}transform(p,b=!1){if(b=!!b,typeof p=="number")return this.transformPosition(p,b);const x=p,E=new s.default(this.ops),g=new s.default(x.ops),v=new c;for(;E.hasNext()||g.hasNext();)if(E.peekType()==="insert"&&(b||g.peekType()!=="insert"))v.retain(a.default.length(E.next()));else if(g.peekType()==="insert")v.push(g.next());else{const C=Math.min(E.peekLength(),g.peekLength()),A=E.next(C),_=g.next(C);if(A.delete)continue;if(_.delete)v.push(_);else{const O=A.retain,R=_.retain;let I=typeof R=="object"&&R!==null?R:C;if(typeof O=="object"&&O!==null&&typeof R=="object"&&R!==null){const N=Object.keys(O)[0];if(N===Object.keys(R)[0]){const L=c.getHandler(N);L&&(I={[N]:L.transform(O[N],R[N],b)})}}v.retain(I,o.default.transform(A.attributes,_.attributes,b))}}return v.chop()}transformPosition(p,b=!1){b=!!b;const x=new s.default(this.ops);let E=0;for(;x.hasNext()&&E<=p;){const g=x.peekLength(),v=x.peekType();if(x.next(),v==="delete"){p-=Math.min(g,p-E);continue}else v==="insert"&&(E<p||!b)&&(p+=g);E+=g}return p}}c.Op=a.default,c.OpIterator=s.default,c.AttributeMap=o.default,c.handlers={},e.default=c,n.exports=c,n.exports.default=c})(Vs,Vs.exports)),Vs.exports}var lr=aM();const fe=eo(lr);class jr extends Yn{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}jr.blotName="break";jr.tagName="BR";let Sr=class extends _l{};const sM={"&":"&","<":"<",">":">",'"':""","'":"'"};function au(n){return n.replace(/[&<>"']/g,e=>sM[e])}class Tn extends hg{static allowedChildren=[Tn,jr,Yn,Sr];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const r=Tn.order.indexOf(e),i=Tn.order.indexOf(t);return r>=0||i>=0?r-i:e===t?0:e<t?-1:1}formatAt(e,t,r,i){if(Tn.compare(this.statics.blotName,r)<0&&this.scroll.query(r,ge.BLOT)){const o=this.isolate(e,t);i&&o.wrap(r,i)}else super.formatAt(e,t,r,i)}optimize(e){if(super.optimize(e),this.parent instanceof Tn&&Tn.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}const Oy=1;class pn extends ls{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=OE(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,r,i){t<=0||(this.scroll.query(r,ge.BLOCK)?e+t===this.length()&&this.format(r,i):super.formatAt(e,Math.min(t,this.length()-e-1),r,i),this.cache={})}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r),this.cache={};return}if(t.length===0)return;const i=t.split(`
|
|
79
|
+
`),o=i.shift();o.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),o):this.children.tail.insertAt(this.children.tail.length(),o),this.cache={});let a=this;i.reduce((s,l)=>(a=a.split(s,!0),a.insertAt(0,l),l.length),e+o.length)}insertBefore(e,t){const{head:r}=this.children;super.insertBefore(e,t),r instanceof jr&&r.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Oy),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]:!1;if(t&&(e===0||e>=this.length()-Oy)){const i=this.clone();return e===0?(this.parent.insertBefore(i,this),this):(this.parent.insertBefore(i,this.next),i)}const r=super.split(e,t);return this.cache={},r}}pn.blotName="block";pn.tagName="P";pn.defaultChild=jr;pn.allowedChildren=[jr,Tn,Yn,Sr];class ar extends Yn{attach(){super.attach(),this.attributes=new iu(this.domNode)}delta(){return new fe().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,ge.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,t)}formatAt(e,t,r,i){this.format(r,i)}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r);return}const i=t.split(`
|
|
80
|
+
`),o=i.pop(),a=i.map(l=>{const u=this.scroll.create(pn.blotName);return u.insertAt(0,l),u}),s=this.split(e);a.forEach(l=>{this.parent.insertBefore(l,s)}),o&&this.parent.insertBefore(this.scroll.create("text",o),s)}}ar.scope=ge.BLOCK_BLOT;function OE(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(yn).reduce((t,r)=>r.length()===0?t:t.insert(r.value(),rr(r,{},e)),new fe).insert(`
|
|
81
|
+
`,rr(n))}function rr(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:rr(n.parent,e,t)}class wr extends Yn{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\uFEFF";static value(){}constructor(e,t,r){super(e,t),this.selection=r,this.textNode=document.createTextNode(wr.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let r=this,i=0;for(;r!=null&&r.statics.scope!==ge.BLOCK_BLOT;)i+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=wr.CONTENTS.length,r.optimize(),r.formatAt(i,wr.CONTENTS.length,e,t),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;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof Sr?this.prev:null,r=t?t.length():0,i=this.next instanceof Sr?this.next:null,o=i?i.text:"",{textNode:a}=this,s=a.data.split(wr.CONTENTS).join("");a.data=wr.CONTENTS;let l;if(t)l=t,(s||i)&&(t.insertAt(t.length(),s+o),i&&i.remove());else if(i)l=i,i.insertAt(0,s);else{const u=document.createTextNode(s);l=this.scroll.create(u),this.parent.insertBefore(l,this)}if(this.remove(),e){const u=(p,b)=>t&&p===t.domNode?b:p===a?r+b-1:i&&p===i.domNode?r+s.length+b:null,c=u(e.start.node,e.start.offset),h=u(e.end.node,e.end.offset);if(c!==null&&h!==null)return{startNode:l.domNode,startOffset:c,endNode:l.domNode,endOffset:h}}return null}update(e,t){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=wr.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var Lh={exports:{}},jy;function lM(){return jy||(jy=1,(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function i(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function o(l,u,c,h,p){if(typeof c!="function")throw new TypeError("The listener must be a function");var b=new i(c,h||l,p),x=t?t+u:u;return l._events[x]?l._events[x].fn?l._events[x]=[l._events[x],b]:l._events[x].push(b):(l._events[x]=b,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],c,h;if(this._eventsCount===0)return u;for(h in c=this._events)e.call(c,h)&&u.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},s.prototype.listeners=function(u){var c=t?t+u:u,h=this._events[c];if(!h)return[];if(h.fn)return[h.fn];for(var p=0,b=h.length,x=new Array(b);p<b;p++)x[p]=h[p].fn;return x},s.prototype.listenerCount=function(u){var c=t?t+u:u,h=this._events[c];return h?h.fn?1:h.length:0},s.prototype.emit=function(u,c,h,p,b,x){var E=t?t+u:u;if(!this._events[E])return!1;var g=this._events[E],v=arguments.length,C,A;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),v){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,c),!0;case 3:return g.fn.call(g.context,c,h),!0;case 4:return g.fn.call(g.context,c,h,p),!0;case 5:return g.fn.call(g.context,c,h,p,b),!0;case 6:return g.fn.call(g.context,c,h,p,b,x),!0}for(A=1,C=new Array(v-1);A<v;A++)C[A-1]=arguments[A];g.fn.apply(g.context,C)}else{var _=g.length,O;for(A=0;A<_;A++)switch(g[A].once&&this.removeListener(u,g[A].fn,void 0,!0),v){case 1:g[A].fn.call(g[A].context);break;case 2:g[A].fn.call(g[A].context,c);break;case 3:g[A].fn.call(g[A].context,c,h);break;case 4:g[A].fn.call(g[A].context,c,h,p);break;default:if(!C)for(O=1,C=new Array(v-1);O<v;O++)C[O-1]=arguments[O];g[A].fn.apply(g[A].context,C)}}return!0},s.prototype.on=function(u,c,h){return o(this,u,c,h,!1)},s.prototype.once=function(u,c,h){return o(this,u,c,h,!0)},s.prototype.removeListener=function(u,c,h,p){var b=t?t+u:u;if(!this._events[b])return this;if(!c)return a(this,b),this;var x=this._events[b];if(x.fn)x.fn===c&&(!p||x.once)&&(!h||x.context===h)&&a(this,b);else{for(var E=0,g=[],v=x.length;E<v;E++)(x[E].fn!==c||p&&!x[E].once||h&&x[E].context!==h)&&g.push(x[E]);g.length?this._events[b]=g.length===1?g[0]:g:a(this,b)}return this},s.prototype.removeAllListeners=function(u){var c;return u?(c=t?t+u:u,this._events[c]&&a(this,c)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=t,s.EventEmitter=s,n.exports=s})(Lh)),Lh.exports}var uM=lM();const cM=eo(uM),Ff=new WeakMap,Gf=["error","warn","log","info"];let qf="warn";function jE(n){if(qf&&Gf.indexOf(n)<=Gf.indexOf(qf)){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];console[n](...t)}}function ui(n){return Gf.reduce((e,t)=>(e[t]=jE.bind(console,t,n),e),{})}ui.level=n=>{qf=n};jE.level=ui.level;const Bh=ui("quill:events"),dM=["selectionchange","mousedown","mouseup","click"];dM.forEach(n=>{document.addEventListener(n,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(i=>{const o=Ff.get(i);o&&o.emitter&&o.emitter.handleDOM(...t)})})});class ue extends cM{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",Bh.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Bh.log.call(Bh,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];(this.domListeners[e.type]||[]).forEach(o=>{let{node:a,handler:s}=o;(e.target===a||a.contains(e.target))&&s(e,...r)})}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}const Fh=ui("quill:selection");class Zi{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class hM{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 Zi(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,ue.sources.USER),1)}),this.emitter.on(ue.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(ue.events.SCROLL_UPDATE,(i,o)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const a=o.some(s=>s.type==="characterData"||s.type==="childList"||s.type==="attributes"&&s.target===this.root);this.update(a?ue.sources.SILENT:i)}catch{}})}),this.emitter.on(ue.events.SCROLL_OPTIMIZE,(r,i)=>{if(i.range){const{startNode:o,startOffset:a,endNode:s,endOffset:l}=i.range;this.setNativeRange(o,a,s,l),this.update(ue.sources.SILENT)}}),this.update(ue.sources.SILENT)}handleComposition(){this.emitter.on(ue.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(ue.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const 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(ue.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,ge.BLOCK))){if(r.start.node!==this.cursor.textNode){const i=this.scroll.find(r.start.node,!1);if(i==null)return;if(i instanceof yn){const o=i.split(r.start.offset);i.parent.insertBefore(this.cursor,o)}else i.insertBefore(this.cursor,r.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;const r=this.scroll.length();e=Math.min(e,r-1),t=Math.min(e+t,r-1)-e;let i,[o,a]=this.scroll.leaf(e);if(o==null)return null;if(t>0&&a===o.length()){const[c]=this.scroll.leaf(e+1);if(c){const[h]=this.scroll.line(e),[p]=this.scroll.line(e+1);h===p&&(o=c,a=0)}}[i,a]=o.position(a,!0);const s=document.createRange();if(t>0)return s.setStart(i,a),[o,a]=this.scroll.leaf(e+t),o==null?null:([i,a]=o.position(a,!0),s.setEnd(i,a),s.getBoundingClientRect());let l="left",u;if(i instanceof Text){if(!i.data.length)return null;a<i.data.length?(s.setStart(i,a),s.setEnd(i,a+1)):(s.setStart(i,a-1),s.setEnd(i,a),l="right"),u=s.getBoundingClientRect()}else{if(!(o.domNode instanceof Element))return null;u=o.domNode.getBoundingClientRect(),a>0&&(l="right")}return{bottom:u.top+u.height,height:u.height,left:u[l],right:u[l],top:u.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const r=this.normalizeNative(t);return Fh.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Gh(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const r=t.map(a=>{const[s,l]=a,u=this.scroll.find(s,!0),c=u.offset(this.scroll);return l===0?c:u instanceof yn?c+u.index(s,l):c+u.length()}),i=Math.min(Math.max(...r),this.scroll.length()-1),o=Math.min(i,...r);return new Zi(o,i-o)}normalizeNative(e){if(!Gh(this.root,e.startContainer)||!e.collapsed&&!Gh(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(r=>{let{node:i,offset:o}=r;for(;!(i instanceof Text)&&i.childNodes.length>0;)if(i.childNodes.length>o)i=i.childNodes[o],o=0;else if(i.childNodes.length===o)i=i.lastChild,i instanceof Text?o=i.data.length:i.childNodes.length>0?o=i.childNodes.length:o=i.childNodes.length+1;else break;r.node=i,r.offset=o}),t}rangeToNative(e){const t=this.scroll.length(),r=(i,o)=>{i=Math.min(t-1,i);const[a,s]=this.scroll.leaf(i);return a?a.position(s,o):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Fh.info("setNativeRange",e,t,r,i),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:s}=this.getNativeRange()||{};if(s==null||o||e!==s.startContainer||t!==s.startOffset||r!==s.endContainer||i!==s.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(i=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const l=document.createRange();l.setStart(e,t),l.setEnd(r,i),a.removeAllRanges(),a.addRange(l)}}else a.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ue.sources.API;if(typeof t=="string"&&(r=t,t=!1),Fh.info("setRange",e),e!=null){const i=this.rangeToNative(e);this.setNativeRange(...i,t)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ue.sources.USER;const t=this.lastRange,[r,i]=this.getRange();if(this.lastRange=r,this.lastNative=i,this.lastRange!=null&&(this.savedRange=this.lastRange),!wi(t,this.lastRange)){if(!this.composing&&i!=null&&i.native.collapsed&&i.start.node!==this.cursor.textNode){const a=this.cursor.restore();a&&this.setNativeRange(a.startNode,a.startOffset,a.endNode,a.endOffset)}const o=[ue.events.SELECTION_CHANGE,Ko(this.lastRange),Ko(t),e];this.emitter.emit(ue.events.EDITOR_CHANGE,...o),e!==ue.sources.SILENT&&this.emitter.emit(...o)}}}function Gh(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const fM=/^[ -~]*$/;class pM{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=Ny(e),i=new fe;return mM(r.ops.slice()).reduce((a,s)=>{const l=lr.Op.length(s);let u=s.attributes||{},c=!1,h=!1;if(s.insert!=null){if(i.retain(l),typeof s.insert=="string"){const x=s.insert;h=!x.endsWith(`
|
|
82
|
+
`)&&(t<=a||!!this.scroll.descendant(ar,a)[0]),this.scroll.insertAt(a,x);const[E,g]=this.scroll.line(a);let v=qt({},rr(E));if(E instanceof pn){const[C]=E.descendant(yn,g);C&&(v=qt(v,rr(C)))}u=lr.AttributeMap.diff(v,u)||{}}else if(typeof s.insert=="object"){const x=Object.keys(s.insert)[0];if(x==null)return a;const E=this.scroll.query(x,ge.INLINE)!=null;if(E)(t<=a||this.scroll.descendant(ar,a)[0])&&(h=!0);else if(a>0){const[g,v]=this.scroll.descendant(yn,a-1);g instanceof Sr?g.value()[v]!==`
|
|
83
|
+
`&&(c=!0):g instanceof Yn&&g.statics.scope===ge.INLINE_BLOT&&(c=!0)}if(this.scroll.insertAt(a,x,s.insert[x]),E){const[g]=this.scroll.descendant(yn,a);if(g){const v=qt({},rr(g));u=lr.AttributeMap.diff(v,u)||{}}}}t+=l}else if(i.push(s),s.retain!==null&&typeof s.retain=="object"){const x=Object.keys(s.retain)[0];if(x==null)return a;this.scroll.updateEmbedAt(a,x,s.retain[x])}Object.keys(u).forEach(x=>{this.scroll.formatAt(a,l,x,u[x])});const p=c?1:0,b=h?1:0;return t+=p+b,i.retain(p),i.delete(b),a+l+p+b},0),i.reduce((a,s)=>typeof s.delete=="number"?(this.scroll.deleteAt(a,s.delete),a):a+lr.Op.length(s),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new fe().retain(e).delete(t))}formatLine(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(o=>{this.scroll.lines(e,Math.max(t,1)).forEach(a=>{a.format(o,r[o])})}),this.scroll.optimize();const i=new fe().retain(e).retain(t,Ko(r));return this.update(i)}formatText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(o=>{this.scroll.formatAt(e,t,o,r[o])});const i=new fe().retain(e).retain(t,Ko(r));return this.update(i)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new fe)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],i=[];t===0?this.scroll.path(e).forEach(s=>{const[l]=s;l instanceof pn?r.push(l):l instanceof yn&&i.push(l)}):(r=this.scroll.lines(e,t),i=this.scroll.descendants(yn,e,t));const[o,a]=[r,i].map(s=>{const l=s.shift();if(l==null)return{};let u=rr(l);for(;Object.keys(u).length>0;){const c=s.shift();if(c==null)return u;u=gM(rr(c),u)}return u});return{...o,...a}}getHTML(e,t){const[r,i]=this.scroll.line(e);if(r){const o=r.length();return r.length()>=i+t&&!(i===0&&t===o)?us(r,i,t,!0):us(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(e,t){const r=Ny(t),i=new fe().retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(i)}insertEmbed(e,t,r){return this.scroll.insertAt(e,t,r),this.update(new fe().retain(e).insert({[t]:r}))}insertText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
|
|
84
84
|
`).replace(/\r/g,`
|
|
85
|
-
`),this.scroll.insertAt(e,t),Object.keys(r).forEach(i=>{this.scroll.formatAt(e,t.length,i,r[i])}),this.update(new fe().retain(e).insert(t,
|
|
86
|
-
`));const u=this.getContents(e,t+a).diff(new fe().insert(r).concat(s)),c=new fe().retain(e).concat(u);return this.applyDelta(c)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const i=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(
|
|
85
|
+
`),this.scroll.insertAt(e,t),Object.keys(r).forEach(i=>{this.scroll.formatAt(e,t.length,i,r[i])}),this.update(new fe().retain(e).insert(t,Ko(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==pn.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof jr}removeFormat(e,t){const r=this.getText(e,t),[i,o]=this.scroll.line(e+t);let a=0,s=new fe;i!=null&&(a=i.length()-o,s=i.delta().slice(o,o+a-1).insert(`
|
|
86
|
+
`));const u=this.getContents(e,t+a).diff(new fe().insert(r).concat(s)),c=new fe().retain(e).concat(u);return this.applyDelta(c)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const i=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(fM)&&this.scroll.find(t[0].target)){const o=this.scroll.find(t[0].target),a=rr(o),s=o.offset(this.scroll),l=t[0].oldValue.replace(wr.CONTENTS,""),u=new fe().insert(l),c=new fe().insert(o.value()),h=r&&{oldRange:Dy(r.oldRange,-s),newRange:Dy(r.newRange,-s)};e=new fe().retain(s).concat(u.diff(c,h)).reduce((b,x)=>x.insert?b.insert(x.insert,a):b.push(x),new fe),this.delta=i.compose(e)}else this.delta=this.getDelta(),(!e||!wi(i.compose(e),this.delta))&&(e=i.diff(this.delta,r));return e}}function Yo(n,e,t){if(n.length===0){const[b]=qh(t.pop());return e<=0?`</li></${b}>`:`</li></${b}>${Yo([],e-1,t)}`}const[{child:r,offset:i,length:o,indent:a,type:s},...l]=n,[u,c]=qh(s);if(a>e)return t.push(s),a===e+1?`<${u}><li${c}>${us(r,i,o)}${Yo(l,a,t)}`:`<${u}><li>${Yo(n,e+1,t)}`;const h=t[t.length-1];if(a===e&&s===h)return`</li><li${c}>${us(r,i,o)}${Yo(l,a,t)}`;const[p]=qh(t.pop());return`</li></${p}>${Yo(n,e-1,t)}`}function us(n,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in n&&typeof n.html=="function")return n.html(e,t);if(n instanceof Sr)return au(n.value().slice(e,e+t)).replaceAll(" "," ");if(n instanceof Ir){if(n.statics.blotName==="list-container"){const u=[];return n.children.forEachAt(e,t,(c,h,p)=>{const b="formats"in c&&typeof c.formats=="function"?c.formats():{};u.push({child:c,offset:h,length:p,indent:b.indent||0,type:b.list})}),Yo(u,-1,[])}const i=[];if(n.children.forEachAt(e,t,(u,c,h)=>{i.push(us(u,c,h))}),r||n.statics.blotName==="list")return i.join("");const{outerHTML:o,innerHTML:a}=n.domNode,[s,l]=o.split(`>${a}<`);return s==="<table"?`<table style="border: 1px solid #000;">${i.join("")}<${l}`:`${s}>${i.join("")}<${l}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function gM(n,e){return Object.keys(e).reduce((t,r)=>{if(n[r]==null)return t;const i=e[r];return i===n[r]?t[r]=i:Array.isArray(i)?i.indexOf(n[r])<0?t[r]=i.concat([n[r]]):t[r]=i:t[r]=[i,n[r]],t},{})}function qh(n){const e=n==="ordered"?"ol":"ul";switch(n){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function Ny(n){return n.reduce((e,t)=>{if(typeof t.insert=="string"){const r=t.insert.replace(/\r\n/g,`
|
|
87
87
|
`).replace(/\r/g,`
|
|
88
|
-
`);return e.insert(r,t.attributes)}return e.push(t)},new fe)}function
|
|
88
|
+
`);return e.insert(r,t.attributes)}return e.push(t)},new fe)}function Dy(n,e){let{index:t,length:r}=n;return new Zi(t+e,r)}function mM(n){const e=[];return n.forEach(t=>{typeof t.insert=="string"?t.insert.split(`
|
|
89
89
|
`).forEach((i,o)=>{o&&e.push({insert:`
|
|
90
|
-
`,attributes:t.attributes}),i&&e.push({insert:i,attributes:t.attributes})}):e.push(t)}),e}class
|
|
91
|
-
`});this.setContents(a)}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"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,r){return[e,t,,r]=
|
|
92
|
-
`)?i.insertAt(0,t.slice(0,-1),r):i.insertAt(0,t,r)}else{const i=this.scroll.create(t,r);this.appendChild(i)}else super.insertAt(e,t,r);this.optimize()}insertBefore(e,t){if(e.statics.scope===
|
|
93
|
-
`))),i=r.pop();if(i==null)return;this.batchStart();const o=r.shift();if(o){const l=o.type==="block"&&(o.delta.length()===0||!this.descendant(
|
|
94
|
-
`);const
|
|
95
|
-
`);a.slice(0,-1).forEach(l=>{r.insert(l,i.attributes),t.push({type:"block",delta:r,attributes:i.attributes??{}}),r=new fe});const s=a[a.length-1];s&&r.insert(s,i.attributes)}else{const a=Object.keys(o)[0];if(!a)return;this.query(a,
|
|
90
|
+
`,attributes:t.attributes}),i&&e.push({insert:i,attributes:t.attributes})}):e.push(t)}),e}class Ur{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}const Us="\uFEFF";class pg extends Yn{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(Us),this.rightGuard=document.createTextNode(Us),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,r;const i=e.data.split(Us).join("");if(e===this.leftGuard)if(this.prev instanceof Sr){const o=this.prev.length();this.prev.insertAt(o,i),t={startNode:this.prev.domNode,startOffset:o+i.length}}else r=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(r),this),t={startNode:r,startOffset:i.length};else e===this.rightGuard&&(this.next instanceof Sr?(this.next.insertAt(0,i),t={startNode:this.next.domNode,startOffset:i.length}):(r=document.createTextNode(i),this.parent.insertBefore(this.scroll.create(r),this.next),t={startNode:r,startOffset:i.length}));return e.data=Us,t}update(e,t){e.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const i=this.restore(r.target);i&&(t.range=i)}})}}class bM{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){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof pg)&&(this.emitter.emit(ue.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(ue.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(ue.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(ue.events.COMPOSITION_END,e),this.isComposing=!1}}class ga{static DEFAULTS={modules:{}};static themes={default:ga};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]==null&&this.addModule(e)})}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const vM=n=>n.parentElement||n.getRootNode().host||null,yM=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,r="offsetHeight"in n&&Math.abs(e.height)/n.offsetHeight||1;return{top:e.top,right:e.left+n.clientWidth*t,bottom:e.top+n.clientHeight*r,left:e.left}},$s=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},My=(n,e,t,r,i,o)=>n<t&&e>r?0:n<t?-(t-n+i):e>r?e-n>r-t?n+i-t:e-r+o:0,xM=(n,e)=>{const t=n.ownerDocument;let r=e,i=n;for(;i;){const o=i===t.body,a=o?{top:0,right:window.visualViewport?.width??t.documentElement.clientWidth,bottom:window.visualViewport?.height??t.documentElement.clientHeight,left:0}:yM(i),s=getComputedStyle(i),l=My(r.left,r.right,a.left,a.right,$s(s.scrollPaddingLeft),$s(s.scrollPaddingRight)),u=My(r.top,r.bottom,a.top,a.bottom,$s(s.scrollPaddingTop),$s(s.scrollPaddingBottom));if(l||u)if(o)t.defaultView?.scrollBy(l,u);else{const{scrollLeft:c,scrollTop:h}=i;u&&(i.scrollTop+=u),l&&(i.scrollLeft+=l);const p=i.scrollLeft-c,b=i.scrollTop-h;r={left:r.left-p,top:r.top-b,right:r.right-p,bottom:r.bottom-b}}i=o||s.position==="fixed"?null:vM(i)}},CM=100,EM=["block","break","cursor","inline","scroll","text"],wM=(n,e,t)=>{const r=new ua;return EM.forEach(i=>{const o=e.query(i);o&&r.register(o)}),n.forEach(i=>{let o=e.query(i);o||t.error(`Cannot register "${i}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;o;)if(r.register(o),o="blotName"in o?o.requiredContainer??null:null,a+=1,a>CM){t.error(`Cycle detected in registering blot requiredContainer: "${i}"`);break}}),r},ea=ui("quill"),Ys=new ua;Ir.uiClass="ql-ui";class Z{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Ys,theme:"default"};static events=ue.events;static sources=ue.sources;static version="2.0.3";static imports={delta:fe,parchment:nM,"core/module":Ur,"core/theme":ga};static debug(e){e===!0&&(e="log"),ui.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Ff.get(e)||Ys.find(e,t)}static import(e){return this.imports[e]==null&&ea.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"){const e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,t):Object.keys(e).forEach(i=>{this.register(i,e[i],t)})}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&ea.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&Ys.register(t),typeof t.register=="function"&&t.register(Ys)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=_M(e,t),this.container=this.options.container,this.container==null){ea.error("Invalid Quill container",e);return}this.options.debug&&Z.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Ff.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new ue;const i=fg.blotName,o=this.options.registry.query(i);if(!o||!("blotName"in o))throw new Error(`Cannot initialize Quill without "${i}" blot`);if(this.scroll=new o(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new pM(this.scroll),this.selection=new hM(this.scroll,this.emitter),this.composition=new bM(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(ue.events.EDITOR_CHANGE,a=>{a===ue.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(ue.events.SCROLL_UPDATE,(a,s)=>{const l=this.selection.lastRange,[u]=this.selection.getRange(),c=l&&u?{oldRange:l,newRange:u}:void 0;yr.call(this,()=>this.editor.update(null,s,c),a)}),this.emitter.on(ue.events.SCROLL_EMBED_UPDATE,(a,s)=>{const l=this.selection.lastRange,[u]=this.selection.getRange(),c=l&&u?{oldRange:l,newRange:u}:void 0;yr.call(this,()=>{const h=new fe().retain(a.offset(this)).retain({[a.statics.blotName]:s});return this.editor.update(h,[],c)},Z.sources.USER)}),r){const a=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
|
|
91
|
+
`});this.setContents(a)}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"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,r){return[e,t,,r]=ti(e,t,r),yr.call(this,()=>this.editor.deleteText(e,t),r,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const 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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ue.sources.API;return yr.call(this,()=>{const i=this.getSelection(!0);let o=new fe;if(i==null)return o;if(this.scroll.query(e,ge.BLOCK))o=this.editor.formatLine(i.index,i.length,{[e]:t});else{if(i.length===0)return this.selection.format(e,t),o;o=this.editor.formatText(i.index,i.length,{[e]:t})}return this.setSelection(i,ue.sources.SILENT),o},r)}formatLine(e,t,r,i,o){let a;return[e,t,a,o]=ti(e,t,r,i,o),yr.call(this,()=>this.editor.formatLine(e,t,a),o,e,0)}formatText(e,t,r,i,o){let a;return[e,t,a,o]=ti(e,t,r,i,o),yr.call(this,()=>this.editor.formatText(e,t,a),o,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,t):r=this.selection.getBounds(e.index,e.length),!r)return null;const i=this.container.getBoundingClientRect();return{bottom:r.bottom-i.top,height:r.height,left:r.left-i.left,right:r.right-i.left,top:r.top-i.top,width:r.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]=ti(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.index,e.length):this.scroll.lines(e,t)}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=t??this.getLength()-e),[e,t]=ti(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=t??this.getLength()-e),[e,t]=ti(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Z.sources.API;return yr.call(this,()=>this.editor.insertEmbed(e,t,r),i,e)}insertText(e,t,r,i,o){let a;return[e,,a,o]=ti(e,0,r,i,o),yr.call(this,()=>this.editor.insertText(e,t,a),o,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,r){return[e,t,,r]=ti(e,t,r),yr.call(this,()=>this.editor.removeFormat(e,t),r,e)}scrollRectIntoView(e){xM(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(){const 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]:ue.sources.API;return yr.call(this,()=>{e=new fe(e);const r=this.getLength(),i=this.editor.deleteText(0,r),o=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return i.compose(o).compose(a)},t)}setSelection(e,t,r){e==null?this.selection.setRange(null,t||Z.sources.API):([e,t,,r]=ti(e,t,r),this.selection.setRange(new Zi(Math.max(0,e),t),r),r!==ue.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ue.sources.API;const r=new fe().insert(e);return this.setContents(r,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ue.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ue.sources.API;return yr.call(this,()=>(e=new fe(e),this.editor.applyDelta(e)),t,!0)}}function ky(n){return typeof n=="string"?document.querySelector(n):n}function Hh(n){return Object.entries(n??{}).reduce((e,t)=>{let[r,i]=t;return{...e,[r]:i===!0?{}:i}},{})}function Py(n){return Object.fromEntries(Object.entries(n).filter(e=>e[1]!==void 0))}function _M(n,e){const t=ky(n);if(!t)throw new Error("Invalid Quill container");const i=!e.theme||e.theme===Z.DEFAULTS.theme?ga:Z.import(`themes/${e.theme}`);if(!i)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:o,...a}=Z.DEFAULTS,{modules:s,...l}=i.DEFAULTS;let u=Hh(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const c=qt({},Hh(o),Hh(s),u),h={...a,...Py(l),...Py(e)};let p=e.registry;return p?e.formats&&ea.warn('Ignoring "formats" option because "registry" is specified'):p=e.formats?wM(e.formats,h.registry,ea):h.registry,{...h,registry:p,container:t,theme:i,modules:Object.entries(c).reduce((b,x)=>{let[E,g]=x;if(!g)return b;const v=Z.import(`modules/${E}`);return v==null?(ea.error(`Cannot load ${E} module. Are you sure you registered it?`),b):{...b,[E]:qt({},v.DEFAULTS||{},g)}},{}),bounds:ky(h.bounds)}}function yr(n,e,t,r){if(!this.isEnabled()&&e===ue.sources.USER&&!this.allowReadOnlyEdits)return new fe;let i=t==null?null:this.getSelection();const o=this.editor.delta,a=n();if(i!=null&&(t===!0&&(t=i.index),r==null?i=Ly(i,a,e):r!==0&&(i=Ly(i,t,r,e)),this.setSelection(i,ue.sources.SILENT)),a.length()>0){const s=[ue.events.TEXT_CHANGE,a,o,e];this.emitter.emit(ue.events.EDITOR_CHANGE,...s),e!==ue.sources.SILENT&&this.emitter.emit(...s)}return a}function ti(n,e,t,r,i){let o={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(i=r,r=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(i=r,r=t,t=e,e=0),typeof t=="object"?(o=t,i=r):typeof t=="string"&&(r!=null?o[t]=r:i=t),i=i||ue.sources.API,[n,e,o,i]}function Ly(n,e,t,r){const i=typeof t=="number"?t:0;if(n==null)return null;let o,a;return e&&typeof e.transformPosition=="function"?[o,a]=[n.index,n.index+n.length].map(s=>e.transformPosition(s,r!==ue.sources.USER)):[o,a]=[n.index,n.index+n.length].map(s=>s<e||s===e&&r===ue.sources.USER?s:i>=0?s+i:Math.max(e,s+i)),new Zi(o,a-o)}class uo extends ou{}function By(n){return n instanceof pn||n instanceof ar}function Fy(n){return typeof n.updateContent=="function"}class AM extends fg{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=pn;static allowedChildren=[pn,ar,uo];constructor(e,t,r){let{emitter:i}=r;super(e,t),this.emitter=i,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",o=>this.handleDragStart(o))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(ue.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(ue.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(ue.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[r,i]=this.line(e),[o]=this.line(e+t);if(super.deleteAt(e,t),o!=null&&r!==o&&i>0){if(r instanceof ar||o instanceof ar){this.optimize();return}const a=o.children.head instanceof jr?null:o.children.head;r.moveChildren(o,a),r.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,r,i){super.formatAt(e,t,r,i),this.optimize()}insertAt(e,t,r){if(e>=this.length())if(r==null||this.scroll.query(t,ge.BLOCK)==null){const i=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(i),r==null&&t.endsWith(`
|
|
92
|
+
`)?i.insertAt(0,t.slice(0,-1),r):i.insertAt(0,t,r)}else{const i=this.scroll.create(t,r);this.appendChild(i)}else super.insertAt(e,t,r);this.optimize()}insertBefore(e,t){if(e.statics.scope===ge.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(e),super.insertBefore(r,t)}else super.insertBefore(e,t)}insertContents(e,t){const r=this.deltaToRenderBlocks(t.concat(new fe().insert(`
|
|
93
|
+
`))),i=r.pop();if(i==null)return;this.batchStart();const o=r.shift();if(o){const l=o.type==="block"&&(o.delta.length()===0||!this.descendant(ar,e)[0]&&e<this.length()),u=o.type==="block"?o.delta:new fe().insert({[o.key]:o.value});Vh(this,e,u);const c=o.type==="block"?1:0,h=e+u.length()+c;l&&this.insertAt(h-1,`
|
|
94
|
+
`);const p=rr(this.line(e)[0]),b=lr.AttributeMap.diff(p,o.attributes)||{};Object.keys(b).forEach(x=>{this.formatAt(h-1,1,x,b[x])}),e=h}let[a,s]=this.children.find(e);if(r.length&&(a&&(a=a.split(s),s=0),r.forEach(l=>{if(l.type==="block"){const u=this.createBlock(l.attributes,a||void 0);Vh(u,0,l.delta)}else{const u=this.create(l.key,l.value);this.insertBefore(u,a||void 0),Object.keys(l.attributes).forEach(c=>{u.format(c,l.attributes[c])})}})),i.type==="block"&&i.delta.length()){const l=a?a.offset(a.scroll)+s:this.length();Vh(this,l,i.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[r,i]=t;return r instanceof yn?[r,i]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(By,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;const r=(i,o,a)=>{let s=[],l=a;return i.children.forEachAt(o,a,(u,c,h)=>{By(u)?s.push(u):u instanceof ou&&(s=s.concat(r(u,c,l))),l-=h}),s};return r(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(ue.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=ue.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(r=>{let{target:i}=r;const o=this.find(i,!0);return o&&!Fy(o)}),e.length>0&&this.emitter.emit(ue.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(ue.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,r){const[i]=this.descendant(o=>o instanceof ar,e);i&&i.statics.blotName===t&&Fy(i)&&i.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let r=new fe;return e.forEach(i=>{const o=i?.insert;if(o)if(typeof o=="string"){const a=o.split(`
|
|
95
|
+
`);a.slice(0,-1).forEach(l=>{r.insert(l,i.attributes),t.push({type:"block",delta:r,attributes:i.attributes??{}}),r=new fe});const s=a[a.length-1];s&&r.insert(s,i.attributes)}else{const a=Object.keys(o)[0];if(!a)return;this.query(a,ge.INLINE)?r.push(i):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new fe,t.push({type:"blockEmbed",key:a,value:o[a],attributes:i.attributes??{}}))}}),r.length()&&t.push({type:"block",delta:r,attributes:{}}),t}createBlock(e,t){let r;const i={};Object.entries(e).forEach(s=>{let[l,u]=s;this.query(l,ge.BLOCK&ge.BLOT)!=null?r=l:i[l]=u});const o=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(o,t||void 0);const a=o.length();return Object.entries(i).forEach(s=>{let[l,u]=s;o.formatAt(0,a,l,u)}),o}}function Vh(n,e,t){t.reduce((r,i)=>{const o=lr.Op.length(i);let a=i.attributes||{};if(i.insert!=null){if(typeof i.insert=="string"){const s=i.insert;n.insertAt(r,s);const[l]=n.descendant(yn,r),u=rr(l);a=lr.AttributeMap.diff(u,a)||{}}else if(typeof i.insert=="object"){const s=Object.keys(i.insert)[0];if(s==null)return r;if(n.insertAt(r,s,i.insert[s]),n.scroll.query(s,ge.INLINE)!=null){const[u]=n.descendant(yn,r),c=rr(u);a=lr.AttributeMap.diff(c,a)||{}}}}return Object.keys(a).forEach(s=>{n.formatAt(r,o,s,a[s])}),r+o},e)}const gg={scope:ge.BLOCK,whitelist:["right","center","justify"]},TM=new Wr("align","align",gg),NE=new Or("align","ql-align",gg),DE=new ji("align","text-align",gg);class ME extends ji{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(i=>`00${parseInt(i,10).toString(16)}`.slice(-2)).join("")}`):t}}const IM=new Or("color","ql-color",{scope:ge.INLINE}),mg=new ME("color","color",{scope:ge.INLINE}),SM=new Or("background","ql-bg",{scope:ge.INLINE}),bg=new ME("background","background-color",{scope:ge.INLINE});class co extends uo{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
|
|
96
96
|
`).slice(e,e+t)}html(e,t){return`<pre>
|
|
97
|
-
${
|
|
98
|
-
</pre>`}}class Sn extends pn{static TAB=" ";static register(){Z.register(
|
|
99
|
-
`,r);this.quill.updateContents(i,Z.sources.USER),this.quill.setSelection(e.index+1,Z.sources.SILENT),this.quill.focus()}}const
|
|
97
|
+
${au(this.code(e,t))}
|
|
98
|
+
</pre>`}}class Sn extends pn{static TAB=" ";static register(){Z.register(co)}}class vg extends Tn{}vg.blotName="code";vg.tagName="CODE";Sn.blotName="code-block";Sn.className="ql-code-block";Sn.tagName="DIV";co.blotName="code-block-container";co.className="ql-code-block-container";co.tagName="DIV";co.allowedChildren=[Sn];Sn.allowedChildren=[Sr,jr,wr];Sn.requiredContainer=co;const yg={scope:ge.BLOCK,whitelist:["rtl"]},kE=new Wr("direction","dir",yg),PE=new Or("direction","ql-direction",yg),LE=new ji("direction","direction",yg),BE={scope:ge.INLINE,whitelist:["serif","monospace"]},FE=new Or("font","ql-font",BE);class RM extends ji{value(e){return super.value(e).replace(/["']/g,"")}}const GE=new RM("font","font-family",BE),qE=new Or("size","ql-size",{scope:ge.INLINE,whitelist:["small","large","huge"]}),HE=new ji("size","font-size",{scope:ge.INLINE,whitelist:["10px","18px","32px"]}),OM=ui("quill:keyboard"),jM=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class su extends Ur{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!t[r]!==e[r]&&t[r]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),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]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=DM(e);if(i==null){OM.warn("Attempted to add invalid keyboard binding",i);return}typeof t=="function"&&(t={handler:t}),typeof r=="function"&&(r={handler:r}),(Array.isArray(i.key)?i.key:[i.key]).forEach(a=>{const s={...i,key:a,...t,...r};this.bindings[s.key]=this.bindings[s.key]||[],this.bindings[s.key].push(s)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const i=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(v=>su.match(e,v));if(i.length===0)return;const o=Z.find(e.target,!0);if(o&&o.scroll!==this.quill.scroll)return;const a=this.quill.getSelection();if(a==null||!this.quill.hasFocus())return;const[s,l]=this.quill.getLine(a.index),[u,c]=this.quill.getLeaf(a.index),[h,p]=a.length===0?[u,c]:this.quill.getLeaf(a.index+a.length),b=u instanceof _l?u.value().slice(0,c):"",x=h instanceof _l?h.value().slice(p):"",E={collapsed:a.length===0,empty:a.length===0&&s.length()<=1,format:this.quill.getFormat(a),line:s,offset:l,prefix:b,suffix:x,event:e};i.some(v=>{if(v.collapsed!=null&&v.collapsed!==E.collapsed||v.empty!=null&&v.empty!==E.empty||v.offset!=null&&v.offset!==E.offset)return!1;if(Array.isArray(v.format)){if(v.format.every(C=>E.format[C]==null))return!1}else if(typeof v.format=="object"&&!Object.keys(v.format).every(C=>v.format[C]===!0?E.format[C]!=null:v.format[C]===!1?E.format[C]==null:wi(v.format[C],E.format[C])))return!1;return v.prefix!=null&&!v.prefix.test(E.prefix)||v.suffix!=null&&!v.suffix.test(E.suffix)?!1:v.handler.call(this,a,E,v)!==!0})&&e.preventDefault()})}handleBackspace(e,t){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let i={};const[o]=this.quill.getLine(e.index);let a=new fe().retain(e.index-r).delete(r);if(t.offset===0){const[s]=this.quill.getLine(e.index-1);if(s&&!(s.statics.blotName==="block"&&s.length()<=1)){const u=o.formats(),c=this.quill.getFormat(e.index-1,1);if(i=lr.AttributeMap.diff(u,c)||{},Object.keys(i).length>0){const h=new fe().retain(e.index+o.length()-2).retain(1,i);a=a.compose(h)}}}this.quill.updateContents(a,Z.sources.USER),this.quill.focus()}handleDelete(e,t){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let i={};const[o]=this.quill.getLine(e.index);let a=new fe().retain(e.index).delete(r);if(t.offset>=o.length()-1){const[s]=this.quill.getLine(e.index+1);if(s){const l=o.formats(),u=this.quill.getFormat(e.index,1);i=lr.AttributeMap.diff(l,u)||{},Object.keys(i).length>0&&(a=a.retain(s.length()-1).retain(1,i))}}this.quill.updateContents(a,Z.sources.USER),this.quill.focus()}handleDeleteRange(e){xg({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const r=Object.keys(t.format).reduce((o,a)=>(this.quill.scroll.query(a,ge.BLOCK)&&!Array.isArray(t.format[a])&&(o[a]=t.format[a]),o),{}),i=new fe().retain(e.index).delete(e.length).insert(`
|
|
99
|
+
`,r);this.quill.updateContents(i,Z.sources.USER),this.quill.setSelection(e.index+1,Z.sources.SILENT),this.quill.focus()}}const NM={bindings:{bold:Wh("bold"),italic:Wh("italic"),underline:Wh("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",Z.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",Z.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(n,e){e.format.indent!=null?this.quill.format("indent","-1",Z.sources.USER):e.format.list!=null&&this.quill.format("list",!1,Z.sources.USER)}},"indent code-block":Gy(!0),"outdent code-block":Gy(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,Z.sources.USER)}},tab:{key:"Tab",handler(n,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=new fe().retain(n.index).delete(n.length).insert(" ");return this.quill.updateContents(t,Z.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,Z.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,Z.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(n,e){const t={list:!1};e.format.indent&&(t.indent=!1),this.quill.formatLine(n.index,n.length,t,Z.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[e,t]=this.quill.getLine(n.index),r={...e.formats(),list:"checked"},i=new fe().retain(n.index).insert(`
|
|
100
100
|
`,r).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(i,Z.sources.USER),this.quill.setSelection(n.index+1,Z.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,e){const[t,r]=this.quill.getLine(n.index),i=new fe().retain(n.index).insert(`
|
|
101
|
-
`,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,Z.sources.USER),this.quill.setSelection(n.index+1,Z.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(n){const e=this.quill.getModule("table");if(e){const[t,r,i,o]=e.getTable(n),a=
|
|
101
|
+
`,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(i,Z.sources.USER),this.quill.setSelection(n.index+1,Z.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(n){const e=this.quill.getModule("table");if(e){const[t,r,i,o]=e.getTable(n),a=MM(t,r,i,o);if(a==null)return;let s=t.offset();if(a<0){const l=new fe().retain(s).insert(`
|
|
102
102
|
`);this.quill.updateContents(l,Z.sources.USER),this.quill.setSelection(n.index+1,n.length,Z.sources.SILENT)}else if(a>0){s+=t.length();const l=new fe().retain(s).insert(`
|
|
103
|
-
`);this.quill.updateContents(l,Z.sources.USER),this.quill.setSelection(s,Z.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,e){const{event:t,line:r}=e,i=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(i-1,Z.sources.USER):this.quill.setSelection(i+r.length(),Z.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[r,i]=this.quill.getLine(n.index);if(i>t)return!0;let o;switch(e.prefix.trim()){case"[]":case"[ ]":o="unchecked";break;case"[x]":o="checked";break;case"-":case"*":o="bullet";break;default:o="ordered"}this.quill.insertText(n.index," ",Z.sources.USER),this.quill.history.cutoff();const a=new fe().retain(n.index-i).delete(t+1).retain(r.length()-2-i).retain(1,{list:o});return this.quill.updateContents(a,Z.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,Z.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[e,t]=this.quill.getLine(n.index);let r=2,i=e;for(;i!=null&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,r-=1,r<=0){const o=new fe().retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(o,Z.sources.USER),this.quill.setSelection(n.index-1,Z.sources.SILENT),!1}return!0}},"embed left"
|
|
104
|
-
`)&&(o.ops[o.ops.length-1].attributes==null||i.table)?o.compose(new fe().retain(o.length()-1).delete(1)):o}normalizeHTML(e){
|
|
105
|
-
`)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const r=e.clipboardData?.getData("text/html");let i=e.clipboardData?.getData("text/plain");if(!r&&!i){const a=e.clipboardData?.getData("text/uri-list");a&&(i=this.normalizeURIList(a))}const o=Array.from(e.clipboardData?.files||[]);if(!r&&o.length>0){this.quill.uploader.upload(t,o);return}if(r&&o.length>0){const a=new DOMParser().parseFromString(r,"text/html");if(a.body.childElementCount===1&&a.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(t,o);return}}this.onPaste(t,{html:r,text:i})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:i}=t;const o=this.quill.getFormat(e.index),a=this.convert({text:r,html:i},o)
|
|
103
|
+
`);this.quill.updateContents(l,Z.sources.USER),this.quill.setSelection(s,Z.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,e){const{event:t,line:r}=e,i=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(i-1,Z.sources.USER):this.quill.setSelection(i+r.length(),Z.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[r,i]=this.quill.getLine(n.index);if(i>t)return!0;let o;switch(e.prefix.trim()){case"[]":case"[ ]":o="unchecked";break;case"[x]":o="checked";break;case"-":case"*":o="bullet";break;default:o="ordered"}this.quill.insertText(n.index," ",Z.sources.USER),this.quill.history.cutoff();const a=new fe().retain(n.index-i).delete(t+1).retain(r.length()-2-i).retain(1,{list:o});return this.quill.updateContents(a,Z.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,Z.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[e,t]=this.quill.getLine(n.index);let r=2,i=e;for(;i!=null&&i.length()<=1&&i.formats()["code-block"];)if(i=i.prev,r-=1,r<=0){const o=new fe().retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(o,Z.sources.USER),this.quill.setSelection(n.index-1,Z.sources.SILENT),!1}return!0}},"embed left":Zs("ArrowLeft",!1),"embed left shift":Zs("ArrowLeft",!0),"embed right":Zs("ArrowRight",!1),"embed right shift":Zs("ArrowRight",!0),"table down":qy(!1),"table up":qy(!0)}};su.DEFAULTS=NM;function Gy(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:r}=t;const i=this.quill.scroll.query("code-block"),{TAB:o}=i;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,o,Z.sources.USER),this.quill.setSelection(e.index+o.length,Z.sources.SILENT);return}const a=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:s,length:l}=e;a.forEach((u,c)=>{n?(u.insertAt(0,o),c===0?s+=o.length:l+=o.length):u.domNode.textContent.startsWith(o)&&(u.deleteAt(0,o.length),c===0?s-=o.length:l-=o.length)}),this.quill.update(Z.sources.USER),this.quill.setSelection(s,l,Z.sources.SILENT)}}}function Zs(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:i}=r;n==="ArrowRight"&&(i+=r.length+1);const[o]=this.quill.getLeaf(i);return o instanceof Yn?(n==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,Z.sources.USER):this.quill.setSelection(r.index-1,Z.sources.USER):e?this.quill.setSelection(r.index,r.length+1,Z.sources.USER):this.quill.setSelection(r.index+r.length+1,Z.sources.USER),!1):!0}}}function Wh(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],Z.sources.USER)}}}function qy(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const r=n?"prev":"next",i=t.line,o=i.parent[r];if(o!=null){if(o.statics.blotName==="table-row"){let a=o.children.head,s=i;for(;s.prev!=null;)s=s.prev,a=a.next;const l=a.offset(this.quill.scroll)+Math.min(t.offset,a.length()-1);this.quill.setSelection(l,0,Z.sources.USER)}}else{const a=i.table()[r];a!=null&&(n?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,Z.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,Z.sources.USER))}return!1}}}function DM(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=Ko(n);else return null;return n.shortKey&&(n[jM]=n.shortKey,delete n.shortKey),n}function xg(n){let{quill:e,range:t}=n;const r=e.getLines(t);let i={};if(r.length>1){const o=r[0].formats(),a=r[r.length-1].formats();i=lr.AttributeMap.diff(a,o)||{}}e.deleteText(t,Z.sources.USER),Object.keys(i).length>0&&e.formatLine(t.index,1,i,Z.sources.USER),e.setSelection(t.index,Z.sources.SILENT)}function MM(n,e,t,r){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?r===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const kM=/font-weight:\s*normal/,PM=["P","OL","UL"],Hy=n=>n&&PM.includes(n.tagName),LM=n=>{Array.from(n.querySelectorAll("br")).filter(e=>Hy(e.previousElementSibling)&&Hy(e.nextElementSibling)).forEach(e=>{e.parentNode?.removeChild(e)})},BM=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter(e=>e.getAttribute("style")?.match(kM)).forEach(e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)})};function FM(n){n.querySelector('[id^="docs-internal-guid-"]')&&(BM(n),LM(n))}const GM=/\bmso-list:[^;]*ignore/i,qM=/\bmso-list:[^;]*\bl(\d+)/i,HM=/\bmso-list:[^;]*\blevel(\d+)/i,VM=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(qM);if(!r)return null;const i=Number(r[1]),o=t?.match(HM),a=o?Number(o[1]):1,s=new RegExp(`@list l${i}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=e.match(s),u=l&&l[1]==="bullet"?"bullet":"ordered";return{id:i,indent:a,type:u,element:n}},WM=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach(a=>{(a.getAttribute("style")||"").match(GM)?t.push(a):r.push(a)}),t.forEach(a=>a.parentNode?.removeChild(a));const i=n.documentElement.innerHTML,o=r.map(a=>VM(a,i)).filter(a=>a);for(;o.length;){const a=[];let s=o.shift();for(;s;)a.push(s),s=o.length&&o[0]?.element===s.element.nextElementSibling&&o[0].id===s.id?o.shift():null;const l=document.createElement("ul");a.forEach(h=>{const p=document.createElement("li");p.setAttribute("data-list",h.type),h.indent>1&&p.setAttribute("class",`ql-indent-${h.indent-1}`),p.innerHTML=h.element.innerHTML,l.appendChild(p)});const u=a[0]?.element,{parentNode:c}=u??{};u&&c?.replaceChild(l,u),a.slice(1).forEach(h=>{let{element:p}=h;c?.removeChild(p)})}};function zM(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&WM(n)}const XM=[zM,FM],UM=n=>{n.documentElement&&XM.forEach(e=>{e(n)})},$M=ui("quill:clipboard"),YM=[[Node.TEXT_NODE,l3],[Node.TEXT_NODE,Wy],["br",t3],[Node.ELEMENT_NODE,Wy],[Node.ELEMENT_NODE,e3],[Node.ELEMENT_NODE,QM],[Node.ELEMENT_NODE,a3],["li",i3],["ol, ul",o3],["pre",n3],["tr",s3],["b",zh("bold")],["i",zh("italic")],["strike",zh("strike")],["style",r3]],ZM=[TM,kE].reduce((n,e)=>(n[e.keyName]=e,n),{}),Vy=[DE,bg,mg,LE,GE,HE].reduce((n,e)=>(n[e.keyName]=e,n),{});class JM extends Ur{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],YM.concat(this.options.matchers??[]).forEach(r=>{let[i,o]=r;this.addMatcher(i,o)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:r}=e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i[Sn.blotName])return new fe().insert(r||"",{[Sn.blotName]:i[Sn.blotName]});if(!t)return new fe().insert(r||"",i);const o=this.convertHTML(t);return Cs(o,`
|
|
104
|
+
`)&&(o.ops[o.ops.length-1].attributes==null||i.table)?o.compose(new fe().retain(o.length()-1).delete(1)):o}normalizeHTML(e){UM(e)}convertHTML(e){const t=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(t);const r=t.body,i=new WeakMap,[o,a]=this.prepareMatching(r,i);return Cg(this.quill.scroll,r,o,a,i)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Z.sources.API;if(typeof e=="string"){const i=this.convert({html:e,text:""});this.quill.setContents(i,t),this.quill.setSelection(0,Z.sources.SILENT)}else{const i=this.convert({html:t,text:""});this.quill.updateContents(new fe().retain(e).concat(i),r),this.quill.setSelection(e+i.length(),Z.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:i,text:o}=this.onCopy(r,t);e.clipboardData?.setData("text/plain",o),e.clipboardData?.setData("text/html",i),t&&xg({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(t=>t[0]!=="#").join(`
|
|
105
|
+
`)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const r=e.clipboardData?.getData("text/html");let i=e.clipboardData?.getData("text/plain");if(!r&&!i){const a=e.clipboardData?.getData("text/uri-list");a&&(i=this.normalizeURIList(a))}const o=Array.from(e.clipboardData?.files||[]);if(!r&&o.length>0){this.quill.uploader.upload(t,o);return}if(r&&o.length>0){const a=new DOMParser().parseFromString(r,"text/html");if(a.body.childElementCount===1&&a.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(t,o);return}}this.onPaste(t,{html:r,text:i})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:i}=t;const o=this.quill.getFormat(e.index),a=this.convert({text:r,html:i},o);$M.log("onPaste",a,{text:r,html:i});const s=new fe().retain(e.index).delete(e.length).concat(a);this.quill.updateContents(s,Z.sources.USER),this.quill.setSelection(s.length()-e.length,Z.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const r=[],i=[];return this.matchers.forEach(o=>{const[a,s]=o;switch(a){case Node.TEXT_NODE:i.push(s);break;case Node.ELEMENT_NODE:r.push(s);break;default:Array.from(e.querySelectorAll(a)).forEach(l=>{t.has(l)?t.get(l)?.push(s):t.set(l,[s])});break}}),[r,i]}}function ho(n,e,t,r){return r.query(e)?n.reduce((i,o)=>{if(!o.insert)return i;if(o.attributes&&o.attributes[e])return i.push(o);const a=t?{[e]:t}:{};return i.insert(o.insert,{...a,...o.attributes})},new fe):n}function Cs(n,e){let t="";for(let r=n.ops.length-1;r>=0&&t.length<e.length;--r){const i=n.ops[r];if(typeof i.insert!="string")break;t=i.insert+t}return t.slice(-1*e.length)===e}function Ai(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof Yn?!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"].includes(n.tagName.toLowerCase())}function KM(n,e){return n.previousElementSibling&&n.nextElementSibling&&!Ai(n.previousElementSibling,e)&&!Ai(n.nextElementSibling,e)}const Js=new WeakMap;function VE(n){return n==null?!1:(Js.has(n)||(n.tagName==="PRE"?Js.set(n,!0):Js.set(n,VE(n.parentNode))),Js.get(n))}function Cg(n,e,t,r,i){return e.nodeType===e.TEXT_NODE?r.reduce((o,a)=>a(e,o,n),new fe):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((o,a)=>{let s=Cg(n,a,t,r,i);return a.nodeType===e.ELEMENT_NODE&&(s=t.reduce((l,u)=>u(a,l,n),s),s=(i.get(a)||[]).reduce((l,u)=>u(a,l,n),s)),o.concat(s)},new fe):new fe}function zh(n){return(e,t,r)=>ho(t,n,!0,r)}function QM(n,e,t){const r=Wr.keys(n),i=Or.keys(n),o=ji.keys(n),a={};return r.concat(i).concat(o).forEach(s=>{let l=t.query(s,ge.ATTRIBUTE);l!=null&&(a[l.attrName]=l.value(n),a[l.attrName])||(l=ZM[s],l!=null&&(l.attrName===s||l.keyName===s)&&(a[l.attrName]=l.value(n)||void 0),l=Vy[s],l!=null&&(l.attrName===s||l.keyName===s)&&(l=Vy[s],a[l.attrName]=l.value(n)||void 0))}),Object.entries(a).reduce((s,l)=>{let[u,c]=l;return ho(s,u,c,t)},e)}function e3(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof Yn){const i={},o=r.value(n);if(o!=null)return i[r.blotName]=o,new fe().insert(i,r.formats(n,t))}else if(r.prototype instanceof ls&&!Cs(e,`
|
|
106
106
|
`)&&e.insert(`
|
|
107
|
-
`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return
|
|
107
|
+
`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return ho(e,r.blotName,r.formats(n,t),t);return e}function t3(n,e){return Cs(e,`
|
|
108
108
|
`)||e.insert(`
|
|
109
|
-
`),e}function
|
|
110
|
-
`))return e;let i=-1,o=n.parentNode;for(;o!=null;)["OL","UL"].includes(o.tagName)&&(i+=1),o=o.parentNode;return i<=0?e:e.reduce((a,s)=>s.insert?s.attributes&&typeof s.attributes.indent=="number"?a.push(s):a.insert(s.insert,{indent:i,...s.attributes||{}}):a,new fe)}function
|
|
109
|
+
`),e}function n3(n,e,t){const r=t.query("code-block"),i=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return ho(e,"code-block",i,t)}function r3(){return new fe}function i3(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!Cs(e,`
|
|
110
|
+
`))return e;let i=-1,o=n.parentNode;for(;o!=null;)["OL","UL"].includes(o.tagName)&&(i+=1),o=o.parentNode;return i<=0?e:e.reduce((a,s)=>s.insert?s.attributes&&typeof s.attributes.indent=="number"?a.push(s):a.insert(s.insert,{indent:i,...s.attributes||{}}):a,new fe)}function o3(n,e,t){const r=n;let i=r.tagName==="OL"?"ordered":"bullet";const o=r.getAttribute("data-checked");return o&&(i=o==="true"?"checked":"unchecked"),ho(e,"list",i,t)}function Wy(n,e,t){if(!Cs(e,`
|
|
111
111
|
`)){if(Ai(n,t)&&(n.childNodes.length>0||n instanceof HTMLParagraphElement))return e.insert(`
|
|
112
112
|
`);if(e.length()>0&&n.nextSibling){let r=n.nextSibling;for(;r!=null;){if(Ai(r,t))return e.insert(`
|
|
113
|
-
`);const i=t.query(r);if(i&&i.prototype instanceof
|
|
114
|
-
`);r=r.firstChild}}}return e}function
|
|
115
|
-
`)&&!
|
|
116
|
-
`):t.attributes!=null?Object.keys(t.attributes).some(r=>n.query(r,pe.BLOCK)!=null):!1}function VM(n,e){const t=e.reduce((i,o)=>i+(o.delete||0),0);let r=e.length()-t;return HM(n,e)&&(r-=1),r}function Pf(n,e){if(!n)return n;const t=e.transformPosition(n.index),r=e.transformPosition(n.index+n.length);return{index:t,length:r-t}}class SE extends Xr{constructor(e,t){super(e,t),e.root.addEventListener("drop",r=>{r.preventDefault();let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);i=document.createRange(),i.setStart(a.offsetNode,a.offset),i.setEnd(a.offsetNode,a.offset)}const o=i&&e.selection.normalizeNative(i);if(o){const a=e.selection.normalizedToRange(o);r.dataTransfer?.files&&this.upload(a,r.dataTransfer.files)}})}upload(e,t){const r=[];Array.from(t).forEach(i=>{i&&this.options.mimetypes?.includes(i.type)&&r.push(i)}),r.length>0&&this.options.handler.call(this,e,r)}}SE.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map(r=>new Promise(i=>{const o=new FileReader;o.onload=()=>{i(o.result)},o.readAsDataURL(r)}));Promise.all(t).then(r=>{const i=r.reduce((o,a)=>o.insert({image:a}),new fe().retain(n.index).delete(n.length));this.quill.updateContents(i,ue.sources.USER),this.quill.setSelection(n.index+r.length,ue.sources.SILENT)})}};const WM=["insertText","insertReplacementText"];let zM=class extends Xr{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(Z.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){dg({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){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new fe().retain(e.index).insert(t,r),Z.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,Z.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!WM.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=XM(e);if(r==null)return;const i=this.quill.selection.normalizeNative(t),o=i?this.quill.selection.normalizedToRange(i):null;o&&this.replaceText(o,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}};function XM(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const UM=/Mac/i.test(navigator.platform),$M=100,YM=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||UM&&n.key==="a"&&n.ctrlKey===!0);class ZM extends Xr{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:r,event:i}=t;if(!(r instanceof Tr)||!r.uiNode)return!0;const o=getComputedStyle(r.domNode).direction==="rtl";return o&&i.key!=="ArrowRight"||!o&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(i.shiftKey?1:0),Z.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&YM(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+$M,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;const r=this.quill.scroll.find(t.startContainer);if(!(r instanceof Tr)||!r.uiNode)return;const i=document.createRange();i.setStartAfter(r.uiNode),i.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(i)}}Z.register({"blots/block":pn,"blots/block/embed":or,"blots/break":Or,"blots/container":ao,"blots/cursor":Er,"blots/embed":og,"blots/inline":Tn,"blots/scroll":rM,"blots/text":Ir,"modules/clipboard":RM,"modules/history":qM,"modules/keyboard":ru,"modules/uploader":SE,"modules/input":zM,"modules/uiNode":ZM});class JM extends Rr{add(e,t){let r=0;if(t==="+1"||t==="-1"){const i=this.value(e)||0;r=t==="+1"?i+1:i-1}else typeof t=="number"&&(r=t);return r===0?(this.remove(e),!0):super.add(e,r.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}}const KM=new JM("indent","ql-indent",{scope:pe.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class QM extends pn{static blotName="blockquote";static tagName="blockquote"}class ek extends pn{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class xs extends ao{}xs.blotName="list-container";xs.tagName="OL";class Cs extends pn{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){Z.register(xs)}constructor(e,t){super(e,t);const r=t.ownerDocument.createElement("span"),i=o=>{if(!e.isEnabled())return;const a=this.statics.formats(t,e);a==="checked"?(this.format("list","unchecked"),o.preventDefault()):a==="unchecked"&&(this.format("list","checked"),o.preventDefault())};r.addEventListener("mousedown",i),r.addEventListener("touchstart",i),this.attachUI(r)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}Cs.blotName="list";Cs.tagName="LI";xs.allowedChildren=[Cs];Cs.requiredContainer=xs;class fg extends Tn{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)}}class tk extends fg{static blotName="italic";static tagName=["EM","I"]}class El extends Tn{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const 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 RE(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 RE(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}class nk extends Tn{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"}}class rk extends fg{static blotName="strike";static tagName=["S","STRIKE"]}class ik extends Tn{static blotName="underline";static tagName="U"}class ok extends og{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const 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(){const{formula:e}=this.value();return`<span>${e}</span>`}}const Dy=["alt","height","width"];let ak=class extends Yn{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Dy.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return RE(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Dy.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}};const My=["height","width"];class sk extends or{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return My.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static sanitize(e){return El.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){My.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}const Xa=new Rr("code-token","hljs",{scope:pe.INLINE});class ri extends Tn{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(Sn.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),Xa.add(this.domNode,r)}format(e,t){e!==ri.blotName?super.format(e,t):t?Xa.add(this.domNode,t):(Xa.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Xa.value(this.domNode)||this.unwrap()}}ri.blotName="code-token";ri.className="ql-token";class ir extends Sn{static create(e){const 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(),ri.blotName,!1),super.replaceWith(e,t)}}class rs extends so{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===ir.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,t)}))}formatAt(e,t,r,i){r===ir.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,i)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const i=`${Array.from(this.domNode.childNodes).filter(a=>a!==this.uiNode).map(a=>a.textContent).join(`
|
|
113
|
+
`);const i=t.query(r);if(i&&i.prototype instanceof ar)return e.insert(`
|
|
114
|
+
`);r=r.firstChild}}}return e}function a3(n,e,t){const r={},i=n.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),e=Object.entries(r).reduce((o,a)=>{let[s,l]=a;return ho(o,s,l,t)},e),parseFloat(i.textIndent||0)>0?new fe().insert(" ").concat(e):e}function s3(n,e,t){const r=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(r!=null){const o=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return ho(e,"table",o,t)}return e}function l3(n,e,t){let r=n.data;if(n.parentElement?.tagName==="O:P")return e.insert(r.trim());if(!VE(n)){if(r.trim().length===0&&r.includes(`
|
|
115
|
+
`)&&!KM(n,t))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&Ai(n.parentElement,t)||n.previousSibling instanceof Element&&Ai(n.previousSibling,t))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&Ai(n.parentElement,t)||n.nextSibling instanceof Element&&Ai(n.nextSibling,t))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class u3 extends Ur{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(Z.events.EDITOR_CHANGE,(r,i,o,a)=>{r===Z.events.SELECTION_CHANGE?i&&a!==Z.sources.SILENT&&(this.currentRange=i):r===Z.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===Z.sources.USER?this.record(i,o):this.transform(i)),this.currentRange=Hf(this.currentRange,i))}),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",r=>{r.inputType==="historyUndo"?(this.undo(),r.preventDefault()):r.inputType==="historyRedo"&&(this.redo(),r.preventDefault())})}change(e,t){if(this.stack[e].length===0)return;const r=this.stack[e].pop();if(!r)return;const i=this.quill.getContents(),o=r.delta.invert(i);this.stack[t].push({delta:o,range:Hf(r.range,o)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r.delta,Z.sources.USER),this.ignoreChange=!1,this.restoreSelection(r)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let r=e.invert(t),i=this.currentRange;const o=Date.now();if(this.lastRecorded+this.options.delay>o&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(r=r.compose(a.delta),i=a.range)}else this.lastRecorded=o;r.length()!==0&&(this.stack.undo.push({delta:r,range:i}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){zy(this.stack.undo,e),zy(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,Z.sources.USER);else{const t=d3(this.quill.scroll,e.delta);this.quill.setSelection(t,Z.sources.USER)}}}function zy(n,e){let t=e;for(let r=n.length-1;r>=0;r-=1){const i=n[r];n[r]={delta:t.transform(i.delta,!0),range:i.range&&Hf(i.range,t)},t=i.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function c3(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`
|
|
116
|
+
`):t.attributes!=null?Object.keys(t.attributes).some(r=>n.query(r,ge.BLOCK)!=null):!1}function d3(n,e){const t=e.reduce((i,o)=>i+(o.delete||0),0);let r=e.length()-t;return c3(n,e)&&(r-=1),r}function Hf(n,e){if(!n)return n;const t=e.transformPosition(n.index),r=e.transformPosition(n.index+n.length);return{index:t,length:r-t}}class WE extends Ur{constructor(e,t){super(e,t),e.root.addEventListener("drop",r=>{r.preventDefault();let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);i=document.createRange(),i.setStart(a.offsetNode,a.offset),i.setEnd(a.offsetNode,a.offset)}const o=i&&e.selection.normalizeNative(i);if(o){const a=e.selection.normalizedToRange(o);r.dataTransfer?.files&&this.upload(a,r.dataTransfer.files)}})}upload(e,t){const r=[];Array.from(t).forEach(i=>{i&&this.options.mimetypes?.includes(i.type)&&r.push(i)}),r.length>0&&this.options.handler.call(this,e,r)}}WE.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map(r=>new Promise(i=>{const o=new FileReader;o.onload=()=>{i(o.result)},o.readAsDataURL(r)}));Promise.all(t).then(r=>{const i=r.reduce((o,a)=>o.insert({image:a}),new fe().retain(n.index).delete(n.length));this.quill.updateContents(i,ue.sources.USER),this.quill.setSelection(n.index+r.length,ue.sources.SILENT)})}};const h3=["insertText","insertReplacementText"];let f3=class extends Ur{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(Z.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){xg({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){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new fe().retain(e.index).insert(t,r),Z.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,Z.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!h3.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=p3(e);if(r==null)return;const i=this.quill.selection.normalizeNative(t),o=i?this.quill.selection.normalizedToRange(i):null;o&&this.replaceText(o,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}};function p3(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const g3=/Mac/i.test(navigator.platform),m3=100,b3=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||g3&&n.key==="a"&&n.ctrlKey===!0);class v3 extends Ur{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:r,event:i}=t;if(!(r instanceof Ir)||!r.uiNode)return!0;const o=getComputedStyle(r.domNode).direction==="rtl";return o&&i.key!=="ArrowRight"||!o&&i.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(i.shiftKey?1:0),Z.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&b3(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+m3,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;const r=this.quill.scroll.find(t.startContainer);if(!(r instanceof Ir)||!r.uiNode)return;const i=document.createRange();i.setStartAfter(r.uiNode),i.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(i)}}Z.register({"blots/block":pn,"blots/block/embed":ar,"blots/break":jr,"blots/container":uo,"blots/cursor":wr,"blots/embed":pg,"blots/inline":Tn,"blots/scroll":AM,"blots/text":Sr,"modules/clipboard":JM,"modules/history":u3,"modules/keyboard":su,"modules/uploader":WE,"modules/input":f3,"modules/uiNode":v3});class y3 extends Or{add(e,t){let r=0;if(t==="+1"||t==="-1"){const i=this.value(e)||0;r=t==="+1"?i+1:i-1}else typeof t=="number"&&(r=t);return r===0?(this.remove(e),!0):super.add(e,r.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}}const x3=new y3("indent","ql-indent",{scope:ge.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class C3 extends pn{static blotName="blockquote";static tagName="blockquote"}class E3 extends pn{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class Es extends uo{}Es.blotName="list-container";Es.tagName="OL";class ws extends pn{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){Z.register(Es)}constructor(e,t){super(e,t);const r=t.ownerDocument.createElement("span"),i=o=>{if(!e.isEnabled())return;const a=this.statics.formats(t,e);a==="checked"?(this.format("list","unchecked"),o.preventDefault()):a==="unchecked"&&(this.format("list","checked"),o.preventDefault())};r.addEventListener("mousedown",i),r.addEventListener("touchstart",i),this.attachUI(r)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}ws.blotName="list";ws.tagName="LI";Es.allowedChildren=[ws];ws.requiredContainer=Es;class Eg extends Tn{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)}}class w3 extends Eg{static blotName="italic";static tagName=["EM","I"]}class Al extends Tn{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const 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 zE(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 zE(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}class _3 extends Tn{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"}}class A3 extends Eg{static blotName="strike";static tagName=["S","STRIKE"]}class T3 extends Tn{static blotName="underline";static tagName="U"}class I3 extends pg{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const 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(){const{formula:e}=this.value();return`<span>${e}</span>`}}const Xy=["alt","height","width"];let S3=class extends Yn{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Xy.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return zE(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Xy.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}};const Uy=["height","width"];class R3 extends ar{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Uy.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static sanitize(e){return Al.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){Uy.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}const Ua=new Or("code-token","hljs",{scope:ge.INLINE});class ii extends Tn{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(Sn.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),Ua.add(this.domNode,r)}format(e,t){e!==ii.blotName?super.format(e,t):t?Ua.add(this.domNode,t):(Ua.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Ua.value(this.domNode)||this.unwrap()}}ii.blotName="code-token";ii.className="ql-token";class ir extends Sn{static create(e){const 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(),ii.blotName,!1),super.replaceWith(e,t)}}class is extends co{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===ir.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,t)}))}formatAt(e,t,r,i){r===ir.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,i)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const i=`${Array.from(this.domNode.childNodes).filter(a=>a!==this.uiNode).map(a=>a.textContent).join(`
|
|
117
117
|
`)}
|
|
118
|
-
`,o=ir.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==i){if(i.trim().length>0||this.cachedText==null){const a=this.children.reduce((l,u)=>l.concat(
|
|
119
|
-
${
|
|
120
|
-
</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=ir.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}
|
|
118
|
+
`,o=ir.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==i){if(i.trim().length>0||this.cachedText==null){const a=this.children.reduce((l,u)=>l.concat(OE(u,!1)),new fe),s=e(i,o);a.diff(s).reduce((l,u)=>{let{retain:c,attributes:h}=u;return c?(h&&Object.keys(h).forEach(p=>{[ir.blotName,ii.blotName].includes(p)&&this.formatAt(l,c,p,h[p])}),l+c):l},0)}this.cachedText=i,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?ir.formats(r.domNode):"plain"}">
|
|
119
|
+
${au(this.code(e,t))}
|
|
120
|
+
</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=ir.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}is.allowedChildren=[ir];ir.requiredContainer=is;ir.allowedChildren=[ii,wr,Sr,jr];const O3=(n,e,t)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class XE extends Ur{static register(){Z.register(ii,!0),Z.register(ir,!0),Z.register(is,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((r,i)=>{let{key:o}=i;return r[o]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(Z.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof is))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:i,label:o}=r;const a=t.ownerDocument.createElement("option");a.textContent=o,a.setAttribute("value",i),t.appendChild(a)}),t.addEventListener("change",()=>{e.format(ir.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=ir.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(Z.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]:!1;if(this.quill.selection.composing)return;this.quill.update(Z.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(is):[e]).forEach(o=>{o.highlight(this.highlightBlot,t)}),this.quill.update(Z.sources.SILENT),r!=null&&this.quill.setSelection(r,Z.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 au(e).split(`
|
|
121
121
|
`).reduce((i,o,a)=>(a!==0&&i.insert(`
|
|
122
|
-
`,{[Sn.blotName]:t}),i.insert(o)),new fe);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(Sn.className),r.innerHTML=
|
|
122
|
+
`,{[Sn.blotName]:t}),i.insert(o)),new fe);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(Sn.className),r.innerHTML=O3(this.options.hljs,t,e),Cg(this.quill.scroll,r,[(i,o)=>{const a=Ua.value(i);return a?o.compose(new fe().retain(o.length(),{[ii.blotName]:a})):o}],[(i,o)=>i.data.split(`
|
|
123
123
|
`).reduce((a,s,l)=>(l!==0&&a.insert(`
|
|
124
|
-
`,{[Sn.blotName]:t}),a.insert(s)),o)],new WeakMap)}}
|
|
125
|
-
`).join("");return o.insert(a,{table:pg()})},new fe().retain(r.index));this.quill.updateContents(i,Z.sources.USER),this.quill.setSelection(r.index,Z.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(Z.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(Z.events.TEXT_CHANGE,(r,i,o)=>{o===Z.sources.USER&&this.balanceTables()}),!0):!1)})}}const ky=li("quill:toolbar");class gg extends Xr{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),ck(r,this.options.container),e.container?.parentNode?.insertBefore(r,e.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){ky.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(r=>{const i=this.options.handlers?.[r];i&&this.addHandler(r,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(r=>{this.attach(r)}),this.quill.on(Z.events.EDITOR_CHANGE,()=>{const[r]=this.quill.selection.getRange();this.update(r)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(i=>i.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){ky.warn("ignoring attaching to nonexistent format",t,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,i=>{let o;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const s=e.options[e.selectedIndex];s.hasAttribute("selected")?o=!1:o=s.value||!1}else e.classList.contains("ql-active")?o=!1:o=e.value||!e.hasAttribute("value"),i.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,o);else if(this.quill.scroll.query(t).prototype instanceof Yn){if(o=prompt(`Enter ${t}`),!o)return;this.quill.updateContents(new fe().retain(a.index).delete(a.length).insert({[t]:o}),Z.sources.USER)}else this.quill.format(t,o,Z.sources.USER);this.update(a)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[i,o]=r;if(o.tagName==="SELECT"){let a=null;if(e==null)a=null;else if(t[i]==null)a=o.querySelector("option[selected]");else if(!Array.isArray(t[i])){let s=t[i];typeof s=="string"&&(s=s.replace(/"/g,'\\"')),a=o.querySelector(`option[value="${s}"]`)}a==null?(o.value="",o.selectedIndex=-1):a.selected=!0}else if(e==null)o.classList.remove("ql-active"),o.setAttribute("aria-pressed","false");else if(o.hasAttribute("value")){const a=t[i],s=a===o.getAttribute("value")||a!=null&&a.toString()===o.getAttribute("value")||a==null&&!o.getAttribute("value");o.classList.toggle("ql-active",s),o.setAttribute("aria-pressed",s.toString())}else{const a=t[i]!=null;o.classList.toggle("ql-active",a),o.setAttribute("aria-pressed",a.toString())}})}}gg.DEFAULTS={};function Ly(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function ck(n,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach(i=>{if(typeof i=="string")Ly(r,i);else{const o=Object.keys(i)[0],a=i[o];Array.isArray(a)?dk(r,o,a):Ly(r,o,a)}}),n.appendChild(r)})}function dk(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach(i=>{const o=document.createElement("option");i!==!1?o.setAttribute("value",String(i)):o.setAttribute("selected","selected"),r.appendChild(o)}),n.appendChild(r)}gg.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(t=>{this.quill.scroll.query(t,pe.INLINE)!=null&&this.quill.format(t,!1,Z.sources.USER)})}else this.quill.removeFormat(n.index,n.length,Z.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",Z.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,Z.sources.USER),this.quill.format("direction",n,Z.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),r=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let i=n==="+1"?1:-1;t.direction==="rtl"&&(i*=-1),this.quill.format("indent",r+i,Z.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,Z.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,Z.sources.USER):this.quill.format("list","unchecked",Z.sources.USER):this.quill.format("list",n,Z.sources.USER)}}};const hk='<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>',fk='<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>',pk='<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>',gk='<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>',mk='<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>',bk='<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>',vk='<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>',yk='<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>',Py='<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>',xk='<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>',Ck='<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>',Ek='<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>',wk='<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>',Ak='<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>',_k='<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>',Tk='<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>',Ik='<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>',Sk='<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>',Rk='<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>',Ok='<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>',Nk='<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>',jk='<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>',Dk='<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>',Mk='<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>',kk='<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>',Lk='<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>',Pk='<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>',Bk='<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>',Fk='<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>',Gk='<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>',qk='<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>',Hk='<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>',Vk='<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>',us={align:{"":hk,center:fk,right:pk,justify:gk},background:mk,blockquote:bk,bold:vk,clean:yk,code:Py,"code-block":Py,color:xk,direction:{"":Ck,rtl:Ek},formula:wk,header:{1:Ak,2:_k,3:Tk,4:Ik,5:Sk,6:Rk},italic:Ok,image:Nk,indent:{"+1":jk,"-1":Dk},link:Mk,list:{bullet:kk,check:Lk,ordered:Pk},script:{sub:Bk,super:Fk},strike:Gk,table:qk,underline:Hk,video:Vk},Wk='<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>';let By=0;function Fy(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class iu{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",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Fy(this.label,"aria-expanded"),Fy(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&t.setAttribute("data-value",r),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",i=>{switch(i.key){case"Enter":this.selectItem(t,!0),i.preventDefault();break;case"Escape":this.escape(),i.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=Wk,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${By}`,By+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)}),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]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r?.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){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class NE extends iu{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(r=>{r.classList.add("ql-primary")})}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const r=this.label.querySelector(".ql-color-label"),i=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=i:r.style.fill=i)}}class jE extends iu{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=t[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const zk=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};class DE{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,zk(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){const t=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const i=this.boundsContainer.getBoundingClientRect(),o=this.root.getBoundingClientRect();let a=0;if(o.right>i.right&&(a=i.right-o.right,this.root.style.left=`${t+a}px`),o.left<i.left&&(a=i.left-o.left,this.root.style.left=`${t+a}px`),o.bottom>i.bottom){const s=o.bottom-o.top,l=e.bottom-e.top+s;this.root.style.top=`${r-l}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Xk=[!1,"center","right","justify"],Uk=["#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"],$k=[!1,"serif","monospace"],Yk=["1","2","3",!1],Zk=["small",!1,"large","huge"];class Es extends pa{constructor(e,t){super(e,t);const r=i=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(i.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(o=>{o.container.contains(i.target)||o.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(o=>{if(o.startsWith("ql-")&&(o=o.slice(3),t[o]!=null))if(o==="direction")r.innerHTML=t[o][""]+t[o].rtl;else if(typeof t[o]=="string")r.innerHTML=t[o];else{const a=r.value||"";a!=null&&t[o][a]&&(r.innerHTML=t[o][a])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(i=>{if(i.classList.contains("ql-align")&&(i.querySelector("option")==null&&Ia(i,Xk),typeof t.align=="object"))return new jE(i,t.align);if(i.classList.contains("ql-background")||i.classList.contains("ql-color")){const o=i.classList.contains("ql-background")?"background":"color";return i.querySelector("option")==null&&Ia(i,Uk,o==="background"?"#ffffff":"#000000"),new NE(i,t[o])}return i.querySelector("option")==null&&(i.classList.contains("ql-font")?Ia(i,$k):i.classList.contains("ql-header")?Ia(i,Yk):i.classList.contains("ql-size")&&Ia(i,Zk)),new iu(i)});const r=()=>{this.pickers.forEach(i=>{i.update()})};this.quill.on(ue.events.EDITOR_CHANGE,r)}}Es.DEFAULTS=Gt({},pa.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,n.files),n.value=""}),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class ME extends DE{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?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),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":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,ue.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,ue.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=Jk(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,ue.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",ue.sources.USER),this.quill.setSelection(r+2,ue.sources.USER)}break}}this.textbox.value="",this.hide()}}function Jk(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function Ia(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const i=document.createElement("option");r===t?i.setAttribute("selected","selected"):i.setAttribute("value",String(r)),n.appendChild(i)})}const Kk=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Qk extends ME{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(ue.events.EDITOR_CHANGE,(r,i,o,a)=>{if(r===ue.events.SELECTION_CHANGE)if(i!=null&&i.length>0&&a===ue.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const s=this.quill.getLines(i.index,i.length);if(s.length===1){const l=this.quill.getBounds(i);l!=null&&this.position(l)}else{const l=s[s.length-1],u=this.quill.getIndex(l),c=Math.min(l.length()-1,i.index+i.length-u),h=this.quill.getBounds(new $i(u,c));h!=null&&this.position(h)}}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(ue.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){const t=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",t!==0&&(r.style.marginLeft=`${-1*t-r.offsetWidth/2}px`),t}}class kE extends Es{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Kk),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Qk(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),us),this.buildPickers(e.container.querySelectorAll("select"),us))}}kE.DEFAULTS=Gt({},Es.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,Z.sources.USER)}}}}});const e3=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class t3 extends ME{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){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,ue.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(ue.events.SELECTION_CHANGE,(e,t,r)=>{if(e!=null){if(e.length===0&&r===ue.sources.USER){const[i,o]=this.quill.scroll.descendant(El,e.index);if(i!=null){this.linkRange=new $i(e.index-o,i.length());const a=El.formats(i.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const s=this.quill.getBounds(this.linkRange);s!=null&&this.position(s);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}class LE extends Es{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=e3),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"),us),this.buildPickers(e.container.querySelectorAll("select"),us),this.tooltip=new t3(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,r)=>{e.handlers.link.call(e,!r.format.link)}))}}LE.DEFAULTS=Gt({},Es.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const 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}`);const{tooltip:r}=this.quill.theme;r.edit("link",t)}else this.quill.format("link",!1,Z.sources.USER)}}}}});Z.register({"attributors/attribute/direction":yE,"attributors/class/align":mE,"attributors/class/background":aM,"attributors/class/color":oM,"attributors/class/direction":xE,"attributors/class/font":wE,"attributors/class/size":_E,"attributors/style/align":bE,"attributors/style/background":lg,"attributors/style/color":sg,"attributors/style/direction":CE,"attributors/style/font":AE,"attributors/style/size":TE},!0);Z.register({"formats/align":mE,"formats/direction":xE,"formats/indent":KM,"formats/background":lg,"formats/color":sg,"formats/font":wE,"formats/size":_E,"formats/blockquote":QM,"formats/code-block":Sn,"formats/header":ek,"formats/list":Cs,"formats/bold":fg,"formats/code":ug,"formats/italic":tk,"formats/link":El,"formats/script":nk,"formats/strike":rk,"formats/underline":ik,"formats/formula":ok,"formats/image":ak,"formats/video":sk,"modules/syntax":OE,"modules/table":uk,"modules/toolbar":gg,"themes/bubble":kE,"themes/snow":LE,"ui/icons":us,"ui/picker":iu,"ui/icon-picker":jE,"ui/color-picker":NE,"ui/tooltip":DE},!0);var ou=class extends m.Component{constructor(n){super(n),this.editingAreaRef=m.createRef(),this.containerRef=m.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=(t,r,i,o)=>{t==="text-change"?this.onEditorChangeText?.(this.props.useSemanticHTML!==!1?this.editor.getSemanticHTML():this.editor.root.innerHTML,r,o,this.unprivilegedEditor):t==="selection-change"&&this.onEditorChangeSelection?.(r,o,this.unprivilegedEditor)};const e=this.isControlled()?n.value:n.defaultValue;this.value=e??""}validateProps(n){if(m.Children.count(n.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(m.Children.count(n.children)&&m.Children.only(n.children)?.type==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.");if(this.lastDeltaChangeSet&&n.value===this.lastDeltaChangeSet)throw new 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(n,e){if(this.validateProps(n),!this.editor||this.state.generation!==e.generation)return!0;if("value"in n){const t=this.getEditorContents(),r=n.value??"";this.isEqualValue(r,t)||this.setEditorContents(this.editor,r)}return n.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,n.readOnly),[...this.cleanProps,...this.dirtyProps].some(t=>!Ei(n[t],this.props[t]))}shouldComponentRegenerate(n){return this.dirtyProps.some(e=>!Ei(n[e],this.props[e]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(n,e){if(this.editor&&this.shouldComponentRegenerate(n)){const t=this.editor.getContents(),r=this.editor.getSelection();this.regenerationSnapshot={delta:t,selection:r},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.editor&&n.placeholder!==this.props.placeholder&&(this.editor.root.dataset.placeholder=this.props.placeholder||""),this.state.generation!==e.generation){const{delta:t,selection:r}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const i=this.editor;i.setContents(t),Gy(()=>this.setEditorSelection(i,r))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){if(!this.editor)return;this.unhookEditor(this.editor);const n=this.props.modules?.toolbar;if(!(typeof n=="object"&&n&&"container"in n&&typeof n.container=="string"||typeof n=="string")){const t=this.containerRef.current?.querySelector(".ql-toolbar");t&&t.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 new Error("Accessing non-instantiated editor");return this.editor}createEditor(n,e){const t=new Z(n,e);return e.tabIndex!=null&&this.setEditorTabIndex(t,e.tabIndex),this.hookEditor(t),t}hookEditor(n){this.unprivilegedEditor=this.makeUnprivilegedEditor(n),n.on("editor-change",this.onEditorChange)}unhookEditor(n){n.off("editor-change",this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(n){return n&&n.ops}isEqualValue(n,e){return this.isDelta(n)&&this.isDelta(e)?Ei(n.ops,e.ops):Ei(n,e)}setEditorContents(n,e){this.value=e;const t=this.getEditorSelection();typeof e=="string"?n.setContents(n.clipboard.convert({html:e})):n.setContents(e),Gy(()=>this.setEditorSelection(n,t))}setEditorSelection(n,e){if(this.selection=e,e){const t=n.getLength();e.index=Math.max(0,Math.min(e.index,t-1)),e.length=Math.max(0,Math.min(e.length,t-1-e.index)),n.setSelection(e)}}setEditorTabIndex(n,e){n?.scroll?.domNode&&(n.scroll.domNode.tabIndex=e)}setEditorReadOnly(n,e){e?n.disable():n.enable()}makeUnprivilegedEditor(n){const e=n;return{getHTML:()=>e.root.innerHTML,getSemanticHTML:e.getSemanticHTML.bind(e),getLength:e.getLength.bind(e),getText:e.getText.bind(e),getContents:e.getContents.bind(e),getSelection:e.getSelection.bind(e),getBounds:e.getBounds.bind(e)}}getEditingArea(){const n=this.editingAreaRef.current;if(!n)throw new Error("Cannot find element for editing area");if(n.nodeType===3)throw new Error("Editing area cannot be a text node");return n}renderEditingArea(){const{children:n,preserveWhitespace:e}=this.props,{generation:t}=this.state;return m.Children.count(n)?m.cloneElement(m.Children.only(n),{key:t,ref:this.editingAreaRef}):e?p.jsx("pre",{ref:this.editingAreaRef},t):p.jsx("div",{ref:this.editingAreaRef},t)}render(){return 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(n,e,t,r){if(!this.editor)return;const i=this.isDelta(this.value)?r.getContents():this.props.useSemanticHTML!==!1?r.getSemanticHTML():r.getHTML();i!==this.getEditorContents()&&(this.lastDeltaChangeSet=e,this.value=i,this.props.onChange?.(n,e,t,r))}onEditorChangeSelection(n,e,t){if(!this.editor)return;const r=this.getEditorSelection(),i=!r&&n,o=r&&!n;Ei(n,r)||(this.selection=n,this.props.onChangeSelection?.(n,e,t),i?this.props.onFocus?.(n,e,t):o&&this.props.onBlur?.(r,e,t))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}};ou.displayName="React Quill";ou.Quill=Z;ou.defaultProps={theme:"snow",modules:{},readOnly:!1};function Gy(n){Promise.resolve().then(n)}var n3=ou;const r3={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"]]}},i3=In.styled("div")({"& .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 Al({text:n,setText:e}){const t=xn.useSelector(a=>be.getConfig(a)?.annotation?.quillConfig),{formats:r,modules:i}=m.useMemo(()=>t?.modules&&t?.formats?t:r3,[t]),o=a=>{e(a)};return p.jsx("div",{"data-text-editor":"name","data-testid":"textEditor",children:p.jsx(i3,{children:p.jsx(n3,{value:n,onChange:o,placeholder:"Your text here",bounds:'[data-text-editor="name"]',modules:i,formats:r})})})}Al.propTypes={setText:d.func.isRequired,text:d.string.isRequired};function PE({annoHtml:n,updateAnnotationBody:e,t}){return p.jsxs(q.Grid,{container:!0,direction:"column",spacing:1,children:[p.jsx(q.Grid,{container:!0,children:p.jsx(q.Typography,{variant:"formSectionTitle",children:t("note")})}),p.jsx(q.Grid,{container:!0,children:p.jsx(Al,{annoHtml:n,updateAnnotationBody:e})})]})}PE.propTypes={annoHtml:d.string.isRequired,t:d.func.isRequired,updateAnnotationBody:d.func.isRequired};function Se(){return Se=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Se.apply(null,arguments)}function Zi(n){"@babel/helpers - typeof";return Zi=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},Zi(n)}function o3(n,e){if(Zi(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(Zi(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function BE(n){var e=o3(n,"string");return Zi(e)=="symbol"?e:e+""}function Ua(n,e,t){return(e=BE(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qy(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function we(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qy(Object(t),!0).forEach(function(r){Ua(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):qy(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function a3(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Hy(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,BE(r.key),r)}}function s3(n,e,t){return e&&Hy(n.prototype,e),t&&Hy(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Bf(n,e){return Bf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},Bf(n,e)}function l3(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Bf(n,e)}function _l(n){return _l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_l(n)}function FE(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FE=function(){return!!n})()}function u3(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function c3(n,e){if(e&&(Zi(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return u3(n)}function d3(n){var e=FE();return function(){var t,r=_l(n);if(e){var i=_l(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return c3(this,t)}}function Ff(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function h3(n){if(Array.isArray(n))return Ff(n)}function f3(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function GE(n,e){if(n){if(typeof n=="string")return Ff(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ff(n,e):void 0}}function p3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
126
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
127
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ni(n,e){return g3(n)||m3(n,e)||GE(n,e)||b3()}function v3(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function Ur(n,e){if(n==null)return{};var t,r,i=v3(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function y3(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}const x3=Math.min,C3=Math.max,Tl=Math.round,Zs=Math.floor,Gf=n=>({x:n,y:n});function E3(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function au(){return typeof window<"u"}function qE(n){return VE(n)?(n.nodeName||"").toLowerCase():"#document"}function uo(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function HE(n){var e;return(e=(VE(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function VE(n){return au()?n instanceof Node||n instanceof uo(n).Node:!1}function w3(n){return au()?n instanceof Element||n instanceof uo(n).Element:!1}function mg(n){return au()?n instanceof HTMLElement||n instanceof uo(n).HTMLElement:!1}function Vy(n){return!au()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof uo(n).ShadowRoot}function WE(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=zE(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&i!=="inline"&&i!=="contents"}function A3(n){return/^(html|body|#document)$/.test(qE(n))}function zE(n){return uo(n).getComputedStyle(n)}function _3(n){if(qE(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Vy(n)&&n.host||HE(n);return Vy(e)?e.host:e}function XE(n){const e=_3(n);return A3(e)?(n.ownerDocument||n).body:mg(e)&&WE(e)?e:XE(e)}function Il(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=XE(n),o=i===((r=n.ownerDocument)==null?void 0:r.body),a=uo(i);if(o){const s=T3(a);return e.concat(a,a.visualViewport||[],WE(i)?i:[],s&&t?Il(s):[])}else return e.concat(i,Il(i,[],t))}function T3(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function I3(n){const e=zE(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=mg(n),o=i?n.offsetWidth:t,a=i?n.offsetHeight:r,s=Tl(t)!==o||Tl(r)!==a;return s&&(t=o,r=a),{width:t,height:r,$:s}}function bg(n){return w3(n)?n:n.contextElement}function S3(n){const e=bg(n);if(!mg(e))return Gf(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:o}=I3(e);let a=(o?Tl(t.width):t.width)/r,s=(o?Tl(t.height):t.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}function Wy(n,e,t,r){e===void 0&&(e=!1);const i=n.getBoundingClientRect();bg(n);let o=Gf(1);e&&(o=S3(n));const a=Gf(0);let s=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,c=i.height/o.y;return E3({width:u,height:c,x:s,y:l})}function UE(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function R3(n,e,t){let r=null,i;const o=HE(n);function a(){var c;clearTimeout(i),(c=r)==null||c.disconnect(),r=null}function s(c,h){c===void 0&&(c=!1),h===void 0&&(h=1),a();const f=n.getBoundingClientRect(),{left:b,top:x,width:w,height:g}=f;if(c||e(),!w||!g)return;const y=Zs(x),C=Zs(o.clientWidth-(b+w)),A=Zs(o.clientHeight-(x+g)),_=Zs(b),O={rootMargin:-y+"px "+-C+"px "+-A+"px "+-_+"px",threshold:C3(0,x3(1,h))||1};let T=!0;function D(M){const L=M[0].intersectionRatio;if(!UE(f,n.getBoundingClientRect()))return s();if(L!==h){if(!T)return s();L?s(!1,L):i=setTimeout(()=>{s(!1,1e-7)},1e3)}T=!1}try{r=new IntersectionObserver(D,{...O,root:o.ownerDocument})}catch{r=new IntersectionObserver(D,O)}r.observe(n)}const l=uo(n),u=()=>s(t);return l.addEventListener("resize",u),s(!0),()=>{l.removeEventListener("resize",u),a()}}function O3(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=bg(n),c=i||o?[...u?Il(u):[],...e?Il(e):[]]:[];c.forEach(y=>{i&&y.addEventListener("scroll",t),o&&y.addEventListener("resize",t)});const h=u&&s?R3(u,t,o):null;let f=-1,b=null;a&&(b=new ResizeObserver(y=>{let[C]=y;C&&C.target===u&&b&&e&&(b.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var A;(A=b)==null||A.observe(e)})),t()}),u&&!l&&b.observe(u),e&&b.observe(e));let x,w=l?Wy(n):null;l&&g();function g(){const y=Wy(n);w&&!UE(w,y)&&t(),w=y,x=requestAnimationFrame(g)}return t(),()=>{var y;c.forEach(C=>{i&&C.removeEventListener("scroll",t),o&&C.removeEventListener("resize",t)}),h?.(),(y=b)==null||y.disconnect(),b=null,l&&cancelAnimationFrame(x)}}var qf=m.useLayoutEffect,N3=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Sl=function(){};function j3(n,e){return e?e[0]==="-"?n+e:n+"__"+e:n}function D3(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];var o=[].concat(r);if(e&&n)for(var a in e)e.hasOwnProperty(a)&&e[a]&&o.push("".concat(j3(n,a)));return o.filter(function(s){return s}).map(function(s){return String(s).trim()}).join(" ")}var Rl=function(e){return H3(e)?e.filter(Boolean):Zi(e)==="object"&&e!==null?[e]:[]},$E=function(e){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;var t=Ur(e,N3);return we({},t)},qt=function(e,t,r){var i=e.cx,o=e.getStyles,a=e.getClassNames,s=e.className;return{css:o(t,e),className:i(r??{},a(t,e),s)}};function su(n){return[document.documentElement,document.body,window].indexOf(n)>-1}function M3(n){return su(n)?window.innerHeight:n.clientHeight}function YE(n){return su(n)?window.pageYOffset:n.scrollTop}function Ol(n,e){if(su(n)){window.scrollTo(0,e);return}n.scrollTop=e}function k3(n){var e=getComputedStyle(n),t=e.position==="absolute",r=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var i=n;i=i.parentElement;)if(e=getComputedStyle(i),!(t&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX))return i;return document.documentElement}function L3(n,e,t,r){return t*((n=n/r-1)*n*n+1)+e}function Js(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Sl,i=YE(n),o=e-i,a=10,s=0;function l(){s+=a;var u=L3(s,i,o,t);Ol(n,u),s<t?window.requestAnimationFrame(l):r(n)}l()}function zy(n,e){var t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=e.offsetHeight/3;r.bottom+i>t.bottom?Ol(n,Math.min(e.offsetTop+e.clientHeight-n.offsetHeight+i,n.scrollHeight)):r.top-i<t.top&&Ol(n,Math.max(e.offsetTop-i,0))}function P3(n){var e=n.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function Xy(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function B3(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var ZE=!1,F3={get passive(){return ZE=!0}},Ks=typeof window<"u"?window:{};Ks.addEventListener&&Ks.removeEventListener&&(Ks.addEventListener("p",Sl,F3),Ks.removeEventListener("p",Sl,!1));var G3=ZE;function q3(n){return n!=null}function H3(n){return Array.isArray(n)}function $a(n,e,t){return n?e:t}var V3=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];var o=Object.entries(e).filter(function(a){var s=ni(a,1),l=s[0];return!r.includes(l)});return o.reduce(function(a,s){var l=ni(s,2),u=l[0],c=l[1];return a[u]=c,a},{})},W3=["children","innerProps"],z3=["children","innerProps"];function X3(n){var e=n.maxHeight,t=n.menuEl,r=n.minHeight,i=n.placement,o=n.shouldScroll,a=n.isFixedPosition,s=n.controlHeight,l=k3(t),u={placement:"bottom",maxHeight:e};if(!t||!t.offsetParent)return u;var c=l.getBoundingClientRect(),h=c.height,f=t.getBoundingClientRect(),b=f.bottom,x=f.height,w=f.top,g=t.offsetParent.getBoundingClientRect(),y=g.top,C=a?window.innerHeight:M3(l),A=YE(l),_=parseInt(getComputedStyle(t).marginBottom,10),N=parseInt(getComputedStyle(t).marginTop,10),O=y-N,T=C-w,D=O+A,M=h-A-w,L=b-C+A+_,E=A+w-N,S=160;switch(i){case"auto":case"bottom":if(T>=x)return{placement:"bottom",maxHeight:e};if(M>=x&&!a)return o&&Js(l,L,S),{placement:"bottom",maxHeight:e};if(!a&&M>=r||a&&T>=r){o&&Js(l,L,S);var I=a?T-_:M-_;return{placement:"bottom",maxHeight:I}}if(i==="auto"||a){var P=e,B=a?O:D;return B>=r&&(P=Math.min(B-_-s,e)),{placement:"top",maxHeight:P}}if(i==="bottom")return o&&Ol(l,L),{placement:"bottom",maxHeight:e};break;case"top":if(O>=x)return{placement:"top",maxHeight:e};if(D>=x&&!a)return o&&Js(l,E,S),{placement:"top",maxHeight:e};if(!a&&D>=r||a&&O>=r){var F=e;return(!a&&D>=r||a&&O>=r)&&(F=a?O-N:D-N),o&&Js(l,E,S),{placement:"top",maxHeight:F}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function U3(n){var e={bottom:"top",top:"bottom"};return n?e[n]:"bottom"}var JE=function(e){return e==="auto"?"bottom":e},$3=function(e,t){var r,i=e.placement,o=e.theme,a=o.borderRadius,s=o.spacing,l=o.colors;return we((r={label:"menu"},Ua(r,U3(i),"100%"),Ua(r,"position","absolute"),Ua(r,"width","100%"),Ua(r,"zIndex",1),r),t?{}:{backgroundColor:l.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},KE=m.createContext(null),Y3=function(e){var t=e.children,r=e.minMenuHeight,i=e.maxMenuHeight,o=e.menuPlacement,a=e.menuPosition,s=e.menuShouldScrollIntoView,l=e.theme,u=m.useContext(KE)||{},c=u.setPortalPlacement,h=m.useRef(null),f=m.useState(i),b=ni(f,2),x=b[0],w=b[1],g=m.useState(null),y=ni(g,2),C=y[0],A=y[1],_=l.spacing.controlHeight;return qf(function(){var N=h.current;if(N){var O=a==="fixed",T=s&&!O,D=X3({maxHeight:i,menuEl:N,minHeight:r,placement:o,shouldScroll:T,isFixedPosition:O,controlHeight:_});w(D.maxHeight),A(D.placement),c?.(D.placement)}},[i,o,a,s,r,c,_]),t({ref:h,placerProps:we(we({},e),{},{placement:C||JE(o),maxHeight:x})})},Z3=function(e){var t=e.children,r=e.innerRef,i=e.innerProps;return xe.jsx("div",Se({},qt(e,"menu",{menu:!0}),{ref:r},i),t)},J3=Z3,K3=function(e,t){var r=e.maxHeight,i=e.theme.spacing.baseUnit;return we({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:i,paddingTop:i})},Q3=function(e){var t=e.children,r=e.innerProps,i=e.innerRef,o=e.isMulti;return xe.jsx("div",Se({},qt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),t)},QE=function(e,t){var r=e.theme,i=r.spacing.baseUnit,o=r.colors;return we({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},eL=QE,tL=QE,nL=function(e){var t=e.children,r=t===void 0?"No options":t,i=e.innerProps,o=Ur(e,W3);return xe.jsx("div",Se({},qt(we(we({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},rL=function(e){var t=e.children,r=t===void 0?"Loading...":t,i=e.innerProps,o=Ur(e,z3);return xe.jsx("div",Se({},qt(we(we({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},iL=function(e){var t=e.rect,r=e.offset,i=e.position;return{left:t.left,position:i,top:r,width:t.width,zIndex:1}},oL=function(e){var t=e.appendTo,r=e.children,i=e.controlElement,o=e.innerProps,a=e.menuPlacement,s=e.menuPosition,l=m.useRef(null),u=m.useRef(null),c=m.useState(JE(a)),h=ni(c,2),f=h[0],b=h[1],x=m.useMemo(function(){return{setPortalPlacement:b}},[]),w=m.useState(null),g=ni(w,2),y=g[0],C=g[1],A=m.useCallback(function(){if(i){var T=P3(i),D=s==="fixed"?0:window.pageYOffset,M=T[f]+D;(M!==y?.offset||T.left!==y?.rect.left||T.width!==y?.rect.width)&&C({offset:M,rect:T})}},[i,s,f,y?.offset,y?.rect.left,y?.rect.width]);qf(function(){A()},[A]);var _=m.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&l.current&&(u.current=O3(i,l.current,A,{elementResize:"ResizeObserver"in window}))},[i,A]);qf(function(){_()},[_]);var N=m.useCallback(function(T){l.current=T,_()},[_]);if(!t&&s!=="fixed"||!y)return null;var O=xe.jsx("div",Se({ref:N},qt(we(we({},e),{},{offset:y.offset,position:s,rect:y.rect}),"menuPortal",{"menu-portal":!0}),o),r);return xe.jsx(KE.Provider,{value:x},t?j1.createPortal(O,t):O)},aL=function(e){var t=e.isDisabled,r=e.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},sL=function(e){var t=e.children,r=e.innerProps,i=e.isDisabled,o=e.isRtl;return xe.jsx("div",Se({},qt(e,"container",{"--is-disabled":i,"--is-rtl":o}),r),t)},lL=function(e,t){var r=e.theme.spacing,i=e.isMulti,o=e.hasValue,a=e.selectProps.controlShouldRenderValue;return we({alignItems:"center",display:i&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},uL=function(e){var t=e.children,r=e.innerProps,i=e.isMulti,o=e.hasValue;return xe.jsx("div",Se({},qt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),t)},cL=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},dL=function(e){var t=e.children,r=e.innerProps;return xe.jsx("div",Se({},qt(e,"indicatorsContainer",{indicators:!0}),r),t)},Uy,hL=["size"],fL=["innerProps","isRtl","size"];function pL(){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 gL=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:pL},ew=function(e){var t=e.size,r=Ur(e,hL);return xe.jsx("svg",Se({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:gL},r))},vg=function(e){return xe.jsx(ew,Se({size:20},e),xe.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"}))},tw=function(e){return xe.jsx(ew,Se({size:20},e),xe.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"}))},nw=function(e,t){var r=e.isFocused,i=e.theme,o=i.spacing.baseUnit,a=i.colors;return we({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:r?a.neutral60:a.neutral20,padding:o*2,":hover":{color:r?a.neutral80:a.neutral40}})},mL=nw,bL=function(e){var t=e.children,r=e.innerProps;return xe.jsx("div",Se({},qt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),t||xe.jsx(tw,null))},vL=nw,yL=function(e){var t=e.children,r=e.innerProps;return xe.jsx("div",Se({},qt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),t||xe.jsx(vg,null))},xL=function(e,t){var r=e.isDisabled,i=e.theme,o=i.spacing.baseUnit,a=i.colors;return we({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:r?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},CL=function(e){var t=e.innerProps;return xe.jsx("span",Se({},t,qt(e,"indicatorSeparator",{"indicator-separator":!0})))},EL=xe.keyframes(Uy||(Uy=y3([`
|
|
124
|
+
`,{[Sn.blotName]:t}),a.insert(s)),o)],new WeakMap)}}XE.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"}]};class _r extends pn{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",wg()),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(e,t){e===_r.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class Ji extends uo{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),r=this.next.children.head.formats(),i=this.next.children.tail.formats();return e.table===t.table&&e.table===r.table&&e.table===i.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const r=t.formats(),i=t.next.formats();if(r.table!==i.table){const o=this.splitAfter(t);o&&o.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class Ii extends uo{static blotName="table-body";static tagName="TBODY"}class Tl extends uo{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Ji),t=e.reduce((r,i)=>Math.max(i.children.length,r),0);e.forEach(r=>{new Array(t-r.children.length).fill(0).forEach(()=>{let i;r.children.head!=null&&(i=_r.formats(r.children.head.domNode));const o=this.scroll.create(_r.blotName,i);r.appendChild(o),o.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){const[t]=this.descendant(Ii);t==null||t.children.head==null||t.children.forEach(r=>{const i=r.children.at(e);i?.remove()})}insertColumn(e){const[t]=this.descendant(Ii);t==null||t.children.head==null||t.children.forEach(r=>{const i=r.children.at(e),o=_r.formats(r.children.head.domNode),a=this.scroll.create(_r.blotName,o);r.insertBefore(a,i)})}insertRow(e){const[t]=this.descendant(Ii);if(t==null||t.children.head==null)return;const r=wg(),i=this.scroll.create(Ji.blotName);t.children.head.children.forEach(()=>{const a=this.scroll.create(_r.blotName,r);i.appendChild(a)});const o=t.children.at(e);t.insertBefore(i,o)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}Tl.allowedChildren=[Ii];Ii.requiredContainer=Tl;Ii.allowedChildren=[Ji];Ji.requiredContainer=Ii;Ji.allowedChildren=[_r];_r.requiredContainer=Ji;function wg(){return`row-${Math.random().toString(36).slice(2,6)}`}class j3 extends Ur{static register(){Z.register(_r),Z.register(Ji),Z.register(Ii),Z.register(Tl)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Tl).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(Z.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(Z.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(Z.sources.USER),this.quill.setSelection(t,Z.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];const[t,r]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==_r.blotName)return[null,null,null,-1];const i=t.parent;return[i.parent.parent,i,t,r]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[r,i,o]=this.getTable(t);if(o==null)return;const a=o.cellOffset();r.insertColumn(a+e),this.quill.update(Z.sources.USER);let s=i.rowOffset();e===0&&(s+=1),this.quill.setSelection(t.index+s,t.length,Z.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[r,i,o]=this.getTable(t);if(o==null)return;const a=i.rowOffset();r.insertRow(a+e),this.quill.update(Z.sources.USER),e>0?this.quill.setSelection(t,Z.sources.SILENT):this.quill.setSelection(t.index+i.children.length,t.length,Z.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const r=this.quill.getSelection();if(r==null)return;const i=new Array(e).fill(0).reduce(o=>{const a=new Array(t).fill(`
|
|
125
|
+
`).join("");return o.insert(a,{table:wg()})},new fe().retain(r.index));this.quill.updateContents(i,Z.sources.USER),this.quill.setSelection(r.index,Z.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(Z.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(Z.events.TEXT_CHANGE,(r,i,o)=>{o===Z.sources.USER&&this.balanceTables()}),!0):!1)})}}const $y=ui("quill:toolbar");class _g extends Ur{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),N3(r,this.options.container),e.container?.parentNode?.insertBefore(r,e.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){$y.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(r=>{const i=this.options.handlers?.[r];i&&this.addHandler(r,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(r=>{this.attach(r)}),this.quill.on(Z.events.EDITOR_CHANGE,()=>{const[r]=this.quill.selection.getRange();this.update(r)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(i=>i.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){$y.warn("ignoring attaching to nonexistent format",t,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,i=>{let o;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const s=e.options[e.selectedIndex];s.hasAttribute("selected")?o=!1:o=s.value||!1}else e.classList.contains("ql-active")?o=!1:o=e.value||!e.hasAttribute("value"),i.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,o);else if(this.quill.scroll.query(t).prototype instanceof Yn){if(o=prompt(`Enter ${t}`),!o)return;this.quill.updateContents(new fe().retain(a.index).delete(a.length).insert({[t]:o}),Z.sources.USER)}else this.quill.format(t,o,Z.sources.USER);this.update(a)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[i,o]=r;if(o.tagName==="SELECT"){let a=null;if(e==null)a=null;else if(t[i]==null)a=o.querySelector("option[selected]");else if(!Array.isArray(t[i])){let s=t[i];typeof s=="string"&&(s=s.replace(/"/g,'\\"')),a=o.querySelector(`option[value="${s}"]`)}a==null?(o.value="",o.selectedIndex=-1):a.selected=!0}else if(e==null)o.classList.remove("ql-active"),o.setAttribute("aria-pressed","false");else if(o.hasAttribute("value")){const a=t[i],s=a===o.getAttribute("value")||a!=null&&a.toString()===o.getAttribute("value")||a==null&&!o.getAttribute("value");o.classList.toggle("ql-active",s),o.setAttribute("aria-pressed",s.toString())}else{const a=t[i]!=null;o.classList.toggle("ql-active",a),o.setAttribute("aria-pressed",a.toString())}})}}_g.DEFAULTS={};function Yy(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function N3(n,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach(i=>{if(typeof i=="string")Yy(r,i);else{const o=Object.keys(i)[0],a=i[o];Array.isArray(a)?D3(r,o,a):Yy(r,o,a)}}),n.appendChild(r)})}function D3(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach(i=>{const o=document.createElement("option");i!==!1?o.setAttribute("value",String(i)):o.setAttribute("selected","selected"),r.appendChild(o)}),n.appendChild(r)}_g.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(t=>{this.quill.scroll.query(t,ge.INLINE)!=null&&this.quill.format(t,!1,Z.sources.USER)})}else this.quill.removeFormat(n.index,n.length,Z.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",Z.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,Z.sources.USER),this.quill.format("direction",n,Z.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),r=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let i=n==="+1"?1:-1;t.direction==="rtl"&&(i*=-1),this.quill.format("indent",r+i,Z.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,Z.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,Z.sources.USER):this.quill.format("list","unchecked",Z.sources.USER):this.quill.format("list",n,Z.sources.USER)}}};const M3='<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>',k3='<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>',P3='<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>',L3='<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>',B3='<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>',F3='<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>',G3='<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>',q3='<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>',Zy='<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>',H3='<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>',V3='<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>',W3='<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>',z3='<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>',X3='<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>',U3='<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>',Y3='<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>',Z3='<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>',J3='<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>',K3='<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>',Q3='<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>',ek='<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>',tk='<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>',nk='<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>',rk='<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>',ik='<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>',ok='<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>',ak='<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>',sk='<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>',lk='<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>',uk='<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>',ck='<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>',dk='<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>',cs={align:{"":M3,center:k3,right:P3,justify:L3},background:B3,blockquote:F3,bold:G3,clean:q3,code:Zy,"code-block":Zy,color:H3,direction:{"":V3,rtl:W3},formula:z3,header:{1:X3,2:U3,3:$3,4:Y3,5:Z3,6:J3},italic:K3,image:Q3,indent:{"+1":ek,"-1":tk},link:nk,list:{bullet:rk,check:ik,ordered:ok},script:{sub:ak,super:sk},strike:lk,table:uk,underline:ck,video:dk},hk='<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>';let Jy=0;function Ky(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class lu{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",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Ky(this.label,"aria-expanded"),Ky(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&t.setAttribute("data-value",r),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",i=>{switch(i.key){case"Enter":this.selectItem(t,!0),i.preventDefault();break;case"Escape":this.escape(),i.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=hk,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${Jy}`,Jy+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)}),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]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r?.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){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class UE extends lu{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(r=>{r.classList.add("ql-primary")})}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const r=this.label.querySelector(".ql-color-label"),i=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=i:r.style.fill=i)}}class $E extends lu{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=t[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const fk=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};class YE{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,fk(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){const t=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const i=this.boundsContainer.getBoundingClientRect(),o=this.root.getBoundingClientRect();let a=0;if(o.right>i.right&&(a=i.right-o.right,this.root.style.left=`${t+a}px`),o.left<i.left&&(a=i.left-o.left,this.root.style.left=`${t+a}px`),o.bottom>i.bottom){const s=o.bottom-o.top,l=e.bottom-e.top+s;this.root.style.top=`${r-l}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const pk=[!1,"center","right","justify"],gk=["#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"],mk=[!1,"serif","monospace"],bk=["1","2","3",!1],vk=["small",!1,"large","huge"];class _s extends ga{constructor(e,t){super(e,t);const r=i=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(i.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(o=>{o.container.contains(i.target)||o.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(o=>{if(o.startsWith("ql-")&&(o=o.slice(3),t[o]!=null))if(o==="direction")r.innerHTML=t[o][""]+t[o].rtl;else if(typeof t[o]=="string")r.innerHTML=t[o];else{const a=r.value||"";a!=null&&t[o][a]&&(r.innerHTML=t[o][a])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(i=>{if(i.classList.contains("ql-align")&&(i.querySelector("option")==null&&Sa(i,pk),typeof t.align=="object"))return new $E(i,t.align);if(i.classList.contains("ql-background")||i.classList.contains("ql-color")){const o=i.classList.contains("ql-background")?"background":"color";return i.querySelector("option")==null&&Sa(i,gk,o==="background"?"#ffffff":"#000000"),new UE(i,t[o])}return i.querySelector("option")==null&&(i.classList.contains("ql-font")?Sa(i,mk):i.classList.contains("ql-header")?Sa(i,bk):i.classList.contains("ql-size")&&Sa(i,vk)),new lu(i)});const r=()=>{this.pickers.forEach(i=>{i.update()})};this.quill.on(ue.events.EDITOR_CHANGE,r)}}_s.DEFAULTS=qt({},ga.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,n.files),n.value=""}),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class ZE extends YE{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?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),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":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,ue.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,ue.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=yk(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,ue.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",ue.sources.USER),this.quill.setSelection(r+2,ue.sources.USER)}break}}this.textbox.value="",this.hide()}}function yk(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function Sa(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const i=document.createElement("option");r===t?i.setAttribute("selected","selected"):i.setAttribute("value",String(r)),n.appendChild(i)})}const xk=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Ck extends ZE{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(ue.events.EDITOR_CHANGE,(r,i,o,a)=>{if(r===ue.events.SELECTION_CHANGE)if(i!=null&&i.length>0&&a===ue.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const s=this.quill.getLines(i.index,i.length);if(s.length===1){const l=this.quill.getBounds(i);l!=null&&this.position(l)}else{const l=s[s.length-1],u=this.quill.getIndex(l),c=Math.min(l.length()-1,i.index+i.length-u),h=this.quill.getBounds(new Zi(u,c));h!=null&&this.position(h)}}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(ue.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){const t=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",t!==0&&(r.style.marginLeft=`${-1*t-r.offsetWidth/2}px`),t}}class JE extends _s{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=xk),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Ck(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),cs),this.buildPickers(e.container.querySelectorAll("select"),cs))}}JE.DEFAULTS=qt({},_s.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,Z.sources.USER)}}}}});const Ek=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class wk extends ZE{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){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,ue.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(ue.events.SELECTION_CHANGE,(e,t,r)=>{if(e!=null){if(e.length===0&&r===ue.sources.USER){const[i,o]=this.quill.scroll.descendant(Al,e.index);if(i!=null){this.linkRange=new Zi(e.index-o,i.length());const a=Al.formats(i.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const s=this.quill.getBounds(this.linkRange);s!=null&&this.position(s);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}class KE extends _s{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Ek),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"),cs),this.buildPickers(e.container.querySelectorAll("select"),cs),this.tooltip=new wk(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,r)=>{e.handlers.link.call(e,!r.format.link)}))}}KE.DEFAULTS=qt({},_s.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const 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}`);const{tooltip:r}=this.quill.theme;r.edit("link",t)}else this.quill.format("link",!1,Z.sources.USER)}}}}});Z.register({"attributors/attribute/direction":kE,"attributors/class/align":NE,"attributors/class/background":SM,"attributors/class/color":IM,"attributors/class/direction":PE,"attributors/class/font":FE,"attributors/class/size":qE,"attributors/style/align":DE,"attributors/style/background":bg,"attributors/style/color":mg,"attributors/style/direction":LE,"attributors/style/font":GE,"attributors/style/size":HE},!0);Z.register({"formats/align":NE,"formats/direction":PE,"formats/indent":x3,"formats/background":bg,"formats/color":mg,"formats/font":FE,"formats/size":qE,"formats/blockquote":C3,"formats/code-block":Sn,"formats/header":E3,"formats/list":ws,"formats/bold":Eg,"formats/code":vg,"formats/italic":w3,"formats/link":Al,"formats/script":_3,"formats/strike":A3,"formats/underline":T3,"formats/formula":I3,"formats/image":S3,"formats/video":R3,"modules/syntax":XE,"modules/table":j3,"modules/toolbar":_g,"themes/bubble":JE,"themes/snow":KE,"ui/icons":cs,"ui/picker":lu,"ui/icon-picker":$E,"ui/color-picker":UE,"ui/tooltip":YE},!0);var uu=class extends m.Component{constructor(n){super(n),this.editingAreaRef=m.createRef(),this.containerRef=m.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=(t,r,i,o)=>{t==="text-change"?this.onEditorChangeText?.(this.props.useSemanticHTML!==!1?this.editor.getSemanticHTML():this.editor.root.innerHTML,r,o,this.unprivilegedEditor):t==="selection-change"&&this.onEditorChangeSelection?.(r,o,this.unprivilegedEditor)};const e=this.isControlled()?n.value:n.defaultValue;this.value=e??""}validateProps(n){if(m.Children.count(n.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(m.Children.count(n.children)&&m.Children.only(n.children)?.type==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.");if(this.lastDeltaChangeSet&&n.value===this.lastDeltaChangeSet)throw new 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(n,e){if(this.validateProps(n),!this.editor||this.state.generation!==e.generation)return!0;if("value"in n){const t=this.getEditorContents(),r=n.value??"";this.isEqualValue(r,t)||this.setEditorContents(this.editor,r)}return n.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,n.readOnly),[...this.cleanProps,...this.dirtyProps].some(t=>!wi(n[t],this.props[t]))}shouldComponentRegenerate(n){return this.dirtyProps.some(e=>!wi(n[e],this.props[e]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(n,e){if(this.editor&&this.shouldComponentRegenerate(n)){const t=this.editor.getContents(),r=this.editor.getSelection();this.regenerationSnapshot={delta:t,selection:r},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.editor&&n.placeholder!==this.props.placeholder&&(this.editor.root.dataset.placeholder=this.props.placeholder||""),this.state.generation!==e.generation){const{delta:t,selection:r}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const i=this.editor;i.setContents(t),Qy(()=>this.setEditorSelection(i,r))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){if(!this.editor)return;this.unhookEditor(this.editor);const n=this.props.modules?.toolbar;if(!(typeof n=="object"&&n&&"container"in n&&typeof n.container=="string"||typeof n=="string")){const t=this.containerRef.current?.querySelector(".ql-toolbar");t&&t.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 new Error("Accessing non-instantiated editor");return this.editor}createEditor(n,e){const t=new Z(n,e);return e.tabIndex!=null&&this.setEditorTabIndex(t,e.tabIndex),this.hookEditor(t),t}hookEditor(n){this.unprivilegedEditor=this.makeUnprivilegedEditor(n),n.on("editor-change",this.onEditorChange)}unhookEditor(n){n.off("editor-change",this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(n){return n&&n.ops}isEqualValue(n,e){return this.isDelta(n)&&this.isDelta(e)?wi(n.ops,e.ops):wi(n,e)}setEditorContents(n,e){this.value=e;const t=this.getEditorSelection();typeof e=="string"?n.setContents(n.clipboard.convert({html:e})):n.setContents(e),Qy(()=>this.setEditorSelection(n,t))}setEditorSelection(n,e){if(this.selection=e,e){const t=n.getLength();e.index=Math.max(0,Math.min(e.index,t-1)),e.length=Math.max(0,Math.min(e.length,t-1-e.index)),n.setSelection(e)}}setEditorTabIndex(n,e){n?.scroll?.domNode&&(n.scroll.domNode.tabIndex=e)}setEditorReadOnly(n,e){e?n.disable():n.enable()}makeUnprivilegedEditor(n){const e=n;return{getHTML:()=>e.root.innerHTML,getSemanticHTML:e.getSemanticHTML.bind(e),getLength:e.getLength.bind(e),getText:e.getText.bind(e),getContents:e.getContents.bind(e),getSelection:e.getSelection.bind(e),getBounds:e.getBounds.bind(e)}}getEditingArea(){const n=this.editingAreaRef.current;if(!n)throw new Error("Cannot find element for editing area");if(n.nodeType===3)throw new Error("Editing area cannot be a text node");return n}renderEditingArea(){const{children:n,preserveWhitespace:e}=this.props,{generation:t}=this.state;return m.Children.count(n)?m.cloneElement(m.Children.only(n),{key:t,ref:this.editingAreaRef}):e?f.jsx("pre",{ref:this.editingAreaRef},t):f.jsx("div",{ref:this.editingAreaRef},t)}render(){return f.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(n,e,t,r){if(!this.editor)return;const i=this.isDelta(this.value)?r.getContents():this.props.useSemanticHTML!==!1?r.getSemanticHTML():r.getHTML();i!==this.getEditorContents()&&(this.lastDeltaChangeSet=e,this.value=i,this.props.onChange?.(n,e,t,r))}onEditorChangeSelection(n,e,t){if(!this.editor)return;const r=this.getEditorSelection(),i=!r&&n,o=r&&!n;wi(n,r)||(this.selection=n,this.props.onChangeSelection?.(n,e,t),i?this.props.onFocus?.(n,e,t):o&&this.props.onBlur?.(r,e,t))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}};uu.displayName="React Quill";uu.Quill=Z;uu.defaultProps={theme:"snow",modules:{},readOnly:!1};function Qy(n){Promise.resolve().then(n)}var _k=uu;const Ak={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"]]}},Tk=In.styled("div")({"& .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 Il({text:n,setText:e}){const t=xn.useSelector(a=>pe.getConfig(a)?.annotation?.quillConfig),{formats:r,modules:i}=m.useMemo(()=>t?.modules&&t?.formats?t:Ak,[t]),o=a=>{e(a)};return f.jsx("div",{"data-text-editor":"name","data-testid":"textEditor",children:f.jsx(Tk,{children:f.jsx(_k,{value:n,onChange:o,placeholder:"Your text here",bounds:'[data-text-editor="name"]',modules:i,formats:r})})})}Il.propTypes={setText:d.func.isRequired,text:d.string.isRequired};function QE({annoHtml:n,updateAnnotationBody:e,t}){return f.jsxs(G.Grid,{container:!0,direction:"column",spacing:1,children:[f.jsx(G.Grid,{container:!0,children:f.jsx(G.Typography,{variant:"formSectionTitle",children:t("note")})}),f.jsx(G.Grid,{container:!0,children:f.jsx(Il,{annoHtml:n,updateAnnotationBody:e})})]})}QE.propTypes={annoHtml:d.string.isRequired,t:d.func.isRequired,updateAnnotationBody:d.func.isRequired};function Se(){return Se=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Se.apply(null,arguments)}function Ki(n){"@babel/helpers - typeof";return Ki=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},Ki(n)}function Ik(n,e){if(Ki(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(Ki(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ew(n){var e=Ik(n,"string");return Ki(e)=="symbol"?e:e+""}function $a(n,e,t){return(e=ew(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function e1(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function _e(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?e1(Object(t),!0).forEach(function(r){$a(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):e1(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Sk(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function t1(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,ew(r.key),r)}}function Rk(n,e,t){return e&&t1(n.prototype,e),t&&t1(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Vf(n,e){return Vf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},Vf(n,e)}function Ok(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Vf(n,e)}function Sl(n){return Sl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sl(n)}function tw(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tw=function(){return!!n})()}function jk(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Nk(n,e){if(e&&(Ki(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jk(n)}function Dk(n){var e=tw();return function(){var t,r=Sl(n);if(e){var i=Sl(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return Nk(this,t)}}function Wf(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function Mk(n){if(Array.isArray(n))return Wf(n)}function kk(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function nw(n,e){if(n){if(typeof n=="string")return Wf(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Wf(n,e):void 0}}function Pk(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
126
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ta(n){return Mk(n)||kk(n)||nw(n)||Pk()}function Lk(n){if(Array.isArray(n))return n}function Bk(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function Fk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
127
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ri(n,e){return Lk(n)||Bk(n,e)||nw(n,e)||Fk()}function Gk(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function $r(n,e){if(n==null)return{};var t,r,i=Gk(n,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(i[t]=n[t])}return i}function qk(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}const Hk=Math.min,Vk=Math.max,Rl=Math.round,Ks=Math.floor,zf=n=>({x:n,y:n});function Wk(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function cu(){return typeof window<"u"}function rw(n){return ow(n)?(n.nodeName||"").toLowerCase():"#document"}function fo(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function iw(n){var e;return(e=(ow(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function ow(n){return cu()?n instanceof Node||n instanceof fo(n).Node:!1}function zk(n){return cu()?n instanceof Element||n instanceof fo(n).Element:!1}function Ag(n){return cu()?n instanceof HTMLElement||n instanceof fo(n).HTMLElement:!1}function n1(n){return!cu()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof fo(n).ShadowRoot}function aw(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=sw(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&i!=="inline"&&i!=="contents"}function Xk(n){return/^(html|body|#document)$/.test(rw(n))}function sw(n){return fo(n).getComputedStyle(n)}function Uk(n){if(rw(n)==="html")return n;const e=n.assignedSlot||n.parentNode||n1(n)&&n.host||iw(n);return n1(e)?e.host:e}function lw(n){const e=Uk(n);return Xk(e)?(n.ownerDocument||n).body:Ag(e)&&aw(e)?e:lw(e)}function Ol(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=lw(n),o=i===((r=n.ownerDocument)==null?void 0:r.body),a=fo(i);if(o){const s=$k(a);return e.concat(a,a.visualViewport||[],aw(i)?i:[],s&&t?Ol(s):[])}else return e.concat(i,Ol(i,[],t))}function $k(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Yk(n){const e=sw(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Ag(n),o=i?n.offsetWidth:t,a=i?n.offsetHeight:r,s=Rl(t)!==o||Rl(r)!==a;return s&&(t=o,r=a),{width:t,height:r,$:s}}function Tg(n){return zk(n)?n:n.contextElement}function Zk(n){const e=Tg(n);if(!Ag(e))return zf(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:o}=Yk(e);let a=(o?Rl(t.width):t.width)/r,s=(o?Rl(t.height):t.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}function r1(n,e,t,r){e===void 0&&(e=!1);const i=n.getBoundingClientRect();Tg(n);let o=zf(1);e&&(o=Zk(n));const a=zf(0);let s=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,c=i.height/o.y;return Wk({width:u,height:c,x:s,y:l})}function uw(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function Jk(n,e,t){let r=null,i;const o=iw(n);function a(){var c;clearTimeout(i),(c=r)==null||c.disconnect(),r=null}function s(c,h){c===void 0&&(c=!1),h===void 0&&(h=1),a();const p=n.getBoundingClientRect(),{left:b,top:x,width:E,height:g}=p;if(c||e(),!E||!g)return;const v=Ks(x),C=Ks(o.clientWidth-(b+E)),A=Ks(o.clientHeight-(x+g)),_=Ks(b),R={rootMargin:-v+"px "+-C+"px "+-A+"px "+-_+"px",threshold:Vk(0,Hk(1,h))||1};let I=!0;function N(L){const B=L[0].intersectionRatio;if(!uw(p,n.getBoundingClientRect()))return s();if(B!==h){if(!I)return s();B?s(!1,B):i=setTimeout(()=>{s(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(N,{...R,root:o.ownerDocument})}catch{r=new IntersectionObserver(N,R)}r.observe(n)}const l=fo(n),u=()=>s(t);return l.addEventListener("resize",u),s(!0),()=>{l.removeEventListener("resize",u),a()}}function Kk(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Tg(n),c=i||o?[...u?Ol(u):[],...e?Ol(e):[]]:[];c.forEach(v=>{i&&v.addEventListener("scroll",t),o&&v.addEventListener("resize",t)});const h=u&&s?Jk(u,t,o):null;let p=-1,b=null;a&&(b=new ResizeObserver(v=>{let[C]=v;C&&C.target===u&&b&&e&&(b.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var A;(A=b)==null||A.observe(e)})),t()}),u&&!l&&b.observe(u),e&&b.observe(e));let x,E=l?r1(n):null;l&&g();function g(){const v=r1(n);E&&!uw(E,v)&&t(),E=v,x=requestAnimationFrame(g)}return t(),()=>{var v;c.forEach(C=>{i&&C.removeEventListener("scroll",t),o&&C.removeEventListener("resize",t)}),h?.(),(v=b)==null||v.disconnect(),b=null,l&&cancelAnimationFrame(x)}}var Xf=m.useLayoutEffect,Qk=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],jl=function(){};function eP(n,e){return e?e[0]==="-"?n+e:n+"__"+e:n}function tP(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];var o=[].concat(r);if(e&&n)for(var a in e)e.hasOwnProperty(a)&&e[a]&&o.push("".concat(eP(n,a)));return o.filter(function(s){return s}).map(function(s){return String(s).trim()}).join(" ")}var Nl=function(e){return cP(e)?e.filter(Boolean):Ki(e)==="object"&&e!==null?[e]:[]},cw=function(e){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;var t=$r(e,Qk);return _e({},t)},Ht=function(e,t,r){var i=e.cx,o=e.getStyles,a=e.getClassNames,s=e.className;return{css:o(t,e),className:i(r??{},a(t,e),s)}};function du(n){return[document.documentElement,document.body,window].indexOf(n)>-1}function nP(n){return du(n)?window.innerHeight:n.clientHeight}function dw(n){return du(n)?window.pageYOffset:n.scrollTop}function Dl(n,e){if(du(n)){window.scrollTo(0,e);return}n.scrollTop=e}function rP(n){var e=getComputedStyle(n),t=e.position==="absolute",r=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var i=n;i=i.parentElement;)if(e=getComputedStyle(i),!(t&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX))return i;return document.documentElement}function iP(n,e,t,r){return t*((n=n/r-1)*n*n+1)+e}function Qs(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:jl,i=dw(n),o=e-i,a=10,s=0;function l(){s+=a;var u=iP(s,i,o,t);Dl(n,u),s<t?window.requestAnimationFrame(l):r(n)}l()}function i1(n,e){var t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=e.offsetHeight/3;r.bottom+i>t.bottom?Dl(n,Math.min(e.offsetTop+e.clientHeight-n.offsetHeight+i,n.scrollHeight)):r.top-i<t.top&&Dl(n,Math.max(e.offsetTop-i,0))}function oP(n){var e=n.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function o1(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function aP(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var hw=!1,sP={get passive(){return hw=!0}},el=typeof window<"u"?window:{};el.addEventListener&&el.removeEventListener&&(el.addEventListener("p",jl,sP),el.removeEventListener("p",jl,!1));var lP=hw;function uP(n){return n!=null}function cP(n){return Array.isArray(n)}function Ya(n,e,t){return n?e:t}var dP=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];var o=Object.entries(e).filter(function(a){var s=ri(a,1),l=s[0];return!r.includes(l)});return o.reduce(function(a,s){var l=ri(s,2),u=l[0],c=l[1];return a[u]=c,a},{})},hP=["children","innerProps"],fP=["children","innerProps"];function pP(n){var e=n.maxHeight,t=n.menuEl,r=n.minHeight,i=n.placement,o=n.shouldScroll,a=n.isFixedPosition,s=n.controlHeight,l=rP(t),u={placement:"bottom",maxHeight:e};if(!t||!t.offsetParent)return u;var c=l.getBoundingClientRect(),h=c.height,p=t.getBoundingClientRect(),b=p.bottom,x=p.height,E=p.top,g=t.offsetParent.getBoundingClientRect(),v=g.top,C=a?window.innerHeight:nP(l),A=dw(l),_=parseInt(getComputedStyle(t).marginBottom,10),O=parseInt(getComputedStyle(t).marginTop,10),R=v-O,I=C-E,N=R+A,L=h-A-E,B=b-C+A+_,w=A+E-O,P=160;switch(i){case"auto":case"bottom":if(I>=x)return{placement:"bottom",maxHeight:e};if(L>=x&&!a)return o&&Qs(l,B,P),{placement:"bottom",maxHeight:e};if(!a&&L>=r||a&&I>=r){o&&Qs(l,B,P);var T=a?I-_:L-_;return{placement:"bottom",maxHeight:T}}if(i==="auto"||a){var D=e,M=a?R:N;return M>=r&&(D=Math.min(M-_-s,e)),{placement:"top",maxHeight:D}}if(i==="bottom")return o&&Dl(l,B),{placement:"bottom",maxHeight:e};break;case"top":if(R>=x)return{placement:"top",maxHeight:e};if(N>=x&&!a)return o&&Qs(l,w,P),{placement:"top",maxHeight:e};if(!a&&N>=r||a&&R>=r){var k=e;return(!a&&N>=r||a&&R>=r)&&(k=a?R-O:N-O),o&&Qs(l,w,P),{placement:"top",maxHeight:k}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function gP(n){var e={bottom:"top",top:"bottom"};return n?e[n]:"bottom"}var fw=function(e){return e==="auto"?"bottom":e},mP=function(e,t){var r,i=e.placement,o=e.theme,a=o.borderRadius,s=o.spacing,l=o.colors;return _e((r={label:"menu"},$a(r,gP(i),"100%"),$a(r,"position","absolute"),$a(r,"width","100%"),$a(r,"zIndex",1),r),t?{}:{backgroundColor:l.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},pw=m.createContext(null),bP=function(e){var t=e.children,r=e.minMenuHeight,i=e.maxMenuHeight,o=e.menuPlacement,a=e.menuPosition,s=e.menuShouldScrollIntoView,l=e.theme,u=m.useContext(pw)||{},c=u.setPortalPlacement,h=m.useRef(null),p=m.useState(i),b=ri(p,2),x=b[0],E=b[1],g=m.useState(null),v=ri(g,2),C=v[0],A=v[1],_=l.spacing.controlHeight;return Xf(function(){var O=h.current;if(O){var R=a==="fixed",I=s&&!R,N=pP({maxHeight:i,menuEl:O,minHeight:r,placement:o,shouldScroll:I,isFixedPosition:R,controlHeight:_});E(N.maxHeight),A(N.placement),c?.(N.placement)}},[i,o,a,s,r,c,_]),t({ref:h,placerProps:_e(_e({},e),{},{placement:C||fw(o),maxHeight:x})})},vP=function(e){var t=e.children,r=e.innerRef,i=e.innerProps;return xe.jsx("div",Se({},Ht(e,"menu",{menu:!0}),{ref:r},i),t)},yP=vP,xP=function(e,t){var r=e.maxHeight,i=e.theme.spacing.baseUnit;return _e({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:i,paddingTop:i})},CP=function(e){var t=e.children,r=e.innerProps,i=e.innerRef,o=e.isMulti;return xe.jsx("div",Se({},Ht(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),t)},gw=function(e,t){var r=e.theme,i=r.spacing.baseUnit,o=r.colors;return _e({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},EP=gw,wP=gw,_P=function(e){var t=e.children,r=t===void 0?"No options":t,i=e.innerProps,o=$r(e,hP);return xe.jsx("div",Se({},Ht(_e(_e({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},AP=function(e){var t=e.children,r=t===void 0?"Loading...":t,i=e.innerProps,o=$r(e,fP);return xe.jsx("div",Se({},Ht(_e(_e({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},TP=function(e){var t=e.rect,r=e.offset,i=e.position;return{left:t.left,position:i,top:r,width:t.width,zIndex:1}},IP=function(e){var t=e.appendTo,r=e.children,i=e.controlElement,o=e.innerProps,a=e.menuPlacement,s=e.menuPosition,l=m.useRef(null),u=m.useRef(null),c=m.useState(fw(a)),h=ri(c,2),p=h[0],b=h[1],x=m.useMemo(function(){return{setPortalPlacement:b}},[]),E=m.useState(null),g=ri(E,2),v=g[0],C=g[1],A=m.useCallback(function(){if(i){var I=oP(i),N=s==="fixed"?0:window.pageYOffset,L=I[p]+N;(L!==v?.offset||I.left!==v?.rect.left||I.width!==v?.rect.width)&&C({offset:L,rect:I})}},[i,s,p,v?.offset,v?.rect.left,v?.rect.width]);Xf(function(){A()},[A]);var _=m.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&l.current&&(u.current=Kk(i,l.current,A,{elementResize:"ResizeObserver"in window}))},[i,A]);Xf(function(){_()},[_]);var O=m.useCallback(function(I){l.current=I,_()},[_]);if(!t&&s!=="fixed"||!v)return null;var R=xe.jsx("div",Se({ref:O},Ht(_e(_e({},e),{},{offset:v.offset,position:s,rect:v.rect}),"menuPortal",{"menu-portal":!0}),o),r);return xe.jsx(pw.Provider,{value:x},t?ep.createPortal(R,t):R)},SP=function(e){var t=e.isDisabled,r=e.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},RP=function(e){var t=e.children,r=e.innerProps,i=e.isDisabled,o=e.isRtl;return xe.jsx("div",Se({},Ht(e,"container",{"--is-disabled":i,"--is-rtl":o}),r),t)},OP=function(e,t){var r=e.theme.spacing,i=e.isMulti,o=e.hasValue,a=e.selectProps.controlShouldRenderValue;return _e({alignItems:"center",display:i&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},jP=function(e){var t=e.children,r=e.innerProps,i=e.isMulti,o=e.hasValue;return xe.jsx("div",Se({},Ht(e,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),t)},NP=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},DP=function(e){var t=e.children,r=e.innerProps;return xe.jsx("div",Se({},Ht(e,"indicatorsContainer",{indicators:!0}),r),t)},a1,MP=["size"],kP=["innerProps","isRtl","size"];function PP(){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 LP=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:PP},mw=function(e){var t=e.size,r=$r(e,MP);return xe.jsx("svg",Se({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:LP},r))},Ig=function(e){return xe.jsx(mw,Se({size:20},e),xe.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"}))},bw=function(e){return xe.jsx(mw,Se({size:20},e),xe.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"}))},vw=function(e,t){var r=e.isFocused,i=e.theme,o=i.spacing.baseUnit,a=i.colors;return _e({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:r?a.neutral60:a.neutral20,padding:o*2,":hover":{color:r?a.neutral80:a.neutral40}})},BP=vw,FP=function(e){var t=e.children,r=e.innerProps;return xe.jsx("div",Se({},Ht(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),t||xe.jsx(bw,null))},GP=vw,qP=function(e){var t=e.children,r=e.innerProps;return xe.jsx("div",Se({},Ht(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),t||xe.jsx(Ig,null))},HP=function(e,t){var r=e.isDisabled,i=e.theme,o=i.spacing.baseUnit,a=i.colors;return _e({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:r?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},VP=function(e){var t=e.innerProps;return xe.jsx("span",Se({},t,Ht(e,"indicatorSeparator",{"indicator-separator":!0})))},WP=xe.keyframes(a1||(a1=qk([`
|
|
128
128
|
0%, 80%, 100% { opacity: 0; }
|
|
129
129
|
40% { opacity: 1; }
|
|
130
|
-
`]))),wL=function(e,t){var r=e.isFocused,i=e.size,o=e.theme,a=o.colors,s=o.spacing.baseUnit;return we({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:r?a.neutral60:a.neutral20,padding:s*2})},qh=function(e){var t=e.delay,r=e.offset;return xe.jsx("span",{css:xe.css({animation:"".concat(EL," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},process.env.NODE_ENV==="production"?"":";label:LoadingDot;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWUsXG4gIENTU09iamVjdFdpdGhMYWJlbCxcbiAgR3JvdXBCYXNlLFxufSBmcm9tICcuLi90eXBlcyc7XG5pbXBvcnQgeyBnZXRTdHlsZVByb3BzIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgSWNvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBTdmcgPSAoe1xuICBzaXplLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZTogbnVtYmVyIH0pID0+IChcbiAgPHN2Z1xuICAgIGhlaWdodD17c2l6ZX1cbiAgICB3aWR0aD17c2l6ZX1cbiAgICB2aWV3Qm94PVwiMCAwIDIwIDIwXCJcbiAgICBhcmlhLWhpZGRlbj1cInRydWVcIlxuICAgIGZvY3VzYWJsZT1cImZhbHNlXCJcbiAgICBjc3M9e3tcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgZmlsbDogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBsaW5lSGVpZ2h0OiAxLFxuICAgICAgc3Ryb2tlOiAnY3VycmVudENvbG9yJyxcbiAgICAgIHN0cm9rZVdpZHRoOiAwLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IHR5cGUgQ3Jvc3NJY29uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgQ3Jvc3NJY29uID0gKHByb3BzOiBDcm9zc0ljb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNMTQuMzQ4IDE0Ljg0OWMtMC40NjkgMC40NjktMS4yMjkgMC40NjktMS42OTcgMGwtMi42NTEtMy4wMzAtMi42NTEgMy4wMjljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDAtMC40NjktMC40NjktMC40NjktMS4yMjkgMC0xLjY5N2wyLjc1OC0zLjE1LTIuNzU5LTMuMTUyYy0wLjQ2OS0wLjQ2OS0wLjQ2OS0xLjIyOCAwLTEuNjk3czEuMjI4LTAuNDY5IDEuNjk3IDBsMi42NTIgMy4wMzEgMi42NTEtMy4wMzFjMC40NjktMC40NjkgMS4yMjgtMC40NjkgMS42OTcgMHMwLjQ2OSAxLjIyOSAwIDEuNjk3bC0yLjc1OCAzLjE1MiAyLjc1OCAzLjE1YzAuNDY5IDAuNDY5IDAuNDY5IDEuMjI5IDAgMS42OTh6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuZXhwb3J0IHR5cGUgRG93bkNoZXZyb25Qcm9wcyA9IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU/OiBudW1iZXIgfTtcbmV4cG9ydCBjb25zdCBEb3duQ2hldnJvbiA9IChwcm9wczogRG93bkNoZXZyb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNNC41MTYgNy41NDhjMC40MzYtMC40NDYgMS4wNDMtMC40ODEgMS41NzYgMGwzLjkwOCAzLjc0NyAzLjkwOC0zLjc0N2MwLjUzMy0wLjQ4MSAxLjE0MS0wLjQ0NiAxLjU3NCAwIDAuNDM2IDAuNDQ1IDAuNDA4IDEuMTk3IDAgMS42MTUtMC40MDYgMC40MTgtNC42OTUgNC41MDItNC42OTUgNC41MDItMC4yMTcgMC4yMjMtMC41MDIgMC4zMzUtMC43ODcgMC4zMzVzLTAuNTctMC4xMTItMC43ODktMC4zMzVjMCAwLTQuMjg3LTQuMDg0LTQuNjk1LTQuNTAycy0wLjQzNi0xLjE3IDAtMS42MTV6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgQnV0dG9uc1xuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbmV4cG9ydCBpbnRlcmZhY2UgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBUaGUgY2hpbGRyZW4gdG8gYmUgcmVuZGVyZWQgaW5zaWRlIHRoZSBpbmRpY2F0b3IuICovXG4gIGNoaWxkcmVuPzogUmVhY3ROb2RlO1xuICAvKiogUHJvcHMgdGhhdCB3aWxsIGJlIHBhc3NlZCBvbiB0byB0aGUgY2hpbGRyZW4uICovXG4gIGlubmVyUHJvcHM6IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snZGl2J107XG4gIC8qKiBUaGUgZm9jdXNlZCBzdGF0ZSBvZiB0aGUgc2VsZWN0LiAqL1xuICBpc0ZvY3VzZWQ6IGJvb2xlYW47XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG59XG5cbmNvbnN0IGJhc2VDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgdGhlbWU6IHtcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICAgIGNvbG9ycyxcbiAgICB9LFxuICB9OlxuICAgIHwgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuICAgIHwgQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2luZGljYXRvckNvbnRhaW5lcicsXG4gIGRpc3BsYXk6ICdmbGV4JyxcbiAgdHJhbnNpdGlvbjogJ2NvbG9yIDE1MG1zJyxcbiAgLi4uKHVuc3R5bGVkXG4gICAgPyB7fVxuICAgIDoge1xuICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw2MCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIHBhZGRpbmc6IGJhc2VVbml0ICogMixcbiAgICAgICAgJzpob3Zlcic6IHtcbiAgICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw4MCA6IGNvbG9ycy5uZXV0cmFsNDAsXG4gICAgICAgIH0sXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgZHJvcGRvd25JbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IERyb3Bkb3duSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnZHJvcGRvd25JbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2Ryb3Bkb3duLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8RG93bkNoZXZyb24gLz59XG4gICAgPC9kaXY+XG4gICk7XG59O1xuXG5leHBvcnQgaW50ZXJmYWNlIENsZWFySW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xufVxuXG5leHBvcnQgY29uc3QgY2xlYXJJbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IENsZWFySW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnY2xlYXJJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2NsZWFyLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8Q3Jvc3NJY29uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBTZXBhcmF0b3Jcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIEluZGljYXRvclNlcGFyYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpbm5lclByb3BzPzogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ107XG59XG5cbmV4cG9ydCBjb25zdCBpbmRpY2F0b3JTZXBhcmF0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0Rpc2FibGVkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JTZXBhcmF0b3InLFxuICBhbGlnblNlbGY6ICdzdHJldGNoJyxcbiAgd2lkdGg6IDEsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgYmFja2dyb3VuZENvbG9yOiBpc0Rpc2FibGVkID8gY29sb3JzLm5ldXRyYWwxMCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIG1hcmdpbkJvdHRvbTogYmFzZVVuaXQgKiAyLFxuICAgICAgICBtYXJnaW5Ub3A6IGJhc2VVbml0ICogMixcbiAgICAgIH0pLFxufSk7XG5cbmV4cG9ydCBjb25zdCBJbmRpY2F0b3JTZXBhcmF0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHByb3BzOiBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgaW5uZXJQcm9wcyB9ID0gcHJvcHM7XG4gIHJldHVybiAoXG4gICAgPHNwYW5cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgICAgey4uLmdldFN0eWxlUHJvcHMocHJvcHMsICdpbmRpY2F0b3JTZXBhcmF0b3InLCB7XG4gICAgICAgICdpbmRpY2F0b3Itc2VwYXJhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgIC8+XG4gICk7XG59O1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIExvYWRpbmdcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBsb2FkaW5nRG90QW5pbWF0aW9ucyA9IGtleWZyYW1lc2BcbiAgMCUsIDgwJSwgMTAwJSB7IG9wYWNpdHk6IDA7IH1cbiAgNDAlIHsgb3BhY2l0eTogMTsgfVxuYDtcblxuZXhwb3J0IGNvbnN0IGxvYWRpbmdJbmRpY2F0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgc2l6ZSxcbiAgICB0aGVtZToge1xuICAgICAgY29sb3JzLFxuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgIH0sXG4gIH06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2xvYWRpbmdJbmRpY2F0b3InLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIGFsaWduU2VsZjogJ2NlbnRlcicsXG4gIGZvbnRTaXplOiBzaXplLFxuICBsaW5lSGVpZ2h0OiAxLFxuICBtYXJnaW5SaWdodDogc2l6ZSxcbiAgdGV4dEFsaWduOiAnY2VudGVyJyxcbiAgdmVydGljYWxBbGlnbjogJ21pZGRsZScsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5pbnRlcmZhY2UgTG9hZGluZ0RvdFByb3BzIHtcbiAgZGVsYXk6IG51bWJlcjtcbiAgb2Zmc2V0OiBib29sZWFuO1xufVxuY29uc3QgTG9hZGluZ0RvdCA9ICh7IGRlbGF5LCBvZmZzZXQgfTogTG9hZGluZ0RvdFByb3BzKSA9PiAoXG4gIDxzcGFuXG4gICAgY3NzPXt7XG4gICAgICBhbmltYXRpb246IGAke2xvYWRpbmdEb3RBbmltYXRpb25zfSAxcyBlYXNlLWluLW91dCAke2RlbGF5fW1zIGluZmluaXRlO2AsXG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6ICdjdXJyZW50Q29sb3InLFxuICAgICAgYm9yZGVyUmFkaXVzOiAnMWVtJyxcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgbWFyZ2luTGVmdDogb2Zmc2V0ID8gJzFlbScgOiB1bmRlZmluZWQsXG4gICAgICBoZWlnaHQ6ICcxZW0nLFxuICAgICAgdmVydGljYWxBbGlnbjogJ3RvcCcsXG4gICAgICB3aWR0aDogJzFlbScsXG4gICAgfX1cbiAgLz5cbik7XG5cbmV4cG9ydCBpbnRlcmZhY2UgTG9hZGluZ0luZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xuICAvKiogU2V0IHNpemUgb2YgdGhlIGNvbnRhaW5lci4gKi9cbiAgc2l6ZTogbnVtYmVyO1xufVxuZXhwb3J0IGNvbnN0IExvYWRpbmdJbmRpY2F0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oe1xuICBpbm5lclByb3BzLFxuICBpc1J0bCxcbiAgc2l6ZSA9IDQsXG4gIC4uLnJlc3RQcm9wc1xufTogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+KSA9PiB7XG4gIHJldHVybiAoXG4gICAgPGRpdlxuICAgICAgey4uLmdldFN0eWxlUHJvcHMoXG4gICAgICAgIHsgLi4ucmVzdFByb3BzLCBpbm5lclByb3BzLCBpc1J0bCwgc2l6ZSB9LFxuICAgICAgICAnbG9hZGluZ0luZGljYXRvcicsXG4gICAgICAgIHtcbiAgICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgICAgfVxuICAgICAgKX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXswfSBvZmZzZXQ9e2lzUnRsfSAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezE2MH0gb2Zmc2V0IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MzIwfSBvZmZzZXQ9eyFpc1J0bH0gLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG4iXX0= */")})},AL=function(e){var t=e.innerProps,r=e.isRtl,i=e.size,o=i===void 0?4:i,a=Ur(e,fL);return xe.jsx("div",Se({},qt(we(we({},a),{},{innerProps:t,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),xe.jsx(qh,{delay:0,offset:r}),xe.jsx(qh,{delay:160,offset:!0}),xe.jsx(qh,{delay:320,offset:!r}))},_L=function(e,t){var r=e.isDisabled,i=e.isFocused,o=e.theme,a=o.colors,s=o.borderRadius,l=o.spacing;return we({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:i?a.primary:a.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:i?a.primary:a.neutral30}})},TL=function(e){var t=e.children,r=e.isDisabled,i=e.isFocused,o=e.innerRef,a=e.innerProps,s=e.menuIsOpen;return xe.jsx("div",Se({ref:o},qt(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":s}),a,{"aria-disabled":r||void 0}),t)},IL=TL,SL=["data"],RL=function(e,t){var r=e.theme.spacing;return t?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},OL=function(e){var t=e.children,r=e.cx,i=e.getStyles,o=e.getClassNames,a=e.Heading,s=e.headingProps,l=e.innerProps,u=e.label,c=e.theme,h=e.selectProps;return xe.jsx("div",Se({},qt(e,"group",{group:!0}),l),xe.jsx(a,Se({},s,{selectProps:h,theme:c,getStyles:i,getClassNames:o,cx:r}),u),xe.jsx("div",null,t))},NL=function(e,t){var r=e.theme,i=r.colors,o=r.spacing;return we({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},jL=function(e){var t=$E(e);t.data;var r=Ur(t,SL);return xe.jsx("div",Se({},qt(e,"groupHeading",{"group-heading":!0}),r))},DL=OL,ML=["innerRef","isDisabled","isHidden","inputClassName"],kL=function(e,t){var r=e.isDisabled,i=e.value,o=e.theme,a=o.spacing,s=o.colors;return we(we({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},LL),t?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:s.neutral80})},rw={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},LL={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":we({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},rw)},PL=function(e){return we({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},rw)},BL=function(e){var t=e.cx,r=e.value,i=$E(e),o=i.innerRef,a=i.isDisabled,s=i.isHidden,l=i.inputClassName,u=Ur(i,ML);return xe.jsx("div",Se({},qt(e,"input",{"input-container":!0}),{"data-value":r||""}),xe.jsx("input",Se({className:t({input:!0},l),ref:o,style:PL(s),disabled:a},u)))},FL=BL,GL=function(e,t){var r=e.theme,i=r.spacing,o=r.borderRadius,a=r.colors;return we({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},qL=function(e,t){var r=e.theme,i=r.borderRadius,o=r.colors,a=e.cropWithEllipsis;return we({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},HL=function(e,t){var r=e.theme,i=r.spacing,o=r.borderRadius,a=r.colors,s=e.isFocused;return we({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:s?a.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},iw=function(e){var t=e.children,r=e.innerProps;return xe.jsx("div",r,t)},VL=iw,WL=iw;function zL(n){var e=n.children,t=n.innerProps;return xe.jsx("div",Se({role:"button"},t),e||xe.jsx(vg,{size:14}))}var XL=function(e){var t=e.children,r=e.components,i=e.data,o=e.innerProps,a=e.isDisabled,s=e.removeProps,l=e.selectProps,u=r.Container,c=r.Label,h=r.Remove;return xe.jsx(u,{data:i,innerProps:we(we({},qt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:l},xe.jsx(c,{data:i,innerProps:we({},qt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),xe.jsx(h,{data:i,innerProps:we(we({},qt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},s),selectProps:l}))},UL=XL,$L=function(e,t){var r=e.isDisabled,i=e.isFocused,o=e.isSelected,a=e.theme,s=a.spacing,l=a.colors;return we({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(s.baseUnit*2,"px ").concat(s.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},YL=function(e){var t=e.children,r=e.isDisabled,i=e.isFocused,o=e.isSelected,a=e.innerRef,s=e.innerProps;return xe.jsx("div",Se({},qt(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:a,"aria-disabled":r},s),t)},ZL=YL,JL=function(e,t){var r=e.theme,i=r.spacing,o=r.colors;return we({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},KL=function(e){var t=e.children,r=e.innerProps;return xe.jsx("div",Se({},qt(e,"placeholder",{placeholder:!0}),r),t)},QL=KL,eP=function(e,t){var r=e.isDisabled,i=e.theme,o=i.spacing,a=i.colors;return we({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:r?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},tP=function(e){var t=e.children,r=e.isDisabled,i=e.innerProps;return xe.jsx("div",Se({},qt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),t)},nP=tP,rP={ClearIndicator:yL,Control:IL,DropdownIndicator:bL,DownChevron:tw,CrossIcon:vg,Group:DL,GroupHeading:jL,IndicatorsContainer:dL,IndicatorSeparator:CL,Input:FL,LoadingIndicator:AL,Menu:J3,MenuList:Q3,MenuPortal:oL,LoadingMessage:rL,NoOptionsMessage:nL,MultiValue:UL,MultiValueContainer:VL,MultiValueLabel:WL,MultiValueRemove:zL,Option:ZL,Placeholder:QL,SelectContainer:sL,SingleValue:nP,ValueContainer:uL},iP=function(e){return we(we({},rP),e.components)},$y=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function oP(n,e){return!!(n===e||$y(n)&&$y(e))}function aP(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!oP(n[t],e[t]))return!1;return!0}function sP(n,e){e===void 0&&(e=aP);var t=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(t&&t.lastThis===this&&e(i,t.lastArgs))return t.lastResult;var a=n.apply(this,i);return t={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){t=null},r}function lP(){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 uP=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:lP},cP=function(e){return xe.jsx("span",Se({css:uP},e))},Yy=cP,dP={guidance:function(e){var t=e.isSearchable,r=e.isMulti,i=e.tabSelectsValue,o=e.context,a=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,r=e.label,i=r===void 0?"":r,o=e.labels,a=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(e){var t=e.context,r=e.focused,i=e.options,o=e.label,a=o===void 0?"":o,s=e.selectValue,l=e.isDisabled,u=e.isSelected,c=e.isAppleDevice,h=function(w,g){return w&&w.length?"".concat(w.indexOf(g)+1," of ").concat(w.length):""};if(t==="value"&&s)return"value ".concat(a," focused, ").concat(h(s,r),".");if(t==="menu"&&c){var f=l?" disabled":"",b="".concat(u?" selected":"").concat(f);return"".concat(a).concat(b,", ").concat(h(i,r),".")}return""},onFilter:function(e){var t=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(t?" for search term "+t:"",".")}},hP=function(e){var t=e.ariaSelection,r=e.focusedOption,i=e.focusedValue,o=e.focusableOptions,a=e.isFocused,s=e.selectValue,l=e.selectProps,u=e.id,c=e.isAppleDevice,h=l.ariaLiveMessages,f=l.getOptionLabel,b=l.inputValue,x=l.isMulti,w=l.isOptionDisabled,g=l.isSearchable,y=l.menuIsOpen,C=l.options,A=l.screenReaderStatus,_=l.tabSelectsValue,N=l.isLoading,O=l["aria-label"],T=l["aria-live"],D=m.useMemo(function(){return we(we({},dP),h||{})},[h]),M=m.useMemo(function(){var B="";if(t&&D.onChange){var F=t.option,G=t.options,V=t.removedValue,z=t.removedValues,W=t.value,J=function(oe){return Array.isArray(oe)?null:oe},Y=V||F||J(W),ee=Y?f(Y):"",K=G||z||void 0,X=K?K.map(f):[],ie=we({isDisabled:Y&&w(Y,s),label:ee,labels:X},t);B=D.onChange(ie)}return B},[t,D,w,s,f]),L=m.useMemo(function(){var B="",F=r||i,G=!!(r&&s&&s.includes(r));if(F&&D.onFocus){var V={focused:F,label:f(F),isDisabled:w(F,s),isSelected:G,options:o,context:F===r?"menu":"value",selectValue:s,isAppleDevice:c};B=D.onFocus(V)}return B},[r,i,f,w,D,o,s,c]),E=m.useMemo(function(){var B="";if(y&&C.length&&!N&&D.onFilter){var F=A({count:o.length});B=D.onFilter({inputValue:b,resultsMessage:F})}return B},[o,b,y,D,C,A,N]),S=t?.action==="initial-input-focus",I=m.useMemo(function(){var B="";if(D.guidance){var F=i?"value":y?"menu":"input";B=D.guidance({"aria-label":O,context:F,isDisabled:r&&w(r,s),isMulti:x,isSearchable:g,tabSelectsValue:_,isInitialFocus:S})}return B},[O,r,i,x,w,g,y,D,s,_,S]),P=xe.jsx(m.Fragment,null,xe.jsx("span",{id:"aria-selection"},M),xe.jsx("span",{id:"aria-focused"},L),xe.jsx("span",{id:"aria-results"},E),xe.jsx("span",{id:"aria-guidance"},I));return xe.jsx(m.Fragment,null,xe.jsx(Yy,{id:u},S&&P),xe.jsx(Yy,{"aria-live":T,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!S&&P))},fP=hP,Hf=[{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źẑżžẓẕƶȥɀⱬꝣ"}],pP=new RegExp("["+Hf.map(function(n){return n.letters}).join("")+"]","g"),ow={};for(var Hh=0;Hh<Hf.length;Hh++)for(var Vh=Hf[Hh],Wh=0;Wh<Vh.letters.length;Wh++)ow[Vh.letters[Wh]]=Vh.base;var aw=function(e){return e.replace(pP,function(t){return ow[t]})},gP=sP(aw),Zy=function(e){return e.replace(/^\s+|\s+$/g,"")},mP=function(e){return"".concat(e.label," ").concat(e.value)},bP=function(e){return function(t,r){if(t.data.__isNew__)return!0;var i=we({ignoreCase:!0,ignoreAccents:!0,stringify:mP,trim:!0,matchFrom:"any"},e),o=i.ignoreCase,a=i.ignoreAccents,s=i.stringify,l=i.trim,u=i.matchFrom,c=l?Zy(r):r,h=l?Zy(s(t)):s(t);return o&&(c=c.toLowerCase(),h=h.toLowerCase()),a&&(c=gP(c),h=aw(h)),u==="start"?h.substr(0,c.length)===c:h.indexOf(c)>-1}},vP=["innerRef"];function yP(n){var e=n.innerRef,t=Ur(n,vP),r=V3(t,"onExited","in","enter","exit","appear");return xe.jsx("input",Se({ref:e},r,{css:xe.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 xP=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function CP(n){var e=n.isEnabled,t=n.onBottomArrive,r=n.onBottomLeave,i=n.onTopArrive,o=n.onTopLeave,a=m.useRef(!1),s=m.useRef(!1),l=m.useRef(0),u=m.useRef(null),c=m.useCallback(function(g,y){if(u.current!==null){var C=u.current,A=C.scrollTop,_=C.scrollHeight,N=C.clientHeight,O=u.current,T=y>0,D=_-N-A,M=!1;D>y&&a.current&&(r&&r(g),a.current=!1),T&&s.current&&(o&&o(g),s.current=!1),T&&y>D?(t&&!a.current&&t(g),O.scrollTop=_,M=!0,a.current=!0):!T&&-y>A&&(i&&!s.current&&i(g),O.scrollTop=0,M=!0,s.current=!0),M&&xP(g)}},[t,r,i,o]),h=m.useCallback(function(g){c(g,g.deltaY)},[c]),f=m.useCallback(function(g){l.current=g.changedTouches[0].clientY},[]),b=m.useCallback(function(g){var y=l.current-g.changedTouches[0].clientY;c(g,y)},[c]),x=m.useCallback(function(g){if(g){var y=G3?{passive:!1}:!1;g.addEventListener("wheel",h,y),g.addEventListener("touchstart",f,y),g.addEventListener("touchmove",b,y)}},[b,f,h]),w=m.useCallback(function(g){g&&(g.removeEventListener("wheel",h,!1),g.removeEventListener("touchstart",f,!1),g.removeEventListener("touchmove",b,!1))},[b,f,h]);return m.useEffect(function(){if(e){var g=u.current;return x(g),function(){w(g)}}},[e,x,w]),function(g){u.current=g}}var Jy=["boxSizing","height","overflow","paddingRight","position"],Ky={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Qy(n){n.cancelable&&n.preventDefault()}function e1(n){n.stopPropagation()}function t1(){var n=this.scrollTop,e=this.scrollHeight,t=n+this.offsetHeight;n===0?this.scrollTop=1:t===e&&(this.scrollTop=n-1)}function n1(){return"ontouchstart"in window||navigator.maxTouchPoints}var r1=!!(typeof window<"u"&&window.document&&window.document.createElement),Sa=0,Eo={capture:!1,passive:!1};function EP(n){var e=n.isEnabled,t=n.accountForScrollbars,r=t===void 0?!0:t,i=m.useRef({}),o=m.useRef(null),a=m.useCallback(function(l){if(r1){var u=document.body,c=u&&u.style;if(r&&Jy.forEach(function(x){var w=c&&c[x];i.current[x]=w}),r&&Sa<1){var h=parseInt(i.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,b=window.innerWidth-f+h||0;Object.keys(Ky).forEach(function(x){var w=Ky[x];c&&(c[x]=w)}),c&&(c.paddingRight="".concat(b,"px"))}u&&n1()&&(u.addEventListener("touchmove",Qy,Eo),l&&(l.addEventListener("touchstart",t1,Eo),l.addEventListener("touchmove",e1,Eo))),Sa+=1}},[r]),s=m.useCallback(function(l){if(r1){var u=document.body,c=u&&u.style;Sa=Math.max(Sa-1,0),r&&Sa<1&&Jy.forEach(function(h){var f=i.current[h];c&&(c[h]=f)}),u&&n1()&&(u.removeEventListener("touchmove",Qy,Eo),l&&(l.removeEventListener("touchstart",t1,Eo),l.removeEventListener("touchmove",e1,Eo)))}},[r]);return m.useEffect(function(){if(e){var l=o.current;return a(l),function(){s(l)}}},[e,a,s]),function(l){o.current=l}}function wP(){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 AP=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},_P=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:wP};function TP(n){var e=n.children,t=n.lockEnabled,r=n.captureEnabled,i=r===void 0?!0:r,o=n.onBottomArrive,a=n.onBottomLeave,s=n.onTopArrive,l=n.onTopLeave,u=CP({isEnabled:i,onBottomArrive:o,onBottomLeave:a,onTopArrive:s,onTopLeave:l}),c=EP({isEnabled:t}),h=function(b){u(b),c(b)};return xe.jsx(m.Fragment,null,t&&xe.jsx("div",{onClick:AP,css:_P}),e(h))}function IP(){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 SP=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:IP},RP=function(e){var t=e.name,r=e.onFocus;return xe.jsx("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:SP,value:"",onChange:function(){}})},OP=RP;function yg(n){var e;return typeof window<"u"&&window.navigator!=null?n.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function NP(){return yg(/^iPhone/i)}function sw(){return yg(/^Mac/i)}function jP(){return yg(/^iPad/i)||sw()&&navigator.maxTouchPoints>1}function DP(){return NP()||jP()}function MP(){return sw()||DP()}var kP=function(e){return e.label},lw=function(e){return e.label},uw=function(e){return e.value},LP=function(e){return!!e.isDisabled},PP={clearIndicator:vL,container:aL,control:_L,dropdownIndicator:mL,group:RL,groupHeading:NL,indicatorsContainer:cL,indicatorSeparator:xL,input:kL,loadingIndicator:wL,loadingMessage:tL,menu:$3,menuList:K3,menuPortal:iL,multiValue:GL,multiValueLabel:qL,multiValueRemove:HL,noOptionsMessage:eL,option:$L,placeholder:JL,singleValue:eP,valueContainer:lL},BP={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%)"},FP=4,cw=4,GP=38,qP=cw*2,HP={baseUnit:cw,controlHeight:GP,menuGutter:qP},zh={borderRadius:FP,colors:BP,spacing:HP},VP={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Xy(),captureMenuScroll:!Xy(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:bP(),formatGroupLabel:kP,getOptionLabel:lw,getOptionValue:uw,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:LP,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!B3(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function i1(n,e,t,r){var i=fw(n,e,t),o=pw(n,e,t),a=hw(n,e),s=Nl(n,e);return{type:"option",data:e,isDisabled:i,isSelected:o,label:a,value:s,index:r}}function al(n,e){return n.options.map(function(t,r){if("options"in t){var i=t.options.map(function(a,s){return i1(n,a,e,s)}).filter(function(a){return a1(n,a)});return i.length>0?{type:"group",data:t,options:i,index:r}:void 0}var o=i1(n,t,e,r);return a1(n,o)?o:void 0}).filter(q3)}function dw(n){return n.reduce(function(e,t){return t.type==="group"?e.push.apply(e,Qo(t.options.map(function(r){return r.data}))):e.push(t.data),e},[])}function o1(n,e){return n.reduce(function(t,r){return r.type==="group"?t.push.apply(t,Qo(r.options.map(function(i){return{data:i.data,id:"".concat(e,"-").concat(r.index,"-").concat(i.index)}}))):t.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),t},[])}function WP(n,e){return dw(al(n,e))}function a1(n,e){var t=n.inputValue,r=t===void 0?"":t,i=e.data,o=e.isSelected,a=e.label,s=e.value;return(!mw(n)||!o)&&gw(n,{label:a,value:s,data:i},r)}function zP(n,e){var t=n.focusedValue,r=n.selectValue,i=r.indexOf(t);if(i>-1){var o=e.indexOf(t);if(o>-1)return t;if(i<e.length)return e[i]}return null}function XP(n,e){var t=n.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}var Xh=function(e,t){var r,i=(r=e.find(function(o){return o.data===t}))===null||r===void 0?void 0:r.id;return i||null},hw=function(e,t){return e.getOptionLabel(t)},Nl=function(e,t){return e.getOptionValue(t)};function fw(n,e,t){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,t):!1}function pw(n,e,t){if(t.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,t);var r=Nl(n,e);return t.some(function(i){return Nl(n,i)===r})}function gw(n,e,t){return n.filterOption?n.filterOption(e,t):!0}var mw=function(e){var t=e.hideSelectedOptions,r=e.isMulti;return t===void 0?r:t},UP=1,bw=(function(n){l3(t,n);var e=d3(t);function t(r){var i;if(a3(this,t),i=e.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,h=c.onChange,f=c.name;u.name=f,i.ariaOnChange(l,u),h(l,u)},i.setValue=function(l,u,c){var h=i.props,f=h.closeMenuOnSelect,b=h.isMulti,x=h.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:x}),f&&(i.setState({inputIsHiddenAfterUpdate:!b}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,h=u.isMulti,f=u.name,b=i.state.selectValue,x=h&&i.isOptionSelected(l,b),w=i.isOptionDisabled(l,b);if(x){var g=i.getOptionValue(l);i.setValue(b.filter(function(y){return i.getOptionValue(y)!==g}),"deselect-option",l)}else if(!w)h?i.setValue([].concat(Qo(b),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:f});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,h=i.getOptionValue(l),f=c.filter(function(x){return i.getOptionValue(x)!==h}),b=$a(u,f,f[0]||null);i.onChange(b,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange($a(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],h=u.slice(0,u.length-1),f=$a(l,h,h[0]||null);c&&i.onChange(f,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return Xh(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return o1(al(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return D3.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return hw(i.props,l)},i.getOptionValue=function(l){return Nl(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,h=PP[l](u,c);h.boxSizing="border-box";var f=i.props.styles[l];return f?f(h,u):h},i.getClassNames=function(l,u){var c,h;return(c=(h=i.props.classNames)[l])===null||c===void 0?void 0:c.call(h,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return iP(i.props)},i.buildCategorizedOptions=function(){return al(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return dw(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:we({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,h=u.menuIsOpen;i.focusInput(),h?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&su(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var h=Math.abs(c.clientX-i.initialTouchX),f=Math.abs(c.clientY-i.initialTouchY),b=5;i.userIsDragging=h>b||f>b}},i.onTouchEnd=function(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,c=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),c=u.indexOf(l);i.setState({focusedOption:l,focusedOptionId:c>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return mw(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var u=i.props,c=u.isMulti,h=u.backspaceRemovesValue,f=u.escapeClearsValue,b=u.inputValue,x=u.isClearable,w=u.isDisabled,g=u.menuIsOpen,y=u.onKeyDown,C=u.tabSelectsValue,A=u.openMenuOnFocus,_=i.state,N=_.focusedOption,O=_.focusedValue,T=_.selectValue;if(!w&&!(typeof y=="function"&&(y(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||b)return;i.focusValue("previous");break;case"ArrowRight":if(!c||b)return;i.focusValue("next");break;case"Delete":case"Backspace":if(b)return;if(O)i.removeValue(O);else{if(!h)return;c?i.popValue():x&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!g||!C||!N||A&&i.isOptionSelected(N,T))return;i.selectOption(N);break;case"Enter":if(l.keyCode===229)break;if(g){if(!N||i.isComposing)return;i.selectOption(N);break}return;case"Escape":g?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:b}),i.onMenuClose()):x&&f&&i.clearValue();break;case" ":if(b)return;if(!g){i.openMenu("first");break}if(!N)return;i.selectOption(N);break;case"ArrowUp":g?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":g?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!g)return;i.focusOption("pageup");break;case"PageDown":if(!g)return;i.focusOption("pagedown");break;case"Home":if(!g)return;i.focusOption("first");break;case"End":if(!g)return;i.focusOption("last");break;default:return}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++UP),i.state.selectValue=Rl(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),a=i.buildFocusableOptions(),s=a.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=a[s],i.state.focusedOptionId=Xh(o,a[s])}return i}return s3(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&zy(this.menuListRef,this.focusedOptionRef),MP()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isDisabled,s=o.menuIsOpen,l=this.state.isFocused;(l&&!a&&i.isDisabled||l&&s&&!i.menuIsOpen)&&this.focusInput(),l&&a&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!a&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(zy(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,a=this.state,s=a.selectValue,l=a.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var h=u.indexOf(s[0]);h>-1&&(c=h)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,a=o.selectValue,s=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=a.indexOf(s);s||(l=-1);var u=a.length-1,c=-1;if(a.length){switch(i){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:a[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,s=this.getFocusableOptions();if(s.length){var l=0,u=s.indexOf(a);a||(u=-1),i==="up"?l=u>0?u-1:s.length-1:i==="down"?l=(u+1)%s.length:i==="pageup"?(l=u-o,l<0&&(l=0)):i==="pagedown"?(l=u+o,l>s.length-1&&(l=s.length-1)):i==="last"&&(l=s.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:s[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(s[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(zh):we(we({},zh),this.props.theme):zh}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,a=this.getStyles,s=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,h=this.props,f=h.isMulti,b=h.isRtl,x=h.options,w=this.hasValue();return{clearValue:i,cx:o,getStyles:a,getClassNames:s,getValue:l,hasValue:w,isMulti:f,isRtl:b,options:x,selectOption:u,selectProps:h,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,a=i.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(i,o){return fw(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return pw(this.props,i,o)}},{key:"filterOption",value:function(i,o){return gw(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,s=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:a,selectValue:s})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,a=i.isSearchable,s=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,h=i.menuIsOpen,f=i.required,b=this.getComponents(),x=b.Input,w=this.state,g=w.inputIsHidden,y=w.ariaSelection,C=this.commonProps,A=s||this.getElementId("input"),_=we(we(we({"aria-autocomplete":"list","aria-expanded":h,"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":f,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},h&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?y?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?dt.createElement(x,Se({},C,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:A,innerRef:this.getInputRef,isDisabled:o,isHidden:g,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},_)):dt.createElement(yP,Se({id:A,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Sl,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},_))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),a=o.MultiValue,s=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,h=o.Placeholder,f=this.commonProps,b=this.props,x=b.controlShouldRenderValue,w=b.isDisabled,g=b.isMulti,y=b.inputValue,C=b.placeholder,A=this.state,_=A.selectValue,N=A.focusedValue,O=A.isFocused;if(!this.hasValue()||!x)return y?null:dt.createElement(h,Se({},f,{key:"placeholder",isDisabled:w,isFocused:O,innerProps:{id:this.getElementId("placeholder")}}),C);if(g)return _.map(function(D,M){var L=D===N,E="".concat(i.getOptionLabel(D),"-").concat(i.getOptionValue(D));return dt.createElement(a,Se({},f,{components:{Container:s,Label:l,Remove:u},isFocused:L,isDisabled:w,key:E,index:M,removeProps:{onClick:function(){return i.removeValue(D)},onTouchEnd:function(){return i.removeValue(D)},onMouseDown:function(I){I.preventDefault()}},data:D}),i.formatOptionLabel(D,"value"))});if(y)return null;var T=_[0];return dt.createElement(c,Se({},f,{data:T,isDisabled:w}),this.formatOptionLabel(T,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var h={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return dt.createElement(o,Se({},a,{innerProps:h,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!o||!u)return null;var h={"aria-hidden":"true"};return dt.createElement(o,Se({},a,{innerProps:h,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,a=i.IndicatorSeparator;if(!o||!a)return null;var s=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return dt.createElement(a,Se({},s,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var a=this.commonProps,s=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return dt.createElement(o,Se({},a,{innerProps:u,isDisabled:s,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),a=o.Group,s=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,h=o.LoadingMessage,f=o.NoOptionsMessage,b=o.Option,x=this.commonProps,w=this.state.focusedOption,g=this.props,y=g.captureMenuScroll,C=g.inputValue,A=g.isLoading,_=g.loadingMessage,N=g.minMenuHeight,O=g.maxMenuHeight,T=g.menuIsOpen,D=g.menuPlacement,M=g.menuPosition,L=g.menuPortalTarget,E=g.menuShouldBlockScroll,S=g.menuShouldScrollIntoView,I=g.noOptionsMessage,P=g.onMenuScrollToTop,B=g.onMenuScrollToBottom;if(!T)return null;var F=function(ee,K){var X=ee.type,ie=ee.data,de=ee.isDisabled,oe=ee.isSelected,me=ee.label,je=ee.value,Le=w===ie,De=de?void 0:function(){return i.onOptionHover(ie)},He=de?void 0:function(){return i.selectOption(ie)},ve="".concat(i.getElementId("option"),"-").concat(K),se={id:ve,onClick:He,onMouseMove:De,onMouseOver:De,tabIndex:-1,role:"option","aria-selected":i.state.isAppleDevice?void 0:oe};return dt.createElement(b,Se({},x,{innerProps:se,data:ie,isDisabled:de,isSelected:oe,key:ve,label:me,type:X,value:je,isFocused:Le,innerRef:Le?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ee.data,"menu"))},G;if(this.hasOptions())G=this.getCategorizedOptions().map(function(Y){if(Y.type==="group"){var ee=Y.data,K=Y.options,X=Y.index,ie="".concat(i.getElementId("group"),"-").concat(X),de="".concat(ie,"-heading");return dt.createElement(a,Se({},x,{key:ie,data:ee,options:K,Heading:s,headingProps:{id:de,data:Y.data},label:i.formatGroupLabel(Y.data)}),Y.options.map(function(oe){return F(oe,"".concat(X,"-").concat(oe.index))}))}else if(Y.type==="option")return F(Y,"".concat(Y.index))});else if(A){var V=_({inputValue:C});if(V===null)return null;G=dt.createElement(h,x,V)}else{var z=I({inputValue:C});if(z===null)return null;G=dt.createElement(f,x,z)}var W={minMenuHeight:N,maxMenuHeight:O,menuPlacement:D,menuPosition:M,menuShouldScrollIntoView:S},J=dt.createElement(Y3,Se({},x,W),function(Y){var ee=Y.ref,K=Y.placerProps,X=K.placement,ie=K.maxHeight;return dt.createElement(l,Se({},x,W,{innerRef:ee,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:A,placement:X}),dt.createElement(TP,{captureEnabled:y,onTopArrive:P,onBottomArrive:B,lockEnabled:E},function(de){return dt.createElement(u,Se({},x,{innerRef:function(me){i.getMenuListRef(me),de(me)},innerProps:{role:"listbox","aria-multiselectable":x.isMulti,id:i.getElementId("listbox")},isLoading:A,maxHeight:ie,focusedOption:w}),G)}))});return L||M==="fixed"?dt.createElement(c,Se({},x,{appendTo:L,controlElement:this.controlRef,menuPlacement:D,menuPosition:M}),J):J}},{key:"renderFormField",value:function(){var i=this,o=this.props,a=o.delimiter,s=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,h=this.state.selectValue;if(c&&!this.hasValue()&&!s)return dt.createElement(OP,{name:u,onFocus:this.onValueInputFocus});if(!(!u||s))if(l)if(a){var f=h.map(function(w){return i.getOptionValue(w)}).join(a);return dt.createElement("input",{name:u,type:"hidden",value:f})}else{var b=h.length>0?h.map(function(w,g){return dt.createElement("input",{key:"i-".concat(g),name:u,type:"hidden",value:i.getOptionValue(w)})}):dt.createElement("input",{name:u,type:"hidden",value:""});return dt.createElement("div",null,b)}else{var x=h[0]?this.getOptionValue(h[0]):"";return dt.createElement("input",{name:u,type:"hidden",value:x})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,a=o.ariaSelection,s=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,h=this.getFocusableOptions();return dt.createElement(fP,Se({},i,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:s,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:h,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,a=i.IndicatorsContainer,s=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,h=u.id,f=u.isDisabled,b=u.menuIsOpen,x=this.state.isFocused,w=this.commonProps=this.getCommonProps();return dt.createElement(s,Se({},w,{className:c,innerProps:{id:h,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:x}),this.renderLiveRegion(),dt.createElement(o,Se({},w,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:x,menuIsOpen:b}),dt.createElement(l,Se({},w,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),dt.createElement(a,Se({},w,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var a=o.prevProps,s=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,h=o.prevWasFocused,f=o.instancePrefix,b=i.options,x=i.value,w=i.menuIsOpen,g=i.inputValue,y=i.isMulti,C=Rl(x),A={};if(a&&(x!==a.value||b!==a.options||w!==a.menuIsOpen||g!==a.inputValue)){var _=w?WP(i,C):[],N=w?o1(al(i,C),"".concat(f,"-option")):[],O=s?zP(o,C):null,T=XP(o,_),D=Xh(N,T);A={selectValue:C,focusedOption:T,focusedOptionId:D,focusableOptionsWithIds:N,focusedValue:O,clearFocusValueOnUpdate:!1}}var M=l!=null&&i!==a?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},L=u,E=c&&h;return c&&!E&&(L={value:$a(y,C,C[0]||null),options:C,action:"initial-input-focus"},E=!h),u?.action==="initial-input-focus"&&(L=null),we(we(we({},A),M),{},{prevProps:i,ariaSelection:L,prevWasFocused:E})}}]),t})(m.Component);bw.defaultProps=VP;var $P=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function YP(n){var e=n.defaultInputValue,t=e===void 0?"":e,r=n.defaultMenuIsOpen,i=r===void 0?!1:r,o=n.defaultValue,a=o===void 0?null:o,s=n.inputValue,l=n.menuIsOpen,u=n.onChange,c=n.onInputChange,h=n.onMenuClose,f=n.onMenuOpen,b=n.value,x=Ur(n,$P),w=m.useState(s!==void 0?s:t),g=ni(w,2),y=g[0],C=g[1],A=m.useState(l!==void 0?l:i),_=ni(A,2),N=_[0],O=_[1],T=m.useState(b!==void 0?b:a),D=ni(T,2),M=D[0],L=D[1],E=m.useCallback(function(V,z){typeof u=="function"&&u(V,z),L(V)},[u]),S=m.useCallback(function(V,z){var W;typeof c=="function"&&(W=c(V,z)),C(W!==void 0?W:V)},[c]),I=m.useCallback(function(){typeof f=="function"&&f(),O(!0)},[f]),P=m.useCallback(function(){typeof h=="function"&&h(),O(!1)},[h]),B=s!==void 0?s:y,F=l!==void 0?l:N,G=b!==void 0?b:M;return we(we({},x),{},{inputValue:B,menuIsOpen:F,onChange:E,onInputChange:S,onMenuClose:P,onMenuOpen:I,value:G})}var ZP=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],s1=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(e).toLowerCase(),o=String(r.getOptionValue(t)).toLowerCase(),a=String(r.getOptionLabel(t)).toLowerCase();return o===i||a===i},Uh={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,r,i){return!(!e||t.some(function(o){return s1(e,o,i)})||r.some(function(o){return s1(e,o,i)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function JP(n){var e=n.allowCreateWhileLoading,t=e===void 0?!1:e,r=n.createOptionPosition,i=r===void 0?"last":r,o=n.formatCreateLabel,a=o===void 0?Uh.formatCreateLabel:o,s=n.isValidNewOption,l=s===void 0?Uh.isValidNewOption:s,u=n.getNewOptionData,c=u===void 0?Uh.getNewOptionData:u,h=n.onCreateOption,f=n.options,b=f===void 0?[]:f,x=n.onChange,w=Ur(n,ZP),g=w.getOptionValue,y=g===void 0?uw:g,C=w.getOptionLabel,A=C===void 0?lw:C,_=w.inputValue,N=w.isLoading,O=w.isMulti,T=w.value,D=w.name,M=m.useMemo(function(){return l(_,Rl(T),b,{getOptionValue:y,getOptionLabel:A})?c(_,a(_)):void 0},[a,c,A,y,_,l,b,T]),L=m.useMemo(function(){return(t||!N)&&M?i==="first"?[M].concat(Qo(b)):[].concat(Qo(b),[M]):b},[t,i,N,M,b]),E=m.useCallback(function(S,I){if(I.action!=="select-option")return x(S,I);var P=Array.isArray(S)?S:[S];if(P[P.length-1]===M){if(h)h(_);else{var B=c(_,_),F={action:"create-option",name:D,option:B};x($a(O,[].concat(Qo(Rl(T)),[B]),B),F)}return}x(S,I)},[c,_,O,D,M,h,x,T]);return we(we({},w),{},{options:L,onChange:E})}var KP=m.forwardRef(function(n,e){var t=YP(n),r=JP(t);return dt.createElement(bw,Se({ref:e},r))}),vw=KP;function l1(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function QP(n){if(Array.isArray(n))return n}function e9(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function t9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
131
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n9(n,e){return QP(n)||e9(n,e)||r9(n,e)||t9()}function r9(n,e){if(n){if(typeof n=="string")return l1(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?l1(n,e):void 0}}const yw=Object.entries,u1=Object.setPrototypeOf,i9=Object.isFrozen,o9=Object.getPrototypeOf,a9=Object.getOwnPropertyDescriptor;let Qt=Object.freeze,ln=Object.seal,Uo=Object.create,xw=typeof Reflect<"u"&&Reflect,Vf=xw.apply,Wf=xw.construct;Qt||(Qt=function(e){return e});ln||(ln=function(e){return e});Vf||(Vf=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return e.apply(t,i)});Wf||(Wf=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return new e(...r)});const qi=Zt(Array.prototype.forEach),s9=Zt(Array.prototype.lastIndexOf),c1=Zt(Array.prototype.pop),Ra=Zt(Array.prototype.push),l9=Zt(Array.prototype.splice),ea=Array.isArray,Ya=Zt(String.prototype.toLowerCase),$h=Zt(String.prototype.toString),d1=Zt(String.prototype.match),Oa=Zt(String.prototype.replace),h1=Zt(String.prototype.indexOf),u9=Zt(String.prototype.trim),c9=Zt(Number.prototype.toString),d9=Zt(Boolean.prototype.toString),f1=typeof BigInt>"u"?null:Zt(BigInt.prototype.toString),p1=typeof Symbol>"u"?null:Zt(Symbol.prototype.toString),Mn=Zt(Object.prototype.hasOwnProperty),Na=Zt(Object.prototype.toString),vn=Zt(RegExp.prototype.test),Bi=h9(TypeError);function Zt(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return Vf(n,e,r)}}function h9(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Wf(n,t)}}function et(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ya;if(u1&&u1(n,null),!ea(e))return n;let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=t(i);o!==i&&(i9(e)||(e[r]=o),i=o)}n[i]=!0}return n}function f9(n){for(let e=0;e<n.length;e++)Mn(n,e)||(n[e]=null);return n}function Un(n){const e=Uo(null);for(const r of yw(n)){var t=n9(r,2);const i=t[0],o=t[1];Mn(n,i)&&(ea(o)?e[i]=f9(o):o&&typeof o=="object"&&o.constructor===Object?e[i]=Un(o):e[i]=o)}return e}function p9(n){switch(typeof n){case"string":return n;case"number":return c9(n);case"boolean":return d9(n);case"bigint":return f1?f1(n):"0";case"symbol":return p1?p1(n):"Symbol()";case"undefined":return Na(n);case"function":case"object":{if(n===null)return Na(n);const e=n,t=xr(e,"toString");if(typeof t=="function"){const r=t(e);return typeof r=="string"?r:Na(r)}return Na(n)}default:return Na(n)}}function xr(n,e){for(;n!==null;){const r=a9(n,e);if(r){if(r.get)return Zt(r.get);if(typeof r.value=="function")return Zt(r.value)}n=o9(n)}function t(){return null}return t}function g9(n){try{return vn(n,""),!0}catch{return!1}}const g1=Qt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Yh=Qt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Zh=Qt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),m9=Qt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Jh=Qt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),b9=Qt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),m1=Qt(["#text"]),b1=Qt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Kh=Qt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),v1=Qt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Qs=Qt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),v9=ln(/{{[\w\W]*|^[\w\W]*}}/g),y9=ln(/<%[\w\W]*|^[\w\W]*%>/g),x9=ln(/\${[\w\W]*/g),C9=ln(/^data-[\-\w.\u00B7-\uFFFF]+$/),E9=ln(/^aria-[\-\w]+$/),y1=ln(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),w9=ln(/^(?:\w+script|data):/i),A9=ln(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_9=ln(/^html$/i),T9=ln(/^[a-z][.\w]*(-[.\w]+)+$/i),x1=ln(/<[/\w!]/g),C1=ln(/<[/\w]/g),I9=ln(/<\/no(script|embed|frames)/i),S9=ln(/\/>/i),Vn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Cw=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],R9=Qt(et({},Cw)),O9=(function(){const n={};return qi(Cw,e=>{n[e]=ln(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),Qt(n)})(),N9=function(){return typeof window>"u"?null:window},j9=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(r=t.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},E1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},vi=function(e,t,r,i){return Mn(e,t)&&ea(e[t])?et(i.base?Un(i.base):{},e[t],i.transform):r},Qh=function(e,t,r){const i=Mn(e,t)?e[t]:void 0;return i&&typeof i=="object"?Un(i):r()};function Ew(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N9();const e=Q=>Ew(Q);if(e.version="3.4.14",e.removed=[],!n||!n.document||n.document.nodeType!==Vn.document||!n.Element)return e.isSupported=!1,e;let t=n.document;const r=t,i=r.currentScript;n.DocumentFragment;const o=n.HTMLTemplateElement,a=n.Node,s=n.Element,l=n.NodeFilter,u=n.NamedNodeMap;u===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const c=n.DOMParser,h=n.trustedTypes,f=s.prototype,b=xr(f,"cloneNode"),x=xr(f,"remove"),w=xr(f,"nextSibling"),g=xr(f,"childNodes"),y=xr(f,"parentNode"),C=xr(f,"shadowRoot"),A=xr(f,"attributes"),_=a&&a.prototype?xr(a.prototype,"nodeType"):null,N=a&&a.prototype?xr(a.prototype,"nodeName"):null,O=a&&a.prototype?xr(a.prototype,"ownerDocument"):null,T=function(j){return _?_(j):j.nodeType},D=function(j){return N?N(j):j.nodeName};if(typeof o=="function"){const Q=t.createElement("template");Q.content&&Q.content.ownerDocument&&(t=Q.content.ownerDocument)}let M,L="",E,S=!1,I=0;const P=function(){if(I>0)throw Bi('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},B=function(j){P(),I++;try{return M.createHTML(j)}finally{I--}},F=function(j){P(),I++;try{return M.createScriptURL(j)}finally{I--}},G=function(){return S||(E=j9(h,i),S=!0),E},V=t,z=V.implementation,W=V.createNodeIterator,J=V.createDocumentFragment,Y=V.getElementsByTagName,ee=r.importNode;let K=E1();e.isSupported=typeof yw=="function"&&typeof y=="function"&&z&&z.createHTMLDocument!==void 0;const X=v9,ie=y9,de=x9,oe=C9,me=E9,je=w9,Le=A9,De=T9;let He=y1,ve=null;const se=et({},[...g1,...Yh,...Zh,...Jh,...m1]);let Me=null;const Re=et({},[...b1,...Kh,...v1,...Qs]);let tt=Object.seal(Uo(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ie=null,Ye=null;const Ue=Object.seal(Uo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let wt=!0,Ke=!0,gt=!1,Ot=!0,kt=!1,yt=!0,it=!1,mt=!1,pt=null,xt=null,en=!1,st=!1,lt=!1,tn=!1,Rn=!0,Lt=!1;const bt="user-content-";let Nt=!0,Ce=!1,ce={},Ae=null;const ze=et({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let qe=null;const te=et({},["audio","video","img","source","image","track"]);let _e=null;const Xe=et({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ht="http://www.w3.org/1998/Math/MathML",ft="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml";let nn=$e,Cn=!1,cr=null;const dr=et({},[ht,ft,$e],$h),En=Qt(["mi","mo","mn","ms","mtext"]);let At=et({},En);const $r=Qt(["annotation-xml"]);let Zn=et({},$r);const Nr=et({},["title","style","font","a","script"]);let hr=null;const fr=["application/xhtml+xml","text/html"],Ht="text/html";let vt=null,Jn=null;const Ni=t.createElement("form"),jr=function(j){return j instanceof RegExp||j instanceof Function},Dr=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Jn&&Jn===j)return;(!j||typeof j!="object")&&(j={}),j=Un(j),hr=fr.indexOf(j.PARSER_MEDIA_TYPE)===-1?Ht:j.PARSER_MEDIA_TYPE,vt=hr==="application/xhtml+xml"?$h:Ya,ve=vi(j,"ALLOWED_TAGS",se,{transform:vt}),Me=vi(j,"ALLOWED_ATTR",Re,{transform:vt}),cr=vi(j,"ALLOWED_NAMESPACES",dr,{transform:$h}),_e=vi(j,"ADD_URI_SAFE_ATTR",Xe,{transform:vt,base:Xe}),qe=vi(j,"ADD_DATA_URI_TAGS",te,{transform:vt,base:te}),Ae=vi(j,"FORBID_CONTENTS",ze,{transform:vt}),Ie=vi(j,"FORBID_TAGS",Un({}),{transform:vt}),Ye=vi(j,"FORBID_ATTR",Un({}),{transform:vt}),ce=Mn(j,"USE_PROFILES")?j.USE_PROFILES&&typeof j.USE_PROFILES=="object"?Un(j.USE_PROFILES):j.USE_PROFILES:!1,wt=j.ALLOW_ARIA_ATTR!==!1,Ke=j.ALLOW_DATA_ATTR!==!1,gt=j.ALLOW_UNKNOWN_PROTOCOLS||!1,Ot=j.ALLOW_SELF_CLOSE_IN_ATTR!==!1,kt=j.SAFE_FOR_TEMPLATES||!1,yt=j.SAFE_FOR_XML!==!1,it=j.WHOLE_DOCUMENT||!1,st=j.RETURN_DOM||!1,lt=j.RETURN_DOM_FRAGMENT||!1,tn=j.RETURN_TRUSTED_TYPE||!1,en=j.FORCE_BODY||!1,Rn=j.SANITIZE_DOM!==!1,Lt=j.SANITIZE_NAMED_PROPS||!1,Nt=j.KEEP_CONTENT!==!1,Ce=j.IN_PLACE||!1,He=g9(j.ALLOWED_URI_REGEXP)?j.ALLOWED_URI_REGEXP:y1,nn=typeof j.NAMESPACE=="string"?j.NAMESPACE:$e,At=Qh(j,"MATHML_TEXT_INTEGRATION_POINTS",()=>et({},En)),Zn=Qh(j,"HTML_INTEGRATION_POINTS",()=>et({},$r));const H=Qh(j,"CUSTOM_ELEMENT_HANDLING",()=>Uo(null));if(tt=Uo(null),Mn(H,"tagNameCheck")&&jr(H.tagNameCheck)&&(tt.tagNameCheck=H.tagNameCheck),Mn(H,"attributeNameCheck")&&jr(H.attributeNameCheck)&&(tt.attributeNameCheck=H.attributeNameCheck),Mn(H,"allowCustomizedBuiltInElements")&&typeof H.allowCustomizedBuiltInElements=="boolean"&&(tt.allowCustomizedBuiltInElements=H.allowCustomizedBuiltInElements),ln(tt),kt&&(Ke=!1),lt&&(st=!0),ce&&(ve=et({},m1),Me=Uo(null),ce.html===!0&&(et(ve,g1),et(Me,b1)),ce.svg===!0&&(et(ve,Yh),et(Me,Kh),et(Me,Qs)),ce.svgFilters===!0&&(et(ve,Zh),et(Me,Kh),et(Me,Qs)),ce.mathMl===!0&&(et(ve,Jh),et(Me,v1),et(Me,Qs))),Ue.tagCheck=null,Ue.attributeCheck=null,Mn(j,"ADD_TAGS")&&(typeof j.ADD_TAGS=="function"?Ue.tagCheck=j.ADD_TAGS:ea(j.ADD_TAGS)&&(ve===se&&(ve=Un(ve)),et(ve,j.ADD_TAGS,vt))),Mn(j,"ADD_ATTR")&&(typeof j.ADD_ATTR=="function"?Ue.attributeCheck=j.ADD_ATTR:ea(j.ADD_ATTR)&&(Me===Re&&(Me=Un(Me)),et(Me,j.ADD_ATTR,vt))),Mn(j,"ADD_FORBID_CONTENTS")&&ea(j.ADD_FORBID_CONTENTS)&&(Ae===ze&&(Ae=Un(Ae)),et(Ae,j.ADD_FORBID_CONTENTS,vt)),Nt&&(ve["#text"]=!0),it&&et(ve,["html","head","body"]),ve.table&&(et(ve,["tbody"]),delete Ie.tbody),j.TRUSTED_TYPES_POLICY){if(typeof j.TRUSTED_TYPES_POLICY.createHTML!="function")throw Bi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof j.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Bi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const $=M;M=j.TRUSTED_TYPES_POLICY;try{L=B("")}catch(re){throw M=$,re}}else j.TRUSTED_TYPES_POLICY===null?(M=void 0,L=""):(M===void 0&&(M=G()),M&&typeof L=="string"&&(L=B("")));Qt&&Qt(j),Jn=j},Vt=et({},[...Yh,...Zh,...m9]),Yr=et({},[...Jh,...b9]),ji=function(j,H,$){return H.namespaceURI===$e?j==="svg":H.namespaceURI===ht?j==="svg"&&($==="annotation-xml"||At[$]):!!Vt[j]},ui=function(j,H,$){return H.namespaceURI===$e?j==="math":H.namespaceURI===ft?j==="math"&&Zn[$]:!!Yr[j]},ci=function(j,H,$){return H.namespaceURI===ft&&!Zn[$]||H.namespaceURI===ht&&!At[$]?!1:!Yr[j]&&(Nr[j]||!Vt[j])},di=function(j){let H=y(j);(!H||!H.tagName)&&(H={namespaceURI:nn,tagName:"template"});const $=Ya(j.tagName),re=Ya(H.tagName);return cr[j.namespaceURI]?j.namespaceURI===ft?ji($,H,re):j.namespaceURI===ht?ui($,H,re):j.namespaceURI===$e?ci($,H,re):!!(hr==="application/xhtml+xml"&&cr[j.namespaceURI]):!1},ae=function(j){Ra(e.removed,{element:j});try{y(j).removeChild(j)}catch{if(x(j),!y(j))throw Bi("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ze=function(j,H,$){try{j.removeAttributeNode(H)}catch{try{j.removeAttribute($)}catch{}}},jt=function(j){Mr(j);const H=g(j);if(H){const re=[];qi(H,le=>{Ra(re,le)}),qi(re,le=>{try{x(le)}catch{}})}const $=A(j);if($)for(let re=$.length-1;re>=0;--re){const le=$[re],Ee=le&&le.name;typeof Ee=="string"&&Ze(j,le,Ee)}},ot=function(j,H,$){if(!$)try{$=H.getAttributeNode(j)}catch{$=null}Ra(e.removed,{attribute:$||null,from:H});try{$?H.removeAttributeNode($):H.removeAttribute(j)}catch{try{H.removeAttribute(j)}catch{}}if(j==="is")if(st||lt)try{ae(H)}catch{}else try{H.setAttribute(j,"")}catch{}},rn=function(j){const H=A(j);if(H)for(let $=H.length-1;$>=0;--$){const re=H[$],le=re&&re.name;typeof le!="string"||Me[vt(le)]||Ze(j,re,le)}},Mr=function(j){const H=[j];for(;H.length>0;){const $=H.pop();T($)===Vn.element&&rn($);const le=g($);if(le)for(let Ee=le.length-1;Ee>=0;--Ee)H.push(le[Ee])}},pr=function(j,H){return yt?j==="patchsrc"?!0:j==="for"&&H!=="label"&&H!=="output":!1},kr=function(j){if(!yt)return;const H=[j];for(;H.length>0;){const $=H.pop(),re=T($);if(re===Vn.processingInstruction||re===Vn.comment&&vn(C1,$.data)){try{x($)}catch{}continue}if(re===Vn.element){const Ee=$,nt=vt(D($));try{Ee.hasAttribute&&Ee.hasAttribute("patchsrc")&&Ee.removeAttribute("patchsrc"),Ee.hasAttribute&&Ee.hasAttribute("for")&&pr("for",nt)&&Ee.removeAttribute("for")}catch{}}const le=g($);if(le)for(let Ee=le.length-1;Ee>=0;--Ee)H.push(le[Ee])}},hi=function(j){let H=null,$=null;if(en)j="<remove></remove>"+j;else{const Ee=d1(j,/^[\r\n\t ]+/);$=Ee&&Ee[0]}hr==="application/xhtml+xml"&&nn===$e&&(j='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+j+"</body></html>");const re=M?B(j):j;if(nn===$e)try{H=new c().parseFromString(re,hr)}catch{}if(!H||!H.documentElement){H=z.createDocument(nn,"template",null);try{H.documentElement.innerHTML=Cn?L:re}catch{}}const le=H.body||H.documentElement;return j&&$&&le.insertBefore(t.createTextNode($),le.childNodes[0]||null),nn===$e?Y.call(H,it?"html":"body")[0]:it?H.documentElement:le},Lr=function(j){const H=O?O(j):j.ownerDocument;return W.call(H||j,j,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},wn=function(j){return j=Oa(j,X," "),j=Oa(j,ie," "),j=Oa(j,de," "),j},Kn=function(j){var H;j.normalize();const $=O?O(j):j.ownerDocument,re=W.call($||j,j,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let le=re.nextNode();for(;le;)le.data=wn(le.data),le=re.nextNode();const Ee=(H=j.querySelectorAll)===null||H===void 0?void 0:H.call(j,"template");Ee&&qi(Ee,nt=>{Gn(nt.content)&&Kn(nt.content)})},An=function(j){const H=N?N(j):null;return typeof H!="string"||vt(H)!=="form"?!1:typeof j.nodeName!="string"||typeof j.textContent!="string"||typeof j.removeChild!="function"||j.attributes!==A(j)||typeof j.removeAttribute!="function"||typeof j.setAttribute!="function"||typeof j.namespaceURI!="string"||typeof j.insertBefore!="function"||typeof j.hasChildNodes!="function"||j.nodeType!==_(j)||j.childNodes!==g(j)},Gn=function(j){if(!_||typeof j!="object"||j===null)return!1;try{return _(j)===Vn.documentFragment}catch{return!1}},Qn=function(j){if(!_||typeof j!="object"||j===null)return!1;try{return typeof _(j)=="number"}catch{return!1}};function on(Q,j,H){Q.length!==0&&qi(Q,$=>{$.call(e,j,H,Jn)})}const Zr=function(j,H){return!!(yt&&j.hasChildNodes()&&!Qn(j.firstElementChild)&&vn(x1,j.textContent)&&vn(x1,j.innerHTML)||yt&&j.namespaceURI===$e&&R9[H]&&(Qn(j.firstElementChild)||typeof j.textContent=="string"&&vn(O9[H],j.textContent))||j.nodeType===Vn.processingInstruction||yt&&j.nodeType===Vn.comment&&vn(C1,j.data))},er=function(j,H){if(j instanceof RegExp)return vn(j,H);if(j instanceof Function){for(var $=arguments.length,re=new Array($>2?$-2:0),le=2;le<$;le++)re[le-2]=arguments[le];return!!j(H,...re)}return!1},fi=function(j,H,$){if(!Ie[H]&&tr(H)&&er(tt.tagNameCheck,H))return!1;if(Nt&&!Ae[H]){const re=y(j),le=g(j);if(le&&re){const Ee=le.length;for(let nt=Ee-1;nt>=0;--nt){const ut=j===$?b(le[nt],!0):le[nt];re.insertBefore(ut,w(j))}}}return ae(j),!0},pi=function(j,H,$,re){return j.length===0?H:H===$||H===re?Un(H):H},co=function(j,H){return j===H||y(j)!==null?!1:(Ce&&Mr(j),!0)},ho=function(j,H){if(on(K.beforeSanitizeElements,j,null),co(j,H))return!0;if(An(j))return ae(j),!0;const $=vt(D(j));if(ve=pi(K.uponSanitizeElement,ve,se,pt),on(K.uponSanitizeElement,j,{tagName:$,allowedTags:ve}),co(j,H))return!0;if(Zr(j,$))return ae(j),!0;if(Ie[$]||!(Ue.tagCheck instanceof Function&&Ue.tagCheck($))&&!ve[$]){const le=fi(j,$,H);return le===!1&&on(K.afterSanitizeElements,j,null),le}if(T(j)===Vn.element&&!di(j)||($==="noscript"||$==="noembed"||$==="noframes")&&vn(I9,j.innerHTML))return ae(j),!0;if(kt&&j.nodeType===Vn.text){const le=wn(j.textContent);j.textContent!==le&&(Ra(e.removed,{element:j.cloneNode()}),j.textContent=le)}return on(K.afterSanitizeElements,j,null),!1},Pr=function(j,H,$){if(Ye[H]||pr(H,j)||Rn&&(H==="id"||H==="name")&&($ in t||$ in Ni))return!1;const re=Me[H]||Ue.attributeCheck instanceof Function&&Ue.attributeCheck(H,j);return Ke&&vn(oe,H)||wt&&vn(me,H)?!0:re?_e[H]||vn(He,Oa($,Le,""))||(H==="src"||H==="xlink:href"||H==="href")&&j!=="script"&&h1($,"data:")===0&&qe[j]||gt&&!vn(je,Oa($,Le,""))?!0:!$:tr(j)&&er(tt.tagNameCheck,j)&&er(tt.attributeNameCheck,H,j)||H==="is"&&tt.allowCustomizedBuiltInElements&&er(tt.tagNameCheck,$)},qn=et({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),tr=function(j){return!qn[Ya(j)]&&vn(De,j)},gr=function(j,H,$,re){if(M&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!$)switch(h.getAttributeType(j,H)){case"TrustedHTML":return B(re);case"TrustedScriptURL":return F(re)}return re},ga=function(j,H,$,re){try{$?j.setAttributeNS($,H,re):j.setAttribute(H,re),An(j)?ae(j):c1(e.removed)}catch{ot(H,j)}},Hn=function(j){on(K.beforeSanitizeAttributes,j,null);const H=j.attributes;if(!H||An(j))return;Me=pi(K.uponSanitizeAttribute,Me,Re,xt);const $={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Me,forceKeepAttr:void 0};let re=H.length;const le=vt(j.nodeName);for(;re--;){const Ee=H[re],nt=Ee.name,ut=Ee.namespaceURI,an=Ee.value,Jt=vt(nt),Jr=an;let Wt=nt==="value"?Jr:u9(Jr);if($.attrName=Jt,$.attrValue=Wt,$.keepAttr=!0,$.forceKeepAttr=void 0,on(K.uponSanitizeAttribute,j,$),Wt=$.attrValue,Lt&&(Jt==="id"||Jt==="name")&&h1(Wt,bt)!==0&&(ot(nt,j,Ee),Wt=bt+Wt),yt&&vn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Wt)){ot(nt,j,Ee);continue}if(Jt==="attributename"&&d1(Wt,"href")){ot(nt,j,Ee);continue}if(!$.forceKeepAttr){if(!$.keepAttr){ot(nt,j,Ee);continue}if(!Ot&&vn(S9,Wt)){ot(nt,j,Ee);continue}if(kt&&(Wt=wn(Wt)),!Pr(le,Jt,Wt)){ot(nt,j,Ee);continue}Wt=gr(le,Jt,ut,Wt),Wt!==Jr&&ga(j,nt,ut,Wt)}}on(K.afterSanitizeAttributes,j,null)},gi=function(j){let H=null;const $=Lr(j);for(on(K.beforeSanitizeShadowDOM,j,null);H=$.nextNode();)if(on(K.uponSanitizeShadowNode,H,null),ho(H,j),Hn(H),Gn(H.content)&&gi(H.content),T(H)===Vn.element){const re=C(H);Gn(re)&&(Di(re),gi(re))}on(K.afterSanitizeShadowDOM,j,null)},Di=function(j){const H=[{node:j,shadow:null}];for(;H.length>0;){const $=H.pop();if($.shadow){gi($.shadow);continue}const re=$.node,Ee=T(re)===Vn.element,nt=g(re);if(nt)for(let ut=nt.length-1;ut>=0;--ut)H.push({node:nt[ut],shadow:null});if(Ee){const ut=N?N(re):null;if(typeof ut=="string"&&vt(ut)==="template"){const an=re.content;Gn(an)&&H.push({node:an,shadow:null})}}if(Ee){const ut=C(re);Gn(ut)&&H.push({node:null,shadow:ut},{node:ut,shadow:null})}}};return e.sanitize=function(Q){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H=null,$=null,re=null,le=null;if(Cn=!Q,Cn&&(Q="<!-->"),typeof Q!="string"&&!Qn(Q)&&(Q=p9(Q),typeof Q!="string"))throw Bi("dirty is not a string, aborting");if(!e.isSupported)return Q;mt?(ve=pt,Me=xt):Dr(j),(K.uponSanitizeElement.length>0||K.uponSanitizeAttribute.length>0)&&(ve=Un(ve)),K.uponSanitizeAttribute.length>0&&(Me=Un(Me)),e.removed=[];const Ee=Ce&&typeof Q!="string"&&Qn(Q);if(Ee){kr(Q);const an=D(Q);if(typeof an=="string"){const Jt=vt(an);if(!ve[Jt]||Ie[Jt])throw jt(Q),Bi("root node is forbidden and cannot be sanitized in-place")}if(An(Q))throw jt(Q),Bi("root node is clobbered and cannot be sanitized in-place");try{Di(Q)}catch(Jt){throw jt(Q),Jt}}else if(Qn(Q))H=hi("<!---->"),$=H.ownerDocument.importNode(Q,!0),$.nodeType===Vn.element&&$.nodeName==="BODY"||$.nodeName==="HTML"?H=$:H.appendChild($),Di($);else{if(!st&&!kt&&!it&&Q.indexOf("<")===-1)return M&&tn?B(Q):Q;if(H=hi(Q),!H)return st?null:tn?L:""}H&&en&&ae(H.firstChild);const nt=Ee?Q:H;try{const an=Lr(nt);for(;re=an.nextNode();)ho(re,nt),Hn(re),Gn(re.content)&&gi(re.content)}catch(an){throw Ee&&(jt(Q),qi(e.removed,Jt=>{Jt.element&&Mr(Jt.element)})),an}if(Ee)return qi(e.removed,an=>{an.element&&Mr(an.element)}),kt&&Kn(Q),Q;if(st){if(kt&&Kn(H),lt)for(le=J.call(H.ownerDocument);H.firstChild;)le.appendChild(H.firstChild);else le=H;return(Me.shadowroot||Me.shadowrootmode)&&(le=ee.call(r,le,!0)),le}let ut=it?H.outerHTML:H.innerHTML;return it&&ve["!doctype"]&&H.ownerDocument&&H.ownerDocument.doctype&&H.ownerDocument.doctype.name&&vn(_9,H.ownerDocument.doctype.name)&&(ut="<!DOCTYPE "+H.ownerDocument.doctype.name+`>
|
|
132
|
-
`+ut),kt&&(ut=wn(ut)),M&&tn?B(ut):ut},e.setConfig=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dr(Q),mt=!0,pt=ve,xt=Me},e.clearConfig=function(){Jn=null,mt=!1,pt=null,xt=null,M=E,L=""},e.isValidAttribute=function(Q,j,H){Jn||Dr({});const $=vt(Q),re=vt(j);return Pr($,re,H)},e.addHook=function(Q,j){typeof j=="function"&&Mn(K,Q)&&Ra(K[Q],j)},e.removeHook=function(Q,j){if(Mn(K,Q)){if(j!==void 0){const H=s9(K[Q],j);return H===-1?void 0:l9(K[Q],H,1)[0]}return c1(K[Q])}},e.removeHooks=function(Q){Mn(K,Q)&&(K[Q]=[])},e.removeAllHooks=function(){K=E1()},e}var D9=Ew();const M9=n=>D9.sanitize(n);function ww({comment:n,onChangeTemplate:e,setComment:t,t:r}){const i=g=>p.jsx("div",{title:g.title,children:g.label}),a=xn.useSelector(g=>be.getConfig(g)).annotation.commentTemplates??[],[s,l]=m.useState(null),[u,c]=m.useState(""),[h,f]=m.useState(0),b=g=>{if(g){if(n.trim().length>0){l(g),c(n);return}e(g.value)}},x=()=>{e({...s.value,content:u}),l(null),c("")},w=()=>{l(null),c(""),f(g=>g+1)};return p.jsxs(p.Fragment,{children:[p.jsx(q.Grid,{container:!0,children:p.jsx(q.Typography,{variant:"formSectionTitle",children:r("note")})}),a.length>0&&p.jsx(q.Grid,{style:{marginBottom:"10px"},children:p.jsx(vw,{options:a.map(g=>({label:g.title,title:g.content,value:g})),placeholder:r("useTemplate"),onChange:b,isClearable:!0,isSearchable:!0,formatOptionLabel:i,styles:{marginBottom:"20px"}},h)}),p.jsx(q.Grid,{container:!0,children:p.jsx(Al,{text:n,setText:t})}),p.jsxs(q.Dialog,{"aria-labelledby":"confirm-template-selection-title",fullWidth:!0,maxWidth:"sm",onClose:w,open:s!==null,children:[p.jsx(q.DialogTitle,{id:"confirm-template-selection-title",children:p.jsx(q.Typography,{variant:"h2",component:"span",children:r("confirmTemplateSelectionTitle")})}),p.jsxs(q.DialogContent,{children:[p.jsx(q.DialogContentText,{variant:"body1",color:"inherit",children:r("confirmTemplateSelectionContent")}),p.jsx(q.Typography,{variant:"subtitle2",sx:{marginTop:"16px"},children:r("selectedTemplateContent")}),p.jsx(q.Box,{sx:{border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:"4px",marginBottom:"16px",maxHeight:"150px",overflowY:"auto",padding:"8px 12px"},dangerouslySetInnerHTML:{__html:M9(s?.value.content??"")}}),p.jsx(q.Typography,{variant:"subtitle2",children:r("currentNoteContent")}),p.jsx(Al,{text:u,setText:c})]}),p.jsxs(q.DialogActions,{children:[p.jsx(q.Button,{onClick:w,children:r("cancel")}),p.jsx(q.Button,{color:"primary",onClick:x,variant:"contained",children:r("applyMerge")})]})]})]})}ww.propTypes={comment:d.string.isRequired,onChangeTemplate:d.func.isRequired,setComment:d.func.isRequired,t:d.func.isRequired};function Aw({setTags:n,t:e,tags:t,tagsSuggestions:r}){return p.jsxs(p.Fragment,{children:[p.jsx(q.Typography,{variant:"formSectionTitle",children:e("tags")}),p.jsx(vw,{isMulti:!0,options:r,value:t,onChange:n,closeMenuOnSelect:!1,placeholder:e("tagsPlaceholder")}),p.jsx(q.Divider,{spacing:2})]})}Aw.propTypes={setTags:d.func.isRequired,t:d.func.isRequired,tags:d.any.isRequired,tagsSuggestions:d.arrayOf(d.shape({label:d.string,value:d.string})).isRequired};const Oi={AnnotationFormFooter:cp,MultiTagsInput:Aw,TargetFormSection:ng,TextCommentInput:ww,TextFormSection:PE},{AnnotationFormFooter:k9}=Oi,L9=async n=>n;function _w({annotation:n,canvases:e,closeFormCompanionWindow:t,saveAnnotation:r,t:i}){const[o,a]=m.useState(n),s=()=>{e.forEach(async l=>{r(o.newData,l.id)}),t()};return p.jsxs(p.Fragment,{children:[p.jsx(q.Paper,{elevation:0,style:{minHeight:"300px"},children:p.jsx(nI,{data:o,onUpdate:a})}),p.jsx(k9,{closeFormCompanionWindow:t,saveAnnotation:s,t:i,annotationState:o})]})}_w.propTypes={annotation:d.shape({body:d.shape({format:d.string,id:d.string,type:d.string,value:d.string}),drawingState:d.string,id:d.string,maeData:d.object,manifestNetwork:d.string,motivation:d.string,target:d.string}).isRequired,canvases:d.arrayOf(d.object).isRequired,closeFormCompanionWindow:d.func.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired};function ws({contentLocales:n,label:e,onChange:t,value:r}){return n.length<2?null:p.jsx(Dl,{"aria-label":e,exclusive:!0,onChange:(i,o)=>{o!==null&&t(o)},size:"small",value:r??null,children:n.map(({code:i,name:o})=>p.jsx(Ft,{"aria-label":o??i,value:i,children:i.toUpperCase()},i))})}ws.propTypes={contentLocales:d.arrayOf(d.shape({code:d.string.isRequired,name:d.string})),label:d.string.isRequired,onChange:d.func.isRequired,value:d.string};ws.defaultProps={contentLocales:[],value:null};const P9=at.createSvgIcon(p.jsx("path",{d:"M12 3v9.28c-.47-.17-.97-.28-1.5-.28C8.01 12 6 14.01 6 16.5S8.01 21 10.5 21c2.31 0 4.2-1.75 4.45-4H15V6h4V3z"}),"Audiotrack"),B9=at.createSvgIcon(p.jsx("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"}),"InsertDriveFile"),w1=at.createSvgIcon(p.jsx("path",{d:"m18 4 2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4z"}),"Movie"),F9=at.createSvgIcon(p.jsx("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5zm4-3H19v1h1.5V11H19v2h-1.5V7h3zM9 9.5h1v-1H9zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm10 5.5h1v-3h-1z"}),"PictureAsPdf"),G9=300,q9={audio:P9,"research-pdf":F9,"uploaded-video":w1,"youtube-video":w1},A1={borderRadius:1,flexShrink:0,height:40,objectFit:"cover",width:40};function zf({media:n}){if(n.thumbnailUrl)return p.jsx(q.Box,{component:"img",src:n.thumbnailUrl,alt:"","data-testid":"media-selection-thumbnail",sx:A1});const e=n.source==="media-item"&&q9[n.mediaType]||(n.source==="upload"?Xx:B9);return p.jsx(q.Box,{sx:{...A1,alignItems:"center",bgcolor:"action.hover",color:"action.active",display:"flex",justifyContent:"center"},children:p.jsx(e,{fontSize:"small"})})}zf.propTypes={media:d.shape({mediaType:d.string,source:d.string,thumbnailUrl:d.string}).isRequired};const ef={"iiif-image":{normalize:n=>({id:n.documentId,source:"iiif-image",thumbnailUrl:n.thumbnailUrl??null,title:n.displayTitle}),titleKey:"poi_media_source_iiif_image"},upload:{normalize:n=>({id:String(n.id),source:"upload",thumbnailUrl:n.thumbnailUrl??null,title:n.name}),titleKey:"poi_media_source_upload"},"media-item":{normalize:n=>({id:n.documentId,mediaType:n.mediaType??null,source:"media-item",thumbnailUrl:n.thumbnailUrl??null,title:n.titleEn}),titleKey:"poi_media_source_media_item"}};function cs({dialogContainer:n,label:e,onChange:t,onSearchIiifImages:r,onSearchMediaItems:i,onSearchUploads:o,t:a,value:s}){const l=m.useMemo(()=>({"iiif-image":r,"media-item":i,upload:o}),[r,i,o]),u=m.useMemo(()=>Object.keys(ef).filter(T=>typeof l[T]=="function"),[l]),[c,h]=m.useState((s&&u.includes(s.source)?s.source:u[0])??null),[f,b]=m.useState(s?.title??""),[x,w]=m.useState(s?[s]:[]),[g,y]=m.useState(!1),C=m.useRef(null),A=m.useRef(0);m.useEffect(()=>()=>{clearTimeout(C.current),A.current+=1},[]);const _=(T,D)=>{const M=l[T];if(typeof M!="function")return;const L=A.current+1;A.current=L,y(!0),Promise.resolve(M(D)).then(E=>{A.current===L&&w(E.map(ef[T].normalize))}).finally(()=>{A.current===L&&y(!1)})},N=(T,D)=>{clearTimeout(C.current),C.current=setTimeout(()=>_(T,D),G9)},O=(T,D)=>{D&&(A.current+=1,clearTimeout(C.current),h(D),b(""),w([]),y(!1))};return u.length===0?null:p.jsxs(q.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[u.length>1&&p.jsx(q.ToggleButtonGroup,{value:c,exclusive:!0,onChange:O,size:"small",color:"primary",children:u.map(T=>p.jsx(q.ToggleButton,{value:T,children:a(ef[T].titleKey)},T))}),p.jsx(q.Autocomplete,{filterOptions:T=>T,getOptionKey:T=>T.id,getOptionLabel:T=>T.title,inputValue:f,isOptionEqualToValue:(T,D)=>T.source===D.source&&T.id===D.id,loading:g,noOptionsText:a(f?"poi_media_no_results":"poi_media_search_prompt"),onChange:(T,D)=>t(D),onInputChange:(T,D)=>{b(D),N(c,D)},onOpen:()=>_(c,f),options:x,renderInput:T=>p.jsx(q.TextField,{...T,label:e,variant:"outlined",InputProps:{...T.InputProps,endAdornment:p.jsxs(p.Fragment,{children:[g?p.jsx(q.CircularProgress,{color:"inherit",size:16}):null,T.InputProps.endAdornment]})}}),renderOption:(T,D)=>m.createElement(q.Box,{component:"li",...T,key:D.id,sx:{alignItems:"center",display:"flex",gap:1}},p.jsx(zf,{media:{...D,source:c}}),D.title),slotProps:{popper:{container:n}},value:s&&s.source===c?s:null}),s&&p.jsxs(q.Box,{sx:{alignItems:"center",display:"flex",gap:1},children:[p.jsx(zf,{media:s}),p.jsx(q.Typography,{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:s.title})]})]})}cs.propTypes={dialogContainer:d.func.isRequired,label:d.string.isRequired,onChange:d.func.isRequired,onSearchIiifImages:d.func,onSearchMediaItems:d.func,onSearchUploads:d.func,t:d.func.isRequired,value:d.shape({id:d.string.isRequired,mediaType:d.string,source:d.oneOf(["upload","iiif-image","media-item"]).isRequired,thumbnailUrl:d.string,title:d.string})};cs.defaultProps={onSearchIiifImages:void 0,onSearchMediaItems:void 0,onSearchUploads:void 0,value:null};const H9=(n,e)=>!n&&!e?!0:!n||!e?!1:n.source===e.source&&n.id===e.id;function lu({activeLocaleIsRtl:n,dialogContainer:e,keepSameLabel:t,labelAr:r,labelEn:i,mediaAr:o,mediaEn:a,onChangeAr:s,onChangeEn:l,onSearchIiifImages:u,onSearchMediaItems:c,onSearchUploads:h,t:f}){const[b,x]=m.useState(()=>H9(a,o)),w=y=>{n?(s(y),b&&l(y)):(l(y),b&&s(y))},g=y=>{const{checked:C}=y.target;x(C),C&&(n?l(o):s(a))};return p.jsxs(p.Fragment,{children:[p.jsx(cs,{dialogContainer:e,label:n?r:i,onChange:w,onSearchIiifImages:u,onSearchMediaItems:c,onSearchUploads:h,t:f,value:n?o:a},n?"ar":"en"),p.jsx(q.FormControlLabel,{control:p.jsx(q.Checkbox,{checked:b,onChange:g}),label:t})]})}lu.propTypes={activeLocaleIsRtl:d.bool,dialogContainer:d.func.isRequired,keepSameLabel:d.string.isRequired,labelAr:d.string.isRequired,labelEn:d.string.isRequired,mediaAr:cs.propTypes.value,mediaEn:cs.propTypes.value,onChangeAr:d.func.isRequired,onChangeEn:d.func.isRequired,onSearchIiifImages:d.func,onSearchMediaItems:d.func,onSearchUploads:d.func,t:d.func.isRequired};lu.defaultProps={activeLocaleIsRtl:!1,mediaAr:null,mediaEn:null,onSearchIiifImages:void 0,onSearchMediaItems:void 0,onSearchUploads:void 0};const V9=["showBlocks","|","heading","|","superscript","bold","italic","underline","strikethrough","|","bulletedList","numberedList","link","insertTable","codeBlock","specialCharacters","horizontalLine","subscript","|","undo","redo"],W9=[{class:"ck-heading_paragraph",model:"paragraph",title:"Paragraph"},{class:"ck-heading_heading2",model:"heading2",title:"Heading 2",view:"h2"},{class:"ck-heading_heading3",model:"heading3",title:"Heading 3",view:"h3"},{class:"ck-heading_heading4",model:"heading4",title:"Heading 4",view:"h4"},{class:"ck-heading_heading5",model:"heading5",title:"Heading 5",view:"h5"},{class:"ck-heading_heading6",model:"heading6",title:"Heading 6",view:"h6"}],z9=[Xt.Autoformat,Xt.Bold,Xt.CodeBlock,Xt.Essentials,Xt.Heading,Xt.HorizontalLine,Xt.Italic,Xt.Link,Xt.List,Xt.Paragraph,Xt.ShowBlocks,Xt.SpecialCharacters,Xt.SpecialCharactersEssentials,Xt.Strikethrough,Xt.Subscript,Xt.Superscript,Xt.Table,Xt.TableToolbar,Xt.Underline];function As({onChange:n,placeholder:e,rtl:t,value:r}){return p.jsx(q.Box,{sx:{"& .ck-content":{overflowWrap:"break-word"},"& .ck-content *":t?{direction:"rtl",textAlign:"right"}:void 0,"& .ck-content img, & .ck-content table":{maxWidth:"100%"},"& .ck-editor, & .ck-editor__editable":{maxWidth:"100%"},"& .ck-editor__editable":{minHeight:"150px"},"& .ck-editor__editable, & .ck-content":t?{direction:"rtl",textAlign:"right",unicodeBidi:"plaintext"}:void 0,maxWidth:"100%",minWidth:0},children:p.jsx(uA.CKEditor,{config:{heading:{options:W9},language:{content:t?"ar":"en",ui:"en"},licenseKey:"GPL",placeholder:e,plugins:z9,toolbar:{items:V9,shouldNotGroupWhenFull:!0}},data:r,editor:Xt.ClassicEditor,onChange:(i,o)=>n(o.getData())})})}As.propTypes={onChange:d.func.isRequired,placeholder:d.string,rtl:d.bool,value:d.string};As.defaultProps={placeholder:void 0,rtl:!1,value:""};const{AnnotationFormFooter:X9,TargetFormSection:U9}=Oi,Xf="TextualBody",Tw=n=>typeof n=="string"&&n.toLowerCase().startsWith("ar"),xg=(n,e)=>Object.keys(n)[0]??(e.some(({code:t})=>t==="en")?"en":e[0]?.code),$9={description:"",title:""},Cg=(n,e)=>n[e]??$9,Eg=n=>{const e={},t=new Set;return n.forEach(r=>{const i=r.language;if(!i)return;const o=e[i]??{description:"",title:""};r.purpose==="identifying"?o.title=r.value??"":r.purpose==="describing"&&r.type===Xf&&!t.has(i)&&(o.description=r.value??"",t.add(i)),e[i]=o}),e},Iw=n=>{const e=n?.target?.drawingState?.shapes;return Array.isArray(e)&&e.length===1&&e[0].type===Te.POI},Sw=n=>n==null||Number.isFinite(n)&&n>=-90&&n<=90,Rw=n=>n==null||Number.isFinite(n)&&n>=-180&&n<=180,jl=n=>{const e=n.trim();return e===""?null:Number(e.replace(",","."))},wg=(n,e)=>e.every(({code:t})=>!ta(Cg(n,t).title)),Ag=n=>{const e=n,{contentByLocale:t}=e.maeData;return e.body=Object.entries(t).flatMap(([r,i])=>{const{description:o,title:a}=i;return[{language:r,purpose:"identifying",type:Xf,value:a},...ta(o)?[]:[{language:r,purpose:"describing",type:Xf,value:o}]]}),e},Y9=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=Ag(n);return hs(i,e,t,r)};function Ow({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:o}){const{contentLocales:a=[],searchMediaItems:s,searchIiifImages:l,searchUploads:u}=xn.useSelector(X=>be.getConfig(X)).annotation??{};let c=n;c.id?(c.maeData.target.drawingState&&typeof c.maeData.target.drawingState=="string"&&(c.maeData.target.drawingState={...JSON.parse(c.maeData.target.drawingState),currentShape:null}),c.maeData.contentByLocale=Eg(c.body)):c={body:[],"dbf:kind":"POI","dbf:latitude":null,"dbf:longitude":null,"dbf:mediaAr":null,"dbf:mediaEn":null,maeData:{contentByLocale:{},target:null,templateType:Ge.POI_TYPE},motivation:"identifying",target:null};const[h,f]=m.useState(c),[b,x]=m.useState(!1),[w,g]=m.useState(!1),[y,C]=m.useState(!1),[A,_]=m.useState(!1),[N,O]=m.useState(c["dbf:latitude"]!=null?String(c["dbf:latitude"]):""),[T,D]=m.useState(c["dbf:longitude"]!=null?String(c["dbf:longitude"]):""),[M,L]=m.useState(!1),[E,S]=m.useState(xg(h.maeData.contentByLocale,a)),I=m.useRef(null),P=()=>I.current?.closest('[role="dialog"]')??document.body,B=Cg(h.maeData.contentByLocale,E),F=Tw(E),G=X=>{f({...h,maeData:{...h.maeData,...X}})},V=X=>{G({target:X})},z=X=>{G({contentByLocale:{...h.maeData.contentByLocale,[E]:{...B,...X}}})},W=X=>{f(ie=>({...ie,"dbf:mediaEn":X}))},J=X=>{f(ie=>({...ie,"dbf:mediaAr":X}))},Y=X=>{const{value:ie}=X.target;O(ie),f(de=>({...de,"dbf:latitude":jl(ie)}))},ee=X=>{const{value:ie}=X.target;D(ie),f(de=>({...de,"dbf:longitude":jl(ie)}))},K=async()=>{const X=Iw(h.maeData),ie=wg(h.maeData.contentByLocale,a),de=Sw(h["dbf:latitude"]),oe=Rw(h["dbf:longitude"]);if(x(!X),g(!ie),C(!de),_(!oe),!(!X||!ie||!de||!oe)){ds(o,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),L(!0);try{await r(h)}finally{L(!1)}}};return p.jsxs(q.Grid,{container:!0,direction:"column",spacing:2,ref:I,children:[p.jsxs(q.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[p.jsx(q.Grid,{children:p.jsx(Ne,{variant:"formSectionTitle",children:i("poi")})}),p.jsx(q.Grid,{children:p.jsx(ws,{contentLocales:a,label:i("poi_language"),onChange:S,value:E})})]}),p.jsxs(q.Grid,{children:[p.jsx(q.TextField,{fullWidth:!0,error:w,label:i("poi_title"),value:B.title,variant:"outlined",onChange:X=>z({title:X.target.value}),slotProps:{htmlInput:{dir:F?"rtl":"ltr",style:{textAlign:F?"right":"left"}}}}),w&&p.jsx(Ne,{color:"error",variant:"caption",children:i("poi_title_required")})]}),(s||l||u)&&p.jsx(q.Grid,{children:p.jsx(lu,{activeLocaleIsRtl:F,dialogContainer:P,keepSameLabel:i("poi_media_keep_same"),labelAr:i("poi_media_ar"),labelEn:i("poi_media_en"),mediaAr:h["dbf:mediaAr"]??null,mediaEn:h["dbf:mediaEn"]??null,onChangeAr:J,onChangeEn:W,onSearchIiifImages:l,onSearchMediaItems:s,onSearchUploads:u,t:i})}),p.jsx(q.Grid,{children:p.jsx(Ne,{variant:"formSectionTitle",children:i("poi_description_section")})}),p.jsx(q.Grid,{children:p.jsx(As,{onChange:X=>z({description:X}),placeholder:i("poi_description_placeholder"),rtl:F,value:B.description},E)}),p.jsxs(q.Grid,{container:!0,direction:"row",spacing:2,children:[p.jsxs(q.Grid,{size:6,children:[p.jsx(q.TextField,{fullWidth:!0,error:y,label:i("poi_latitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:N,variant:"outlined",onChange:Y}),y&&p.jsx(Ne,{color:"error",variant:"caption",children:i("poi_latitude_invalid")})]}),p.jsxs(q.Grid,{size:6,children:[p.jsx(q.TextField,{fullWidth:!0,error:A,label:i("poi_longitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:T,variant:"outlined",onChange:ee}),A&&p.jsx(Ne,{color:"error",variant:"caption",children:i("poi_longitude_invalid")})]})]}),p.jsxs(q.Grid,{children:[p.jsx(U9,{onChangeTarget:V,playerReferences:t,pointOnly:!0,spatialTarget:!0,target:h.maeData.target,windowId:o}),b&&p.jsx(Ne,{color:"error",variant:"caption",children:i("poi_target_must_be_point")})]}),p.jsx(q.Grid,{children:p.jsx(X9,{closeFormCompanionWindow:e,saveAnnotation:K,saving:M,t:i,annotationState:h})})]})}Ow.propTypes={annotation:d.shape({adapter:d.func,body:d.arrayOf(d.shape({type:d.string})),defaults:d.objectOf(d.oneOfType([d.bool,d.func,d.number,d.string])),drawingState:d.string,manifestNetwork:d.string,target:d.string}).isRequired,closeFormCompanionWindow:d.func.isRequired,playerReferences:d.object.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired,windowId:d.string.isRequired};const{AnnotationFormFooter:Z9}=Oi,J9=n=>typeof n=="string"&&n.toLowerCase().startsWith("ar"),K9={description:"",title:""},Q9=(n,e)=>n[e]??K9,eB=async n=>Ag(n);function Nw({annotation:n,closeFormCompanionWindow:e,saveAnnotation:t,t:r}){const{contentLocales:i=[],searchMediaItems:o,searchIiifImages:a,searchUploads:s}=xn.useSelector(L=>be.getConfig(L)).annotation??{};let l=n;l.id?l.maeData.contentByLocale=Eg(l.body):l={body:[],"dbf:kind":"Journey","dbf:mediaAr":null,"dbf:mediaEn":null,maeData:{contentByLocale:{},target:{},templateType:Ge.JOURNEY_TYPE},motivation:"identifying",target:null};const[u,c]=m.useState(l),[h,f]=m.useState(!1),[b,x]=m.useState(!1),[w,g]=m.useState(xg(u.maeData.contentByLocale,i)),y=m.useRef(null),C=()=>y.current?.closest('[role="dialog"]')??document.body,A=Q9(u.maeData.contentByLocale,w),_=J9(w),N=L=>{c({...u,maeData:{...u.maeData,...L}})},O=L=>{N({contentByLocale:{...u.maeData.contentByLocale,[w]:{...A,...L}}})},T=L=>{c(E=>({...E,"dbf:mediaEn":L}))},D=L=>{c(E=>({...E,"dbf:mediaAr":L}))},M=async()=>{const L=wg(u.maeData.contentByLocale,i);if(f(!L),!!L){x(!0);try{await t(u)}finally{x(!1)}}};return p.jsxs(q.Grid,{container:!0,direction:"column",spacing:2,ref:y,children:[p.jsxs(q.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[p.jsx(q.Grid,{children:p.jsx(Ne,{variant:"formSectionTitle",children:r("journey")})}),p.jsx(q.Grid,{children:p.jsx(ws,{contentLocales:i,label:r("journey_language"),onChange:g,value:w})})]}),p.jsxs(q.Grid,{children:[p.jsx(q.TextField,{fullWidth:!0,error:h,label:r("journey_title"),value:A.title,variant:"outlined",onChange:L=>O({title:L.target.value}),slotProps:{htmlInput:{dir:_?"rtl":"ltr",style:{textAlign:_?"right":"left"}}}}),h&&p.jsx(Ne,{color:"error",variant:"caption",children:r("journey_title_required")})]}),(o||a||s)&&p.jsx(q.Grid,{children:p.jsx(lu,{activeLocaleIsRtl:_,dialogContainer:C,keepSameLabel:r("journey_media_keep_same"),labelAr:r("journey_media_ar"),labelEn:r("journey_media_en"),mediaAr:u["dbf:mediaAr"]??null,mediaEn:u["dbf:mediaEn"]??null,onChangeAr:D,onChangeEn:T,onSearchIiifImages:a,onSearchMediaItems:o,onSearchUploads:s,t:r})}),p.jsx(q.Grid,{children:p.jsx(Ne,{variant:"formSectionTitle",children:r("journey_description_section")})}),p.jsx(q.Grid,{children:p.jsx(As,{onChange:L=>O({description:L}),placeholder:r("journey_description_placeholder"),rtl:_,value:A.description},w)}),p.jsx(q.Grid,{children:p.jsx(Z9,{closeFormCompanionWindow:e,saveAnnotation:M,saving:b,t:r,annotationState:u})}),p.jsx(q.Grid,{children:p.jsx(Ne,{variant:"subFormSectionTitle",children:r("journey_hint")})})]})}Nw.propTypes={annotation:d.shape({body:d.arrayOf(d.shape({type:d.string})),id:d.string}).isRequired,closeFormCompanionWindow:d.func.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired};const{AnnotationFormFooter:tB,MultiTagsInput:nB,TargetFormSection:rB,TextCommentInput:iB}=Oi,oB=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=W1(n);return hs(i,e,t,r)};function jw({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:o}){const a=xn.useSelector(C=>be.getConfig(C)),l=a.annotation.tagsSuggestions??[];let u=n;if(u.id)u.maeData.target.drawingState&&typeof u.maeData.target.drawingState=="string"&&(u.maeData.target.drawingState=JSON.parse(u.maeData.target.drawingState),console.debug("Parsed drawingState:",u.maeData.target.drawingState),u.maeData.target.drawingState={...u.maeData.target.drawingState,currentShape:null}),u.maeData.textBody=u.body.find(C=>C.purpose==="describing"),u.maeData.tags=u.body.filter(C=>C.purpose==="tagging").map(C=>({label:C.value,value:C.value})),u.maeData.textBody===void 0&&(u.maeData.textBody={purpose:"describing",type:"TextualBody",value:""});else{const{defaultTags:C}=gs(a),A=C.map(_=>({label:_,value:_}));u={body:[],maeData:{tags:A,target:null,templateType:Ge.MULTIPLE_BODY_TYPE,textBody:{purpose:"describing",type:"TextualBody",value:""}},motivation:"commenting",target:null}}const[c,h]=m.useState(u),f=C=>{h({...c,maeData:{...c.maeData,textBody:{...c.maeData.textBody,value:C}}})},b=C=>{h({...c,maeData:{...c.maeData,tags:C}})},x=C=>{const A=c.maeData;A.target=C,h({...c,maeData:A})},w=async()=>{ds(o,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),r(c)},g=l.map(C=>({label:C,value:C})),y=C=>{const A=g.find(_=>_.value===C.title);if(A&&!c.maeData.tags.find(_=>_.value===A.value)){h({...c,maeData:{...c.maeData,tags:[...c.maeData.tags,A],textBody:{...c.maeData.textBody,value:C.content}}});return}f(C.content)};return p.jsxs(q.Grid,{container:!0,direction:"column",spacing:2,children:[p.jsx(q.Grid,{children:p.jsx(iB,{comment:c.maeData.textBody.value,setComment:f,onChangeTemplate:y,t:i})}),p.jsx(q.Grid,{children:p.jsx(nB,{t:i,tags:c.maeData.tags,setTags:b,tagsSuggestions:g})}),p.jsx(q.Grid,{children:p.jsx(rB,{onChangeTarget:x,playerReferences:t,spatialTarget:!0,t:i,target:c.maeData.target,timeTarget:!0,windowId:o})}),p.jsx(q.Grid,{children:p.jsx(tB,{closeFormCompanionWindow:e,saveAnnotation:w,t:i,annotationState:c})})]})}jw.propTypes={annotation:d.shape({adapter:d.func,body:d.arrayOf(d.shape({type:d.string})),defaults:d.objectOf(d.oneOfType([d.bool,d.func,d.number,d.string])),drawingState:d.string,manifestNetwork:d.string,target:d.string}).isRequired,closeFormCompanionWindow:d.func.isRequired,playerReferences:d.object.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired,windowId:d.string.isRequired};const aB=300;function _g({dialogContainer:n,label:e,onChange:t,onSearch:r,t:i,value:o}){const[a,s]=m.useState(o?.titleEn??""),[l,u]=m.useState(o?[o]:[]),[c,h]=m.useState(!1),f=m.useRef(null),b=m.useRef(0);m.useEffect(()=>()=>{clearTimeout(f.current),b.current+=1},[]);const x=g=>{const y=b.current+1;b.current=y,h(!0),Promise.resolve(r(g)).then(C=>{b.current===y&&u(C)}).finally(()=>{b.current===y&&h(!1)})},w=g=>{clearTimeout(f.current),f.current=setTimeout(()=>x(g),aB)};return p.jsx(q.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:p.jsx(q.Autocomplete,{filterOptions:g=>g,getOptionKey:g=>g.documentId,getOptionLabel:g=>g.titleEn,inputValue:a,isOptionEqualToValue:(g,y)=>g.documentId===y.documentId,loading:c,noOptionsText:i(a?"map_relation_no_results":"map_relation_search_prompt"),onChange:(g,y)=>t(y),onInputChange:(g,y)=>{s(y),w(y)},onOpen:()=>x(a),options:l,renderInput:g=>p.jsx(q.TextField,{...g,label:e,variant:"outlined",InputProps:{...g.InputProps,endAdornment:p.jsxs(p.Fragment,{children:[c?p.jsx(q.CircularProgress,{color:"inherit",size:16}):null,g.InputProps.endAdornment]})}}),slotProps:{popper:{container:n}},value:o})})}_g.propTypes={dialogContainer:d.func.isRequired,label:d.string.isRequired,onChange:d.func.isRequired,onSearch:d.func.isRequired,t:d.func.isRequired,value:d.shape({documentId:d.string.isRequired,titleEn:d.string.isRequired})};_g.defaultProps={value:null};const{AnnotationFormFooter:sB,TargetFormSection:lB}=Oi,uB=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=Ag(n);return hs(i,e,t,r)};function Dw({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:o}){const{contentLocales:a=[],searchMaps:s}=xn.useSelector(X=>be.getConfig(X)).annotation??{};let l=n;l.id?(l.maeData.target.drawingState&&typeof l.maeData.target.drawingState=="string"&&(l.maeData.target.drawingState={...JSON.parse(l.maeData.target.drawingState),currentShape:null}),l.maeData.contentByLocale=Eg(l.body)):l={body:[],"dbf:kind":"POI","dbf:latitude":null,"dbf:linkedMap":null,"dbf:longitude":null,"dbf:mediaAr":null,"dbf:mediaEn":null,maeData:{contentByLocale:{},target:null,templateType:Ge.NESTED_MAP_TYPE},motivation:"identifying",target:null};const[u,c]=m.useState(l),[h,f]=m.useState(!1),[b,x]=m.useState(!1),[w,g]=m.useState(!1),[y,C]=m.useState(!1),[A,_]=m.useState(!1),[N,O]=m.useState(l["dbf:latitude"]!=null?String(l["dbf:latitude"]):""),[T,D]=m.useState(l["dbf:longitude"]!=null?String(l["dbf:longitude"]):""),[M,L]=m.useState(!1),[E,S]=m.useState(xg(u.maeData.contentByLocale,a)),I=m.useRef(null),P=()=>I.current?.closest('[role="dialog"]')??document.body,B=Cg(u.maeData.contentByLocale,E),F=Tw(E),G=u["dbf:linkedMap"]??null,V=X=>{c({...u,maeData:{...u.maeData,...X}})},z=X=>{V({target:X})},W=X=>{V({contentByLocale:{...u.maeData.contentByLocale,[E]:{...B,...X}}})},J=X=>{c({...u,"dbf:linkedMap":X?{id:X.documentId,titleEn:X.titleEn}:null})},Y=X=>{const{value:ie}=X.target;O(ie),c(de=>({...de,"dbf:latitude":jl(ie)}))},ee=X=>{const{value:ie}=X.target;D(ie),c(de=>({...de,"dbf:longitude":jl(ie)}))},K=async()=>{const X=Iw(u.maeData),ie=!!u["dbf:linkedMap"],de=wg(u.maeData.contentByLocale,a),oe=Sw(u["dbf:latitude"]),me=Rw(u["dbf:longitude"]);if(f(!X),x(!ie),g(!de),C(!oe),_(!me),!(!X||!ie||!de||!oe||!me)){ds(o,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),L(!0);try{await r(u)}finally{L(!1)}}};return p.jsxs(q.Grid,{container:!0,direction:"column",spacing:2,ref:I,children:[p.jsxs(q.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[p.jsx(q.Grid,{children:p.jsx(Ne,{variant:"formSectionTitle",children:i("nested_map")})}),p.jsx(q.Grid,{children:p.jsx(ws,{contentLocales:a,label:i("poi_language"),onChange:S,value:E})})]}),p.jsxs(q.Grid,{children:[p.jsx(q.TextField,{fullWidth:!0,error:w,label:i("poi_title"),value:B.title,variant:"outlined",onChange:X=>W({title:X.target.value}),slotProps:{htmlInput:{dir:F?"rtl":"ltr",style:{textAlign:F?"right":"left"}}}}),w&&p.jsx(Ne,{color:"error",variant:"caption",children:i("poi_title_required")})]}),p.jsx(q.Grid,{children:p.jsx(Ne,{variant:"formSectionTitle",children:i("nested_map_linked_map")})}),typeof s=="function"&&p.jsxs(q.Grid,{children:[p.jsx(_g,{dialogContainer:P,label:i("nested_map_linked_map"),onChange:J,onSearch:s,t:i,value:G?{documentId:G.id,titleEn:G.titleEn}:null}),b&&p.jsx(Ne,{color:"error",variant:"caption",children:i("nested_map_linked_map_required")})]}),p.jsx(q.Grid,{children:p.jsx(Ne,{variant:"formSectionTitle",children:i("poi_description_section")})}),p.jsx(q.Grid,{children:p.jsx(As,{onChange:X=>W({description:X}),placeholder:i("poi_description_placeholder"),rtl:F,value:B.description},E)}),p.jsxs(q.Grid,{container:!0,direction:"row",spacing:2,children:[p.jsxs(q.Grid,{size:6,children:[p.jsx(q.TextField,{fullWidth:!0,error:y,label:i("poi_latitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:N,variant:"outlined",onChange:Y}),y&&p.jsx(Ne,{color:"error",variant:"caption",children:i("poi_latitude_invalid")})]}),p.jsxs(q.Grid,{size:6,children:[p.jsx(q.TextField,{fullWidth:!0,error:A,label:i("poi_longitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:T,variant:"outlined",onChange:ee}),A&&p.jsx(Ne,{color:"error",variant:"caption",children:i("poi_longitude_invalid")})]})]}),p.jsxs(q.Grid,{children:[p.jsx(lB,{onChangeTarget:z,playerReferences:t,pointOnly:!0,spatialTarget:!0,target:u.maeData.target,windowId:o}),h&&p.jsx(Ne,{color:"error",variant:"caption",children:i("poi_target_must_be_point")})]}),p.jsx(q.Grid,{children:p.jsx(sB,{closeFormCompanionWindow:e,saveAnnotation:K,saving:M,t:i,annotationState:u})})]})}Dw.propTypes={annotation:d.shape({adapter:d.func,body:d.arrayOf(d.shape({type:d.string})),defaults:d.objectOf(d.oneOfType([d.bool,d.func,d.number,d.string])),drawingState:d.string,manifestNetwork:d.string,target:d.string}).isRequired,closeFormCompanionWindow:d.func.isRequired,playerReferences:d.object.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired,windowId:d.string.isRequired};const{AnnotationFormFooter:cB,TargetFormSection:dB}=Oi,hB=V1;function Mw({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:o}){const a=xn.useSelector(b=>be.getConfig(b));let s=n;if(s.id)s.maeData.target.drawingState&&typeof s.maeData.target.drawingState=="string"&&(s.maeData.target.drawingState=JSON.parse(s.maeData.target.drawingState));else{const{defaultTags:b}=gs(a);s={body:{type:"Image",value:b.length>0?b[0]:""},maeData:{target:null,templateType:Ge.TAGGING_TYPE},motivation:"tagging",target:null}}const[l,u]=m.useState(s),c=b=>{const x=l.body;x.value=b,u({...l,body:x})},h=b=>{const x=l.maeData;x.target=b,u({...l,maeData:x})},f=async()=>{ds(o,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),r(l)};return p.jsxs(q.Grid,{container:!0,direction:"column",spacing:2,children:[p.jsx(q.Grid,{children:p.jsxs(Ne,{variant:"formSectionTitle",children:[i("tag")," "]})}),p.jsx(q.Grid,{children:p.jsx(q.TextField,{id:"outlined-basic",label:i("your_tag_here"),value:l.body.value,variant:"outlined",onChange:b=>c(b.target.value)})}),p.jsx(q.Grid,{children:p.jsx(dB,{onChangeTarget:h,playerReferences:t,spatialTarget:!0,target:l.maeData.target,windowId:o})}),p.jsx(q.Grid,{children:p.jsx(cB,{closeFormCompanionWindow:e,saveAnnotation:f,t:i,annotationState:l})})]})}Mw.propTypes={annotation:d.shape({adapter:d.func,body:d.arrayOf(d.shape({type:d.string})),defaults:d.objectOf(d.oneOfType([d.bool,d.func,d.number,d.string])),drawingState:d.string,manifestNetwork:d.string,target:d.string}).isRequired,closeFormCompanionWindow:d.func.isRequired,playerReferences:d.object.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired,windowId:d.string.isRequired};const{AnnotationFormFooter:fB,TargetFormSection:pB,TextCommentInput:gB}=Oi,mB="Annotation",bB=V1;function kw({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:o}){let a=n;a.id?a.maeData.target.drawingState&&typeof a.maeData.target.drawingState=="string"&&(a.maeData.target.drawingState=JSON.parse(a.maeData.target.drawingState)):a={body:{id:hn(),type:"TextualBody",value:""},maeData:{target:null,templateType:Ge.TEXT_TYPE},motivation:"commenting",target:null};const[s,l]=m.useState(a),u=b=>{const x=s.body;x.value=b,l({...s,body:x})},c=b=>{u(b.content)},h=b=>{const x=s.maeData;x.target=b,l({...s,maeData:x})},f=()=>{ds(o,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),s.body.value===void 0&&(s.body.value=mB),r(s)};return m.useEffect(()=>{},[s.maeData.target]),p.jsxs(q.Grid,{container:!0,direction:"column",spacing:2,children:[p.jsx(q.Grid,{children:p.jsx(gB,{comment:s.body.value,setComment:u,onChangeTemplate:c,t:i})}),p.jsx(q.Grid,{children:p.jsx(pB,{onChangeTarget:h,playerReferences:t,spatialTarget:!0,target:s.maeData.target,windowId:o})}),p.jsx(q.Grid,{children:p.jsx(fB,{closeFormCompanionWindow:e,saveAnnotation:f,t:i,annotationState:s})})]})}kw.propTypes={annotation:d.object.isRequired,closeFormCompanionWindow:d.func.isRequired,playerReferences:d.object.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired,windowId:d.string.isRequired};const Fi=n=>n===$t.IMAGE,uu=(n,e=[])=>{const t=[{Component:jw,convertToAnnotation:oB,description:n("textual_note_with_target"),icon:p.jsx(vT,{}),id:Ge.MULTIPLE_BODY_TYPE,isCompatibleWithMediaType:Fi,label:n("note"),selectable:!0},{Component:Mw,convertToAnnotation:hB,description:n("tag_with_target"),icon:p.jsx(yT,{fontSize:"small"}),id:Ge.TAGGING_TYPE,isCompatibleWithMediaType:Fi,label:n("tag"),selectable:!0},{Component:Ow,convertToAnnotation:Y9,description:n("poi_description"),icon:p.jsx(CT,{fontSize:"small"}),id:Ge.POI_TYPE,isCompatibleWithMediaType:Fi,label:n("poi"),selectable:!0},{Component:Dw,convertToAnnotation:uB,description:n("nested_map_description"),icon:p.jsx(J1,{fontSize:"small"}),id:Ge.NESTED_MAP_TYPE,isCompatibleWithMediaType:Fi,label:n("nested_map"),selectable:!0},{Component:Nw,convertToAnnotation:eB,description:n("journey_description"),icon:p.jsx(Q1,{fontSize:"small"}),id:Ge.JOURNEY_TYPE,isCompatibleWithMediaType:Fi,label:n("journey"),selectable:!0},{Component:_w,convertToAnnotation:L9,description:n("edit_iiif_json_code"),icon:p.jsx(xT,{fontSize:"small"}),id:Ge.IIIF_TYPE,isCompatibleWithMediaType:Fi,label:n("expert_mode"),selectable:!0},{Component:kw,convertToAnnotation:bB,description:"",icon:null,id:Ge.TEXT_TYPE,isCompatibleWithMediaType:Fi,label:"",selectable:!1}],r=new Set(t.map(o=>o.id)),i=e.filter(o=>r.has(o.id)?(console.warn(`Ignoring external annotation template with id "${o.id}": it collides with a built-in template id.`),!1):typeof o.id!="string"||typeof o.Component!="function"||typeof o.convertToAnnotation!="function"||typeof o.isCompatibleWithMediaType!="function"?(console.warn(`Ignoring external annotation template with id "${o.id}": it does not follow the TEMPLATE_REGISTRY contract (id: string, Component/convertToAnnotation/isCompatibleWithMediaType: function are all required).`),!1):!0);return[...t,...i]},Lw=(n,e=[],t=null)=>uu(n,e).filter(r=>r.selectable).filter(r=>!Array.isArray(t)||t.length===0?!0:t.includes(r.id)),ja=(n,e,t=[])=>uu(n,t).find(r=>r.id===e);let Za=0;const _1=()=>{document.dispatchEvent(new CustomEvent(af,{detail:{saving:Za>0}}))},vB=n=>n["dbf:kind"]==="Journey"?Ge.JOURNEY_TYPE:n["dbf:linkedMap"]?Ge.NESTED_MAP_TYPE:Ge.POI_TYPE,Pw="maps-annotation-list",yB={name:Pw,put:!0},xB={name:Pw,put:(n,e,t)=>t.getAttribute("data-kind")==="POI"};function Bw({journeyId:n,persist:e,pois:t,recomputeAndPersistJourney:r,renderRow:i}){const o=m.useRef(!1),a=m.useRef(0),[s,l]=m.useState(t);m.useEffect(()=>{o.current||a.current>0||l(t)},[t]);const u=m.useCallback(()=>{o.current=!0},[]),c=m.useCallback(()=>{o.current=!1},[]),h=m.useCallback(f=>{const b=f.map((w,g)=>ix(w,n,g));l(b),a.current+=1;let x;b.reduce((w,g)=>w.then(()=>e(g).then(y=>{x=y})),Promise.resolve()).then(()=>x?r(n,x.items):void 0).finally(()=>{a.current-=1})},[n,e,r]);return p.jsx(vx.ReactSortable,{animation:150,forceFallback:!0,group:xB,list:s,onEnd:c,onStart:u,setList:h,tag:"ul",style:{listStyle:"none",margin:0,paddingInlineStart:24},children:s.map(f=>p.jsx("li",{style:{listStyle:"none"},"data-kind":"POI",children:i(f)},f.id))})}Bw.propTypes={journeyId:d.string.isRequired,persist:d.func.isRequired,pois:d.arrayOf(d.object).isRequired,recomputeAndPersistJourney:d.func.isRequired,renderRow:d.func.isRequired};function Tg({canvasId:n,deselectAnnotation:e,hoverAnnotation:t,hoveredAnnotationIds:r=[],index:i,items:o=[],label:a,receiveAnnotation:s,selectAnnotation:l,selectedAnnotationId:u,storageAdapter:c,totalSize:h,windowId:f}){const{i18n:b,t:x}=Bn.useTranslation(),w=m.useMemo(()=>{const G=new Map;return uu(x).forEach(V=>G.set(V.id,V)),G},[x]),g=m.useMemo(()=>rx(o),[o]),y=m.useMemo(()=>g.map(G=>G.item),[g]),C=m.useMemo(()=>{const G=new Map;return g.forEach(V=>{V.kind==="Journey"&&G.set(V.id,V.pois)}),G},[g]),A=m.useRef(!1),_=m.useRef(0),[N,O]=m.useState(y);m.useEffect(()=>{A.current||_.current>0||O(y)},[y]);const T=m.useCallback(()=>{A.current=!0},[]),D=m.useCallback(()=>{A.current=!1},[]),M=m.useRef(Promise.resolve()),L=m.useCallback(G=>{const V=c(n);Za+=1,Za===1&&_1();const z=()=>V.update(G).then(J=>(s(n,V.annotationPageId,J),J)),W=M.current.then(z,z);return M.current=W.catch(()=>{}),W.finally(()=>{Za-=1,Za===0&&_1()}),W},[c,n,s]),E=m.useCallback((G,V)=>{if(!G)return Promise.resolve();const z=uf(G,V,n);if(!z)return Promise.resolve();const W=(V??[]).find(J=>J.id===G);return W&&JSON.stringify(W.target)===JSON.stringify(z.target)?Promise.resolve():L(z)},[L]),S=m.useCallback(G=>{const V=new Set(G.map(J=>J["dbf:journey"]?.id).filter(Boolean)),z=G.map((J,Y)=>tm(J,Y));O(z),_.current+=1;let W;z.reduce((J,Y)=>J.then(()=>L(Y).then(ee=>{W=ee})),Promise.resolve()).then(()=>{if(W)return Promise.all([...V].map(J=>E(J,W.items)))}).finally(()=>{_.current-=1})},[L,E]),I=m.useCallback(G=>{window.getSelection()?.toString()||(u===G?e(f,G):l(f,G))},[f,e,l,u]),P=m.useMemo(()=>g.filter(G=>G.kind==="Journey").map(G=>({id:G.id,title:em(G.item,b.language)||"—"})),[g,b.language]),B=m.useCallback((G,V)=>{const z=G["dbf:journey"]?.id??null,W=V?ix(G,V,(C.get(V)??[]).length):tm(G,N.length);L(W).then(J=>{if(!J)return;const Y=new Set([V,z].filter(Boolean));return Promise.all([...Y].map(ee=>E(ee,J.items)))})},[C,L,N.length,E]),F=G=>{const V=em(G,b.language)||"—",z=r.includes(G.id)||u===G.id,W=G["dbf:kind"]==="Journey",J=w.get(vB(G))?.icon;let Y;return z?Y="rgba(0, 0, 0, 0.04)":W&&(Y="rgba(0, 0, 0, 0.02)"),p.jsxs(Ll,{annotationid:G.id,currentJourneyId:W?void 0:G["dbf:journey"]?.id??null,"data-kind":G["dbf:kind"],journeys:W?void 0:P,onClick:()=>I(G.id),onMoveToJourney:W?void 0:ee=>B(G,ee),onMouseEnter:()=>t(f,[G.id]),onMouseLeave:()=>t(f,[]),style:{alignItems:"center",backgroundColor:Y,cursor:"pointer",display:"flex",gap:8,listStyle:"none",padding:"8px 16px"},children:[J&&p.jsx("span",{style:{display:"inline-flex",flexShrink:0},children:J}),p.jsx(Ne,{variant:W?"subtitle2":"body2",children:V})]},G.id)};return N.length===0?null:p.jsxs(p.Fragment,{children:[p.jsx(Ne,{sx:{paddingLeft:2,paddingRight:1,paddingTop:2},variant:"overline",children:x("annotationCanvasLabel",{context:`${i+1}/${h}`,label:a})}),p.jsx(vx.ReactSortable,{animation:150,forceFallback:!0,group:yB,list:N,onEnd:D,onStart:T,setList:S,tag:"ul",style:{listStyle:"none",margin:0,padding:0},children:N.map(G=>G["dbf:kind"]==="Journey"?p.jsxs("li",{style:{listStyle:"none"},"data-kind":"Journey",children:[F(G),p.jsx(Bw,{journeyId:G.id,persist:L,pois:C.get(G.id)??[],recomputeAndPersistJourney:E,renderRow:F})]},G.id):p.jsx("li",{style:{listStyle:"none"},"data-kind":"POI",children:F(G)},G.id))})]})}Tg.propTypes={canvasId:d.string.isRequired,deselectAnnotation:d.func.isRequired,hoverAnnotation:d.func.isRequired,hoveredAnnotationIds:d.arrayOf(d.string),index:d.number.isRequired,items:d.arrayOf(d.object),label:d.string.isRequired,receiveAnnotation:d.func.isRequired,selectAnnotation:d.func.isRequired,selectedAnnotationId:d.string,storageAdapter:d.func.isRequired,totalSize:d.number.isRequired,windowId:d.string.isRequired};Tg.defaultProps={hoveredAnnotationIds:[],items:[],selectedAnnotationId:void 0};const Uf=n=>{if(!n)return!1;const e=getComputedStyle(n),t=e.overflowY||e.overflow||"";return/(auto|scroll|overlay)/.test(t)&&n.scrollHeight>n.clientHeight},CB=n=>{let e=n?.parentElement||null;for(;e;){if(Uf(e))return e;e=e.parentElement}return null},EB=()=>document.scrollingElement||document.documentElement;function wB(n,e,t){const r=n.getBoundingClientRect(),i=e.getBoundingClientRect(),o=i.top-r.top+n.scrollTop,a=i.bottom-r.top+n.scrollTop,s=n.scrollTop+t,l=n.scrollTop+n.clientHeight,u=o<s,c=a>l;return!u&&!c?null:u?o-t:Math.max(a-n.clientHeight,o-t)}function AB(n,e){const t=n.getBoundingClientRect(),r=t.top+window.scrollY,i=t.bottom+window.scrollY,o=window.scrollY+e,a=window.scrollY+window.innerHeight,s=r<o,l=i>a;return!s&&!l?null:s?r-e:Math.max(i-window.innerHeight,r-e)}const _B=(n,e,t)=>new Promise(r=>{const i="smooth";requestAnimationFrame(()=>{requestAnimationFrame(()=>{let a=e.current;if(Uf(a)||(a=CB(n)),Uf(a)||(a=EB()),a===document.body||a===document.documentElement||a===document.scrollingElement){const c=AB(n,96);if(c==null)return r(!0);const h=window.scrollY;window.scrollTo({behavior:i,top:c}),setTimeout(()=>{const f=window.scrollY;r(Math.abs(f-h)>.5)},t);return}const l=wB(a,n,96);if(l==null)return r(!0);const u=a.scrollTop;typeof a.scrollTo=="function"&&a.scrollTo({behavior:i,top:l}),setTimeout(()=>{const c=a.scrollTop;r(Math.abs(c-u)>.5)},t)})})}),TB=async(n,e)=>{for(let i=0;i<=3&&!await _B(n,e,24);i++)i<3&&await new Promise(a=>{setTimeout(a,24)})};function Fw({addCompanionWindow:n,annotationsOnCanvases:e={},canvases:t=[],config:r,deselectAnnotation:i,highlightAllAnnotations:o,receiveAnnotation:a,switchToSingleCanvasView:s,TargetComponent:l,targetProps:u,updateWindow:c,windowViewType:h,annotationEditCompanionWindowIsOpened:f,annotationPreviewCompanionWindowIsOpened:b}){const[x,w]=m.useState(!1),{t:g}=Bn.useTranslation(),y=m.useRef(null),C=m.useRef(null);m.useEffect(()=>{const S=u?.selectedAnnotationId;if(!S)return;const I=y.current?.querySelector(`li[annotationid="${S}"]`)||y.current?.querySelector("li.MuiMenuItem-root.Mui-selected");I&&TB(I,C)},[u?.selectedAnnotationId]);const A=m.useCallback(()=>{w(S=>!S)});m.useEffect(()=>{hu.isInitialized&&r.translations&&(Object.keys(r.translations).forEach(S=>{hu.addResourceBundle(S,"translation",r.translations[S],!0,!0)}),r.language&&hu.changeLanguage(r.language))},[r.translations,r.language]);const{editMode:_}=sI(r);m.useEffect(()=>{_&&!o&&c({highlightAllAnnotations:!0})},[_,o,c]);const N=m.useCallback(S=>S?t.some(I=>{const P=e[I.id];return P?Object.values(P).some(B=>B.json&&B.json.items?B.json.items.some(F=>F.id===S&&F.maeData):!1):!1}):!1,[t,e]),O=m.useRef(f);m.useEffect(()=>{const S=!O.current,I=f;O.current=f,_&&S&&I&&i()},[_,f,i]);const T=m.useRef(null);m.useEffect(()=>{if(!_)return;const S=u?.selectedAnnotationId;S!==T.current&&(T.current=S,S&&f&&N(S)&&n("annotationCreation",{annotationid:S,position:"right"}))},[_,u?.selectedAnnotationId,f,N,n]);const D={containerRef:C,...u,listContainerComponent:Ll},M=m.useMemo(()=>{const S=u?.canvasId;return!S||!e[S]?[]:Object.values(e[S]).flatMap(I=>I?.json?.items??[])},[u?.canvasId,e]),L=M.some(S=>S["dbf:kind"]==="POI"||S["dbf:kind"]==="Journey"),E=m.useMemo(()=>({addCompanionWindow:n,annotationEditCompanionWindowIsOpened:f,annotationPreviewCompanionWindowIsOpened:b,annotationsOnCanvases:e,canvases:t,config:r,receiveAnnotation:a,storageAdapter:r.annotation.adapter,t:g,toggleSingleCanvasDialogOpen:A,windowId:u.windowId,windowViewType:h}),[n,f,b,e,t,r,a,g,A,u.windowId,h]);return p.jsxs(ex.Provider,{value:E,children:[p.jsx("div",{ref:y,style:{height:"100%",position:"relative"},children:L?p.jsx(Tg,{canvasId:u.canvasId,deselectAnnotation:u.deselectAnnotation,hoverAnnotation:u.hoverAnnotation,hoveredAnnotationIds:u.hoveredAnnotationIds,index:u.index,items:M,label:u.label,receiveAnnotation:a,selectAnnotation:u.selectAnnotation,selectedAnnotationId:u.selectedAnnotationId,storageAdapter:r.annotation.adapter,totalSize:u.totalSize,windowId:u.windowId}):p.jsx(l,{...D})}),h!=="single"&&p.jsx(Zf,{handleClose:A,open:x,switchToSingleCanvasView:s})]})}Fw.propTypes={addCompanionWindow:d.func.isRequired,annotationEditCompanionWindowIsOpened:d.bool.isRequired,annotationPreviewCompanionWindowIsOpened:d.bool.isRequired,annotationsOnCanvases:d.shape({id:d.string,isFetching:d.bool,json:d.shape({id:d.string,items:d.arrayOf(d.shape({body:d.shape({format:d.string,id:d.string,value:d.string}),drawingState:d.string,id:d.string,manifestNetwork:d.string,motivation:d.string,target:d.string,type:d.string})),type:d.string})}).isRequired,canvases:d.arrayOf(d.shape({id:d.string,index:d.number})).isRequired,config:d.shape({annotation:d.shape({adapter:d.func,editMode:d.bool}),language:d.string,translations:d.objectOf(d.object)}).isRequired,deselectAnnotation:d.func.isRequired,highlightAllAnnotations:d.bool.isRequired,receiveAnnotation:d.func.isRequired,switchToSingleCanvasView:d.func.isRequired,t:d.func.isRequired,TargetComponent:d.oneOfType([d.func,d.node]).isRequired,targetProps:d.object.isRequired,updateWindow:d.func.isRequired,windowViewType:d.string.isRequired};function IB(n,{targetProps:{windowId:e}}){const t=be.getVisibleCanvases(n,{windowId:e}),r={},i=be.getCompanionWindowsForContent(n,{content:"annotationCreation",windowId:e}),o=Object.keys(i).length===0,a=be.getCompanionWindowsForContent(n,{content:"mapsPoiPreview",windowId:e}),s=Object.keys(a).length===0;return t.forEach(l=>{const u=n.annotations[l.id];u&&(r[l.id]=u)}),{annotationEditCompanionWindowIsOpened:o,annotationPreviewCompanionWindowIsOpened:s,annotationsOnCanvases:r,canvases:t,config:{...n.config,translations:Kf},highlightAllAnnotations:be.getWindow(n,{windowId:e}).highlightAllAnnotations,windowViewType:be.getWindowViewType(n,{windowId:e})}}const SB=(n,e)=>({addCompanionWindow:(t,r)=>n(be.addCompanionWindow(e.targetProps.windowId,{content:t,...r})),deselectAnnotation:()=>n(be.deselectAnnotation(e.targetProps.windowId)),receiveAnnotation:(t,r,i)=>n(be.receiveAnnotation(t,r,i)),switchToSingleCanvasView:()=>n(be.setWindowViewType(e.targetProps.windowId,"single")),updateWindow:t=>n(be.updateWindow(e.targetProps.windowId,t))}),Gw={component:Fw,mapDispatchToProps:SB,mapStateToProps:IB,mode:"wrap",target:"CanvasAnnotations"};function qw({mediaType:n,setCommentingType:e}){const{t}=Bn.useTranslation(),r=s=>e(s),{enabledTemplateTypes:i,externalTemplates:o}=xn.useSelector(s=>be.getConfig(s)).annotation,a=Lw(t,o,i);return p.jsx(RB,{children:n===$t.AUDIO?p.jsx(q.Grid,{container:!0,spacing:1,direction:"column",children:p.jsx(q.Grid,{children:p.jsx(Ne,{children:t("audio_not_supported")})})}):a.map(s=>s.isCompatibleWithMediaType(n)&&p.jsx(OB,{children:p.jsx(NB,{id:s.id,onClick:()=>r(s),children:p.jsxs(q.CardContent,{children:[p.jsxs(jB,{component:"div",children:[t(s.label),s.icon]}),p.jsx(DB,{component:"div",variant:"body2",children:t(s.description)})]})})},s.id))})}const RB=In.styled("div")(({theme:n})=>({display:"flex",flexDirection:"column",gap:n.spacing(3.75),margin:n.spacing(1.25)})),OB=In.styled(q.Card)(({theme:n})=>({borderRadius:n.shape.borderRadius,boxShadow:n.shadows[1],border:`1px solid ${In.alpha(n.palette.primary?.main??"#5A8264",.25)}`,transition:"box-shadow 120ms ease, transform 120ms ease, border-color 120ms ease","&:hover":{boxShadow:n.shadows[3],borderColor:In.alpha(n.palette.primary?.main??"#5A8264",.5),transform:"translateY(-1px)"}})),NB=In.styled(q.CardActionArea)(({theme:n})=>({borderRadius:n.shape.borderRadius,"&:hover":{backgroundColor:In.alpha(n.palette.primary?.main??"#5A8264",.06)}})),jB=In.styled(Ne)(({theme:n})=>{const e=n.typography.formSectionTitle??{};return{display:"flex",justifyContent:"space-between",alignItems:"center",gap:n.spacing(1),color:e.color??n.palette.primary?.main??"#5A8264",fontSize:e.fontSize??n.typography.h6.fontSize,fontWeight:e.fontWeight??600,letterSpacing:e.letterSpacing??"0.02em",textTransform:e.textTransform??"none",lineHeight:1.25,marginBottom:n.spacing(.5)}}),DB=In.styled(Ne)(({theme:n})=>{const e=n.typography.subFormSectionTitle??{};return{color:n.palette.text.secondary,fontSize:e.fontSize??n.typography.body2.fontSize,fontWeight:e.fontWeight??300,letterSpacing:e.letterSpacing??0,lineHeight:e.lineHeight??n.typography.body2.lineHeight,textTransform:e.textTransform??"none"}});qw.propTypes={mediaType:d.string.isRequired,setCommentingType:d.func.isRequired};const MB=at.createSvgIcon(p.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");function Hw({templateType:n,setCommentingType:e,annotation:t}){const r=()=>{e(null)};return p.jsxs(q.Grid,{container:!0,direction:"row",alignItems:"center",justifyContent:"space-between",sx:{marginRight:"10px"},spacing:2,children:[p.jsx(q.Grid,{children:t.id==null&&p.jsx(be.MiradorMenuButton,{"aria-label":"back",TooltipProps:{title:"back"},children:p.jsx(MB,{onClick:r})})}),p.jsx(q.Grid,{children:n.icon})]})}Hw.propTypes={annotation:d.oneOfType([d.shape({body:d.shape({format:d.string,id:d.string,type:d.string,value:d.string}),drawingState:d.string,id:d.string,manifestNetwork:d.string,motivation:d.string,target:d.string}),d.string]).isRequired,setCommentingType:d.func.isRequired,templateType:d.shape({description:d.string,icon:d.element,id:d.string,label:d.string}).isRequired};function Vw({playerReferences:n,t:e}){return p.jsxs(p.Fragment,{children:[p.jsx("h4",{children:"Debug info "}),p.jsx("p",{children:"Only visible in debug mode"}),p.jsx(Ne,{children:n.getMediaType()}),p.jsxs(Ne,{children:[e("scale"),":",n.getScale()]}),p.jsxs(Ne,{children:[e("zoom"),":",n.getZoom()]}),p.jsxs(Ne,{children:[e("image_true_size"),":",n.getMediaTrueWidth()," ","x",n.getMediaTrueHeight()]}),p.jsxs(Ne,{children:[e("container_size"),":",n.getContainerWidth()," ","x",n.getContainerHeight()]}),p.jsxs(Ne,{children:[e("image_displayed"),":",n.getDisplayedMediaWidth()," ","x",n.getDisplayedMediaHeight()]})]})}Vw.propTypes={playerReferences:d.any.isRequired,t:d.func.isRequired};function Ww({annotation:n,canvases:e,closeFormCompanionWindow:t,playerReferences:r,saveAnnotation:i,templateType:o,windowId:a}){const{t:s}=Bn.useTranslation(),l=xn.useSelector(f=>be.getConfig(f)).annotation,u=l.debug??!1,{externalTemplates:c}=l,h=m.useMemo(()=>uu(s,c).find(f=>f.id===o.id)?.Component,[s,o.id,c]);return p.jsxs(q.Grid,{container:!0,direction:"column",children:[p.jsx(kB,{children:h&&p.jsx(h,{annotation:n,canvases:e,closeFormCompanionWindow:t,playerReferences:r,saveAnnotation:i,t:s,windowId:a})}),u&&p.jsx(Vw,{playerReferences:r,t:s})]})}const kB=In.styled(q.Grid)({margin:"0 10px"});Ww.propTypes={annotation:d.shape({adapter:d.func,body:d.arrayOf(d.shape({type:d.string})),defaults:d.objectOf(d.oneOfType([d.bool,d.func,d.number,d.string])),drawingState:d.string,manifestNetwork:d.string,target:d.string}).isRequired,canvases:d.arrayOf(d.shape({id:d.string,index:d.number})).isRequired,closeFormCompanionWindow:d.func.isRequired,playerReferences:d.object.isRequired,saveAnnotation:d.func.isRequired,templateType:d.shape({description:d.string,icon:d.element,id:d.string,label:d.string}).isRequired,windowId:d.string.isRequired};function zw({id:n,windowId:e,mediaType:t}){const{t:r}=Bn.useTranslation();return p.jsx(be.CompanionWindow,{title:r("media_not_supported"),windowId:e,id:n,children:p.jsxs(q.Grid,{container:!0,padding:1,spacing:1,children:[p.jsx(q.Grid,{children:p.jsx(Ne,{children:r("media_not_supported")})}),p.jsx(q.Grid,{children:p.jsx(Ne,{children:r("detected_media_type",{mediaType:t})})})]})})}zw.propTypes={id:d.string.isRequired,mediaType:d.string.isRequired,windowId:d.string.isRequired};function Xw({annotation:n,canvases:e,closeCompanionWindow:t,config:r,id:i,playerReferences:o,receiveAnnotation:a,windowId:s}){const{t:l}=Bn.useTranslation(),{enabledTemplateTypes:u,externalTemplates:c}=r.annotation,[h,f]=m.useState(null),[b,x]=m.useState(o.getMediaType()),[w,g]=m.useState(0),[,y]=m.useReducer(T=>T+1,0);!o.isInitializedCorrectly()&&w<10&&(console.log("AnnotationForm.js: retryCount",w),setTimeout(()=>{g(w+1),y()},100));const[C,A]=m.useState({height:window.innerHeight,width:window.innerWidth});if(!h)if(n.id)n.maeData&&n.maeData.templateType?f(ja(l,n.maeData.templateType,c)??ja(l,Ge.IIIF_TYPE)):f(ja(l,Ge.IIIF_TYPE));else{const{defaultForm:T}=gs(r),D=Lw(l,c,u).filter(M=>M.isCompatibleWithMediaType(b));T&&Dg[T]?f(ja(l,Dg[T])):D.length===1&&f(D[0])}if(m.useEffect(()=>{f(null),x(o.getMediaType())},[e[0].index]),m.useEffect(()=>{const T=()=>{A({height:window.innerHeight,width:window.innerWidth})};return window.addEventListener("resize",T),()=>{window.removeEventListener("resize",T)}},[]),o.isInitCorrectly||o.isInitializedCorrectly(),!o.isInitCorrectly)return p.jsx(zw,{id:i,mediaType:b,windowId:s});const _=m.useCallback(()=>{t("annotationCreation",{id:i,position:"right"})},[t,i]),N=m.useRef(n);N.current=n;const O=T=>{const D=T,M=D?.maeData?.templateType?ja(l,D.maeData.templateType,c):void 0,L=o.getCanvases().map(async E=>{let S;D?.maeData&&D.maeData.templateType?S=M?await M.convertToAnnotation(D,{canvas:E,playerReferences:o,windowId:s}):await t_(D,E,s,o):S=D;const I=r.annotation.adapter(E.id);return kA(E.id,I,a,S)});return Promise.all(L).then(()=>{_()})};return p.jsx(be.ConnectedCompanionWindow,{title:n.id?l("edit_annotation"):l("new_annotation"),windowId:s,id:i,children:h===null?p.jsx(qw,{setCommentingType:f,mediaType:b}):p.jsxs(q.Grid,{container:!0,direction:"column",spacing:1,children:[p.jsx(q.Grid,{container:!0,children:p.jsx(Hw,{setCommentingType:f,templateType:h,annotation:n})}),p.jsx(q.Grid,{children:p.jsx(Ww,{annotation:n,canvases:e,closeFormCompanionWindow:_,playerReferences:o,saveAnnotation:O,templateType:h,windowId:s})})]})})}Xw.propTypes={annotation:d.oneOfType([d.shape({body:d.shape({format:d.string,id:d.string,type:d.string,value:d.string}),drawingState:d.string,id:d.string,manifestNetwork:d.string,motivation:d.string,target:d.string}),d.string]).isRequired,canvases:d.arrayOf(d.shape({id:d.string})).isRequired,closeCompanionWindow:d.func.isRequired,config:d.shape({annotation:d.shape({adapter:d.func,debug:d.bool,defaults:d.objectOf(d.oneOfType([d.bool,d.func,d.number,d.string])),enabledTemplateTypes:d.arrayOf(d.string),externalTemplates:d.arrayOf(d.object)}),language:d.string,translations:d.objectOf(d.object)}).isRequired,id:d.string.isRequired,playerReferences:d.object.isRequired,receiveAnnotation:d.func.isRequired,windowId:d.string.isRequired};class LB{actions;mediaType;canvases;windowId;overlay;isInitCorrectly;constructor(e,t,r,i){this.actions=i,this.media=r,this.mediaType=PB(e,t),this.canvases=be.getVisibleCanvases(e,{windowId:t}),this.windowId=t,this.isInitCorrectly=!1,this.isInitializedCorrectly()&&(this.mediaType===$t.IMAGE?this.overlay={canvasHeight:this.media.current.canvas.clientHeight,canvasWidth:this.media.current.canvas.clientWidth,containerHeight:this.media.current.canvas.clientHeight,containerWidth:this.media.current.canvas.clientWidth}:console.error("Unknown media type"))}sleep(e){return new Promise(t=>{setTimeout(t,e)})}isInitializedCorrectly(){return this.isInitCorrectly=this.media&&(this.mediaType===$t.IMAGE&&this.media.current&&this.media.current.canvas||this.mediaType===$t.VIDEO&&this.media.video)&&this.mediaType!==$t.UNKNOWN&&this.mediaType!==$t.AUDIO,this.isInitCorrectly}getMediaType(){return this.mediaType}getCanvases(){return this.canvases}getAudioElement(){return this.mediaType===$t.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===$t.IMAGE?this.media.current.container:null}getContainerHeight(){return this.overlay.containerHeight}getContainerWidth(){return this.overlay.containerWidth}getDisplayedMediaHeight(){if(this.mediaType===$t.IMAGE){const e=this.media.current;if(e){const t=this.getMediaTrueHeight()*e.viewport.getZoom(),r=e.container.clientWidth;return Math.round(r*t)}}}getDisplayedMediaWidth(){if(this.mediaType===$t.IMAGE){const e=this.media.current;if(e&&e.world.getItemCount()>0){const t=this.getMediaTrueWidth()*e.viewport.getZoom(),r=e.container.clientWidth;return Math.round(r*t)}}}getMediaTrueHeight(){if(this.mediaType===$t.IMAGE)return this.canvases[0].__jsonld.height;console.error("Unknown media type")}getMediaTrueWidth(){if(this.mediaType===$t.IMAGE)return this.canvases[0].__jsonld.width}getScale(){return this.isInitializedCorrectly()?this.getDisplayedMediaWidth()/this.getMediaTrueWidth():null}getZoom(){if(this.mediaType===$t.IMAGE){const e=this.media.current.viewport.getZoom(),t=this.media.current.viewport.getMaxZoom();let r=e/t;return r=Math.round(r*100)/100,r}}getImagePosition(){if(this.mediaType===$t.IMAGE){const e=this.media.current;if(e){const r=e.world.getItemAt(0).getBounds(),i=e.viewport.viewportToViewerElementCoordinates(r.getTopLeft());return{x:Math.round(i.x),y:Math.round(i.y)}}}}getTargetStrokeWidth(){return Math.max(this.getDisplayedMediaWidth()/500,3)}}function PB(n,e){const t=be.getVisibleCanvasAudioResources(n,{windowId:e})||[];return(be.getVisibleCanvasVideoResources(n,{windowId:e})||[]).length>0?$t.VIDEO:t.length>0?$t.AUDIO:$t.IMAGE}const BB=(n,{id:e,windowId:t})=>({closeCompanionWindow:()=>n(be.removeCompanionWindow(t,e)),receiveAnnotation:(r,i,o)=>n(be.receiveAnnotation(r,i,o))});function FB(n,{id:e,windowId:t}){const i=be.getCompanionWindow(n,{companionWindowId:e,windowId:t}),{annotationid:o}=i,a=be.OSDReferences.get(t),s=new LB(n,t,a,cA),l=be.getVisibleCanvases(n,{windowId:t});let u=be.getPresentAnnotationsOnSelectedCanvases(n,{windowId:t}).flatMap(c=>c.json.items||[]).find(c=>c.id===o);return u||(u={id:null,maeData:{templateType:null}}),{annotation:u,canvases:l,config:{...n.config,translations:Kf},currentTime:null,playerReferences:s}}const Uw={companionWindowKey:"annotationCreation",component:Xw,mapDispatchToProps:BB,mapStateToProps:FB};function $w({PluginComponents:n=[],TargetComponent:e,targetProps:t}){return t.hasAnyAnnotations=!0,p.jsx(e,{...t,PluginComponents:n})}$w.propTypes={PluginComponents:d.array.isRequired,TargetComponent:d.oneOfType([d.func,d.node]).isRequired,targetProps:d.object.isRequired};const Yw={component:$w,mode:"wrap",target:"WindowSideBarButtons"};var Zw=function(e){return"@@redux-saga/"+e},GB=Zw("IO"),qB=Zw("MULTICAST"),HB=function(e){return e==null},VB=function(e){return e!==void 0},Ji=function(e){return typeof e=="function"},Jw=function(e){return typeof e=="string"},Kw=Array.isArray,$f=function(e){return e&&(Jw(e)||zB(e)||Ji(e)||Kw(e)&&e.every($f))},Ig=function(e){return e&&Ji(e.take)&&Ji(e.close)},WB=function(e){return Ji(e)&&e.hasOwnProperty("toString")},zB=function(e){return!!e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype},XB=function(e){return Ig(e)&&e[qB]},UB=function(e){return e},$B=function(e){throw e},YB=function(e){return{value:e,done:!0}};function ZB(n,e,t){e===void 0&&(e=$B),t===void 0&&(t="iterator");var r={meta:{name:t},next:n,throw:e,return:YB,isSagaIterator:!0};return typeof Symbol<"u"&&(r[Symbol.iterator]=function(){return r}),r}var tf="TAKE",JB="PUT",KB="ALL",QB="CALL",eF="FORK",tF="SELECT",Ti=function(e,t){var r;return r={},r[GB]=!0,r.combinator=!1,r.type=e,r.payload=t,r};function nF(n,e){if(n===void 0&&(n="*"),$f(n))return Ti(tf,{pattern:n});if(XB(n)&&VB(e)&&$f(e))return Ti(tf,{channel:n,pattern:e});if(Ig(n))return Ti(tf,{channel:n})}function rF(n,e){return HB(e)&&(e=n,n=void 0),Ti(JB,{channel:n,action:e})}function iF(n){var e=Ti(KB,n);return e.combinator=!0,e}function Qw(n,e){var t=null,r;return Ji(n)?r=n:(Kw(n)?(t=n[0],r=n[1]):(t=n.context,r=n.fn),t&&Jw(r)&&Ji(t[r])&&(r=t[r])),{context:t,fn:r,args:e}}function eA(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Ti(QB,Qw(n,t))}function tA(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Ti(eF,Qw(n,t))}function oF(n){n===void 0&&(n=UB);for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Ti(tF,{selector:n,args:t})}var T1=function(e){return{done:!0,value:e}},nf={};function aF(n){return Ig(n)?"channel":WB(n)?String(n):Ji(n)?n.name:String(n)}function sF(n,e,t){var r,i,o,a=e;function s(l,u){if(a===nf)return T1(l);if(u&&!i)throw a=nf,u;r&&r(l);var c=u?n[i](u):n[a]();return a=c.nextState,o=c.effect,r=c.stateUpdater,i=c.errorState,a===nf?T1(l):o}return ZB(s,function(l){return s(null,l)},t)}function lF(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];var o={done:!1,value:nF(n)},a=function(c){return{done:!1,value:tA.apply(void 0,[e].concat(r,[c]))}},s,l=function(c){return s=c};return sF({q1:function(){return{nextState:"q2",effect:o,stateUpdater:l}},q2:function(){return{nextState:"q1",effect:a(s)}}},"q1","takeEvery("+aF(n)+", "+e.name+")")}function uF(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];return tA.apply(void 0,[lF,n,e].concat(r))}function*cF(n){const e=yield oF(be.getConfig);if(e&&e.annotation.adapter){const t=e.annotation.adapter(n),r=yield eA([t,t.all]);r&&(yield rF(be.receiveAnnotation(n,t.annotationPageId,r)))}}function*dF(n){const{canvasId:e}=n;yield eA(cF,e)}function*hF(){yield iF([uF(be.ActionTypes.SET_CANVAS,dF)])}const fF={saga:hF},pF=(n,e)=>{console.error(`AiinotateAdapter.${n} error: `,e)},gF=async n=>{if(!n.ok)throw new Error(`Fetch error: response ${n.status} on url: ${n.url}`)};class mF{constructor(e,t,r,i){if(![2,3].includes(t))throw new Error(`AiiinotateAdapter: unrecognized value for 'iiifPresentationVersion'. expected one of [2,3], got '${t}'`);this.user=i||ul,this.canvasId=r,this.iiifPresentationVersion=t,this.endpointUrl=e,this.endpointUrlAnnotations=`${this.endpointUrl}/annotations/${t}`,this.endpointUrlManifests=`${this.endpointUrl}/manifests/${t}`}getStorageAdapterUser(){return this.user}get annotationPageId(){return`${this.endpointUrlAnnotations}/search?canvasUri=${this.canvasId}`}maybeConvert(e){return this.iiifPresentationVersion===2?n_(e):e}handleResponse=async(e,t)=>(await gF(t),this.all());handleError=(e,t)=>(pF(e,t),this.all());async create(e){return e=this.maybeConvert(e),fetch(`${this.endpointUrlAnnotations}/create`,{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async t=>await this.handleResponse("create",t)).catch(t=>this.handleError("create",t))}async update(e){return e=this.maybeConvert(e),fetch(`${this.endpointUrlAnnotations}/update`,{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async t=>await this.handleResponse("update",t)).catch(t=>this.handleError("update",t))}async delete(e){return fetch(`${this.endpointUrlAnnotations}/delete?uri=${e}`,{method:"DELETE"}).then(async t=>await this.handleResponse("delete",t)).catch(t=>this.handleError("delete",t))}async get(e){return await fetch(e)}async all(){let e=[],t=this.annotationPageId,r,i;for(;t&&t.length;)r=await fetch(this.annotationPageId),i=await r.json(),e=[...e,...i.resources],t=i.next;const o=await this.iiifPresentationVersion===2?i_(e,this.annotationPageId):e;return o.items=o.items.map(kl),o}}const bF={AiiinotateAdapter:mF,LocalStorageAdapter:z1},vF=[U1,Y1,Gw,Uw,Yw,fF];exports.annotationAdapters=bF;exports.annotationCreationCompanionWindowPlugin=Uw;exports.canvasAnnotationsPlugin=Gw;exports.convertIIIFAnnoToMaeData=kl;exports.default=vF;exports.externalStorageAnnotationPlugin=Y1;exports.miradorAnnotationPlugin=U1;exports.templateKit=Oi;exports.windowSideBarButtonsPlugin=Yw;
|
|
130
|
+
`]))),zP=function(e,t){var r=e.isFocused,i=e.size,o=e.theme,a=o.colors,s=o.spacing.baseUnit;return _e({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},t?{}:{color:r?a.neutral60:a.neutral20,padding:s*2})},Xh=function(e){var t=e.delay,r=e.offset;return xe.jsx("span",{css:xe.css({animation:"".concat(WP," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},process.env.NODE_ENV==="production"?"":";label:LoadingDot;",process.env.NODE_ENV==="production"?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWUsXG4gIENTU09iamVjdFdpdGhMYWJlbCxcbiAgR3JvdXBCYXNlLFxufSBmcm9tICcuLi90eXBlcyc7XG5pbXBvcnQgeyBnZXRTdHlsZVByb3BzIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgSWNvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBTdmcgPSAoe1xuICBzaXplLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZTogbnVtYmVyIH0pID0+IChcbiAgPHN2Z1xuICAgIGhlaWdodD17c2l6ZX1cbiAgICB3aWR0aD17c2l6ZX1cbiAgICB2aWV3Qm94PVwiMCAwIDIwIDIwXCJcbiAgICBhcmlhLWhpZGRlbj1cInRydWVcIlxuICAgIGZvY3VzYWJsZT1cImZhbHNlXCJcbiAgICBjc3M9e3tcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgZmlsbDogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBsaW5lSGVpZ2h0OiAxLFxuICAgICAgc3Ryb2tlOiAnY3VycmVudENvbG9yJyxcbiAgICAgIHN0cm9rZVdpZHRoOiAwLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IHR5cGUgQ3Jvc3NJY29uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgQ3Jvc3NJY29uID0gKHByb3BzOiBDcm9zc0ljb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNMTQuMzQ4IDE0Ljg0OWMtMC40NjkgMC40NjktMS4yMjkgMC40NjktMS42OTcgMGwtMi42NTEtMy4wMzAtMi42NTEgMy4wMjljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDAtMC40NjktMC40NjktMC40NjktMS4yMjkgMC0xLjY5N2wyLjc1OC0zLjE1LTIuNzU5LTMuMTUyYy0wLjQ2OS0wLjQ2OS0wLjQ2OS0xLjIyOCAwLTEuNjk3czEuMjI4LTAuNDY5IDEuNjk3IDBsMi42NTIgMy4wMzEgMi42NTEtMy4wMzFjMC40NjktMC40NjkgMS4yMjgtMC40NjkgMS42OTcgMHMwLjQ2OSAxLjIyOSAwIDEuNjk3bC0yLjc1OCAzLjE1MiAyLjc1OCAzLjE1YzAuNDY5IDAuNDY5IDAuNDY5IDEuMjI5IDAgMS42OTh6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuZXhwb3J0IHR5cGUgRG93bkNoZXZyb25Qcm9wcyA9IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU/OiBudW1iZXIgfTtcbmV4cG9ydCBjb25zdCBEb3duQ2hldnJvbiA9IChwcm9wczogRG93bkNoZXZyb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNNC41MTYgNy41NDhjMC40MzYtMC40NDYgMS4wNDMtMC40ODEgMS41NzYgMGwzLjkwOCAzLjc0NyAzLjkwOC0zLjc0N2MwLjUzMy0wLjQ4MSAxLjE0MS0wLjQ0NiAxLjU3NCAwIDAuNDM2IDAuNDQ1IDAuNDA4IDEuMTk3IDAgMS42MTUtMC40MDYgMC40MTgtNC42OTUgNC41MDItNC42OTUgNC41MDItMC4yMTcgMC4yMjMtMC41MDIgMC4zMzUtMC43ODcgMC4zMzVzLTAuNTctMC4xMTItMC43ODktMC4zMzVjMCAwLTQuMjg3LTQuMDg0LTQuNjk1LTQuNTAycy0wLjQzNi0xLjE3IDAtMS42MTV6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgQnV0dG9uc1xuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbmV4cG9ydCBpbnRlcmZhY2UgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBUaGUgY2hpbGRyZW4gdG8gYmUgcmVuZGVyZWQgaW5zaWRlIHRoZSBpbmRpY2F0b3IuICovXG4gIGNoaWxkcmVuPzogUmVhY3ROb2RlO1xuICAvKiogUHJvcHMgdGhhdCB3aWxsIGJlIHBhc3NlZCBvbiB0byB0aGUgY2hpbGRyZW4uICovXG4gIGlubmVyUHJvcHM6IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snZGl2J107XG4gIC8qKiBUaGUgZm9jdXNlZCBzdGF0ZSBvZiB0aGUgc2VsZWN0LiAqL1xuICBpc0ZvY3VzZWQ6IGJvb2xlYW47XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG59XG5cbmNvbnN0IGJhc2VDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgdGhlbWU6IHtcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICAgIGNvbG9ycyxcbiAgICB9LFxuICB9OlxuICAgIHwgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuICAgIHwgQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2luZGljYXRvckNvbnRhaW5lcicsXG4gIGRpc3BsYXk6ICdmbGV4JyxcbiAgdHJhbnNpdGlvbjogJ2NvbG9yIDE1MG1zJyxcbiAgLi4uKHVuc3R5bGVkXG4gICAgPyB7fVxuICAgIDoge1xuICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw2MCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIHBhZGRpbmc6IGJhc2VVbml0ICogMixcbiAgICAgICAgJzpob3Zlcic6IHtcbiAgICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw4MCA6IGNvbG9ycy5uZXV0cmFsNDAsXG4gICAgICAgIH0sXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgZHJvcGRvd25JbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IERyb3Bkb3duSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnZHJvcGRvd25JbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2Ryb3Bkb3duLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8RG93bkNoZXZyb24gLz59XG4gICAgPC9kaXY+XG4gICk7XG59O1xuXG5leHBvcnQgaW50ZXJmYWNlIENsZWFySW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xufVxuXG5leHBvcnQgY29uc3QgY2xlYXJJbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IENsZWFySW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnY2xlYXJJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2NsZWFyLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8Q3Jvc3NJY29uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBTZXBhcmF0b3Jcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIEluZGljYXRvclNlcGFyYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpbm5lclByb3BzPzogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ107XG59XG5cbmV4cG9ydCBjb25zdCBpbmRpY2F0b3JTZXBhcmF0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0Rpc2FibGVkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JTZXBhcmF0b3InLFxuICBhbGlnblNlbGY6ICdzdHJldGNoJyxcbiAgd2lkdGg6IDEsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgYmFja2dyb3VuZENvbG9yOiBpc0Rpc2FibGVkID8gY29sb3JzLm5ldXRyYWwxMCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIG1hcmdpbkJvdHRvbTogYmFzZVVuaXQgKiAyLFxuICAgICAgICBtYXJnaW5Ub3A6IGJhc2VVbml0ICogMixcbiAgICAgIH0pLFxufSk7XG5cbmV4cG9ydCBjb25zdCBJbmRpY2F0b3JTZXBhcmF0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHByb3BzOiBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgaW5uZXJQcm9wcyB9ID0gcHJvcHM7XG4gIHJldHVybiAoXG4gICAgPHNwYW5cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgICAgey4uLmdldFN0eWxlUHJvcHMocHJvcHMsICdpbmRpY2F0b3JTZXBhcmF0b3InLCB7XG4gICAgICAgICdpbmRpY2F0b3Itc2VwYXJhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgIC8+XG4gICk7XG59O1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIExvYWRpbmdcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBsb2FkaW5nRG90QW5pbWF0aW9ucyA9IGtleWZyYW1lc2BcbiAgMCUsIDgwJSwgMTAwJSB7IG9wYWNpdHk6IDA7IH1cbiAgNDAlIHsgb3BhY2l0eTogMTsgfVxuYDtcblxuZXhwb3J0IGNvbnN0IGxvYWRpbmdJbmRpY2F0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgc2l6ZSxcbiAgICB0aGVtZToge1xuICAgICAgY29sb3JzLFxuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgIH0sXG4gIH06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2xvYWRpbmdJbmRpY2F0b3InLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIGFsaWduU2VsZjogJ2NlbnRlcicsXG4gIGZvbnRTaXplOiBzaXplLFxuICBsaW5lSGVpZ2h0OiAxLFxuICBtYXJnaW5SaWdodDogc2l6ZSxcbiAgdGV4dEFsaWduOiAnY2VudGVyJyxcbiAgdmVydGljYWxBbGlnbjogJ21pZGRsZScsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5pbnRlcmZhY2UgTG9hZGluZ0RvdFByb3BzIHtcbiAgZGVsYXk6IG51bWJlcjtcbiAgb2Zmc2V0OiBib29sZWFuO1xufVxuY29uc3QgTG9hZGluZ0RvdCA9ICh7IGRlbGF5LCBvZmZzZXQgfTogTG9hZGluZ0RvdFByb3BzKSA9PiAoXG4gIDxzcGFuXG4gICAgY3NzPXt7XG4gICAgICBhbmltYXRpb246IGAke2xvYWRpbmdEb3RBbmltYXRpb25zfSAxcyBlYXNlLWluLW91dCAke2RlbGF5fW1zIGluZmluaXRlO2AsXG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6ICdjdXJyZW50Q29sb3InLFxuICAgICAgYm9yZGVyUmFkaXVzOiAnMWVtJyxcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgbWFyZ2luTGVmdDogb2Zmc2V0ID8gJzFlbScgOiB1bmRlZmluZWQsXG4gICAgICBoZWlnaHQ6ICcxZW0nLFxuICAgICAgdmVydGljYWxBbGlnbjogJ3RvcCcsXG4gICAgICB3aWR0aDogJzFlbScsXG4gICAgfX1cbiAgLz5cbik7XG5cbmV4cG9ydCBpbnRlcmZhY2UgTG9hZGluZ0luZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xuICAvKiogU2V0IHNpemUgb2YgdGhlIGNvbnRhaW5lci4gKi9cbiAgc2l6ZTogbnVtYmVyO1xufVxuZXhwb3J0IGNvbnN0IExvYWRpbmdJbmRpY2F0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oe1xuICBpbm5lclByb3BzLFxuICBpc1J0bCxcbiAgc2l6ZSA9IDQsXG4gIC4uLnJlc3RQcm9wc1xufTogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+KSA9PiB7XG4gIHJldHVybiAoXG4gICAgPGRpdlxuICAgICAgey4uLmdldFN0eWxlUHJvcHMoXG4gICAgICAgIHsgLi4ucmVzdFByb3BzLCBpbm5lclByb3BzLCBpc1J0bCwgc2l6ZSB9LFxuICAgICAgICAnbG9hZGluZ0luZGljYXRvcicsXG4gICAgICAgIHtcbiAgICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgICAgfVxuICAgICAgKX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXswfSBvZmZzZXQ9e2lzUnRsfSAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezE2MH0gb2Zmc2V0IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MzIwfSBvZmZzZXQ9eyFpc1J0bH0gLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG4iXX0= */")})},XP=function(e){var t=e.innerProps,r=e.isRtl,i=e.size,o=i===void 0?4:i,a=$r(e,kP);return xe.jsx("div",Se({},Ht(_e(_e({},a),{},{innerProps:t,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),xe.jsx(Xh,{delay:0,offset:r}),xe.jsx(Xh,{delay:160,offset:!0}),xe.jsx(Xh,{delay:320,offset:!r}))},UP=function(e,t){var r=e.isDisabled,i=e.isFocused,o=e.theme,a=o.colors,s=o.borderRadius,l=o.spacing;return _e({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:i?a.primary:a.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:i?a.primary:a.neutral30}})},$P=function(e){var t=e.children,r=e.isDisabled,i=e.isFocused,o=e.innerRef,a=e.innerProps,s=e.menuIsOpen;return xe.jsx("div",Se({ref:o},Ht(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":s}),a,{"aria-disabled":r||void 0}),t)},YP=$P,ZP=["data"],JP=function(e,t){var r=e.theme.spacing;return t?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},KP=function(e){var t=e.children,r=e.cx,i=e.getStyles,o=e.getClassNames,a=e.Heading,s=e.headingProps,l=e.innerProps,u=e.label,c=e.theme,h=e.selectProps;return xe.jsx("div",Se({},Ht(e,"group",{group:!0}),l),xe.jsx(a,Se({},s,{selectProps:h,theme:c,getStyles:i,getClassNames:o,cx:r}),u),xe.jsx("div",null,t))},QP=function(e,t){var r=e.theme,i=r.colors,o=r.spacing;return _e({label:"group",cursor:"default",display:"block"},t?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},eL=function(e){var t=cw(e);t.data;var r=$r(t,ZP);return xe.jsx("div",Se({},Ht(e,"groupHeading",{"group-heading":!0}),r))},tL=KP,nL=["innerRef","isDisabled","isHidden","inputClassName"],rL=function(e,t){var r=e.isDisabled,i=e.value,o=e.theme,a=o.spacing,s=o.colors;return _e(_e({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},iL),t?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:s.neutral80})},yw={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},iL={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":_e({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},yw)},oL=function(e){return _e({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},yw)},aL=function(e){var t=e.cx,r=e.value,i=cw(e),o=i.innerRef,a=i.isDisabled,s=i.isHidden,l=i.inputClassName,u=$r(i,nL);return xe.jsx("div",Se({},Ht(e,"input",{"input-container":!0}),{"data-value":r||""}),xe.jsx("input",Se({className:t({input:!0},l),ref:o,style:oL(s),disabled:a},u)))},sL=aL,lL=function(e,t){var r=e.theme,i=r.spacing,o=r.borderRadius,a=r.colors;return _e({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},uL=function(e,t){var r=e.theme,i=r.borderRadius,o=r.colors,a=e.cropWithEllipsis;return _e({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},cL=function(e,t){var r=e.theme,i=r.spacing,o=r.borderRadius,a=r.colors,s=e.isFocused;return _e({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:s?a.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},xw=function(e){var t=e.children,r=e.innerProps;return xe.jsx("div",r,t)},dL=xw,hL=xw;function fL(n){var e=n.children,t=n.innerProps;return xe.jsx("div",Se({role:"button"},t),e||xe.jsx(Ig,{size:14}))}var pL=function(e){var t=e.children,r=e.components,i=e.data,o=e.innerProps,a=e.isDisabled,s=e.removeProps,l=e.selectProps,u=r.Container,c=r.Label,h=r.Remove;return xe.jsx(u,{data:i,innerProps:_e(_e({},Ht(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:l},xe.jsx(c,{data:i,innerProps:_e({},Ht(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),xe.jsx(h,{data:i,innerProps:_e(_e({},Ht(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},s),selectProps:l}))},gL=pL,mL=function(e,t){var r=e.isDisabled,i=e.isFocused,o=e.isSelected,a=e.theme,s=a.spacing,l=a.colors;return _e({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(s.baseUnit*2,"px ").concat(s.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},bL=function(e){var t=e.children,r=e.isDisabled,i=e.isFocused,o=e.isSelected,a=e.innerRef,s=e.innerProps;return xe.jsx("div",Se({},Ht(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:a,"aria-disabled":r},s),t)},vL=bL,yL=function(e,t){var r=e.theme,i=r.spacing,o=r.colors;return _e({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},xL=function(e){var t=e.children,r=e.innerProps;return xe.jsx("div",Se({},Ht(e,"placeholder",{placeholder:!0}),r),t)},CL=xL,EL=function(e,t){var r=e.isDisabled,i=e.theme,o=i.spacing,a=i.colors;return _e({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:r?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},wL=function(e){var t=e.children,r=e.isDisabled,i=e.innerProps;return xe.jsx("div",Se({},Ht(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),t)},_L=wL,AL={ClearIndicator:qP,Control:YP,DropdownIndicator:FP,DownChevron:bw,CrossIcon:Ig,Group:tL,GroupHeading:eL,IndicatorsContainer:DP,IndicatorSeparator:VP,Input:sL,LoadingIndicator:XP,Menu:yP,MenuList:CP,MenuPortal:IP,LoadingMessage:AP,NoOptionsMessage:_P,MultiValue:gL,MultiValueContainer:dL,MultiValueLabel:hL,MultiValueRemove:fL,Option:vL,Placeholder:CL,SelectContainer:RP,SingleValue:_L,ValueContainer:jP},TL=function(e){return _e(_e({},AL),e.components)},s1=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function IL(n,e){return!!(n===e||s1(n)&&s1(e))}function SL(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!IL(n[t],e[t]))return!1;return!0}function RL(n,e){e===void 0&&(e=SL);var t=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(t&&t.lastThis===this&&e(i,t.lastArgs))return t.lastResult;var a=n.apply(this,i);return t={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){t=null},r}function OL(){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 jL=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:OL},NL=function(e){return xe.jsx("span",Se({css:jL},e))},l1=NL,DL={guidance:function(e){var t=e.isSearchable,r=e.isMulti,i=e.tabSelectsValue,o=e.context,a=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,r=e.label,i=r===void 0?"":r,o=e.labels,a=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(e){var t=e.context,r=e.focused,i=e.options,o=e.label,a=o===void 0?"":o,s=e.selectValue,l=e.isDisabled,u=e.isSelected,c=e.isAppleDevice,h=function(E,g){return E&&E.length?"".concat(E.indexOf(g)+1," of ").concat(E.length):""};if(t==="value"&&s)return"value ".concat(a," focused, ").concat(h(s,r),".");if(t==="menu"&&c){var p=l?" disabled":"",b="".concat(u?" selected":"").concat(p);return"".concat(a).concat(b,", ").concat(h(i,r),".")}return""},onFilter:function(e){var t=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(t?" for search term "+t:"",".")}},ML=function(e){var t=e.ariaSelection,r=e.focusedOption,i=e.focusedValue,o=e.focusableOptions,a=e.isFocused,s=e.selectValue,l=e.selectProps,u=e.id,c=e.isAppleDevice,h=l.ariaLiveMessages,p=l.getOptionLabel,b=l.inputValue,x=l.isMulti,E=l.isOptionDisabled,g=l.isSearchable,v=l.menuIsOpen,C=l.options,A=l.screenReaderStatus,_=l.tabSelectsValue,O=l.isLoading,R=l["aria-label"],I=l["aria-live"],N=m.useMemo(function(){return _e(_e({},DL),h||{})},[h]),L=m.useMemo(function(){var M="";if(t&&N.onChange){var k=t.option,V=t.options,W=t.removedValue,Y=t.removedValues,q=t.value,J=function(oe){return Array.isArray(oe)?null:oe},X=W||k||J(q),Q=X?p(X):"",K=V||Y||void 0,z=K?K.map(p):[],re=_e({isDisabled:X&&E(X,s),label:Q,labels:z},t);M=N.onChange(re)}return M},[t,N,E,s,p]),B=m.useMemo(function(){var M="",k=r||i,V=!!(r&&s&&s.includes(r));if(k&&N.onFocus){var W={focused:k,label:p(k),isDisabled:E(k,s),isSelected:V,options:o,context:k===r?"menu":"value",selectValue:s,isAppleDevice:c};M=N.onFocus(W)}return M},[r,i,p,E,N,o,s,c]),w=m.useMemo(function(){var M="";if(v&&C.length&&!O&&N.onFilter){var k=A({count:o.length});M=N.onFilter({inputValue:b,resultsMessage:k})}return M},[o,b,v,N,C,A,O]),P=t?.action==="initial-input-focus",T=m.useMemo(function(){var M="";if(N.guidance){var k=i?"value":v?"menu":"input";M=N.guidance({"aria-label":R,context:k,isDisabled:r&&E(r,s),isMulti:x,isSearchable:g,tabSelectsValue:_,isInitialFocus:P})}return M},[R,r,i,x,E,g,v,N,s,_,P]),D=xe.jsx(m.Fragment,null,xe.jsx("span",{id:"aria-selection"},L),xe.jsx("span",{id:"aria-focused"},B),xe.jsx("span",{id:"aria-results"},w),xe.jsx("span",{id:"aria-guidance"},T));return xe.jsx(m.Fragment,null,xe.jsx(l1,{id:u},P&&D),xe.jsx(l1,{"aria-live":I,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!P&&D))},kL=ML,Uf=[{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źẑżžẓẕƶȥɀⱬꝣ"}],PL=new RegExp("["+Uf.map(function(n){return n.letters}).join("")+"]","g"),Cw={};for(var Uh=0;Uh<Uf.length;Uh++)for(var $h=Uf[Uh],Yh=0;Yh<$h.letters.length;Yh++)Cw[$h.letters[Yh]]=$h.base;var Ew=function(e){return e.replace(PL,function(t){return Cw[t]})},LL=RL(Ew),u1=function(e){return e.replace(/^\s+|\s+$/g,"")},BL=function(e){return"".concat(e.label," ").concat(e.value)},FL=function(e){return function(t,r){if(t.data.__isNew__)return!0;var i=_e({ignoreCase:!0,ignoreAccents:!0,stringify:BL,trim:!0,matchFrom:"any"},e),o=i.ignoreCase,a=i.ignoreAccents,s=i.stringify,l=i.trim,u=i.matchFrom,c=l?u1(r):r,h=l?u1(s(t)):s(t);return o&&(c=c.toLowerCase(),h=h.toLowerCase()),a&&(c=LL(c),h=Ew(h)),u==="start"?h.substr(0,c.length)===c:h.indexOf(c)>-1}},GL=["innerRef"];function qL(n){var e=n.innerRef,t=$r(n,GL),r=dP(t,"onExited","in","enter","exit","appear");return xe.jsx("input",Se({ref:e},r,{css:xe.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 HL=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function VL(n){var e=n.isEnabled,t=n.onBottomArrive,r=n.onBottomLeave,i=n.onTopArrive,o=n.onTopLeave,a=m.useRef(!1),s=m.useRef(!1),l=m.useRef(0),u=m.useRef(null),c=m.useCallback(function(g,v){if(u.current!==null){var C=u.current,A=C.scrollTop,_=C.scrollHeight,O=C.clientHeight,R=u.current,I=v>0,N=_-O-A,L=!1;N>v&&a.current&&(r&&r(g),a.current=!1),I&&s.current&&(o&&o(g),s.current=!1),I&&v>N?(t&&!a.current&&t(g),R.scrollTop=_,L=!0,a.current=!0):!I&&-v>A&&(i&&!s.current&&i(g),R.scrollTop=0,L=!0,s.current=!0),L&&HL(g)}},[t,r,i,o]),h=m.useCallback(function(g){c(g,g.deltaY)},[c]),p=m.useCallback(function(g){l.current=g.changedTouches[0].clientY},[]),b=m.useCallback(function(g){var v=l.current-g.changedTouches[0].clientY;c(g,v)},[c]),x=m.useCallback(function(g){if(g){var v=lP?{passive:!1}:!1;g.addEventListener("wheel",h,v),g.addEventListener("touchstart",p,v),g.addEventListener("touchmove",b,v)}},[b,p,h]),E=m.useCallback(function(g){g&&(g.removeEventListener("wheel",h,!1),g.removeEventListener("touchstart",p,!1),g.removeEventListener("touchmove",b,!1))},[b,p,h]);return m.useEffect(function(){if(e){var g=u.current;return x(g),function(){E(g)}}},[e,x,E]),function(g){u.current=g}}var c1=["boxSizing","height","overflow","paddingRight","position"],d1={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function h1(n){n.cancelable&&n.preventDefault()}function f1(n){n.stopPropagation()}function p1(){var n=this.scrollTop,e=this.scrollHeight,t=n+this.offsetHeight;n===0?this.scrollTop=1:t===e&&(this.scrollTop=n-1)}function g1(){return"ontouchstart"in window||navigator.maxTouchPoints}var m1=!!(typeof window<"u"&&window.document&&window.document.createElement),Ra=0,Ao={capture:!1,passive:!1};function WL(n){var e=n.isEnabled,t=n.accountForScrollbars,r=t===void 0?!0:t,i=m.useRef({}),o=m.useRef(null),a=m.useCallback(function(l){if(m1){var u=document.body,c=u&&u.style;if(r&&c1.forEach(function(x){var E=c&&c[x];i.current[x]=E}),r&&Ra<1){var h=parseInt(i.current.paddingRight,10)||0,p=document.body?document.body.clientWidth:0,b=window.innerWidth-p+h||0;Object.keys(d1).forEach(function(x){var E=d1[x];c&&(c[x]=E)}),c&&(c.paddingRight="".concat(b,"px"))}u&&g1()&&(u.addEventListener("touchmove",h1,Ao),l&&(l.addEventListener("touchstart",p1,Ao),l.addEventListener("touchmove",f1,Ao))),Ra+=1}},[r]),s=m.useCallback(function(l){if(m1){var u=document.body,c=u&&u.style;Ra=Math.max(Ra-1,0),r&&Ra<1&&c1.forEach(function(h){var p=i.current[h];c&&(c[h]=p)}),u&&g1()&&(u.removeEventListener("touchmove",h1,Ao),l&&(l.removeEventListener("touchstart",p1,Ao),l.removeEventListener("touchmove",f1,Ao)))}},[r]);return m.useEffect(function(){if(e){var l=o.current;return a(l),function(){s(l)}}},[e,a,s]),function(l){o.current=l}}function zL(){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 XL=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},UL=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:zL};function $L(n){var e=n.children,t=n.lockEnabled,r=n.captureEnabled,i=r===void 0?!0:r,o=n.onBottomArrive,a=n.onBottomLeave,s=n.onTopArrive,l=n.onTopLeave,u=VL({isEnabled:i,onBottomArrive:o,onBottomLeave:a,onTopArrive:s,onTopLeave:l}),c=WL({isEnabled:t}),h=function(b){u(b),c(b)};return xe.jsx(m.Fragment,null,t&&xe.jsx("div",{onClick:XL,css:UL}),e(h))}function YL(){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 ZL=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:YL},JL=function(e){var t=e.name,r=e.onFocus;return xe.jsx("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:ZL,value:"",onChange:function(){}})},KL=JL;function Sg(n){var e;return typeof window<"u"&&window.navigator!=null?n.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function QL(){return Sg(/^iPhone/i)}function ww(){return Sg(/^Mac/i)}function e9(){return Sg(/^iPad/i)||ww()&&navigator.maxTouchPoints>1}function t9(){return QL()||e9()}function n9(){return ww()||t9()}var r9=function(e){return e.label},_w=function(e){return e.label},Aw=function(e){return e.value},i9=function(e){return!!e.isDisabled},o9={clearIndicator:GP,container:SP,control:UP,dropdownIndicator:BP,group:JP,groupHeading:QP,indicatorsContainer:NP,indicatorSeparator:HP,input:rL,loadingIndicator:zP,loadingMessage:wP,menu:mP,menuList:xP,menuPortal:TP,multiValue:lL,multiValueLabel:uL,multiValueRemove:cL,noOptionsMessage:EP,option:mL,placeholder:yL,singleValue:EL,valueContainer:OP},a9={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%)"},s9=4,Tw=4,l9=38,u9=Tw*2,c9={baseUnit:Tw,controlHeight:l9,menuGutter:u9},Zh={borderRadius:s9,colors:a9,spacing:c9},d9={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:o1(),captureMenuScroll:!o1(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:FL(),formatGroupLabel:r9,getOptionLabel:_w,getOptionValue:Aw,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:i9,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!aP(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function b1(n,e,t,r){var i=Rw(n,e,t),o=Ow(n,e,t),a=Sw(n,e),s=Ml(n,e);return{type:"option",data:e,isDisabled:i,isSelected:o,label:a,value:s,index:r}}function ll(n,e){return n.options.map(function(t,r){if("options"in t){var i=t.options.map(function(a,s){return b1(n,a,e,s)}).filter(function(a){return y1(n,a)});return i.length>0?{type:"group",data:t,options:i,index:r}:void 0}var o=b1(n,t,e,r);return y1(n,o)?o:void 0}).filter(uP)}function Iw(n){return n.reduce(function(e,t){return t.type==="group"?e.push.apply(e,ta(t.options.map(function(r){return r.data}))):e.push(t.data),e},[])}function v1(n,e){return n.reduce(function(t,r){return r.type==="group"?t.push.apply(t,ta(r.options.map(function(i){return{data:i.data,id:"".concat(e,"-").concat(r.index,"-").concat(i.index)}}))):t.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),t},[])}function h9(n,e){return Iw(ll(n,e))}function y1(n,e){var t=n.inputValue,r=t===void 0?"":t,i=e.data,o=e.isSelected,a=e.label,s=e.value;return(!Nw(n)||!o)&&jw(n,{label:a,value:s,data:i},r)}function f9(n,e){var t=n.focusedValue,r=n.selectValue,i=r.indexOf(t);if(i>-1){var o=e.indexOf(t);if(o>-1)return t;if(i<e.length)return e[i]}return null}function p9(n,e){var t=n.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}var Jh=function(e,t){var r,i=(r=e.find(function(o){return o.data===t}))===null||r===void 0?void 0:r.id;return i||null},Sw=function(e,t){return e.getOptionLabel(t)},Ml=function(e,t){return e.getOptionValue(t)};function Rw(n,e,t){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,t):!1}function Ow(n,e,t){if(t.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,t);var r=Ml(n,e);return t.some(function(i){return Ml(n,i)===r})}function jw(n,e,t){return n.filterOption?n.filterOption(e,t):!0}var Nw=function(e){var t=e.hideSelectedOptions,r=e.isMulti;return t===void 0?r:t},g9=1,Dw=(function(n){Ok(t,n);var e=Dk(t);function t(r){var i;if(Sk(this,t),i=e.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,h=c.onChange,p=c.name;u.name=p,i.ariaOnChange(l,u),h(l,u)},i.setValue=function(l,u,c){var h=i.props,p=h.closeMenuOnSelect,b=h.isMulti,x=h.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:x}),p&&(i.setState({inputIsHiddenAfterUpdate:!b}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,h=u.isMulti,p=u.name,b=i.state.selectValue,x=h&&i.isOptionSelected(l,b),E=i.isOptionDisabled(l,b);if(x){var g=i.getOptionValue(l);i.setValue(b.filter(function(v){return i.getOptionValue(v)!==g}),"deselect-option",l)}else if(!E)h?i.setValue([].concat(ta(b),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:p});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,h=i.getOptionValue(l),p=c.filter(function(x){return i.getOptionValue(x)!==h}),b=Ya(u,p,p[0]||null);i.onChange(b,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange(Ya(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],h=u.slice(0,u.length-1),p=Ya(l,h,h[0]||null);c&&i.onChange(p,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return Jh(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return v1(ll(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return tP.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return Sw(i.props,l)},i.getOptionValue=function(l){return Ml(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,h=o9[l](u,c);h.boxSizing="border-box";var p=i.props.styles[l];return p?p(h,u):h},i.getClassNames=function(l,u){var c,h;return(c=(h=i.props.classNames)[l])===null||c===void 0?void 0:c.call(h,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return TL(i.props)},i.buildCategorizedOptions=function(){return ll(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return Iw(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:_e({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,h=u.menuIsOpen;i.focusInput(),h?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&du(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var h=Math.abs(c.clientX-i.initialTouchX),p=Math.abs(c.clientY-i.initialTouchY),b=5;i.userIsDragging=h>b||p>b}},i.onTouchEnd=function(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,c=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),c=u.indexOf(l);i.setState({focusedOption:l,focusedOptionId:c>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return Nw(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var u=i.props,c=u.isMulti,h=u.backspaceRemovesValue,p=u.escapeClearsValue,b=u.inputValue,x=u.isClearable,E=u.isDisabled,g=u.menuIsOpen,v=u.onKeyDown,C=u.tabSelectsValue,A=u.openMenuOnFocus,_=i.state,O=_.focusedOption,R=_.focusedValue,I=_.selectValue;if(!E&&!(typeof v=="function"&&(v(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||b)return;i.focusValue("previous");break;case"ArrowRight":if(!c||b)return;i.focusValue("next");break;case"Delete":case"Backspace":if(b)return;if(R)i.removeValue(R);else{if(!h)return;c?i.popValue():x&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!g||!C||!O||A&&i.isOptionSelected(O,I))return;i.selectOption(O);break;case"Enter":if(l.keyCode===229)break;if(g){if(!O||i.isComposing)return;i.selectOption(O);break}return;case"Escape":g?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:b}),i.onMenuClose()):x&&p&&i.clearValue();break;case" ":if(b)return;if(!g){i.openMenu("first");break}if(!O)return;i.selectOption(O);break;case"ArrowUp":g?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":g?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!g)return;i.focusOption("pageup");break;case"PageDown":if(!g)return;i.focusOption("pagedown");break;case"Home":if(!g)return;i.focusOption("first");break;case"End":if(!g)return;i.focusOption("last");break;default:return}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++g9),i.state.selectValue=Nl(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),a=i.buildFocusableOptions(),s=a.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=a[s],i.state.focusedOptionId=Jh(o,a[s])}return i}return Rk(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&i1(this.menuListRef,this.focusedOptionRef),n9()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isDisabled,s=o.menuIsOpen,l=this.state.isFocused;(l&&!a&&i.isDisabled||l&&s&&!i.menuIsOpen)&&this.focusInput(),l&&a&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!a&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(i1(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,a=this.state,s=a.selectValue,l=a.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var h=u.indexOf(s[0]);h>-1&&(c=h)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,a=o.selectValue,s=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=a.indexOf(s);s||(l=-1);var u=a.length-1,c=-1;if(a.length){switch(i){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:a[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,s=this.getFocusableOptions();if(s.length){var l=0,u=s.indexOf(a);a||(u=-1),i==="up"?l=u>0?u-1:s.length-1:i==="down"?l=(u+1)%s.length:i==="pageup"?(l=u-o,l<0&&(l=0)):i==="pagedown"?(l=u+o,l>s.length-1&&(l=s.length-1)):i==="last"&&(l=s.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:s[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(s[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Zh):_e(_e({},Zh),this.props.theme):Zh}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,a=this.getStyles,s=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,h=this.props,p=h.isMulti,b=h.isRtl,x=h.options,E=this.hasValue();return{clearValue:i,cx:o,getStyles:a,getClassNames:s,getValue:l,hasValue:E,isMulti:p,isRtl:b,options:x,selectOption:u,selectProps:h,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,a=i.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(i,o){return Rw(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Ow(this.props,i,o)}},{key:"filterOption",value:function(i,o){return jw(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,s=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:a,selectValue:s})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,a=i.isSearchable,s=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,h=i.menuIsOpen,p=i.required,b=this.getComponents(),x=b.Input,E=this.state,g=E.inputIsHidden,v=E.ariaSelection,C=this.commonProps,A=s||this.getElementId("input"),_=_e(_e(_e({"aria-autocomplete":"list","aria-expanded":h,"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":p,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},h&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?v?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?dt.createElement(x,Se({},C,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:A,innerRef:this.getInputRef,isDisabled:o,isHidden:g,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},_)):dt.createElement(qL,Se({id:A,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:jl,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},_))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),a=o.MultiValue,s=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,h=o.Placeholder,p=this.commonProps,b=this.props,x=b.controlShouldRenderValue,E=b.isDisabled,g=b.isMulti,v=b.inputValue,C=b.placeholder,A=this.state,_=A.selectValue,O=A.focusedValue,R=A.isFocused;if(!this.hasValue()||!x)return v?null:dt.createElement(h,Se({},p,{key:"placeholder",isDisabled:E,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),C);if(g)return _.map(function(N,L){var B=N===O,w="".concat(i.getOptionLabel(N),"-").concat(i.getOptionValue(N));return dt.createElement(a,Se({},p,{components:{Container:s,Label:l,Remove:u},isFocused:B,isDisabled:E,key:w,index:L,removeProps:{onClick:function(){return i.removeValue(N)},onTouchEnd:function(){return i.removeValue(N)},onMouseDown:function(T){T.preventDefault()}},data:N}),i.formatOptionLabel(N,"value"))});if(v)return null;var I=_[0];return dt.createElement(c,Se({},p,{data:I,isDisabled:E}),this.formatOptionLabel(I,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var h={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return dt.createElement(o,Se({},a,{innerProps:h,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!o||!u)return null;var h={"aria-hidden":"true"};return dt.createElement(o,Se({},a,{innerProps:h,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,a=i.IndicatorSeparator;if(!o||!a)return null;var s=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return dt.createElement(a,Se({},s,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var a=this.commonProps,s=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return dt.createElement(o,Se({},a,{innerProps:u,isDisabled:s,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),a=o.Group,s=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,h=o.LoadingMessage,p=o.NoOptionsMessage,b=o.Option,x=this.commonProps,E=this.state.focusedOption,g=this.props,v=g.captureMenuScroll,C=g.inputValue,A=g.isLoading,_=g.loadingMessage,O=g.minMenuHeight,R=g.maxMenuHeight,I=g.menuIsOpen,N=g.menuPlacement,L=g.menuPosition,B=g.menuPortalTarget,w=g.menuShouldBlockScroll,P=g.menuShouldScrollIntoView,T=g.noOptionsMessage,D=g.onMenuScrollToTop,M=g.onMenuScrollToBottom;if(!I)return null;var k=function(Q,K){var z=Q.type,re=Q.data,de=Q.isDisabled,oe=Q.isSelected,be=Q.label,Ne=Q.value,Pe=E===re,De=de?void 0:function(){return i.onOptionHover(re)},He=de?void 0:function(){return i.selectOption(re)},ve="".concat(i.getElementId("option"),"-").concat(K),se={id:ve,onClick:He,onMouseMove:De,onMouseOver:De,tabIndex:-1,role:"option","aria-selected":i.state.isAppleDevice?void 0:oe};return dt.createElement(b,Se({},x,{innerProps:se,data:re,isDisabled:de,isSelected:oe,key:ve,label:be,type:z,value:Ne,isFocused:Pe,innerRef:Pe?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(Q.data,"menu"))},V;if(this.hasOptions())V=this.getCategorizedOptions().map(function(X){if(X.type==="group"){var Q=X.data,K=X.options,z=X.index,re="".concat(i.getElementId("group"),"-").concat(z),de="".concat(re,"-heading");return dt.createElement(a,Se({},x,{key:re,data:Q,options:K,Heading:s,headingProps:{id:de,data:X.data},label:i.formatGroupLabel(X.data)}),X.options.map(function(oe){return k(oe,"".concat(z,"-").concat(oe.index))}))}else if(X.type==="option")return k(X,"".concat(X.index))});else if(A){var W=_({inputValue:C});if(W===null)return null;V=dt.createElement(h,x,W)}else{var Y=T({inputValue:C});if(Y===null)return null;V=dt.createElement(p,x,Y)}var q={minMenuHeight:O,maxMenuHeight:R,menuPlacement:N,menuPosition:L,menuShouldScrollIntoView:P},J=dt.createElement(bP,Se({},x,q),function(X){var Q=X.ref,K=X.placerProps,z=K.placement,re=K.maxHeight;return dt.createElement(l,Se({},x,q,{innerRef:Q,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:A,placement:z}),dt.createElement($L,{captureEnabled:v,onTopArrive:D,onBottomArrive:M,lockEnabled:w},function(de){return dt.createElement(u,Se({},x,{innerRef:function(be){i.getMenuListRef(be),de(be)},innerProps:{role:"listbox","aria-multiselectable":x.isMulti,id:i.getElementId("listbox")},isLoading:A,maxHeight:re,focusedOption:E}),V)}))});return B||L==="fixed"?dt.createElement(c,Se({},x,{appendTo:B,controlElement:this.controlRef,menuPlacement:N,menuPosition:L}),J):J}},{key:"renderFormField",value:function(){var i=this,o=this.props,a=o.delimiter,s=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,h=this.state.selectValue;if(c&&!this.hasValue()&&!s)return dt.createElement(KL,{name:u,onFocus:this.onValueInputFocus});if(!(!u||s))if(l)if(a){var p=h.map(function(E){return i.getOptionValue(E)}).join(a);return dt.createElement("input",{name:u,type:"hidden",value:p})}else{var b=h.length>0?h.map(function(E,g){return dt.createElement("input",{key:"i-".concat(g),name:u,type:"hidden",value:i.getOptionValue(E)})}):dt.createElement("input",{name:u,type:"hidden",value:""});return dt.createElement("div",null,b)}else{var x=h[0]?this.getOptionValue(h[0]):"";return dt.createElement("input",{name:u,type:"hidden",value:x})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,a=o.ariaSelection,s=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,h=this.getFocusableOptions();return dt.createElement(kL,Se({},i,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:s,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:h,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,a=i.IndicatorsContainer,s=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,h=u.id,p=u.isDisabled,b=u.menuIsOpen,x=this.state.isFocused,E=this.commonProps=this.getCommonProps();return dt.createElement(s,Se({},E,{className:c,innerProps:{id:h,onKeyDown:this.onKeyDown},isDisabled:p,isFocused:x}),this.renderLiveRegion(),dt.createElement(o,Se({},E,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:p,isFocused:x,menuIsOpen:b}),dt.createElement(l,Se({},E,{isDisabled:p}),this.renderPlaceholderOrValue(),this.renderInput()),dt.createElement(a,Se({},E,{isDisabled:p}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var a=o.prevProps,s=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,h=o.prevWasFocused,p=o.instancePrefix,b=i.options,x=i.value,E=i.menuIsOpen,g=i.inputValue,v=i.isMulti,C=Nl(x),A={};if(a&&(x!==a.value||b!==a.options||E!==a.menuIsOpen||g!==a.inputValue)){var _=E?h9(i,C):[],O=E?v1(ll(i,C),"".concat(p,"-option")):[],R=s?f9(o,C):null,I=p9(o,_),N=Jh(O,I);A={selectValue:C,focusedOption:I,focusedOptionId:N,focusableOptionsWithIds:O,focusedValue:R,clearFocusValueOnUpdate:!1}}var L=l!=null&&i!==a?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},B=u,w=c&&h;return c&&!w&&(B={value:Ya(v,C,C[0]||null),options:C,action:"initial-input-focus"},w=!h),u?.action==="initial-input-focus"&&(B=null),_e(_e(_e({},A),L),{},{prevProps:i,ariaSelection:B,prevWasFocused:w})}}]),t})(m.Component);Dw.defaultProps=d9;var m9=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function b9(n){var e=n.defaultInputValue,t=e===void 0?"":e,r=n.defaultMenuIsOpen,i=r===void 0?!1:r,o=n.defaultValue,a=o===void 0?null:o,s=n.inputValue,l=n.menuIsOpen,u=n.onChange,c=n.onInputChange,h=n.onMenuClose,p=n.onMenuOpen,b=n.value,x=$r(n,m9),E=m.useState(s!==void 0?s:t),g=ri(E,2),v=g[0],C=g[1],A=m.useState(l!==void 0?l:i),_=ri(A,2),O=_[0],R=_[1],I=m.useState(b!==void 0?b:a),N=ri(I,2),L=N[0],B=N[1],w=m.useCallback(function(W,Y){typeof u=="function"&&u(W,Y),B(W)},[u]),P=m.useCallback(function(W,Y){var q;typeof c=="function"&&(q=c(W,Y)),C(q!==void 0?q:W)},[c]),T=m.useCallback(function(){typeof p=="function"&&p(),R(!0)},[p]),D=m.useCallback(function(){typeof h=="function"&&h(),R(!1)},[h]),M=s!==void 0?s:v,k=l!==void 0?l:O,V=b!==void 0?b:L;return _e(_e({},x),{},{inputValue:M,menuIsOpen:k,onChange:w,onInputChange:P,onMenuClose:D,onMenuOpen:T,value:V})}var v9=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],x1=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(e).toLowerCase(),o=String(r.getOptionValue(t)).toLowerCase(),a=String(r.getOptionLabel(t)).toLowerCase();return o===i||a===i},Kh={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,r,i){return!(!e||t.some(function(o){return x1(e,o,i)})||r.some(function(o){return x1(e,o,i)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}};function y9(n){var e=n.allowCreateWhileLoading,t=e===void 0?!1:e,r=n.createOptionPosition,i=r===void 0?"last":r,o=n.formatCreateLabel,a=o===void 0?Kh.formatCreateLabel:o,s=n.isValidNewOption,l=s===void 0?Kh.isValidNewOption:s,u=n.getNewOptionData,c=u===void 0?Kh.getNewOptionData:u,h=n.onCreateOption,p=n.options,b=p===void 0?[]:p,x=n.onChange,E=$r(n,v9),g=E.getOptionValue,v=g===void 0?Aw:g,C=E.getOptionLabel,A=C===void 0?_w:C,_=E.inputValue,O=E.isLoading,R=E.isMulti,I=E.value,N=E.name,L=m.useMemo(function(){return l(_,Nl(I),b,{getOptionValue:v,getOptionLabel:A})?c(_,a(_)):void 0},[a,c,A,v,_,l,b,I]),B=m.useMemo(function(){return(t||!O)&&L?i==="first"?[L].concat(ta(b)):[].concat(ta(b),[L]):b},[t,i,O,L,b]),w=m.useCallback(function(P,T){if(T.action!=="select-option")return x(P,T);var D=Array.isArray(P)?P:[P];if(D[D.length-1]===L){if(h)h(_);else{var M=c(_,_),k={action:"create-option",name:N,option:M};x(Ya(R,[].concat(ta(Nl(I)),[M]),M),k)}return}x(P,T)},[c,_,R,N,L,h,x,I]);return _e(_e({},E),{},{options:B,onChange:w})}var x9=m.forwardRef(function(n,e){var t=b9(n),r=y9(t);return dt.createElement(Dw,Se({ref:e},r))}),Mw=x9;function C1(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function C9(n){if(Array.isArray(n))return n}function E9(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(n)).next,e!==0)for(;!(l=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function w9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
131
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _9(n,e){return C9(n)||E9(n,e)||A9(n,e)||w9()}function A9(n,e){if(n){if(typeof n=="string")return C1(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?C1(n,e):void 0}}const kw=Object.entries,E1=Object.setPrototypeOf,T9=Object.isFrozen,I9=Object.getPrototypeOf,S9=Object.getOwnPropertyDescriptor;let en=Object.freeze,un=Object.seal,Zo=Object.create,Pw=typeof Reflect<"u"&&Reflect,$f=Pw.apply,Yf=Pw.construct;en||(en=function(e){return e});un||(un=function(e){return e});$f||($f=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return e.apply(t,i)});Yf||(Yf=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return new e(...r)});const Vi=Zt(Array.prototype.forEach),R9=Zt(Array.prototype.lastIndexOf),w1=Zt(Array.prototype.pop),Oa=Zt(Array.prototype.push),O9=Zt(Array.prototype.splice),na=Array.isArray,Za=Zt(String.prototype.toLowerCase),Qh=Zt(String.prototype.toString),_1=Zt(String.prototype.match),ja=Zt(String.prototype.replace),A1=Zt(String.prototype.indexOf),j9=Zt(String.prototype.trim),N9=Zt(Number.prototype.toString),D9=Zt(Boolean.prototype.toString),T1=typeof BigInt>"u"?null:Zt(BigInt.prototype.toString),I1=typeof Symbol>"u"?null:Zt(Symbol.prototype.toString),kn=Zt(Object.prototype.hasOwnProperty),Na=Zt(Object.prototype.toString),vn=Zt(RegExp.prototype.test),Gi=M9(TypeError);function Zt(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return $f(n,e,r)}}function M9(n){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Yf(n,t)}}function et(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Za;if(E1&&E1(n,null),!na(e))return n;let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=t(i);o!==i&&(T9(e)||(e[r]=o),i=o)}n[i]=!0}return n}function k9(n){for(let e=0;e<n.length;e++)kn(n,e)||(n[e]=null);return n}function Un(n){const e=Zo(null);for(const r of kw(n)){var t=_9(r,2);const i=t[0],o=t[1];kn(n,i)&&(na(o)?e[i]=k9(o):o&&typeof o=="object"&&o.constructor===Object?e[i]=Un(o):e[i]=o)}return e}function P9(n){switch(typeof n){case"string":return n;case"number":return N9(n);case"boolean":return D9(n);case"bigint":return T1?T1(n):"0";case"symbol":return I1?I1(n):"Symbol()";case"undefined":return Na(n);case"function":case"object":{if(n===null)return Na(n);const e=n,t=Cr(e,"toString");if(typeof t=="function"){const r=t(e);return typeof r=="string"?r:Na(r)}return Na(n)}default:return Na(n)}}function Cr(n,e){for(;n!==null;){const r=S9(n,e);if(r){if(r.get)return Zt(r.get);if(typeof r.value=="function")return Zt(r.value)}n=I9(n)}function t(){return null}return t}function L9(n){try{return vn(n,""),!0}catch{return!1}}const S1=en(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ef=en(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),tf=en(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),B9=en(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),nf=en(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),F9=en(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),R1=en(["#text"]),O1=en(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),rf=en(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),j1=en(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),tl=en(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),G9=un(/{{[\w\W]*|^[\w\W]*}}/g),q9=un(/<%[\w\W]*|^[\w\W]*%>/g),H9=un(/\${[\w\W]*/g),V9=un(/^data-[\-\w.\u00B7-\uFFFF]+$/),W9=un(/^aria-[\-\w]+$/),N1=un(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),z9=un(/^(?:\w+script|data):/i),X9=un(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),U9=un(/^html$/i),$9=un(/^[a-z][.\w]*(-[.\w]+)+$/i),D1=un(/<[/\w!]/g),M1=un(/<[/\w]/g),Y9=un(/<\/no(script|embed|frames)/i),Z9=un(/\/>/i),Vn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Lw=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],J9=en(et({},Lw)),K9=(function(){const n={};return Vi(Lw,e=>{n[e]=un(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),en(n)})(),Q9=function(){return typeof window>"u"?null:window},eB=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(r=t.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},k1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},yi=function(e,t,r,i){return kn(e,t)&&na(e[t])?et(i.base?Un(i.base):{},e[t],i.transform):r},of=function(e,t,r){const i=kn(e,t)?e[t]:void 0;return i&&typeof i=="object"?Un(i):r()};function Bw(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q9();const e=ee=>Bw(ee);if(e.version="3.4.14",e.removed=[],!n||!n.document||n.document.nodeType!==Vn.document||!n.Element)return e.isSupported=!1,e;let t=n.document;const r=t,i=r.currentScript;n.DocumentFragment;const o=n.HTMLTemplateElement,a=n.Node,s=n.Element,l=n.NodeFilter,u=n.NamedNodeMap;u===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const c=n.DOMParser,h=n.trustedTypes,p=s.prototype,b=Cr(p,"cloneNode"),x=Cr(p,"remove"),E=Cr(p,"nextSibling"),g=Cr(p,"childNodes"),v=Cr(p,"parentNode"),C=Cr(p,"shadowRoot"),A=Cr(p,"attributes"),_=a&&a.prototype?Cr(a.prototype,"nodeType"):null,O=a&&a.prototype?Cr(a.prototype,"nodeName"):null,R=a&&a.prototype?Cr(a.prototype,"ownerDocument"):null,I=function(j){return _?_(j):j.nodeType},N=function(j){return O?O(j):j.nodeName};if(typeof o=="function"){const ee=t.createElement("template");ee.content&&ee.content.ownerDocument&&(t=ee.content.ownerDocument)}let L,B="",w,P=!1,T=0;const D=function(){if(T>0)throw Gi('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},M=function(j){D(),T++;try{return L.createHTML(j)}finally{T--}},k=function(j){D(),T++;try{return L.createScriptURL(j)}finally{T--}},V=function(){return P||(w=eB(h,i),P=!0),w},W=t,Y=W.implementation,q=W.createNodeIterator,J=W.createDocumentFragment,X=W.getElementsByTagName,Q=r.importNode;let K=k1();e.isSupported=typeof kw=="function"&&typeof v=="function"&&Y&&Y.createHTMLDocument!==void 0;const z=G9,re=q9,de=H9,oe=V9,be=W9,Ne=z9,Pe=X9,De=$9;let He=N1,ve=null;const se=et({},[...S1,...ef,...tf,...nf,...R1]);let Me=null;const Re=et({},[...O1,...rf,...j1,...tl]);let nt=Object.seal(Zo(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ie=null,Ye=null;const Ue=Object.seal(Zo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let _t=!0,Ke=!0,gt=!1,Ot=!0,Pt=!1,xt=!0,ot=!1,mt=!1,pt=null,Ct=null,tn=!1,st=!1,lt=!1,nn=!1,On=!0,Lt=!1;const bt="user-content-";let jt=!0,Ce=!1,ce={},Ae=null;const ze=et({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let qe=null;const te=et({},["audio","video","img","source","image","track"]);let Te=null;const Xe=et({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ht="http://www.w3.org/1998/Math/MathML",ft="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml";let rn=$e,Cn=!1,dr=null;const hr=et({},[ht,ft,$e],Qh),En=en(["mi","mo","mn","ms","mtext"]);let At=et({},En);const Yr=en(["annotation-xml"]);let Zn=et({},Yr);const Nr=et({},["title","style","font","a","script"]);let fr=null;const pr=["application/xhtml+xml","text/html"],Vt="text/html";let vt=null,Jn=null;const Di=t.createElement("form"),Dr=function(j){return j instanceof RegExp||j instanceof Function},Mr=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Jn&&Jn===j)return;(!j||typeof j!="object")&&(j={}),j=Un(j),fr=pr.indexOf(j.PARSER_MEDIA_TYPE)===-1?Vt:j.PARSER_MEDIA_TYPE,vt=fr==="application/xhtml+xml"?Qh:Za,ve=yi(j,"ALLOWED_TAGS",se,{transform:vt}),Me=yi(j,"ALLOWED_ATTR",Re,{transform:vt}),dr=yi(j,"ALLOWED_NAMESPACES",hr,{transform:Qh}),Te=yi(j,"ADD_URI_SAFE_ATTR",Xe,{transform:vt,base:Xe}),qe=yi(j,"ADD_DATA_URI_TAGS",te,{transform:vt,base:te}),Ae=yi(j,"FORBID_CONTENTS",ze,{transform:vt}),Ie=yi(j,"FORBID_TAGS",Un({}),{transform:vt}),Ye=yi(j,"FORBID_ATTR",Un({}),{transform:vt}),ce=kn(j,"USE_PROFILES")?j.USE_PROFILES&&typeof j.USE_PROFILES=="object"?Un(j.USE_PROFILES):j.USE_PROFILES:!1,_t=j.ALLOW_ARIA_ATTR!==!1,Ke=j.ALLOW_DATA_ATTR!==!1,gt=j.ALLOW_UNKNOWN_PROTOCOLS||!1,Ot=j.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pt=j.SAFE_FOR_TEMPLATES||!1,xt=j.SAFE_FOR_XML!==!1,ot=j.WHOLE_DOCUMENT||!1,st=j.RETURN_DOM||!1,lt=j.RETURN_DOM_FRAGMENT||!1,nn=j.RETURN_TRUSTED_TYPE||!1,tn=j.FORCE_BODY||!1,On=j.SANITIZE_DOM!==!1,Lt=j.SANITIZE_NAMED_PROPS||!1,jt=j.KEEP_CONTENT!==!1,Ce=j.IN_PLACE||!1,He=L9(j.ALLOWED_URI_REGEXP)?j.ALLOWED_URI_REGEXP:N1,rn=typeof j.NAMESPACE=="string"?j.NAMESPACE:$e,At=of(j,"MATHML_TEXT_INTEGRATION_POINTS",()=>et({},En)),Zn=of(j,"HTML_INTEGRATION_POINTS",()=>et({},Yr));const H=of(j,"CUSTOM_ELEMENT_HANDLING",()=>Zo(null));if(nt=Zo(null),kn(H,"tagNameCheck")&&Dr(H.tagNameCheck)&&(nt.tagNameCheck=H.tagNameCheck),kn(H,"attributeNameCheck")&&Dr(H.attributeNameCheck)&&(nt.attributeNameCheck=H.attributeNameCheck),kn(H,"allowCustomizedBuiltInElements")&&typeof H.allowCustomizedBuiltInElements=="boolean"&&(nt.allowCustomizedBuiltInElements=H.allowCustomizedBuiltInElements),un(nt),Pt&&(Ke=!1),lt&&(st=!0),ce&&(ve=et({},R1),Me=Zo(null),ce.html===!0&&(et(ve,S1),et(Me,O1)),ce.svg===!0&&(et(ve,ef),et(Me,rf),et(Me,tl)),ce.svgFilters===!0&&(et(ve,tf),et(Me,rf),et(Me,tl)),ce.mathMl===!0&&(et(ve,nf),et(Me,j1),et(Me,tl))),Ue.tagCheck=null,Ue.attributeCheck=null,kn(j,"ADD_TAGS")&&(typeof j.ADD_TAGS=="function"?Ue.tagCheck=j.ADD_TAGS:na(j.ADD_TAGS)&&(ve===se&&(ve=Un(ve)),et(ve,j.ADD_TAGS,vt))),kn(j,"ADD_ATTR")&&(typeof j.ADD_ATTR=="function"?Ue.attributeCheck=j.ADD_ATTR:na(j.ADD_ATTR)&&(Me===Re&&(Me=Un(Me)),et(Me,j.ADD_ATTR,vt))),kn(j,"ADD_FORBID_CONTENTS")&&na(j.ADD_FORBID_CONTENTS)&&(Ae===ze&&(Ae=Un(Ae)),et(Ae,j.ADD_FORBID_CONTENTS,vt)),jt&&(ve["#text"]=!0),ot&&et(ve,["html","head","body"]),ve.table&&(et(ve,["tbody"]),delete Ie.tbody),j.TRUSTED_TYPES_POLICY){if(typeof j.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof j.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const $=L;L=j.TRUSTED_TYPES_POLICY;try{B=M("")}catch(ie){throw L=$,ie}}else j.TRUSTED_TYPES_POLICY===null?(L=void 0,B=""):(L===void 0&&(L=V()),L&&typeof B=="string"&&(B=M("")));en&&en(j),Jn=j},Wt=et({},[...ef,...tf,...B9]),Zr=et({},[...nf,...F9]),Mi=function(j,H,$){return H.namespaceURI===$e?j==="svg":H.namespaceURI===ht?j==="svg"&&($==="annotation-xml"||At[$]):!!Wt[j]},ci=function(j,H,$){return H.namespaceURI===$e?j==="math":H.namespaceURI===ft?j==="math"&&Zn[$]:!!Zr[j]},di=function(j,H,$){return H.namespaceURI===ft&&!Zn[$]||H.namespaceURI===ht&&!At[$]?!1:!Zr[j]&&(Nr[j]||!Wt[j])},hi=function(j){let H=v(j);(!H||!H.tagName)&&(H={namespaceURI:rn,tagName:"template"});const $=Za(j.tagName),ie=Za(H.tagName);return dr[j.namespaceURI]?j.namespaceURI===ft?Mi($,H,ie):j.namespaceURI===ht?ci($,H,ie):j.namespaceURI===$e?di($,H,ie):!!(fr==="application/xhtml+xml"&&dr[j.namespaceURI]):!1},ae=function(j){Oa(e.removed,{element:j});try{v(j).removeChild(j)}catch{if(x(j),!v(j))throw Gi("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ze=function(j,H,$){try{j.removeAttributeNode(H)}catch{try{j.removeAttribute($)}catch{}}},Nt=function(j){kr(j);const H=g(j);if(H){const ie=[];Vi(H,le=>{Oa(ie,le)}),Vi(ie,le=>{try{x(le)}catch{}})}const $=A(j);if($)for(let ie=$.length-1;ie>=0;--ie){const le=$[ie],Ee=le&&le.name;typeof Ee=="string"&&Ze(j,le,Ee)}},at=function(j,H,$){if(!$)try{$=H.getAttributeNode(j)}catch{$=null}Oa(e.removed,{attribute:$||null,from:H});try{$?H.removeAttributeNode($):H.removeAttribute(j)}catch{try{H.removeAttribute(j)}catch{}}if(j==="is")if(st||lt)try{ae(H)}catch{}else try{H.setAttribute(j,"")}catch{}},on=function(j){const H=A(j);if(H)for(let $=H.length-1;$>=0;--$){const ie=H[$],le=ie&&ie.name;typeof le!="string"||Me[vt(le)]||Ze(j,ie,le)}},kr=function(j){const H=[j];for(;H.length>0;){const $=H.pop();I($)===Vn.element&&on($);const le=g($);if(le)for(let Ee=le.length-1;Ee>=0;--Ee)H.push(le[Ee])}},gr=function(j,H){return xt?j==="patchsrc"?!0:j==="for"&&H!=="label"&&H!=="output":!1},Pr=function(j){if(!xt)return;const H=[j];for(;H.length>0;){const $=H.pop(),ie=I($);if(ie===Vn.processingInstruction||ie===Vn.comment&&vn(M1,$.data)){try{x($)}catch{}continue}if(ie===Vn.element){const Ee=$,rt=vt(N($));try{Ee.hasAttribute&&Ee.hasAttribute("patchsrc")&&Ee.removeAttribute("patchsrc"),Ee.hasAttribute&&Ee.hasAttribute("for")&&gr("for",rt)&&Ee.removeAttribute("for")}catch{}}const le=g($);if(le)for(let Ee=le.length-1;Ee>=0;--Ee)H.push(le[Ee])}},fi=function(j){let H=null,$=null;if(tn)j="<remove></remove>"+j;else{const Ee=_1(j,/^[\r\n\t ]+/);$=Ee&&Ee[0]}fr==="application/xhtml+xml"&&rn===$e&&(j='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+j+"</body></html>");const ie=L?M(j):j;if(rn===$e)try{H=new c().parseFromString(ie,fr)}catch{}if(!H||!H.documentElement){H=Y.createDocument(rn,"template",null);try{H.documentElement.innerHTML=Cn?B:ie}catch{}}const le=H.body||H.documentElement;return j&&$&&le.insertBefore(t.createTextNode($),le.childNodes[0]||null),rn===$e?X.call(H,ot?"html":"body")[0]:ot?H.documentElement:le},Lr=function(j){const H=R?R(j):j.ownerDocument;return q.call(H||j,j,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},wn=function(j){return j=ja(j,z," "),j=ja(j,re," "),j=ja(j,de," "),j},Kn=function(j){var H;j.normalize();const $=R?R(j):j.ownerDocument,ie=q.call($||j,j,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let le=ie.nextNode();for(;le;)le.data=wn(le.data),le=ie.nextNode();const Ee=(H=j.querySelectorAll)===null||H===void 0?void 0:H.call(j,"template");Ee&&Vi(Ee,rt=>{Gn(rt.content)&&Kn(rt.content)})},_n=function(j){const H=O?O(j):null;return typeof H!="string"||vt(H)!=="form"?!1:typeof j.nodeName!="string"||typeof j.textContent!="string"||typeof j.removeChild!="function"||j.attributes!==A(j)||typeof j.removeAttribute!="function"||typeof j.setAttribute!="function"||typeof j.namespaceURI!="string"||typeof j.insertBefore!="function"||typeof j.hasChildNodes!="function"||j.nodeType!==_(j)||j.childNodes!==g(j)},Gn=function(j){if(!_||typeof j!="object"||j===null)return!1;try{return _(j)===Vn.documentFragment}catch{return!1}},Qn=function(j){if(!_||typeof j!="object"||j===null)return!1;try{return typeof _(j)=="number"}catch{return!1}};function an(ee,j,H){ee.length!==0&&Vi(ee,$=>{$.call(e,j,H,Jn)})}const Jr=function(j,H){return!!(xt&&j.hasChildNodes()&&!Qn(j.firstElementChild)&&vn(D1,j.textContent)&&vn(D1,j.innerHTML)||xt&&j.namespaceURI===$e&&J9[H]&&(Qn(j.firstElementChild)||typeof j.textContent=="string"&&vn(K9[H],j.textContent))||j.nodeType===Vn.processingInstruction||xt&&j.nodeType===Vn.comment&&vn(M1,j.data))},er=function(j,H){if(j instanceof RegExp)return vn(j,H);if(j instanceof Function){for(var $=arguments.length,ie=new Array($>2?$-2:0),le=2;le<$;le++)ie[le-2]=arguments[le];return!!j(H,...ie)}return!1},pi=function(j,H,$){if(!Ie[H]&&tr(H)&&er(nt.tagNameCheck,H))return!1;if(jt&&!Ae[H]){const ie=v(j),le=g(j);if(le&&ie){const Ee=le.length;for(let rt=Ee-1;rt>=0;--rt){const ut=j===$?b(le[rt],!0):le[rt];ie.insertBefore(ut,E(j))}}}return ae(j),!0},gi=function(j,H,$,ie){return j.length===0?H:H===$||H===ie?Un(H):H},po=function(j,H){return j===H||v(j)!==null?!1:(Ce&&kr(j),!0)},go=function(j,H){if(an(K.beforeSanitizeElements,j,null),po(j,H))return!0;if(_n(j))return ae(j),!0;const $=vt(N(j));if(ve=gi(K.uponSanitizeElement,ve,se,pt),an(K.uponSanitizeElement,j,{tagName:$,allowedTags:ve}),po(j,H))return!0;if(Jr(j,$))return ae(j),!0;if(Ie[$]||!(Ue.tagCheck instanceof Function&&Ue.tagCheck($))&&!ve[$]){const le=pi(j,$,H);return le===!1&&an(K.afterSanitizeElements,j,null),le}if(I(j)===Vn.element&&!hi(j)||($==="noscript"||$==="noembed"||$==="noframes")&&vn(Y9,j.innerHTML))return ae(j),!0;if(Pt&&j.nodeType===Vn.text){const le=wn(j.textContent);j.textContent!==le&&(Oa(e.removed,{element:j.cloneNode()}),j.textContent=le)}return an(K.afterSanitizeElements,j,null),!1},Br=function(j,H,$){if(Ye[H]||gr(H,j)||On&&(H==="id"||H==="name")&&($ in t||$ in Di))return!1;const ie=Me[H]||Ue.attributeCheck instanceof Function&&Ue.attributeCheck(H,j);return Ke&&vn(oe,H)||_t&&vn(be,H)?!0:ie?Te[H]||vn(He,ja($,Pe,""))||(H==="src"||H==="xlink:href"||H==="href")&&j!=="script"&&A1($,"data:")===0&&qe[j]||gt&&!vn(Ne,ja($,Pe,""))?!0:!$:tr(j)&&er(nt.tagNameCheck,j)&&er(nt.attributeNameCheck,H,j)||H==="is"&&nt.allowCustomizedBuiltInElements&&er(nt.tagNameCheck,$)},qn=et({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),tr=function(j){return!qn[Za(j)]&&vn(De,j)},mr=function(j,H,$,ie){if(L&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!$)switch(h.getAttributeType(j,H)){case"TrustedHTML":return M(ie);case"TrustedScriptURL":return k(ie)}return ie},ma=function(j,H,$,ie){try{$?j.setAttributeNS($,H,ie):j.setAttribute(H,ie),_n(j)?ae(j):w1(e.removed)}catch{at(H,j)}},Hn=function(j){an(K.beforeSanitizeAttributes,j,null);const H=j.attributes;if(!H||_n(j))return;Me=gi(K.uponSanitizeAttribute,Me,Re,Ct);const $={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Me,forceKeepAttr:void 0};let ie=H.length;const le=vt(j.nodeName);for(;ie--;){const Ee=H[ie],rt=Ee.name,ut=Ee.namespaceURI,sn=Ee.value,Jt=vt(rt),Kr=sn;let zt=rt==="value"?Kr:j9(Kr);if($.attrName=Jt,$.attrValue=zt,$.keepAttr=!0,$.forceKeepAttr=void 0,an(K.uponSanitizeAttribute,j,$),zt=$.attrValue,Lt&&(Jt==="id"||Jt==="name")&&A1(zt,bt)!==0&&(at(rt,j,Ee),zt=bt+zt),xt&&vn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,zt)){at(rt,j,Ee);continue}if(Jt==="attributename"&&_1(zt,"href")){at(rt,j,Ee);continue}if(!$.forceKeepAttr){if(!$.keepAttr){at(rt,j,Ee);continue}if(!Ot&&vn(Z9,zt)){at(rt,j,Ee);continue}if(Pt&&(zt=wn(zt)),!Br(le,Jt,zt)){at(rt,j,Ee);continue}zt=mr(le,Jt,ut,zt),zt!==Kr&&ma(j,rt,ut,zt)}}an(K.afterSanitizeAttributes,j,null)},mi=function(j){let H=null;const $=Lr(j);for(an(K.beforeSanitizeShadowDOM,j,null);H=$.nextNode();)if(an(K.uponSanitizeShadowNode,H,null),go(H,j),Hn(H),Gn(H.content)&&mi(H.content),I(H)===Vn.element){const ie=C(H);Gn(ie)&&(ki(ie),mi(ie))}an(K.afterSanitizeShadowDOM,j,null)},ki=function(j){const H=[{node:j,shadow:null}];for(;H.length>0;){const $=H.pop();if($.shadow){mi($.shadow);continue}const ie=$.node,Ee=I(ie)===Vn.element,rt=g(ie);if(rt)for(let ut=rt.length-1;ut>=0;--ut)H.push({node:rt[ut],shadow:null});if(Ee){const ut=O?O(ie):null;if(typeof ut=="string"&&vt(ut)==="template"){const sn=ie.content;Gn(sn)&&H.push({node:sn,shadow:null})}}if(Ee){const ut=C(ie);Gn(ut)&&H.push({node:null,shadow:ut},{node:ut,shadow:null})}}};return e.sanitize=function(ee){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H=null,$=null,ie=null,le=null;if(Cn=!ee,Cn&&(ee="<!-->"),typeof ee!="string"&&!Qn(ee)&&(ee=P9(ee),typeof ee!="string"))throw Gi("dirty is not a string, aborting");if(!e.isSupported)return ee;mt?(ve=pt,Me=Ct):Mr(j),(K.uponSanitizeElement.length>0||K.uponSanitizeAttribute.length>0)&&(ve=Un(ve)),K.uponSanitizeAttribute.length>0&&(Me=Un(Me)),e.removed=[];const Ee=Ce&&typeof ee!="string"&&Qn(ee);if(Ee){Pr(ee);const sn=N(ee);if(typeof sn=="string"){const Jt=vt(sn);if(!ve[Jt]||Ie[Jt])throw Nt(ee),Gi("root node is forbidden and cannot be sanitized in-place")}if(_n(ee))throw Nt(ee),Gi("root node is clobbered and cannot be sanitized in-place");try{ki(ee)}catch(Jt){throw Nt(ee),Jt}}else if(Qn(ee))H=fi("<!---->"),$=H.ownerDocument.importNode(ee,!0),$.nodeType===Vn.element&&$.nodeName==="BODY"||$.nodeName==="HTML"?H=$:H.appendChild($),ki($);else{if(!st&&!Pt&&!ot&&ee.indexOf("<")===-1)return L&&nn?M(ee):ee;if(H=fi(ee),!H)return st?null:nn?B:""}H&&tn&&ae(H.firstChild);const rt=Ee?ee:H;try{const sn=Lr(rt);for(;ie=sn.nextNode();)go(ie,rt),Hn(ie),Gn(ie.content)&&mi(ie.content)}catch(sn){throw Ee&&(Nt(ee),Vi(e.removed,Jt=>{Jt.element&&kr(Jt.element)})),sn}if(Ee)return Vi(e.removed,sn=>{sn.element&&kr(sn.element)}),Pt&&Kn(ee),ee;if(st){if(Pt&&Kn(H),lt)for(le=J.call(H.ownerDocument);H.firstChild;)le.appendChild(H.firstChild);else le=H;return(Me.shadowroot||Me.shadowrootmode)&&(le=Q.call(r,le,!0)),le}let ut=ot?H.outerHTML:H.innerHTML;return ot&&ve["!doctype"]&&H.ownerDocument&&H.ownerDocument.doctype&&H.ownerDocument.doctype.name&&vn(U9,H.ownerDocument.doctype.name)&&(ut="<!DOCTYPE "+H.ownerDocument.doctype.name+`>
|
|
132
|
+
`+ut),Pt&&(ut=wn(ut)),L&&nn?M(ut):ut},e.setConfig=function(){let ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mr(ee),mt=!0,pt=ve,Ct=Me},e.clearConfig=function(){Jn=null,mt=!1,pt=null,Ct=null,L=w,B=""},e.isValidAttribute=function(ee,j,H){Jn||Mr({});const $=vt(ee),ie=vt(j);return Br($,ie,H)},e.addHook=function(ee,j){typeof j=="function"&&kn(K,ee)&&Oa(K[ee],j)},e.removeHook=function(ee,j){if(kn(K,ee)){if(j!==void 0){const H=R9(K[ee],j);return H===-1?void 0:O9(K[ee],H,1)[0]}return w1(K[ee])}},e.removeHooks=function(ee){kn(K,ee)&&(K[ee]=[])},e.removeAllHooks=function(){K=k1()},e}var tB=Bw();const nB=n=>tB.sanitize(n);function Fw({comment:n,onChangeTemplate:e,setComment:t,t:r}){const i=g=>f.jsx("div",{title:g.title,children:g.label}),a=xn.useSelector(g=>pe.getConfig(g)).annotation.commentTemplates??[],[s,l]=m.useState(null),[u,c]=m.useState(""),[h,p]=m.useState(0),b=g=>{if(g){if(n.trim().length>0){l(g),c(n);return}e(g.value)}},x=()=>{e({...s.value,content:u}),l(null),c("")},E=()=>{l(null),c(""),p(g=>g+1)};return f.jsxs(f.Fragment,{children:[f.jsx(G.Grid,{container:!0,children:f.jsx(G.Typography,{variant:"formSectionTitle",children:r("note")})}),a.length>0&&f.jsx(G.Grid,{style:{marginBottom:"10px"},children:f.jsx(Mw,{options:a.map(g=>({label:g.title,title:g.content,value:g})),placeholder:r("useTemplate"),onChange:b,isClearable:!0,isSearchable:!0,formatOptionLabel:i,styles:{marginBottom:"20px"}},h)}),f.jsx(G.Grid,{container:!0,children:f.jsx(Il,{text:n,setText:t})}),f.jsxs(G.Dialog,{"aria-labelledby":"confirm-template-selection-title",fullWidth:!0,maxWidth:"sm",onClose:E,open:s!==null,children:[f.jsx(G.DialogTitle,{id:"confirm-template-selection-title",children:f.jsx(G.Typography,{variant:"h2",component:"span",children:r("confirmTemplateSelectionTitle")})}),f.jsxs(G.DialogContent,{children:[f.jsx(G.DialogContentText,{variant:"body1",color:"inherit",children:r("confirmTemplateSelectionContent")}),f.jsx(G.Typography,{variant:"subtitle2",sx:{marginTop:"16px"},children:r("selectedTemplateContent")}),f.jsx(G.Box,{sx:{border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:"4px",marginBottom:"16px",maxHeight:"150px",overflowY:"auto",padding:"8px 12px"},dangerouslySetInnerHTML:{__html:nB(s?.value.content??"")}}),f.jsx(G.Typography,{variant:"subtitle2",children:r("currentNoteContent")}),f.jsx(Il,{text:u,setText:c})]}),f.jsxs(G.DialogActions,{children:[f.jsx(G.Button,{onClick:E,children:r("cancel")}),f.jsx(G.Button,{color:"primary",onClick:x,variant:"contained",children:r("applyMerge")})]})]})]})}Fw.propTypes={comment:d.string.isRequired,onChangeTemplate:d.func.isRequired,setComment:d.func.isRequired,t:d.func.isRequired};function Gw({setTags:n,t:e,tags:t,tagsSuggestions:r}){return f.jsxs(f.Fragment,{children:[f.jsx(G.Typography,{variant:"formSectionTitle",children:e("tags")}),f.jsx(Mw,{isMulti:!0,options:r,value:t,onChange:n,closeMenuOnSelect:!1,placeholder:e("tagsPlaceholder")}),f.jsx(G.Divider,{spacing:2})]})}Gw.propTypes={setTags:d.func.isRequired,t:d.func.isRequired,tags:d.any.isRequired,tagsSuggestions:d.arrayOf(d.shape({label:d.string,value:d.string})).isRequired};const Ni={AnnotationFormFooter:Sp,MultiTagsInput:Gw,TargetFormSection:dg,TextCommentInput:Fw,TextFormSection:QE},{AnnotationFormFooter:rB}=Ni,iB=async n=>n;function qw({annotation:n,canvases:e,closeFormCompanionWindow:t,saveAnnotation:r,t:i}){const[o,a]=m.useState(n),s=()=>{e.forEach(async l=>{r(o.newData,l.id)}),t()};return f.jsxs(f.Fragment,{children:[f.jsx(G.Paper,{elevation:0,style:{minHeight:"300px"},children:f.jsx(fS,{data:o,onUpdate:a})}),f.jsx(rB,{closeFormCompanionWindow:t,saveAnnotation:s,t:i,annotationState:o})]})}qw.propTypes={annotation:d.shape({body:d.shape({format:d.string,id:d.string,type:d.string,value:d.string}),drawingState:d.string,id:d.string,maeData:d.object,manifestNetwork:d.string,motivation:d.string,target:d.string}).isRequired,canvases:d.arrayOf(d.object).isRequired,closeFormCompanionWindow:d.func.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired};function As({contentLocales:n,label:e,onChange:t,value:r}){return n.length<2?null:f.jsx(Ll,{"aria-label":e,exclusive:!0,onChange:(i,o)=>{o!==null&&t(o)},size:"small",value:r??null,children:n.map(({code:i,name:o})=>f.jsx(Gt,{"aria-label":o??i,value:i,children:i.toUpperCase()},i))})}As.propTypes={contentLocales:d.arrayOf(d.shape({code:d.string.isRequired,name:d.string})),label:d.string.isRequired,onChange:d.func.isRequired,value:d.string};As.defaultProps={contentLocales:[],value:null};const oB=tt.createSvgIcon(f.jsx("path",{d:"M12 3v9.28c-.47-.17-.97-.28-1.5-.28C8.01 12 6 14.01 6 16.5S8.01 21 10.5 21c2.31 0 4.2-1.75 4.45-4H15V6h4V3z"}),"Audiotrack"),aB=tt.createSvgIcon(f.jsx("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"}),"InsertDriveFile"),P1=tt.createSvgIcon(f.jsx("path",{d:"m18 4 2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4z"}),"Movie"),sB=tt.createSvgIcon(f.jsx("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5zm4-3H19v1h1.5V11H19v2h-1.5V7h3zM9 9.5h1v-1H9zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm10 5.5h1v-3h-1z"}),"PictureAsPdf"),lB=300,uB={audio:oB,"research-pdf":sB,"uploaded-video":P1,"youtube-video":P1},L1={borderRadius:1,flexShrink:0,height:40,objectFit:"cover",width:40};function Zf({media:n}){if(n.thumbnailUrl)return f.jsx(G.Box,{component:"img",src:n.thumbnailUrl,alt:"","data-testid":"media-selection-thumbnail",sx:L1});const e=n.source==="media-item"&&uB[n.mediaType]||(n.source==="upload"?vC:aB);return f.jsx(G.Box,{sx:{...L1,alignItems:"center",bgcolor:"action.hover",color:"action.active",display:"flex",justifyContent:"center"},children:f.jsx(e,{fontSize:"small"})})}Zf.propTypes={media:d.shape({mediaType:d.string,source:d.string,thumbnailUrl:d.string}).isRequired};const af={"iiif-image":{normalize:n=>({id:n.documentId,source:"iiif-image",thumbnailUrl:n.thumbnailUrl??null,title:n.displayTitle}),titleKey:"poi_media_source_iiif_image"},upload:{normalize:n=>({id:String(n.id),source:"upload",thumbnailUrl:n.thumbnailUrl??null,title:n.name}),titleKey:"poi_media_source_upload"},"media-item":{normalize:n=>({id:n.documentId,mediaType:n.mediaType??null,source:"media-item",thumbnailUrl:n.thumbnailUrl??null,title:n.titleEn}),titleKey:"poi_media_source_media_item"}};function ds({dialogContainer:n,label:e,onChange:t,onSearchIiifImages:r,onSearchMediaItems:i,onSearchUploads:o,t:a,value:s}){const l=m.useMemo(()=>({"iiif-image":r,"media-item":i,upload:o}),[r,i,o]),u=m.useMemo(()=>Object.keys(af).filter(I=>typeof l[I]=="function"),[l]),[c,h]=m.useState((s&&u.includes(s.source)?s.source:u[0])??null),[p,b]=m.useState(s?.title??""),[x,E]=m.useState(s?[s]:[]),[g,v]=m.useState(!1),C=m.useRef(null),A=m.useRef(0);m.useEffect(()=>()=>{clearTimeout(C.current),A.current+=1},[]);const _=(I,N)=>{const L=l[I];if(typeof L!="function")return;const B=A.current+1;A.current=B,v(!0),Promise.resolve(L(N)).then(w=>{A.current===B&&E(w.map(af[I].normalize))}).finally(()=>{A.current===B&&v(!1)})},O=(I,N)=>{clearTimeout(C.current),C.current=setTimeout(()=>_(I,N),lB)},R=(I,N)=>{N&&(A.current+=1,clearTimeout(C.current),h(N),b(""),E([]),v(!1))};return u.length===0?null:f.jsxs(G.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[u.length>1&&f.jsx(G.ToggleButtonGroup,{value:c,exclusive:!0,onChange:R,size:"small",color:"primary",children:u.map(I=>f.jsx(G.ToggleButton,{value:I,children:a(af[I].titleKey)},I))}),f.jsx(G.Autocomplete,{filterOptions:I=>I,getOptionKey:I=>I.id,getOptionLabel:I=>I.title,inputValue:p,isOptionEqualToValue:(I,N)=>I.source===N.source&&I.id===N.id,loading:g,noOptionsText:a(p?"poi_media_no_results":"poi_media_search_prompt"),onChange:(I,N)=>t(N),onInputChange:(I,N)=>{b(N),O(c,N)},onOpen:()=>_(c,p),options:x,renderInput:I=>f.jsx(G.TextField,{...I,label:e,variant:"outlined",InputProps:{...I.InputProps,endAdornment:f.jsxs(f.Fragment,{children:[g?f.jsx(G.CircularProgress,{color:"inherit",size:16}):null,I.InputProps.endAdornment]})}}),renderOption:(I,N)=>m.createElement(G.Box,{component:"li",...I,key:N.id,sx:{alignItems:"center",display:"flex",gap:1}},f.jsx(Zf,{media:{...N,source:c}}),N.title),slotProps:{popper:{container:n}},value:s&&s.source===c?s:null}),s&&f.jsxs(G.Box,{sx:{alignItems:"center",display:"flex",gap:1},children:[f.jsx(Zf,{media:s}),f.jsx(G.Typography,{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:s.title})]})]})}ds.propTypes={dialogContainer:d.func.isRequired,label:d.string.isRequired,onChange:d.func.isRequired,onSearchIiifImages:d.func,onSearchMediaItems:d.func,onSearchUploads:d.func,t:d.func.isRequired,value:d.shape({id:d.string.isRequired,mediaType:d.string,source:d.oneOf(["upload","iiif-image","media-item"]).isRequired,thumbnailUrl:d.string,title:d.string})};ds.defaultProps={onSearchIiifImages:void 0,onSearchMediaItems:void 0,onSearchUploads:void 0,value:null};const cB=(n,e)=>!n&&!e?!0:!n||!e?!1:n.source===e.source&&n.id===e.id;function hu({activeLocaleIsRtl:n,dialogContainer:e,keepSameLabel:t,labelAr:r,labelEn:i,mediaAr:o,mediaEn:a,onChangeAr:s,onChangeEn:l,onSearchIiifImages:u,onSearchMediaItems:c,onSearchUploads:h,t:p}){const[b,x]=m.useState(()=>cB(a,o)),E=v=>{n?(s(v),b&&l(v)):(l(v),b&&s(v))},g=v=>{const{checked:C}=v.target;x(C),C&&(n?l(o):s(a))};return f.jsxs(f.Fragment,{children:[f.jsx(ds,{dialogContainer:e,label:n?r:i,onChange:E,onSearchIiifImages:u,onSearchMediaItems:c,onSearchUploads:h,t:p,value:n?o:a},n?"ar":"en"),f.jsx(G.FormControlLabel,{control:f.jsx(G.Checkbox,{checked:b,onChange:g}),label:t})]})}hu.propTypes={activeLocaleIsRtl:d.bool,dialogContainer:d.func.isRequired,keepSameLabel:d.string.isRequired,labelAr:d.string.isRequired,labelEn:d.string.isRequired,mediaAr:ds.propTypes.value,mediaEn:ds.propTypes.value,onChangeAr:d.func.isRequired,onChangeEn:d.func.isRequired,onSearchIiifImages:d.func,onSearchMediaItems:d.func,onSearchUploads:d.func,t:d.func.isRequired};hu.defaultProps={activeLocaleIsRtl:!1,mediaAr:null,mediaEn:null,onSearchIiifImages:void 0,onSearchMediaItems:void 0,onSearchUploads:void 0};const dB=["showBlocks","|","heading","|","superscript","bold","italic","underline","strikethrough","|","bulletedList","numberedList","link","insertTable","codeBlock","specialCharacters","horizontalLine","subscript","|","undo","redo"],hB=[{class:"ck-heading_paragraph",model:"paragraph",title:"Paragraph"},{class:"ck-heading_heading2",model:"heading2",title:"Heading 2",view:"h2"},{class:"ck-heading_heading3",model:"heading3",title:"Heading 3",view:"h3"},{class:"ck-heading_heading4",model:"heading4",title:"Heading 4",view:"h4"},{class:"ck-heading_heading5",model:"heading5",title:"Heading 5",view:"h5"},{class:"ck-heading_heading6",model:"heading6",title:"Heading 6",view:"h6"}],fB=[Ut.Autoformat,Ut.Bold,Ut.CodeBlock,Ut.Essentials,Ut.Heading,Ut.HorizontalLine,Ut.Italic,Ut.Link,Ut.List,Ut.Paragraph,Ut.ShowBlocks,Ut.SpecialCharacters,Ut.SpecialCharactersEssentials,Ut.Strikethrough,Ut.Subscript,Ut.Superscript,Ut.Table,Ut.TableToolbar,Ut.Underline];function Ts({onChange:n,placeholder:e,rtl:t,value:r}){return f.jsx(G.Box,{sx:{"& .ck-content":{overflowWrap:"break-word"},"& .ck-content *":t?{direction:"rtl",textAlign:"right"}:void 0,"& .ck-content img, & .ck-content table":{maxWidth:"100%"},"& .ck-editor, & .ck-editor__editable":{maxWidth:"100%"},"& .ck-editor__editable":{minHeight:"150px"},"& .ck-editor__editable, & .ck-content":t?{direction:"rtl",textAlign:"right",unicodeBidi:"plaintext"}:void 0,maxWidth:"100%",minWidth:0},children:f.jsx(S_.CKEditor,{config:{heading:{options:hB},language:{content:t?"ar":"en",ui:"en"},licenseKey:"GPL",placeholder:e,plugins:fB,toolbar:{items:dB,shouldNotGroupWhenFull:!0}},data:r,editor:Ut.ClassicEditor,onChange:(i,o)=>n(o.getData())})})}Ts.propTypes={onChange:d.func.isRequired,placeholder:d.string,rtl:d.bool,value:d.string};Ts.defaultProps={placeholder:void 0,rtl:!1,value:""};const{AnnotationFormFooter:pB,TargetFormSection:gB}=Ni,Jf="TextualBody",Hw=n=>typeof n=="string"&&n.toLowerCase().startsWith("ar"),Rg=(n,e)=>Object.keys(n)[0]??(e.some(({code:t})=>t==="en")?"en":e[0]?.code),mB={description:"",title:""},Og=(n,e)=>n[e]??mB,jg=n=>{const e={},t=new Set;return n.forEach(r=>{const i=r.language;if(!i)return;const o=e[i]??{description:"",title:""};r.purpose==="identifying"?o.title=r.value??"":r.purpose==="describing"&&r.type===Jf&&!t.has(i)&&(o.description=r.value??"",t.add(i)),e[i]=o}),e},Vw=n=>{const e=n?.target?.drawingState?.shapes;return Array.isArray(e)&&e.length===1&&e[0].type===we.POI},Ww=n=>n==null||Number.isFinite(n)&&n>=-90&&n<=90,zw=n=>n==null||Number.isFinite(n)&&n>=-180&&n<=180,kl=n=>{const e=n.trim();return e===""?null:Number(e.replace(",","."))},Ng=(n,e)=>e.every(({code:t})=>!ra(Og(n,t).title)),Dg=n=>{const e=n,{contentByLocale:t}=e.maeData;return e.body=Object.entries(t).flatMap(([r,i])=>{const{description:o,title:a}=i;return[{language:r,purpose:"identifying",type:Jf,value:a},...ra(o)?[]:[{language:r,purpose:"describing",type:Jf,value:o}]]}),e},bB=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=Dg(n);return ps(i,e,t,r)};function Xw({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:o}){const{contentLocales:a=[],searchMediaItems:s,searchIiifImages:l,searchUploads:u}=xn.useSelector(z=>pe.getConfig(z)).annotation??{};let c=n;c.id?(c.maeData.target.drawingState&&typeof c.maeData.target.drawingState=="string"&&(c.maeData.target.drawingState={...JSON.parse(c.maeData.target.drawingState),currentShape:null}),c.maeData.contentByLocale=jg(c.body)):c={body:[],"dbf:kind":"POI","dbf:latitude":null,"dbf:longitude":null,"dbf:mediaAr":null,"dbf:mediaEn":null,maeData:{contentByLocale:{},target:null,templateType:Ge.POI_TYPE},motivation:"identifying",target:null};const[h,p]=m.useState(c),[b,x]=m.useState(!1),[E,g]=m.useState(!1),[v,C]=m.useState(!1),[A,_]=m.useState(!1),[O,R]=m.useState(c["dbf:latitude"]!=null?String(c["dbf:latitude"]):""),[I,N]=m.useState(c["dbf:longitude"]!=null?String(c["dbf:longitude"]):""),[L,B]=m.useState(!1),[w,P]=m.useState(Rg(h.maeData.contentByLocale,a)),T=m.useRef(null),D=()=>T.current?.closest('[role="dialog"]')??document.body,M=Og(h.maeData.contentByLocale,w),k=Hw(w),V=z=>{p({...h,maeData:{...h.maeData,...z}})},W=z=>{V({target:z})},Y=z=>{V({contentByLocale:{...h.maeData.contentByLocale,[w]:{...M,...z}}})},q=z=>{p(re=>({...re,"dbf:mediaEn":z}))},J=z=>{p(re=>({...re,"dbf:mediaAr":z}))},X=z=>{const{value:re}=z.target;R(re),p(de=>({...de,"dbf:latitude":kl(re)}))},Q=z=>{const{value:re}=z.target;N(re),p(de=>({...de,"dbf:longitude":kl(re)}))},K=async()=>{const z=Vw(h.maeData),re=Ng(h.maeData.contentByLocale,a),de=Ww(h["dbf:latitude"]),oe=zw(h["dbf:longitude"]);if(x(!z),g(!re),C(!de),_(!oe),!(!z||!re||!de||!oe)){hs(o,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),B(!0);try{await r(h)}finally{B(!1)}}};return f.jsxs(G.Grid,{container:!0,direction:"column",spacing:2,ref:T,children:[f.jsxs(G.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[f.jsx(G.Grid,{children:f.jsx(je,{variant:"formSectionTitle",children:i("poi")})}),f.jsx(G.Grid,{children:f.jsx(As,{contentLocales:a,label:i("poi_language"),onChange:P,value:w})})]}),f.jsxs(G.Grid,{children:[f.jsx(G.TextField,{fullWidth:!0,error:E,label:i("poi_title"),value:M.title,variant:"outlined",onChange:z=>Y({title:z.target.value}),slotProps:{htmlInput:{dir:k?"rtl":"ltr",style:{textAlign:k?"right":"left"}}}}),E&&f.jsx(je,{color:"error",variant:"caption",children:i("poi_title_required")})]}),(s||l||u)&&f.jsx(G.Grid,{children:f.jsx(hu,{activeLocaleIsRtl:k,dialogContainer:D,keepSameLabel:i("poi_media_keep_same"),labelAr:i("poi_media_ar"),labelEn:i("poi_media_en"),mediaAr:h["dbf:mediaAr"]??null,mediaEn:h["dbf:mediaEn"]??null,onChangeAr:J,onChangeEn:q,onSearchIiifImages:l,onSearchMediaItems:s,onSearchUploads:u,t:i})}),f.jsx(G.Grid,{children:f.jsx(je,{variant:"formSectionTitle",children:i("poi_description_section")})}),f.jsx(G.Grid,{children:f.jsx(Ts,{onChange:z=>Y({description:z}),placeholder:i("poi_description_placeholder"),rtl:k,value:M.description},w)}),f.jsxs(G.Grid,{container:!0,direction:"row",spacing:2,children:[f.jsxs(G.Grid,{size:6,children:[f.jsx(G.TextField,{fullWidth:!0,error:v,label:i("poi_latitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:O,variant:"outlined",onChange:X}),v&&f.jsx(je,{color:"error",variant:"caption",children:i("poi_latitude_invalid")})]}),f.jsxs(G.Grid,{size:6,children:[f.jsx(G.TextField,{fullWidth:!0,error:A,label:i("poi_longitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:I,variant:"outlined",onChange:Q}),A&&f.jsx(je,{color:"error",variant:"caption",children:i("poi_longitude_invalid")})]})]}),f.jsxs(G.Grid,{children:[f.jsx(gB,{onChangeTarget:W,playerReferences:t,pointOnly:!0,spatialTarget:!0,target:h.maeData.target,windowId:o}),b&&f.jsx(je,{color:"error",variant:"caption",children:i("poi_target_must_be_point")})]}),f.jsx(G.Grid,{children:f.jsx(pB,{closeFormCompanionWindow:e,saveAnnotation:K,saving:L,t:i,annotationState:h})})]})}Xw.propTypes={annotation:d.shape({adapter:d.func,body:d.arrayOf(d.shape({type:d.string})),defaults:d.objectOf(d.oneOfType([d.bool,d.func,d.number,d.string])),drawingState:d.string,manifestNetwork:d.string,target:d.string}).isRequired,closeFormCompanionWindow:d.func.isRequired,playerReferences:d.object.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired,windowId:d.string.isRequired};const{AnnotationFormFooter:vB}=Ni,yB=n=>typeof n=="string"&&n.toLowerCase().startsWith("ar"),xB={description:"",title:""},CB=(n,e)=>n[e]??xB,EB=async n=>Dg(n);function Uw({annotation:n,closeFormCompanionWindow:e,saveAnnotation:t,t:r}){const{contentLocales:i=[],searchMediaItems:o,searchIiifImages:a,searchUploads:s}=xn.useSelector(B=>pe.getConfig(B)).annotation??{};let l=n;l.id?l.maeData.contentByLocale=jg(l.body):l={body:[],"dbf:kind":"Journey","dbf:mediaAr":null,"dbf:mediaEn":null,maeData:{contentByLocale:{},target:{},templateType:Ge.JOURNEY_TYPE},motivation:"identifying",target:null};const[u,c]=m.useState(l),[h,p]=m.useState(!1),[b,x]=m.useState(!1),[E,g]=m.useState(Rg(u.maeData.contentByLocale,i)),v=m.useRef(null),C=()=>v.current?.closest('[role="dialog"]')??document.body,A=CB(u.maeData.contentByLocale,E),_=yB(E),O=B=>{c({...u,maeData:{...u.maeData,...B}})},R=B=>{O({contentByLocale:{...u.maeData.contentByLocale,[E]:{...A,...B}}})},I=B=>{c(w=>({...w,"dbf:mediaEn":B}))},N=B=>{c(w=>({...w,"dbf:mediaAr":B}))},L=async()=>{const B=Ng(u.maeData.contentByLocale,i);if(p(!B),!!B){x(!0);try{await t(u)}finally{x(!1)}}};return f.jsxs(G.Grid,{container:!0,direction:"column",spacing:2,ref:v,children:[f.jsxs(G.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[f.jsx(G.Grid,{children:f.jsx(je,{variant:"formSectionTitle",children:r("journey")})}),f.jsx(G.Grid,{children:f.jsx(As,{contentLocales:i,label:r("journey_language"),onChange:g,value:E})})]}),f.jsxs(G.Grid,{children:[f.jsx(G.TextField,{fullWidth:!0,error:h,label:r("journey_title"),value:A.title,variant:"outlined",onChange:B=>R({title:B.target.value}),slotProps:{htmlInput:{dir:_?"rtl":"ltr",style:{textAlign:_?"right":"left"}}}}),h&&f.jsx(je,{color:"error",variant:"caption",children:r("journey_title_required")})]}),(o||a||s)&&f.jsx(G.Grid,{children:f.jsx(hu,{activeLocaleIsRtl:_,dialogContainer:C,keepSameLabel:r("journey_media_keep_same"),labelAr:r("journey_media_ar"),labelEn:r("journey_media_en"),mediaAr:u["dbf:mediaAr"]??null,mediaEn:u["dbf:mediaEn"]??null,onChangeAr:N,onChangeEn:I,onSearchIiifImages:a,onSearchMediaItems:o,onSearchUploads:s,t:r})}),f.jsx(G.Grid,{children:f.jsx(je,{variant:"formSectionTitle",children:r("journey_description_section")})}),f.jsx(G.Grid,{children:f.jsx(Ts,{onChange:B=>R({description:B}),placeholder:r("journey_description_placeholder"),rtl:_,value:A.description},E)}),f.jsx(G.Grid,{children:f.jsx(vB,{closeFormCompanionWindow:e,saveAnnotation:L,saving:b,t:r,annotationState:u})}),f.jsx(G.Grid,{children:f.jsx(je,{variant:"subFormSectionTitle",children:r("journey_hint")})})]})}Uw.propTypes={annotation:d.shape({body:d.arrayOf(d.shape({type:d.string})),id:d.string}).isRequired,closeFormCompanionWindow:d.func.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired};const{AnnotationFormFooter:wB,MultiTagsInput:_B,TargetFormSection:AB,TextCommentInput:TB}=Ni,IB=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=ix(n);return ps(i,e,t,r)};function $w({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:o}){const a=xn.useSelector(C=>pe.getConfig(C)),l=a.annotation.tagsSuggestions??[];let u=n;if(u.id)u.maeData.target.drawingState&&typeof u.maeData.target.drawingState=="string"&&(u.maeData.target.drawingState=JSON.parse(u.maeData.target.drawingState),console.debug("Parsed drawingState:",u.maeData.target.drawingState),u.maeData.target.drawingState={...u.maeData.target.drawingState,currentShape:null}),u.maeData.textBody=u.body.find(C=>C.purpose==="describing"),u.maeData.tags=u.body.filter(C=>C.purpose==="tagging").map(C=>({label:C.value,value:C.value})),u.maeData.textBody===void 0&&(u.maeData.textBody={purpose:"describing",type:"TextualBody",value:""});else{const{defaultTags:C}=vs(a),A=C.map(_=>({label:_,value:_}));u={body:[],maeData:{tags:A,target:null,templateType:Ge.MULTIPLE_BODY_TYPE,textBody:{purpose:"describing",type:"TextualBody",value:""}},motivation:"commenting",target:null}}const[c,h]=m.useState(u),p=C=>{h({...c,maeData:{...c.maeData,textBody:{...c.maeData.textBody,value:C}}})},b=C=>{h({...c,maeData:{...c.maeData,tags:C}})},x=C=>{const A=c.maeData;A.target=C,h({...c,maeData:A})},E=async()=>{hs(o,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),r(c)},g=l.map(C=>({label:C,value:C})),v=C=>{const A=g.find(_=>_.value===C.title);if(A&&!c.maeData.tags.find(_=>_.value===A.value)){h({...c,maeData:{...c.maeData,tags:[...c.maeData.tags,A],textBody:{...c.maeData.textBody,value:C.content}}});return}p(C.content)};return f.jsxs(G.Grid,{container:!0,direction:"column",spacing:2,children:[f.jsx(G.Grid,{children:f.jsx(TB,{comment:c.maeData.textBody.value,setComment:p,onChangeTemplate:v,t:i})}),f.jsx(G.Grid,{children:f.jsx(_B,{t:i,tags:c.maeData.tags,setTags:b,tagsSuggestions:g})}),f.jsx(G.Grid,{children:f.jsx(AB,{onChangeTarget:x,playerReferences:t,spatialTarget:!0,t:i,target:c.maeData.target,timeTarget:!0,windowId:o})}),f.jsx(G.Grid,{children:f.jsx(wB,{closeFormCompanionWindow:e,saveAnnotation:E,t:i,annotationState:c})})]})}$w.propTypes={annotation:d.shape({adapter:d.func,body:d.arrayOf(d.shape({type:d.string})),defaults:d.objectOf(d.oneOfType([d.bool,d.func,d.number,d.string])),drawingState:d.string,manifestNetwork:d.string,target:d.string}).isRequired,closeFormCompanionWindow:d.func.isRequired,playerReferences:d.object.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired,windowId:d.string.isRequired};const SB=300;function Mg({dialogContainer:n,label:e,onChange:t,onSearch:r,t:i,value:o}){const[a,s]=m.useState(o?.titleEn??""),[l,u]=m.useState(o?[o]:[]),[c,h]=m.useState(!1),p=m.useRef(null),b=m.useRef(0);m.useEffect(()=>()=>{clearTimeout(p.current),b.current+=1},[]);const x=g=>{const v=b.current+1;b.current=v,h(!0),Promise.resolve(r(g)).then(C=>{b.current===v&&u(C)}).finally(()=>{b.current===v&&h(!1)})},E=g=>{clearTimeout(p.current),p.current=setTimeout(()=>x(g),SB)};return f.jsx(G.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:f.jsx(G.Autocomplete,{filterOptions:g=>g,getOptionKey:g=>g.documentId,getOptionLabel:g=>g.titleEn,inputValue:a,isOptionEqualToValue:(g,v)=>g.documentId===v.documentId,loading:c,noOptionsText:i(a?"map_relation_no_results":"map_relation_search_prompt"),onChange:(g,v)=>t(v),onInputChange:(g,v)=>{s(v),E(v)},onOpen:()=>x(a),options:l,renderInput:g=>f.jsx(G.TextField,{...g,label:e,variant:"outlined",InputProps:{...g.InputProps,endAdornment:f.jsxs(f.Fragment,{children:[c?f.jsx(G.CircularProgress,{color:"inherit",size:16}):null,g.InputProps.endAdornment]})}}),slotProps:{popper:{container:n}},value:o})})}Mg.propTypes={dialogContainer:d.func.isRequired,label:d.string.isRequired,onChange:d.func.isRequired,onSearch:d.func.isRequired,t:d.func.isRequired,value:d.shape({documentId:d.string.isRequired,titleEn:d.string.isRequired})};Mg.defaultProps={value:null};const{AnnotationFormFooter:RB,TargetFormSection:OB}=Ni,jB=async(n,{canvas:e,windowId:t,playerReferences:r})=>{const i=Dg(n);return ps(i,e,t,r)};function Yw({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:o}){const{contentLocales:a=[],searchMaps:s}=xn.useSelector(z=>pe.getConfig(z)).annotation??{};let l=n;l.id?(l.maeData.target.drawingState&&typeof l.maeData.target.drawingState=="string"&&(l.maeData.target.drawingState={...JSON.parse(l.maeData.target.drawingState),currentShape:null}),l.maeData.contentByLocale=jg(l.body)):l={body:[],"dbf:kind":"POI","dbf:latitude":null,"dbf:linkedMap":null,"dbf:longitude":null,"dbf:mediaAr":null,"dbf:mediaEn":null,maeData:{contentByLocale:{},target:null,templateType:Ge.NESTED_MAP_TYPE},motivation:"identifying",target:null};const[u,c]=m.useState(l),[h,p]=m.useState(!1),[b,x]=m.useState(!1),[E,g]=m.useState(!1),[v,C]=m.useState(!1),[A,_]=m.useState(!1),[O,R]=m.useState(l["dbf:latitude"]!=null?String(l["dbf:latitude"]):""),[I,N]=m.useState(l["dbf:longitude"]!=null?String(l["dbf:longitude"]):""),[L,B]=m.useState(!1),[w,P]=m.useState(Rg(u.maeData.contentByLocale,a)),T=m.useRef(null),D=()=>T.current?.closest('[role="dialog"]')??document.body,M=Og(u.maeData.contentByLocale,w),k=Hw(w),V=u["dbf:linkedMap"]??null,W=z=>{c({...u,maeData:{...u.maeData,...z}})},Y=z=>{W({target:z})},q=z=>{W({contentByLocale:{...u.maeData.contentByLocale,[w]:{...M,...z}}})},J=z=>{c({...u,"dbf:linkedMap":z?{id:z.documentId,titleEn:z.titleEn}:null})},X=z=>{const{value:re}=z.target;R(re),c(de=>({...de,"dbf:latitude":kl(re)}))},Q=z=>{const{value:re}=z.target;N(re),c(de=>({...de,"dbf:longitude":kl(re)}))},K=async()=>{const z=Vw(u.maeData),re=!!u["dbf:linkedMap"],de=Ng(u.maeData.contentByLocale,a),oe=Ww(u["dbf:latitude"]),be=zw(u["dbf:longitude"]);if(p(!z),x(!re),g(!de),C(!oe),_(!be),!(!z||!re||!de||!oe||!be)){hs(o,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),B(!0);try{await r(u)}finally{B(!1)}}};return f.jsxs(G.Grid,{container:!0,direction:"column",spacing:2,ref:T,children:[f.jsxs(G.Grid,{container:!0,direction:"row",spacing:2,alignItems:"center",justifyContent:"space-between",children:[f.jsx(G.Grid,{children:f.jsx(je,{variant:"formSectionTitle",children:i("nested_map")})}),f.jsx(G.Grid,{children:f.jsx(As,{contentLocales:a,label:i("poi_language"),onChange:P,value:w})})]}),f.jsxs(G.Grid,{children:[f.jsx(G.TextField,{fullWidth:!0,error:E,label:i("poi_title"),value:M.title,variant:"outlined",onChange:z=>q({title:z.target.value}),slotProps:{htmlInput:{dir:k?"rtl":"ltr",style:{textAlign:k?"right":"left"}}}}),E&&f.jsx(je,{color:"error",variant:"caption",children:i("poi_title_required")})]}),f.jsx(G.Grid,{children:f.jsx(je,{variant:"formSectionTitle",children:i("nested_map_linked_map")})}),typeof s=="function"&&f.jsxs(G.Grid,{children:[f.jsx(Mg,{dialogContainer:D,label:i("nested_map_linked_map"),onChange:J,onSearch:s,t:i,value:V?{documentId:V.id,titleEn:V.titleEn}:null}),b&&f.jsx(je,{color:"error",variant:"caption",children:i("nested_map_linked_map_required")})]}),f.jsx(G.Grid,{children:f.jsx(je,{variant:"formSectionTitle",children:i("poi_description_section")})}),f.jsx(G.Grid,{children:f.jsx(Ts,{onChange:z=>q({description:z}),placeholder:i("poi_description_placeholder"),rtl:k,value:M.description},w)}),f.jsxs(G.Grid,{container:!0,direction:"row",spacing:2,children:[f.jsxs(G.Grid,{size:6,children:[f.jsx(G.TextField,{fullWidth:!0,error:v,label:i("poi_latitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:O,variant:"outlined",onChange:X}),v&&f.jsx(je,{color:"error",variant:"caption",children:i("poi_latitude_invalid")})]}),f.jsxs(G.Grid,{size:6,children:[f.jsx(G.TextField,{fullWidth:!0,error:A,label:i("poi_longitude"),slotProps:{htmlInput:{inputMode:"decimal"}},type:"text",value:I,variant:"outlined",onChange:Q}),A&&f.jsx(je,{color:"error",variant:"caption",children:i("poi_longitude_invalid")})]})]}),f.jsxs(G.Grid,{children:[f.jsx(OB,{onChangeTarget:Y,playerReferences:t,pointOnly:!0,spatialTarget:!0,target:u.maeData.target,windowId:o}),h&&f.jsx(je,{color:"error",variant:"caption",children:i("poi_target_must_be_point")})]}),f.jsx(G.Grid,{children:f.jsx(RB,{closeFormCompanionWindow:e,saveAnnotation:K,saving:L,t:i,annotationState:u})})]})}Yw.propTypes={annotation:d.shape({adapter:d.func,body:d.arrayOf(d.shape({type:d.string})),defaults:d.objectOf(d.oneOfType([d.bool,d.func,d.number,d.string])),drawingState:d.string,manifestNetwork:d.string,target:d.string}).isRequired,closeFormCompanionWindow:d.func.isRequired,playerReferences:d.object.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired,windowId:d.string.isRequired};const{AnnotationFormFooter:NB,TargetFormSection:DB}=Ni,MB=rx;function Zw({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:o}){const a=xn.useSelector(b=>pe.getConfig(b));let s=n;if(s.id)s.maeData.target.drawingState&&typeof s.maeData.target.drawingState=="string"&&(s.maeData.target.drawingState=JSON.parse(s.maeData.target.drawingState));else{const{defaultTags:b}=vs(a);s={body:{type:"Image",value:b.length>0?b[0]:""},maeData:{target:null,templateType:Ge.TAGGING_TYPE},motivation:"tagging",target:null}}const[l,u]=m.useState(s),c=b=>{const x=l.body;x.value=b,u({...l,body:x})},h=b=>{const x=l.maeData;x.target=b,u({...l,maeData:x})},p=async()=>{hs(o,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),r(l)};return f.jsxs(G.Grid,{container:!0,direction:"column",spacing:2,children:[f.jsx(G.Grid,{children:f.jsxs(je,{variant:"formSectionTitle",children:[i("tag")," "]})}),f.jsx(G.Grid,{children:f.jsx(G.TextField,{id:"outlined-basic",label:i("your_tag_here"),value:l.body.value,variant:"outlined",onChange:b=>c(b.target.value)})}),f.jsx(G.Grid,{children:f.jsx(DB,{onChangeTarget:h,playerReferences:t,spatialTarget:!0,target:l.maeData.target,windowId:o})}),f.jsx(G.Grid,{children:f.jsx(NB,{closeFormCompanionWindow:e,saveAnnotation:p,t:i,annotationState:l})})]})}Zw.propTypes={annotation:d.shape({adapter:d.func,body:d.arrayOf(d.shape({type:d.string})),defaults:d.objectOf(d.oneOfType([d.bool,d.func,d.number,d.string])),drawingState:d.string,manifestNetwork:d.string,target:d.string}).isRequired,closeFormCompanionWindow:d.func.isRequired,playerReferences:d.object.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired,windowId:d.string.isRequired};const{AnnotationFormFooter:kB,TargetFormSection:PB,TextCommentInput:LB}=Ni,BB="Annotation",FB=rx;function Jw({annotation:n,closeFormCompanionWindow:e,playerReferences:t,saveAnnotation:r,t:i,windowId:o}){let a=n;a.id?a.maeData.target.drawingState&&typeof a.maeData.target.drawingState=="string"&&(a.maeData.target.drawingState=JSON.parse(a.maeData.target.drawingState)):a={body:{id:ln(),type:"TextualBody",value:""},maeData:{target:null,templateType:Ge.TEXT_TYPE},motivation:"commenting",target:null};const[s,l]=m.useState(a),u=b=>{const x=s.body;x.value=b,l({...s,body:x})},c=b=>{u(b.content)},h=b=>{const x=s.maeData;x.target=b,l({...s,maeData:x})},p=()=>{hs(o,t.getMediaTrueWidth(),t.getMediaTrueHeight(),1/t.getScale()),s.body.value===void 0&&(s.body.value=BB),r(s)};return m.useEffect(()=>{},[s.maeData.target]),f.jsxs(G.Grid,{container:!0,direction:"column",spacing:2,children:[f.jsx(G.Grid,{children:f.jsx(LB,{comment:s.body.value,setComment:u,onChangeTemplate:c,t:i})}),f.jsx(G.Grid,{children:f.jsx(PB,{onChangeTarget:h,playerReferences:t,spatialTarget:!0,target:s.maeData.target,windowId:o})}),f.jsx(G.Grid,{children:f.jsx(kB,{closeFormCompanionWindow:e,saveAnnotation:p,t:i,annotationState:s})})]})}Jw.propTypes={annotation:d.object.isRequired,closeFormCompanionWindow:d.func.isRequired,playerReferences:d.object.isRequired,saveAnnotation:d.func.isRequired,t:d.func.isRequired,windowId:d.string.isRequired};const qi=n=>n===Yt.IMAGE,fu=(n,e=[])=>{const t=[{Component:$w,convertToAnnotation:IB,description:n("textual_note_with_target"),icon:f.jsx(RI,{}),id:Ge.MULTIPLE_BODY_TYPE,isCompatibleWithMediaType:qi,label:n("note"),selectable:!0},{Component:Zw,convertToAnnotation:MB,description:n("tag_with_target"),icon:f.jsx(OI,{fontSize:"small"}),id:Ge.TAGGING_TYPE,isCompatibleWithMediaType:qi,label:n("tag"),selectable:!0},{Component:Xw,convertToAnnotation:bB,description:n("poi_description"),icon:f.jsx(NI,{fontSize:"small"}),id:Ge.POI_TYPE,isCompatibleWithMediaType:qi,label:n("poi"),selectable:!0},{Component:Yw,convertToAnnotation:jB,description:n("nested_map_description"),icon:f.jsx(dx,{fontSize:"small"}),id:Ge.NESTED_MAP_TYPE,isCompatibleWithMediaType:qi,label:n("nested_map"),selectable:!0},{Component:Uw,convertToAnnotation:EB,description:n("journey_description"),icon:f.jsx(fx,{fontSize:"small"}),id:Ge.JOURNEY_TYPE,isCompatibleWithMediaType:qi,label:n("journey"),selectable:!0},{Component:qw,convertToAnnotation:iB,description:n("edit_iiif_json_code"),icon:f.jsx(jI,{fontSize:"small"}),id:Ge.IIIF_TYPE,isCompatibleWithMediaType:qi,label:n("expert_mode"),selectable:!0},{Component:Jw,convertToAnnotation:FB,description:"",icon:null,id:Ge.TEXT_TYPE,isCompatibleWithMediaType:qi,label:"",selectable:!1}],r=new Set(t.map(o=>o.id)),i=e.filter(o=>r.has(o.id)?(console.warn(`Ignoring external annotation template with id "${o.id}": it collides with a built-in template id.`),!1):typeof o.id!="string"||typeof o.Component!="function"||typeof o.convertToAnnotation!="function"||typeof o.isCompatibleWithMediaType!="function"?(console.warn(`Ignoring external annotation template with id "${o.id}": it does not follow the TEMPLATE_REGISTRY contract (id: string, Component/convertToAnnotation/isCompatibleWithMediaType: function are all required).`),!1):!0);return[...t,...i]},Kw=(n,e=[],t=null)=>fu(n,e).filter(r=>r.selectable).filter(r=>!Array.isArray(t)||t.length===0?!0:t.includes(r.id)),Da=(n,e,t=[])=>fu(n,t).find(r=>r.id===e);let Ja=0;const B1=()=>{document.dispatchEvent(new CustomEvent(hf,{detail:{saving:Ja>0}}))},GB=n=>n["dbf:kind"]==="Journey"?Ge.JOURNEY_TYPE:n["dbf:linkedMap"]?Ge.NESTED_MAP_TYPE:Ge.POI_TYPE,kg=n=>{if(!n)return n;const{chosen:e,selected:t,...r}=n;return r},Pl=n=>n.map(e=>({...e})),Qw=(n,e)=>n.length===e.length&&n.every((t,r)=>t.id===e[r].id),e_=(n,e)=>n.filter(t=>!FT(t,kg(e.get(t.id)))),t_="maps-annotation-list",qB={name:t_,put:!0},HB={name:t_,put:(n,e,t)=>t.getAttribute("data-kind")==="POI"};function n_({canonicalItemsById:n,journeyId:e,persistChanges:t,pois:r,renderRow:i}){const o=m.useRef(!1),a=m.useRef(0),[s,l]=m.useState(()=>Pl(r));m.useEffect(()=>{o.current||a.current>0||l(Pl(r))},[r]);const u=m.useCallback(()=>{o.current=!0},[]),c=m.useCallback(()=>{o.current=!1},[]),h=m.useCallback(p=>{if(Qw(p,s))return;const b=p.map((x,E)=>vx(kg(x),e,E));l(b),a.current+=1,t(e_(b,n),[e]).finally(()=>{a.current-=1})},[n,e,s,t]);return f.jsx(zx.ReactSortable,{animation:150,forceFallback:!0,group:HB,list:s,onEnd:c,onStart:u,setList:h,tag:"ul",style:{listStyle:"none",margin:0,paddingInlineStart:24},children:s.map(p=>f.jsx("li",{style:{listStyle:"none"},"data-kind":"POI",children:i(p)},p.id))})}n_.propTypes={canonicalItemsById:d.instanceOf(Map).isRequired,journeyId:d.string.isRequired,persistChanges:d.func.isRequired,pois:d.arrayOf(d.object).isRequired,renderRow:d.func.isRequired};function Pg({canvasId:n,deselectAnnotation:e,hoverAnnotation:t,hoveredAnnotationIds:r=[],index:i,items:o=[],label:a,receiveAnnotation:s,selectAnnotation:l,selectedAnnotationId:u,storageAdapter:c,totalSize:h,windowId:p}){const{i18n:b,t:x}=Rn.useTranslation(),E=m.useMemo(()=>{const q=new Map;return fu(x).forEach(J=>q.set(J.id,J)),q},[x]),g=m.useMemo(()=>bx(o),[o]),v=m.useMemo(()=>new Map(o.map(q=>[q.id,q])),[o]),C=m.useMemo(()=>g.map(q=>q.item),[g]),A=m.useMemo(()=>{const q=new Map;return g.forEach(J=>{J.kind==="Journey"&&q.set(J.id,J.pois)}),q},[g]),_=m.useRef(!1),O=m.useRef(0),[R,I]=m.useState(()=>Pl(C));m.useEffect(()=>{_.current||O.current>0||I(Pl(C))},[C]);const N=m.useRef(o);m.useEffect(()=>{N.current=o},[o]);const L=m.useCallback(()=>{_.current=!0},[]),B=m.useCallback(()=>{_.current=!1},[]),w=m.useRef(Promise.resolve()),P=m.useCallback(q=>{const J=c(n);Ja+=1,Ja===1&&B1();const X=()=>J.update(q).then(K=>(K?.items&&(N.current=K.items),s(n,J.annotationPageId,K),K)),Q=w.current.then(X,X);return w.current=Q.catch(()=>{}),Q.finally(()=>{Ja-=1,Ja===0&&B1()}),Q},[c,n,s]),T=m.useCallback((q,J)=>{if(!q)return Promise.resolve();const X=hl(q,J,n);if(!X)return Promise.resolve();const Q=(J??[]).find(K=>K.id===q);return Q&&lp(Q.target,X.target)?Promise.resolve():P(X)},[P]),D=m.useCallback((q,J)=>(q.forEach(X=>P(X)),w.current.then(()=>Promise.all(J.map(X=>T(X,N.current))))),[P,T]),M=m.useCallback(q=>{if(Qw(q,R))return;const J=new Set(q.map(Q=>Q["dbf:journey"]?.id).filter(Boolean)),X=q.map((Q,K)=>hm(kg(Q),K));I(X),O.current+=1,D(e_(X,v),[...J]).finally(()=>{O.current-=1})},[v,R,D]),k=m.useCallback(q=>{window.getSelection()?.toString()||(u===q?e(p,q):l(p,q))},[p,e,l,u]),V=m.useMemo(()=>g.filter(q=>q.kind==="Journey").map(q=>({id:q.id,title:dm(q.item,b.language)||"—"})),[g,b.language]),W=m.useCallback((q,J)=>{const X=q["dbf:journey"]?.id??null,Q=J?vx(q,J,(A.get(J)??[]).length):hm(q,R.length);P(Q).then(K=>{if(!K)return;const z=new Set([J,X].filter(Boolean));return Promise.all([...z].map(re=>T(re,K.items)))})},[A,P,R.length,T]),Y=q=>{const J=dm(q,b.language)||"—",X=r.includes(q.id)||u===q.id,Q=q["dbf:kind"]==="Journey",K=E.get(GB(q))?.icon;let z;return X?z="rgba(0, 0, 0, 0.04)":Q&&(z="rgba(0, 0, 0, 0.02)"),f.jsxs(Gl,{annotationid:q.id,currentJourneyId:Q?void 0:q["dbf:journey"]?.id??null,"data-kind":q["dbf:kind"],journeys:Q?void 0:V,onClick:()=>k(q.id),onMoveToJourney:Q?void 0:re=>W(q,re),onMouseEnter:()=>t(p,[q.id]),onMouseLeave:()=>t(p,[]),style:{alignItems:"center",backgroundColor:z,cursor:"pointer",display:"flex",gap:8,listStyle:"none",padding:"8px 16px"},children:[K&&f.jsx("span",{style:{display:"inline-flex",flexShrink:0},children:K}),f.jsx(je,{variant:Q?"subtitle2":"body2",children:J})]},q.id)};return R.length===0?null:f.jsxs(f.Fragment,{children:[f.jsx(je,{sx:{paddingLeft:2,paddingRight:1,paddingTop:2},variant:"overline",children:x("annotationCanvasLabel",{context:`${i+1}/${h}`,label:a})}),f.jsx(zx.ReactSortable,{animation:150,forceFallback:!0,group:qB,list:R,onEnd:B,onStart:L,setList:M,tag:"ul",style:{listStyle:"none",margin:0,padding:0},children:R.map(q=>q["dbf:kind"]==="Journey"?f.jsxs("li",{style:{listStyle:"none"},"data-kind":"Journey",children:[Y(q),f.jsx(n_,{canonicalItemsById:v,journeyId:q.id,persistChanges:D,pois:A.get(q.id)??[],renderRow:Y})]},q.id):f.jsx("li",{style:{listStyle:"none"},"data-kind":"POI",children:Y(q)},q.id))})]})}Pg.propTypes={canvasId:d.string.isRequired,deselectAnnotation:d.func.isRequired,hoverAnnotation:d.func.isRequired,hoveredAnnotationIds:d.arrayOf(d.string),index:d.number.isRequired,items:d.arrayOf(d.object),label:d.string.isRequired,receiveAnnotation:d.func.isRequired,selectAnnotation:d.func.isRequired,selectedAnnotationId:d.string,storageAdapter:d.func.isRequired,totalSize:d.number.isRequired,windowId:d.string.isRequired};Pg.defaultProps={hoveredAnnotationIds:[],items:[],selectedAnnotationId:void 0};const Kf=n=>{if(!n)return!1;const e=getComputedStyle(n),t=e.overflowY||e.overflow||"";return/(auto|scroll|overlay)/.test(t)&&n.scrollHeight>n.clientHeight},VB=n=>{let e=n?.parentElement||null;for(;e;){if(Kf(e))return e;e=e.parentElement}return null},WB=()=>document.scrollingElement||document.documentElement;function zB(n,e,t){const r=n.getBoundingClientRect(),i=e.getBoundingClientRect(),o=i.top-r.top+n.scrollTop,a=i.bottom-r.top+n.scrollTop,s=n.scrollTop+t,l=n.scrollTop+n.clientHeight,u=o<s,c=a>l;return!u&&!c?null:u?o-t:Math.max(a-n.clientHeight,o-t)}function XB(n,e){const t=n.getBoundingClientRect(),r=t.top+window.scrollY,i=t.bottom+window.scrollY,o=window.scrollY+e,a=window.scrollY+window.innerHeight,s=r<o,l=i>a;return!s&&!l?null:s?r-e:Math.max(i-window.innerHeight,r-e)}const UB=(n,e,t)=>new Promise(r=>{const i="smooth";requestAnimationFrame(()=>{requestAnimationFrame(()=>{let a=e.current;if(Kf(a)||(a=VB(n)),Kf(a)||(a=WB()),a===document.body||a===document.documentElement||a===document.scrollingElement){const c=XB(n,96);if(c==null)return r(!0);const h=window.scrollY;window.scrollTo({behavior:i,top:c}),setTimeout(()=>{const p=window.scrollY;r(Math.abs(p-h)>.5)},t);return}const l=zB(a,n,96);if(l==null)return r(!0);const u=a.scrollTop;typeof a.scrollTo=="function"&&a.scrollTo({behavior:i,top:l}),setTimeout(()=>{const c=a.scrollTop;r(Math.abs(c-u)>.5)},t)})})}),$B=async(n,e)=>{for(let i=0;i<=3&&!await UB(n,e,24);i++)i<3&&await new Promise(a=>{setTimeout(a,24)})};function r_({addCompanionWindow:n,addWindow:e,annotationsOnCanvases:t={},canvases:r=[],config:i,deselectAnnotation:o,highlightAllAnnotations:a,receiveAnnotation:s,switchToSingleCanvasView:l,TargetComponent:u,targetProps:c,updateWindow:h,windowViewType:p,annotationEditCompanionWindowIsOpened:b,annotationPreviewCompanionWindowIsOpened:x}){const[E,g]=m.useState(!1),{t:v}=Rn.useTranslation(),C=m.useRef(null),A=m.useRef(null);m.useEffect(()=>{const T=c?.selectedAnnotationId;if(!T)return;const D=C.current?.querySelector(`li[annotationid="${T}"]`)||C.current?.querySelector("li.MuiMenuItem-root.Mui-selected");D&&$B(D,A)},[c?.selectedAnnotationId]);const _=m.useCallback(()=>{g(T=>!T)});m.useEffect(()=>{mu.isInitialized&&i.translations&&(Object.keys(i.translations).forEach(T=>{mu.addResourceBundle(T,"translation",i.translations[T],!0,!0)}),i.language&&mu.changeLanguage(i.language))},[i.translations,i.language]);const{editMode:O}=CS(i);m.useEffect(()=>{O&&!a&&h({highlightAllAnnotations:!0})},[O,a,h]);const R=m.useCallback(T=>T?r.some(D=>{const M=t[D.id];return M?Object.values(M).some(k=>k.json&&k.json.items?k.json.items.some(V=>V.id===T&&V.maeData):!1):!1}):!1,[r,t]),I=m.useRef(b);m.useEffect(()=>{const T=!I.current,D=b;I.current=b,O&&T&&D&&o()},[O,b,o]);const N=m.useRef(null);m.useEffect(()=>{if(!O)return;const T=c?.selectedAnnotationId;T!==N.current&&(N.current=T,T&&b&&R(T)&&n("annotationCreation",{annotationid:T,position:"right"}))},[O,c?.selectedAnnotationId,b,R,n]);const L={containerRef:A,...c,listContainerComponent:Gl},B=m.useMemo(()=>{const T=c?.canvasId;return!T||!t[T]?[]:Object.values(t[T]).flatMap(D=>D?.json?.items??[])},[c?.canvasId,t]),w=B.some(T=>T["dbf:kind"]==="POI"||T["dbf:kind"]==="Journey"),P=m.useMemo(()=>({addCompanionWindow:n,addWindow:e,annotationEditCompanionWindowIsOpened:b,annotationPreviewCompanionWindowIsOpened:x,annotationsOnCanvases:t,canvases:r,config:i,receiveAnnotation:s,storageAdapter:i.annotation.adapter,t:v,toggleSingleCanvasDialogOpen:_,windowId:c.windowId,windowViewType:p}),[n,e,b,x,t,r,i,s,v,_,c.windowId,p]);return f.jsxs(px.Provider,{value:P,children:[f.jsx("div",{ref:C,style:{height:"100%",position:"relative"},children:w?f.jsx(Pg,{canvasId:c.canvasId,deselectAnnotation:c.deselectAnnotation,hoverAnnotation:c.hoverAnnotation,hoveredAnnotationIds:c.hoveredAnnotationIds,index:c.index,items:B,label:c.label,receiveAnnotation:s,selectAnnotation:c.selectAnnotation,selectedAnnotationId:c.selectedAnnotationId,storageAdapter:i.annotation.adapter,totalSize:c.totalSize,windowId:c.windowId}):f.jsx(u,{...L})}),p!=="single"&&f.jsx(np,{handleClose:_,open:E,switchToSingleCanvasView:l})]})}r_.propTypes={addCompanionWindow:d.func.isRequired,addWindow:d.func.isRequired,annotationEditCompanionWindowIsOpened:d.bool.isRequired,annotationPreviewCompanionWindowIsOpened:d.bool.isRequired,annotationsOnCanvases:d.shape({id:d.string,isFetching:d.bool,json:d.shape({id:d.string,items:d.arrayOf(d.shape({body:d.shape({format:d.string,id:d.string,value:d.string}),drawingState:d.string,id:d.string,manifestNetwork:d.string,motivation:d.string,target:d.string,type:d.string})),type:d.string})}).isRequired,canvases:d.arrayOf(d.shape({id:d.string,index:d.number})).isRequired,config:d.shape({annotation:d.shape({adapter:d.func,editMode:d.bool}),language:d.string,translations:d.objectOf(d.object)}).isRequired,deselectAnnotation:d.func.isRequired,highlightAllAnnotations:d.bool.isRequired,receiveAnnotation:d.func.isRequired,switchToSingleCanvasView:d.func.isRequired,t:d.func.isRequired,TargetComponent:d.oneOfType([d.func,d.node]).isRequired,targetProps:d.object.isRequired,updateWindow:d.func.isRequired,windowViewType:d.string.isRequired};function YB(n,{targetProps:{windowId:e}}){const t=pe.getVisibleCanvases(n,{windowId:e}),r={},i=pe.getCompanionWindowsForContent(n,{content:"annotationCreation",windowId:e}),o=Object.keys(i).length===0,a=pe.getCompanionWindowsForContent(n,{content:"mapsPoiPreview",windowId:e}),s=Object.keys(a).length===0;return t.forEach(l=>{const u=n.annotations[l.id];u&&(r[l.id]=u)}),{annotationEditCompanionWindowIsOpened:o,annotationPreviewCompanionWindowIsOpened:s,annotationsOnCanvases:r,canvases:t,config:{...n.config,translations:Fl},highlightAllAnnotations:pe.getWindow(n,{windowId:e}).highlightAllAnnotations,windowViewType:pe.getWindowViewType(n,{windowId:e})}}const ZB=(n,e)=>({addCompanionWindow:(t,r)=>n(pe.addCompanionWindow(e.targetProps.windowId,{content:t,...r})),addWindow:t=>n(pe.addWindow(t)),deselectAnnotation:()=>n(pe.deselectAnnotation(e.targetProps.windowId)),receiveAnnotation:(t,r,i)=>n(pe.receiveAnnotation(t,r,i)),switchToSingleCanvasView:()=>n(pe.setWindowViewType(e.targetProps.windowId,"single")),updateWindow:t=>n(pe.updateWindow(e.targetProps.windowId,t))}),i_={component:r_,mapDispatchToProps:ZB,mapStateToProps:YB,mode:"wrap",target:"CanvasAnnotations"};function o_({mediaType:n,setCommentingType:e}){const{t}=Rn.useTranslation(),r=s=>e(s),{enabledTemplateTypes:i,externalTemplates:o}=xn.useSelector(s=>pe.getConfig(s)).annotation,a=Kw(t,o,i);return f.jsx(JB,{children:n===Yt.AUDIO?f.jsx(G.Grid,{container:!0,spacing:1,direction:"column",children:f.jsx(G.Grid,{children:f.jsx(je,{children:t("audio_not_supported")})})}):a.map(s=>s.isCompatibleWithMediaType(n)&&f.jsx(KB,{children:f.jsx(QB,{id:s.id,onClick:()=>r(s),children:f.jsxs(G.CardContent,{children:[f.jsxs(eF,{component:"div",children:[t(s.label),s.icon]}),f.jsx(tF,{component:"div",variant:"body2",children:t(s.description)})]})})},s.id))})}const JB=In.styled("div")(({theme:n})=>({display:"flex",flexDirection:"column",gap:n.spacing(3.75),margin:n.spacing(1.25)})),KB=In.styled(G.Card)(({theme:n})=>({borderRadius:n.shape.borderRadius,boxShadow:n.shadows[1],border:`1px solid ${In.alpha(n.palette.primary?.main??"#5A8264",.25)}`,transition:"box-shadow 120ms ease, transform 120ms ease, border-color 120ms ease","&:hover":{boxShadow:n.shadows[3],borderColor:In.alpha(n.palette.primary?.main??"#5A8264",.5),transform:"translateY(-1px)"}})),QB=In.styled(G.CardActionArea)(({theme:n})=>({borderRadius:n.shape.borderRadius,"&:hover":{backgroundColor:In.alpha(n.palette.primary?.main??"#5A8264",.06)}})),eF=In.styled(je)(({theme:n})=>{const e=n.typography.formSectionTitle??{};return{display:"flex",justifyContent:"space-between",alignItems:"center",gap:n.spacing(1),color:e.color??n.palette.primary?.main??"#5A8264",fontSize:e.fontSize??n.typography.h6.fontSize,fontWeight:e.fontWeight??600,letterSpacing:e.letterSpacing??"0.02em",textTransform:e.textTransform??"none",lineHeight:1.25,marginBottom:n.spacing(.5)}}),tF=In.styled(je)(({theme:n})=>{const e=n.typography.subFormSectionTitle??{};return{color:n.palette.text.secondary,fontSize:e.fontSize??n.typography.body2.fontSize,fontWeight:e.fontWeight??300,letterSpacing:e.letterSpacing??0,lineHeight:e.lineHeight??n.typography.body2.lineHeight,textTransform:e.textTransform??"none"}});o_.propTypes={mediaType:d.string.isRequired,setCommentingType:d.func.isRequired};const nF=tt.createSvgIcon(f.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");function a_({templateType:n,setCommentingType:e,annotation:t}){const r=()=>{e(null)};return f.jsxs(G.Grid,{container:!0,direction:"row",alignItems:"center",justifyContent:"space-between",sx:{marginRight:"10px"},spacing:2,children:[f.jsx(G.Grid,{children:t.id==null&&f.jsx(pe.MiradorMenuButton,{"aria-label":"back",TooltipProps:{title:"back"},children:f.jsx(nF,{onClick:r})})}),f.jsx(G.Grid,{children:n.icon})]})}a_.propTypes={annotation:d.oneOfType([d.shape({body:d.shape({format:d.string,id:d.string,type:d.string,value:d.string}),drawingState:d.string,id:d.string,manifestNetwork:d.string,motivation:d.string,target:d.string}),d.string]).isRequired,setCommentingType:d.func.isRequired,templateType:d.shape({description:d.string,icon:d.element,id:d.string,label:d.string}).isRequired};function s_({playerReferences:n,t:e}){return f.jsxs(f.Fragment,{children:[f.jsx("h4",{children:"Debug info "}),f.jsx("p",{children:"Only visible in debug mode"}),f.jsx(je,{children:n.getMediaType()}),f.jsxs(je,{children:[e("scale"),":",n.getScale()]}),f.jsxs(je,{children:[e("zoom"),":",n.getZoom()]}),f.jsxs(je,{children:[e("image_true_size"),":",n.getMediaTrueWidth()," ","x",n.getMediaTrueHeight()]}),f.jsxs(je,{children:[e("container_size"),":",n.getContainerWidth()," ","x",n.getContainerHeight()]}),f.jsxs(je,{children:[e("image_displayed"),":",n.getDisplayedMediaWidth()," ","x",n.getDisplayedMediaHeight()]})]})}s_.propTypes={playerReferences:d.any.isRequired,t:d.func.isRequired};function l_({annotation:n,canvases:e,closeFormCompanionWindow:t,playerReferences:r,saveAnnotation:i,templateType:o,windowId:a}){const{t:s}=Rn.useTranslation(),l=xn.useSelector(p=>pe.getConfig(p)).annotation,u=l.debug??!1,{externalTemplates:c}=l,h=m.useMemo(()=>fu(s,c).find(p=>p.id===o.id)?.Component,[s,o.id,c]);return f.jsxs(G.Grid,{container:!0,direction:"column",children:[f.jsx(rF,{children:h&&f.jsx(h,{annotation:n,canvases:e,closeFormCompanionWindow:t,playerReferences:r,saveAnnotation:i,t:s,windowId:a})}),u&&f.jsx(s_,{playerReferences:r,t:s})]})}const rF=In.styled(G.Grid)({margin:"0 10px"});l_.propTypes={annotation:d.shape({adapter:d.func,body:d.arrayOf(d.shape({type:d.string})),defaults:d.objectOf(d.oneOfType([d.bool,d.func,d.number,d.string])),drawingState:d.string,manifestNetwork:d.string,target:d.string}).isRequired,canvases:d.arrayOf(d.shape({id:d.string,index:d.number})).isRequired,closeFormCompanionWindow:d.func.isRequired,playerReferences:d.object.isRequired,saveAnnotation:d.func.isRequired,templateType:d.shape({description:d.string,icon:d.element,id:d.string,label:d.string}).isRequired,windowId:d.string.isRequired};function u_({id:n,windowId:e,mediaType:t}){const{t:r}=Rn.useTranslation();return f.jsx(pe.CompanionWindow,{title:r("media_not_supported"),windowId:e,id:n,children:f.jsxs(G.Grid,{container:!0,padding:1,spacing:1,children:[f.jsx(G.Grid,{children:f.jsx(je,{children:r("media_not_supported")})}),f.jsx(G.Grid,{children:f.jsx(je,{children:r("detected_media_type",{mediaType:t})})})]})})}u_.propTypes={id:d.string.isRequired,mediaType:d.string.isRequired,windowId:d.string.isRequired};function c_({annotation:n,canvases:e,closeCompanionWindow:t,config:r,id:i,playerReferences:o,receiveAnnotation:a,windowId:s}){const{t:l}=Rn.useTranslation(),{enabledTemplateTypes:u,externalTemplates:c}=r.annotation,[h,p]=m.useState(null),[b,x]=m.useState(o.getMediaType()),[E,g]=m.useState(0),[,v]=m.useReducer(I=>I+1,0);!o.isInitializedCorrectly()&&E<10&&(console.log("AnnotationForm.js: retryCount",E),setTimeout(()=>{g(E+1),v()},100));const[C,A]=m.useState({height:window.innerHeight,width:window.innerWidth});if(!h)if(n.id)n.maeData&&n.maeData.templateType?p(Da(l,n.maeData.templateType,c)??Da(l,Ge.IIIF_TYPE)):p(Da(l,Ge.IIIF_TYPE));else{const{defaultForm:I}=vs(r),N=Kw(l,c,u).filter(L=>L.isCompatibleWithMediaType(b));I&&Wg[I]?p(Da(l,Wg[I])):N.length===1&&p(N[0])}if(m.useEffect(()=>{p(null),x(o.getMediaType())},[e[0].index]),m.useEffect(()=>{const I=()=>{A({height:window.innerHeight,width:window.innerWidth})};return window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}},[]),o.isInitCorrectly||o.isInitializedCorrectly(),!o.isInitCorrectly)return f.jsx(u_,{id:i,mediaType:b,windowId:s});const _=m.useCallback(()=>{t("annotationCreation",{id:i,position:"right"})},[t,i]),O=m.useRef(n);O.current=n;const R=I=>{const N=I,L=N?.maeData?.templateType?Da(l,N.maeData.templateType,c):void 0,B=o.getCanvases().map(async w=>{let P;N?.maeData&&N.maeData.templateType?P=L?await L.convertToAnnotation(N,{canvas:w,playerReferences:o,windowId:s}):await vA(N,w,s,o):P=N;const T=r.annotation.adapter(w.id),D=await K1(w.id,T,a,P);return xx(P?.["dbf:journey"]?.id,D,w.id,T,a)});return Promise.all(B).then(()=>{_()})};return f.jsx(pe.ConnectedCompanionWindow,{title:n.id?l("edit_annotation"):l("new_annotation"),windowId:s,id:i,children:h===null?f.jsx(o_,{setCommentingType:p,mediaType:b}):f.jsxs(G.Grid,{container:!0,direction:"column",spacing:1,children:[f.jsx(G.Grid,{container:!0,children:f.jsx(a_,{setCommentingType:p,templateType:h,annotation:n})}),f.jsx(G.Grid,{children:f.jsx(l_,{annotation:n,canvases:e,closeFormCompanionWindow:_,playerReferences:o,saveAnnotation:R,templateType:h,windowId:s})})]})})}c_.propTypes={annotation:d.oneOfType([d.shape({body:d.shape({format:d.string,id:d.string,type:d.string,value:d.string}),drawingState:d.string,id:d.string,manifestNetwork:d.string,motivation:d.string,target:d.string}),d.string]).isRequired,canvases:d.arrayOf(d.shape({id:d.string})).isRequired,closeCompanionWindow:d.func.isRequired,config:d.shape({annotation:d.shape({adapter:d.func,debug:d.bool,defaults:d.objectOf(d.oneOfType([d.bool,d.func,d.number,d.string])),enabledTemplateTypes:d.arrayOf(d.string),externalTemplates:d.arrayOf(d.object)}),language:d.string,translations:d.objectOf(d.object)}).isRequired,id:d.string.isRequired,playerReferences:d.object.isRequired,receiveAnnotation:d.func.isRequired,windowId:d.string.isRequired};class iF{actions;mediaType;canvases;windowId;overlay;isInitCorrectly;constructor(e,t,r,i){this.actions=i,this.media=r,this.mediaType=oF(e,t),this.canvases=pe.getVisibleCanvases(e,{windowId:t}),this.windowId=t,this.isInitCorrectly=!1,this.isInitializedCorrectly()&&(this.mediaType===Yt.IMAGE?this.overlay={canvasHeight:this.media.current.canvas.clientHeight,canvasWidth:this.media.current.canvas.clientWidth,containerHeight:this.media.current.canvas.clientHeight,containerWidth:this.media.current.canvas.clientWidth}:console.error("Unknown media type"))}sleep(e){return new Promise(t=>{setTimeout(t,e)})}isInitializedCorrectly(){return this.isInitCorrectly=this.media&&(this.mediaType===Yt.IMAGE&&this.media.current&&this.media.current.canvas||this.mediaType===Yt.VIDEO&&this.media.video)&&this.mediaType!==Yt.UNKNOWN&&this.mediaType!==Yt.AUDIO,this.isInitCorrectly}getMediaType(){return this.mediaType}getCanvases(){return this.canvases}getAudioElement(){return this.mediaType===Yt.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===Yt.IMAGE?this.media.current.container:null}getContainerHeight(){return this.overlay.containerHeight}getContainerWidth(){return this.overlay.containerWidth}getDisplayedMediaHeight(){if(this.mediaType===Yt.IMAGE){const e=this.media.current;if(e){const t=this.getMediaTrueHeight()*e.viewport.getZoom(),r=e.container.clientWidth;return Math.round(r*t)}}}getDisplayedMediaWidth(){if(this.mediaType===Yt.IMAGE){const e=this.media.current;if(e&&e.world.getItemCount()>0){const t=this.getMediaTrueWidth()*e.viewport.getZoom(),r=e.container.clientWidth;return Math.round(r*t)}}}getMediaTrueHeight(){if(this.mediaType===Yt.IMAGE)return this.canvases[0].__jsonld.height;console.error("Unknown media type")}getMediaTrueWidth(){if(this.mediaType===Yt.IMAGE)return this.canvases[0].__jsonld.width}getScale(){return this.isInitializedCorrectly()?this.getDisplayedMediaWidth()/this.getMediaTrueWidth():null}getZoom(){if(this.mediaType===Yt.IMAGE){const e=this.media.current.viewport.getZoom(),t=this.media.current.viewport.getMaxZoom();let r=e/t;return r=Math.round(r*100)/100,r}}getImagePosition(){if(this.mediaType===Yt.IMAGE){const e=this.media.current;if(e){const r=e.world.getItemAt(0).getBounds(),i=e.viewport.viewportToViewerElementCoordinates(r.getTopLeft());return{x:Math.round(i.x),y:Math.round(i.y)}}}}getTargetStrokeWidth(){return Math.max(this.getDisplayedMediaWidth()/500,3)}}function oF(n,e){const t=pe.getVisibleCanvasAudioResources(n,{windowId:e})||[];return(pe.getVisibleCanvasVideoResources(n,{windowId:e})||[]).length>0?Yt.VIDEO:t.length>0?Yt.AUDIO:Yt.IMAGE}const aF=(n,{id:e,windowId:t})=>({closeCompanionWindow:()=>n(pe.removeCompanionWindow(t,e)),receiveAnnotation:(r,i,o)=>n(pe.receiveAnnotation(r,i,o))});function sF(n,{id:e,windowId:t}){const i=pe.getCompanionWindow(n,{companionWindowId:e,windowId:t}),{annotationid:o}=i,a=pe.OSDReferences.get(t),s=new iF(n,t,a,R_),l=pe.getVisibleCanvases(n,{windowId:t});let u=pe.getPresentAnnotationsOnSelectedCanvases(n,{windowId:t}).flatMap(c=>c.json.items||[]).find(c=>c.id===o);return u||(u={id:null,maeData:{templateType:null}}),{annotation:u,canvases:l,config:{...n.config,translations:Fl},currentTime:null,playerReferences:s}}const d_={companionWindowKey:"annotationCreation",component:c_,mapDispatchToProps:aF,mapStateToProps:sF};function h_({PluginComponents:n=[],TargetComponent:e,targetProps:t}){return t.hasAnyAnnotations=!0,f.jsx(e,{...t,PluginComponents:n})}h_.propTypes={PluginComponents:d.array.isRequired,TargetComponent:d.oneOfType([d.func,d.node]).isRequired,targetProps:d.object.isRequired};const f_={component:h_,mode:"wrap",target:"WindowSideBarButtons"};var p_=function(e){return"@@redux-saga/"+e},lF=p_("IO"),uF=p_("MULTICAST"),cF=function(e){return e==null},dF=function(e){return e!==void 0},Qi=function(e){return typeof e=="function"},g_=function(e){return typeof e=="string"},m_=Array.isArray,Qf=function(e){return e&&(g_(e)||fF(e)||Qi(e)||m_(e)&&e.every(Qf))},Lg=function(e){return e&&Qi(e.take)&&Qi(e.close)},hF=function(e){return Qi(e)&&e.hasOwnProperty("toString")},fF=function(e){return!!e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype},pF=function(e){return Lg(e)&&e[uF]},gF=function(e){return e},mF=function(e){throw e},bF=function(e){return{value:e,done:!0}};function vF(n,e,t){e===void 0&&(e=mF),t===void 0&&(t="iterator");var r={meta:{name:t},next:n,throw:e,return:bF,isSagaIterator:!0};return typeof Symbol<"u"&&(r[Symbol.iterator]=function(){return r}),r}var sf="TAKE",yF="PUT",xF="ALL",CF="CALL",EF="FORK",wF="SELECT",Si=function(e,t){var r;return r={},r[lF]=!0,r.combinator=!1,r.type=e,r.payload=t,r};function _F(n,e){if(n===void 0&&(n="*"),Qf(n))return Si(sf,{pattern:n});if(pF(n)&&dF(e)&&Qf(e))return Si(sf,{channel:n,pattern:e});if(Lg(n))return Si(sf,{channel:n})}function AF(n,e){return cF(e)&&(e=n,n=void 0),Si(yF,{channel:n,action:e})}function TF(n){var e=Si(xF,n);return e.combinator=!0,e}function b_(n,e){var t=null,r;return Qi(n)?r=n:(m_(n)?(t=n[0],r=n[1]):(t=n.context,r=n.fn),t&&g_(r)&&Qi(t[r])&&(r=t[r])),{context:t,fn:r,args:e}}function v_(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Si(CF,b_(n,t))}function y_(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Si(EF,b_(n,t))}function IF(n){n===void 0&&(n=gF);for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return Si(wF,{selector:n,args:t})}var F1=function(e){return{done:!0,value:e}},lf={};function SF(n){return Lg(n)?"channel":hF(n)?String(n):Qi(n)?n.name:String(n)}function RF(n,e,t){var r,i,o,a=e;function s(l,u){if(a===lf)return F1(l);if(u&&!i)throw a=lf,u;r&&r(l);var c=u?n[i](u):n[a]();return a=c.nextState,o=c.effect,r=c.stateUpdater,i=c.errorState,a===lf?F1(l):o}return vF(s,function(l){return s(null,l)},t)}function OF(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];var o={done:!1,value:_F(n)},a=function(c){return{done:!1,value:y_.apply(void 0,[e].concat(r,[c]))}},s,l=function(c){return s=c};return RF({q1:function(){return{nextState:"q2",effect:o,stateUpdater:l}},q2:function(){return{nextState:"q1",effect:a(s)}}},"q1","takeEvery("+SF(n)+", "+e.name+")")}function jF(n,e){for(var t=arguments.length,r=new Array(t>2?t-2:0),i=2;i<t;i++)r[i-2]=arguments[i];return y_.apply(void 0,[OF,n,e].concat(r))}function*NF(n){const e=yield IF(pe.getConfig);if(e&&e.annotation.adapter){const t=e.annotation.adapter(n),r=yield v_([t,t.all]);r&&(yield AF(pe.receiveAnnotation(n,t.annotationPageId,r)))}}function*DF(n){const{canvasId:e}=n;yield v_(NF,e)}function*MF(){yield TF([jF(pe.ActionTypes.SET_CANVAS,DF)])}const kF={saga:MF},PF=(n,e,t)=>{const r=n.maeData?.target?n:fs({...n}),i=r.maeData?.target??{},o=typeof i.drawingState=="string"?JSON.parse(i.drawingState):i.drawingState??{},s={...o.shapes?.[0]??{...Ti,id:ln(),rotation:0,scaleX:1,scaleY:1,type:we.POI},x:e.x,y:e.y},{svg:l,...u}=i;return{...r,maeData:{...r.maeData,target:{...u,drawingState:JSON.stringify({...o,currentShape:s,isDrawing:!1,shapes:[s]})}},target:ex(t,s)}},G1=()=>{},LF=n=>{const e=n?.viewport?.getBounds(!0),t=n?.container;if(!e||!t||!e.width)return null;const r=t.clientWidth/e.width;return{height:t.clientHeight,scale:r,width:t.clientWidth,x:-e.x*r,y:-e.y*r}};function Bg({canvasId:n=null,canvasHeight:e=0,canvasWidth:t=0,isFormOpen:r,pois:i,receiveAnnotation:o,storageAdapter:a=null,viewer:s=null}){const{t:l}=Rn.useTranslation(),[u,c]=m.useState(or.MOVE),[,h]=m.useReducer(_=>_+1,0),p=m.useRef(Promise.resolve()),b=!r&&!!a&&!!n&&i.length>0,x=b&&u===or.TARGET;m.useEffect(()=>{b||c(or.MOVE)},[b]),m.useEffect(()=>{if(!(!x||typeof s?.addHandler!="function"))return s.addHandler("animation",h),s.addHandler("resize",h),()=>{s.removeHandler("animation",h),s.removeHandler("resize",h)}},[x,s]);const E=m.useCallback((_,O)=>{const R=a(n),I=async()=>{const L=await K1(n,R,o,PF(_,O,n));await xx(_["dbf:journey"]?.id,L,n,R,o)},N=p.current.then(I,I);return p.current=N.catch(()=>{}),N},[n,o,a]);if(!b)return null;const g=f.jsx(G.Paper,{elevation:3,sx:{insetInlineEnd:_=>_.spacing(2),position:"absolute",top:_=>_.spacing(2),zIndex:1001},children:f.jsxs(G.ToggleButtonGroup,{"aria-label":l("poi_mode"),exclusive:!0,onChange:(_,O)=>O&&c(O),size:"small",value:u,children:[f.jsx(G.Tooltip,{title:l("poi_mode_move"),children:f.jsx(G.ToggleButton,{"aria-label":l("poi_mode_move"),value:or.MOVE,children:f.jsx(gE,{fontSize:"small"})})}),f.jsx(G.Tooltip,{title:l("pois_mode_target"),children:f.jsx(G.ToggleButton,{"aria-label":l("pois_mode_target"),value:or.TARGET,children:f.jsx(mE,{fontSize:"small"})})})]})}),v=x?LF(s):null,C=rp(t,e),A=_=>{const O=s?.canvas;O&&(_.evt.preventDefault(),O.dispatchEvent(new WheelEvent(_.evt.type,_.evt)))};return f.jsxs(f.Fragment,{children:[v&&f.jsx(kt.Stage,{height:v.height,onWheel:A,style:{cursor:"crosshair",left:0,position:"absolute",top:0,zIndex:1e3},width:v.width,children:f.jsx(kt.Layer,{scaleX:v.scale,scaleY:v.scale,x:v.x,y:v.y,children:i.map(({point:_,poi:O})=>f.jsx(Rp,{handleDragEnd:R=>{const I=R.currentTarget;E(O,{x:I.x(),y:I.y()}).catch(()=>I.position(_))},handleDragStart:G1,onShapeClick:G1,shape:{...Ti,id:O.id,radius:C,x:_.x,y:_.y}},O.id))})}),g]})}Bg.defaultProps={canvasHeight:0,canvasId:null,canvasWidth:0,storageAdapter:null,viewer:null};Bg.propTypes={canvasHeight:d.number,canvasId:d.string,canvasWidth:d.number,isFormOpen:d.bool.isRequired,pois:d.arrayOf(d.shape({poi:d.object.isRequired,point:d.shape({x:d.number,y:d.number}).isRequired})).isRequired,receiveAnnotation:d.func.isRequired,storageAdapter:d.func,viewer:d.object};const uf=new WeakMap,BF=n=>{if(!n)return[];if(uf.has(n))return uf.get(n);const e=Object.values(n).flatMap(t=>t?.json?.items??[]).filter(t=>t["dbf:kind"]==="POI").map(t=>({poi:t,point:yx(t)})).filter(({point:t})=>t);return uf.set(n,e),e};function FF(n,{windowId:e}){const[t]=pe.getVisibleCanvases(n,{windowId:e}),{annotation:r={}}=n.config;return{canvasHeight:t?.getHeight?.()??0,canvasId:t?.id??null,canvasWidth:t?.getWidth?.()??0,isFormOpen:Object.keys(pe.getCompanionWindowsForContent(n,{content:"annotationCreation",windowId:e})).length>0,pois:t?BF(n.annotations[t.id]):[],storageAdapter:r.readonly===!0?null:r.adapter??null}}const GF={receiveAnnotation:pe.receiveAnnotation},x_={component:Bg,config:{translations:Fl},mapDispatchToProps:GF,mapStateToProps:FF,mode:"add",target:"OpenSeadragonViewer"},qF=(n,e)=>{console.error(`AiinotateAdapter.${n} error: `,e)},HF=async n=>{if(!n.ok)throw new Error(`Fetch error: response ${n.status} on url: ${n.url}`)};class VF{constructor(e,t,r,i){if(![2,3].includes(t))throw new Error(`AiiinotateAdapter: unrecognized value for 'iiifPresentationVersion'. expected one of [2,3], got '${t}'`);this.user=i||dl,this.canvasId=r,this.iiifPresentationVersion=t,this.endpointUrl=e,this.endpointUrlAnnotations=`${this.endpointUrl}/annotations/${t}`,this.endpointUrlManifests=`${this.endpointUrl}/manifests/${t}`}getStorageAdapterUser(){return this.user}get annotationPageId(){return`${this.endpointUrlAnnotations}/search?canvasUri=${this.canvasId}`}maybeConvert(e){return this.iiifPresentationVersion===2?yA(e):e}handleResponse=async(e,t)=>(await HF(t),this.all());handleError=(e,t)=>(qF(e,t),this.all());async create(e){return e=this.maybeConvert(e),fetch(`${this.endpointUrlAnnotations}/create`,{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async t=>await this.handleResponse("create",t)).catch(t=>this.handleError("create",t))}async update(e){return e=this.maybeConvert(e),fetch(`${this.endpointUrlAnnotations}/update`,{method:"POST",body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async t=>await this.handleResponse("update",t)).catch(t=>this.handleError("update",t))}async delete(e){return fetch(`${this.endpointUrlAnnotations}/delete?uri=${e}`,{method:"DELETE"}).then(async t=>await this.handleResponse("delete",t)).catch(t=>this.handleError("delete",t))}async get(e){return await fetch(e)}async all(){let e=[],t=this.annotationPageId,r,i;for(;t&&t.length;)r=await fetch(this.annotationPageId),i=await r.json(),e=[...e,...i.resources],t=i.next;const o=await this.iiifPresentationVersion===2?CA(e,this.annotationPageId):e;return o.items=o.items.map(fs),o}}const WF={AiiinotateAdapter:VF,LocalStorageAdapter:ox},zF=[sx,ux,i_,d_,f_,kF,x_];exports.annotationAdapters=WF;exports.annotationCreationCompanionWindowPlugin=d_;exports.canvasAnnotationsPlugin=i_;exports.convertIIIFAnnoToMaeData=fs;exports.default=zF;exports.externalStorageAnnotationPlugin=ux;exports.miradorAnnotationPlugin=sx;exports.poiMoveOnMapPlugin=x_;exports.templateKit=Ni;exports.windowSideBarButtonsPlugin=f_;
|
|
133
133
|
//# sourceMappingURL=mirador-annotation-editor.cjs.js.map
|