plutonium 0.19.13 → 0.20.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,36 +1,36 @@
1
- (()=>{var Bv=Object.create;var Ed=Object.defineProperty;var Uv=Object.getOwnPropertyDescriptor;var zv=Object.getOwnPropertyNames;var Hv=Object.getPrototypeOf,$v=Object.prototype.hasOwnProperty;var _e=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var qv=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of zv(e))!$v.call(i,s)&&s!==t&&Ed(i,s,{get:()=>e[s],enumerable:!(r=Uv(e,s))||r.enumerable});return i};var Ce=(i,e,t)=>(t=i!=null?Bv(Hv(i)):{},qv(e||!i||!i.__esModule?Ed(t,"default",{value:i,enumerable:!0}):t,i));var Ud=_e((bx,Bd)=>{var Lb="Expected a function",Dd=NaN,Mb="[object Symbol]",Ib=/^\s+|\s+$/g,Db=/^[-+]0x[0-9a-f]+$/i,Nb=/^0b[01]+$/i,Bb=/^0o[0-7]+$/i,Ub=parseInt,zb=typeof global=="object"&&global&&global.Object===Object&&global,Hb=typeof self=="object"&&self&&self.Object===Object&&self,$b=zb||Hb||Function("return this")(),qb=Object.prototype,Vb=qb.toString,jb=Math.max,Wb=Math.min,oc=function(){return $b.Date.now()};function Gb(i,e,t){var r,s,n,o,a,l,c=0,d=!1,f=!1,y=!0;if(typeof i!="function")throw new TypeError(Lb);e=Nd(e)||0,ac(t)&&(d=!!t.leading,f="maxWait"in t,n=f?jb(Nd(t.maxWait)||0,e):n,y="trailing"in t?!!t.trailing:y);function v(R){var G=r,K=s;return r=s=void 0,c=R,o=i.apply(K,G),o}function x(R){return c=R,a=setTimeout(I,e),d?v(R):o}function P(R){var G=R-l,K=R-c,Y=e-G;return f?Wb(Y,n-K):Y}function C(R){var G=R-l,K=R-c;return l===void 0||G>=e||G<0||f&&K>=n}function I(){var R=oc();if(C(R))return D(R);a=setTimeout(I,P(R))}function D(R){return a=void 0,y&&r?v(R):(r=s=void 0,o)}function q(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function M(){return a===void 0?o:D(oc())}function H(){var R=oc(),G=C(R);if(r=arguments,s=this,l=R,G){if(a===void 0)return x(l);if(f)return a=setTimeout(I,e),v(l)}return a===void 0&&(a=setTimeout(I,e)),o}return H.cancel=q,H.flush=M,H}function ac(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function Kb(i){return!!i&&typeof i=="object"}function Xb(i){return typeof i=="symbol"||Kb(i)&&Vb.call(i)==Mb}function Nd(i){if(typeof i=="number")return i;if(Xb(i))return Dd;if(ac(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=ac(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Ib,"");var t=Nb.test(i);return t||Bb.test(i)?Ub(i.slice(2),t?2:8):Db.test(i)?Dd:+i}Bd.exports=Gb});var Bp=_e((cC,Np)=>{Np.exports=function(){var e={},t=e._fns={};e.emit=function(o,a,l,c,d,f,y){var v=r(o);v.length&&s(o,v,[a,l,c,d,f,y])},e.on=function(o,a){t[o]||(t[o]=[]),t[o].push(a)},e.once=function(o,a){function l(){a.apply(this,arguments),e.off(o,l)}this.on(o,l)},e.off=function(o,a){var l=[];if(o&&a){var c=this._fns[o],d=0,f=c?c.length:0;for(d;d<f;d++)c[d]!==a&&l.push(c[d])}l.length?this._fns[o]=l:delete this._fns[o]};function r(n){var o=t[n]?t[n]:[],a=n.indexOf(":"),l=a===-1?[n]:[n.substring(0,a),n.substring(a+1)],c=Object.keys(t),d=0,f=c.length;for(d;d<f;d++){var y=c[d];if(y==="*"&&(o=o.concat(t[y])),l.length===2&&l[0]===y){o=o.concat(t[y]);break}}return o}function s(n,o,a){var l=0,c=o.length;for(l;l<c&&o[l];l++)o[l].event=n,o[l].apply(o[l],a)}return e}});var Sa=_e((hC,zp)=>{function C0(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}zp.exports=C0});var $p=_e((dC,Hp)=>{var F0=typeof global=="object"&&global&&global.Object===Object&&global;Hp.exports=F0});var Bc=_e((pC,qp)=>{var _0=$p(),O0=typeof self=="object"&&self&&self.Object===Object&&self,R0=_0||O0||Function("return this")();qp.exports=R0});var jp=_e((fC,Vp)=>{var L0=Bc(),M0=function(){return L0.Date.now()};Vp.exports=M0});var Gp=_e((mC,Wp)=>{var I0=/\s/;function D0(i){for(var e=i.length;e--&&I0.test(i.charAt(e)););return e}Wp.exports=D0});var Xp=_e((gC,Kp)=>{var N0=Gp(),B0=/^\s+/;function U0(i){return i&&i.slice(0,N0(i)+1).replace(B0,"")}Kp.exports=U0});var Uc=_e((vC,Yp)=>{var z0=Bc(),H0=z0.Symbol;Yp.exports=H0});var ef=_e((bC,Jp)=>{var Zp=Uc(),Qp=Object.prototype,$0=Qp.hasOwnProperty,q0=Qp.toString,Pn=Zp?Zp.toStringTag:void 0;function V0(i){var e=$0.call(i,Pn),t=i[Pn];try{i[Pn]=void 0;var r=!0}catch{}var s=q0.call(i);return r&&(e?i[Pn]=t:delete i[Pn]),s}Jp.exports=V0});var rf=_e((yC,tf)=>{var j0=Object.prototype,W0=j0.toString;function G0(i){return W0.call(i)}tf.exports=G0});var af=_e((wC,of)=>{var sf=Uc(),K0=ef(),X0=rf(),Y0="[object Null]",Z0="[object Undefined]",nf=sf?sf.toStringTag:void 0;function Q0(i){return i==null?i===void 0?Z0:Y0:nf&&nf in Object(i)?K0(i):X0(i)}of.exports=Q0});var cf=_e((SC,lf)=>{function J0(i){return i!=null&&typeof i=="object"}lf.exports=J0});var hf=_e((EC,uf)=>{var ew=af(),tw=cf(),iw="[object Symbol]";function rw(i){return typeof i=="symbol"||tw(i)&&ew(i)==iw}uf.exports=rw});var mf=_e((TC,ff)=>{var sw=Xp(),df=Sa(),nw=hf(),pf=NaN,ow=/^[-+]0x[0-9a-f]+$/i,aw=/^0b[01]+$/i,lw=/^0o[0-7]+$/i,cw=parseInt;function uw(i){if(typeof i=="number")return i;if(nw(i))return pf;if(df(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=df(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=sw(i);var t=aw.test(i);return t||lw.test(i)?cw(i.slice(2),t?2:8):ow.test(i)?pf:+i}ff.exports=uw});var Hc=_e((xC,vf)=>{var hw=Sa(),zc=jp(),gf=mf(),dw="Expected a function",pw=Math.max,fw=Math.min;function mw(i,e,t){var r,s,n,o,a,l,c=0,d=!1,f=!1,y=!0;if(typeof i!="function")throw new TypeError(dw);e=gf(e)||0,hw(t)&&(d=!!t.leading,f="maxWait"in t,n=f?pw(gf(t.maxWait)||0,e):n,y="trailing"in t?!!t.trailing:y);function v(R){var G=r,K=s;return r=s=void 0,c=R,o=i.apply(K,G),o}function x(R){return c=R,a=setTimeout(I,e),d?v(R):o}function P(R){var G=R-l,K=R-c,Y=e-G;return f?fw(Y,n-K):Y}function C(R){var G=R-l,K=R-c;return l===void 0||G>=e||G<0||f&&K>=n}function I(){var R=zc();if(C(R))return D(R);a=setTimeout(I,P(R))}function D(R){return a=void 0,y&&r?v(R):(r=s=void 0,o)}function q(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function M(){return a===void 0?o:D(zc())}function H(){var R=zc(),G=C(R);if(r=arguments,s=this,l=R,G){if(a===void 0)return x(l);if(f)return clearTimeout(a),a=setTimeout(I,e),v(l)}return a===void 0&&(a=setTimeout(I,e)),o}return H.cancel=q,H.flush=M,H}vf.exports=mw});var yf=_e((kC,bf)=>{var gw=Hc(),vw=Sa(),bw="Expected a function";function yw(i,e,t){var r=!0,s=!0;if(typeof i!="function")throw new TypeError(bw);return vw(t)&&(r="leading"in t?!!t.leading:r,s="trailing"in t?!!t.trailing:s),gw(i,e,{leading:r,maxWait:e,trailing:s})}bf.exports=yw});var ka=_e((UC,Af)=>{"use strict";Af.exports=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);let t=e<0,r=Math.abs(e);if(t&&(r=-r),r===0)return"0 B";let s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(r)/Math.log(1024)),s.length-1),o=Number(r/1024**n),a=s[n];return`${o>=10||o%1===0?Math.round(o):o.toFixed(1)} ${a}`}});var Ff=_e((zC,Cf)=>{"use strict";function Pf(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}Pf.prototype.match=function(i){var e=!0,t=this.parts,r,s=t.length,n;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)e=!1;else{for(n=(i||"").split(this.separator),r=0;e&&r<s;r++)t[r]!=="*"&&(r<n.length?e=t[r]===n[r]:e=!1);e=e&&n}else if(typeof i.splice=="function")for(e=[],r=i.length;r--;)this.match(i[r])&&(e[e.length]=i[r]);else if(typeof i=="object"){e={};for(var o in i)this.match(o)&&(e[o]=i[o])}return e};Cf.exports=function(i,e,t){var r=new Pf(i,t||/[\/\.]/);return typeof e<"u"?r.match(e):r}});var Of=_e((HC,_f)=>{var kw=Ff(),Aw=/[\/\+\.]/;_f.exports=function(i,e){function t(r){var s=kw(r,i,Aw);return s&&s.length>=2}return e?t(e.split(";")[0]):t}});var bt=_e((y2,Ia)=>{(function(){"use strict";var i={}.hasOwnProperty;function e(){for(var s="",n=0;n<arguments.length;n++){var o=arguments[n];o&&(s=r(s,t(o)))}return s}function t(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return e.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var n="";for(var o in s)i.call(s,o)&&s[o]&&(n=r(n,o));return n}function r(s,n){return n?s?s+" "+n:s+n:s}typeof Ia<"u"&&Ia.exports?(e.default=e,Ia.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var Qm=_e((p_,Gu)=>{"use strict";var eS=Object.prototype.hasOwnProperty,wt="~";function so(){}Object.create&&(so.prototype=Object.create(null),new so().__proto__||(wt=!1));function tS(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function Zm(i,e,t,r,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new tS(t,r||i,s),o=wt?wt+e:e;return i._events[o]?i._events[o].fn?i._events[o]=[i._events[o],n]:i._events[o].push(n):(i._events[o]=n,i._eventsCount++),i}function el(i,e){--i._eventsCount===0?i._events=new so:delete i._events[e]}function dt(){this._events=new so,this._eventsCount=0}dt.prototype.eventNames=function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)eS.call(t,r)&&e.push(wt?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};dt.prototype.listeners=function(e){var t=wt?wt+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,o=new Array(n);s<n;s++)o[s]=r[s].fn;return o};dt.prototype.listenerCount=function(e){var t=wt?wt+e:e,r=this._events[t];return r?r.fn?1:r.length:0};dt.prototype.emit=function(e,t,r,s,n,o){var a=wt?wt+e:e;if(!this._events[a])return!1;var l=this._events[a],c=arguments.length,d,f;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,s),!0;case 5:return l.fn.call(l.context,t,r,s,n),!0;case 6:return l.fn.call(l.context,t,r,s,n,o),!0}for(f=1,d=new Array(c-1);f<c;f++)d[f-1]=arguments[f];l.fn.apply(l.context,d)}else{var y=l.length,v;for(f=0;f<y;f++)switch(l[f].once&&this.removeListener(e,l[f].fn,void 0,!0),c){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,t);break;case 3:l[f].fn.call(l[f].context,t,r);break;case 4:l[f].fn.call(l[f].context,t,r,s);break;default:if(!d)for(v=1,d=new Array(c-1);v<c;v++)d[v-1]=arguments[v];l[f].fn.apply(l[f].context,d)}}return!0};dt.prototype.on=function(e,t,r){return Zm(this,e,t,r,!1)};dt.prototype.once=function(e,t,r){return Zm(this,e,t,r,!0)};dt.prototype.removeListener=function(e,t,r,s){var n=wt?wt+e:e;if(!this._events[n])return this;if(!t)return el(this,n),this;var o=this._events[n];if(o.fn)o.fn===t&&(!s||o.once)&&(!r||o.context===r)&&el(this,n);else{for(var a=0,l=[],c=o.length;a<c;a++)(o[a].fn!==t||s&&!o[a].once||r&&o[a].context!==r)&&l.push(o[a]);l.length?this._events[n]=l.length===1?l[0]:l:el(this,n)}return this};dt.prototype.removeAllListeners=function(e){var t;return e?(t=wt?wt+e:e,this._events[t]&&el(this,t)):(this._events=new so,this._eventsCount=0),this};dt.prototype.off=dt.prototype.removeListener;dt.prototype.addListener=dt.prototype.on;dt.prefixed=wt;dt.EventEmitter=dt;typeof Gu<"u"&&(Gu.exports=dt)});var Bg=_e((xh,kh)=>{(function(i,e){typeof xh=="object"&&typeof kh<"u"?kh.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Cropper=e())})(xh,function(){"use strict";function i(g,h){var m=Object.keys(g);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(g);h&&(p=p.filter(function(E){return Object.getOwnPropertyDescriptor(g,E).enumerable})),m.push.apply(m,p)}return m}function e(g){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?i(Object(m),!0).forEach(function(p){l(g,p,m[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(m)):i(Object(m)).forEach(function(p){Object.defineProperty(g,p,Object.getOwnPropertyDescriptor(m,p))})}return g}function t(g,h){if(typeof g!="object"||!g)return g;var m=g[Symbol.toPrimitive];if(m!==void 0){var p=m.call(g,h||"default");if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(g)}function r(g){var h=t(g,"string");return typeof h=="symbol"?h:h+""}function s(g){"@babel/helpers - typeof";return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},s(g)}function n(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function o(g,h){for(var m=0;m<h.length;m++){var p=h[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(g,r(p.key),p)}}function a(g,h,m){return h&&o(g.prototype,h),m&&o(g,m),Object.defineProperty(g,"prototype",{writable:!1}),g}function l(g,h,m){return h=r(h),h in g?Object.defineProperty(g,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):g[h]=m,g}function c(g){return d(g)||f(g)||y(g)||x()}function d(g){if(Array.isArray(g))return v(g)}function f(g){if(typeof Symbol<"u"&&g[Symbol.iterator]!=null||g["@@iterator"]!=null)return Array.from(g)}function y(g,h){if(g){if(typeof g=="string")return v(g,h);var m=Object.prototype.toString.call(g).slice(8,-1);if(m==="Object"&&g.constructor&&(m=g.constructor.name),m==="Map"||m==="Set")return Array.from(g);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return v(g,h)}}function v(g,h){(h==null||h>g.length)&&(h=g.length);for(var m=0,p=new Array(h);m<h;m++)p[m]=g[m];return p}function x(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var P=typeof window<"u"&&typeof window.document<"u",C=P?window:{},I=P&&C.document.documentElement?"ontouchstart"in C.document.documentElement:!1,D=P?"PointerEvent"in C:!1,q="cropper",M="all",H="crop",R="move",G="zoom",K="e",Y="w",ie="s",Q="n",oe="ne",le="nw",ke="se",We="sw",T="".concat(q,"-crop"),k="".concat(q,"-disabled"),A="".concat(q,"-hidden"),$="".concat(q,"-hide"),j="".concat(q,"-invisible"),z="".concat(q,"-modal"),J="".concat(q,"-move"),ee="".concat(q,"Action"),Ae="".concat(q,"Preview"),ne="crop",ce="move",Me="none",Ne="crop",He="cropend",fi="cropmove",mi="cropstart",Yt="dblclick",er=I?"touchstart":"mousedown",Zt=I?"touchmove":"mousemove",br=I?"touchend touchcancel":"mouseup",Ai=D?"pointerdown":er,Ut=D?"pointermove":Zt,Pi=D?"pointerup pointercancel":br,Ci="ready",Ct="resize",gi="wheel",tr="zoom",Fi="image/jpeg",Qt=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Jt=/^data:/,ei=/^data:image\/jpeg;base64,/,yr=/^img|canvas$/i,ir=200,en=100,fs={viewMode:0,dragMode:ne,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:ir,minContainerHeight:en,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Lo='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',ms=Number.isNaN||C.isNaN;function se(g){return typeof g=="number"&&!ms(g)}var zt=function(h){return h>0&&h<1/0};function vi(g){return typeof g>"u"}function ti(g){return s(g)==="object"&&g!==null}var tn=Object.prototype.hasOwnProperty;function rr(g){if(!ti(g))return!1;try{var h=g.constructor,m=h.prototype;return h&&m&&tn.call(m,"isPrototypeOf")}catch{return!1}}function Ge(g){return typeof g=="function"}var gs=Array.prototype.slice;function Mo(g){return Array.from?Array.from(g):gs.call(g)}function ye(g,h){return g&&Ge(h)&&(Array.isArray(g)||se(g.length)?Mo(g).forEach(function(m,p){h.call(g,m,p,g)}):ti(g)&&Object.keys(g).forEach(function(m){h.call(g,g[m],m,g)})),g}var we=Object.assign||function(h){for(var m=arguments.length,p=new Array(m>1?m-1:0),E=1;E<m;E++)p[E-1]=arguments[E];return ti(h)&&p.length>0&&p.forEach(function(b){ti(b)&&Object.keys(b).forEach(function(S){h[S]=b[S]})}),h},Ol=/\.\d*(?:0|9){12}\d*$/;function Te(g){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Ol.test(g)?Math.round(g*h)/h:g}var sr=/^width|height|left|top|marginLeft|marginTop$/;function bi(g,h){var m=g.style;ye(h,function(p,E){sr.test(E)&&se(p)&&(p="".concat(p,"px")),m[E]=p})}function Io(g,h){return g.classList?g.classList.contains(h):g.className.indexOf(h)>-1}function Ie(g,h){if(h){if(se(g.length)){ye(g,function(p){Ie(p,h)});return}if(g.classList){g.classList.add(h);return}var m=g.className.trim();m?m.indexOf(h)<0&&(g.className="".concat(m," ").concat(h)):g.className=h}}function Ft(g,h){if(h){if(se(g.length)){ye(g,function(m){Ft(m,h)});return}if(g.classList){g.classList.remove(h);return}g.className.indexOf(h)>=0&&(g.className=g.className.replace(h,""))}}function _i(g,h,m){if(h){if(se(g.length)){ye(g,function(p){_i(p,h,m)});return}m?Ie(g,h):Ft(g,h)}}var Rl=/([a-z\d])([A-Z])/g;function xt(g){return g.replace(Rl,"$1-$2").toLowerCase()}function nr(g,h){return ti(g[h])?g[h]:g.dataset?g.dataset[h]:g.getAttribute("data-".concat(xt(h)))}function or(g,h,m){ti(m)?g[h]=m:g.dataset?g.dataset[h]=m:g.setAttribute("data-".concat(xt(h)),m)}function Do(g,h){if(ti(g[h]))try{delete g[h]}catch{g[h]=void 0}else if(g.dataset)try{delete g.dataset[h]}catch{g.dataset[h]=void 0}else g.removeAttribute("data-".concat(xt(h)))}var rn=/\s\s*/,sn=function(){var g=!1;if(P){var h=!1,m=function(){},p=Object.defineProperty({},"once",{get:function(){return g=!0,h},set:function(b){h=b}});C.addEventListener("test",m,p),C.removeEventListener("test",m,p)}return g}();function Be(g,h,m){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},E=m;h.trim().split(rn).forEach(function(b){if(!sn){var S=g.listeners;S&&S[b]&&S[b][m]&&(E=S[b][m],delete S[b][m],Object.keys(S[b]).length===0&&delete S[b],Object.keys(S).length===0&&delete g.listeners)}g.removeEventListener(b,E,p)})}function pt(g,h,m){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},E=m;h.trim().split(rn).forEach(function(b){if(p.once&&!sn){var S=g.listeners,F=S===void 0?{}:S;E=function(){delete F[b][m],g.removeEventListener(b,E,p);for(var L=arguments.length,_=new Array(L),O=0;O<L;O++)_[O]=arguments[O];m.apply(g,_)},F[b]||(F[b]={}),F[b][m]&&g.removeEventListener(b,F[b][m],p),F[b][m]=E,g.listeners=F}g.addEventListener(b,E,p)})}function Oi(g,h,m){var p;return Ge(Event)&&Ge(CustomEvent)?p=new CustomEvent(h,{detail:m,bubbles:!0,cancelable:!0}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(h,!0,!0,m)),g.dispatchEvent(p)}function nn(g){var h=g.getBoundingClientRect();return{left:h.left+(window.pageXOffset-document.documentElement.clientLeft),top:h.top+(window.pageYOffset-document.documentElement.clientTop)}}var vs=C.location,Ll=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Z(g){var h=g.match(Ll);return h!==null&&(h[1]!==vs.protocol||h[2]!==vs.hostname||h[3]!==vs.port)}function w(g){var h="timestamp=".concat(new Date().getTime());return g+(g.indexOf("?")===-1?"?":"&")+h}function B(g){var h=g.rotate,m=g.scaleX,p=g.scaleY,E=g.translateX,b=g.translateY,S=[];se(E)&&E!==0&&S.push("translateX(".concat(E,"px)")),se(b)&&b!==0&&S.push("translateY(".concat(b,"px)")),se(h)&&h!==0&&S.push("rotate(".concat(h,"deg)")),se(m)&&m!==1&&S.push("scaleX(".concat(m,")")),se(p)&&p!==1&&S.push("scaleY(".concat(p,")"));var F=S.length?S.join(" "):"none";return{WebkitTransform:F,msTransform:F,transform:F}}function X(g){var h=e({},g),m=0;return ye(g,function(p,E){delete h[E],ye(h,function(b){var S=Math.abs(p.startX-b.startX),F=Math.abs(p.startY-b.startY),U=Math.abs(p.endX-b.endX),L=Math.abs(p.endY-b.endY),_=Math.sqrt(S*S+F*F),O=Math.sqrt(U*U+L*L),N=(O-_)/_;Math.abs(N)>Math.abs(m)&&(m=N)})}),m}function ve(g,h){var m=g.pageX,p=g.pageY,E={endX:m,endY:p};return h?E:e({startX:m,startY:p},E)}function Qe(g){var h=0,m=0,p=0;return ye(g,function(E){var b=E.startX,S=E.startY;h+=b,m+=S,p+=1}),h/=p,m/=p,{pageX:h,pageY:m}}function Se(g){var h=g.aspectRatio,m=g.height,p=g.width,E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",b=zt(p),S=zt(m);if(b&&S){var F=m*h;E==="contain"&&F>p||E==="cover"&&F<p?m=p/h:p=m*h}else b?m=p/h:S&&(p=m*h);return{width:p,height:m}}function ut(g){var h=g.width,m=g.height,p=g.degree;if(p=Math.abs(p)%180,p===90)return{width:m,height:h};var E=p%90*Math.PI/180,b=Math.sin(E),S=Math.cos(E),F=h*S+m*b,U=h*b+m*S;return p>90?{width:U,height:F}:{width:F,height:U}}function Ht(g,h,m,p){var E=h.aspectRatio,b=h.naturalWidth,S=h.naturalHeight,F=h.rotate,U=F===void 0?0:F,L=h.scaleX,_=L===void 0?1:L,O=h.scaleY,N=O===void 0?1:O,he=m.aspectRatio,ue=m.naturalWidth,Pe=m.naturalHeight,pe=p.fillColor,Ke=pe===void 0?"transparent":pe,Je=p.imageSmoothingEnabled,$e=Je===void 0?!0:Je,Ri=p.imageSmoothingQuality,_t=Ri===void 0?"low":Ri,V=p.maxWidth,fe=V===void 0?1/0:V,Xe=p.maxHeight,$t=Xe===void 0?1/0:Xe,Li=p.minWidth,wr=Li===void 0?0:Li,Sr=p.minHeight,lr=Sr===void 0?0:Sr,yi=document.createElement("canvas"),kt=yi.getContext("2d"),Er=Se({aspectRatio:he,width:fe,height:$t}),Uo=Se({aspectRatio:he,width:wr,height:lr},"cover"),Ml=Math.min(Er.width,Math.max(Uo.width,ue)),Il=Math.min(Er.height,Math.max(Uo.height,Pe)),bd=Se({aspectRatio:E,width:fe,height:$t}),yd=Se({aspectRatio:E,width:wr,height:lr},"cover"),wd=Math.min(bd.width,Math.max(yd.width,b)),Sd=Math.min(bd.height,Math.max(yd.height,S)),Dv=[-wd/2,-Sd/2,wd,Sd];return yi.width=Te(Ml),yi.height=Te(Il),kt.fillStyle=Ke,kt.fillRect(0,0,Ml,Il),kt.save(),kt.translate(Ml/2,Il/2),kt.rotate(U*Math.PI/180),kt.scale(_,N),kt.imageSmoothingEnabled=$e,kt.imageSmoothingQuality=_t,kt.drawImage.apply(kt,[g].concat(c(Dv.map(function(Nv){return Math.floor(Te(Nv))})))),kt.restore(),yi}var ar=String.fromCharCode;function st(g,h,m){var p="";m+=h;for(var E=h;E<m;E+=1)p+=ar(g.getUint8(E));return p}var No=/^data:.*,/;function Bo(g){var h=g.replace(No,""),m=atob(h),p=new ArrayBuffer(m.length),E=new Uint8Array(p);return ye(E,function(b,S){E[S]=m.charCodeAt(S)}),p}function Av(g,h){for(var m=[],p=8192,E=new Uint8Array(g);E.length>0;)m.push(ar.apply(null,Mo(E.subarray(0,p)))),E=E.subarray(p);return"data:".concat(h,";base64,").concat(btoa(m.join("")))}function Pv(g){var h=new DataView(g),m;try{var p,E,b;if(h.getUint8(0)===255&&h.getUint8(1)===216)for(var S=h.byteLength,F=2;F+1<S;){if(h.getUint8(F)===255&&h.getUint8(F+1)===225){E=F;break}F+=1}if(E){var U=E+4,L=E+10;if(st(h,U,4)==="Exif"){var _=h.getUint16(L);if(p=_===18761,(p||_===19789)&&h.getUint16(L+2,p)===42){var O=h.getUint32(L+4,p);O>=8&&(b=L+O)}}}if(b){var N=h.getUint16(b,p),he,ue;for(ue=0;ue<N;ue+=1)if(he=b+ue*12+2,h.getUint16(he,p)===274){he+=8,m=h.getUint16(he,p),h.setUint16(he,1,p);break}}}catch{m=1}return m}function Cv(g){var h=0,m=1,p=1;switch(g){case 2:m=-1;break;case 3:h=-180;break;case 4:p=-1;break;case 5:h=90,p=-1;break;case 6:h=90;break;case 7:h=90,m=-1;break;case 8:h=-90;break}return{rotate:h,scaleX:m,scaleY:p}}var Fv={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var h=this.element,m=this.options,p=this.container,E=this.cropper,b=Number(m.minContainerWidth),S=Number(m.minContainerHeight);Ie(E,A),Ft(h,A);var F={width:Math.max(p.offsetWidth,b>=0?b:ir),height:Math.max(p.offsetHeight,S>=0?S:en)};this.containerData=F,bi(E,{width:F.width,height:F.height}),Ie(h,A),Ft(E,A)},initCanvas:function(){var h=this.containerData,m=this.imageData,p=this.options.viewMode,E=Math.abs(m.rotate)%180===90,b=E?m.naturalHeight:m.naturalWidth,S=E?m.naturalWidth:m.naturalHeight,F=b/S,U=h.width,L=h.height;h.height*F>h.width?p===3?U=h.height*F:L=h.width/F:p===3?L=h.width/F:U=h.height*F;var _={aspectRatio:F,naturalWidth:b,naturalHeight:S,width:U,height:L};this.canvasData=_,this.limited=p===1||p===2,this.limitCanvas(!0,!0),_.width=Math.min(Math.max(_.width,_.minWidth),_.maxWidth),_.height=Math.min(Math.max(_.height,_.minHeight),_.maxHeight),_.left=(h.width-_.width)/2,_.top=(h.height-_.height)/2,_.oldLeft=_.left,_.oldTop=_.top,this.initialCanvasData=we({},_)},limitCanvas:function(h,m){var p=this.options,E=this.containerData,b=this.canvasData,S=this.cropBoxData,F=p.viewMode,U=b.aspectRatio,L=this.cropped&&S;if(h){var _=Number(p.minCanvasWidth)||0,O=Number(p.minCanvasHeight)||0;F>1?(_=Math.max(_,E.width),O=Math.max(O,E.height),F===3&&(O*U>_?_=O*U:O=_/U)):F>0&&(_?_=Math.max(_,L?S.width:0):O?O=Math.max(O,L?S.height:0):L&&(_=S.width,O=S.height,O*U>_?_=O*U:O=_/U));var N=Se({aspectRatio:U,width:_,height:O});_=N.width,O=N.height,b.minWidth=_,b.minHeight=O,b.maxWidth=1/0,b.maxHeight=1/0}if(m)if(F>(L?0:1)){var he=E.width-b.width,ue=E.height-b.height;b.minLeft=Math.min(0,he),b.minTop=Math.min(0,ue),b.maxLeft=Math.max(0,he),b.maxTop=Math.max(0,ue),L&&this.limited&&(b.minLeft=Math.min(S.left,S.left+(S.width-b.width)),b.minTop=Math.min(S.top,S.top+(S.height-b.height)),b.maxLeft=S.left,b.maxTop=S.top,F===2&&(b.width>=E.width&&(b.minLeft=Math.min(0,he),b.maxLeft=Math.max(0,he)),b.height>=E.height&&(b.minTop=Math.min(0,ue),b.maxTop=Math.max(0,ue))))}else b.minLeft=-b.width,b.minTop=-b.height,b.maxLeft=E.width,b.maxTop=E.height},renderCanvas:function(h,m){var p=this.canvasData,E=this.imageData;if(m){var b=ut({width:E.naturalWidth*Math.abs(E.scaleX||1),height:E.naturalHeight*Math.abs(E.scaleY||1),degree:E.rotate||0}),S=b.width,F=b.height,U=p.width*(S/p.naturalWidth),L=p.height*(F/p.naturalHeight);p.left-=(U-p.width)/2,p.top-=(L-p.height)/2,p.width=U,p.height=L,p.aspectRatio=S/F,p.naturalWidth=S,p.naturalHeight=F,this.limitCanvas(!0,!1)}(p.width>p.maxWidth||p.width<p.minWidth)&&(p.left=p.oldLeft),(p.height>p.maxHeight||p.height<p.minHeight)&&(p.top=p.oldTop),p.width=Math.min(Math.max(p.width,p.minWidth),p.maxWidth),p.height=Math.min(Math.max(p.height,p.minHeight),p.maxHeight),this.limitCanvas(!1,!0),p.left=Math.min(Math.max(p.left,p.minLeft),p.maxLeft),p.top=Math.min(Math.max(p.top,p.minTop),p.maxTop),p.oldLeft=p.left,p.oldTop=p.top,bi(this.canvas,we({width:p.width,height:p.height},B({translateX:p.left,translateY:p.top}))),this.renderImage(h),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(h){var m=this.canvasData,p=this.imageData,E=p.naturalWidth*(m.width/m.naturalWidth),b=p.naturalHeight*(m.height/m.naturalHeight);we(p,{width:E,height:b,left:(m.width-E)/2,top:(m.height-b)/2}),bi(this.image,we({width:p.width,height:p.height},B(we({translateX:p.left,translateY:p.top},p)))),h&&this.output()},initCropBox:function(){var h=this.options,m=this.canvasData,p=h.aspectRatio||h.initialAspectRatio,E=Number(h.autoCropArea)||.8,b={width:m.width,height:m.height};p&&(m.height*p>m.width?b.height=b.width/p:b.width=b.height*p),this.cropBoxData=b,this.limitCropBox(!0,!0),b.width=Math.min(Math.max(b.width,b.minWidth),b.maxWidth),b.height=Math.min(Math.max(b.height,b.minHeight),b.maxHeight),b.width=Math.max(b.minWidth,b.width*E),b.height=Math.max(b.minHeight,b.height*E),b.left=m.left+(m.width-b.width)/2,b.top=m.top+(m.height-b.height)/2,b.oldLeft=b.left,b.oldTop=b.top,this.initialCropBoxData=we({},b)},limitCropBox:function(h,m){var p=this.options,E=this.containerData,b=this.canvasData,S=this.cropBoxData,F=this.limited,U=p.aspectRatio;if(h){var L=Number(p.minCropBoxWidth)||0,_=Number(p.minCropBoxHeight)||0,O=F?Math.min(E.width,b.width,b.width+b.left,E.width-b.left):E.width,N=F?Math.min(E.height,b.height,b.height+b.top,E.height-b.top):E.height;L=Math.min(L,E.width),_=Math.min(_,E.height),U&&(L&&_?_*U>L?_=L/U:L=_*U:L?_=L/U:_&&(L=_*U),N*U>O?N=O/U:O=N*U),S.minWidth=Math.min(L,O),S.minHeight=Math.min(_,N),S.maxWidth=O,S.maxHeight=N}m&&(F?(S.minLeft=Math.max(0,b.left),S.minTop=Math.max(0,b.top),S.maxLeft=Math.min(E.width,b.left+b.width)-S.width,S.maxTop=Math.min(E.height,b.top+b.height)-S.height):(S.minLeft=0,S.minTop=0,S.maxLeft=E.width-S.width,S.maxTop=E.height-S.height))},renderCropBox:function(){var h=this.options,m=this.containerData,p=this.cropBoxData;(p.width>p.maxWidth||p.width<p.minWidth)&&(p.left=p.oldLeft),(p.height>p.maxHeight||p.height<p.minHeight)&&(p.top=p.oldTop),p.width=Math.min(Math.max(p.width,p.minWidth),p.maxWidth),p.height=Math.min(Math.max(p.height,p.minHeight),p.maxHeight),this.limitCropBox(!1,!0),p.left=Math.min(Math.max(p.left,p.minLeft),p.maxLeft),p.top=Math.min(Math.max(p.top,p.minTop),p.maxTop),p.oldLeft=p.left,p.oldTop=p.top,h.movable&&h.cropBoxMovable&&or(this.face,ee,p.width>=m.width&&p.height>=m.height?R:M),bi(this.cropBox,we({width:p.width,height:p.height},B({translateX:p.left,translateY:p.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Oi(this.element,Ne,this.getData())}},_v={initPreview:function(){var h=this.element,m=this.crossOrigin,p=this.options.preview,E=m?this.crossOriginUrl:this.url,b=h.alt||"The image to preview",S=document.createElement("img");if(m&&(S.crossOrigin=m),S.src=E,S.alt=b,this.viewBox.appendChild(S),this.viewBoxImage=S,!!p){var F=p;typeof p=="string"?F=h.ownerDocument.querySelectorAll(p):p.querySelector&&(F=[p]),this.previews=F,ye(F,function(U){var L=document.createElement("img");or(U,Ae,{width:U.offsetWidth,height:U.offsetHeight,html:U.innerHTML}),m&&(L.crossOrigin=m),L.src=E,L.alt=b,L.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',U.innerHTML="",U.appendChild(L)})}},resetPreview:function(){ye(this.previews,function(h){var m=nr(h,Ae);bi(h,{width:m.width,height:m.height}),h.innerHTML=m.html,Do(h,Ae)})},preview:function(){var h=this.imageData,m=this.canvasData,p=this.cropBoxData,E=p.width,b=p.height,S=h.width,F=h.height,U=p.left-m.left-h.left,L=p.top-m.top-h.top;!this.cropped||this.disabled||(bi(this.viewBoxImage,we({width:S,height:F},B(we({translateX:-U,translateY:-L},h)))),ye(this.previews,function(_){var O=nr(_,Ae),N=O.width,he=O.height,ue=N,Pe=he,pe=1;E&&(pe=N/E,Pe=b*pe),b&&Pe>he&&(pe=he/b,ue=E*pe,Pe=he),bi(_,{width:ue,height:Pe}),bi(_.getElementsByTagName("img")[0],we({width:S*pe,height:F*pe},B(we({translateX:-U*pe,translateY:-L*pe},h))))}))}},Ov={bind:function(){var h=this.element,m=this.options,p=this.cropper;Ge(m.cropstart)&&pt(h,mi,m.cropstart),Ge(m.cropmove)&&pt(h,fi,m.cropmove),Ge(m.cropend)&&pt(h,He,m.cropend),Ge(m.crop)&&pt(h,Ne,m.crop),Ge(m.zoom)&&pt(h,tr,m.zoom),pt(p,Ai,this.onCropStart=this.cropStart.bind(this)),m.zoomable&&m.zoomOnWheel&&pt(p,gi,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),m.toggleDragModeOnDblclick&&pt(p,Yt,this.onDblclick=this.dblclick.bind(this)),pt(h.ownerDocument,Ut,this.onCropMove=this.cropMove.bind(this)),pt(h.ownerDocument,Pi,this.onCropEnd=this.cropEnd.bind(this)),m.responsive&&pt(window,Ct,this.onResize=this.resize.bind(this))},unbind:function(){var h=this.element,m=this.options,p=this.cropper;Ge(m.cropstart)&&Be(h,mi,m.cropstart),Ge(m.cropmove)&&Be(h,fi,m.cropmove),Ge(m.cropend)&&Be(h,He,m.cropend),Ge(m.crop)&&Be(h,Ne,m.crop),Ge(m.zoom)&&Be(h,tr,m.zoom),Be(p,Ai,this.onCropStart),m.zoomable&&m.zoomOnWheel&&Be(p,gi,this.onWheel,{passive:!1,capture:!0}),m.toggleDragModeOnDblclick&&Be(p,Yt,this.onDblclick),Be(h.ownerDocument,Ut,this.onCropMove),Be(h.ownerDocument,Pi,this.onCropEnd),m.responsive&&Be(window,Ct,this.onResize)}},Rv={resize:function(){if(!this.disabled){var h=this.options,m=this.container,p=this.containerData,E=m.offsetWidth/p.width,b=m.offsetHeight/p.height,S=Math.abs(E-1)>Math.abs(b-1)?E:b;if(S!==1){var F,U;h.restore&&(F=this.getCanvasData(),U=this.getCropBoxData()),this.render(),h.restore&&(this.setCanvasData(ye(F,function(L,_){F[_]=L*S})),this.setCropBoxData(ye(U,function(L,_){U[_]=L*S})))}}},dblclick:function(){this.disabled||this.options.dragMode===Me||this.setDragMode(Io(this.dragBox,T)?ce:ne)},wheel:function(h){var m=this,p=Number(this.options.wheelZoomRatio)||.1,E=1;this.disabled||(h.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){m.wheeling=!1},50),h.deltaY?E=h.deltaY>0?1:-1:h.wheelDelta?E=-h.wheelDelta/120:h.detail&&(E=h.detail>0?1:-1),this.zoom(-E*p,h)))},cropStart:function(h){var m=h.buttons,p=h.button;if(!(this.disabled||(h.type==="mousedown"||h.type==="pointerdown"&&h.pointerType==="mouse")&&(se(m)&&m!==1||se(p)&&p!==0||h.ctrlKey))){var E=this.options,b=this.pointers,S;h.changedTouches?ye(h.changedTouches,function(F){b[F.identifier]=ve(F)}):b[h.pointerId||0]=ve(h),Object.keys(b).length>1&&E.zoomable&&E.zoomOnTouch?S=G:S=nr(h.target,ee),Qt.test(S)&&Oi(this.element,mi,{originalEvent:h,action:S})!==!1&&(h.preventDefault(),this.action=S,this.cropping=!1,S===H&&(this.cropping=!0,Ie(this.dragBox,z)))}},cropMove:function(h){var m=this.action;if(!(this.disabled||!m)){var p=this.pointers;h.preventDefault(),Oi(this.element,fi,{originalEvent:h,action:m})!==!1&&(h.changedTouches?ye(h.changedTouches,function(E){we(p[E.identifier]||{},ve(E,!0))}):we(p[h.pointerId||0]||{},ve(h,!0)),this.change(h))}},cropEnd:function(h){if(!this.disabled){var m=this.action,p=this.pointers;h.changedTouches?ye(h.changedTouches,function(E){delete p[E.identifier]}):delete p[h.pointerId||0],m&&(h.preventDefault(),Object.keys(p).length||(this.action=""),this.cropping&&(this.cropping=!1,_i(this.dragBox,z,this.cropped&&this.options.modal)),Oi(this.element,He,{originalEvent:h,action:m}))}}},Lv={change:function(h){var m=this.options,p=this.canvasData,E=this.containerData,b=this.cropBoxData,S=this.pointers,F=this.action,U=m.aspectRatio,L=b.left,_=b.top,O=b.width,N=b.height,he=L+O,ue=_+N,Pe=0,pe=0,Ke=E.width,Je=E.height,$e=!0,Ri;!U&&h.shiftKey&&(U=O&&N?O/N:1),this.limited&&(Pe=b.minLeft,pe=b.minTop,Ke=Pe+Math.min(E.width,p.width,p.left+p.width),Je=pe+Math.min(E.height,p.height,p.top+p.height));var _t=S[Object.keys(S)[0]],V={x:_t.endX-_t.startX,y:_t.endY-_t.startY},fe=function($t){switch($t){case K:he+V.x>Ke&&(V.x=Ke-he);break;case Y:L+V.x<Pe&&(V.x=Pe-L);break;case Q:_+V.y<pe&&(V.y=pe-_);break;case ie:ue+V.y>Je&&(V.y=Je-ue);break}};switch(F){case M:L+=V.x,_+=V.y;break;case K:if(V.x>=0&&(he>=Ke||U&&(_<=pe||ue>=Je))){$e=!1;break}fe(K),O+=V.x,O<0&&(F=Y,O=-O,L-=O),U&&(N=O/U,_+=(b.height-N)/2);break;case Q:if(V.y<=0&&(_<=pe||U&&(L<=Pe||he>=Ke))){$e=!1;break}fe(Q),N-=V.y,_+=V.y,N<0&&(F=ie,N=-N,_-=N),U&&(O=N*U,L+=(b.width-O)/2);break;case Y:if(V.x<=0&&(L<=Pe||U&&(_<=pe||ue>=Je))){$e=!1;break}fe(Y),O-=V.x,L+=V.x,O<0&&(F=K,O=-O,L-=O),U&&(N=O/U,_+=(b.height-N)/2);break;case ie:if(V.y>=0&&(ue>=Je||U&&(L<=Pe||he>=Ke))){$e=!1;break}fe(ie),N+=V.y,N<0&&(F=Q,N=-N,_-=N),U&&(O=N*U,L+=(b.width-O)/2);break;case oe:if(U){if(V.y<=0&&(_<=pe||he>=Ke)){$e=!1;break}fe(Q),N-=V.y,_+=V.y,O=N*U}else fe(Q),fe(K),V.x>=0?he<Ke?O+=V.x:V.y<=0&&_<=pe&&($e=!1):O+=V.x,V.y<=0?_>pe&&(N-=V.y,_+=V.y):(N-=V.y,_+=V.y);O<0&&N<0?(F=We,N=-N,O=-O,_-=N,L-=O):O<0?(F=le,O=-O,L-=O):N<0&&(F=ke,N=-N,_-=N);break;case le:if(U){if(V.y<=0&&(_<=pe||L<=Pe)){$e=!1;break}fe(Q),N-=V.y,_+=V.y,O=N*U,L+=b.width-O}else fe(Q),fe(Y),V.x<=0?L>Pe?(O-=V.x,L+=V.x):V.y<=0&&_<=pe&&($e=!1):(O-=V.x,L+=V.x),V.y<=0?_>pe&&(N-=V.y,_+=V.y):(N-=V.y,_+=V.y);O<0&&N<0?(F=ke,N=-N,O=-O,_-=N,L-=O):O<0?(F=oe,O=-O,L-=O):N<0&&(F=We,N=-N,_-=N);break;case We:if(U){if(V.x<=0&&(L<=Pe||ue>=Je)){$e=!1;break}fe(Y),O-=V.x,L+=V.x,N=O/U}else fe(ie),fe(Y),V.x<=0?L>Pe?(O-=V.x,L+=V.x):V.y>=0&&ue>=Je&&($e=!1):(O-=V.x,L+=V.x),V.y>=0?ue<Je&&(N+=V.y):N+=V.y;O<0&&N<0?(F=oe,N=-N,O=-O,_-=N,L-=O):O<0?(F=ke,O=-O,L-=O):N<0&&(F=le,N=-N,_-=N);break;case ke:if(U){if(V.x>=0&&(he>=Ke||ue>=Je)){$e=!1;break}fe(K),O+=V.x,N=O/U}else fe(ie),fe(K),V.x>=0?he<Ke?O+=V.x:V.y>=0&&ue>=Je&&($e=!1):O+=V.x,V.y>=0?ue<Je&&(N+=V.y):N+=V.y;O<0&&N<0?(F=le,N=-N,O=-O,_-=N,L-=O):O<0?(F=We,O=-O,L-=O):N<0&&(F=oe,N=-N,_-=N);break;case R:this.move(V.x,V.y),$e=!1;break;case G:this.zoom(X(S),h),$e=!1;break;case H:if(!V.x||!V.y){$e=!1;break}Ri=nn(this.cropper),L=_t.startX-Ri.left,_=_t.startY-Ri.top,O=b.minWidth,N=b.minHeight,V.x>0?F=V.y>0?ke:oe:V.x<0&&(L-=O,F=V.y>0?We:le),V.y<0&&(_-=N),this.cropped||(Ft(this.cropBox,A),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}$e&&(b.width=O,b.height=N,b.left=L,b.top=_,this.action=F,this.renderCropBox()),ye(S,function(Xe){Xe.startX=Xe.endX,Xe.startY=Xe.endY})}},Mv={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Ie(this.dragBox,z),Ft(this.cropBox,A),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=we({},this.initialImageData),this.canvasData=we({},this.initialCanvasData),this.cropBoxData=we({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(we(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Ft(this.dragBox,z),Ie(this.cropBox,A)),this},replace:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&h&&(this.isImg&&(this.element.src=h),m?(this.url=h,this.image.src=h,this.ready&&(this.viewBoxImage.src=h,ye(this.previews,function(p){p.getElementsByTagName("img")[0].src=h}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(h))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Ft(this.cropper,k)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Ie(this.cropper,k)),this},destroy:function(){var h=this.element;return h[q]?(h[q]=void 0,this.isImg&&this.replaced&&(h.src=this.originalUrl),this.uncreate(),this):this},move:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,p=this.canvasData,E=p.left,b=p.top;return this.moveTo(vi(h)?h:E+Number(h),vi(m)?m:b+Number(m))},moveTo:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,p=this.canvasData,E=!1;return h=Number(h),m=Number(m),this.ready&&!this.disabled&&this.options.movable&&(se(h)&&(p.left=h,E=!0),se(m)&&(p.top=m,E=!0),E&&this.renderCanvas(!0)),this},zoom:function(h,m){var p=this.canvasData;return h=Number(h),h<0?h=1/(1-h):h=1+h,this.zoomTo(p.width*h/p.naturalWidth,null,m)},zoomTo:function(h,m,p){var E=this.options,b=this.canvasData,S=b.width,F=b.height,U=b.naturalWidth,L=b.naturalHeight;if(h=Number(h),h>=0&&this.ready&&!this.disabled&&E.zoomable){var _=U*h,O=L*h;if(Oi(this.element,tr,{ratio:h,oldRatio:S/U,originalEvent:p})===!1)return this;if(p){var N=this.pointers,he=nn(this.cropper),ue=N&&Object.keys(N).length?Qe(N):{pageX:p.pageX,pageY:p.pageY};b.left-=(_-S)*((ue.pageX-he.left-b.left)/S),b.top-=(O-F)*((ue.pageY-he.top-b.top)/F)}else rr(m)&&se(m.x)&&se(m.y)?(b.left-=(_-S)*((m.x-b.left)/S),b.top-=(O-F)*((m.y-b.top)/F)):(b.left-=(_-S)/2,b.top-=(O-F)/2);b.width=_,b.height=O,this.renderCanvas(!0)}return this},rotate:function(h){return this.rotateTo((this.imageData.rotate||0)+Number(h))},rotateTo:function(h){return h=Number(h),se(h)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=h%360,this.renderCanvas(!0,!0)),this},scaleX:function(h){var m=this.imageData.scaleY;return this.scale(h,se(m)?m:1)},scaleY:function(h){var m=this.imageData.scaleX;return this.scale(se(m)?m:1,h)},scale:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,p=this.imageData,E=!1;return h=Number(h),m=Number(m),this.ready&&!this.disabled&&this.options.scalable&&(se(h)&&(p.scaleX=h,E=!0),se(m)&&(p.scaleY=m,E=!0),E&&this.renderCanvas(!0,!0)),this},getData:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,m=this.options,p=this.imageData,E=this.canvasData,b=this.cropBoxData,S;if(this.ready&&this.cropped){S={x:b.left-E.left,y:b.top-E.top,width:b.width,height:b.height};var F=p.width/p.naturalWidth;if(ye(S,function(_,O){S[O]=_/F}),h){var U=Math.round(S.y+S.height),L=Math.round(S.x+S.width);S.x=Math.round(S.x),S.y=Math.round(S.y),S.width=L-S.x,S.height=U-S.y}}else S={x:0,y:0,width:0,height:0};return m.rotatable&&(S.rotate=p.rotate||0),m.scalable&&(S.scaleX=p.scaleX||1,S.scaleY=p.scaleY||1),S},setData:function(h){var m=this.options,p=this.imageData,E=this.canvasData,b={};if(this.ready&&!this.disabled&&rr(h)){var S=!1;m.rotatable&&se(h.rotate)&&h.rotate!==p.rotate&&(p.rotate=h.rotate,S=!0),m.scalable&&(se(h.scaleX)&&h.scaleX!==p.scaleX&&(p.scaleX=h.scaleX,S=!0),se(h.scaleY)&&h.scaleY!==p.scaleY&&(p.scaleY=h.scaleY,S=!0)),S&&this.renderCanvas(!0,!0);var F=p.width/p.naturalWidth;se(h.x)&&(b.left=h.x*F+E.left),se(h.y)&&(b.top=h.y*F+E.top),se(h.width)&&(b.width=h.width*F),se(h.height)&&(b.height=h.height*F),this.setCropBoxData(b)}return this},getContainerData:function(){return this.ready?we({},this.containerData):{}},getImageData:function(){return this.sized?we({},this.imageData):{}},getCanvasData:function(){var h=this.canvasData,m={};return this.ready&&ye(["left","top","width","height","naturalWidth","naturalHeight"],function(p){m[p]=h[p]}),m},setCanvasData:function(h){var m=this.canvasData,p=m.aspectRatio;return this.ready&&!this.disabled&&rr(h)&&(se(h.left)&&(m.left=h.left),se(h.top)&&(m.top=h.top),se(h.width)?(m.width=h.width,m.height=h.width/p):se(h.height)&&(m.height=h.height,m.width=h.height*p),this.renderCanvas(!0)),this},getCropBoxData:function(){var h=this.cropBoxData,m;return this.ready&&this.cropped&&(m={left:h.left,top:h.top,width:h.width,height:h.height}),m||{}},setCropBoxData:function(h){var m=this.cropBoxData,p=this.options.aspectRatio,E,b;return this.ready&&this.cropped&&!this.disabled&&rr(h)&&(se(h.left)&&(m.left=h.left),se(h.top)&&(m.top=h.top),se(h.width)&&h.width!==m.width&&(E=!0,m.width=h.width),se(h.height)&&h.height!==m.height&&(b=!0,m.height=h.height),p&&(E?m.height=m.width/p:b&&(m.width=m.height*p)),this.renderCropBox()),this},getCroppedCanvas:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var m=this.canvasData,p=Ht(this.image,this.imageData,m,h);if(!this.cropped)return p;var E=this.getData(h.rounded),b=E.x,S=E.y,F=E.width,U=E.height,L=p.width/Math.floor(m.naturalWidth);L!==1&&(b*=L,S*=L,F*=L,U*=L);var _=F/U,O=Se({aspectRatio:_,width:h.maxWidth||1/0,height:h.maxHeight||1/0}),N=Se({aspectRatio:_,width:h.minWidth||0,height:h.minHeight||0},"cover"),he=Se({aspectRatio:_,width:h.width||(L!==1?p.width:F),height:h.height||(L!==1?p.height:U)}),ue=he.width,Pe=he.height;ue=Math.min(O.width,Math.max(N.width,ue)),Pe=Math.min(O.height,Math.max(N.height,Pe));var pe=document.createElement("canvas"),Ke=pe.getContext("2d");pe.width=Te(ue),pe.height=Te(Pe),Ke.fillStyle=h.fillColor||"transparent",Ke.fillRect(0,0,ue,Pe);var Je=h.imageSmoothingEnabled,$e=Je===void 0?!0:Je,Ri=h.imageSmoothingQuality;Ke.imageSmoothingEnabled=$e,Ri&&(Ke.imageSmoothingQuality=Ri);var _t=p.width,V=p.height,fe=b,Xe=S,$t,Li,wr,Sr,lr,yi;fe<=-F||fe>_t?(fe=0,$t=0,wr=0,lr=0):fe<=0?(wr=-fe,fe=0,$t=Math.min(_t,F+fe),lr=$t):fe<=_t&&(wr=0,$t=Math.min(F,_t-fe),lr=$t),$t<=0||Xe<=-U||Xe>V?(Xe=0,Li=0,Sr=0,yi=0):Xe<=0?(Sr=-Xe,Xe=0,Li=Math.min(V,U+Xe),yi=Li):Xe<=V&&(Sr=0,Li=Math.min(U,V-Xe),yi=Li);var kt=[fe,Xe,$t,Li];if(lr>0&&yi>0){var Er=ue/F;kt.push(wr*Er,Sr*Er,lr*Er,yi*Er)}return Ke.drawImage.apply(Ke,[p].concat(c(kt.map(function(Uo){return Math.floor(Te(Uo))})))),pe},setAspectRatio:function(h){var m=this.options;return!this.disabled&&!vi(h)&&(m.aspectRatio=Math.max(0,h)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(h){var m=this.options,p=this.dragBox,E=this.face;if(this.ready&&!this.disabled){var b=h===ne,S=m.movable&&h===ce;h=b||S?h:Me,m.dragMode=h,or(p,ee,h),_i(p,T,b),_i(p,J,S),m.cropBoxMovable||(or(E,ee,h),_i(E,T,b),_i(E,J,S))}return this}},Iv=C.Cropper,vd=function(){function g(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n(this,g),!h||!yr.test(h.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=h,this.options=we({},fs,rr(m)&&m),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return a(g,[{key:"init",value:function(){var m=this.element,p=m.tagName.toLowerCase(),E;if(!m[q]){if(m[q]=this,p==="img"){if(this.isImg=!0,E=m.getAttribute("src")||"",this.originalUrl=E,!E)return;E=m.src}else p==="canvas"&&window.HTMLCanvasElement&&(E=m.toDataURL());this.load(E)}}},{key:"load",value:function(m){var p=this;if(m){this.url=m,this.imageData={};var E=this.element,b=this.options;if(!b.rotatable&&!b.scalable&&(b.checkOrientation=!1),!b.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Jt.test(m)){ei.test(m)?this.read(Bo(m)):this.clone();return}var S=new XMLHttpRequest,F=this.clone.bind(this);this.reloading=!0,this.xhr=S,S.onabort=F,S.onerror=F,S.ontimeout=F,S.onprogress=function(){S.getResponseHeader("content-type")!==Fi&&S.abort()},S.onload=function(){p.read(S.response)},S.onloadend=function(){p.reloading=!1,p.xhr=null},b.checkCrossOrigin&&Z(m)&&E.crossOrigin&&(m=w(m)),S.open("GET",m,!0),S.responseType="arraybuffer",S.withCredentials=E.crossOrigin==="use-credentials",S.send()}}},{key:"read",value:function(m){var p=this.options,E=this.imageData,b=Pv(m),S=0,F=1,U=1;if(b>1){this.url=Av(m,Fi);var L=Cv(b);S=L.rotate,F=L.scaleX,U=L.scaleY}p.rotatable&&(E.rotate=S),p.scalable&&(E.scaleX=F,E.scaleY=U),this.clone()}},{key:"clone",value:function(){var m=this.element,p=this.url,E=m.crossOrigin,b=p;this.options.checkCrossOrigin&&Z(p)&&(E||(E="anonymous"),b=w(p)),this.crossOrigin=E,this.crossOriginUrl=b;var S=document.createElement("img");E&&(S.crossOrigin=E),S.src=b||p,S.alt=m.alt||"The image to crop",this.image=S,S.onload=this.start.bind(this),S.onerror=this.stop.bind(this),Ie(S,$),m.parentNode.insertBefore(S,m.nextSibling)}},{key:"start",value:function(){var m=this,p=this.image;p.onload=null,p.onerror=null,this.sizing=!0;var E=C.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(C.navigator.userAgent),b=function(L,_){we(m.imageData,{naturalWidth:L,naturalHeight:_,aspectRatio:L/_}),m.initialImageData=we({},m.imageData),m.sizing=!1,m.sized=!0,m.build()};if(p.naturalWidth&&!E){b(p.naturalWidth,p.naturalHeight);return}var S=document.createElement("img"),F=document.body||document.documentElement;this.sizingImage=S,S.onload=function(){b(S.width,S.height),E||F.removeChild(S)},S.src=p.src,E||(S.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",F.appendChild(S))}},{key:"stop",value:function(){var m=this.image;m.onload=null,m.onerror=null,m.parentNode.removeChild(m),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var m=this.element,p=this.options,E=this.image,b=m.parentNode,S=document.createElement("div");S.innerHTML=Lo;var F=S.querySelector(".".concat(q,"-container")),U=F.querySelector(".".concat(q,"-canvas")),L=F.querySelector(".".concat(q,"-drag-box")),_=F.querySelector(".".concat(q,"-crop-box")),O=_.querySelector(".".concat(q,"-face"));this.container=b,this.cropper=F,this.canvas=U,this.dragBox=L,this.cropBox=_,this.viewBox=F.querySelector(".".concat(q,"-view-box")),this.face=O,U.appendChild(E),Ie(m,A),b.insertBefore(F,m.nextSibling),Ft(E,$),this.initPreview(),this.bind(),p.initialAspectRatio=Math.max(0,p.initialAspectRatio)||NaN,p.aspectRatio=Math.max(0,p.aspectRatio)||NaN,p.viewMode=Math.max(0,Math.min(3,Math.round(p.viewMode)))||0,Ie(_,A),p.guides||Ie(_.getElementsByClassName("".concat(q,"-dashed")),A),p.center||Ie(_.getElementsByClassName("".concat(q,"-center")),A),p.background&&Ie(F,"".concat(q,"-bg")),p.highlight||Ie(O,j),p.cropBoxMovable&&(Ie(O,J),or(O,ee,M)),p.cropBoxResizable||(Ie(_.getElementsByClassName("".concat(q,"-line")),A),Ie(_.getElementsByClassName("".concat(q,"-point")),A)),this.render(),this.ready=!0,this.setDragMode(p.dragMode),p.autoCrop&&this.crop(),this.setData(p.data),Ge(p.ready)&&pt(m,Ci,p.ready,{once:!0}),Oi(m,Ci)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var m=this.cropper.parentNode;m&&m.removeChild(this.cropper),Ft(this.element,A)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Iv,g}},{key:"setDefaults",value:function(m){we(fs,rr(m)&&m)}}])}();return we(vd.prototype,Fv,_v,Ov,Rv,Lv,Mv),vd})});var Dl=class{constructor(e,t,r){this.eventTarget=e,this.eventName=t,this.eventOptions=r,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){let t=Vv(e);for(let r of this.bindings){if(t.immediatePropagationStopped)break;r.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let r=e.index,s=t.index;return r<s?-1:r>s?1:0})}};function Vv(i){if("immediatePropagationStopped"in i)return i;{let{stopImmediatePropagation:e}=i;return Object.assign(i,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var Nl=class{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,r={}){this.application.handleError(e,`Error ${t}`,r)}clearEventListenersForBinding(e){let t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:t,eventName:r,eventOptions:s}=e,n=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(r,s);n.delete(o),n.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:r,eventOptions:s}=e;return this.fetchEventListener(t,r,s)}fetchEventListener(e,t,r){let s=this.fetchEventListenerMapForEventTarget(e),n=this.cacheKey(t,r),o=s.get(n);return o||(o=this.createEventListener(e,t,r),s.set(n,o)),o}createEventListener(e,t,r){let s=new Dl(e,t,r);return this.started&&s.connect(),s}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let r=[e];return Object.keys(t).sort().forEach(s=>{r.push(`${t[s]?"":"!"}${s}`)}),r.join(":")}},jv={stop({event:i,value:e}){return e&&i.stopPropagation(),!0},prevent({event:i,value:e}){return e&&i.preventDefault(),!0},self({event:i,value:e,element:t}){return e?t===i.target:!0}},Wv=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function Gv(i){let t=i.trim().match(Wv)||[],r=t[2],s=t[3];return s&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${s}`,s=""),{eventTarget:Kv(t[4]),eventName:r,eventOptions:t[7]?Xv(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||s}}function Kv(i){if(i=="window")return window;if(i=="document")return document}function Xv(i){return i.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function Yv(i){if(i==window)return"window";if(i==document)return"document"}function nc(i){return i.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function Bl(i){return nc(i.replace(/--/g,"-").replace(/__/g,"_"))}function an(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Rd(i){return i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function Zv(i){return i.match(/[^\s]+/g)||[]}function Td(i){return i!=null}function Ul(i,e){return Object.prototype.hasOwnProperty.call(i,e)}var xd=["meta","ctrl","alt","shift"],zl=class{constructor(e,t,r,s){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||Qv(e)||zo("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||zo("missing identifier"),this.methodName=r.methodName||zo("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=s}static forToken(e,t){return new this(e.element,e.index,Gv(e.content),t)}toString(){let e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;let t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;let r=t.filter(s=>!xd.includes(s))[0];return r?(Ul(this.keyMappings,r)||zo(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[r].toLowerCase()!==e.key.toLowerCase()):!1}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;let t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){let e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(let{name:r,value:s}of Array.from(this.element.attributes)){let n=r.match(t),o=n&&n[1];o&&(e[nc(o)]=Jv(s))}return e}get eventTargetName(){return Yv(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[r,s,n,o]=xd.map(a=>t.includes(a));return e.metaKey!==r||e.ctrlKey!==s||e.altKey!==n||e.shiftKey!==o}},kd={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:i=>i.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function Qv(i){let e=i.tagName.toLowerCase();if(e in kd)return kd[e](i)}function zo(i){throw new Error(i)}function Jv(i){try{return JSON.parse(i)}catch{return i}}var Hl=class{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){let t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){let{element:t}=this.action,{actionDescriptorFilters:r}=this.context.application,{controller:s}=this.context,n=!0;for(let[o,a]of Object.entries(this.eventOptions))if(o in r){let l=r[o];n=n&&l({name:o,value:a,event:e,element:t,controller:s})}else continue;return n}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){let{target:t,currentTarget:r}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:r,action:this.methodName})}catch(s){let{identifier:n,controller:o,element:a,index:l}=this,c={identifier:n,controller:o,element:a,index:l,event:e};this.context.handleError(s,`invoking action "${this.action}"`,c)}}willBeInvokedByEvent(e){let t=e.target;return e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e)||e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e)?!1:this.element===t?!0:t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}},Ho=class{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.processTree(r,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.elementIsActive(r)&&this.processTree(r,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let r of this.matchElementsInTree(e))t.call(this,r)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1:this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}},$o=class{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new Ho(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){let t=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(this.selector));return t.concat(r)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}};function eb(i,e,t){Ld(i,e).add(t)}function tb(i,e,t){Ld(i,e).delete(t),ib(i,e)}function Ld(i,e){let t=i.get(e);return t||(t=new Set,i.set(e,t)),t}function ib(i,e){let t=i.get(e);t!=null&&t.size==0&&i.delete(e)}var Mi=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t.concat(Array.from(r)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t+r.size,0)}add(e,t){eb(this.valuesByKey,e,t)}delete(e,t){tb(this.valuesByKey,e,t)}has(e,t){let r=this.valuesByKey.get(e);return r!=null&&r.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(r=>r.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,r])=>r.has(e)).map(([t,r])=>t)}};var $l=class{constructor(e,t,r,s){this._selector=t,this.details=s,this.elementObserver=new Ho(e,this),this.delegate=r,this.matchesByElement=new Mi}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){let{selector:t}=this;if(t){let r=e.matches(t);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(e,this.details):r}else return!1}matchElementsInTree(e){let{selector:t}=this;if(t){let r=this.matchElement(e)?[e]:[],s=Array.from(e.querySelectorAll(t)).filter(n=>this.matchElement(n));return r.concat(s)}else return[]}elementMatched(e){let{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){let t=this.matchesByElement.getKeysForValue(e);for(let r of t)this.selectorUnmatched(e,r)}elementAttributeChanged(e,t){let{selector:r}=this;if(r){let s=this.matchElement(e),n=this.matchesByElement.has(r,e);s&&!n?this.selectorMatched(e,r):!s&&n&&this.selectorUnmatched(e,r)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}},ql=class{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){let t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){let r=this.delegate.getStringMapKeyForAttribute(e);if(r!=null){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);let s=this.element.getAttribute(e);if(this.stringMap.get(e)!=s&&this.stringMapValueChanged(s,r,t),s==null){let n=this.stringMap.get(e);this.stringMap.delete(e),n&&this.stringMapKeyRemoved(r,e,n)}else this.stringMap.set(e,s)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,r)}stringMapKeyRemoved(e,t,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,r)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}},qo=class{constructor(e,t,r){this.attributeObserver=new $o(e,t,this),this.delegate=r,this.tokensByElement=new Mi}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){let[t,r]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(r)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(t=>this.tokenMatched(t))}tokensUnmatched(e){e.forEach(t=>this.tokenUnmatched(t))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){let t=this.tokensByElement.getValuesForKey(e),r=this.readTokensForElement(e),s=sb(t,r).findIndex(([n,o])=>!nb(n,o));return s==-1?[[],[]]:[t.slice(s),r.slice(s)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return rb(r,e,t)}};function rb(i,e,t){return i.trim().split(/\s+/).filter(r=>r.length).map((r,s)=>({element:e,attributeName:t,content:r,index:s}))}function sb(i,e){let t=Math.max(i.length,e.length);return Array.from({length:t},(r,s)=>[i[s],e[s]])}function nb(i,e){return i&&e&&i.index==e.index&&i.content==e.content}var Vo=class{constructor(e,t,r){this.tokenListObserver=new qo(e,t,this),this.delegate=r,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).set(e,r),this.delegate.elementMatchedValue(t,r))}tokenUnmatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,r))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(t){return{error:t}}}},Vl=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new Vo(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){let t=new Hl(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){let t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e,!0)),this.bindingsByAction.clear()}parseValueForToken(e){let t=zl.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},jl=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new ql(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){let r=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,r.writer(this.receiver[e]),r.writer(r.defaultValue))}stringMapValueChanged(e,t,r){let s=this.valueDescriptorNameMap[t];e!==null&&(r===null&&(r=s.writer(s.defaultValue)),this.invokeChangedCallback(t,e,r))}stringMapKeyRemoved(e,t,r){let s=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,s.writer(this.receiver[e]),r):this.invokeChangedCallback(e,s.writer(s.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:r,writer:s}of this.valueDescriptors)r!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,s(r),void 0)}invokeChangedCallback(e,t,r){let s=`${e}Changed`,n=this.receiver[s];if(typeof n=="function"){let o=this.valueDescriptorNameMap[e];try{let a=o.reader(t),l=r;r&&(l=o.reader(r)),n.call(this.receiver,a,l)}catch(a){throw a instanceof TypeError&&(a.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${a.message}`),a}}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{let r=this.valueDescriptorMap[t];e[r.name]=r}),e}hasValue(e){let t=this.valueDescriptorNameMap[e],r=`has${an(t.name)}`;return this.receiver[r]}},Wl=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new Mi}start(){this.tokenListObserver||(this.tokenListObserver=new qo(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var r;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var r;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}};function ln(i,e){let t=Md(i);return Array.from(t.reduce((r,s)=>(ab(s,e).forEach(n=>r.add(n)),r),new Set))}function ob(i,e){return Md(i).reduce((r,s)=>(r.push(...lb(s,e)),r),[])}function Md(i){let e=[];for(;i;)e.push(i),i=Object.getPrototypeOf(i);return e.reverse()}function ab(i,e){let t=i[e];return Array.isArray(t)?t:[]}function lb(i,e){let t=i[e];return t?Object.keys(t).map(r=>[r,t[r]]):[]}var Gl=class{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new Mi,this.outletElementsByName=new Mi,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)}),this.started=!0,this.dependentContexts.forEach(e=>e.refresh()))}refresh(){this.selectorObserverMap.forEach(e=>e.refresh()),this.attributeObserverMap.forEach(e=>e.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(e=>e.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(e=>e.stop()),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:r}){let s=this.getOutlet(e,r);s&&this.connectOutlet(s,e,r)}selectorUnmatched(e,t,{outletName:r}){let s=this.getOutletFromMap(e,r);s&&this.disconnectOutlet(s,e,r)}selectorMatchElement(e,{outletName:t}){let r=this.selector(t),s=this.hasOutlet(e,t),n=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return r?s&&n&&e.matches(r):!1}elementMatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementAttributeValueChanged(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementUnmatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}connectOutlet(e,t,r){var s;this.outletElementsByName.has(r,t)||(this.outletsByName.add(r,e),this.outletElementsByName.add(r,t),(s=this.selectorObserverMap.get(r))===null||s===void 0||s.pause(()=>this.delegate.outletConnected(e,t,r)))}disconnectOutlet(e,t,r){var s;this.outletElementsByName.has(r,t)&&(this.outletsByName.delete(r,e),this.outletElementsByName.delete(r,t),(s=this.selectorObserverMap.get(r))===null||s===void 0||s.pause(()=>this.delegate.outletDisconnected(e,t,r)))}disconnectAllOutlets(){for(let e of this.outletElementsByName.keys)for(let t of this.outletElementsByName.getValuesForKey(e))for(let r of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(r,t,e)}updateSelectorObserverForOutlet(e){let t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){let t=this.selector(e),r=new $l(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r),r.start()}setupAttributeObserverForOutlet(e){let t=this.attributeNameForOutletName(e),r=new $o(this.scope.element,t,this);this.attributeObserverMap.set(e,r),r.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find(t=>this.attributeNameForOutletName(t)===e)}get outletDependencies(){let e=new Mi;return this.router.modules.forEach(t=>{let r=t.definition.controllerConstructor;ln(r,"outlets").forEach(n=>e.add(n,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let e=this.dependentControllerIdentifiers;return this.router.contexts.filter(t=>e.includes(t.identifier))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find(r=>r.element===e)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}},Kl=class{constructor(e,t){this.logDebugActivity=(r,s={})=>{let{identifier:n,controller:o,element:a}=this;s=Object.assign({identifier:n,controller:o,element:a},s),this.application.logDebugActivity(this.identifier,r,s)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new Vl(this,this.dispatcher),this.valueObserver=new jl(this,this.controller),this.targetObserver=new Wl(this,this),this.outletObserver=new Gl(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(r){this.handleError(r,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,r={}){let{identifier:s,controller:n,element:o}=this;r=Object.assign({identifier:s,controller:n,element:o},r),this.application.handleError(e,`Error ${t}`,r)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,r){this.invokeControllerMethod(`${Bl(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${Bl(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let r=this.controller;typeof r[e]=="function"&&r[e](...t)}};function cb(i){return ub(i,hb(i))}function ub(i,e){let t=mb(i),r=db(i.prototype,e);return Object.defineProperties(t.prototype,r),t}function hb(i){return ln(i,"blessings").reduce((t,r)=>{let s=r(i);for(let n in s){let o=t[n]||{};t[n]=Object.assign(o,s[n])}return t},{})}function db(i,e){return fb(e).reduce((t,r)=>{let s=pb(i,e,r);return s&&Object.assign(t,{[r]:s}),t},{})}function pb(i,e,t){let r=Object.getOwnPropertyDescriptor(i,t);if(!(r&&"value"in r)){let n=Object.getOwnPropertyDescriptor(e,t).value;return r&&(n.get=r.get||n.get,n.set=r.set||n.set),n}}var fb=typeof Object.getOwnPropertySymbols=="function"?i=>[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)]:Object.getOwnPropertyNames,mb=(()=>{function i(t){function r(){return Reflect.construct(t,arguments,new.target)}return r.prototype=Object.create(t.prototype,{constructor:{value:r}}),Reflect.setPrototypeOf(r,t),r}function e(){let r=i(function(){this.a.call(this)});return r.prototype.a=function(){},new r}try{return e(),i}catch{return r=>class extends r{}}})();function gb(i){return{identifier:i.identifier,controllerConstructor:cb(i.controllerConstructor)}}var Xl=class{constructor(e,t){this.application=e,this.definition=gb(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new Kl(this,e),this.contextsByScope.set(e,t)),t}},Yl=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){let t=this.data.get(this.getDataKey(e))||"";return Zv(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Zl=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){let r=this.getAttributeNameForKey(e);return this.element.setAttribute(r,t),this.get(e)}has(e){let t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){let t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${Rd(e)}`}},Ql=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,r){let s=this.warnedKeysByObject.get(e);s||(s=new Set,this.warnedKeysByObject.set(e,s)),s.has(t)||(s.add(t),this.logger.warn(r,e))}};function Jl(i,e){return`[${i}~="${e}"]`}var ec=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findTarget(r)||this.findLegacyTarget(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllTargets(r),...this.findAllLegacyTargets(r)],[])}findTarget(e){let t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){let t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){let t=this.schema.targetAttributeForScope(this.identifier);return Jl(t,e)}findLegacyTarget(e){let t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){let t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(r=>this.deprecate(r,e))}getLegacySelectorForTargetName(e){let t=`${this.identifier}.${e}`;return Jl(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:r}=this,s=this.schema.targetAttribute,n=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${s}="${r}.${t}" with ${n}="${t}". The ${s} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},tc=class{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findOutlet(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllOutlets(r)],[])}getSelectorForOutletName(e){let t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){let t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){let t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter(s=>this.matchesElement(s,e,t))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter(s=>this.matchesElement(s,e,t))}matchesElement(e,t,r){let s=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&s.split(" ").includes(r)}},ic=class i{constructor(e,t,r,s){this.targets=new ec(this),this.classes=new Yl(this),this.data=new Zl(this),this.containsElement=n=>n.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new Ql(s),this.outlets=new tc(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return Jl(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new i(this.schema,document.documentElement,this.identifier,this.guide.logger)}},rc=class{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new Vo(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){let{element:t,content:r}=e;return this.parseValueForElementAndIdentifier(t,r)}parseValueForElementAndIdentifier(e,t){let r=this.fetchScopesByIdentifierForElement(e),s=r.get(t);return s||(s=this.delegate.createScopeForElementAndIdentifier(e,t),r.set(t,s)),s}elementMatchedValue(e,t){let r=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,r),r==1&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){let r=this.scopeReferenceCounts.get(t);r&&(this.scopeReferenceCounts.set(t,r-1),r==1&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}},sc=class{constructor(e){this.application=e,this.scopeObserver=new rc(this.element,this.schema,this),this.scopesByIdentifier=new Mi,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);let t=new Xl(this.application,e);this.connectModule(t);let r=e.controllerConstructor.afterLoad;r&&r.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){let r=this.modulesByIdentifier.get(t);if(r)return r.contexts.find(s=>s.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){let r=this.scopeObserver.parseValueForElementAndIdentifier(e,t);r?this.scopeObserver.elementMatchedValue(r.element,r):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new ic(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.connectContextForScope(r))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.disconnectContextForScope(r))}},vb={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:i=>`data-${i}-target`,outletAttributeForScope:(i,e)=>`data-${i}-${e}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},Ad("abcdefghijklmnopqrstuvwxyz".split("").map(i=>[i,i]))),Ad("0123456789".split("").map(i=>[i,i])))};function Ad(i){return i.reduce((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r}),{})}var jo=class{constructor(e=document.documentElement,t=vb){this.logger=console,this.debug=!1,this.logDebugActivity=(r,s,n={})=>{this.debug&&this.logFormattedMessage(r,s,n)},this.element=e,this.schema=t,this.dispatcher=new Nl(this),this.router=new sc(this),this.actionDescriptorFilters=Object.assign({},jv)}static start(e,t){let r=new this(e,t);return r.start(),r}async start(){await bb(),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(s=>{s.controllerConstructor.shouldLoad&&this.router.loadDefinition(s)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(s=>this.router.unloadIdentifier(s))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){let r=this.router.getContextForElementAndIdentifier(e,t);return r?r.controller:null}handleError(e,t,r){var s;this.logger.error(`%s
1
+ (()=>{var Qv=Object.create;var Fd=Object.defineProperty;var Jv=Object.getOwnPropertyDescriptor;var eb=Object.getOwnPropertyNames;var tb=Object.getPrototypeOf,ib=Object.prototype.hasOwnProperty;var _e=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var rb=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of eb(e))!ib.call(i,s)&&s!==t&&Fd(i,s,{get:()=>e[s],enumerable:!(r=Jv(e,s))||r.enumerable});return i};var Ce=(i,e,t)=>(t=i!=null?Qv(tb(i)):{},rb(e||!i||!i.__esModule?Fd(t,"default",{value:i,enumerable:!0}):t,i));var Wd=_e((Ux,jd)=>{var Gb="Expected a function",qd=NaN,Kb="[object Symbol]",Xb=/^\s+|\s+$/g,Yb=/^[-+]0x[0-9a-f]+$/i,Zb=/^0b[01]+$/i,Qb=/^0o[0-7]+$/i,Jb=parseInt,ey=typeof global=="object"&&global&&global.Object===Object&&global,ty=typeof self=="object"&&self&&self.Object===Object&&self,iy=ey||ty||Function("return this")(),ry=Object.prototype,sy=ry.toString,ny=Math.max,oy=Math.min,ac=function(){return iy.Date.now()};function ay(i,e,t){var r,s,n,o,a,l,c=0,d=!1,p=!1,y=!0;if(typeof i!="function")throw new TypeError(Gb);e=Vd(e)||0,lc(t)&&(d=!!t.leading,p="maxWait"in t,n=p?ny(Vd(t.maxWait)||0,e):n,y="trailing"in t?!!t.trailing:y);function v(L){var j=r,K=s;return r=s=void 0,c=L,o=i.apply(K,j),o}function x(L){return c=L,a=setTimeout(R,e),d?v(L):o}function P(L){var j=L-l,K=L-c,Z=e-j;return p?oy(Z,n-K):Z}function F(L){var j=L-l,K=L-c;return l===void 0||j>=e||j<0||p&&K>=n}function R(){var L=ac();if(F(L))return D(L);a=setTimeout(R,P(L))}function D(L){return a=void 0,y&&r?v(L):(r=s=void 0,o)}function q(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function I(){return a===void 0?o:D(ac())}function z(){var L=ac(),j=F(L);if(r=arguments,s=this,l=L,j){if(a===void 0)return x(l);if(p)return a=setTimeout(R,e),v(l)}return a===void 0&&(a=setTimeout(R,e)),o}return z.cancel=q,z.flush=I,z}function lc(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function ly(i){return!!i&&typeof i=="object"}function cy(i){return typeof i=="symbol"||ly(i)&&sy.call(i)==Kb}function Vd(i){if(typeof i=="number")return i;if(cy(i))return qd;if(lc(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=lc(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Xb,"");var t=Zb.test(i);return t||Qb.test(i)?Jb(i.slice(2),t?2:8):Yb.test(i)?qd:+i}jd.exports=ay});var Gp=_e((_C,Wp)=>{Wp.exports=function(){var e={},t=e._fns={};e.emit=function(o,a,l,c,d,p,y){var v=r(o);v.length&&s(o,v,[a,l,c,d,p,y])},e.on=function(o,a){t[o]||(t[o]=[]),t[o].push(a)},e.once=function(o,a){function l(){a.apply(this,arguments),e.off(o,l)}this.on(o,l)},e.off=function(o,a){var l=[];if(o&&a){var c=this._fns[o],d=0,p=c?c.length:0;for(d;d<p;d++)c[d]!==a&&l.push(c[d])}l.length?this._fns[o]=l:delete this._fns[o]};function r(n){var o=t[n]?t[n]:[],a=n.indexOf(":"),l=a===-1?[n]:[n.substring(0,a),n.substring(a+1)],c=Object.keys(t),d=0,p=c.length;for(d;d<p;d++){var y=c[d];if(y==="*"&&(o=o.concat(t[y])),l.length===2&&l[0]===y){o=o.concat(t[y]);break}}return o}function s(n,o,a){var l=0,c=o.length;for(l;l<c&&o[l];l++)o[l].event=n,o[l].apply(o[l],a)}return e}});var Ta=_e((RC,Kp)=>{function Y0(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}Kp.exports=Y0});var Yp=_e((LC,Xp)=>{var Z0=typeof global=="object"&&global&&global.Object===Object&&global;Xp.exports=Z0});var zc=_e((MC,Zp)=>{var Q0=Yp(),J0=typeof self=="object"&&self&&self.Object===Object&&self,ew=Q0||J0||Function("return this")();Zp.exports=ew});var Jp=_e((IC,Qp)=>{var tw=zc(),iw=function(){return tw.Date.now()};Qp.exports=iw});var tf=_e((DC,ef)=>{var rw=/\s/;function sw(i){for(var e=i.length;e--&&rw.test(i.charAt(e)););return e}ef.exports=sw});var sf=_e((NC,rf)=>{var nw=tf(),ow=/^\s+/;function aw(i){return i&&i.slice(0,nw(i)+1).replace(ow,"")}rf.exports=aw});var Hc=_e((BC,nf)=>{var lw=zc(),cw=lw.Symbol;nf.exports=cw});var cf=_e((UC,lf)=>{var of=Hc(),af=Object.prototype,uw=af.hasOwnProperty,hw=af.toString,kn=of?of.toStringTag:void 0;function dw(i){var e=uw.call(i,kn),t=i[kn];try{i[kn]=void 0;var r=!0}catch{}var s=hw.call(i);return r&&(e?i[kn]=t:delete i[kn]),s}lf.exports=dw});var hf=_e((zC,uf)=>{var pw=Object.prototype,fw=pw.toString;function mw(i){return fw.call(i)}uf.exports=mw});var mf=_e((HC,ff)=>{var df=Hc(),gw=cf(),vw=hf(),bw="[object Null]",yw="[object Undefined]",pf=df?df.toStringTag:void 0;function ww(i){return i==null?i===void 0?yw:bw:pf&&pf in Object(i)?gw(i):vw(i)}ff.exports=ww});var vf=_e(($C,gf)=>{function Sw(i){return i!=null&&typeof i=="object"}gf.exports=Sw});var yf=_e((qC,bf)=>{var Tw=mf(),Ew=vf(),xw="[object Symbol]";function kw(i){return typeof i=="symbol"||Ew(i)&&Tw(i)==xw}bf.exports=kw});var Ef=_e((VC,Tf)=>{var Aw=sf(),wf=Ta(),Pw=yf(),Sf=NaN,Cw=/^[-+]0x[0-9a-f]+$/i,Fw=/^0b[01]+$/i,_w=/^0o[0-7]+$/i,Ow=parseInt;function Rw(i){if(typeof i=="number")return i;if(Pw(i))return Sf;if(wf(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=wf(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=Aw(i);var t=Fw.test(i);return t||_w.test(i)?Ow(i.slice(2),t?2:8):Cw.test(i)?Sf:+i}Tf.exports=Rw});var qc=_e((jC,kf)=>{var Lw=Ta(),$c=Jp(),xf=Ef(),Mw="Expected a function",Iw=Math.max,Dw=Math.min;function Nw(i,e,t){var r,s,n,o,a,l,c=0,d=!1,p=!1,y=!0;if(typeof i!="function")throw new TypeError(Mw);e=xf(e)||0,Lw(t)&&(d=!!t.leading,p="maxWait"in t,n=p?Iw(xf(t.maxWait)||0,e):n,y="trailing"in t?!!t.trailing:y);function v(L){var j=r,K=s;return r=s=void 0,c=L,o=i.apply(K,j),o}function x(L){return c=L,a=setTimeout(R,e),d?v(L):o}function P(L){var j=L-l,K=L-c,Z=e-j;return p?Dw(Z,n-K):Z}function F(L){var j=L-l,K=L-c;return l===void 0||j>=e||j<0||p&&K>=n}function R(){var L=$c();if(F(L))return D(L);a=setTimeout(R,P(L))}function D(L){return a=void 0,y&&r?v(L):(r=s=void 0,o)}function q(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function I(){return a===void 0?o:D($c())}function z(){var L=$c(),j=F(L);if(r=arguments,s=this,l=L,j){if(a===void 0)return x(l);if(p)return clearTimeout(a),a=setTimeout(R,e),v(l)}return a===void 0&&(a=setTimeout(R,e)),o}return z.cancel=q,z.flush=I,z}kf.exports=Nw});var Pf=_e((WC,Af)=>{var Bw=qc(),Uw=Ta(),zw="Expected a function";function Hw(i,e,t){var r=!0,s=!0;if(typeof i!="function")throw new TypeError(zw);return Uw(t)&&(r="leading"in t?!!t.leading:r,s="trailing"in t?!!t.trailing:s),Bw(i,e,{leading:r,maxWait:e,trailing:s})}Af.exports=Hw});var Aa=_e((o2,Mf)=>{"use strict";Mf.exports=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);let t=e<0,r=Math.abs(e);if(t&&(r=-r),r===0)return"0 B";let s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(r)/Math.log(1024)),s.length-1),o=Number(r/1024**n),a=s[n];return`${o>=10||o%1===0?Math.round(o):o.toFixed(1)} ${a}`}});var Nf=_e((a2,Df)=>{"use strict";function If(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}If.prototype.match=function(i){var e=!0,t=this.parts,r,s=t.length,n;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)e=!1;else{for(n=(i||"").split(this.separator),r=0;e&&r<s;r++)t[r]!=="*"&&(r<n.length?e=t[r]===n[r]:e=!1);e=e&&n}else if(typeof i.splice=="function")for(e=[],r=i.length;r--;)this.match(i[r])&&(e[e.length]=i[r]);else if(typeof i=="object"){e={};for(var o in i)this.match(o)&&(e[o]=i[o])}return e};Df.exports=function(i,e,t){var r=new If(i,t||/[\/\.]/);return typeof e<"u"?r.match(e):r}});var Uf=_e((l2,Bf)=>{var Gw=Nf(),Kw=/[\/\+\.]/;Bf.exports=function(i,e){function t(r){var s=Gw(r,i,Kw);return s&&s.length>=2}return e?t(e.split(";")[0]):t}});var wt=_e((H2,Da)=>{(function(){"use strict";var i={}.hasOwnProperty;function e(){for(var s="",n=0;n<arguments.length;n++){var o=arguments[n];o&&(s=r(s,t(o)))}return s}function t(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return e.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var n="";for(var o in s)i.call(s,o)&&s[o]&&(n=r(n,o));return n}function r(s,n){return n?s?s+" "+n:s+n:s}typeof Da<"u"&&Da.exports?(e.default=e,Da.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var lg=_e((I_,Ku)=>{"use strict";var TS=Object.prototype.hasOwnProperty,Tt="~";function ro(){}Object.create&&(ro.prototype=Object.create(null),new ro().__proto__||(Tt=!1));function ES(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function ag(i,e,t,r,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new ES(t,r||i,s),o=Tt?Tt+e:e;return i._events[o]?i._events[o].fn?i._events[o]=[i._events[o],n]:i._events[o].push(n):(i._events[o]=n,i._eventsCount++),i}function tl(i,e){--i._eventsCount===0?i._events=new ro:delete i._events[e]}function pt(){this._events=new ro,this._eventsCount=0}pt.prototype.eventNames=function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)TS.call(t,r)&&e.push(Tt?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};pt.prototype.listeners=function(e){var t=Tt?Tt+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,o=new Array(n);s<n;s++)o[s]=r[s].fn;return o};pt.prototype.listenerCount=function(e){var t=Tt?Tt+e:e,r=this._events[t];return r?r.fn?1:r.length:0};pt.prototype.emit=function(e,t,r,s,n,o){var a=Tt?Tt+e:e;if(!this._events[a])return!1;var l=this._events[a],c=arguments.length,d,p;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,s),!0;case 5:return l.fn.call(l.context,t,r,s,n),!0;case 6:return l.fn.call(l.context,t,r,s,n,o),!0}for(p=1,d=new Array(c-1);p<c;p++)d[p-1]=arguments[p];l.fn.apply(l.context,d)}else{var y=l.length,v;for(p=0;p<y;p++)switch(l[p].once&&this.removeListener(e,l[p].fn,void 0,!0),c){case 1:l[p].fn.call(l[p].context);break;case 2:l[p].fn.call(l[p].context,t);break;case 3:l[p].fn.call(l[p].context,t,r);break;case 4:l[p].fn.call(l[p].context,t,r,s);break;default:if(!d)for(v=1,d=new Array(c-1);v<c;v++)d[v-1]=arguments[v];l[p].fn.apply(l[p].context,d)}}return!0};pt.prototype.on=function(e,t,r){return ag(this,e,t,r,!1)};pt.prototype.once=function(e,t,r){return ag(this,e,t,r,!0)};pt.prototype.removeListener=function(e,t,r,s){var n=Tt?Tt+e:e;if(!this._events[n])return this;if(!t)return tl(this,n),this;var o=this._events[n];if(o.fn)o.fn===t&&(!s||o.once)&&(!r||o.context===r)&&tl(this,n);else{for(var a=0,l=[],c=o.length;a<c;a++)(o[a].fn!==t||s&&!o[a].once||r&&o[a].context!==r)&&l.push(o[a]);l.length?this._events[n]=l.length===1?l[0]:l:tl(this,n)}return this};pt.prototype.removeAllListeners=function(e){var t;return e?(t=Tt?Tt+e:e,this._events[t]&&tl(this,t)):(this._events=new ro,this._eventsCount=0),this};pt.prototype.off=pt.prototype.removeListener;pt.prototype.addListener=pt.prototype.on;pt.prefixed=Tt;pt.EventEmitter=pt;typeof Ku<"u"&&(Ku.exports=pt)});var Gg=_e((kh,Ah)=>{(function(i,e){typeof kh=="object"&&typeof Ah<"u"?Ah.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Cropper=e())})(kh,function(){"use strict";function i(g,h){var m=Object.keys(g);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(g);h&&(f=f.filter(function(T){return Object.getOwnPropertyDescriptor(g,T).enumerable})),m.push.apply(m,f)}return m}function e(g){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?i(Object(m),!0).forEach(function(f){l(g,f,m[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(m)):i(Object(m)).forEach(function(f){Object.defineProperty(g,f,Object.getOwnPropertyDescriptor(m,f))})}return g}function t(g,h){if(typeof g!="object"||!g)return g;var m=g[Symbol.toPrimitive];if(m!==void 0){var f=m.call(g,h||"default");if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(g)}function r(g){var h=t(g,"string");return typeof h=="symbol"?h:h+""}function s(g){"@babel/helpers - typeof";return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},s(g)}function n(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function o(g,h){for(var m=0;m<h.length;m++){var f=h[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(g,r(f.key),f)}}function a(g,h,m){return h&&o(g.prototype,h),m&&o(g,m),Object.defineProperty(g,"prototype",{writable:!1}),g}function l(g,h,m){return h=r(h),h in g?Object.defineProperty(g,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):g[h]=m,g}function c(g){return d(g)||p(g)||y(g)||x()}function d(g){if(Array.isArray(g))return v(g)}function p(g){if(typeof Symbol<"u"&&g[Symbol.iterator]!=null||g["@@iterator"]!=null)return Array.from(g)}function y(g,h){if(g){if(typeof g=="string")return v(g,h);var m=Object.prototype.toString.call(g).slice(8,-1);if(m==="Object"&&g.constructor&&(m=g.constructor.name),m==="Map"||m==="Set")return Array.from(g);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return v(g,h)}}function v(g,h){(h==null||h>g.length)&&(h=g.length);for(var m=0,f=new Array(h);m<h;m++)f[m]=g[m];return f}function x(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var P=typeof window<"u"&&typeof window.document<"u",F=P?window:{},R=P&&F.document.documentElement?"ontouchstart"in F.document.documentElement:!1,D=P?"PointerEvent"in F:!1,q="cropper",I="all",z="crop",L="move",j="zoom",K="e",Z="w",ne="s",Y="n",re="ne",le="nw",ke="se",We="sw",E="".concat(q,"-crop"),k="".concat(q,"-disabled"),A="".concat(q,"-hidden"),$="".concat(q,"-hide"),W="".concat(q,"-invisible"),H="".concat(q,"-modal"),J="".concat(q,"-move"),ee="".concat(q,"Action"),Ae="".concat(q,"Preview"),oe="crop",ce="move",Le="none",De="crop",He="cropend",gi="cropmove",vi="cropstart",Zt="dblclick",tr=R?"touchstart":"mousedown",Qt=R?"touchmove":"mousemove",Sr=R?"touchend touchcancel":"mouseup",Ci=D?"pointerdown":tr,zt=D?"pointermove":Qt,Fi=D?"pointerup pointercancel":Sr,_i="ready",_t="resize",bi="wheel",ir="zoom",Oi="image/jpeg",Jt=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,ei=/^data:/,ti=/^data:image\/jpeg;base64,/,Tr=/^img|canvas$/i,rr=200,Js=100,gs={viewMode:0,dragMode:oe,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:rr,minContainerHeight:Js,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Mo='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',vs=Number.isNaN||F.isNaN;function se(g){return typeof g=="number"&&!vs(g)}var Ht=function(h){return h>0&&h<1/0};function yi(g){return typeof g>"u"}function ii(g){return s(g)==="object"&&g!==null}var en=Object.prototype.hasOwnProperty;function sr(g){if(!ii(g))return!1;try{var h=g.constructor,m=h.prototype;return h&&m&&en.call(m,"isPrototypeOf")}catch{return!1}}function Ge(g){return typeof g=="function"}var bs=Array.prototype.slice;function Io(g){return Array.from?Array.from(g):bs.call(g)}function ye(g,h){return g&&Ge(h)&&(Array.isArray(g)||se(g.length)?Io(g).forEach(function(m,f){h.call(g,m,f,g)}):ii(g)&&Object.keys(g).forEach(function(m){h.call(g,g[m],m,g)})),g}var we=Object.assign||function(h){for(var m=arguments.length,f=new Array(m>1?m-1:0),T=1;T<m;T++)f[T-1]=arguments[T];return ii(h)&&f.length>0&&f.forEach(function(b){ii(b)&&Object.keys(b).forEach(function(S){h[S]=b[S]})}),h},Rl=/\.\d*(?:0|9){12}\d*$/;function Ee(g){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Rl.test(g)?Math.round(g*h)/h:g}var nr=/^width|height|left|top|marginLeft|marginTop$/;function wi(g,h){var m=g.style;ye(h,function(f,T){nr.test(T)&&se(f)&&(f="".concat(f,"px")),m[T]=f})}function Do(g,h){return g.classList?g.classList.contains(h):g.className.indexOf(h)>-1}function Me(g,h){if(h){if(se(g.length)){ye(g,function(f){Me(f,h)});return}if(g.classList){g.classList.add(h);return}var m=g.className.trim();m?m.indexOf(h)<0&&(g.className="".concat(m," ").concat(h)):g.className=h}}function Ot(g,h){if(h){if(se(g.length)){ye(g,function(m){Ot(m,h)});return}if(g.classList){g.classList.remove(h);return}g.className.indexOf(h)>=0&&(g.className=g.className.replace(h,""))}}function Ri(g,h,m){if(h){if(se(g.length)){ye(g,function(f){Ri(f,h,m)});return}m?Me(g,h):Ot(g,h)}}var Ll=/([a-z\d])([A-Z])/g;function At(g){return g.replace(Ll,"$1-$2").toLowerCase()}function or(g,h){return ii(g[h])?g[h]:g.dataset?g.dataset[h]:g.getAttribute("data-".concat(At(h)))}function ar(g,h,m){ii(m)?g[h]=m:g.dataset?g.dataset[h]=m:g.setAttribute("data-".concat(At(h)),m)}function No(g,h){if(ii(g[h]))try{delete g[h]}catch{g[h]=void 0}else if(g.dataset)try{delete g.dataset[h]}catch{g.dataset[h]=void 0}else g.removeAttribute("data-".concat(At(h)))}var ys=/\s\s*/,tn=function(){var g=!1;if(P){var h=!1,m=function(){},f=Object.defineProperty({},"once",{get:function(){return g=!0,h},set:function(b){h=b}});F.addEventListener("test",m,f),F.removeEventListener("test",m,f)}return g}();function Ne(g,h,m){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},T=m;h.trim().split(ys).forEach(function(b){if(!tn){var S=g.listeners;S&&S[b]&&S[b][m]&&(T=S[b][m],delete S[b][m],Object.keys(S[b]).length===0&&delete S[b],Object.keys(S).length===0&&delete g.listeners)}g.removeEventListener(b,T,f)})}function ft(g,h,m){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},T=m;h.trim().split(ys).forEach(function(b){if(f.once&&!tn){var S=g.listeners,C=S===void 0?{}:S;T=function(){delete C[b][m],g.removeEventListener(b,T,f);for(var M=arguments.length,_=new Array(M),O=0;O<M;O++)_[O]=arguments[O];m.apply(g,_)},C[b]||(C[b]={}),C[b][m]&&g.removeEventListener(b,C[b][m],f),C[b][m]=T,g.listeners=C}g.addEventListener(b,T,f)})}function Li(g,h,m){var f;return Ge(Event)&&Ge(CustomEvent)?f=new CustomEvent(h,{detail:m,bubbles:!0,cancelable:!0}):(f=document.createEvent("CustomEvent"),f.initCustomEvent(h,!0,!0,m)),g.dispatchEvent(f)}function rn(g){var h=g.getBoundingClientRect();return{left:h.left+(window.pageXOffset-document.documentElement.clientLeft),top:h.top+(window.pageYOffset-document.documentElement.clientTop)}}var ws=F.location,Ml=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Q(g){var h=g.match(Ml);return h!==null&&(h[1]!==ws.protocol||h[2]!==ws.hostname||h[3]!==ws.port)}function w(g){var h="timestamp=".concat(new Date().getTime());return g+(g.indexOf("?")===-1?"?":"&")+h}function N(g){var h=g.rotate,m=g.scaleX,f=g.scaleY,T=g.translateX,b=g.translateY,S=[];se(T)&&T!==0&&S.push("translateX(".concat(T,"px)")),se(b)&&b!==0&&S.push("translateY(".concat(b,"px)")),se(h)&&h!==0&&S.push("rotate(".concat(h,"deg)")),se(m)&&m!==1&&S.push("scaleX(".concat(m,")")),se(f)&&f!==1&&S.push("scaleY(".concat(f,")"));var C=S.length?S.join(" "):"none";return{WebkitTransform:C,msTransform:C,transform:C}}function X(g){var h=e({},g),m=0;return ye(g,function(f,T){delete h[T],ye(h,function(b){var S=Math.abs(f.startX-b.startX),C=Math.abs(f.startY-b.startY),U=Math.abs(f.endX-b.endX),M=Math.abs(f.endY-b.endY),_=Math.sqrt(S*S+C*C),O=Math.sqrt(U*U+M*M),B=(O-_)/_;Math.abs(B)>Math.abs(m)&&(m=B)})}),m}function be(g,h){var m=g.pageX,f=g.pageY,T={endX:m,endY:f};return h?T:e({startX:m,startY:f},T)}function Qe(g){var h=0,m=0,f=0;return ye(g,function(T){var b=T.startX,S=T.startY;h+=b,m+=S,f+=1}),h/=f,m/=f,{pageX:h,pageY:m}}function Se(g){var h=g.aspectRatio,m=g.height,f=g.width,T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",b=Ht(f),S=Ht(m);if(b&&S){var C=m*h;T==="contain"&&C>f||T==="cover"&&C<f?m=f/h:f=m*h}else b?m=f/h:S&&(f=m*h);return{width:f,height:m}}function ht(g){var h=g.width,m=g.height,f=g.degree;if(f=Math.abs(f)%180,f===90)return{width:m,height:h};var T=f%90*Math.PI/180,b=Math.sin(T),S=Math.cos(T),C=h*S+m*b,U=h*b+m*S;return f>90?{width:U,height:C}:{width:C,height:U}}function $t(g,h,m,f){var T=h.aspectRatio,b=h.naturalWidth,S=h.naturalHeight,C=h.rotate,U=C===void 0?0:C,M=h.scaleX,_=M===void 0?1:M,O=h.scaleY,B=O===void 0?1:O,he=m.aspectRatio,ue=m.naturalWidth,Pe=m.naturalHeight,pe=f.fillColor,Ke=pe===void 0?"transparent":pe,Je=f.imageSmoothingEnabled,$e=Je===void 0?!0:Je,Mi=f.imageSmoothingQuality,Rt=Mi===void 0?"low":Mi,V=f.maxWidth,fe=V===void 0?1/0:V,Xe=f.maxHeight,qt=Xe===void 0?1/0:Xe,Ii=f.minWidth,Er=Ii===void 0?0:Ii,xr=f.minHeight,cr=xr===void 0?0:xr,Si=document.createElement("canvas"),Pt=Si.getContext("2d"),kr=Se({aspectRatio:he,width:fe,height:qt}),zo=Se({aspectRatio:he,width:Er,height:cr},"cover"),Il=Math.min(kr.width,Math.max(zo.width,ue)),Dl=Math.min(kr.height,Math.max(zo.height,Pe)),kd=Se({aspectRatio:T,width:fe,height:qt}),Ad=Se({aspectRatio:T,width:Er,height:cr},"cover"),Pd=Math.min(kd.width,Math.max(Ad.width,b)),Cd=Math.min(kd.height,Math.max(Ad.height,S)),Yv=[-Pd/2,-Cd/2,Pd,Cd];return Si.width=Ee(Il),Si.height=Ee(Dl),Pt.fillStyle=Ke,Pt.fillRect(0,0,Il,Dl),Pt.save(),Pt.translate(Il/2,Dl/2),Pt.rotate(U*Math.PI/180),Pt.scale(_,B),Pt.imageSmoothingEnabled=$e,Pt.imageSmoothingQuality=Rt,Pt.drawImage.apply(Pt,[g].concat(c(Yv.map(function(Zv){return Math.floor(Ee(Zv))})))),Pt.restore(),Si}var lr=String.fromCharCode;function nt(g,h,m){var f="";m+=h;for(var T=h;T<m;T+=1)f+=lr(g.getUint8(T));return f}var Bo=/^data:.*,/;function Uo(g){var h=g.replace(Bo,""),m=atob(h),f=new ArrayBuffer(m.length),T=new Uint8Array(f);return ye(T,function(b,S){T[S]=m.charCodeAt(S)}),f}function zv(g,h){for(var m=[],f=8192,T=new Uint8Array(g);T.length>0;)m.push(lr.apply(null,Io(T.subarray(0,f)))),T=T.subarray(f);return"data:".concat(h,";base64,").concat(btoa(m.join("")))}function Hv(g){var h=new DataView(g),m;try{var f,T,b;if(h.getUint8(0)===255&&h.getUint8(1)===216)for(var S=h.byteLength,C=2;C+1<S;){if(h.getUint8(C)===255&&h.getUint8(C+1)===225){T=C;break}C+=1}if(T){var U=T+4,M=T+10;if(nt(h,U,4)==="Exif"){var _=h.getUint16(M);if(f=_===18761,(f||_===19789)&&h.getUint16(M+2,f)===42){var O=h.getUint32(M+4,f);O>=8&&(b=M+O)}}}if(b){var B=h.getUint16(b,f),he,ue;for(ue=0;ue<B;ue+=1)if(he=b+ue*12+2,h.getUint16(he,f)===274){he+=8,m=h.getUint16(he,f),h.setUint16(he,1,f);break}}}catch{m=1}return m}function $v(g){var h=0,m=1,f=1;switch(g){case 2:m=-1;break;case 3:h=-180;break;case 4:f=-1;break;case 5:h=90,f=-1;break;case 6:h=90;break;case 7:h=90,m=-1;break;case 8:h=-90;break}return{rotate:h,scaleX:m,scaleY:f}}var qv={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var h=this.element,m=this.options,f=this.container,T=this.cropper,b=Number(m.minContainerWidth),S=Number(m.minContainerHeight);Me(T,A),Ot(h,A);var C={width:Math.max(f.offsetWidth,b>=0?b:rr),height:Math.max(f.offsetHeight,S>=0?S:Js)};this.containerData=C,wi(T,{width:C.width,height:C.height}),Me(h,A),Ot(T,A)},initCanvas:function(){var h=this.containerData,m=this.imageData,f=this.options.viewMode,T=Math.abs(m.rotate)%180===90,b=T?m.naturalHeight:m.naturalWidth,S=T?m.naturalWidth:m.naturalHeight,C=b/S,U=h.width,M=h.height;h.height*C>h.width?f===3?U=h.height*C:M=h.width/C:f===3?M=h.width/C:U=h.height*C;var _={aspectRatio:C,naturalWidth:b,naturalHeight:S,width:U,height:M};this.canvasData=_,this.limited=f===1||f===2,this.limitCanvas(!0,!0),_.width=Math.min(Math.max(_.width,_.minWidth),_.maxWidth),_.height=Math.min(Math.max(_.height,_.minHeight),_.maxHeight),_.left=(h.width-_.width)/2,_.top=(h.height-_.height)/2,_.oldLeft=_.left,_.oldTop=_.top,this.initialCanvasData=we({},_)},limitCanvas:function(h,m){var f=this.options,T=this.containerData,b=this.canvasData,S=this.cropBoxData,C=f.viewMode,U=b.aspectRatio,M=this.cropped&&S;if(h){var _=Number(f.minCanvasWidth)||0,O=Number(f.minCanvasHeight)||0;C>1?(_=Math.max(_,T.width),O=Math.max(O,T.height),C===3&&(O*U>_?_=O*U:O=_/U)):C>0&&(_?_=Math.max(_,M?S.width:0):O?O=Math.max(O,M?S.height:0):M&&(_=S.width,O=S.height,O*U>_?_=O*U:O=_/U));var B=Se({aspectRatio:U,width:_,height:O});_=B.width,O=B.height,b.minWidth=_,b.minHeight=O,b.maxWidth=1/0,b.maxHeight=1/0}if(m)if(C>(M?0:1)){var he=T.width-b.width,ue=T.height-b.height;b.minLeft=Math.min(0,he),b.minTop=Math.min(0,ue),b.maxLeft=Math.max(0,he),b.maxTop=Math.max(0,ue),M&&this.limited&&(b.minLeft=Math.min(S.left,S.left+(S.width-b.width)),b.minTop=Math.min(S.top,S.top+(S.height-b.height)),b.maxLeft=S.left,b.maxTop=S.top,C===2&&(b.width>=T.width&&(b.minLeft=Math.min(0,he),b.maxLeft=Math.max(0,he)),b.height>=T.height&&(b.minTop=Math.min(0,ue),b.maxTop=Math.max(0,ue))))}else b.minLeft=-b.width,b.minTop=-b.height,b.maxLeft=T.width,b.maxTop=T.height},renderCanvas:function(h,m){var f=this.canvasData,T=this.imageData;if(m){var b=ht({width:T.naturalWidth*Math.abs(T.scaleX||1),height:T.naturalHeight*Math.abs(T.scaleY||1),degree:T.rotate||0}),S=b.width,C=b.height,U=f.width*(S/f.naturalWidth),M=f.height*(C/f.naturalHeight);f.left-=(U-f.width)/2,f.top-=(M-f.height)/2,f.width=U,f.height=M,f.aspectRatio=S/C,f.naturalWidth=S,f.naturalHeight=C,this.limitCanvas(!0,!1)}(f.width>f.maxWidth||f.width<f.minWidth)&&(f.left=f.oldLeft),(f.height>f.maxHeight||f.height<f.minHeight)&&(f.top=f.oldTop),f.width=Math.min(Math.max(f.width,f.minWidth),f.maxWidth),f.height=Math.min(Math.max(f.height,f.minHeight),f.maxHeight),this.limitCanvas(!1,!0),f.left=Math.min(Math.max(f.left,f.minLeft),f.maxLeft),f.top=Math.min(Math.max(f.top,f.minTop),f.maxTop),f.oldLeft=f.left,f.oldTop=f.top,wi(this.canvas,we({width:f.width,height:f.height},N({translateX:f.left,translateY:f.top}))),this.renderImage(h),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(h){var m=this.canvasData,f=this.imageData,T=f.naturalWidth*(m.width/m.naturalWidth),b=f.naturalHeight*(m.height/m.naturalHeight);we(f,{width:T,height:b,left:(m.width-T)/2,top:(m.height-b)/2}),wi(this.image,we({width:f.width,height:f.height},N(we({translateX:f.left,translateY:f.top},f)))),h&&this.output()},initCropBox:function(){var h=this.options,m=this.canvasData,f=h.aspectRatio||h.initialAspectRatio,T=Number(h.autoCropArea)||.8,b={width:m.width,height:m.height};f&&(m.height*f>m.width?b.height=b.width/f:b.width=b.height*f),this.cropBoxData=b,this.limitCropBox(!0,!0),b.width=Math.min(Math.max(b.width,b.minWidth),b.maxWidth),b.height=Math.min(Math.max(b.height,b.minHeight),b.maxHeight),b.width=Math.max(b.minWidth,b.width*T),b.height=Math.max(b.minHeight,b.height*T),b.left=m.left+(m.width-b.width)/2,b.top=m.top+(m.height-b.height)/2,b.oldLeft=b.left,b.oldTop=b.top,this.initialCropBoxData=we({},b)},limitCropBox:function(h,m){var f=this.options,T=this.containerData,b=this.canvasData,S=this.cropBoxData,C=this.limited,U=f.aspectRatio;if(h){var M=Number(f.minCropBoxWidth)||0,_=Number(f.minCropBoxHeight)||0,O=C?Math.min(T.width,b.width,b.width+b.left,T.width-b.left):T.width,B=C?Math.min(T.height,b.height,b.height+b.top,T.height-b.top):T.height;M=Math.min(M,T.width),_=Math.min(_,T.height),U&&(M&&_?_*U>M?_=M/U:M=_*U:M?_=M/U:_&&(M=_*U),B*U>O?B=O/U:O=B*U),S.minWidth=Math.min(M,O),S.minHeight=Math.min(_,B),S.maxWidth=O,S.maxHeight=B}m&&(C?(S.minLeft=Math.max(0,b.left),S.minTop=Math.max(0,b.top),S.maxLeft=Math.min(T.width,b.left+b.width)-S.width,S.maxTop=Math.min(T.height,b.top+b.height)-S.height):(S.minLeft=0,S.minTop=0,S.maxLeft=T.width-S.width,S.maxTop=T.height-S.height))},renderCropBox:function(){var h=this.options,m=this.containerData,f=this.cropBoxData;(f.width>f.maxWidth||f.width<f.minWidth)&&(f.left=f.oldLeft),(f.height>f.maxHeight||f.height<f.minHeight)&&(f.top=f.oldTop),f.width=Math.min(Math.max(f.width,f.minWidth),f.maxWidth),f.height=Math.min(Math.max(f.height,f.minHeight),f.maxHeight),this.limitCropBox(!1,!0),f.left=Math.min(Math.max(f.left,f.minLeft),f.maxLeft),f.top=Math.min(Math.max(f.top,f.minTop),f.maxTop),f.oldLeft=f.left,f.oldTop=f.top,h.movable&&h.cropBoxMovable&&ar(this.face,ee,f.width>=m.width&&f.height>=m.height?L:I),wi(this.cropBox,we({width:f.width,height:f.height},N({translateX:f.left,translateY:f.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Li(this.element,De,this.getData())}},Vv={initPreview:function(){var h=this.element,m=this.crossOrigin,f=this.options.preview,T=m?this.crossOriginUrl:this.url,b=h.alt||"The image to preview",S=document.createElement("img");if(m&&(S.crossOrigin=m),S.src=T,S.alt=b,this.viewBox.appendChild(S),this.viewBoxImage=S,!!f){var C=f;typeof f=="string"?C=h.ownerDocument.querySelectorAll(f):f.querySelector&&(C=[f]),this.previews=C,ye(C,function(U){var M=document.createElement("img");ar(U,Ae,{width:U.offsetWidth,height:U.offsetHeight,html:U.innerHTML}),m&&(M.crossOrigin=m),M.src=T,M.alt=b,M.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',U.innerHTML="",U.appendChild(M)})}},resetPreview:function(){ye(this.previews,function(h){var m=or(h,Ae);wi(h,{width:m.width,height:m.height}),h.innerHTML=m.html,No(h,Ae)})},preview:function(){var h=this.imageData,m=this.canvasData,f=this.cropBoxData,T=f.width,b=f.height,S=h.width,C=h.height,U=f.left-m.left-h.left,M=f.top-m.top-h.top;!this.cropped||this.disabled||(wi(this.viewBoxImage,we({width:S,height:C},N(we({translateX:-U,translateY:-M},h)))),ye(this.previews,function(_){var O=or(_,Ae),B=O.width,he=O.height,ue=B,Pe=he,pe=1;T&&(pe=B/T,Pe=b*pe),b&&Pe>he&&(pe=he/b,ue=T*pe,Pe=he),wi(_,{width:ue,height:Pe}),wi(_.getElementsByTagName("img")[0],we({width:S*pe,height:C*pe},N(we({translateX:-U*pe,translateY:-M*pe},h))))}))}},jv={bind:function(){var h=this.element,m=this.options,f=this.cropper;Ge(m.cropstart)&&ft(h,vi,m.cropstart),Ge(m.cropmove)&&ft(h,gi,m.cropmove),Ge(m.cropend)&&ft(h,He,m.cropend),Ge(m.crop)&&ft(h,De,m.crop),Ge(m.zoom)&&ft(h,ir,m.zoom),ft(f,Ci,this.onCropStart=this.cropStart.bind(this)),m.zoomable&&m.zoomOnWheel&&ft(f,bi,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),m.toggleDragModeOnDblclick&&ft(f,Zt,this.onDblclick=this.dblclick.bind(this)),ft(h.ownerDocument,zt,this.onCropMove=this.cropMove.bind(this)),ft(h.ownerDocument,Fi,this.onCropEnd=this.cropEnd.bind(this)),m.responsive&&ft(window,_t,this.onResize=this.resize.bind(this))},unbind:function(){var h=this.element,m=this.options,f=this.cropper;Ge(m.cropstart)&&Ne(h,vi,m.cropstart),Ge(m.cropmove)&&Ne(h,gi,m.cropmove),Ge(m.cropend)&&Ne(h,He,m.cropend),Ge(m.crop)&&Ne(h,De,m.crop),Ge(m.zoom)&&Ne(h,ir,m.zoom),Ne(f,Ci,this.onCropStart),m.zoomable&&m.zoomOnWheel&&Ne(f,bi,this.onWheel,{passive:!1,capture:!0}),m.toggleDragModeOnDblclick&&Ne(f,Zt,this.onDblclick),Ne(h.ownerDocument,zt,this.onCropMove),Ne(h.ownerDocument,Fi,this.onCropEnd),m.responsive&&Ne(window,_t,this.onResize)}},Wv={resize:function(){if(!this.disabled){var h=this.options,m=this.container,f=this.containerData,T=m.offsetWidth/f.width,b=m.offsetHeight/f.height,S=Math.abs(T-1)>Math.abs(b-1)?T:b;if(S!==1){var C,U;h.restore&&(C=this.getCanvasData(),U=this.getCropBoxData()),this.render(),h.restore&&(this.setCanvasData(ye(C,function(M,_){C[_]=M*S})),this.setCropBoxData(ye(U,function(M,_){U[_]=M*S})))}}},dblclick:function(){this.disabled||this.options.dragMode===Le||this.setDragMode(Do(this.dragBox,E)?ce:oe)},wheel:function(h){var m=this,f=Number(this.options.wheelZoomRatio)||.1,T=1;this.disabled||(h.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){m.wheeling=!1},50),h.deltaY?T=h.deltaY>0?1:-1:h.wheelDelta?T=-h.wheelDelta/120:h.detail&&(T=h.detail>0?1:-1),this.zoom(-T*f,h)))},cropStart:function(h){var m=h.buttons,f=h.button;if(!(this.disabled||(h.type==="mousedown"||h.type==="pointerdown"&&h.pointerType==="mouse")&&(se(m)&&m!==1||se(f)&&f!==0||h.ctrlKey))){var T=this.options,b=this.pointers,S;h.changedTouches?ye(h.changedTouches,function(C){b[C.identifier]=be(C)}):b[h.pointerId||0]=be(h),Object.keys(b).length>1&&T.zoomable&&T.zoomOnTouch?S=j:S=or(h.target,ee),Jt.test(S)&&Li(this.element,vi,{originalEvent:h,action:S})!==!1&&(h.preventDefault(),this.action=S,this.cropping=!1,S===z&&(this.cropping=!0,Me(this.dragBox,H)))}},cropMove:function(h){var m=this.action;if(!(this.disabled||!m)){var f=this.pointers;h.preventDefault(),Li(this.element,gi,{originalEvent:h,action:m})!==!1&&(h.changedTouches?ye(h.changedTouches,function(T){we(f[T.identifier]||{},be(T,!0))}):we(f[h.pointerId||0]||{},be(h,!0)),this.change(h))}},cropEnd:function(h){if(!this.disabled){var m=this.action,f=this.pointers;h.changedTouches?ye(h.changedTouches,function(T){delete f[T.identifier]}):delete f[h.pointerId||0],m&&(h.preventDefault(),Object.keys(f).length||(this.action=""),this.cropping&&(this.cropping=!1,Ri(this.dragBox,H,this.cropped&&this.options.modal)),Li(this.element,He,{originalEvent:h,action:m}))}}},Gv={change:function(h){var m=this.options,f=this.canvasData,T=this.containerData,b=this.cropBoxData,S=this.pointers,C=this.action,U=m.aspectRatio,M=b.left,_=b.top,O=b.width,B=b.height,he=M+O,ue=_+B,Pe=0,pe=0,Ke=T.width,Je=T.height,$e=!0,Mi;!U&&h.shiftKey&&(U=O&&B?O/B:1),this.limited&&(Pe=b.minLeft,pe=b.minTop,Ke=Pe+Math.min(T.width,f.width,f.left+f.width),Je=pe+Math.min(T.height,f.height,f.top+f.height));var Rt=S[Object.keys(S)[0]],V={x:Rt.endX-Rt.startX,y:Rt.endY-Rt.startY},fe=function(qt){switch(qt){case K:he+V.x>Ke&&(V.x=Ke-he);break;case Z:M+V.x<Pe&&(V.x=Pe-M);break;case Y:_+V.y<pe&&(V.y=pe-_);break;case ne:ue+V.y>Je&&(V.y=Je-ue);break}};switch(C){case I:M+=V.x,_+=V.y;break;case K:if(V.x>=0&&(he>=Ke||U&&(_<=pe||ue>=Je))){$e=!1;break}fe(K),O+=V.x,O<0&&(C=Z,O=-O,M-=O),U&&(B=O/U,_+=(b.height-B)/2);break;case Y:if(V.y<=0&&(_<=pe||U&&(M<=Pe||he>=Ke))){$e=!1;break}fe(Y),B-=V.y,_+=V.y,B<0&&(C=ne,B=-B,_-=B),U&&(O=B*U,M+=(b.width-O)/2);break;case Z:if(V.x<=0&&(M<=Pe||U&&(_<=pe||ue>=Je))){$e=!1;break}fe(Z),O-=V.x,M+=V.x,O<0&&(C=K,O=-O,M-=O),U&&(B=O/U,_+=(b.height-B)/2);break;case ne:if(V.y>=0&&(ue>=Je||U&&(M<=Pe||he>=Ke))){$e=!1;break}fe(ne),B+=V.y,B<0&&(C=Y,B=-B,_-=B),U&&(O=B*U,M+=(b.width-O)/2);break;case re:if(U){if(V.y<=0&&(_<=pe||he>=Ke)){$e=!1;break}fe(Y),B-=V.y,_+=V.y,O=B*U}else fe(Y),fe(K),V.x>=0?he<Ke?O+=V.x:V.y<=0&&_<=pe&&($e=!1):O+=V.x,V.y<=0?_>pe&&(B-=V.y,_+=V.y):(B-=V.y,_+=V.y);O<0&&B<0?(C=We,B=-B,O=-O,_-=B,M-=O):O<0?(C=le,O=-O,M-=O):B<0&&(C=ke,B=-B,_-=B);break;case le:if(U){if(V.y<=0&&(_<=pe||M<=Pe)){$e=!1;break}fe(Y),B-=V.y,_+=V.y,O=B*U,M+=b.width-O}else fe(Y),fe(Z),V.x<=0?M>Pe?(O-=V.x,M+=V.x):V.y<=0&&_<=pe&&($e=!1):(O-=V.x,M+=V.x),V.y<=0?_>pe&&(B-=V.y,_+=V.y):(B-=V.y,_+=V.y);O<0&&B<0?(C=ke,B=-B,O=-O,_-=B,M-=O):O<0?(C=re,O=-O,M-=O):B<0&&(C=We,B=-B,_-=B);break;case We:if(U){if(V.x<=0&&(M<=Pe||ue>=Je)){$e=!1;break}fe(Z),O-=V.x,M+=V.x,B=O/U}else fe(ne),fe(Z),V.x<=0?M>Pe?(O-=V.x,M+=V.x):V.y>=0&&ue>=Je&&($e=!1):(O-=V.x,M+=V.x),V.y>=0?ue<Je&&(B+=V.y):B+=V.y;O<0&&B<0?(C=re,B=-B,O=-O,_-=B,M-=O):O<0?(C=ke,O=-O,M-=O):B<0&&(C=le,B=-B,_-=B);break;case ke:if(U){if(V.x>=0&&(he>=Ke||ue>=Je)){$e=!1;break}fe(K),O+=V.x,B=O/U}else fe(ne),fe(K),V.x>=0?he<Ke?O+=V.x:V.y>=0&&ue>=Je&&($e=!1):O+=V.x,V.y>=0?ue<Je&&(B+=V.y):B+=V.y;O<0&&B<0?(C=le,B=-B,O=-O,_-=B,M-=O):O<0?(C=We,O=-O,M-=O):B<0&&(C=re,B=-B,_-=B);break;case L:this.move(V.x,V.y),$e=!1;break;case j:this.zoom(X(S),h),$e=!1;break;case z:if(!V.x||!V.y){$e=!1;break}Mi=rn(this.cropper),M=Rt.startX-Mi.left,_=Rt.startY-Mi.top,O=b.minWidth,B=b.minHeight,V.x>0?C=V.y>0?ke:re:V.x<0&&(M-=O,C=V.y>0?We:le),V.y<0&&(_-=B),this.cropped||(Ot(this.cropBox,A),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}$e&&(b.width=O,b.height=B,b.left=M,b.top=_,this.action=C,this.renderCropBox()),ye(S,function(Xe){Xe.startX=Xe.endX,Xe.startY=Xe.endY})}},Kv={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Me(this.dragBox,H),Ot(this.cropBox,A),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=we({},this.initialImageData),this.canvasData=we({},this.initialCanvasData),this.cropBoxData=we({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(we(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Ot(this.dragBox,H),Me(this.cropBox,A)),this},replace:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&h&&(this.isImg&&(this.element.src=h),m?(this.url=h,this.image.src=h,this.ready&&(this.viewBoxImage.src=h,ye(this.previews,function(f){f.getElementsByTagName("img")[0].src=h}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(h))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Ot(this.cropper,k)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Me(this.cropper,k)),this},destroy:function(){var h=this.element;return h[q]?(h[q]=void 0,this.isImg&&this.replaced&&(h.src=this.originalUrl),this.uncreate(),this):this},move:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,f=this.canvasData,T=f.left,b=f.top;return this.moveTo(yi(h)?h:T+Number(h),yi(m)?m:b+Number(m))},moveTo:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,f=this.canvasData,T=!1;return h=Number(h),m=Number(m),this.ready&&!this.disabled&&this.options.movable&&(se(h)&&(f.left=h,T=!0),se(m)&&(f.top=m,T=!0),T&&this.renderCanvas(!0)),this},zoom:function(h,m){var f=this.canvasData;return h=Number(h),h<0?h=1/(1-h):h=1+h,this.zoomTo(f.width*h/f.naturalWidth,null,m)},zoomTo:function(h,m,f){var T=this.options,b=this.canvasData,S=b.width,C=b.height,U=b.naturalWidth,M=b.naturalHeight;if(h=Number(h),h>=0&&this.ready&&!this.disabled&&T.zoomable){var _=U*h,O=M*h;if(Li(this.element,ir,{ratio:h,oldRatio:S/U,originalEvent:f})===!1)return this;if(f){var B=this.pointers,he=rn(this.cropper),ue=B&&Object.keys(B).length?Qe(B):{pageX:f.pageX,pageY:f.pageY};b.left-=(_-S)*((ue.pageX-he.left-b.left)/S),b.top-=(O-C)*((ue.pageY-he.top-b.top)/C)}else sr(m)&&se(m.x)&&se(m.y)?(b.left-=(_-S)*((m.x-b.left)/S),b.top-=(O-C)*((m.y-b.top)/C)):(b.left-=(_-S)/2,b.top-=(O-C)/2);b.width=_,b.height=O,this.renderCanvas(!0)}return this},rotate:function(h){return this.rotateTo((this.imageData.rotate||0)+Number(h))},rotateTo:function(h){return h=Number(h),se(h)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=h%360,this.renderCanvas(!0,!0)),this},scaleX:function(h){var m=this.imageData.scaleY;return this.scale(h,se(m)?m:1)},scaleY:function(h){var m=this.imageData.scaleX;return this.scale(se(m)?m:1,h)},scale:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,f=this.imageData,T=!1;return h=Number(h),m=Number(m),this.ready&&!this.disabled&&this.options.scalable&&(se(h)&&(f.scaleX=h,T=!0),se(m)&&(f.scaleY=m,T=!0),T&&this.renderCanvas(!0,!0)),this},getData:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,m=this.options,f=this.imageData,T=this.canvasData,b=this.cropBoxData,S;if(this.ready&&this.cropped){S={x:b.left-T.left,y:b.top-T.top,width:b.width,height:b.height};var C=f.width/f.naturalWidth;if(ye(S,function(_,O){S[O]=_/C}),h){var U=Math.round(S.y+S.height),M=Math.round(S.x+S.width);S.x=Math.round(S.x),S.y=Math.round(S.y),S.width=M-S.x,S.height=U-S.y}}else S={x:0,y:0,width:0,height:0};return m.rotatable&&(S.rotate=f.rotate||0),m.scalable&&(S.scaleX=f.scaleX||1,S.scaleY=f.scaleY||1),S},setData:function(h){var m=this.options,f=this.imageData,T=this.canvasData,b={};if(this.ready&&!this.disabled&&sr(h)){var S=!1;m.rotatable&&se(h.rotate)&&h.rotate!==f.rotate&&(f.rotate=h.rotate,S=!0),m.scalable&&(se(h.scaleX)&&h.scaleX!==f.scaleX&&(f.scaleX=h.scaleX,S=!0),se(h.scaleY)&&h.scaleY!==f.scaleY&&(f.scaleY=h.scaleY,S=!0)),S&&this.renderCanvas(!0,!0);var C=f.width/f.naturalWidth;se(h.x)&&(b.left=h.x*C+T.left),se(h.y)&&(b.top=h.y*C+T.top),se(h.width)&&(b.width=h.width*C),se(h.height)&&(b.height=h.height*C),this.setCropBoxData(b)}return this},getContainerData:function(){return this.ready?we({},this.containerData):{}},getImageData:function(){return this.sized?we({},this.imageData):{}},getCanvasData:function(){var h=this.canvasData,m={};return this.ready&&ye(["left","top","width","height","naturalWidth","naturalHeight"],function(f){m[f]=h[f]}),m},setCanvasData:function(h){var m=this.canvasData,f=m.aspectRatio;return this.ready&&!this.disabled&&sr(h)&&(se(h.left)&&(m.left=h.left),se(h.top)&&(m.top=h.top),se(h.width)?(m.width=h.width,m.height=h.width/f):se(h.height)&&(m.height=h.height,m.width=h.height*f),this.renderCanvas(!0)),this},getCropBoxData:function(){var h=this.cropBoxData,m;return this.ready&&this.cropped&&(m={left:h.left,top:h.top,width:h.width,height:h.height}),m||{}},setCropBoxData:function(h){var m=this.cropBoxData,f=this.options.aspectRatio,T,b;return this.ready&&this.cropped&&!this.disabled&&sr(h)&&(se(h.left)&&(m.left=h.left),se(h.top)&&(m.top=h.top),se(h.width)&&h.width!==m.width&&(T=!0,m.width=h.width),se(h.height)&&h.height!==m.height&&(b=!0,m.height=h.height),f&&(T?m.height=m.width/f:b&&(m.width=m.height*f)),this.renderCropBox()),this},getCroppedCanvas:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var m=this.canvasData,f=$t(this.image,this.imageData,m,h);if(!this.cropped)return f;var T=this.getData(h.rounded),b=T.x,S=T.y,C=T.width,U=T.height,M=f.width/Math.floor(m.naturalWidth);M!==1&&(b*=M,S*=M,C*=M,U*=M);var _=C/U,O=Se({aspectRatio:_,width:h.maxWidth||1/0,height:h.maxHeight||1/0}),B=Se({aspectRatio:_,width:h.minWidth||0,height:h.minHeight||0},"cover"),he=Se({aspectRatio:_,width:h.width||(M!==1?f.width:C),height:h.height||(M!==1?f.height:U)}),ue=he.width,Pe=he.height;ue=Math.min(O.width,Math.max(B.width,ue)),Pe=Math.min(O.height,Math.max(B.height,Pe));var pe=document.createElement("canvas"),Ke=pe.getContext("2d");pe.width=Ee(ue),pe.height=Ee(Pe),Ke.fillStyle=h.fillColor||"transparent",Ke.fillRect(0,0,ue,Pe);var Je=h.imageSmoothingEnabled,$e=Je===void 0?!0:Je,Mi=h.imageSmoothingQuality;Ke.imageSmoothingEnabled=$e,Mi&&(Ke.imageSmoothingQuality=Mi);var Rt=f.width,V=f.height,fe=b,Xe=S,qt,Ii,Er,xr,cr,Si;fe<=-C||fe>Rt?(fe=0,qt=0,Er=0,cr=0):fe<=0?(Er=-fe,fe=0,qt=Math.min(Rt,C+fe),cr=qt):fe<=Rt&&(Er=0,qt=Math.min(C,Rt-fe),cr=qt),qt<=0||Xe<=-U||Xe>V?(Xe=0,Ii=0,xr=0,Si=0):Xe<=0?(xr=-Xe,Xe=0,Ii=Math.min(V,U+Xe),Si=Ii):Xe<=V&&(xr=0,Ii=Math.min(U,V-Xe),Si=Ii);var Pt=[fe,Xe,qt,Ii];if(cr>0&&Si>0){var kr=ue/C;Pt.push(Er*kr,xr*kr,cr*kr,Si*kr)}return Ke.drawImage.apply(Ke,[f].concat(c(Pt.map(function(zo){return Math.floor(Ee(zo))})))),pe},setAspectRatio:function(h){var m=this.options;return!this.disabled&&!yi(h)&&(m.aspectRatio=Math.max(0,h)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(h){var m=this.options,f=this.dragBox,T=this.face;if(this.ready&&!this.disabled){var b=h===oe,S=m.movable&&h===ce;h=b||S?h:Le,m.dragMode=h,ar(f,ee,h),Ri(f,E,b),Ri(f,J,S),m.cropBoxMovable||(ar(T,ee,h),Ri(T,E,b),Ri(T,J,S))}return this}},Xv=F.Cropper,xd=function(){function g(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n(this,g),!h||!Tr.test(h.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=h,this.options=we({},gs,sr(m)&&m),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return a(g,[{key:"init",value:function(){var m=this.element,f=m.tagName.toLowerCase(),T;if(!m[q]){if(m[q]=this,f==="img"){if(this.isImg=!0,T=m.getAttribute("src")||"",this.originalUrl=T,!T)return;T=m.src}else f==="canvas"&&window.HTMLCanvasElement&&(T=m.toDataURL());this.load(T)}}},{key:"load",value:function(m){var f=this;if(m){this.url=m,this.imageData={};var T=this.element,b=this.options;if(!b.rotatable&&!b.scalable&&(b.checkOrientation=!1),!b.checkOrientation||!window.ArrayBuffer){this.clone();return}if(ei.test(m)){ti.test(m)?this.read(Uo(m)):this.clone();return}var S=new XMLHttpRequest,C=this.clone.bind(this);this.reloading=!0,this.xhr=S,S.onabort=C,S.onerror=C,S.ontimeout=C,S.onprogress=function(){S.getResponseHeader("content-type")!==Oi&&S.abort()},S.onload=function(){f.read(S.response)},S.onloadend=function(){f.reloading=!1,f.xhr=null},b.checkCrossOrigin&&Q(m)&&T.crossOrigin&&(m=w(m)),S.open("GET",m,!0),S.responseType="arraybuffer",S.withCredentials=T.crossOrigin==="use-credentials",S.send()}}},{key:"read",value:function(m){var f=this.options,T=this.imageData,b=Hv(m),S=0,C=1,U=1;if(b>1){this.url=zv(m,Oi);var M=$v(b);S=M.rotate,C=M.scaleX,U=M.scaleY}f.rotatable&&(T.rotate=S),f.scalable&&(T.scaleX=C,T.scaleY=U),this.clone()}},{key:"clone",value:function(){var m=this.element,f=this.url,T=m.crossOrigin,b=f;this.options.checkCrossOrigin&&Q(f)&&(T||(T="anonymous"),b=w(f)),this.crossOrigin=T,this.crossOriginUrl=b;var S=document.createElement("img");T&&(S.crossOrigin=T),S.src=b||f,S.alt=m.alt||"The image to crop",this.image=S,S.onload=this.start.bind(this),S.onerror=this.stop.bind(this),Me(S,$),m.parentNode.insertBefore(S,m.nextSibling)}},{key:"start",value:function(){var m=this,f=this.image;f.onload=null,f.onerror=null,this.sizing=!0;var T=F.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(F.navigator.userAgent),b=function(M,_){we(m.imageData,{naturalWidth:M,naturalHeight:_,aspectRatio:M/_}),m.initialImageData=we({},m.imageData),m.sizing=!1,m.sized=!0,m.build()};if(f.naturalWidth&&!T){b(f.naturalWidth,f.naturalHeight);return}var S=document.createElement("img"),C=document.body||document.documentElement;this.sizingImage=S,S.onload=function(){b(S.width,S.height),T||C.removeChild(S)},S.src=f.src,T||(S.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",C.appendChild(S))}},{key:"stop",value:function(){var m=this.image;m.onload=null,m.onerror=null,m.parentNode.removeChild(m),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var m=this.element,f=this.options,T=this.image,b=m.parentNode,S=document.createElement("div");S.innerHTML=Mo;var C=S.querySelector(".".concat(q,"-container")),U=C.querySelector(".".concat(q,"-canvas")),M=C.querySelector(".".concat(q,"-drag-box")),_=C.querySelector(".".concat(q,"-crop-box")),O=_.querySelector(".".concat(q,"-face"));this.container=b,this.cropper=C,this.canvas=U,this.dragBox=M,this.cropBox=_,this.viewBox=C.querySelector(".".concat(q,"-view-box")),this.face=O,U.appendChild(T),Me(m,A),b.insertBefore(C,m.nextSibling),Ot(T,$),this.initPreview(),this.bind(),f.initialAspectRatio=Math.max(0,f.initialAspectRatio)||NaN,f.aspectRatio=Math.max(0,f.aspectRatio)||NaN,f.viewMode=Math.max(0,Math.min(3,Math.round(f.viewMode)))||0,Me(_,A),f.guides||Me(_.getElementsByClassName("".concat(q,"-dashed")),A),f.center||Me(_.getElementsByClassName("".concat(q,"-center")),A),f.background&&Me(C,"".concat(q,"-bg")),f.highlight||Me(O,W),f.cropBoxMovable&&(Me(O,J),ar(O,ee,I)),f.cropBoxResizable||(Me(_.getElementsByClassName("".concat(q,"-line")),A),Me(_.getElementsByClassName("".concat(q,"-point")),A)),this.render(),this.ready=!0,this.setDragMode(f.dragMode),f.autoCrop&&this.crop(),this.setData(f.data),Ge(f.ready)&&ft(m,_i,f.ready,{once:!0}),Li(m,_i)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var m=this.cropper.parentNode;m&&m.removeChild(this.cropper),Ot(this.element,A)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Xv,g}},{key:"setDefaults",value:function(m){we(gs,sr(m)&&m)}}])}();return we(xd.prototype,qv,Vv,jv,Wv,Gv,Kv),xd})});var Nl=class{constructor(e,t,r){this.eventTarget=e,this.eventName=t,this.eventOptions=r,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){let t=sb(e);for(let r of this.bindings){if(t.immediatePropagationStopped)break;r.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let r=e.index,s=t.index;return r<s?-1:r>s?1:0})}};function sb(i){if("immediatePropagationStopped"in i)return i;{let{stopImmediatePropagation:e}=i;return Object.assign(i,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var Bl=class{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,r={}){this.application.handleError(e,`Error ${t}`,r)}clearEventListenersForBinding(e){let t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:t,eventName:r,eventOptions:s}=e,n=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(r,s);n.delete(o),n.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:r,eventOptions:s}=e;return this.fetchEventListener(t,r,s)}fetchEventListener(e,t,r){let s=this.fetchEventListenerMapForEventTarget(e),n=this.cacheKey(t,r),o=s.get(n);return o||(o=this.createEventListener(e,t,r),s.set(n,o)),o}createEventListener(e,t,r){let s=new Nl(e,t,r);return this.started&&s.connect(),s}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let r=[e];return Object.keys(t).sort().forEach(s=>{r.push(`${t[s]?"":"!"}${s}`)}),r.join(":")}},nb={stop({event:i,value:e}){return e&&i.stopPropagation(),!0},prevent({event:i,value:e}){return e&&i.preventDefault(),!0},self({event:i,value:e,element:t}){return e?t===i.target:!0}},ob=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function ab(i){let t=i.trim().match(ob)||[],r=t[2],s=t[3];return s&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${s}`,s=""),{eventTarget:lb(t[4]),eventName:r,eventOptions:t[7]?cb(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||s}}function lb(i){if(i=="window")return window;if(i=="document")return document}function cb(i){return i.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function ub(i){if(i==window)return"window";if(i==document)return"document"}function oc(i){return i.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function Ul(i){return oc(i.replace(/--/g,"-").replace(/__/g,"_"))}function nn(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Ud(i){return i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function hb(i){return i.match(/[^\s]+/g)||[]}function _d(i){return i!=null}function zl(i,e){return Object.prototype.hasOwnProperty.call(i,e)}var Od=["meta","ctrl","alt","shift"],Hl=class{constructor(e,t,r,s){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||db(e)||Ho("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||Ho("missing identifier"),this.methodName=r.methodName||Ho("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=s}static forToken(e,t){return new this(e.element,e.index,ab(e.content),t)}toString(){let e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;let t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;let r=t.filter(s=>!Od.includes(s))[0];return r?(zl(this.keyMappings,r)||Ho(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[r].toLowerCase()!==e.key.toLowerCase()):!1}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;let t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){let e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(let{name:r,value:s}of Array.from(this.element.attributes)){let n=r.match(t),o=n&&n[1];o&&(e[oc(o)]=pb(s))}return e}get eventTargetName(){return ub(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[r,s,n,o]=Od.map(a=>t.includes(a));return e.metaKey!==r||e.ctrlKey!==s||e.altKey!==n||e.shiftKey!==o}},Rd={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:i=>i.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function db(i){let e=i.tagName.toLowerCase();if(e in Rd)return Rd[e](i)}function Ho(i){throw new Error(i)}function pb(i){try{return JSON.parse(i)}catch{return i}}var $l=class{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){let t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){let{element:t}=this.action,{actionDescriptorFilters:r}=this.context.application,{controller:s}=this.context,n=!0;for(let[o,a]of Object.entries(this.eventOptions))if(o in r){let l=r[o];n=n&&l({name:o,value:a,event:e,element:t,controller:s})}else continue;return n}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){let{target:t,currentTarget:r}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:r,action:this.methodName})}catch(s){let{identifier:n,controller:o,element:a,index:l}=this,c={identifier:n,controller:o,element:a,index:l,event:e};this.context.handleError(s,`invoking action "${this.action}"`,c)}}willBeInvokedByEvent(e){let t=e.target;return e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e)||e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e)?!1:this.element===t?!0:t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}},$o=class{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.processTree(r,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.elementIsActive(r)&&this.processTree(r,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let r of this.matchElementsInTree(e))t.call(this,r)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1:this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}},qo=class{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new $o(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){let t=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(this.selector));return t.concat(r)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}};function fb(i,e,t){zd(i,e).add(t)}function mb(i,e,t){zd(i,e).delete(t),gb(i,e)}function zd(i,e){let t=i.get(e);return t||(t=new Set,i.set(e,t)),t}function gb(i,e){let t=i.get(e);t!=null&&t.size==0&&i.delete(e)}var Di=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t.concat(Array.from(r)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t+r.size,0)}add(e,t){fb(this.valuesByKey,e,t)}delete(e,t){mb(this.valuesByKey,e,t)}has(e,t){let r=this.valuesByKey.get(e);return r!=null&&r.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(r=>r.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,r])=>r.has(e)).map(([t,r])=>t)}};var ql=class{constructor(e,t,r,s){this._selector=t,this.details=s,this.elementObserver=new $o(e,this),this.delegate=r,this.matchesByElement=new Di}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){let{selector:t}=this;if(t){let r=e.matches(t);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(e,this.details):r}else return!1}matchElementsInTree(e){let{selector:t}=this;if(t){let r=this.matchElement(e)?[e]:[],s=Array.from(e.querySelectorAll(t)).filter(n=>this.matchElement(n));return r.concat(s)}else return[]}elementMatched(e){let{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){let t=this.matchesByElement.getKeysForValue(e);for(let r of t)this.selectorUnmatched(e,r)}elementAttributeChanged(e,t){let{selector:r}=this;if(r){let s=this.matchElement(e),n=this.matchesByElement.has(r,e);s&&!n?this.selectorMatched(e,r):!s&&n&&this.selectorUnmatched(e,r)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}},Vl=class{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){let t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){let r=this.delegate.getStringMapKeyForAttribute(e);if(r!=null){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);let s=this.element.getAttribute(e);if(this.stringMap.get(e)!=s&&this.stringMapValueChanged(s,r,t),s==null){let n=this.stringMap.get(e);this.stringMap.delete(e),n&&this.stringMapKeyRemoved(r,e,n)}else this.stringMap.set(e,s)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,r)}stringMapKeyRemoved(e,t,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,r)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}},Vo=class{constructor(e,t,r){this.attributeObserver=new qo(e,t,this),this.delegate=r,this.tokensByElement=new Di}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){let[t,r]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(r)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(t=>this.tokenMatched(t))}tokensUnmatched(e){e.forEach(t=>this.tokenUnmatched(t))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){let t=this.tokensByElement.getValuesForKey(e),r=this.readTokensForElement(e),s=bb(t,r).findIndex(([n,o])=>!yb(n,o));return s==-1?[[],[]]:[t.slice(s),r.slice(s)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return vb(r,e,t)}};function vb(i,e,t){return i.trim().split(/\s+/).filter(r=>r.length).map((r,s)=>({element:e,attributeName:t,content:r,index:s}))}function bb(i,e){let t=Math.max(i.length,e.length);return Array.from({length:t},(r,s)=>[i[s],e[s]])}function yb(i,e){return i&&e&&i.index==e.index&&i.content==e.content}var jo=class{constructor(e,t,r){this.tokenListObserver=new Vo(e,t,this),this.delegate=r,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).set(e,r),this.delegate.elementMatchedValue(t,r))}tokenUnmatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,r))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(t){return{error:t}}}},jl=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new jo(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){let t=new $l(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){let t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e,!0)),this.bindingsByAction.clear()}parseValueForToken(e){let t=Hl.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},Wl=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new Vl(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){let r=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,r.writer(this.receiver[e]),r.writer(r.defaultValue))}stringMapValueChanged(e,t,r){let s=this.valueDescriptorNameMap[t];e!==null&&(r===null&&(r=s.writer(s.defaultValue)),this.invokeChangedCallback(t,e,r))}stringMapKeyRemoved(e,t,r){let s=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,s.writer(this.receiver[e]),r):this.invokeChangedCallback(e,s.writer(s.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:r,writer:s}of this.valueDescriptors)r!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,s(r),void 0)}invokeChangedCallback(e,t,r){let s=`${e}Changed`,n=this.receiver[s];if(typeof n=="function"){let o=this.valueDescriptorNameMap[e];try{let a=o.reader(t),l=r;r&&(l=o.reader(r)),n.call(this.receiver,a,l)}catch(a){throw a instanceof TypeError&&(a.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${a.message}`),a}}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{let r=this.valueDescriptorMap[t];e[r.name]=r}),e}hasValue(e){let t=this.valueDescriptorNameMap[e],r=`has${nn(t.name)}`;return this.receiver[r]}},Gl=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new Di}start(){this.tokenListObserver||(this.tokenListObserver=new Vo(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var r;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var r;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}};function on(i,e){let t=Hd(i);return Array.from(t.reduce((r,s)=>(Sb(s,e).forEach(n=>r.add(n)),r),new Set))}function wb(i,e){return Hd(i).reduce((r,s)=>(r.push(...Tb(s,e)),r),[])}function Hd(i){let e=[];for(;i;)e.push(i),i=Object.getPrototypeOf(i);return e.reverse()}function Sb(i,e){let t=i[e];return Array.isArray(t)?t:[]}function Tb(i,e){let t=i[e];return t?Object.keys(t).map(r=>[r,t[r]]):[]}var Kl=class{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new Di,this.outletElementsByName=new Di,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)}),this.started=!0,this.dependentContexts.forEach(e=>e.refresh()))}refresh(){this.selectorObserverMap.forEach(e=>e.refresh()),this.attributeObserverMap.forEach(e=>e.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(e=>e.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(e=>e.stop()),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:r}){let s=this.getOutlet(e,r);s&&this.connectOutlet(s,e,r)}selectorUnmatched(e,t,{outletName:r}){let s=this.getOutletFromMap(e,r);s&&this.disconnectOutlet(s,e,r)}selectorMatchElement(e,{outletName:t}){let r=this.selector(t),s=this.hasOutlet(e,t),n=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return r?s&&n&&e.matches(r):!1}elementMatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementAttributeValueChanged(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementUnmatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}connectOutlet(e,t,r){var s;this.outletElementsByName.has(r,t)||(this.outletsByName.add(r,e),this.outletElementsByName.add(r,t),(s=this.selectorObserverMap.get(r))===null||s===void 0||s.pause(()=>this.delegate.outletConnected(e,t,r)))}disconnectOutlet(e,t,r){var s;this.outletElementsByName.has(r,t)&&(this.outletsByName.delete(r,e),this.outletElementsByName.delete(r,t),(s=this.selectorObserverMap.get(r))===null||s===void 0||s.pause(()=>this.delegate.outletDisconnected(e,t,r)))}disconnectAllOutlets(){for(let e of this.outletElementsByName.keys)for(let t of this.outletElementsByName.getValuesForKey(e))for(let r of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(r,t,e)}updateSelectorObserverForOutlet(e){let t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){let t=this.selector(e),r=new ql(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r),r.start()}setupAttributeObserverForOutlet(e){let t=this.attributeNameForOutletName(e),r=new qo(this.scope.element,t,this);this.attributeObserverMap.set(e,r),r.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find(t=>this.attributeNameForOutletName(t)===e)}get outletDependencies(){let e=new Di;return this.router.modules.forEach(t=>{let r=t.definition.controllerConstructor;on(r,"outlets").forEach(n=>e.add(n,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let e=this.dependentControllerIdentifiers;return this.router.contexts.filter(t=>e.includes(t.identifier))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find(r=>r.element===e)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}},Xl=class{constructor(e,t){this.logDebugActivity=(r,s={})=>{let{identifier:n,controller:o,element:a}=this;s=Object.assign({identifier:n,controller:o,element:a},s),this.application.logDebugActivity(this.identifier,r,s)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new jl(this,this.dispatcher),this.valueObserver=new Wl(this,this.controller),this.targetObserver=new Gl(this,this),this.outletObserver=new Kl(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(r){this.handleError(r,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,r={}){let{identifier:s,controller:n,element:o}=this;r=Object.assign({identifier:s,controller:n,element:o},r),this.application.handleError(e,`Error ${t}`,r)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,r){this.invokeControllerMethod(`${Ul(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${Ul(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let r=this.controller;typeof r[e]=="function"&&r[e](...t)}};function Eb(i){return xb(i,kb(i))}function xb(i,e){let t=Fb(i),r=Ab(i.prototype,e);return Object.defineProperties(t.prototype,r),t}function kb(i){return on(i,"blessings").reduce((t,r)=>{let s=r(i);for(let n in s){let o=t[n]||{};t[n]=Object.assign(o,s[n])}return t},{})}function Ab(i,e){return Cb(e).reduce((t,r)=>{let s=Pb(i,e,r);return s&&Object.assign(t,{[r]:s}),t},{})}function Pb(i,e,t){let r=Object.getOwnPropertyDescriptor(i,t);if(!(r&&"value"in r)){let n=Object.getOwnPropertyDescriptor(e,t).value;return r&&(n.get=r.get||n.get,n.set=r.set||n.set),n}}var Cb=typeof Object.getOwnPropertySymbols=="function"?i=>[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)]:Object.getOwnPropertyNames,Fb=(()=>{function i(t){function r(){return Reflect.construct(t,arguments,new.target)}return r.prototype=Object.create(t.prototype,{constructor:{value:r}}),Reflect.setPrototypeOf(r,t),r}function e(){let r=i(function(){this.a.call(this)});return r.prototype.a=function(){},new r}try{return e(),i}catch{return r=>class extends r{}}})();function _b(i){return{identifier:i.identifier,controllerConstructor:Eb(i.controllerConstructor)}}var Yl=class{constructor(e,t){this.application=e,this.definition=_b(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new Xl(this,e),this.contextsByScope.set(e,t)),t}},Zl=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){let t=this.data.get(this.getDataKey(e))||"";return hb(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Ql=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){let r=this.getAttributeNameForKey(e);return this.element.setAttribute(r,t),this.get(e)}has(e){let t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){let t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${Ud(e)}`}},Jl=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,r){let s=this.warnedKeysByObject.get(e);s||(s=new Set,this.warnedKeysByObject.set(e,s)),s.has(t)||(s.add(t),this.logger.warn(r,e))}};function ec(i,e){return`[${i}~="${e}"]`}var tc=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findTarget(r)||this.findLegacyTarget(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllTargets(r),...this.findAllLegacyTargets(r)],[])}findTarget(e){let t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){let t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){let t=this.schema.targetAttributeForScope(this.identifier);return ec(t,e)}findLegacyTarget(e){let t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){let t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(r=>this.deprecate(r,e))}getLegacySelectorForTargetName(e){let t=`${this.identifier}.${e}`;return ec(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:r}=this,s=this.schema.targetAttribute,n=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${s}="${r}.${t}" with ${n}="${t}". The ${s} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},ic=class{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findOutlet(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllOutlets(r)],[])}getSelectorForOutletName(e){let t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){let t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){let t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter(s=>this.matchesElement(s,e,t))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter(s=>this.matchesElement(s,e,t))}matchesElement(e,t,r){let s=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&s.split(" ").includes(r)}},rc=class i{constructor(e,t,r,s){this.targets=new tc(this),this.classes=new Zl(this),this.data=new Ql(this),this.containsElement=n=>n.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new Jl(s),this.outlets=new ic(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return ec(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new i(this.schema,document.documentElement,this.identifier,this.guide.logger)}},sc=class{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new jo(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){let{element:t,content:r}=e;return this.parseValueForElementAndIdentifier(t,r)}parseValueForElementAndIdentifier(e,t){let r=this.fetchScopesByIdentifierForElement(e),s=r.get(t);return s||(s=this.delegate.createScopeForElementAndIdentifier(e,t),r.set(t,s)),s}elementMatchedValue(e,t){let r=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,r),r==1&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){let r=this.scopeReferenceCounts.get(t);r&&(this.scopeReferenceCounts.set(t,r-1),r==1&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}},nc=class{constructor(e){this.application=e,this.scopeObserver=new sc(this.element,this.schema,this),this.scopesByIdentifier=new Di,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);let t=new Yl(this.application,e);this.connectModule(t);let r=e.controllerConstructor.afterLoad;r&&r.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){let r=this.modulesByIdentifier.get(t);if(r)return r.contexts.find(s=>s.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){let r=this.scopeObserver.parseValueForElementAndIdentifier(e,t);r?this.scopeObserver.elementMatchedValue(r.element,r):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new rc(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.connectContextForScope(r))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.disconnectContextForScope(r))}},Ob={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:i=>`data-${i}-target`,outletAttributeForScope:(i,e)=>`data-${i}-${e}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},Ld("abcdefghijklmnopqrstuvwxyz".split("").map(i=>[i,i]))),Ld("0123456789".split("").map(i=>[i,i])))};function Ld(i){return i.reduce((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r}),{})}var Wo=class{constructor(e=document.documentElement,t=Ob){this.logger=console,this.debug=!1,this.logDebugActivity=(r,s,n={})=>{this.debug&&this.logFormattedMessage(r,s,n)},this.element=e,this.schema=t,this.dispatcher=new Bl(this),this.router=new nc(this),this.actionDescriptorFilters=Object.assign({},nb)}static start(e,t){let r=new this(e,t);return r.start(),r}async start(){await Rb(),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(s=>{s.controllerConstructor.shouldLoad&&this.router.loadDefinition(s)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(s=>this.router.unloadIdentifier(s))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){let r=this.router.getContextForElementAndIdentifier(e,t);return r?r.controller:null}handleError(e,t,r){var s;this.logger.error(`%s
3
3
 
4
4
  %o
5
5
 
6
- %o`,t,e,r),(s=window.onerror)===null||s===void 0||s.call(window,t,"",0,0,e)}logFormattedMessage(e,t,r={}){r=Object.assign({application:this},r),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},r)),this.logger.groupEnd()}};function bb(){return new Promise(i=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}function yb(i){return ln(i,"classes").reduce((t,r)=>Object.assign(t,wb(r)),{})}function wb(i){return{[`${i}Class`]:{get(){let{classes:e}=this;if(e.has(i))return e.get(i);{let t=e.getAttributeName(i);throw new Error(`Missing attribute "${t}"`)}}},[`${i}Classes`]:{get(){return this.classes.getAll(i)}},[`has${an(i)}Class`]:{get(){return this.classes.has(i)}}}}function Sb(i){return ln(i,"outlets").reduce((t,r)=>Object.assign(t,Eb(r)),{})}function Pd(i,e,t){return i.application.getControllerForElementAndIdentifier(e,t)}function Cd(i,e,t){let r=Pd(i,e,t);if(r||(i.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),r=Pd(i,e,t),r))return r}function Eb(i){let e=Bl(i);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t){let s=Cd(this,t,i);if(s)return s;throw new Error(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(i);return t.length>0?t.map(r=>{let s=Cd(this,r,i);if(s)return s;console.warn(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`,r)}).filter(r=>r):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t)return t;throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(i)}},[`has${an(e)}Outlet`]:{get(){return this.outlets.has(i)}}}}function Tb(i){return ln(i,"targets").reduce((t,r)=>Object.assign(t,xb(r)),{})}function xb(i){return{[`${i}Target`]:{get(){let e=this.targets.find(i);if(e)return e;throw new Error(`Missing target element "${i}" for "${this.identifier}" controller`)}},[`${i}Targets`]:{get(){return this.targets.findAll(i)}},[`has${an(i)}Target`]:{get(){return this.targets.has(i)}}}}function kb(i){let e=ob(i,"values"),t={valueDescriptorMap:{get(){return e.reduce((r,s)=>{let n=Id(s,this.identifier),o=this.data.getAttributeNameForKey(n.key);return Object.assign(r,{[o]:n})},{})}}};return e.reduce((r,s)=>Object.assign(r,Ab(s)),t)}function Ab(i,e){let t=Id(i,e),{key:r,name:s,reader:n,writer:o}=t;return{[s]:{get(){let a=this.data.get(r);return a!==null?n(a):t.defaultValue},set(a){a===void 0?this.data.delete(r):this.data.set(r,o(a))}},[`has${an(s)}`]:{get(){return this.data.has(r)||t.hasCustomDefaultValue}}}}function Id([i,e],t){return _b({controller:t,token:i,typeDefinition:e})}function Wo(i){switch(i){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function on(i){switch(typeof i){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(i))return"array";if(Object.prototype.toString.call(i)==="[object Object]")return"object"}function Pb(i){let{controller:e,token:t,typeObject:r}=i,s=Td(r.type),n=Td(r.default),o=s&&n,a=s&&!n,l=!s&&n,c=Wo(r.type),d=on(i.typeObject.default);if(a)return c;if(l)return d;if(c!==d){let f=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${f}" must match the defined type "${c}". The provided default value of "${r.default}" is of type "${d}".`)}if(o)return c}function Cb(i){let{controller:e,token:t,typeDefinition:r}=i,n=Pb({controller:e,token:t,typeObject:r}),o=on(r),a=Wo(r),l=n||o||a;if(l)return l;let c=e?`${e}.${r}`:t;throw new Error(`Unknown value type "${c}" for "${t}" value`)}function Fb(i){let e=Wo(i);if(e)return Fd[e];let t=Ul(i,"default"),r=Ul(i,"type"),s=i;if(t)return s.default;if(r){let{type:n}=s,o=Wo(n);if(o)return Fd[o]}return i}function _b(i){let{token:e,typeDefinition:t}=i,r=`${Rd(e)}-value`,s=Cb(i);return{type:s,key:r,name:nc(r),get defaultValue(){return Fb(t)},get hasCustomDefaultValue(){return on(t)!==void 0},reader:Ob[s],writer:_d[s]||_d.default}}var Fd={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Ob={array(i){let e=JSON.parse(i);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${i}" of type "${on(e)}"`);return e},boolean(i){return!(i=="0"||String(i).toLowerCase()=="false")},number(i){return Number(i.replace(/_/g,""))},object(i){let e=JSON.parse(i);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${i}" of type "${on(e)}"`);return e},string(i){return i}},_d={default:Rb,array:Od,object:Od};function Od(i){return JSON.stringify(i)}function Rb(i){return`${i}`}var re=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:r={},prefix:s=this.identifier,bubbles:n=!0,cancelable:o=!0}={}){let a=s?`${s}:${e}`:e,l=new CustomEvent(a,{detail:r,bubbles:n,cancelable:o});return t.dispatchEvent(l),l}};re.blessings=[yb,Tb,kb,Sb];re.targets=[];re.outlets=[];re.values={};var Go=class extends re{static targets=["openIcon","closeIcon"];static outlets=["sidebar"];static values={placement:{type:String,default:"left"},bodyScrolling:{type:Boolean,default:!1},backdrop:{type:Boolean,default:!0},edge:{type:Boolean,default:!1},edgeOffset:{type:String,default:"bottom-[60px]"}};static classes={backdrop:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30"};initialize(){this.visible=!1,this.handleEscapeKey=this.handleEscapeKey.bind(this)}connect(){document.addEventListener("keydown",this.handleEscapeKey)}sidebarOutletConnected(){this.#e(this.sidebarOutlet.element)}disconnect(){this.#i(),document.removeEventListener("keydown",this.handleEscapeKey),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden")}#e(i){i.setAttribute("aria-hidden","true"),i.classList.add("transition-transform"),this.#s(this.placementValue).base.forEach(e=>{i.classList.add(e)})}toggleDrawer(){this.visible?this.hideDrawer():this.showDrawer()}showDrawer(){this.edgeValue?this.#n(`${this.placementValue}-edge`,!0):this.#r(this.placementValue,!0),this.openIconTarget.classList.add("hidden"),this.openIconTarget.setAttribute("aria-hidden","true"),this.closeIconTarget.classList.remove("hidden"),this.closeIconTarget.setAttribute("aria-hidden","false"),this.sidebarOutlet.element.setAttribute("aria-modal","true"),this.sidebarOutlet.element.setAttribute("role","dialog"),this.sidebarOutlet.element.removeAttribute("aria-hidden"),this.bodyScrollingValue||document.body.classList.add("overflow-hidden"),this.backdropValue&&this.#t(),this.visible=!0,this.dispatch("show")}hideDrawer(){this.edgeValue?this.#n(`${this.placementValue}-edge`,!1):this.#r(this.placementValue,!1),this.openIconTarget.classList.remove("hidden"),this.openIconTarget.setAttribute("aria-hidden","false"),this.closeIconTarget.classList.add("hidden"),this.closeIconTarget.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.removeAttribute("aria-modal"),this.sidebarOutlet.element.removeAttribute("role"),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden"),this.backdropValue&&this.#i(),this.visible=!1,this.dispatch("hide")}handleEscapeKey(i){i.key==="Escape"&&this.visible&&this.hideDrawer()}#t(){if(!this.visible){let i=document.createElement("div");i.setAttribute("data-drawer-backdrop",""),i.classList.add(...this.constructor.classes.backdrop.split(" ")),i.addEventListener("click",()=>this.hideDrawer()),document.body.appendChild(i)}}#i(){let i=document.querySelector("[data-drawer-backdrop]");i&&i.remove()}#s(i){let e={top:{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]},right:{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]},bottom:{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]},left:{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]},"bottom-edge":{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this.edgeOffsetValue]}};return e[i]||e.left}#r(i,e){let t=this.#s(i);e?(t.active.forEach(r=>this.sidebarOutlet.element.classList.add(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.remove(r))):(t.active.forEach(r=>this.sidebarOutlet.element.classList.remove(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.add(r)))}#n(i,e){this.#r(i,e)}};var Ko=class extends re{static targets=["target","template","addButton"];static values={wrapperSelector:{type:String,default:".nested-resource-form-fields"},limit:Number};connect(){this.updateState()}add(i){i.preventDefault();let e=this.templateTarget.innerHTML.replace(/NEW_RECORD/g,new Date().getTime().toString());this.targetTarget.insertAdjacentHTML("beforebegin",e);let t=new CustomEvent("nested-resource-form-fields:add",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}remove(i){i.preventDefault();let e=i.target.closest(this.wrapperSelectorValue);if(e.dataset.newRecord!==void 0)e.remove();else{e.style.display="none",e.classList.remove(...e.classList);let r=e.querySelector("input[name*='_destroy']");r.value="1"}let t=new CustomEvent("nested-resource-form-fields:remove",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}updateState(){!this.hasAddButtonTarget||this.limitValue==0||(this.childCount>=this.limitValue?this.addButtonTarget.style.display="none":this.addButtonTarget.style.display="initial")}get childCount(){return this.element.querySelectorAll(this.wrapperSelectorValue).length}};var wx=Ce(Ud(),1),Xo=class extends re{connect(){}submit(){this.element.requestSubmit()}};var De="top",Ye="bottom",qe="right",Ue="left",Yo="auto",cr=[De,Ye,qe,Ue],Ii="start",Tr="end",zd="clippingParents",Zo="viewport",bs="popper",Hd="reference",lc=cr.reduce(function(i,e){return i.concat([e+"-"+Ii,e+"-"+Tr])},[]),Qo=[].concat(cr,[Yo]).reduce(function(i,e){return i.concat([e,e+"-"+Ii,e+"-"+Tr])},[]),Yb="beforeRead",Zb="read",Qb="afterRead",Jb="beforeMain",ey="main",ty="afterMain",iy="beforeWrite",ry="write",sy="afterWrite",$d=[Yb,Zb,Qb,Jb,ey,ty,iy,ry,sy];function et(i){return i?(i.nodeName||"").toLowerCase():null}function Fe(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function qt(i){var e=Fe(i).Element;return i instanceof e||i instanceof Element}function Ze(i){var e=Fe(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function ys(i){if(typeof ShadowRoot>"u")return!1;var e=Fe(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function ny(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},s=e.attributes[t]||{},n=e.elements[t];!Ze(n)||!et(n)||(Object.assign(n.style,r),Object.keys(s).forEach(function(o){var a=s[o];a===!1?n.removeAttribute(o):n.setAttribute(o,a===!0?"":a)}))})}function oy(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var s=e.elements[r],n=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(l,c){return l[c]="",l},{});!Ze(s)||!et(s)||(Object.assign(s.style,a),Object.keys(n).forEach(function(l){s.removeAttribute(l)}))})}}var qd={name:"applyStyles",enabled:!0,phase:"write",fn:ny,effect:oy,requires:["computeStyles"]};function tt(i){return i.split("-")[0]}var ii=Math.max,xr=Math.min,Di=Math.round;function ws(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function cn(){return!/^((?!chrome|android).)*safari/i.test(ws())}function Vt(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),s=1,n=1;e&&Ze(i)&&(s=i.offsetWidth>0&&Di(r.width)/i.offsetWidth||1,n=i.offsetHeight>0&&Di(r.height)/i.offsetHeight||1);var o=qt(i)?Fe(i):window,a=o.visualViewport,l=!cn()&&t,c=(r.left+(l&&a?a.offsetLeft:0))/s,d=(r.top+(l&&a?a.offsetTop:0))/n,f=r.width/s,y=r.height/n;return{width:f,height:y,top:d,right:c+f,bottom:d+y,left:c,x:c,y:d}}function kr(i){var e=Vt(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function un(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&ys(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ft(i){return Fe(i).getComputedStyle(i)}function cc(i){return["table","td","th"].indexOf(et(i))>=0}function nt(i){return((qt(i)?i.ownerDocument:i.document)||window.document).documentElement}function Ni(i){return et(i)==="html"?i:i.assignedSlot||i.parentNode||(ys(i)?i.host:null)||nt(i)}function Vd(i){return!Ze(i)||ft(i).position==="fixed"?null:i.offsetParent}function ay(i){var e=/firefox/i.test(ws()),t=/Trident/i.test(ws());if(t&&Ze(i)){var r=ft(i);if(r.position==="fixed")return null}var s=Ni(i);for(ys(s)&&(s=s.host);Ze(s)&&["html","body"].indexOf(et(s))<0;){var n=ft(s);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return s;s=s.parentNode}return null}function ri(i){for(var e=Fe(i),t=Vd(i);t&&cc(t)&&ft(t).position==="static";)t=Vd(t);return t&&(et(t)==="html"||et(t)==="body"&&ft(t).position==="static")?e:t||ay(i)||e}function Ar(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function Pr(i,e,t){return ii(i,xr(e,t))}function jd(i,e,t){var r=Pr(i,e,t);return r>t?t:r}function hn(){return{top:0,right:0,bottom:0,left:0}}function dn(i){return Object.assign({},hn(),i)}function pn(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var ly=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,dn(typeof e!="number"?e:pn(e,cr))};function cy(i){var e,t=i.state,r=i.name,s=i.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=tt(t.placement),l=Ar(a),c=[Ue,qe].indexOf(a)>=0,d=c?"height":"width";if(!(!n||!o)){var f=ly(s.padding,t),y=kr(n),v=l==="y"?De:Ue,x=l==="y"?Ye:qe,P=t.rects.reference[d]+t.rects.reference[l]-o[l]-t.rects.popper[d],C=o[l]-t.rects.reference[l],I=ri(n),D=I?l==="y"?I.clientHeight||0:I.clientWidth||0:0,q=P/2-C/2,M=f[v],H=D-y[d]-f[x],R=D/2-y[d]/2+q,G=Pr(M,R,H),K=l;t.modifiersData[r]=(e={},e[K]=G,e.centerOffset=G-R,e)}}function uy(i){var e=i.state,t=i.options,r=t.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||un(e.elements.popper,s)&&(e.elements.arrow=s))}var Wd={name:"arrow",enabled:!0,phase:"main",fn:cy,effect:uy,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function jt(i){return i.split("-")[1]}var hy={top:"auto",right:"auto",bottom:"auto",left:"auto"};function dy(i,e){var t=i.x,r=i.y,s=e.devicePixelRatio||1;return{x:Di(t*s)/s||0,y:Di(r*s)/s||0}}function Gd(i){var e,t=i.popper,r=i.popperRect,s=i.placement,n=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,c=i.adaptive,d=i.roundOffsets,f=i.isFixed,y=o.x,v=y===void 0?0:y,x=o.y,P=x===void 0?0:x,C=typeof d=="function"?d({x:v,y:P}):{x:v,y:P};v=C.x,P=C.y;var I=o.hasOwnProperty("x"),D=o.hasOwnProperty("y"),q=Ue,M=De,H=window;if(c){var R=ri(t),G="clientHeight",K="clientWidth";if(R===Fe(t)&&(R=nt(t),ft(R).position!=="static"&&a==="absolute"&&(G="scrollHeight",K="scrollWidth")),R=R,s===De||(s===Ue||s===qe)&&n===Tr){M=Ye;var Y=f&&R===H&&H.visualViewport?H.visualViewport.height:R[G];P-=Y-r.height,P*=l?1:-1}if(s===Ue||(s===De||s===Ye)&&n===Tr){q=qe;var ie=f&&R===H&&H.visualViewport?H.visualViewport.width:R[K];v-=ie-r.width,v*=l?1:-1}}var Q=Object.assign({position:a},c&&hy),oe=d===!0?dy({x:v,y:P},Fe(t)):{x:v,y:P};if(v=oe.x,P=oe.y,l){var le;return Object.assign({},Q,(le={},le[M]=D?"0":"",le[q]=I?"0":"",le.transform=(H.devicePixelRatio||1)<=1?"translate("+v+"px, "+P+"px)":"translate3d("+v+"px, "+P+"px, 0)",le))}return Object.assign({},Q,(e={},e[M]=D?P+"px":"",e[q]=I?v+"px":"",e.transform="",e))}function py(i){var e=i.state,t=i.options,r=t.gpuAcceleration,s=r===void 0?!0:r,n=t.adaptive,o=n===void 0?!0:n,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:tt(e.placement),variation:jt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Gd(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Gd(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Kd={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:py,data:{}};var Jo={passive:!0};function fy(i){var e=i.state,t=i.instance,r=i.options,s=r.scroll,n=s===void 0?!0:s,o=r.resize,a=o===void 0?!0:o,l=Fe(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&c.forEach(function(d){d.addEventListener("scroll",t.update,Jo)}),a&&l.addEventListener("resize",t.update,Jo),function(){n&&c.forEach(function(d){d.removeEventListener("scroll",t.update,Jo)}),a&&l.removeEventListener("resize",t.update,Jo)}}var Xd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fy,data:{}};var my={left:"right",right:"left",bottom:"top",top:"bottom"};function Ss(i){return i.replace(/left|right|bottom|top/g,function(e){return my[e]})}var gy={start:"end",end:"start"};function ea(i){return i.replace(/start|end/g,function(e){return gy[e]})}function Cr(i){var e=Fe(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Fr(i){return Vt(nt(i)).left+Cr(i).scrollLeft}function uc(i,e){var t=Fe(i),r=nt(i),s=t.visualViewport,n=r.clientWidth,o=r.clientHeight,a=0,l=0;if(s){n=s.width,o=s.height;var c=cn();(c||!c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:n,height:o,x:a+Fr(i),y:l}}function hc(i){var e,t=nt(i),r=Cr(i),s=(e=i.ownerDocument)==null?void 0:e.body,n=ii(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=ii(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-r.scrollLeft+Fr(i),l=-r.scrollTop;return ft(s||t).direction==="rtl"&&(a+=ii(t.clientWidth,s?s.clientWidth:0)-n),{width:n,height:o,x:a,y:l}}function _r(i){var e=ft(i),t=e.overflow,r=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+r)}function ta(i){return["html","body","#document"].indexOf(et(i))>=0?i.ownerDocument.body:Ze(i)&&_r(i)?i:ta(Ni(i))}function ur(i,e){var t;e===void 0&&(e=[]);var r=ta(i),s=r===((t=i.ownerDocument)==null?void 0:t.body),n=Fe(r),o=s?[n].concat(n.visualViewport||[],_r(r)?r:[]):r,a=e.concat(o);return s?a:a.concat(ur(Ni(o)))}function Es(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function vy(i,e){var t=Vt(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function Yd(i,e,t){return e===Zo?Es(uc(i,t)):qt(e)?vy(e,t):Es(hc(nt(i)))}function by(i){var e=ur(Ni(i)),t=["absolute","fixed"].indexOf(ft(i).position)>=0,r=t&&Ze(i)?ri(i):i;return qt(r)?e.filter(function(s){return qt(s)&&un(s,r)&&et(s)!=="body"}):[]}function dc(i,e,t,r){var s=e==="clippingParents"?by(i):[].concat(e),n=[].concat(s,[t]),o=n[0],a=n.reduce(function(l,c){var d=Yd(i,c,r);return l.top=ii(d.top,l.top),l.right=xr(d.right,l.right),l.bottom=xr(d.bottom,l.bottom),l.left=ii(d.left,l.left),l},Yd(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function fn(i){var e=i.reference,t=i.element,r=i.placement,s=r?tt(r):null,n=r?jt(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(s){case De:l={x:o,y:e.y-t.height};break;case Ye:l={x:o,y:e.y+e.height};break;case qe:l={x:e.x+e.width,y:a};break;case Ue:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=s?Ar(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(n){case Ii:l[c]=l[c]-(e[d]/2-t[d]/2);break;case Tr:l[c]=l[c]+(e[d]/2-t[d]/2);break;default:}}return l}function si(i,e){e===void 0&&(e={});var t=e,r=t.placement,s=r===void 0?i.placement:r,n=t.strategy,o=n===void 0?i.strategy:n,a=t.boundary,l=a===void 0?zd:a,c=t.rootBoundary,d=c===void 0?Zo:c,f=t.elementContext,y=f===void 0?bs:f,v=t.altBoundary,x=v===void 0?!1:v,P=t.padding,C=P===void 0?0:P,I=dn(typeof C!="number"?C:pn(C,cr)),D=y===bs?Hd:bs,q=i.rects.popper,M=i.elements[x?D:y],H=dc(qt(M)?M:M.contextElement||nt(i.elements.popper),l,d,o),R=Vt(i.elements.reference),G=fn({reference:R,element:q,strategy:"absolute",placement:s}),K=Es(Object.assign({},q,G)),Y=y===bs?K:R,ie={top:H.top-Y.top+I.top,bottom:Y.bottom-H.bottom+I.bottom,left:H.left-Y.left+I.left,right:Y.right-H.right+I.right},Q=i.modifiersData.offset;if(y===bs&&Q){var oe=Q[s];Object.keys(ie).forEach(function(le){var ke=[qe,Ye].indexOf(le)>=0?1:-1,We=[De,Ye].indexOf(le)>=0?"y":"x";ie[le]+=oe[We]*ke})}return ie}function pc(i,e){e===void 0&&(e={});var t=e,r=t.placement,s=t.boundary,n=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?Qo:l,d=jt(r),f=d?a?lc:lc.filter(function(x){return jt(x)===d}):cr,y=f.filter(function(x){return c.indexOf(x)>=0});y.length===0&&(y=f);var v=y.reduce(function(x,P){return x[P]=si(i,{placement:P,boundary:s,rootBoundary:n,padding:o})[tt(P)],x},{});return Object.keys(v).sort(function(x,P){return v[x]-v[P]})}function yy(i){if(tt(i)===Yo)return[];var e=Ss(i);return[ea(i),e,ea(e)]}function wy(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var s=t.mainAxis,n=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,c=t.padding,d=t.boundary,f=t.rootBoundary,y=t.altBoundary,v=t.flipVariations,x=v===void 0?!0:v,P=t.allowedAutoPlacements,C=e.options.placement,I=tt(C),D=I===C,q=l||(D||!x?[Ss(C)]:yy(C)),M=[C].concat(q).reduce(function(Ae,ne){return Ae.concat(tt(ne)===Yo?pc(e,{placement:ne,boundary:d,rootBoundary:f,padding:c,flipVariations:x,allowedAutoPlacements:P}):ne)},[]),H=e.rects.reference,R=e.rects.popper,G=new Map,K=!0,Y=M[0],ie=0;ie<M.length;ie++){var Q=M[ie],oe=tt(Q),le=jt(Q)===Ii,ke=[De,Ye].indexOf(oe)>=0,We=ke?"width":"height",T=si(e,{placement:Q,boundary:d,rootBoundary:f,altBoundary:y,padding:c}),k=ke?le?qe:Ue:le?Ye:De;H[We]>R[We]&&(k=Ss(k));var A=Ss(k),$=[];if(n&&$.push(T[oe]<=0),a&&$.push(T[k]<=0,T[A]<=0),$.every(function(Ae){return Ae})){Y=Q,K=!1;break}G.set(Q,$)}if(K)for(var j=x?3:1,z=function(ne){var ce=M.find(function(Me){var Ne=G.get(Me);if(Ne)return Ne.slice(0,ne).every(function(He){return He})});if(ce)return Y=ce,"break"},J=j;J>0;J--){var ee=z(J);if(ee==="break")break}e.placement!==Y&&(e.modifiersData[r]._skip=!0,e.placement=Y,e.reset=!0)}}var Zd={name:"flip",enabled:!0,phase:"main",fn:wy,requiresIfExists:["offset"],data:{_skip:!1}};function Qd(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function Jd(i){return[De,qe,Ye,Ue].some(function(e){return i[e]>=0})}function Sy(i){var e=i.state,t=i.name,r=e.rects.reference,s=e.rects.popper,n=e.modifiersData.preventOverflow,o=si(e,{elementContext:"reference"}),a=si(e,{altBoundary:!0}),l=Qd(o,r),c=Qd(a,s,n),d=Jd(l),f=Jd(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}var ep={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Sy};function Ey(i,e,t){var r=tt(i),s=[Ue,De].indexOf(r)>=0?-1:1,n=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=n[0],a=n[1];return o=o||0,a=(a||0)*s,[Ue,qe].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Ty(i){var e=i.state,t=i.options,r=i.name,s=t.offset,n=s===void 0?[0,0]:s,o=Qo.reduce(function(d,f){return d[f]=Ey(f,e.rects,n),d},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}var tp={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ty};function xy(i){var e=i.state,t=i.name;e.modifiersData[t]=fn({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var ip={name:"popperOffsets",enabled:!0,phase:"read",fn:xy,data:{}};function fc(i){return i==="x"?"y":"x"}function ky(i){var e=i.state,t=i.options,r=i.name,s=t.mainAxis,n=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,c=t.rootBoundary,d=t.altBoundary,f=t.padding,y=t.tether,v=y===void 0?!0:y,x=t.tetherOffset,P=x===void 0?0:x,C=si(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:d}),I=tt(e.placement),D=jt(e.placement),q=!D,M=Ar(I),H=fc(M),R=e.modifiersData.popperOffsets,G=e.rects.reference,K=e.rects.popper,Y=typeof P=="function"?P(Object.assign({},e.rects,{placement:e.placement})):P,ie=typeof Y=="number"?{mainAxis:Y,altAxis:Y}:Object.assign({mainAxis:0,altAxis:0},Y),Q=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,oe={x:0,y:0};if(R){if(n){var le,ke=M==="y"?De:Ue,We=M==="y"?Ye:qe,T=M==="y"?"height":"width",k=R[M],A=k+C[ke],$=k-C[We],j=v?-K[T]/2:0,z=D===Ii?G[T]:K[T],J=D===Ii?-K[T]:-G[T],ee=e.elements.arrow,Ae=v&&ee?kr(ee):{width:0,height:0},ne=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:hn(),ce=ne[ke],Me=ne[We],Ne=Pr(0,G[T],Ae[T]),He=q?G[T]/2-j-Ne-ce-ie.mainAxis:z-Ne-ce-ie.mainAxis,fi=q?-G[T]/2+j+Ne+Me+ie.mainAxis:J+Ne+Me+ie.mainAxis,mi=e.elements.arrow&&ri(e.elements.arrow),Yt=mi?M==="y"?mi.clientTop||0:mi.clientLeft||0:0,er=(le=Q?.[M])!=null?le:0,Zt=k+He-er-Yt,br=k+fi-er,Ai=Pr(v?xr(A,Zt):A,k,v?ii($,br):$);R[M]=Ai,oe[M]=Ai-k}if(a){var Ut,Pi=M==="x"?De:Ue,Ci=M==="x"?Ye:qe,Ct=R[H],gi=H==="y"?"height":"width",tr=Ct+C[Pi],Fi=Ct-C[Ci],Qt=[De,Ue].indexOf(I)!==-1,Jt=(Ut=Q?.[H])!=null?Ut:0,ei=Qt?tr:Ct-G[gi]-K[gi]-Jt+ie.altAxis,yr=Qt?Ct+G[gi]+K[gi]-Jt-ie.altAxis:Fi,ir=v&&Qt?jd(ei,Ct,yr):Pr(v?ei:tr,Ct,v?yr:Fi);R[H]=ir,oe[H]=ir-Ct}e.modifiersData[r]=oe}}var rp={name:"preventOverflow",enabled:!0,phase:"main",fn:ky,requiresIfExists:["offset"]};function mc(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function gc(i){return i===Fe(i)||!Ze(i)?Cr(i):mc(i)}function Ay(i){var e=i.getBoundingClientRect(),t=Di(e.width)/i.offsetWidth||1,r=Di(e.height)/i.offsetHeight||1;return t!==1||r!==1}function vc(i,e,t){t===void 0&&(t=!1);var r=Ze(e),s=Ze(e)&&Ay(e),n=nt(e),o=Vt(i,s,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((et(e)!=="body"||_r(n))&&(a=gc(e)),Ze(e)?(l=Vt(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):n&&(l.x=Fr(n))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Py(i){var e=new Map,t=new Set,r=[];i.forEach(function(n){e.set(n.name,n)});function s(n){t.add(n.name);var o=[].concat(n.requires||[],n.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&s(l)}}),r.push(n)}return i.forEach(function(n){t.has(n.name)||s(n)}),r}function bc(i){var e=Py(i);return $d.reduce(function(t,r){return t.concat(e.filter(function(s){return s.phase===r}))},[])}function yc(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function wc(i){var e=i.reduce(function(t,r){var s=t[r.name];return t[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var sp={placement:"bottom",modifiers:[],strategy:"absolute"};function np(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function op(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,s=e.defaultOptions,n=s===void 0?sp:s;return function(a,l,c){c===void 0&&(c=n);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},sp,n),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],y=!1,v={state:d,setOptions:function(I){var D=typeof I=="function"?I(d.options):I;P(),d.options=Object.assign({},n,d.options,D),d.scrollParents={reference:qt(a)?ur(a):a.contextElement?ur(a.contextElement):[],popper:ur(l)};var q=bc(wc([].concat(r,d.options.modifiers)));return d.orderedModifiers=q.filter(function(M){return M.enabled}),x(),v.update()},forceUpdate:function(){if(!y){var I=d.elements,D=I.reference,q=I.popper;if(np(D,q)){d.rects={reference:vc(D,ri(q),d.options.strategy==="fixed"),popper:kr(q)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(ie){return d.modifiersData[ie.name]=Object.assign({},ie.data)});for(var M=0;M<d.orderedModifiers.length;M++){if(d.reset===!0){d.reset=!1,M=-1;continue}var H=d.orderedModifiers[M],R=H.fn,G=H.options,K=G===void 0?{}:G,Y=H.name;typeof R=="function"&&(d=R({state:d,options:K,name:Y,instance:v})||d)}}}},update:yc(function(){return new Promise(function(C){v.forceUpdate(),C(d)})}),destroy:function(){P(),y=!0}};if(!np(a,l))return v;v.setOptions(c).then(function(C){!y&&c.onFirstUpdate&&c.onFirstUpdate(C)});function x(){d.orderedModifiers.forEach(function(C){var I=C.name,D=C.options,q=D===void 0?{}:D,M=C.effect;if(typeof M=="function"){var H=M({state:d,name:I,instance:v,options:q}),R=function(){};f.push(H||R)}})}function P(){f.forEach(function(C){return C()}),f=[]}return v}}var Cy=[Xd,ip,Kd,qd,tp,Zd,rp,Wd,ep],Sc=op({defaultModifiers:Cy});var ia=class extends re{static targets=["trigger","menu"];connect(){this.visible=!1,this.initialized=!1,this.options={placement:"bottom",triggerType:"click",offsetSkidding:0,offsetDistance:10,delay:300,ignoreClickOutsideClass:!1},this.init()}init(){this.triggerTarget&&this.menuTarget&&!this.initialized&&(this.popperInstance=Sc(this.triggerTarget,this.menuTarget,{placement:this.options.placement,modifiers:[{name:"offset",options:{offset:[this.options.offsetSkidding,this.options.offsetDistance]}}]}),this.setupEventListeners(),this.initialized=!0)}disconnect(){this.initialized&&(this.options.triggerType==="click"&&this.triggerTarget.removeEventListener("click",this.clickHandler),this.options.triggerType==="hover"&&(this.triggerTarget.removeEventListener("mouseenter",this.hoverShowTriggerHandler),this.menuTarget.removeEventListener("mouseenter",this.hoverShowMenuHandler),this.triggerTarget.removeEventListener("mouseleave",this.hoverHideHandler),this.menuTarget.removeEventListener("mouseleave",this.hoverHideHandler)),this.removeClickOutsideListener(),this.popperInstance.destroy(),this.initialized=!1)}setupEventListeners(){this.clickHandler=this.toggle.bind(this),this.hoverShowTriggerHandler=i=>{i.type==="click"?this.toggle():setTimeout(()=>{this.show()},this.options.delay)},this.hoverShowMenuHandler=()=>{this.show()},this.hoverHideHandler=()=>{setTimeout(()=>{this.menuTarget.matches(":hover")||this.hide()},this.options.delay)},this.options.triggerType==="click"?this.triggerTarget.addEventListener("click",this.clickHandler):this.options.triggerType==="hover"&&(this.triggerTarget.addEventListener("mouseenter",this.hoverShowTriggerHandler),this.menuTarget.addEventListener("mouseenter",this.hoverShowMenuHandler),this.triggerTarget.addEventListener("mouseleave",this.hoverHideHandler),this.menuTarget.addEventListener("mouseleave",this.hoverHideHandler))}setupClickOutsideListener(){this.clickOutsideHandler=i=>{let e=i.target,t=this.options.ignoreClickOutsideClass,r=!1;t&&document.querySelectorAll(`.${t}`).forEach(n=>{if(n.contains(e)){r=!0;return}}),e!==this.menuTarget&&!this.menuTarget.contains(e)&&!this.triggerTarget.contains(e)&&!r&&this.visible&&this.hide()},document.body.addEventListener("click",this.clickOutsideHandler,!0)}removeClickOutsideListener(){this.clickOutsideHandler&&document.body.removeEventListener("click",this.clickOutsideHandler,!0)}toggle(){this.visible?this.hide():this.show()}show(){this.menuTarget.classList.remove("hidden"),this.menuTarget.classList.add("block"),this.menuTarget.removeAttribute("aria-hidden"),this.popperInstance.setOptions(i=>({...i,modifiers:[...i.modifiers,{name:"eventListeners",enabled:!0}]})),this.setupClickOutsideListener(),this.popperInstance.update(),this.visible=!0}hide(){this.menuTarget.classList.remove("block"),this.menuTarget.classList.add("hidden"),this.menuTarget.setAttribute("aria-hidden","true"),this.popperInstance.setOptions(i=>({...i,modifiers:[...i.modifiers,{name:"eventListeners",enabled:!1}]})),this.removeClickOutsideListener(),this.visible=!1}};var ra=class extends re{static targets=["trigger","menu"];connect(){this.element.hasAttribute("data-visible")||this.element.setAttribute("data-visible","false"),this.#e()}toggle(){let i=this.element.getAttribute("data-visible")==="true";this.element.setAttribute("data-visible",(!i).toString()),this.#e()}#e(){this.element.getAttribute("data-visible")==="true"?(this.menuTarget.classList.remove("hidden"),this.triggerTarget.setAttribute("aria-expanded","true"),this.dispatch("expand")):(this.menuTarget.classList.add("hidden"),this.triggerTarget.setAttribute("aria-expanded","false"),this.dispatch("collapse"))}};var sa=class extends re{static values={after:Number};connect(){this.hasAfterValue&&this.afterValue>0&&(this.autoDismissTimeout=setTimeout(()=>{this.dismiss(),this.autoDismissTimeout=null},this.afterValue))}disconnect(){this.autoDismissTimeout&&clearTimeout(this.autoDismissTimeout),this.autoDismissTimeout=null}dismiss(){this.element.remove()}};var na=class extends re{static targets=["frame","refreshButton","backButton","homeButton","maximizeLink"];connect(){this.#t(),this.srcHistory=[],this.originalFrameSrc=this.frameTarget.src,this.hasRefreshButtonTarget&&(this.refreshButtonTarget.style.display="",this.refreshButtonClicked=this.refreshButtonClicked.bind(this),this.refreshButtonTarget.addEventListener("click",this.refreshButtonClicked)),this.hasBackButtonTarget&&(this.backButtonClicked=this.backButtonClicked.bind(this),this.backButtonTarget.addEventListener("click",this.backButtonClicked)),this.hasHomeButtonTarget&&(this.homeButtonClicked=this.homeButtonClicked.bind(this),this.homeButtonTarget.addEventListener("click",this.homeButtonClicked)),this.frameLoaded=this.frameLoaded.bind(this),this.frameTarget.addEventListener("turbo:frame-load",this.frameLoaded),this.frameLoading=this.frameLoading.bind(this),this.frameTarget.addEventListener("turbo:click",this.frameLoading),this.frameTarget.addEventListener("turbo:submit-start",this.frameLoading),this.frameFailed=this.frameFailed.bind(this),this.frameTarget.addEventListener("turbo:fetch-request-error",this.frameFailed)}disconnect(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.removeEventListener("click",this.refreshButtonClicked),this.hasBackButtonTarget&&this.backButtonTarget.removeEventListener("click",this.backButtonClicked),this.hasHomeButtonTarget&&this.homeButtonTarget.removeEventListener("click",this.homeButtonClicked),this.frameTarget.removeEventListener("turbo:frame-load",this.frameLoaded),this.frameTarget.removeEventListener("turbo:click",this.frameLoading),this.frameTarget.removeEventListener("turbo:submit-start",this.frameLoading),this.frameTarget.removeEventListener("turbo:fetch-request-error",this.frameFailed)}frameLoading(i){this.#t()}frameFailed(i){this.#i()}frameLoaded(i){this.#i();let e=i.target.src;this.#e(e)}refreshButtonClicked(i){this.frameLoading(null),this.frameTarget.reload()}backButtonClicked(i){this.frameLoading(null),this.srcHistory.pop(),this.frameTarget.src=this.currentSrc}homeButtonClicked(i){this.frameLoading(null),this.frameTarget.src=this.originalFrameSrc}get currentSrc(){return this.srcHistory[this.srcHistory.length-1]}#e(i){i==this.currentSrc||(i==this.originalFrameSrc?this.srcHistory=[i]:this.srcHistory.push(i)),this.#s(),this.hasMaximizeLinkTarget&&(this.maximizeLinkTarget.href=i)}#t(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.add("motion-safe:animate-spin"),this.frameTarget.classList.add("motion-safe:animate-pulse")}#i(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.remove("motion-safe:animate-spin"),this.frameTarget.classList.remove("motion-safe:animate-pulse")}#s(){this.hasHomeButtonTarget&&(this.homeButtonTarget.style.display=this.srcHistory.length>2?"":"none"),this.hasBackButtonTarget&&(this.backButtonTarget.style.display=this.srcHistory.length>1?"":"none")}};var oa=class extends re{connect(){this.updateColorMode()}disconnect(){}updateColorMode(){localStorage.theme==="dark"||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}setLightColorMode(){localStorage.theme="light",this.updateColorMode()}setDarkColorMode(){localStorage.theme="dark",this.updateColorMode()}setSystemColorMode(){localStorage.removeItem("theme"),this.updateColorMode()}};var{entries:gp,setPrototypeOf:ap,isFrozen:Fy,getPrototypeOf:_y,getOwnPropertyDescriptor:Oy}=Object,{freeze:gt,seal:Wt,create:vp}=Object,{apply:Pc,construct:Cc}=typeof Reflect<"u"&&Reflect;gt||(gt=function(e){return e});Wt||(Wt=function(e){return e});Pc||(Pc=function(e,t,r){return e.apply(t,r)});Cc||(Cc=function(e,t){return new e(...t)});var aa=Ot(Array.prototype.forEach),lp=Ot(Array.prototype.pop),mn=Ot(Array.prototype.push),ca=Ot(String.prototype.toLowerCase),Ec=Ot(String.prototype.toString),cp=Ot(String.prototype.match),gn=Ot(String.prototype.replace),Ry=Ot(String.prototype.indexOf),Ly=Ot(String.prototype.trim),ni=Ot(Object.prototype.hasOwnProperty),mt=Ot(RegExp.prototype.test),vn=My(TypeError);function Ot(i){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return Pc(i,e,r)}}function My(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Cc(i,t)}}function ae(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ca;ap&&ap(i,null);let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){let n=t(s);n!==s&&(Fy(e)||(e[r]=n),s=n)}i[s]=!0}return i}function Iy(i){for(let e=0;e<i.length;e++)ni(i,e)||(i[e]=null);return i}function Or(i){let e=vp(null);for(let[t,r]of gp(i))ni(i,t)&&(Array.isArray(r)?e[t]=Iy(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Or(r):e[t]=r);return e}function bn(i,e){for(;i!==null;){let r=Oy(i,e);if(r){if(r.get)return Ot(r.get);if(typeof r.value=="function")return Ot(r.value)}i=_y(i)}function t(){return null}return t}var up=gt(["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","section","select","shadow","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"]),Tc=gt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xc=gt(["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"]),Dy=gt(["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"]),kc=gt(["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"]),Ny=gt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hp=gt(["#text"]),dp=gt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ac=gt(["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","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","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","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-rendering","textlength","type","u1","u2","unicode","values","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"]),pp=gt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),la=gt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),By=Wt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Uy=Wt(/<%[\w\W]*|[\w\W]*%>/gm),zy=Wt(/\${[\w\W]*}/gm),Hy=Wt(/^data-[\-\w.\u00B7-\uFFFF]/),$y=Wt(/^aria-[\-\w]+$/),bp=Wt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qy=Wt(/^(?:\w+script|data):/i),Vy=Wt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yp=Wt(/^html$/i),jy=Wt(/^[a-z][.\w]*(-[.\w]+)+$/i),fp=Object.freeze({__proto__:null,ARIA_ATTR:$y,ATTR_WHITESPACE:Vy,CUSTOM_ELEMENT:jy,DATA_ATTR:Hy,DOCTYPE_NAME:yp,ERB_EXPR:Uy,IS_ALLOWED_URI:bp,IS_SCRIPT_OR_DATA:qy,MUSTACHE_EXPR:By,TMPLIT_EXPR:zy}),yn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Wy=function(){return typeof window>"u"?null:window},Gy=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(r=t.getAttribute(s));let n="dompurify"+(r?"#"+r:"");try{return e.createPolicy(n,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+n+" could not be created."),null}},mp=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function wp(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wy(),e=Z=>wp(Z);if(e.version="3.2.2",e.removed=[],!i||!i.document||i.document.nodeType!==yn.document)return e.isSupported=!1,e;let{document:t}=i,r=t,s=r.currentScript,{DocumentFragment:n,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:f,DOMParser:y,trustedTypes:v}=i,x=l.prototype,P=bn(x,"cloneNode"),C=bn(x,"remove"),I=bn(x,"nextSibling"),D=bn(x,"childNodes"),q=bn(x,"parentNode");if(typeof o=="function"){let Z=t.createElement("template");Z.content&&Z.content.ownerDocument&&(t=Z.content.ownerDocument)}let M,H="",{implementation:R,createNodeIterator:G,createDocumentFragment:K,getElementsByTagName:Y}=t,{importNode:ie}=r,Q=mp();e.isSupported=typeof gp=="function"&&typeof q=="function"&&R&&R.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:oe,ERB_EXPR:le,TMPLIT_EXPR:ke,DATA_ATTR:We,ARIA_ATTR:T,IS_SCRIPT_OR_DATA:k,ATTR_WHITESPACE:A,CUSTOM_ELEMENT:$}=fp,{IS_ALLOWED_URI:j}=fp,z=null,J=ae({},[...up,...Tc,...xc,...kc,...hp]),ee=null,Ae=ae({},[...dp,...Ac,...pp,...la]),ne=Object.seal(vp(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}})),ce=null,Me=null,Ne=!0,He=!0,fi=!1,mi=!0,Yt=!1,er=!0,Zt=!1,br=!1,Ai=!1,Ut=!1,Pi=!1,Ci=!1,Ct=!0,gi=!1,tr="user-content-",Fi=!0,Qt=!1,Jt={},ei=null,yr=ae({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ir=null,en=ae({},["audio","video","img","source","image","track"]),fs=null,Lo=ae({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ms="http://www.w3.org/1998/Math/MathML",se="http://www.w3.org/2000/svg",zt="http://www.w3.org/1999/xhtml",vi=zt,ti=!1,tn=null,rr=ae({},[ms,se,zt],Ec),Ge=ae({},["mi","mo","mn","ms","mtext"]),gs=ae({},["annotation-xml"]),Mo=ae({},["title","style","font","a","script"]),ye=null,we=["application/xhtml+xml","text/html"],Ol="text/html",Te=null,sr=null,bi=t.createElement("form"),Io=function(w){return w instanceof RegExp||w instanceof Function},Ie=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(sr&&sr===w)){if((!w||typeof w!="object")&&(w={}),w=Or(w),ye=we.indexOf(w.PARSER_MEDIA_TYPE)===-1?Ol:w.PARSER_MEDIA_TYPE,Te=ye==="application/xhtml+xml"?Ec:ca,z=ni(w,"ALLOWED_TAGS")?ae({},w.ALLOWED_TAGS,Te):J,ee=ni(w,"ALLOWED_ATTR")?ae({},w.ALLOWED_ATTR,Te):Ae,tn=ni(w,"ALLOWED_NAMESPACES")?ae({},w.ALLOWED_NAMESPACES,Ec):rr,fs=ni(w,"ADD_URI_SAFE_ATTR")?ae(Or(Lo),w.ADD_URI_SAFE_ATTR,Te):Lo,ir=ni(w,"ADD_DATA_URI_TAGS")?ae(Or(en),w.ADD_DATA_URI_TAGS,Te):en,ei=ni(w,"FORBID_CONTENTS")?ae({},w.FORBID_CONTENTS,Te):yr,ce=ni(w,"FORBID_TAGS")?ae({},w.FORBID_TAGS,Te):{},Me=ni(w,"FORBID_ATTR")?ae({},w.FORBID_ATTR,Te):{},Jt=ni(w,"USE_PROFILES")?w.USE_PROFILES:!1,Ne=w.ALLOW_ARIA_ATTR!==!1,He=w.ALLOW_DATA_ATTR!==!1,fi=w.ALLOW_UNKNOWN_PROTOCOLS||!1,mi=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Yt=w.SAFE_FOR_TEMPLATES||!1,er=w.SAFE_FOR_XML!==!1,Zt=w.WHOLE_DOCUMENT||!1,Ut=w.RETURN_DOM||!1,Pi=w.RETURN_DOM_FRAGMENT||!1,Ci=w.RETURN_TRUSTED_TYPE||!1,Ai=w.FORCE_BODY||!1,Ct=w.SANITIZE_DOM!==!1,gi=w.SANITIZE_NAMED_PROPS||!1,Fi=w.KEEP_CONTENT!==!1,Qt=w.IN_PLACE||!1,j=w.ALLOWED_URI_REGEXP||bp,vi=w.NAMESPACE||zt,Ge=w.MATHML_TEXT_INTEGRATION_POINTS||Ge,gs=w.HTML_INTEGRATION_POINTS||gs,ne=w.CUSTOM_ELEMENT_HANDLING||{},w.CUSTOM_ELEMENT_HANDLING&&Io(w.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ne.tagNameCheck=w.CUSTOM_ELEMENT_HANDLING.tagNameCheck),w.CUSTOM_ELEMENT_HANDLING&&Io(w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ne.attributeNameCheck=w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ne.allowCustomizedBuiltInElements=w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Yt&&(He=!1),Pi&&(Ut=!0),Jt&&(z=ae({},hp),ee=[],Jt.html===!0&&(ae(z,up),ae(ee,dp)),Jt.svg===!0&&(ae(z,Tc),ae(ee,Ac),ae(ee,la)),Jt.svgFilters===!0&&(ae(z,xc),ae(ee,Ac),ae(ee,la)),Jt.mathMl===!0&&(ae(z,kc),ae(ee,pp),ae(ee,la))),w.ADD_TAGS&&(z===J&&(z=Or(z)),ae(z,w.ADD_TAGS,Te)),w.ADD_ATTR&&(ee===Ae&&(ee=Or(ee)),ae(ee,w.ADD_ATTR,Te)),w.ADD_URI_SAFE_ATTR&&ae(fs,w.ADD_URI_SAFE_ATTR,Te),w.FORBID_CONTENTS&&(ei===yr&&(ei=Or(ei)),ae(ei,w.FORBID_CONTENTS,Te)),Fi&&(z["#text"]=!0),Zt&&ae(z,["html","head","body"]),z.table&&(ae(z,["tbody"]),delete ce.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw vn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=w.TRUSTED_TYPES_POLICY,H=M.createHTML("")}else M===void 0&&(M=Gy(v,s)),M!==null&&typeof H=="string"&&(H=M.createHTML(""));gt&&gt(w),sr=w}},Ft=ae({},[...Tc,...xc,...Dy]),_i=ae({},[...kc,...Ny]),Rl=function(w){let B=q(w);(!B||!B.tagName)&&(B={namespaceURI:vi,tagName:"template"});let X=ca(w.tagName),ve=ca(B.tagName);return tn[w.namespaceURI]?w.namespaceURI===se?B.namespaceURI===zt?X==="svg":B.namespaceURI===ms?X==="svg"&&(ve==="annotation-xml"||Ge[ve]):!!Ft[X]:w.namespaceURI===ms?B.namespaceURI===zt?X==="math":B.namespaceURI===se?X==="math"&&gs[ve]:!!_i[X]:w.namespaceURI===zt?B.namespaceURI===se&&!gs[ve]||B.namespaceURI===ms&&!Ge[ve]?!1:!_i[X]&&(Mo[X]||!Ft[X]):!!(ye==="application/xhtml+xml"&&tn[w.namespaceURI]):!1},xt=function(w){mn(e.removed,{element:w});try{q(w).removeChild(w)}catch{C(w)}},nr=function(w,B){try{mn(e.removed,{attribute:B.getAttributeNode(w),from:B})}catch{mn(e.removed,{attribute:null,from:B})}if(B.removeAttribute(w),w==="is")if(Ut||Pi)try{xt(B)}catch{}else try{B.setAttribute(w,"")}catch{}},or=function(w){let B=null,X=null;if(Ai)w="<remove></remove>"+w;else{let Se=cp(w,/^[\r\n\t ]+/);X=Se&&Se[0]}ye==="application/xhtml+xml"&&vi===zt&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");let ve=M?M.createHTML(w):w;if(vi===zt)try{B=new y().parseFromString(ve,ye)}catch{}if(!B||!B.documentElement){B=R.createDocument(vi,"template",null);try{B.documentElement.innerHTML=ti?H:ve}catch{}}let Qe=B.body||B.documentElement;return w&&X&&Qe.insertBefore(t.createTextNode(X),Qe.childNodes[0]||null),vi===zt?Y.call(B,Zt?"html":"body")[0]:Zt?B.documentElement:Qe},Do=function(w){return G.call(w.ownerDocument||w,w,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},rn=function(w){return w instanceof f&&(typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||!(w.attributes instanceof d)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function")},sn=function(w){return typeof a=="function"&&w instanceof a};function Be(Z,w,B){aa(Z,X=>{X.call(e,w,B,sr)})}let pt=function(w){let B=null;if(Be(Q.beforeSanitizeElements,w,null),rn(w))return xt(w),!0;let X=Te(w.nodeName);if(Be(Q.uponSanitizeElement,w,{tagName:X,allowedTags:z}),w.hasChildNodes()&&!sn(w.firstElementChild)&&mt(/<[/\w]/g,w.innerHTML)&&mt(/<[/\w]/g,w.textContent)||w.nodeType===yn.progressingInstruction||er&&w.nodeType===yn.comment&&mt(/<[/\w]/g,w.data))return xt(w),!0;if(!z[X]||ce[X]){if(!ce[X]&&nn(X)&&(ne.tagNameCheck instanceof RegExp&&mt(ne.tagNameCheck,X)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(X)))return!1;if(Fi&&!ei[X]){let ve=q(w)||w.parentNode,Qe=D(w)||w.childNodes;if(Qe&&ve){let Se=Qe.length;for(let ut=Se-1;ut>=0;--ut){let Ht=P(Qe[ut],!0);Ht.__removalCount=(w.__removalCount||0)+1,ve.insertBefore(Ht,I(w))}}}return xt(w),!0}return w instanceof l&&!Rl(w)||(X==="noscript"||X==="noembed"||X==="noframes")&&mt(/<\/no(script|embed|frames)/i,w.innerHTML)?(xt(w),!0):(Yt&&w.nodeType===yn.text&&(B=w.textContent,aa([oe,le,ke],ve=>{B=gn(B,ve," ")}),w.textContent!==B&&(mn(e.removed,{element:w.cloneNode()}),w.textContent=B)),Be(Q.afterSanitizeElements,w,null),!1)},Oi=function(w,B,X){if(Ct&&(B==="id"||B==="name")&&(X in t||X in bi))return!1;if(!(He&&!Me[B]&&mt(We,B))){if(!(Ne&&mt(T,B))){if(!ee[B]||Me[B]){if(!(nn(w)&&(ne.tagNameCheck instanceof RegExp&&mt(ne.tagNameCheck,w)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(w))&&(ne.attributeNameCheck instanceof RegExp&&mt(ne.attributeNameCheck,B)||ne.attributeNameCheck instanceof Function&&ne.attributeNameCheck(B))||B==="is"&&ne.allowCustomizedBuiltInElements&&(ne.tagNameCheck instanceof RegExp&&mt(ne.tagNameCheck,X)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(X))))return!1}else if(!fs[B]){if(!mt(j,gn(X,A,""))){if(!((B==="src"||B==="xlink:href"||B==="href")&&w!=="script"&&Ry(X,"data:")===0&&ir[w])){if(!(fi&&!mt(k,gn(X,A,"")))){if(X)return!1}}}}}}return!0},nn=function(w){return w!=="annotation-xml"&&cp(w,$)},vs=function(w){Be(Q.beforeSanitizeAttributes,w,null);let{attributes:B}=w;if(!B)return;let X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0},ve=B.length;for(;ve--;){let Qe=B[ve],{name:Se,namespaceURI:ut,value:Ht}=Qe,ar=Te(Se),st=Se==="value"?Ht:Ly(Ht);if(X.attrName=ar,X.attrValue=st,X.keepAttr=!0,X.forceKeepAttr=void 0,Be(Q.uponSanitizeAttribute,w,X),st=X.attrValue,gi&&(ar==="id"||ar==="name")&&(nr(Se,w),st=tr+st),er&&mt(/((--!?|])>)|<\/(style|title)/i,st)){nr(Se,w);continue}if(X.forceKeepAttr||(nr(Se,w),!X.keepAttr))continue;if(!mi&&mt(/\/>/i,st)){nr(Se,w);continue}Yt&&aa([oe,le,ke],Bo=>{st=gn(st,Bo," ")});let No=Te(w.nodeName);if(Oi(No,ar,st)){if(M&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!ut)switch(v.getAttributeType(No,ar)){case"TrustedHTML":{st=M.createHTML(st);break}case"TrustedScriptURL":{st=M.createScriptURL(st);break}}try{ut?w.setAttributeNS(ut,Se,st):w.setAttribute(Se,st),rn(w)?xt(w):lp(e.removed)}catch{}}}Be(Q.afterSanitizeAttributes,w,null)},Ll=function Z(w){let B=null,X=Do(w);for(Be(Q.beforeSanitizeShadowDOM,w,null);B=X.nextNode();)Be(Q.uponSanitizeShadowNode,B,null),!pt(B)&&(B.content instanceof n&&Z(B.content),vs(B));Be(Q.afterSanitizeShadowDOM,w,null)};return e.sanitize=function(Z){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=null,X=null,ve=null,Qe=null;if(ti=!Z,ti&&(Z="<!-->"),typeof Z!="string"&&!sn(Z))if(typeof Z.toString=="function"){if(Z=Z.toString(),typeof Z!="string")throw vn("dirty is not a string, aborting")}else throw vn("toString is not a function");if(!e.isSupported)return Z;if(br||Ie(w),e.removed=[],typeof Z=="string"&&(Qt=!1),Qt){if(Z.nodeName){let Ht=Te(Z.nodeName);if(!z[Ht]||ce[Ht])throw vn("root node is forbidden and cannot be sanitized in-place")}}else if(Z instanceof a)B=or("<!---->"),X=B.ownerDocument.importNode(Z,!0),X.nodeType===yn.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?B=X:B.appendChild(X);else{if(!Ut&&!Yt&&!Zt&&Z.indexOf("<")===-1)return M&&Ci?M.createHTML(Z):Z;if(B=or(Z),!B)return Ut?null:Ci?H:""}B&&Ai&&xt(B.firstChild);let Se=Do(Qt?Z:B);for(;ve=Se.nextNode();)pt(ve)||(ve.content instanceof n&&Ll(ve.content),vs(ve));if(Qt)return Z;if(Ut){if(Pi)for(Qe=K.call(B.ownerDocument);B.firstChild;)Qe.appendChild(B.firstChild);else Qe=B;return(ee.shadowroot||ee.shadowrootmode)&&(Qe=ie.call(r,Qe,!0)),Qe}let ut=Zt?B.outerHTML:B.innerHTML;return Zt&&z["!doctype"]&&B.ownerDocument&&B.ownerDocument.doctype&&B.ownerDocument.doctype.name&&mt(yp,B.ownerDocument.doctype.name)&&(ut="<!DOCTYPE "+B.ownerDocument.doctype.name+`>
7
- `+ut),Yt&&aa([oe,le,ke],Ht=>{ut=gn(ut,Ht," ")}),M&&Ci?M.createHTML(ut):ut},e.setConfig=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ie(Z),br=!0},e.clearConfig=function(){sr=null,br=!1},e.isValidAttribute=function(Z,w,B){sr||Ie({});let X=Te(Z),ve=Te(w);return Oi(X,ve,B)},e.addHook=function(Z,w){typeof w=="function"&&mn(Q[Z],w)},e.removeHook=function(Z){return lp(Q[Z])},e.removeHooks=function(Z){Q[Z]=[]},e.removeAllHooks=function(){Q=mp()},e}var Ts=wp();function Oc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lr=Oc();function Ap(i){Lr=i}var En={exec:()=>null};function be(i,e=""){let t=typeof i=="string"?i:i.source,r={replace:(s,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(vt.caret,"$1"),t=t.replace(s,o),r},getRegex:()=>new RegExp(t,e)};return r}var vt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i")},Ky=/^(?:[ \t]*(?:\n|$))+/,Xy=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yy=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,xn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Zy=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Pp=/(?:[*+-]|\d{1,9}[.)])/,Cp=be(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Pp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Rc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Qy=/^[^\n]+/,Lc=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Jy=be(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Lc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),e0=be(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Pp).getRegex(),da="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Mc=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,t0=be("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Mc).replace("tag",da).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fp=be(Rc).replace("hr",xn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",da).getRegex(),i0=be(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Fp).getRegex(),Ic={blockquote:i0,code:Xy,def:Jy,fences:Yy,heading:Zy,hr:xn,html:t0,lheading:Cp,list:e0,newline:Ky,paragraph:Fp,table:En,text:Qy},Sp=be("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",xn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",da).getRegex(),r0={...Ic,table:Sp,paragraph:be(Rc).replace("hr",xn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Sp).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",da).getRegex()},s0={...Ic,html:be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Mc).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:En,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:be(Rc).replace("hr",xn).replace("heading",` *#{1,6} *[^
8
- ]`).replace("lheading",Cp).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},_p=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,n0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Op=/^( {2,}|\\)\n(?!\s*$)/,o0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pa=/[\p{P}\p{S}]/u,Dc=/[\s\p{P}\p{S}]/u,Rp=/[^\s\p{P}\p{S}]/u,a0=be(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Dc).getRegex(),l0=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,c0=be(/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,"u").replace(/punct/g,pa).getRegex(),u0=be("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Rp).replace(/punctSpace/g,Dc).replace(/punct/g,pa).getRegex(),h0=be("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Rp).replace(/punctSpace/g,Dc).replace(/punct/g,pa).getRegex(),d0=be(/\\(punct)/,"gu").replace(/punct/g,pa).getRegex(),p0=be(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),f0=be(Mc).replace("(?:-->|$)","-->").getRegex(),m0=be("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",f0).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ha=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,g0=be(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ha).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Lp=be(/^!?\[(label)\]\[(ref)\]/).replace("label",ha).replace("ref",Lc).getRegex(),Mp=be(/^!?\[(ref)\](?:\[\])?/).replace("ref",Lc).getRegex(),v0=be("reflink|nolink(?!\\()","g").replace("reflink",Lp).replace("nolink",Mp).getRegex(),Nc={_backpedal:En,anyPunctuation:d0,autolink:p0,blockSkip:l0,br:Op,code:n0,del:En,emStrongLDelim:c0,emStrongRDelimAst:u0,emStrongRDelimUnd:h0,escape:_p,link:g0,nolink:Mp,punctuation:a0,reflink:Lp,reflinkSearch:v0,tag:m0,text:o0,url:En},b0={...Nc,link:be(/^!?\[(label)\]\((.*?)\)/).replace("label",ha).getRegex(),reflink:be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ha).getRegex()},Fc={...Nc,escape:be(_p).replace("])","~|])").getRegex(),url:be(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},y0={...Fc,br:be(Op).replace("{2,}","*").getRegex(),text:be(Fc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ua={normal:Ic,gfm:r0,pedantic:s0},wn={normal:Nc,gfm:Fc,breaks:y0,pedantic:b0},w0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ep=i=>w0[i];function wi(i,e){if(e){if(vt.escapeTest.test(i))return i.replace(vt.escapeReplace,Ep)}else if(vt.escapeTestNoEncode.test(i))return i.replace(vt.escapeReplaceNoEncode,Ep);return i}function Tp(i){try{i=encodeURI(i).replace(vt.percentDecode,"%")}catch{return null}return i}function xp(i,e){let t=i.replace(vt.findPipe,(n,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=t.split(vt.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(vt.slashPipe,"|");return r}function Sn(i,e,t){let r=i.length;if(r===0)return"";let s=0;for(;s<r;){let n=i.charAt(r-s-1);if(n===e&&!t)s++;else if(n!==e&&t)s++;else break}return i.slice(0,r-s)}function S0(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<i.length;r++)if(i[r]==="\\")r++;else if(i[r]===e[0])t++;else if(i[r]===e[1]&&(t--,t<0))return r;return-1}function kp(i,e,t,r,s){let n=e.href,o=e.title||null,a=i[1].replace(s.other.outputLinkReplace,"$1");if(i[0].charAt(0)!=="!"){r.state.inLink=!0;let l={type:"link",raw:t,href:n,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:t,href:n,title:o,text:a}}function E0(i,e,t){let r=i.match(t.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
6
+ %o`,t,e,r),(s=window.onerror)===null||s===void 0||s.call(window,t,"",0,0,e)}logFormattedMessage(e,t,r={}){r=Object.assign({application:this},r),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},r)),this.logger.groupEnd()}};function Rb(){return new Promise(i=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}function Lb(i){return on(i,"classes").reduce((t,r)=>Object.assign(t,Mb(r)),{})}function Mb(i){return{[`${i}Class`]:{get(){let{classes:e}=this;if(e.has(i))return e.get(i);{let t=e.getAttributeName(i);throw new Error(`Missing attribute "${t}"`)}}},[`${i}Classes`]:{get(){return this.classes.getAll(i)}},[`has${nn(i)}Class`]:{get(){return this.classes.has(i)}}}}function Ib(i){return on(i,"outlets").reduce((t,r)=>Object.assign(t,Db(r)),{})}function Md(i,e,t){return i.application.getControllerForElementAndIdentifier(e,t)}function Id(i,e,t){let r=Md(i,e,t);if(r||(i.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),r=Md(i,e,t),r))return r}function Db(i){let e=Ul(i);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t){let s=Id(this,t,i);if(s)return s;throw new Error(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(i);return t.length>0?t.map(r=>{let s=Id(this,r,i);if(s)return s;console.warn(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`,r)}).filter(r=>r):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t)return t;throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(i)}},[`has${nn(e)}Outlet`]:{get(){return this.outlets.has(i)}}}}function Nb(i){return on(i,"targets").reduce((t,r)=>Object.assign(t,Bb(r)),{})}function Bb(i){return{[`${i}Target`]:{get(){let e=this.targets.find(i);if(e)return e;throw new Error(`Missing target element "${i}" for "${this.identifier}" controller`)}},[`${i}Targets`]:{get(){return this.targets.findAll(i)}},[`has${nn(i)}Target`]:{get(){return this.targets.has(i)}}}}function Ub(i){let e=wb(i,"values"),t={valueDescriptorMap:{get(){return e.reduce((r,s)=>{let n=$d(s,this.identifier),o=this.data.getAttributeNameForKey(n.key);return Object.assign(r,{[o]:n})},{})}}};return e.reduce((r,s)=>Object.assign(r,zb(s)),t)}function zb(i,e){let t=$d(i,e),{key:r,name:s,reader:n,writer:o}=t;return{[s]:{get(){let a=this.data.get(r);return a!==null?n(a):t.defaultValue},set(a){a===void 0?this.data.delete(r):this.data.set(r,o(a))}},[`has${nn(s)}`]:{get(){return this.data.has(r)||t.hasCustomDefaultValue}}}}function $d([i,e],t){return Vb({controller:t,token:i,typeDefinition:e})}function Go(i){switch(i){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function sn(i){switch(typeof i){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(i))return"array";if(Object.prototype.toString.call(i)==="[object Object]")return"object"}function Hb(i){let{controller:e,token:t,typeObject:r}=i,s=_d(r.type),n=_d(r.default),o=s&&n,a=s&&!n,l=!s&&n,c=Go(r.type),d=sn(i.typeObject.default);if(a)return c;if(l)return d;if(c!==d){let p=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${p}" must match the defined type "${c}". The provided default value of "${r.default}" is of type "${d}".`)}if(o)return c}function $b(i){let{controller:e,token:t,typeDefinition:r}=i,n=Hb({controller:e,token:t,typeObject:r}),o=sn(r),a=Go(r),l=n||o||a;if(l)return l;let c=e?`${e}.${r}`:t;throw new Error(`Unknown value type "${c}" for "${t}" value`)}function qb(i){let e=Go(i);if(e)return Dd[e];let t=zl(i,"default"),r=zl(i,"type"),s=i;if(t)return s.default;if(r){let{type:n}=s,o=Go(n);if(o)return Dd[o]}return i}function Vb(i){let{token:e,typeDefinition:t}=i,r=`${Ud(e)}-value`,s=$b(i);return{type:s,key:r,name:oc(r),get defaultValue(){return qb(t)},get hasCustomDefaultValue(){return sn(t)!==void 0},reader:jb[s],writer:Nd[s]||Nd.default}}var Dd={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},jb={array(i){let e=JSON.parse(i);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${i}" of type "${sn(e)}"`);return e},boolean(i){return!(i=="0"||String(i).toLowerCase()=="false")},number(i){return Number(i.replace(/_/g,""))},object(i){let e=JSON.parse(i);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${i}" of type "${sn(e)}"`);return e},string(i){return i}},Nd={default:Wb,array:Bd,object:Bd};function Bd(i){return JSON.stringify(i)}function Wb(i){return`${i}`}var ie=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:r={},prefix:s=this.identifier,bubbles:n=!0,cancelable:o=!0}={}){let a=s?`${s}:${e}`:e,l=new CustomEvent(a,{detail:r,bubbles:n,cancelable:o});return t.dispatchEvent(l),l}};ie.blessings=[Lb,Nb,Ub,Ib];ie.targets=[];ie.outlets=[];ie.values={};var Ko=class extends ie{static targets=["openIcon","closeIcon"];static outlets=["sidebar"];static values={placement:{type:String,default:"left"},bodyScrolling:{type:Boolean,default:!1},backdrop:{type:Boolean,default:!0},edge:{type:Boolean,default:!1},edgeOffset:{type:String,default:"bottom-[60px]"}};static classes={backdrop:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30"};initialize(){this.visible=!1,this.handleEscapeKey=this.handleEscapeKey.bind(this)}connect(){document.addEventListener("keydown",this.handleEscapeKey)}sidebarOutletConnected(){this.#e(this.sidebarOutlet.element)}disconnect(){this.#i(),document.removeEventListener("keydown",this.handleEscapeKey),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden")}#e(i){i.setAttribute("aria-hidden","true"),i.classList.add("transition-transform"),this.#o(this.placementValue).base.forEach(e=>{i.classList.add(e)})}toggleDrawer(){this.visible?this.hideDrawer():this.showDrawer()}showDrawer(){this.edgeValue?this.#a(`${this.placementValue}-edge`,!0):this.#s(this.placementValue,!0),this.openIconTarget.classList.add("hidden"),this.openIconTarget.setAttribute("aria-hidden","true"),this.closeIconTarget.classList.remove("hidden"),this.closeIconTarget.setAttribute("aria-hidden","false"),this.sidebarOutlet.element.setAttribute("aria-modal","true"),this.sidebarOutlet.element.setAttribute("role","dialog"),this.sidebarOutlet.element.removeAttribute("aria-hidden"),this.bodyScrollingValue||document.body.classList.add("overflow-hidden"),this.backdropValue&&this.#t(),this.visible=!0,this.dispatch("show")}hideDrawer(){this.edgeValue?this.#a(`${this.placementValue}-edge`,!1):this.#s(this.placementValue,!1),this.openIconTarget.classList.remove("hidden"),this.openIconTarget.setAttribute("aria-hidden","false"),this.closeIconTarget.classList.add("hidden"),this.closeIconTarget.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.removeAttribute("aria-modal"),this.sidebarOutlet.element.removeAttribute("role"),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden"),this.backdropValue&&this.#i(),this.visible=!1,this.dispatch("hide")}handleEscapeKey(i){i.key==="Escape"&&this.visible&&this.hideDrawer()}#t(){if(!this.visible){let i=document.createElement("div");i.setAttribute("data-drawer-backdrop",""),i.classList.add(...this.constructor.classes.backdrop.split(" ")),i.addEventListener("click",()=>this.hideDrawer()),document.body.appendChild(i)}}#i(){let i=document.querySelector("[data-drawer-backdrop]");i&&i.remove()}#o(i){let e={top:{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]},right:{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]},bottom:{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]},left:{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]},"bottom-edge":{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this.edgeOffsetValue]}};return e[i]||e.left}#s(i,e){let t=this.#o(i);e?(t.active.forEach(r=>this.sidebarOutlet.element.classList.add(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.remove(r))):(t.active.forEach(r=>this.sidebarOutlet.element.classList.remove(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.add(r)))}#a(i,e){this.#s(i,e)}};var Xo=class extends ie{static targets=["target","template","addButton"];static values={wrapperSelector:{type:String,default:".nested-resource-form-fields"},limit:Number};connect(){this.updateState()}add(i){i.preventDefault();let e=this.templateTarget.innerHTML.replace(/NEW_RECORD/g,new Date().getTime().toString());this.targetTarget.insertAdjacentHTML("beforebegin",e);let t=new CustomEvent("nested-resource-form-fields:add",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}remove(i){i.preventDefault();let e=i.target.closest(this.wrapperSelectorValue);if(e.dataset.newRecord!==void 0)e.remove();else{e.style.display="none",e.classList.remove(...e.classList);let r=e.querySelector("input[name*='_destroy']");r.value="1"}let t=new CustomEvent("nested-resource-form-fields:remove",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}updateState(){!this.hasAddButtonTarget||this.limitValue==0||(this.childCount>=this.limitValue?this.addButtonTarget.style.display="none":this.addButtonTarget.style.display="initial")}get childCount(){return this.element.querySelectorAll(this.wrapperSelectorValue).length}};var Hx=Ce(Wd(),1),Yo=class extends ie{connect(){}submit(){this.element.requestSubmit()}};var Ie="top",Ye="bottom",qe="right",Be="left",Zo="auto",ur=[Ie,Ye,qe,Be],Ni="start",Ar="end",Gd="clippingParents",Qo="viewport",Ss="popper",Kd="reference",cc=ur.reduce(function(i,e){return i.concat([e+"-"+Ni,e+"-"+Ar])},[]),Jo=[].concat(ur,[Zo]).reduce(function(i,e){return i.concat([e,e+"-"+Ni,e+"-"+Ar])},[]),uy="beforeRead",hy="read",dy="afterRead",py="beforeMain",fy="main",my="afterMain",gy="beforeWrite",vy="write",by="afterWrite",Xd=[uy,hy,dy,py,fy,my,gy,vy,by];function et(i){return i?(i.nodeName||"").toLowerCase():null}function Fe(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function Vt(i){var e=Fe(i).Element;return i instanceof e||i instanceof Element}function Ze(i){var e=Fe(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function Ts(i){if(typeof ShadowRoot>"u")return!1;var e=Fe(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function yy(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},s=e.attributes[t]||{},n=e.elements[t];!Ze(n)||!et(n)||(Object.assign(n.style,r),Object.keys(s).forEach(function(o){var a=s[o];a===!1?n.removeAttribute(o):n.setAttribute(o,a===!0?"":a)}))})}function wy(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var s=e.elements[r],n=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(l,c){return l[c]="",l},{});!Ze(s)||!et(s)||(Object.assign(s.style,a),Object.keys(n).forEach(function(l){s.removeAttribute(l)}))})}}var Yd={name:"applyStyles",enabled:!0,phase:"write",fn:yy,effect:wy,requires:["computeStyles"]};function tt(i){return i.split("-")[0]}var ri=Math.max,Pr=Math.min,Bi=Math.round;function Es(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function an(){return!/^((?!chrome|android).)*safari/i.test(Es())}function jt(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),s=1,n=1;e&&Ze(i)&&(s=i.offsetWidth>0&&Bi(r.width)/i.offsetWidth||1,n=i.offsetHeight>0&&Bi(r.height)/i.offsetHeight||1);var o=Vt(i)?Fe(i):window,a=o.visualViewport,l=!an()&&t,c=(r.left+(l&&a?a.offsetLeft:0))/s,d=(r.top+(l&&a?a.offsetTop:0))/n,p=r.width/s,y=r.height/n;return{width:p,height:y,top:d,right:c+p,bottom:d+y,left:c,x:c,y:d}}function Cr(i){var e=jt(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function ln(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&Ts(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function mt(i){return Fe(i).getComputedStyle(i)}function uc(i){return["table","td","th"].indexOf(et(i))>=0}function ot(i){return((Vt(i)?i.ownerDocument:i.document)||window.document).documentElement}function Ui(i){return et(i)==="html"?i:i.assignedSlot||i.parentNode||(Ts(i)?i.host:null)||ot(i)}function Zd(i){return!Ze(i)||mt(i).position==="fixed"?null:i.offsetParent}function Sy(i){var e=/firefox/i.test(Es()),t=/Trident/i.test(Es());if(t&&Ze(i)){var r=mt(i);if(r.position==="fixed")return null}var s=Ui(i);for(Ts(s)&&(s=s.host);Ze(s)&&["html","body"].indexOf(et(s))<0;){var n=mt(s);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return s;s=s.parentNode}return null}function si(i){for(var e=Fe(i),t=Zd(i);t&&uc(t)&&mt(t).position==="static";)t=Zd(t);return t&&(et(t)==="html"||et(t)==="body"&&mt(t).position==="static")?e:t||Sy(i)||e}function Fr(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function _r(i,e,t){return ri(i,Pr(e,t))}function Qd(i,e,t){var r=_r(i,e,t);return r>t?t:r}function cn(){return{top:0,right:0,bottom:0,left:0}}function un(i){return Object.assign({},cn(),i)}function hn(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var Ty=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,un(typeof e!="number"?e:hn(e,ur))};function Ey(i){var e,t=i.state,r=i.name,s=i.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=tt(t.placement),l=Fr(a),c=[Be,qe].indexOf(a)>=0,d=c?"height":"width";if(!(!n||!o)){var p=Ty(s.padding,t),y=Cr(n),v=l==="y"?Ie:Be,x=l==="y"?Ye:qe,P=t.rects.reference[d]+t.rects.reference[l]-o[l]-t.rects.popper[d],F=o[l]-t.rects.reference[l],R=si(n),D=R?l==="y"?R.clientHeight||0:R.clientWidth||0:0,q=P/2-F/2,I=p[v],z=D-y[d]-p[x],L=D/2-y[d]/2+q,j=_r(I,L,z),K=l;t.modifiersData[r]=(e={},e[K]=j,e.centerOffset=j-L,e)}}function xy(i){var e=i.state,t=i.options,r=t.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||ln(e.elements.popper,s)&&(e.elements.arrow=s))}var Jd={name:"arrow",enabled:!0,phase:"main",fn:Ey,effect:xy,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Wt(i){return i.split("-")[1]}var ky={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ay(i,e){var t=i.x,r=i.y,s=e.devicePixelRatio||1;return{x:Bi(t*s)/s||0,y:Bi(r*s)/s||0}}function ep(i){var e,t=i.popper,r=i.popperRect,s=i.placement,n=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,c=i.adaptive,d=i.roundOffsets,p=i.isFixed,y=o.x,v=y===void 0?0:y,x=o.y,P=x===void 0?0:x,F=typeof d=="function"?d({x:v,y:P}):{x:v,y:P};v=F.x,P=F.y;var R=o.hasOwnProperty("x"),D=o.hasOwnProperty("y"),q=Be,I=Ie,z=window;if(c){var L=si(t),j="clientHeight",K="clientWidth";if(L===Fe(t)&&(L=ot(t),mt(L).position!=="static"&&a==="absolute"&&(j="scrollHeight",K="scrollWidth")),L=L,s===Ie||(s===Be||s===qe)&&n===Ar){I=Ye;var Z=p&&L===z&&z.visualViewport?z.visualViewport.height:L[j];P-=Z-r.height,P*=l?1:-1}if(s===Be||(s===Ie||s===Ye)&&n===Ar){q=qe;var ne=p&&L===z&&z.visualViewport?z.visualViewport.width:L[K];v-=ne-r.width,v*=l?1:-1}}var Y=Object.assign({position:a},c&&ky),re=d===!0?Ay({x:v,y:P},Fe(t)):{x:v,y:P};if(v=re.x,P=re.y,l){var le;return Object.assign({},Y,(le={},le[I]=D?"0":"",le[q]=R?"0":"",le.transform=(z.devicePixelRatio||1)<=1?"translate("+v+"px, "+P+"px)":"translate3d("+v+"px, "+P+"px, 0)",le))}return Object.assign({},Y,(e={},e[I]=D?P+"px":"",e[q]=R?v+"px":"",e.transform="",e))}function Py(i){var e=i.state,t=i.options,r=t.gpuAcceleration,s=r===void 0?!0:r,n=t.adaptive,o=n===void 0?!0:n,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:tt(e.placement),variation:Wt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ep(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ep(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var tp={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Py,data:{}};var ea={passive:!0};function Cy(i){var e=i.state,t=i.instance,r=i.options,s=r.scroll,n=s===void 0?!0:s,o=r.resize,a=o===void 0?!0:o,l=Fe(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&c.forEach(function(d){d.addEventListener("scroll",t.update,ea)}),a&&l.addEventListener("resize",t.update,ea),function(){n&&c.forEach(function(d){d.removeEventListener("scroll",t.update,ea)}),a&&l.removeEventListener("resize",t.update,ea)}}var ip={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Cy,data:{}};var Fy={left:"right",right:"left",bottom:"top",top:"bottom"};function xs(i){return i.replace(/left|right|bottom|top/g,function(e){return Fy[e]})}var _y={start:"end",end:"start"};function ta(i){return i.replace(/start|end/g,function(e){return _y[e]})}function Or(i){var e=Fe(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Rr(i){return jt(ot(i)).left+Or(i).scrollLeft}function hc(i,e){var t=Fe(i),r=ot(i),s=t.visualViewport,n=r.clientWidth,o=r.clientHeight,a=0,l=0;if(s){n=s.width,o=s.height;var c=an();(c||!c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:n,height:o,x:a+Rr(i),y:l}}function dc(i){var e,t=ot(i),r=Or(i),s=(e=i.ownerDocument)==null?void 0:e.body,n=ri(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=ri(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-r.scrollLeft+Rr(i),l=-r.scrollTop;return mt(s||t).direction==="rtl"&&(a+=ri(t.clientWidth,s?s.clientWidth:0)-n),{width:n,height:o,x:a,y:l}}function Lr(i){var e=mt(i),t=e.overflow,r=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+r)}function ia(i){return["html","body","#document"].indexOf(et(i))>=0?i.ownerDocument.body:Ze(i)&&Lr(i)?i:ia(Ui(i))}function hr(i,e){var t;e===void 0&&(e=[]);var r=ia(i),s=r===((t=i.ownerDocument)==null?void 0:t.body),n=Fe(r),o=s?[n].concat(n.visualViewport||[],Lr(r)?r:[]):r,a=e.concat(o);return s?a:a.concat(hr(Ui(o)))}function ks(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function Oy(i,e){var t=jt(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function rp(i,e,t){return e===Qo?ks(hc(i,t)):Vt(e)?Oy(e,t):ks(dc(ot(i)))}function Ry(i){var e=hr(Ui(i)),t=["absolute","fixed"].indexOf(mt(i).position)>=0,r=t&&Ze(i)?si(i):i;return Vt(r)?e.filter(function(s){return Vt(s)&&ln(s,r)&&et(s)!=="body"}):[]}function pc(i,e,t,r){var s=e==="clippingParents"?Ry(i):[].concat(e),n=[].concat(s,[t]),o=n[0],a=n.reduce(function(l,c){var d=rp(i,c,r);return l.top=ri(d.top,l.top),l.right=Pr(d.right,l.right),l.bottom=Pr(d.bottom,l.bottom),l.left=ri(d.left,l.left),l},rp(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function dn(i){var e=i.reference,t=i.element,r=i.placement,s=r?tt(r):null,n=r?Wt(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(s){case Ie:l={x:o,y:e.y-t.height};break;case Ye:l={x:o,y:e.y+e.height};break;case qe:l={x:e.x+e.width,y:a};break;case Be:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=s?Fr(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(n){case Ni:l[c]=l[c]-(e[d]/2-t[d]/2);break;case Ar:l[c]=l[c]+(e[d]/2-t[d]/2);break;default:}}return l}function ni(i,e){e===void 0&&(e={});var t=e,r=t.placement,s=r===void 0?i.placement:r,n=t.strategy,o=n===void 0?i.strategy:n,a=t.boundary,l=a===void 0?Gd:a,c=t.rootBoundary,d=c===void 0?Qo:c,p=t.elementContext,y=p===void 0?Ss:p,v=t.altBoundary,x=v===void 0?!1:v,P=t.padding,F=P===void 0?0:P,R=un(typeof F!="number"?F:hn(F,ur)),D=y===Ss?Kd:Ss,q=i.rects.popper,I=i.elements[x?D:y],z=pc(Vt(I)?I:I.contextElement||ot(i.elements.popper),l,d,o),L=jt(i.elements.reference),j=dn({reference:L,element:q,strategy:"absolute",placement:s}),K=ks(Object.assign({},q,j)),Z=y===Ss?K:L,ne={top:z.top-Z.top+R.top,bottom:Z.bottom-z.bottom+R.bottom,left:z.left-Z.left+R.left,right:Z.right-z.right+R.right},Y=i.modifiersData.offset;if(y===Ss&&Y){var re=Y[s];Object.keys(ne).forEach(function(le){var ke=[qe,Ye].indexOf(le)>=0?1:-1,We=[Ie,Ye].indexOf(le)>=0?"y":"x";ne[le]+=re[We]*ke})}return ne}function fc(i,e){e===void 0&&(e={});var t=e,r=t.placement,s=t.boundary,n=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?Jo:l,d=Wt(r),p=d?a?cc:cc.filter(function(x){return Wt(x)===d}):ur,y=p.filter(function(x){return c.indexOf(x)>=0});y.length===0&&(y=p);var v=y.reduce(function(x,P){return x[P]=ni(i,{placement:P,boundary:s,rootBoundary:n,padding:o})[tt(P)],x},{});return Object.keys(v).sort(function(x,P){return v[x]-v[P]})}function Ly(i){if(tt(i)===Zo)return[];var e=xs(i);return[ta(i),e,ta(e)]}function My(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var s=t.mainAxis,n=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,c=t.padding,d=t.boundary,p=t.rootBoundary,y=t.altBoundary,v=t.flipVariations,x=v===void 0?!0:v,P=t.allowedAutoPlacements,F=e.options.placement,R=tt(F),D=R===F,q=l||(D||!x?[xs(F)]:Ly(F)),I=[F].concat(q).reduce(function(Ae,oe){return Ae.concat(tt(oe)===Zo?fc(e,{placement:oe,boundary:d,rootBoundary:p,padding:c,flipVariations:x,allowedAutoPlacements:P}):oe)},[]),z=e.rects.reference,L=e.rects.popper,j=new Map,K=!0,Z=I[0],ne=0;ne<I.length;ne++){var Y=I[ne],re=tt(Y),le=Wt(Y)===Ni,ke=[Ie,Ye].indexOf(re)>=0,We=ke?"width":"height",E=ni(e,{placement:Y,boundary:d,rootBoundary:p,altBoundary:y,padding:c}),k=ke?le?qe:Be:le?Ye:Ie;z[We]>L[We]&&(k=xs(k));var A=xs(k),$=[];if(n&&$.push(E[re]<=0),a&&$.push(E[k]<=0,E[A]<=0),$.every(function(Ae){return Ae})){Z=Y,K=!1;break}j.set(Y,$)}if(K)for(var W=x?3:1,H=function(oe){var ce=I.find(function(Le){var De=j.get(Le);if(De)return De.slice(0,oe).every(function(He){return He})});if(ce)return Z=ce,"break"},J=W;J>0;J--){var ee=H(J);if(ee==="break")break}e.placement!==Z&&(e.modifiersData[r]._skip=!0,e.placement=Z,e.reset=!0)}}var sp={name:"flip",enabled:!0,phase:"main",fn:My,requiresIfExists:["offset"],data:{_skip:!1}};function np(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function op(i){return[Ie,qe,Ye,Be].some(function(e){return i[e]>=0})}function Iy(i){var e=i.state,t=i.name,r=e.rects.reference,s=e.rects.popper,n=e.modifiersData.preventOverflow,o=ni(e,{elementContext:"reference"}),a=ni(e,{altBoundary:!0}),l=np(o,r),c=np(a,s,n),d=op(l),p=op(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}var ap={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Iy};function Dy(i,e,t){var r=tt(i),s=[Be,Ie].indexOf(r)>=0?-1:1,n=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=n[0],a=n[1];return o=o||0,a=(a||0)*s,[Be,qe].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Ny(i){var e=i.state,t=i.options,r=i.name,s=t.offset,n=s===void 0?[0,0]:s,o=Jo.reduce(function(d,p){return d[p]=Dy(p,e.rects,n),d},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}var lp={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ny};function By(i){var e=i.state,t=i.name;e.modifiersData[t]=dn({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var cp={name:"popperOffsets",enabled:!0,phase:"read",fn:By,data:{}};function mc(i){return i==="x"?"y":"x"}function Uy(i){var e=i.state,t=i.options,r=i.name,s=t.mainAxis,n=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,c=t.rootBoundary,d=t.altBoundary,p=t.padding,y=t.tether,v=y===void 0?!0:y,x=t.tetherOffset,P=x===void 0?0:x,F=ni(e,{boundary:l,rootBoundary:c,padding:p,altBoundary:d}),R=tt(e.placement),D=Wt(e.placement),q=!D,I=Fr(R),z=mc(I),L=e.modifiersData.popperOffsets,j=e.rects.reference,K=e.rects.popper,Z=typeof P=="function"?P(Object.assign({},e.rects,{placement:e.placement})):P,ne=typeof Z=="number"?{mainAxis:Z,altAxis:Z}:Object.assign({mainAxis:0,altAxis:0},Z),Y=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,re={x:0,y:0};if(L){if(n){var le,ke=I==="y"?Ie:Be,We=I==="y"?Ye:qe,E=I==="y"?"height":"width",k=L[I],A=k+F[ke],$=k-F[We],W=v?-K[E]/2:0,H=D===Ni?j[E]:K[E],J=D===Ni?-K[E]:-j[E],ee=e.elements.arrow,Ae=v&&ee?Cr(ee):{width:0,height:0},oe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:cn(),ce=oe[ke],Le=oe[We],De=_r(0,j[E],Ae[E]),He=q?j[E]/2-W-De-ce-ne.mainAxis:H-De-ce-ne.mainAxis,gi=q?-j[E]/2+W+De+Le+ne.mainAxis:J+De+Le+ne.mainAxis,vi=e.elements.arrow&&si(e.elements.arrow),Zt=vi?I==="y"?vi.clientTop||0:vi.clientLeft||0:0,tr=(le=Y?.[I])!=null?le:0,Qt=k+He-tr-Zt,Sr=k+gi-tr,Ci=_r(v?Pr(A,Qt):A,k,v?ri($,Sr):$);L[I]=Ci,re[I]=Ci-k}if(a){var zt,Fi=I==="x"?Ie:Be,_i=I==="x"?Ye:qe,_t=L[z],bi=z==="y"?"height":"width",ir=_t+F[Fi],Oi=_t-F[_i],Jt=[Ie,Be].indexOf(R)!==-1,ei=(zt=Y?.[z])!=null?zt:0,ti=Jt?ir:_t-j[bi]-K[bi]-ei+ne.altAxis,Tr=Jt?_t+j[bi]+K[bi]-ei-ne.altAxis:Oi,rr=v&&Jt?Qd(ti,_t,Tr):_r(v?ti:ir,_t,v?Tr:Oi);L[z]=rr,re[z]=rr-_t}e.modifiersData[r]=re}}var up={name:"preventOverflow",enabled:!0,phase:"main",fn:Uy,requiresIfExists:["offset"]};function gc(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function vc(i){return i===Fe(i)||!Ze(i)?Or(i):gc(i)}function zy(i){var e=i.getBoundingClientRect(),t=Bi(e.width)/i.offsetWidth||1,r=Bi(e.height)/i.offsetHeight||1;return t!==1||r!==1}function bc(i,e,t){t===void 0&&(t=!1);var r=Ze(e),s=Ze(e)&&zy(e),n=ot(e),o=jt(i,s,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((et(e)!=="body"||Lr(n))&&(a=vc(e)),Ze(e)?(l=jt(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):n&&(l.x=Rr(n))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Hy(i){var e=new Map,t=new Set,r=[];i.forEach(function(n){e.set(n.name,n)});function s(n){t.add(n.name);var o=[].concat(n.requires||[],n.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&s(l)}}),r.push(n)}return i.forEach(function(n){t.has(n.name)||s(n)}),r}function yc(i){var e=Hy(i);return Xd.reduce(function(t,r){return t.concat(e.filter(function(s){return s.phase===r}))},[])}function wc(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function Sc(i){var e=i.reduce(function(t,r){var s=t[r.name];return t[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var hp={placement:"bottom",modifiers:[],strategy:"absolute"};function dp(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function pp(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,s=e.defaultOptions,n=s===void 0?hp:s;return function(a,l,c){c===void 0&&(c=n);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},hp,n),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},p=[],y=!1,v={state:d,setOptions:function(R){var D=typeof R=="function"?R(d.options):R;P(),d.options=Object.assign({},n,d.options,D),d.scrollParents={reference:Vt(a)?hr(a):a.contextElement?hr(a.contextElement):[],popper:hr(l)};var q=yc(Sc([].concat(r,d.options.modifiers)));return d.orderedModifiers=q.filter(function(I){return I.enabled}),x(),v.update()},forceUpdate:function(){if(!y){var R=d.elements,D=R.reference,q=R.popper;if(dp(D,q)){d.rects={reference:bc(D,si(q),d.options.strategy==="fixed"),popper:Cr(q)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(ne){return d.modifiersData[ne.name]=Object.assign({},ne.data)});for(var I=0;I<d.orderedModifiers.length;I++){if(d.reset===!0){d.reset=!1,I=-1;continue}var z=d.orderedModifiers[I],L=z.fn,j=z.options,K=j===void 0?{}:j,Z=z.name;typeof L=="function"&&(d=L({state:d,options:K,name:Z,instance:v})||d)}}}},update:wc(function(){return new Promise(function(F){v.forceUpdate(),F(d)})}),destroy:function(){P(),y=!0}};if(!dp(a,l))return v;v.setOptions(c).then(function(F){!y&&c.onFirstUpdate&&c.onFirstUpdate(F)});function x(){d.orderedModifiers.forEach(function(F){var R=F.name,D=F.options,q=D===void 0?{}:D,I=F.effect;if(typeof I=="function"){var z=I({state:d,name:R,instance:v,options:q}),L=function(){};p.push(z||L)}})}function P(){p.forEach(function(F){return F()}),p=[]}return v}}var $y=[ip,cp,tp,Yd,lp,sp,up,Jd,ap],Tc=pp({defaultModifiers:$y});var ra=class extends ie{static targets=["trigger","menu"];connect(){this.visible=!1,this.initialized=!1,this.options={placement:"bottom",triggerType:"click",offsetSkidding:0,offsetDistance:10,delay:300,ignoreClickOutsideClass:!1},this.init()}init(){this.triggerTarget&&this.menuTarget&&!this.initialized&&(this.popperInstance=Tc(this.triggerTarget,this.menuTarget,{placement:this.options.placement,modifiers:[{name:"offset",options:{offset:[this.options.offsetSkidding,this.options.offsetDistance]}}]}),this.setupEventListeners(),this.initialized=!0)}disconnect(){this.initialized&&(this.options.triggerType==="click"&&this.triggerTarget.removeEventListener("click",this.clickHandler),this.options.triggerType==="hover"&&(this.triggerTarget.removeEventListener("mouseenter",this.hoverShowTriggerHandler),this.menuTarget.removeEventListener("mouseenter",this.hoverShowMenuHandler),this.triggerTarget.removeEventListener("mouseleave",this.hoverHideHandler),this.menuTarget.removeEventListener("mouseleave",this.hoverHideHandler)),this.removeClickOutsideListener(),this.popperInstance.destroy(),this.initialized=!1)}setupEventListeners(){this.clickHandler=this.toggle.bind(this),this.hoverShowTriggerHandler=i=>{i.type==="click"?this.toggle():setTimeout(()=>{this.show()},this.options.delay)},this.hoverShowMenuHandler=()=>{this.show()},this.hoverHideHandler=()=>{setTimeout(()=>{this.menuTarget.matches(":hover")||this.hide()},this.options.delay)},this.options.triggerType==="click"?this.triggerTarget.addEventListener("click",this.clickHandler):this.options.triggerType==="hover"&&(this.triggerTarget.addEventListener("mouseenter",this.hoverShowTriggerHandler),this.menuTarget.addEventListener("mouseenter",this.hoverShowMenuHandler),this.triggerTarget.addEventListener("mouseleave",this.hoverHideHandler),this.menuTarget.addEventListener("mouseleave",this.hoverHideHandler))}setupClickOutsideListener(){this.clickOutsideHandler=i=>{let e=i.target,t=this.options.ignoreClickOutsideClass,r=!1;t&&document.querySelectorAll(`.${t}`).forEach(n=>{if(n.contains(e)){r=!0;return}}),e!==this.menuTarget&&!this.menuTarget.contains(e)&&!this.triggerTarget.contains(e)&&!r&&this.visible&&this.hide()},document.body.addEventListener("click",this.clickOutsideHandler,!0)}removeClickOutsideListener(){this.clickOutsideHandler&&document.body.removeEventListener("click",this.clickOutsideHandler,!0)}toggle(){this.visible?this.hide():this.show()}show(){this.menuTarget.classList.remove("hidden"),this.menuTarget.classList.add("block"),this.menuTarget.removeAttribute("aria-hidden"),this.popperInstance.setOptions(i=>({...i,modifiers:[...i.modifiers,{name:"eventListeners",enabled:!0}]})),this.setupClickOutsideListener(),this.popperInstance.update(),this.visible=!0}hide(){this.menuTarget.classList.remove("block"),this.menuTarget.classList.add("hidden"),this.menuTarget.setAttribute("aria-hidden","true"),this.popperInstance.setOptions(i=>({...i,modifiers:[...i.modifiers,{name:"eventListeners",enabled:!1}]})),this.removeClickOutsideListener(),this.visible=!1}};var sa=class extends ie{static targets=["trigger","menu"];connect(){this.element.hasAttribute("data-visible")||this.element.setAttribute("data-visible","false"),this.#e()}toggle(){let i=this.element.getAttribute("data-visible")==="true";this.element.setAttribute("data-visible",(!i).toString()),this.#e()}#e(){this.element.getAttribute("data-visible")==="true"?(this.menuTarget.classList.remove("hidden"),this.triggerTarget.setAttribute("aria-expanded","true"),this.dispatch("expand")):(this.menuTarget.classList.add("hidden"),this.triggerTarget.setAttribute("aria-expanded","false"),this.dispatch("collapse"))}};var na=class extends ie{static values={after:Number};connect(){this.hasAfterValue&&this.afterValue>0&&(this.autoDismissTimeout=setTimeout(()=>{this.dismiss(),this.autoDismissTimeout=null},this.afterValue))}disconnect(){this.autoDismissTimeout&&clearTimeout(this.autoDismissTimeout),this.autoDismissTimeout=null}dismiss(){this.element.remove()}};var oa=class extends ie{static targets=["frame","refreshButton","backButton","homeButton","maximizeLink"];connect(){this.#t(),this.srcHistory=[],this.originalFrameSrc=this.frameTarget.src,this.hasRefreshButtonTarget&&(this.refreshButtonTarget.style.display="",this.refreshButtonClicked=this.refreshButtonClicked.bind(this),this.refreshButtonTarget.addEventListener("click",this.refreshButtonClicked)),this.hasBackButtonTarget&&(this.backButtonClicked=this.backButtonClicked.bind(this),this.backButtonTarget.addEventListener("click",this.backButtonClicked)),this.hasHomeButtonTarget&&(this.homeButtonClicked=this.homeButtonClicked.bind(this),this.homeButtonTarget.addEventListener("click",this.homeButtonClicked)),this.frameLoaded=this.frameLoaded.bind(this),this.frameTarget.addEventListener("turbo:frame-load",this.frameLoaded),this.frameLoading=this.frameLoading.bind(this),this.frameTarget.addEventListener("turbo:click",this.frameLoading),this.frameTarget.addEventListener("turbo:submit-start",this.frameLoading),this.frameFailed=this.frameFailed.bind(this),this.frameTarget.addEventListener("turbo:fetch-request-error",this.frameFailed)}disconnect(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.removeEventListener("click",this.refreshButtonClicked),this.hasBackButtonTarget&&this.backButtonTarget.removeEventListener("click",this.backButtonClicked),this.hasHomeButtonTarget&&this.homeButtonTarget.removeEventListener("click",this.homeButtonClicked),this.frameTarget.removeEventListener("turbo:frame-load",this.frameLoaded),this.frameTarget.removeEventListener("turbo:click",this.frameLoading),this.frameTarget.removeEventListener("turbo:submit-start",this.frameLoading),this.frameTarget.removeEventListener("turbo:fetch-request-error",this.frameFailed)}frameLoading(i){this.#t()}frameFailed(i){this.#i()}frameLoaded(i){this.#i();let e=i.target.src;this.#e(e)}refreshButtonClicked(i){this.frameLoading(null),this.frameTarget.reload()}backButtonClicked(i){this.frameLoading(null),this.srcHistory.pop(),this.frameTarget.src=this.currentSrc}homeButtonClicked(i){this.frameLoading(null),this.frameTarget.src=this.originalFrameSrc}get currentSrc(){return this.srcHistory[this.srcHistory.length-1]}#e(i){i==this.currentSrc||(i==this.originalFrameSrc?this.srcHistory=[i]:this.srcHistory.push(i)),this.#o(),this.hasMaximizeLinkTarget&&(this.maximizeLinkTarget.href=i)}#t(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.add("motion-safe:animate-spin"),this.frameTarget.classList.add("motion-safe:animate-pulse")}#i(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.remove("motion-safe:animate-spin"),this.frameTarget.classList.remove("motion-safe:animate-pulse")}#o(){this.hasHomeButtonTarget&&(this.homeButtonTarget.style.display=this.srcHistory.length>2?"":"none"),this.hasBackButtonTarget&&(this.backButtonTarget.style.display=this.srcHistory.length>1?"":"none")}};var aa=class extends ie{connect(){this.updateColorMode()}disconnect(){}updateColorMode(){localStorage.theme==="dark"||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}setLightColorMode(){localStorage.theme="light",this.updateColorMode()}setDarkColorMode(){localStorage.theme="dark",this.updateColorMode()}setSystemColorMode(){localStorage.removeItem("theme"),this.updateColorMode()}};var{entries:Ep,setPrototypeOf:fp,isFrozen:qy,getPrototypeOf:Vy,getOwnPropertyDescriptor:jy}=Object,{freeze:vt,seal:Gt,create:xp}=Object,{apply:Cc,construct:Fc}=typeof Reflect<"u"&&Reflect;vt||(vt=function(e){return e});Gt||(Gt=function(e){return e});Cc||(Cc=function(e,t,r){return e.apply(t,r)});Fc||(Fc=function(e,t){return new e(...t)});var la=bt(Array.prototype.forEach),Wy=bt(Array.prototype.lastIndexOf),mp=bt(Array.prototype.pop),pn=bt(Array.prototype.push),Gy=bt(Array.prototype.splice),ua=bt(String.prototype.toLowerCase),Ec=bt(String.prototype.toString),gp=bt(String.prototype.match),fn=bt(String.prototype.replace),Ky=bt(String.prototype.indexOf),Xy=bt(String.prototype.trim),oi=bt(Object.prototype.hasOwnProperty),gt=bt(RegExp.prototype.test),mn=Yy(TypeError);function bt(i){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return Cc(i,e,r)}}function Yy(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Fc(i,t)}}function ae(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ua;fp&&fp(i,null);let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){let n=t(s);n!==s&&(qy(e)||(e[r]=n),s=n)}i[s]=!0}return i}function Zy(i){for(let e=0;e<i.length;e++)oi(i,e)||(i[e]=null);return i}function Mr(i){let e=xp(null);for(let[t,r]of Ep(i))oi(i,t)&&(Array.isArray(r)?e[t]=Zy(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Mr(r):e[t]=r);return e}function gn(i,e){for(;i!==null;){let r=jy(i,e);if(r){if(r.get)return bt(r.get);if(typeof r.value=="function")return bt(r.value)}i=Vy(i)}function t(){return null}return t}var vp=vt(["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","section","select","shadow","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"]),xc=vt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),kc=vt(["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"]),Qy=vt(["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"]),Ac=vt(["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"]),Jy=vt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),bp=vt(["#text"]),yp=vt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Pc=vt(["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","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","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","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-rendering","textlength","type","u1","u2","unicode","values","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"]),wp=vt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),ca=vt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),e0=Gt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),t0=Gt(/<%[\w\W]*|[\w\W]*%>/gm),i0=Gt(/\$\{[\w\W]*/gm),r0=Gt(/^data-[\-\w.\u00B7-\uFFFF]+$/),s0=Gt(/^aria-[\-\w]+$/),kp=Gt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),n0=Gt(/^(?:\w+script|data):/i),o0=Gt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ap=Gt(/^html$/i),a0=Gt(/^[a-z][.\w]*(-[.\w]+)+$/i),Sp=Object.freeze({__proto__:null,ARIA_ATTR:s0,ATTR_WHITESPACE:o0,CUSTOM_ELEMENT:a0,DATA_ATTR:r0,DOCTYPE_NAME:Ap,ERB_EXPR:t0,IS_ALLOWED_URI:kp,IS_SCRIPT_OR_DATA:n0,MUSTACHE_EXPR:e0,TMPLIT_EXPR:i0}),vn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},l0=function(){return typeof window>"u"?null:window},c0=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(r=t.getAttribute(s));let n="dompurify"+(r?"#"+r:"");try{return e.createPolicy(n,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+n+" could not be created."),null}},Tp=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Pp(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:l0(),e=Q=>Pp(Q);if(e.version="3.2.4",e.removed=[],!i||!i.document||i.document.nodeType!==vn.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i,r=t,s=r.currentScript,{DocumentFragment:n,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:p,DOMParser:y,trustedTypes:v}=i,x=l.prototype,P=gn(x,"cloneNode"),F=gn(x,"remove"),R=gn(x,"nextSibling"),D=gn(x,"childNodes"),q=gn(x,"parentNode");if(typeof o=="function"){let Q=t.createElement("template");Q.content&&Q.content.ownerDocument&&(t=Q.content.ownerDocument)}let I,z="",{implementation:L,createNodeIterator:j,createDocumentFragment:K,getElementsByTagName:Z}=t,{importNode:ne}=r,Y=Tp();e.isSupported=typeof Ep=="function"&&typeof q=="function"&&L&&L.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:re,ERB_EXPR:le,TMPLIT_EXPR:ke,DATA_ATTR:We,ARIA_ATTR:E,IS_SCRIPT_OR_DATA:k,ATTR_WHITESPACE:A,CUSTOM_ELEMENT:$}=Sp,{IS_ALLOWED_URI:W}=Sp,H=null,J=ae({},[...vp,...xc,...kc,...Ac,...bp]),ee=null,Ae=ae({},[...yp,...Pc,...wp,...ca]),oe=Object.seal(xp(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}})),ce=null,Le=null,De=!0,He=!0,gi=!1,vi=!0,Zt=!1,tr=!0,Qt=!1,Sr=!1,Ci=!1,zt=!1,Fi=!1,_i=!1,_t=!0,bi=!1,ir="user-content-",Oi=!0,Jt=!1,ei={},ti=null,Tr=ae({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),rr=null,Js=ae({},["audio","video","img","source","image","track"]),gs=null,Mo=ae({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vs="http://www.w3.org/1998/Math/MathML",se="http://www.w3.org/2000/svg",Ht="http://www.w3.org/1999/xhtml",yi=Ht,ii=!1,en=null,sr=ae({},[vs,se,Ht],Ec),Ge=ae({},["mi","mo","mn","ms","mtext"]),bs=ae({},["annotation-xml"]),Io=ae({},["title","style","font","a","script"]),ye=null,we=["application/xhtml+xml","text/html"],Rl="text/html",Ee=null,nr=null,wi=t.createElement("form"),Do=function(w){return w instanceof RegExp||w instanceof Function},Me=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(nr&&nr===w)){if((!w||typeof w!="object")&&(w={}),w=Mr(w),ye=we.indexOf(w.PARSER_MEDIA_TYPE)===-1?Rl:w.PARSER_MEDIA_TYPE,Ee=ye==="application/xhtml+xml"?Ec:ua,H=oi(w,"ALLOWED_TAGS")?ae({},w.ALLOWED_TAGS,Ee):J,ee=oi(w,"ALLOWED_ATTR")?ae({},w.ALLOWED_ATTR,Ee):Ae,en=oi(w,"ALLOWED_NAMESPACES")?ae({},w.ALLOWED_NAMESPACES,Ec):sr,gs=oi(w,"ADD_URI_SAFE_ATTR")?ae(Mr(Mo),w.ADD_URI_SAFE_ATTR,Ee):Mo,rr=oi(w,"ADD_DATA_URI_TAGS")?ae(Mr(Js),w.ADD_DATA_URI_TAGS,Ee):Js,ti=oi(w,"FORBID_CONTENTS")?ae({},w.FORBID_CONTENTS,Ee):Tr,ce=oi(w,"FORBID_TAGS")?ae({},w.FORBID_TAGS,Ee):{},Le=oi(w,"FORBID_ATTR")?ae({},w.FORBID_ATTR,Ee):{},ei=oi(w,"USE_PROFILES")?w.USE_PROFILES:!1,De=w.ALLOW_ARIA_ATTR!==!1,He=w.ALLOW_DATA_ATTR!==!1,gi=w.ALLOW_UNKNOWN_PROTOCOLS||!1,vi=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Zt=w.SAFE_FOR_TEMPLATES||!1,tr=w.SAFE_FOR_XML!==!1,Qt=w.WHOLE_DOCUMENT||!1,zt=w.RETURN_DOM||!1,Fi=w.RETURN_DOM_FRAGMENT||!1,_i=w.RETURN_TRUSTED_TYPE||!1,Ci=w.FORCE_BODY||!1,_t=w.SANITIZE_DOM!==!1,bi=w.SANITIZE_NAMED_PROPS||!1,Oi=w.KEEP_CONTENT!==!1,Jt=w.IN_PLACE||!1,W=w.ALLOWED_URI_REGEXP||kp,yi=w.NAMESPACE||Ht,Ge=w.MATHML_TEXT_INTEGRATION_POINTS||Ge,bs=w.HTML_INTEGRATION_POINTS||bs,oe=w.CUSTOM_ELEMENT_HANDLING||{},w.CUSTOM_ELEMENT_HANDLING&&Do(w.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(oe.tagNameCheck=w.CUSTOM_ELEMENT_HANDLING.tagNameCheck),w.CUSTOM_ELEMENT_HANDLING&&Do(w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(oe.attributeNameCheck=w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(oe.allowCustomizedBuiltInElements=w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Zt&&(He=!1),Fi&&(zt=!0),ei&&(H=ae({},bp),ee=[],ei.html===!0&&(ae(H,vp),ae(ee,yp)),ei.svg===!0&&(ae(H,xc),ae(ee,Pc),ae(ee,ca)),ei.svgFilters===!0&&(ae(H,kc),ae(ee,Pc),ae(ee,ca)),ei.mathMl===!0&&(ae(H,Ac),ae(ee,wp),ae(ee,ca))),w.ADD_TAGS&&(H===J&&(H=Mr(H)),ae(H,w.ADD_TAGS,Ee)),w.ADD_ATTR&&(ee===Ae&&(ee=Mr(ee)),ae(ee,w.ADD_ATTR,Ee)),w.ADD_URI_SAFE_ATTR&&ae(gs,w.ADD_URI_SAFE_ATTR,Ee),w.FORBID_CONTENTS&&(ti===Tr&&(ti=Mr(ti)),ae(ti,w.FORBID_CONTENTS,Ee)),Oi&&(H["#text"]=!0),Qt&&ae(H,["html","head","body"]),H.table&&(ae(H,["tbody"]),delete ce.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw mn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw mn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=w.TRUSTED_TYPES_POLICY,z=I.createHTML("")}else I===void 0&&(I=c0(v,s)),I!==null&&typeof z=="string"&&(z=I.createHTML(""));vt&&vt(w),nr=w}},Ot=ae({},[...xc,...kc,...Qy]),Ri=ae({},[...Ac,...Jy]),Ll=function(w){let N=q(w);(!N||!N.tagName)&&(N={namespaceURI:yi,tagName:"template"});let X=ua(w.tagName),be=ua(N.tagName);return en[w.namespaceURI]?w.namespaceURI===se?N.namespaceURI===Ht?X==="svg":N.namespaceURI===vs?X==="svg"&&(be==="annotation-xml"||Ge[be]):!!Ot[X]:w.namespaceURI===vs?N.namespaceURI===Ht?X==="math":N.namespaceURI===se?X==="math"&&bs[be]:!!Ri[X]:w.namespaceURI===Ht?N.namespaceURI===se&&!bs[be]||N.namespaceURI===vs&&!Ge[be]?!1:!Ri[X]&&(Io[X]||!Ot[X]):!!(ye==="application/xhtml+xml"&&en[w.namespaceURI]):!1},At=function(w){pn(e.removed,{element:w});try{q(w).removeChild(w)}catch{F(w)}},or=function(w,N){try{pn(e.removed,{attribute:N.getAttributeNode(w),from:N})}catch{pn(e.removed,{attribute:null,from:N})}if(N.removeAttribute(w),w==="is")if(zt||Fi)try{At(N)}catch{}else try{N.setAttribute(w,"")}catch{}},ar=function(w){let N=null,X=null;if(Ci)w="<remove></remove>"+w;else{let Se=gp(w,/^[\r\n\t ]+/);X=Se&&Se[0]}ye==="application/xhtml+xml"&&yi===Ht&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");let be=I?I.createHTML(w):w;if(yi===Ht)try{N=new y().parseFromString(be,ye)}catch{}if(!N||!N.documentElement){N=L.createDocument(yi,"template",null);try{N.documentElement.innerHTML=ii?z:be}catch{}}let Qe=N.body||N.documentElement;return w&&X&&Qe.insertBefore(t.createTextNode(X),Qe.childNodes[0]||null),yi===Ht?Z.call(N,Qt?"html":"body")[0]:Qt?N.documentElement:Qe},No=function(w){return j.call(w.ownerDocument||w,w,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ys=function(w){return w instanceof p&&(typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||!(w.attributes instanceof d)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function")},tn=function(w){return typeof a=="function"&&w instanceof a};function Ne(Q,w,N){la(Q,X=>{X.call(e,w,N,nr)})}let ft=function(w){let N=null;if(Ne(Y.beforeSanitizeElements,w,null),ys(w))return At(w),!0;let X=Ee(w.nodeName);if(Ne(Y.uponSanitizeElement,w,{tagName:X,allowedTags:H}),w.hasChildNodes()&&!tn(w.firstElementChild)&&gt(/<[/\w]/g,w.innerHTML)&&gt(/<[/\w]/g,w.textContent)||w.nodeType===vn.progressingInstruction||tr&&w.nodeType===vn.comment&&gt(/<[/\w]/g,w.data))return At(w),!0;if(!H[X]||ce[X]){if(!ce[X]&&rn(X)&&(oe.tagNameCheck instanceof RegExp&&gt(oe.tagNameCheck,X)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(X)))return!1;if(Oi&&!ti[X]){let be=q(w)||w.parentNode,Qe=D(w)||w.childNodes;if(Qe&&be){let Se=Qe.length;for(let ht=Se-1;ht>=0;--ht){let $t=P(Qe[ht],!0);$t.__removalCount=(w.__removalCount||0)+1,be.insertBefore($t,R(w))}}}return At(w),!0}return w instanceof l&&!Ll(w)||(X==="noscript"||X==="noembed"||X==="noframes")&&gt(/<\/no(script|embed|frames)/i,w.innerHTML)?(At(w),!0):(Zt&&w.nodeType===vn.text&&(N=w.textContent,la([re,le,ke],be=>{N=fn(N,be," ")}),w.textContent!==N&&(pn(e.removed,{element:w.cloneNode()}),w.textContent=N)),Ne(Y.afterSanitizeElements,w,null),!1)},Li=function(w,N,X){if(_t&&(N==="id"||N==="name")&&(X in t||X in wi))return!1;if(!(He&&!Le[N]&&gt(We,N))){if(!(De&&gt(E,N))){if(!ee[N]||Le[N]){if(!(rn(w)&&(oe.tagNameCheck instanceof RegExp&&gt(oe.tagNameCheck,w)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(w))&&(oe.attributeNameCheck instanceof RegExp&&gt(oe.attributeNameCheck,N)||oe.attributeNameCheck instanceof Function&&oe.attributeNameCheck(N))||N==="is"&&oe.allowCustomizedBuiltInElements&&(oe.tagNameCheck instanceof RegExp&&gt(oe.tagNameCheck,X)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(X))))return!1}else if(!gs[N]){if(!gt(W,fn(X,A,""))){if(!((N==="src"||N==="xlink:href"||N==="href")&&w!=="script"&&Ky(X,"data:")===0&&rr[w])){if(!(gi&&!gt(k,fn(X,A,"")))){if(X)return!1}}}}}}return!0},rn=function(w){return w!=="annotation-xml"&&gp(w,$)},ws=function(w){Ne(Y.beforeSanitizeAttributes,w,null);let{attributes:N}=w;if(!N||ys(w))return;let X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0},be=N.length;for(;be--;){let Qe=N[be],{name:Se,namespaceURI:ht,value:$t}=Qe,lr=Ee(Se),nt=Se==="value"?$t:Xy($t);if(X.attrName=lr,X.attrValue=nt,X.keepAttr=!0,X.forceKeepAttr=void 0,Ne(Y.uponSanitizeAttribute,w,X),nt=X.attrValue,bi&&(lr==="id"||lr==="name")&&(or(Se,w),nt=ir+nt),tr&&gt(/((--!?|])>)|<\/(style|title)/i,nt)){or(Se,w);continue}if(X.forceKeepAttr||(or(Se,w),!X.keepAttr))continue;if(!vi&&gt(/\/>/i,nt)){or(Se,w);continue}Zt&&la([re,le,ke],Uo=>{nt=fn(nt,Uo," ")});let Bo=Ee(w.nodeName);if(Li(Bo,lr,nt)){if(I&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!ht)switch(v.getAttributeType(Bo,lr)){case"TrustedHTML":{nt=I.createHTML(nt);break}case"TrustedScriptURL":{nt=I.createScriptURL(nt);break}}try{ht?w.setAttributeNS(ht,Se,nt):w.setAttribute(Se,nt),ys(w)?At(w):mp(e.removed)}catch{}}}Ne(Y.afterSanitizeAttributes,w,null)},Ml=function Q(w){let N=null,X=No(w);for(Ne(Y.beforeSanitizeShadowDOM,w,null);N=X.nextNode();)Ne(Y.uponSanitizeShadowNode,N,null),ft(N),ws(N),N.content instanceof n&&Q(N.content);Ne(Y.afterSanitizeShadowDOM,w,null)};return e.sanitize=function(Q){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},N=null,X=null,be=null,Qe=null;if(ii=!Q,ii&&(Q="<!-->"),typeof Q!="string"&&!tn(Q))if(typeof Q.toString=="function"){if(Q=Q.toString(),typeof Q!="string")throw mn("dirty is not a string, aborting")}else throw mn("toString is not a function");if(!e.isSupported)return Q;if(Sr||Me(w),e.removed=[],typeof Q=="string"&&(Jt=!1),Jt){if(Q.nodeName){let $t=Ee(Q.nodeName);if(!H[$t]||ce[$t])throw mn("root node is forbidden and cannot be sanitized in-place")}}else if(Q instanceof a)N=ar("<!---->"),X=N.ownerDocument.importNode(Q,!0),X.nodeType===vn.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?N=X:N.appendChild(X);else{if(!zt&&!Zt&&!Qt&&Q.indexOf("<")===-1)return I&&_i?I.createHTML(Q):Q;if(N=ar(Q),!N)return zt?null:_i?z:""}N&&Ci&&At(N.firstChild);let Se=No(Jt?Q:N);for(;be=Se.nextNode();)ft(be),ws(be),be.content instanceof n&&Ml(be.content);if(Jt)return Q;if(zt){if(Fi)for(Qe=K.call(N.ownerDocument);N.firstChild;)Qe.appendChild(N.firstChild);else Qe=N;return(ee.shadowroot||ee.shadowrootmode)&&(Qe=ne.call(r,Qe,!0)),Qe}let ht=Qt?N.outerHTML:N.innerHTML;return Qt&&H["!doctype"]&&N.ownerDocument&&N.ownerDocument.doctype&&N.ownerDocument.doctype.name&&gt(Ap,N.ownerDocument.doctype.name)&&(ht="<!DOCTYPE "+N.ownerDocument.doctype.name+`>
7
+ `+ht),Zt&&la([re,le,ke],$t=>{ht=fn(ht,$t," ")}),I&&_i?I.createHTML(ht):ht},e.setConfig=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Me(Q),Sr=!0},e.clearConfig=function(){nr=null,Sr=!1},e.isValidAttribute=function(Q,w,N){nr||Me({});let X=Ee(Q),be=Ee(w);return Li(X,be,N)},e.addHook=function(Q,w){typeof w=="function"&&pn(Y[Q],w)},e.removeHook=function(Q,w){if(w!==void 0){let N=Wy(Y[Q],w);return N===-1?void 0:Gy(Y[Q],N,1)[0]}return mp(Y[Q])},e.removeHooks=function(Q){Y[Q]=[]},e.removeAllHooks=function(){Y=Tp()},e}var As=Pp();function Rc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Dr=Rc();function Lp(i){Dr=i}var wn={exec:()=>null};function ge(i,e=""){let t=typeof i=="string"?i:i.source,r={replace:(s,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(yt.caret,"$1"),t=t.replace(s,o),r},getRegex:()=>new RegExp(t,e)};return r}var yt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i")},u0=/^(?:[ \t]*(?:\n|$))+/,h0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,d0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Tn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,p0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Lc=/(?:[*+-]|\d{1,9}[.)])/,Mp=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ip=ge(Mp).replace(/bull/g,Lc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),f0=ge(Mp).replace(/bull/g,Lc).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Mc=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,m0=/^[^\n]+/,Ic=/(?!\s*\])(?:\\.|[^\[\]\\])+/,g0=ge(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ic).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),v0=ge(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Lc).getRegex(),pa="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Dc=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,b0=ge("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Dc).replace("tag",pa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Dp=ge(Mc).replace("hr",Tn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pa).getRegex(),y0=ge(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Dp).getRegex(),Nc={blockquote:y0,code:h0,def:g0,fences:d0,heading:p0,hr:Tn,html:b0,lheading:Ip,list:v0,newline:u0,paragraph:Dp,table:wn,text:m0},Cp=ge("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Tn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pa).getRegex(),w0={...Nc,lheading:f0,table:Cp,paragraph:ge(Mc).replace("hr",Tn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Cp).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pa).getRegex()},S0={...Nc,html:ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Dc).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ge(Mc).replace("hr",Tn).replace("heading",` *#{1,6} *[^
8
+ ]`).replace("lheading",Ip).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},T0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,E0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Np=/^( {2,}|\\)\n(?!\s*$)/,x0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fa=/[\p{P}\p{S}]/u,Bc=/[\s\p{P}\p{S}]/u,Bp=/[^\s\p{P}\p{S}]/u,k0=ge(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Bc).getRegex(),Up=/(?!~)[\p{P}\p{S}]/u,A0=/(?!~)[\s\p{P}\p{S}]/u,P0=/(?:[^\s\p{P}\p{S}]|~)/u,C0=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,zp=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,F0=ge(zp,"u").replace(/punct/g,fa).getRegex(),_0=ge(zp,"u").replace(/punct/g,Up).getRegex(),Hp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",O0=ge(Hp,"gu").replace(/notPunctSpace/g,Bp).replace(/punctSpace/g,Bc).replace(/punct/g,fa).getRegex(),R0=ge(Hp,"gu").replace(/notPunctSpace/g,P0).replace(/punctSpace/g,A0).replace(/punct/g,Up).getRegex(),L0=ge("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Bp).replace(/punctSpace/g,Bc).replace(/punct/g,fa).getRegex(),M0=ge(/\\(punct)/,"gu").replace(/punct/g,fa).getRegex(),I0=ge(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),D0=ge(Dc).replace("(?:-->|$)","-->").getRegex(),N0=ge("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",D0).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),da=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,B0=ge(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",da).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$p=ge(/^!?\[(label)\]\[(ref)\]/).replace("label",da).replace("ref",Ic).getRegex(),qp=ge(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ic).getRegex(),U0=ge("reflink|nolink(?!\\()","g").replace("reflink",$p).replace("nolink",qp).getRegex(),Uc={_backpedal:wn,anyPunctuation:M0,autolink:I0,blockSkip:C0,br:Np,code:E0,del:wn,emStrongLDelim:F0,emStrongRDelimAst:O0,emStrongRDelimUnd:L0,escape:T0,link:B0,nolink:qp,punctuation:k0,reflink:$p,reflinkSearch:U0,tag:N0,text:x0,url:wn},z0={...Uc,link:ge(/^!?\[(label)\]\((.*?)\)/).replace("label",da).getRegex(),reflink:ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",da).getRegex()},_c={...Uc,emStrongRDelimAst:R0,emStrongLDelim:_0,url:ge(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},H0={..._c,br:ge(Np).replace("{2,}","*").getRegex(),text:ge(_c.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ha={normal:Nc,gfm:w0,pedantic:S0},bn={normal:Uc,gfm:_c,breaks:H0,pedantic:z0},$0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Fp=i=>$0[i];function Ti(i,e){if(e){if(yt.escapeTest.test(i))return i.replace(yt.escapeReplace,Fp)}else if(yt.escapeTestNoEncode.test(i))return i.replace(yt.escapeReplaceNoEncode,Fp);return i}function _p(i){try{i=encodeURI(i).replace(yt.percentDecode,"%")}catch{return null}return i}function Op(i,e){let t=i.replace(yt.findPipe,(n,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=t.split(yt.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(yt.slashPipe,"|");return r}function yn(i,e,t){let r=i.length;if(r===0)return"";let s=0;for(;s<r&&i.charAt(r-s-1)===e;)s++;return i.slice(0,r-s)}function q0(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<i.length;r++)if(i[r]==="\\")r++;else if(i[r]===e[0])t++;else if(i[r]===e[1]&&(t--,t<0))return r;return-1}function Rp(i,e,t,r,s){let n=e.href,o=e.title||null,a=i[1].replace(s.other.outputLinkReplace,"$1");if(i[0].charAt(0)!=="!"){r.state.inLink=!0;let l={type:"link",raw:t,href:n,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:t,href:n,title:o,text:a}}function V0(i,e,t){let r=i.match(t.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
9
9
  `).map(n=>{let o=n.match(t.other.beginningSpace);if(o===null)return n;let[a]=o;return a.length>=s.length?n.slice(s.length):n}).join(`
10
- `)}var ks=class{options;rules;lexer;constructor(e){this.options=e||Lr}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Sn(r,`
11
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],s=E0(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){let s=Sn(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Sn(t[0],`
12
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=Sn(t[0],`
10
+ `)}var Cs=class{options;rules;lexer;constructor(e){this.options=e||Dr}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:yn(r,`
11
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],s=V0(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){let s=yn(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:yn(t[0],`
12
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=yn(t[0],`
13
13
  `).split(`
14
14
  `),s="",n="",o=[];for(;r.length>0;){let a=!1,l=[],c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))l.push(r[c]),a=!0;else if(!a)l.push(r[c]);else break;r=r.slice(c);let d=l.join(`
15
- `),f=d.replace(this.rules.other.blockquoteSetextReplace,`
15
+ `),p=d.replace(this.rules.other.blockquoteSetextReplace,`
16
16
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
17
17
  ${d}`:d,n=n?`${n}
18
- ${f}`:f;let y=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,o,!0),this.lexer.state.top=y,r.length===0)break;let v=o.at(-1);if(v?.type==="code")break;if(v?.type==="blockquote"){let x=v,P=x.raw+`
18
+ ${p}`:p;let y=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,o,!0),this.lexer.state.top=y,r.length===0)break;let v=o.at(-1);if(v?.type==="code")break;if(v?.type==="blockquote"){let x=v,P=x.raw+`
19
19
  `+r.join(`
20
- `),C=this.blockquote(P);o[o.length-1]=C,s=s.substring(0,s.length-x.raw.length)+C.raw,n=n.substring(0,n.length-x.text.length)+C.text;break}else if(v?.type==="list"){let x=v,P=x.raw+`
20
+ `),F=this.blockquote(P);o[o.length-1]=F,s=s.substring(0,s.length-x.raw.length)+F.raw,n=n.substring(0,n.length-x.text.length)+F.text;break}else if(v?.type==="list"){let x=v,P=x.raw+`
21
21
  `+r.join(`
22
- `),C=this.list(P);o[o.length-1]=C,s=s.substring(0,s.length-v.raw.length)+C.raw,n=n.substring(0,n.length-x.raw.length)+C.raw,r=P.substring(o.at(-1).raw.length).split(`
23
- `);continue}}return{type:"blockquote",raw:s,tokens:o,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),s=r.length>1,n={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let o=this.rules.other.listItemRegex(r),a=!1;for(;e;){let c=!1,d="",f="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let y=t[2].split(`
22
+ `),F=this.list(P);o[o.length-1]=F,s=s.substring(0,s.length-v.raw.length)+F.raw,n=n.substring(0,n.length-x.raw.length)+F.raw,r=P.substring(o.at(-1).raw.length).split(`
23
+ `);continue}}return{type:"blockquote",raw:s,tokens:o,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),s=r.length>1,n={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let o=this.rules.other.listItemRegex(r),a=!1;for(;e;){let c=!1,d="",p="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let y=t[2].split(`
24
24
  `,1)[0].replace(this.rules.other.listReplaceTabs,D=>" ".repeat(3*D.length)),v=e.split(`
25
- `,1)[0],x=!y.trim(),P=0;if(this.options.pedantic?(P=2,f=y.trimStart()):x?P=t[1].length+1:(P=t[2].search(this.rules.other.nonSpaceChar),P=P>4?1:P,f=y.slice(P),P+=t[1].length),x&&this.rules.other.blankLine.test(v)&&(d+=v+`
26
- `,e=e.substring(v.length+1),c=!0),!c){let D=this.rules.other.nextBulletRegex(P),q=this.rules.other.hrRegex(P),M=this.rules.other.fencesBeginRegex(P),H=this.rules.other.headingBeginRegex(P),R=this.rules.other.htmlBeginRegex(P);for(;e;){let G=e.split(`
27
- `,1)[0],K;if(v=G,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),K=v):K=v.replace(this.rules.other.tabCharGlobal," "),M.test(v)||H.test(v)||R.test(v)||D.test(v)||q.test(v))break;if(K.search(this.rules.other.nonSpaceChar)>=P||!v.trim())f+=`
28
- `+K.slice(P);else{if(x||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||M.test(y)||H.test(y)||q.test(y))break;f+=`
29
- `+v}!x&&!v.trim()&&(x=!0),d+=G+`
30
- `,e=e.substring(G.length+1),y=K.slice(P)}}n.loose||(a?n.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(a=!0));let C=null,I;this.options.gfm&&(C=this.rules.other.listIsTask.exec(f),C&&(I=C[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:d,task:!!C,checked:I,loose:!1,text:f,tokens:[]}),n.raw+=d}let l=n.items.at(-1);l&&(l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd()),n.raw=n.raw.trimEnd();for(let c=0;c<n.items.length;c++)if(this.lexer.state.top=!1,n.items[c].tokens=this.lexer.blockTokens(n.items[c].text,[]),!n.loose){let d=n.items[c].tokens.filter(y=>y.type==="space"),f=d.length>0&&d.some(y=>this.rules.other.anyLine.test(y.raw));n.loose=f}if(n.loose)for(let c=0;c<n.items.length;c++)n.items[c].loose=!0;return n}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:s,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=xp(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
31
- `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let a of s)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<r.length;a++)o.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:o.align[a]});for(let a of n)o.rows.push(xp(a,o.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[c]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
32
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=Sn(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=S0(t[2],"()");if(o>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let s=t[2],n="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(s);o&&(s=o[1],n=o[3])}else n=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),kp(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=t[s.toLowerCase()];if(!n){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return kp(r,n,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!r||this.rules.inline.punctuation.exec(r)){let o=[...s[0]].length-1,a,l,c=o,d=0,f=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+o);(s=f.exec(t))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(l=[...a].length,s[3]||s[4]){c+=l;continue}else if((s[5]||s[6])&&o%3&&!((o+l)%3)){d+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+d);let y=[...s[0]][0].length,v=e.slice(0,o+s.index+y+l);if(Math.min(o,l)%2){let P=v.slice(1,-1);return{type:"em",raw:v,text:P,tokens:this.lexer.inlineTokens(P)}}let x=v.slice(2,-2);return{type:"strong",raw:v,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),n=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&n&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,s;return t[2]==="@"?(r=t[1],s="mailto:"+r):(r=t[1],s=r),{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},oi=class i{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Lr,this.options.tokenizer=this.options.tokenizer||new ks,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:vt,block:ua.normal,inline:wn.normal};this.options.pedantic?(t.block=ua.pedantic,t.inline=wn.pedantic):this.options.gfm&&(t.block=ua.gfm,this.options.breaks?t.inline=wn.breaks:t.inline=wn.gfm),this.tokenizer.rules=t}static get rules(){return{block:ua,inline:wn}}static lex(e,t){return new i(t).lex(e)}static lexInline(e,t){return new i(t).inlineTokens(e)}lex(e){e=e.replace(vt.carriageReturn,`
33
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(vt.tabCharGlobal," ").replace(vt.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let o=t.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
25
+ `,1)[0],x=!y.trim(),P=0;if(this.options.pedantic?(P=2,p=y.trimStart()):x?P=t[1].length+1:(P=t[2].search(this.rules.other.nonSpaceChar),P=P>4?1:P,p=y.slice(P),P+=t[1].length),x&&this.rules.other.blankLine.test(v)&&(d+=v+`
26
+ `,e=e.substring(v.length+1),c=!0),!c){let D=this.rules.other.nextBulletRegex(P),q=this.rules.other.hrRegex(P),I=this.rules.other.fencesBeginRegex(P),z=this.rules.other.headingBeginRegex(P),L=this.rules.other.htmlBeginRegex(P);for(;e;){let j=e.split(`
27
+ `,1)[0],K;if(v=j,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),K=v):K=v.replace(this.rules.other.tabCharGlobal," "),I.test(v)||z.test(v)||L.test(v)||D.test(v)||q.test(v))break;if(K.search(this.rules.other.nonSpaceChar)>=P||!v.trim())p+=`
28
+ `+K.slice(P);else{if(x||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||I.test(y)||z.test(y)||q.test(y))break;p+=`
29
+ `+v}!x&&!v.trim()&&(x=!0),d+=j+`
30
+ `,e=e.substring(j.length+1),y=K.slice(P)}}n.loose||(a?n.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(a=!0));let F=null,R;this.options.gfm&&(F=this.rules.other.listIsTask.exec(p),F&&(R=F[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:d,task:!!F,checked:R,loose:!1,text:p,tokens:[]}),n.raw+=d}let l=n.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let c=0;c<n.items.length;c++)if(this.lexer.state.top=!1,n.items[c].tokens=this.lexer.blockTokens(n.items[c].text,[]),!n.loose){let d=n.items[c].tokens.filter(y=>y.type==="space"),p=d.length>0&&d.some(y=>this.rules.other.anyLine.test(y.raw));n.loose=p}if(n.loose)for(let c=0;c<n.items.length;c++)n.items[c].loose=!0;return n}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:s,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=Op(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
31
+ `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let a of s)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<r.length;a++)o.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:o.align[a]});for(let a of n)o.rows.push(Op(a,o.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[c]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
32
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=yn(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=q0(t[2],"()");if(o>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let s=t[2],n="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(s);o&&(s=o[1],n=o[3])}else n=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),Rp(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=t[s.toLowerCase()];if(!n){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return Rp(r,n,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!r||this.rules.inline.punctuation.exec(r)){let o=[...s[0]].length-1,a,l,c=o,d=0,p=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+o);(s=p.exec(t))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(l=[...a].length,s[3]||s[4]){c+=l;continue}else if((s[5]||s[6])&&o%3&&!((o+l)%3)){d+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+d);let y=[...s[0]][0].length,v=e.slice(0,o+s.index+y+l);if(Math.min(o,l)%2){let P=v.slice(1,-1);return{type:"em",raw:v,text:P,tokens:this.lexer.inlineTokens(P)}}let x=v.slice(2,-2);return{type:"strong",raw:v,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),n=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&n&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,s;return t[2]==="@"?(r=t[1],s="mailto:"+r):(r=t[1],s=r),{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},ai=class i{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Dr,this.options.tokenizer=this.options.tokenizer||new Cs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:yt,block:ha.normal,inline:bn.normal};this.options.pedantic?(t.block=ha.pedantic,t.inline=bn.pedantic):this.options.gfm&&(t.block=ha.gfm,this.options.breaks?t.inline=bn.breaks:t.inline=bn.gfm),this.tokenizer.rules=t}static get rules(){return{block:ha,inline:bn}}static lex(e,t){return new i(t).lex(e)}static lexInline(e,t){return new i(t).inlineTokens(e)}lex(e){e=e.replace(yt.carriageReturn,`
33
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(yt.tabCharGlobal," ").replace(yt.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let o=t.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
34
34
  `:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
35
35
  `+s.raw,o.text+=`
36
36
  `+s.text,this.inlineQueue.at(-1).src=o.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
@@ -39,16 +39,16 @@ ${f}`:f;let y=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
39
39
  `+s.raw,o.text+=`
40
40
  `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(s),r=n.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let o=t.at(-1);o?.type==="text"?(o.raw+=`
41
41
  `+s.raw,o.text+=`
42
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(s);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r=e,s=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)a.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n=!1,o="";for(;e;){n||(o=""),n=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=t.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,r,o)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),f;this.options.extensions.startInline.forEach(y=>{f=y.call({lexer:this},d),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),n=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},As=class{options;parser;constructor(e){this.options=e||Lr}space(e){return""}code({text:e,lang:t,escaped:r}){let s=(t||"").match(vt.notSpaceStart)?.[0],n=e.replace(vt.endingNewline,"")+`
43
- `;return s?'<pre><code class="language-'+wi(s)+'">'+(r?n:wi(n,!0))+`</code></pre>
44
- `:"<pre><code>"+(r?n:wi(n,!0))+`</code></pre>
42
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(s);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r=e,s=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)a.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n=!1,o="";for(;e;){n||(o=""),n=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=t.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,r,o)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),p;this.options.extensions.startInline.forEach(y=>{p=y.call({lexer:this},d),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),n=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},Fs=class{options;parser;constructor(e){this.options=e||Dr}space(e){return""}code({text:e,lang:t,escaped:r}){let s=(t||"").match(yt.notSpaceStart)?.[0],n=e.replace(yt.endingNewline,"")+`
43
+ `;return s?'<pre><code class="language-'+Ti(s)+'">'+(r?n:Ti(n,!0))+`</code></pre>
44
+ `:"<pre><code>"+(r?n:Ti(n,!0))+`</code></pre>
45
45
  `}blockquote({tokens:e}){return`<blockquote>
46
46
  ${this.parser.parse(e)}</blockquote>
47
47
  `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
48
48
  `}hr(e){return`<hr>
49
49
  `}list(e){let t=e.ordered,r=e.start,s="";for(let a=0;a<e.items.length;a++){let l=e.items[a];s+=this.listitem(l)}let n=t?"ol":"ul",o=t&&r!==1?' start="'+r+'"':"";return"<"+n+o+`>
50
50
  `+s+"</"+n+`>
51
- `}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+wi(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
51
+ `}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Ti(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
52
52
  `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
53
53
  `}table(e){let t="",r="";for(let n=0;n<e.header.length;n++)r+=this.tablecell(e.header[n]);t+=this.tablerow({text:r});let s="";for(let n=0;n<e.rows.length;n++){let o=e.rows[n];r="";for(let a=0;a<o.length;a++)r+=this.tablecell(o[a]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
54
54
  <thead>
@@ -57,26 +57,26 @@ ${this.parser.parse(e)}</blockquote>
57
57
  `}tablerow({text:e}){return`<tr>
58
58
  ${e}</tr>
59
59
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
60
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${wi(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let s=this.parser.parseInline(r),n=Tp(e);if(n===null)return s;e=n;let o='<a href="'+e+'"';return t&&(o+=' title="'+wi(t)+'"'),o+=">"+s+"</a>",o}image({href:e,title:t,text:r}){let s=Tp(e);if(s===null)return wi(r);e=s;let n=`<img src="${e}" alt="${r}"`;return t&&(n+=` title="${wi(t)}"`),n+=">",n}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:wi(e.text)}},Tn=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},ai=class i{options;renderer;textRenderer;constructor(e){this.options=e||Lr,this.options.renderer=this.options.renderer||new As,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Tn}static parse(e,t){return new i(t).parse(e)}static parseInline(e,t){return new i(t).parseInline(e)}parse(e,t=!0){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let a=n,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=l||"";continue}}let o=n;switch(o.type){case"space":{r+=this.renderer.space(o);continue}case"hr":{r+=this.renderer.hr(o);continue}case"heading":{r+=this.renderer.heading(o);continue}case"code":{r+=this.renderer.code(o);continue}case"table":{r+=this.renderer.table(o);continue}case"blockquote":{r+=this.renderer.blockquote(o);continue}case"list":{r+=this.renderer.list(o);continue}case"html":{r+=this.renderer.html(o);continue}case"paragraph":{r+=this.renderer.paragraph(o);continue}case"text":{let a=o,l=this.renderer.text(a);for(;s+1<e.length&&e[s+1].type==="text";)a=e[++s],l+=`
61
- `+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=a||"";continue}}let o=n;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},xs=class{options;block;constructor(e){this.options=e||Lr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?oi.lex:oi.lexInline}provideParser(){return this.block?ai.parse:ai.parseInline}},_c=class{defaults=Oc();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ai;Renderer=As;TextRenderer=Tn;Lexer=oi;Tokenizer=ks;Hooks=xs;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let s of e)switch(r=r.concat(t.call(this,s)),s.type){case"table":{let n=s;for(let o of n.header)r=r.concat(this.walkTokens(o.tokens,t));for(let o of n.rows)for(let a of o)r=r.concat(this.walkTokens(a.tokens,t));break}case"list":{let n=s;r=r.concat(this.walkTokens(n.items,t));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(o=>{let a=n[o].flat(1/0);r=r.concat(this.walkTokens(a,t))}):n.tokens&&(r=r.concat(this.walkTokens(n.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let o=t.renderers[n.name];o?t.renderers[n.name]=function(...a){let l=n.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[n.level];o?o.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level==="block"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level==="inline"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),s.extensions=t),r.renderer){let n=this.defaults.renderer||new As(this.defaults);for(let o in r.renderer){if(!(o in n))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=r.renderer[a],c=n[a];n[a]=(...d)=>{let f=l.apply(n,d);return f===!1&&(f=c.apply(n,d)),f||""}}s.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new ks(this.defaults);for(let o in r.tokenizer){if(!(o in n))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=r.tokenizer[a],c=n[a];n[a]=(...d)=>{let f=l.apply(n,d);return f===!1&&(f=c.apply(n,d)),f}}s.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new xs;for(let o in r.hooks){if(!(o in n))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=r.hooks[a],c=n[a];xs.passThroughHooks.has(o)?n[a]=d=>{if(this.defaults.async)return Promise.resolve(l.call(n,d)).then(y=>c.call(n,y));let f=l.call(n,d);return c.call(n,f)}:n[a]=(...d)=>{let f=l.apply(n,d);return f===!1&&(f=c.apply(n,d)),f}}s.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,o=r.walkTokens;s.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),n&&(l=l.concat(n.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return oi.lex(e,t??this.defaults)}parser(e,t){return ai.parse(e,t??this.defaults)}parseMarkdown(e){return(r,s)=>{let n={...s},o={...this.defaults,...n},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&n.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);let l=o.hooks?o.hooks.provideLexer():e?oi.lex:oi.lexInline,c=o.hooks?o.hooks.provideParser():e?ai.parse:ai.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(d=>l(d,o)).then(d=>o.hooks?o.hooks.processAllTokens(d):d).then(d=>o.walkTokens?Promise.all(this.walkTokens(d,o.walkTokens)).then(()=>d):d).then(d=>c(d,o)).then(d=>o.hooks?o.hooks.postprocess(d):d).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let d=l(r,o);o.hooks&&(d=o.hooks.processAllTokens(d)),o.walkTokens&&this.walkTokens(d,o.walkTokens);let f=c(d,o);return o.hooks&&(f=o.hooks.postprocess(f)),f}catch(d){return a(d)}}}onError(e,t){return r=>{if(r.message+=`
62
- Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+wi(r.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(r);throw r}}},Rr=new _c;function me(i,e){return Rr.parse(i,e)}me.options=me.setOptions=function(i){return Rr.setOptions(i),me.defaults=Rr.defaults,Ap(me.defaults),me};me.getDefaults=Oc;me.defaults=Lr;me.use=function(...i){return Rr.use(...i),me.defaults=Rr.defaults,Ap(me.defaults),me};me.walkTokens=function(i,e){return Rr.walkTokens(i,e)};me.parseInline=Rr.parseInline;me.Parser=ai;me.parser=ai.parse;me.Renderer=As;me.TextRenderer=Tn;me.Lexer=oi;me.lexer=oi.lex;me.Tokenizer=ks;me.Hooks=xs;me.parse=me;var MP=me.options,IP=me.setOptions,DP=me.use,NP=me.walkTokens,BP=me.parseInline;var UP=ai.parse,zP=oi.lex;var fa=class extends re{connect(){this.easyMDE=new EasyMDE(this.#e()),this.element.setAttribute("data-action","turbo:morph-element->easymde#reconnect")}disconnect(){this.easyMDE&&(this.easyMDE.toTextArea(),this.easyMDE=null)}reconnect(){this.disconnect(),this.connect()}#e(){let i={element:this.element,promptURLs:!0,spellChecker:!1,previewRender:e=>{let t=Ts.sanitize(e,{ALLOWED_TAGS:["strong","em","sub","sup","details","summary"],ALLOWED_ATTR:[]}),r=me(t);return Ts.sanitize(r,{USE_PROFILES:{html:!0}})}};return this.element.attributes.id.value&&(i.autosave={enabled:!0,uniqueId:this.element.attributes.id.value,delay:1e3}),i}};var ma=class extends re{connect(){this.slimSelect=new SlimSelect({select:this.element}),this.element.setAttribute("data-action","turbo:morph-element->slim-select#reconnect")}disconnect(){this.slimSelect&&(this.slimSelect.destroy(),this.slimSelect=null)}reconnect(){this.disconnect(),setTimeout(()=>this.connect(),10)}};var ga=class extends re{connect(){this.picker=new flatpickr(this.element,this.#e()),this.element.setAttribute("data-action","turbo:morph-element->flatpickr#reconnect")}disconnect(){this.picker&&(this.picker.destroy(),this.picker=null)}reconnect(){this.disconnect(),this.connect()}#e(){let i={altInput:!0};return this.element.attributes.type.value=="datetime-local"?i.enableTime=!0:this.element.attributes.type.value=="time"&&(i.enableTime=!0,i.noCalendar=!0),i}};var va=class extends re{static targets=["input"];connect(){}disconnect(){this.inputTargetDisconnected()}inputTargetConnected(){this.hasInputTarget&&(this.iti=window.intlTelInput(this.inputTarget,this.#e()),this.inputTarget.setAttribute("data-action","turbo:morph-element->intl-tel-input#reconnect"))}inputTargetDisconnected(){this.iti&&(this.iti.destroy(),this.iti=null)}reconnect(){this.inputTargetDisconnected(),this.inputTargetConnected()}#e(){return{strictMode:!0,hiddenInput:()=>({phone:this.inputTarget.attributes.name.value}),loadUtilsOnInit:"https://cdn.jsdelivr.net/npm/intl-tel-input@24.8.1/build/js/utils.js"}}};var ba=class extends re{static targets=["select"];navigate(i){let e=this.selectTarget.value,t=document.createElement("a");t.href=e,this.element.appendChild(t),t.click(),t.remove()}};var ya=class extends re{static targets=["btn","tab"];static values={defaultTab:String,activeClasses:String,inActiveClasses:String};connect(){this.activeClasses=this.hasActiveClassesValue?this.activeClassesValue.split(" "):[],this.inActiveClasses=this.hasInActiveClassesValue?this.inActiveClassesValue.split(" "):[],this.#e(this.defaultTabValue||this.btnTargets[0].id)}select(i){this.#e(i.currentTarget.id)}#e(i){let e=this.btnTargets.find(r=>r.id===i);if(!e){console.error(`Tab Button with id "${i}" not found`);return}let t=this.tabTargets.find(r=>r.id===e.dataset.target);if(!t){console.error(`Tab Panel with id "${e.dataset.target}" not found`);return}this.tabTargets.forEach(r=>{r.hidden=!0,r.setAttribute("aria-hidden","true")}),this.btnTargets.forEach(r=>{r.setAttribute("aria-selected","false"),r.setAttribute("tabindex","-1"),r.classList.remove(...this.activeClasses),r.classList.add(...this.inActiveClasses)}),e.setAttribute("aria-selected","true"),e.setAttribute("tabindex","0"),e.classList.remove(...this.inActiveClasses),e.classList.add(...this.activeClasses),t.hidden=!1,t.setAttribute("aria-hidden","false"),e!==document.activeElement&&e.focus()}};function wa(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var T0=0;function Dp(i){return"__private_"+T0+++"_"+i}function x0(i,e,t){let r=[];return i.forEach(s=>typeof s!="string"?r.push(s):e[Symbol.split](s).forEach((n,o,a)=>{n!==""&&r.push(n),o<a.length-1&&r.push(t)})),r}function Ip(i,e){let t=/\$/g,r="$$$$",s=[i];if(e==null)return s;for(let n of Object.keys(e))if(n!=="_"){let o=e[n];typeof o=="string"&&(o=t[Symbol.replace](o,r)),s=x0(s,new RegExp(`%\\{${n}\\}`,"g"),o)}return s}var k0=i=>{throw new Error(`missing string: ${i}`)},kn=Dp("onMissingKey"),An=Dp("apply"),Mr=class{constructor(e,t){let{onMissingKey:r=k0}=t===void 0?{}:t;Object.defineProperty(this,An,{value:A0}),Object.defineProperty(this,kn,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(wa(this,An)[An],this):wa(this,An)[An](e),wa(this,kn)[kn]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&(wa(this,kn)[kn](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){let n=this.locale.pluralize(t.smart_count);return Ip(r[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return Ip(r,t)}};function A0(i){if(!(i!=null&&i.strings))return;let e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}var If=Ce(Bp(),1);var P0="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Up=(i=21)=>{let e="",t=i|0;for(;t--;)e+=P0[Math.random()*64|0];return e};var Df=Ce(yf(),1);function Ea(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var ww=0;function wf(i){return"__private_"+ww+++"_"+i}var Sw={version:"4.1.2"},Ir=wf("callbacks"),$c=wf("publish"),Ta=class{constructor(){Object.defineProperty(this,$c,{value:Ew}),this.state={},Object.defineProperty(this,Ir,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t={...this.state},r={...this.state,...e};this.state=r,Ea(this,$c)[$c](t,r,e)}subscribe(e){return Ea(this,Ir)[Ir].add(e),()=>{Ea(this,Ir)[Ir].delete(e)}}};function Ew(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Ea(this,Ir)[Ir].forEach(r=>{r(...e)})}Ta.VERSION=Sw.version;var Sf=Ta;function Dr(i){let e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}var qc={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Cn(i){var e;if(i.type)return i.type;let t=i.name?(e=Dr(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in qc?qc[t]:"application/octet-stream"}function Tw(i){return i.charCodeAt(0).toString(32)}function Ef(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${Tw(t)}`,"/"))+e}function Tf(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${Ef(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${Ef(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function xw(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function xa(i,e){if(xw(i))return i.id;let t=Cn(i);return Tf({...i,type:t},e)}function Vc(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;let r=e[1].split(".",2),s=parseInt(r[0],10),n=parseInt(r[1],10);return s<15||s===15&&n<15063||s>18||s===18&&n>=18218}function jc(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function Wc(i){return i<10?`0${i}`:i.toString()}function Ps(){let i=new Date,e=Wc(i.getHours()),t=Wc(i.getMinutes()),r=Wc(i.getSeconds());return`${e}:${t}:${r}`}var xf={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ps()}]`,...e)}},kf={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${Ps()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${Ps()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ps()}]`,...e)}};var Fn=Ce(ka(),1),Rf=Ce(Of(),1),Lf={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},At=class extends Error{constructor(e,t){var r;super(e),this.isRestriction=!0,this.isUserFacing=(r=t?.isUserFacing)!=null?r:!0,t!=null&&t.file&&(this.file=t.file)}},Aa=class{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var r;let s=e();if(((r=s.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:r,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(o=>!o.isGhost).length+t.length>s)throw new At(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(r){let n=[...e,...t].reduce((o,a)=>{var l;return o+((l=a.size)!=null?l:0)},0);if(n>r)throw new At(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,Fn.default)(r),size:(0,Fn.default)(n)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(a=>a.includes("/")?e.type?(0,Rf.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=s.join(", ");throw new At(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t){var n;throw new At(this.getI18n()("exceedsSize",{size:(0,Fn.default)(t),file:(n=e.name)!=null?n:this.getI18n()("unnamed")}),{file:e})}if(r&&e.size!=null&&e.size<r)throw new At(this.getI18n()("inferiorSize",{size:(0,Fn.default)(r)}),{file:e})}validate(e,t){t.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new At(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){var t;let r=new At(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(t=e.name)!=null?t:this.getI18n()("unnamed")})),{requiredMetaFields:s}=this.getOpts().restrictions,n=[];for(let o of s)(!Object.hasOwn(e.meta,o)||e.meta[o]==="")&&n.push(o);return{missingFields:n,error:r}}};var Mf={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function W(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Pw=0;function xe(i){return"__private_"+Pw+++"_"+i}var Cw={version:"4.3.1"},Pa={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},ot=xe("plugins"),at=xe("restricter"),_n=xe("storeUnsubscribe"),Bi=xe("emitter"),Nr=xe("preProcessors"),Br=xe("uploaders"),Hi=xe("postProcessors"),Rt=xe("informAndEmit"),Dn=xe("checkRequiredMetaFieldsOnFile"),Gc=xe("checkRequiredMetaFields"),On=xe("assertNewUploadAllowed"),Yc=xe("transformFile"),Rn=xe("startIfAutoProceed"),Ln=xe("checkAndUpdateFileState"),Zc=xe("handleUploadProgress"),Mn=xe("updateTotalProgress"),$i=xe("updateTotalProgressThrottled"),Qc=xe("calculateTotalProgress"),Kc=xe("addListeners"),li=xe("updateOnlineStatus"),In=xe("requestClientById"),Ui=xe("createUpload"),Xc=xe("getUpload"),Ur=xe("removeUpload"),zi=xe("runUpload"),Ca=class i{constructor(e){Object.defineProperty(this,zi,{value:$w}),Object.defineProperty(this,Ur,{value:Hw}),Object.defineProperty(this,Xc,{value:zw}),Object.defineProperty(this,Ui,{value:Uw}),Object.defineProperty(this,Kc,{value:Bw}),Object.defineProperty(this,Qc,{value:Nw}),Object.defineProperty(this,Mn,{value:Dw}),Object.defineProperty(this,Ln,{value:Iw}),Object.defineProperty(this,Rn,{value:Mw}),Object.defineProperty(this,Yc,{value:Lw}),Object.defineProperty(this,On,{value:Rw}),Object.defineProperty(this,Gc,{value:Ow}),Object.defineProperty(this,Dn,{value:_w}),Object.defineProperty(this,Rt,{value:Fw}),Object.defineProperty(this,ot,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,at,{writable:!0,value:void 0}),Object.defineProperty(this,_n,{writable:!0,value:void 0}),Object.defineProperty(this,Bi,{writable:!0,value:(0,If.default)()}),Object.defineProperty(this,Nr,{writable:!0,value:new Set}),Object.defineProperty(this,Br,{writable:!0,value:new Set}),Object.defineProperty(this,Hi,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,Zc,{writable:!0,value:(s,n)=>{let o=s?this.getFile(s.id):void 0;if(s==null||!o){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}if(o.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${s.id}`);return}let a={bytesTotal:n.bytesTotal,percentage:n.bytesTotal!=null&&Number.isFinite(n.bytesTotal)&&n.bytesTotal>0?Math.round(n.bytesUploaded/n.bytesTotal*100):void 0};o.progress.uploadStarted!=null?this.setFileState(s.id,{progress:{...o.progress,...a,bytesUploaded:n.bytesUploaded}}):this.setFileState(s.id,{progress:{...o.progress,...a}}),W(this,$i)[$i]()}}),Object.defineProperty(this,$i,{writable:!0,value:(0,Df.default)(()=>W(this,Mn)[Mn](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,li,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,In,{writable:!0,value:new Map}),this.defaultLocale=Mf;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Lf,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new Sf,logger:xf,infoTimeout:5e3},r={...t,...e};this.opts={...r,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=kf),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Pa,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Vc(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),W(this,at)[at]=new Aa(()=>this.opts,()=>this.i18n),W(this,_n)[_n]=this.store.subscribe((s,n,o)=>{this.emit("state-update",s,n,o),this.updateAll(n)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),W(this,Kc)[Kc]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];W(this,Bi)[Bi].emit(e,...r)}on(e,t){return W(this,Bi)[Bi].on(e,t),this}once(e,t){return W(this,Bi)[Bi].once(e,t),this}off(e,t){return W(this,Bi)[Bi].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(r=>{let[s,n]=r;return[s,{...t[s],...n}]}))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=r=>this.log(`Missing i18n string: ${r}`,"error"),t=new Mr([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},r=Object.create(null);Object.keys(t).forEach(s=>{r[s]={...t[s],progress:{...t[s].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:r,...Pa})}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Pa,files:{}})}addPreProcessor(e){W(this,Nr)[Nr].add(e)}removePreProcessor(e){return W(this,Nr)[Nr].delete(e)}addPostProcessor(e){W(this,Hi)[Hi].add(e)}removePostProcessor(e){return W(this,Hi)[Hi].delete(e)}addUploader(e){W(this,Br)[Br].add(e)}removeUploader(e){return W(this,Br)[Br].delete(e)}setMeta(e){let t={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(s=>{r[s]={...r[s],meta:{...r[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){let r={...this.getState().files};if(!r[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}let s={...r[e].meta,...t};r[e]={...r[e],meta:s},this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:r}=this.getState(),s=Object.values(e),n=[],o=[],a=[],l=[],c=[],d=[],f=[],y=[],v=[];for(let x of s){let{progress:P}=x;!P.uploadComplete&&P.uploadStarted&&(n.push(x),x.isPaused||y.push(x)),P.uploadStarted||o.push(x),(P.uploadStarted||P.preprocess||P.postprocess)&&a.push(x),P.uploadStarted&&l.push(x),x.isPaused&&c.push(x),P.uploadComplete&&d.push(x),x.error&&f.push(x),(P.preprocess||P.postprocess)&&v.push(x)}return{newFiles:o,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:d,erroredFiles:f,inProgressFiles:n,inProgressNotPausedFiles:y,processingFiles:v,isUploadStarted:l.length>0,isAllComplete:t===100&&d.length===s.length&&v.length===0,isAllErrored:!!r&&f.length===s.length,isAllPaused:n.length!==0&&c.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some(x=>x.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{W(this,at)[at].validate(t,[e])}catch(r){return r}return null}validateSingleFile(e){try{W(this,at)[at].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{W(this,at)[at].validateAggregateRestrictions(t,e)}catch(r){return r.message}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){W(this,On)[On](e);let{nextFilesState:t,validFilesToAdd:r,errors:s}=W(this,Ln)[Ln]([e]),n=s.filter(a=>a.isRestriction);if(W(this,Rt)[Rt](n),s.length>0)throw s[0];this.setState({files:t});let[o]=r;return this.emit("file-added",o),this.emit("files-added",r),this.log(`Added file: ${o.name}, ${o.id}, mime type: ${o.type}`),W(this,Rn)[Rn](),o.id}addFiles(e){W(this,On)[On]();let{nextFilesState:t,validFilesToAdd:r,errors:s}=W(this,Ln)[Ln](e),n=s.filter(a=>a.isRestriction);W(this,Rt)[Rt](n);let o=s.filter(a=>!a.isRestriction);if(o.length>0){let a=`Multiple errors occurred while adding files:
60
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ti(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let s=this.parser.parseInline(r),n=_p(e);if(n===null)return s;e=n;let o='<a href="'+e+'"';return t&&(o+=' title="'+Ti(t)+'"'),o+=">"+s+"</a>",o}image({href:e,title:t,text:r}){let s=_p(e);if(s===null)return Ti(r);e=s;let n=`<img src="${e}" alt="${r}"`;return t&&(n+=` title="${Ti(t)}"`),n+=">",n}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ti(e.text)}},Sn=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},li=class i{options;renderer;textRenderer;constructor(e){this.options=e||Dr,this.options.renderer=this.options.renderer||new Fs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Sn}static parse(e,t){return new i(t).parse(e)}static parseInline(e,t){return new i(t).parseInline(e)}parse(e,t=!0){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let a=n,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=l||"";continue}}let o=n;switch(o.type){case"space":{r+=this.renderer.space(o);continue}case"hr":{r+=this.renderer.hr(o);continue}case"heading":{r+=this.renderer.heading(o);continue}case"code":{r+=this.renderer.code(o);continue}case"table":{r+=this.renderer.table(o);continue}case"blockquote":{r+=this.renderer.blockquote(o);continue}case"list":{r+=this.renderer.list(o);continue}case"html":{r+=this.renderer.html(o);continue}case"paragraph":{r+=this.renderer.paragraph(o);continue}case"text":{let a=o,l=this.renderer.text(a);for(;s+1<e.length&&e[s+1].type==="text";)a=e[++s],l+=`
61
+ `+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=a||"";continue}}let o=n;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},Ps=class{options;block;constructor(e){this.options=e||Dr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?ai.lex:ai.lexInline}provideParser(){return this.block?li.parse:li.parseInline}},Oc=class{defaults=Rc();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=li;Renderer=Fs;TextRenderer=Sn;Lexer=ai;Tokenizer=Cs;Hooks=Ps;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let s of e)switch(r=r.concat(t.call(this,s)),s.type){case"table":{let n=s;for(let o of n.header)r=r.concat(this.walkTokens(o.tokens,t));for(let o of n.rows)for(let a of o)r=r.concat(this.walkTokens(a.tokens,t));break}case"list":{let n=s;r=r.concat(this.walkTokens(n.items,t));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(o=>{let a=n[o].flat(1/0);r=r.concat(this.walkTokens(a,t))}):n.tokens&&(r=r.concat(this.walkTokens(n.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let o=t.renderers[n.name];o?t.renderers[n.name]=function(...a){let l=n.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[n.level];o?o.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level==="block"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level==="inline"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),s.extensions=t),r.renderer){let n=this.defaults.renderer||new Fs(this.defaults);for(let o in r.renderer){if(!(o in n))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=r.renderer[a],c=n[a];n[a]=(...d)=>{let p=l.apply(n,d);return p===!1&&(p=c.apply(n,d)),p||""}}s.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new Cs(this.defaults);for(let o in r.tokenizer){if(!(o in n))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=r.tokenizer[a],c=n[a];n[a]=(...d)=>{let p=l.apply(n,d);return p===!1&&(p=c.apply(n,d)),p}}s.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new Ps;for(let o in r.hooks){if(!(o in n))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=r.hooks[a],c=n[a];Ps.passThroughHooks.has(o)?n[a]=d=>{if(this.defaults.async)return Promise.resolve(l.call(n,d)).then(y=>c.call(n,y));let p=l.call(n,d);return c.call(n,p)}:n[a]=(...d)=>{let p=l.apply(n,d);return p===!1&&(p=c.apply(n,d)),p}}s.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,o=r.walkTokens;s.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),n&&(l=l.concat(n.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ai.lex(e,t??this.defaults)}parser(e,t){return li.parse(e,t??this.defaults)}parseMarkdown(e){return(r,s)=>{let n={...s},o={...this.defaults,...n},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&n.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);let l=o.hooks?o.hooks.provideLexer():e?ai.lex:ai.lexInline,c=o.hooks?o.hooks.provideParser():e?li.parse:li.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(d=>l(d,o)).then(d=>o.hooks?o.hooks.processAllTokens(d):d).then(d=>o.walkTokens?Promise.all(this.walkTokens(d,o.walkTokens)).then(()=>d):d).then(d=>c(d,o)).then(d=>o.hooks?o.hooks.postprocess(d):d).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let d=l(r,o);o.hooks&&(d=o.hooks.processAllTokens(d)),o.walkTokens&&this.walkTokens(d,o.walkTokens);let p=c(d,o);return o.hooks&&(p=o.hooks.postprocess(p)),p}catch(d){return a(d)}}}onError(e,t){return r=>{if(r.message+=`
62
+ Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+Ti(r.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(r);throw r}}},Ir=new Oc;function me(i,e){return Ir.parse(i,e)}me.options=me.setOptions=function(i){return Ir.setOptions(i),me.defaults=Ir.defaults,Lp(me.defaults),me};me.getDefaults=Rc;me.defaults=Dr;me.use=function(...i){return Ir.use(...i),me.defaults=Ir.defaults,Lp(me.defaults),me};me.walkTokens=function(i,e){return Ir.walkTokens(i,e)};me.parseInline=Ir.parseInline;me.Parser=li;me.parser=li.parse;me.Renderer=Fs;me.TextRenderer=Sn;me.Lexer=ai;me.lexer=ai.lex;me.Tokenizer=Cs;me.Hooks=Ps;me.parse=me;var tC=me.options,iC=me.setOptions,rC=me.use,sC=me.walkTokens,nC=me.parseInline;var oC=li.parse,aC=ai.lex;var ma=class extends ie{connect(){this.easyMDE=new EasyMDE(this.#e()),this.element.setAttribute("data-action","turbo:morph-element->easymde#reconnect")}disconnect(){this.easyMDE&&(this.easyMDE.toTextArea(),this.easyMDE=null)}reconnect(){this.disconnect(),this.connect()}#e(){let i={element:this.element,promptURLs:!0,spellChecker:!1,previewRender:e=>{let t=As.sanitize(e,{ALLOWED_TAGS:["strong","em","sub","sup","details","summary"],ALLOWED_ATTR:[]}),r=me(t);return As.sanitize(r,{USE_PROFILES:{html:!0}})}};return this.element.attributes.id.value&&(i.autosave={enabled:!0,uniqueId:this.element.attributes.id.value,delay:1e3}),i}};var ga=class extends ie{connect(){this.slimSelect=new SlimSelect({select:this.element}),this.element.setAttribute("data-action","turbo:morph-element->slim-select#reconnect")}disconnect(){this.slimSelect&&(this.slimSelect.destroy(),this.slimSelect=null)}reconnect(){this.disconnect(),setTimeout(()=>this.connect(),10)}};var va=class extends ie{connect(){this.picker=new flatpickr(this.element,this.#e()),this.element.setAttribute("data-action","turbo:morph-element->flatpickr#reconnect")}disconnect(){this.picker&&(this.picker.destroy(),this.picker=null)}reconnect(){this.disconnect(),this.connect()}#e(){let i={altInput:!0};return this.element.attributes.type.value=="datetime-local"?i.enableTime=!0:this.element.attributes.type.value=="time"&&(i.enableTime=!0,i.noCalendar=!0),i}};var ba=class extends ie{static targets=["input"];connect(){}disconnect(){this.inputTargetDisconnected()}inputTargetConnected(){this.hasInputTarget&&(this.iti=window.intlTelInput(this.inputTarget,this.#e()),this.inputTarget.setAttribute("data-action","turbo:morph-element->intl-tel-input#reconnect"))}inputTargetDisconnected(){this.iti&&(this.iti.destroy(),this.iti=null)}reconnect(){this.inputTargetDisconnected(),this.inputTargetConnected()}#e(){return{strictMode:!0,hiddenInput:()=>({phone:this.inputTarget.attributes.name.value}),loadUtilsOnInit:"https://cdn.jsdelivr.net/npm/intl-tel-input@24.8.1/build/js/utils.js"}}};var ya=class extends ie{static targets=["select"];navigate(i){let e=this.selectTarget.value,t=document.createElement("a");t.href=e,this.element.appendChild(t),t.click(),t.remove()}};var wa=class extends ie{static targets=["btn","tab"];static values={defaultTab:String,activeClasses:String,inActiveClasses:String};connect(){this.activeClasses=this.hasActiveClassesValue?this.activeClassesValue.split(" "):[],this.inActiveClasses=this.hasInActiveClassesValue?this.inActiveClassesValue.split(" "):[],this.#e(this.defaultTabValue||this.btnTargets[0].id)}select(i){this.#e(i.currentTarget.id)}#e(i){let e=this.btnTargets.find(r=>r.id===i);if(!e){console.error(`Tab Button with id "${i}" not found`);return}let t=this.tabTargets.find(r=>r.id===e.dataset.target);if(!t){console.error(`Tab Panel with id "${e.dataset.target}" not found`);return}this.tabTargets.forEach(r=>{r.hidden=!0,r.setAttribute("aria-hidden","true")}),this.btnTargets.forEach(r=>{r.setAttribute("aria-selected","false"),r.setAttribute("tabindex","-1"),r.classList.remove(...this.activeClasses),r.classList.add(...this.inActiveClasses)}),e.setAttribute("aria-selected","true"),e.setAttribute("tabindex","0"),e.classList.remove(...this.inActiveClasses),e.classList.add(...this.activeClasses),t.hidden=!1,t.setAttribute("aria-hidden","false"),e!==document.activeElement&&e.focus()}};function Sa(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var j0=0;function jp(i){return"__private_"+j0+++"_"+i}function W0(i,e,t){let r=[];return i.forEach(s=>typeof s!="string"?r.push(s):e[Symbol.split](s).forEach((n,o,a)=>{n!==""&&r.push(n),o<a.length-1&&r.push(t)})),r}function Vp(i,e){let t=/\$/g,r="$$$$",s=[i];if(e==null)return s;for(let n of Object.keys(e))if(n!=="_"){let o=e[n];typeof o=="string"&&(o=t[Symbol.replace](o,r)),s=W0(s,new RegExp(`%\\{${n}\\}`,"g"),o)}return s}var G0=i=>{throw new Error(`missing string: ${i}`)},En=jp("onMissingKey"),xn=jp("apply"),Nr=class{constructor(e,t){let{onMissingKey:r=G0}=t===void 0?{}:t;Object.defineProperty(this,xn,{value:K0}),Object.defineProperty(this,En,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(Sa(this,xn)[xn],this):Sa(this,xn)[xn](e),Sa(this,En)[En]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&(Sa(this,En)[En](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){let n=this.locale.pluralize(t.smart_count);return Vp(r[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return Vp(r,t)}};function K0(i){if(!(i!=null&&i.strings))return;let e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}var qf=Ce(Gp(),1);var X0="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var dr=(i=21)=>{let e="",t=i|0;for(;t--;)e+=X0[Math.random()*64|0];return e};var Vf=Ce(Pf(),1);function Ea(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var $w=0;function Cf(i){return"__private_"+$w+++"_"+i}var qw={version:"4.2.0"},Br=Cf("callbacks"),Vc=Cf("publish"),xa=class{constructor(){Object.defineProperty(this,Vc,{value:Vw}),this.state={},Object.defineProperty(this,Br,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t={...this.state},r={...this.state,...e};this.state=r,Ea(this,Vc)[Vc](t,r,e)}subscribe(e){return Ea(this,Br)[Br].add(e),()=>{Ea(this,Br)[Br].delete(e)}}};function Vw(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Ea(this,Br)[Br].forEach(r=>{r(...e)})}xa.VERSION=qw.version;var Ff=xa;function Ur(i){let e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}var jc={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function An(i){var e;if(i.type)return i.type;let t=i.name?(e=Ur(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in jc?jc[t]:"application/octet-stream"}function jw(i){return i.charCodeAt(0).toString(32)}function _f(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${jw(t)}`,"/"))+e}function Of(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${_f(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${_f(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function Ww(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function ka(i,e){if(Ww(i))return i.id;let t=An(i);return Of({...i,type:t},e)}function Wc(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;let r=e[1].split(".",2),s=parseInt(r[0],10),n=parseInt(r[1],10);return s<15||s===15&&n<15063||s>18||s===18&&n>=18218}function Gc(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function Kc(i){return i<10?`0${i}`:i.toString()}function _s(){let i=new Date,e=Kc(i.getHours()),t=Kc(i.getMinutes()),r=Kc(i.getSeconds());return`${e}:${t}:${r}`}var Rf={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${_s()}]`,...e)}},Lf={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${_s()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${_s()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${_s()}]`,...e)}};var Pn=Ce(Aa(),1),zf=Ce(Uf(),1),Hf={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},Ct=class extends Error{constructor(e,t){var r;super(e),this.isRestriction=!0,this.isUserFacing=(r=t?.isUserFacing)!=null?r:!0,t!=null&&t.file&&(this.file=t.file)}},Pa=class{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var r;let s=e();if(((r=s.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:r,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(o=>!o.isGhost).length+t.length>s)throw new Ct(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(r){let n=[...e,...t].reduce((o,a)=>{var l;return o+((l=a.size)!=null?l:0)},0);if(n>r)throw new Ct(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,Pn.default)(r),size:(0,Pn.default)(n)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(a=>a.includes("/")?e.type?(0,zf.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=s.join(", ");throw new Ct(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t){var n;throw new Ct(this.getI18n()("exceedsSize",{size:(0,Pn.default)(t),file:(n=e.name)!=null?n:this.getI18n()("unnamed")}),{file:e})}if(r&&e.size!=null&&e.size<r)throw new Ct(this.getI18n()("inferiorSize",{size:(0,Pn.default)(r)}),{file:e})}validate(e,t){t.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new Ct(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){var t;let r=new Ct(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(t=e.name)!=null?t:this.getI18n()("unnamed")})),{requiredMetaFields:s}=this.getOpts().restrictions,n=[];for(let o of s)(!Object.hasOwn(e.meta,o)||e.meta[o]==="")&&n.push(o);return{missingFields:n,error:r}}};var $f={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function G(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Xw=0;function xe(i){return"__private_"+Xw+++"_"+i}var Yw={version:"4.4.2"},Ca={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},at=xe("plugins"),lt=xe("restricter"),Cn=xe("storeUnsubscribe"),zi=xe("emitter"),zr=xe("preProcessors"),Hr=xe("uploaders"),qi=xe("postProcessors"),Lt=xe("informAndEmit"),Mn=xe("checkRequiredMetaFieldsOnFile"),Xc=xe("checkRequiredMetaFields"),Fn=xe("assertNewUploadAllowed"),Qc=xe("transformFile"),_n=xe("startIfAutoProceed"),On=xe("checkAndUpdateFileState"),Jc=xe("handleUploadProgress"),Rn=xe("updateTotalProgress"),Vi=xe("updateTotalProgressThrottled"),eu=xe("calculateTotalProgress"),Yc=xe("addListeners"),ci=xe("updateOnlineStatus"),Ln=xe("requestClientById"),Hi=xe("createUpload"),Zc=xe("getUpload"),$r=xe("removeUpload"),$i=xe("runUpload"),Fa=class i{constructor(e){Object.defineProperty(this,$i,{value:u1}),Object.defineProperty(this,$r,{value:c1}),Object.defineProperty(this,Zc,{value:l1}),Object.defineProperty(this,Hi,{value:a1}),Object.defineProperty(this,Yc,{value:o1}),Object.defineProperty(this,eu,{value:n1}),Object.defineProperty(this,Rn,{value:s1}),Object.defineProperty(this,On,{value:r1}),Object.defineProperty(this,_n,{value:i1}),Object.defineProperty(this,Qc,{value:t1}),Object.defineProperty(this,Fn,{value:e1}),Object.defineProperty(this,Xc,{value:Jw}),Object.defineProperty(this,Mn,{value:Qw}),Object.defineProperty(this,Lt,{value:Zw}),Object.defineProperty(this,at,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,Cn,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:(0,qf.default)()}),Object.defineProperty(this,zr,{writable:!0,value:new Set}),Object.defineProperty(this,Hr,{writable:!0,value:new Set}),Object.defineProperty(this,qi,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,Jc,{writable:!0,value:(s,n)=>{let o=s?this.getFile(s.id):void 0;if(s==null||!o){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}if(o.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${s.id}`);return}let a={bytesTotal:n.bytesTotal,percentage:n.bytesTotal!=null&&Number.isFinite(n.bytesTotal)&&n.bytesTotal>0?Math.round(n.bytesUploaded/n.bytesTotal*100):void 0};o.progress.uploadStarted!=null?this.setFileState(s.id,{progress:{...o.progress,...a,bytesUploaded:n.bytesUploaded}}):this.setFileState(s.id,{progress:{...o.progress,...a}}),G(this,Vi)[Vi]()}}),Object.defineProperty(this,Vi,{writable:!0,value:(0,Vf.default)(()=>G(this,Rn)[Rn](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,ci,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,Ln,{writable:!0,value:new Map}),this.defaultLocale=$f;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Hf,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new Ff,logger:Rf,infoTimeout:5e3},r={...t,...e};this.opts={...r,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=Lf),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Ca,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Wc(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),G(this,lt)[lt]=new Pa(()=>this.opts,()=>this.i18n),G(this,Cn)[Cn]=this.store.subscribe((s,n,o)=>{this.emit("state-update",s,n,o),this.updateAll(n)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),G(this,Yc)[Yc]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];G(this,zi)[zi].emit(e,...r)}on(e,t){return G(this,zi)[zi].on(e,t),this}once(e,t){return G(this,zi)[zi].once(e,t),this}off(e,t){return G(this,zi)[zi].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(r=>{let[s,n]=r;return[s,{...t[s],...n}]}))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=r=>this.log(`Missing i18n string: ${r}`,"error"),t=new Nr([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},r=Object.create(null);Object.keys(t).forEach(s=>{r[s]={...t[s],progress:{...t[s].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:r,...Ca})}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Ca,files:{}})}addPreProcessor(e){G(this,zr)[zr].add(e)}removePreProcessor(e){return G(this,zr)[zr].delete(e)}addPostProcessor(e){G(this,qi)[qi].add(e)}removePostProcessor(e){return G(this,qi)[qi].delete(e)}addUploader(e){G(this,Hr)[Hr].add(e)}removeUploader(e){return G(this,Hr)[Hr].delete(e)}setMeta(e){let t={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(s=>{r[s]={...r[s],meta:{...r[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){let r={...this.getState().files};if(!r[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}let s={...r[e].meta,...t};r[e]={...r[e],meta:s},this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:r}=this.getState(),s=Object.values(e),n=[],o=[],a=[],l=[],c=[],d=[],p=[],y=[],v=[];for(let x of s){let{progress:P}=x;!P.uploadComplete&&P.uploadStarted&&(n.push(x),x.isPaused||y.push(x)),P.uploadStarted||o.push(x),(P.uploadStarted||P.preprocess||P.postprocess)&&a.push(x),P.uploadStarted&&l.push(x),x.isPaused&&c.push(x),P.uploadComplete&&d.push(x),x.error&&p.push(x),(P.preprocess||P.postprocess)&&v.push(x)}return{newFiles:o,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:d,erroredFiles:p,inProgressFiles:n,inProgressNotPausedFiles:y,processingFiles:v,isUploadStarted:l.length>0,isAllComplete:t===100&&d.length===s.length&&v.length===0,isAllErrored:!!r&&p.length===s.length,isAllPaused:n.length!==0&&c.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some(x=>x.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{G(this,lt)[lt].validate(t,[e])}catch(r){return r}return null}validateSingleFile(e){try{G(this,lt)[lt].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{G(this,lt)[lt].validateAggregateRestrictions(t,e)}catch(r){return r.message}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){G(this,Fn)[Fn](e);let{nextFilesState:t,validFilesToAdd:r,errors:s}=G(this,On)[On]([e]),n=s.filter(a=>a.isRestriction);if(G(this,Lt)[Lt](n),s.length>0)throw s[0];this.setState({files:t});let[o]=r;return this.emit("file-added",o),this.emit("files-added",r),this.log(`Added file: ${o.name}, ${o.id}, mime type: ${o.type}`),G(this,_n)[_n](),o.id}addFiles(e){G(this,Fn)[Fn]();let{nextFilesState:t,validFilesToAdd:r,errors:s}=G(this,On)[On](e),n=s.filter(a=>a.isRestriction);G(this,Lt)[Lt](n);let o=s.filter(a=>!a.isRestriction);if(o.length>0){let a=`Multiple errors occurred while adding files:
63
63
  `;if(o.forEach(l=>{a+=`
64
64
  * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:a},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(o,a);{let l=new Error(a);throw l.errors=o,l}}this.setState({files:t}),r.forEach(a=>{this.emit("file-added",a)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.values(r).forEach(a=>{this.log(`Added file: ${a.name}
65
65
  id: ${a.id}
66
- type: ${a.type}`)}),r.length>0&&W(this,Rn)[Rn]()}removeFiles(e){let{files:t,currentUploads:r}=this.getState(),s={...t},n={...r},o=Object.create(null);e.forEach(d=>{t[d]&&(o[d]=t[d],delete s[d])});function a(d){return o[d]===void 0}Object.keys(n).forEach(d=>{let f=r[d].fileIDs.filter(a);if(f.length===0){delete n[d];return}let{capabilities:y}=this.getState();if(f.length!==r[d].fileIDs.length&&!y.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");n[d]={...r[d],fileIDs:f}});let l={currentUploads:n,files:s};Object.keys(s).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),W(this,$i)[$i]();let c=Object.keys(o);c.forEach(d=>{this.emit("file-removed",o[d])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let t=this.getFile(e),s=!(t.isPaused||!1);return this.setFileState(e,{isPaused:s}),this.emit("upload-pause",t,s),s}pauseAll(){let e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{let s={...e[r],isPaused:!0};e[r]=s}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{let s={...e[r],isPaused:!1,error:null};e[r]=s}),this.setState({files:e}),this.emit("resume-all")}retryAll(){let e={...this.getState().files},t=Object.keys(e).filter(s=>e[s].error);if(t.forEach(s=>{let n={...e[s],isPaused:!1,error:null};e[s]=n}),this.setState({files:e,error:null}),this.emit("retry-all",Object.values(e)),t.length===0)return Promise.resolve({successful:[],failed:[]});let r=W(this,Ui)[Ui](t,{forceAllowNewUpload:!0});return W(this,zi)[zi](r)}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(Pa)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let t=W(this,Ui)[Ui]([e],{forceAllowNewUpload:!0});return W(this,zi)[zi](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return W(this,Mn)[Mn]()}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e){if(typeof e!="function"){let l=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(l)}for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];let n=new e(this,...r),o=n.id;if(!o)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");let a=this.getPlugin(o);if(a){let l=`Already found a plugin named '${a.id}'. Tried to use: '${o}'.
67
- Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return e.VERSION&&this.log(`Using ${o} v${e.VERSION}`),n.type in W(this,ot)[ot]?W(this,ot)[ot][n.type].push(n):W(this,ot)[ot][n.type]=[n],n.install(),this.emit("plugin-added",n),this}getPlugin(e){for(let t of Object.values(W(this,ot)[ot])){let r=t.find(s=>s.id===e);if(r!=null)return r}}[Symbol.for("uppy test: getPlugins")](e){return W(this,ot)[ot][e]}iteratePlugins(e){Object.values(W(this,ot)[ot]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=W(this,ot)[ot][e.type],r=t.findIndex(o=>o.id===e.id);r!==-1&&t.splice(r,1);let n={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(n)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),W(this,_n)[_n](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",W(this,li)[li]),window.removeEventListener("offline",W(this,li)[li]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,r){t===void 0&&(t="info"),r===void 0&&(r=3e3);let s=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:s?e.message:e,details:s?e.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(e,t){let{logger:r}=this.opts;switch(t){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e);break}}registerRequestClient(e,t){W(this,In)[In].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=W(this,In)[In].get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?W(this,zi)[zi](e):(W(this,Ur)[Ur](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return W(this,Ui)[Ui](...arguments)}addResultData(e,t){if(!W(this,Xc)[Xc](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:r}=this.getState(),s={...r[e],result:{...r[e].result,...t}};this.setState({currentUploads:{...r,[e]:s}})}upload(){var e;(e=W(this,ot)[ot].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState(),r=this.opts.onBeforeUpload(t);return r===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&typeof r=="object"&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>W(this,at)[at].validateMinNumberOfFiles(t)).catch(s=>{throw W(this,Rt)[Rt]([s]),s}).then(()=>{if(!W(this,Gc)[Gc](t))throw new At(this.i18n("missingRequiredMetaField"))}).catch(s=>{throw s}).then(()=>{let{currentUploads:s}=this.getState(),n=Object.values(s).flatMap(l=>l.fileIDs),o=[];Object.keys(t).forEach(l=>{let c=this.getFile(l);!c.progress.uploadStarted&&n.indexOf(l)===-1&&o.push(c.id)});let a=W(this,Ui)[Ui](o);return W(this,zi)[zi](a)}).catch(s=>{throw this.emit("error",s),this.log(s,"error"),s}))}};function Fw(i){for(let n of i)n.isRestriction?this.emit("restriction-failed",n.file,n):this.emit("error",n,n.file),this.log(n,"warning");let e=i.filter(n=>n.isUserFacing),t=4,r=e.slice(0,t),s=e.slice(t);r.forEach(n=>{let{message:o,details:a=""}=n;this.info({message:o,details:a},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}function _w(i){let{missingFields:e,error:t}=W(this,at)[at].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",i,t),!1):!0}function Ow(i){let e=!0;for(let t of Object.values(i))W(this,Dn)[Dn](t)||(e=!1);return e}function Rw(i){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new At(this.i18n("noMoreFilesAllowed"),{file:i});throw W(this,Rt)[Rt]([t]),t}}function Lw(i){let e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=Cn(e),r=jc(t,e),s=Dr(r).extension,n=xa(e,this.getID()),o=e.meta||{};o.name=r,o.type=t;let a=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:n,name:r,extension:s||"",meta:{...this.getState().meta,...o},type:t,data:e.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:a,uploadComplete:!1,uploadStarted:null},size:a,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote,preview:e.preview}}function Mw(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}function Iw(i){let{files:e}=this.getState(),t={...e},r=[],s=[];for(let a of i)try{var n;let l=W(this,Yc)[Yc](a),c=(n=e[l.id])==null?void 0:n.isGhost;c&&(l={...e[l.id],isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`));let d=this.opts.onBeforeFileAdded(l,t);if(!d&&this.checkIfFileAlreadyExists(l.id)){var o;throw new At(this.i18n("noDuplicates",{fileName:(o=l.name)!=null?o:this.i18n("unnamed")}),{file:a})}if(d===!1&&!c)throw new At("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof d=="object"&&d!==null&&(l=d),W(this,at)[at].validateSingleFile(l),t[l.id]=l,r.push(l)}catch(l){s.push(l)}try{W(this,at)[at].validateAggregateRestrictions(Object.values(e),r)}catch(a){return s.push(a),{nextFilesState:e,validFilesToAdd:[],errors:s}}return{nextFilesState:t,validFilesToAdd:r,errors:s}}function Dw(){var i,e;let t=W(this,Qc)[Qc](),r=null;t!=null&&(r=Math.round(t*100),r>100?r=100:r<0&&(r=0)),this.emit("progress",(i=r)!=null?i:0),this.setState({totalProgress:(e=r)!=null?e:0})}function Nw(){let e=this.getFiles().filter(a=>a.progress.uploadStarted||a.progress.preprocess||a.progress.postprocess);if(e.length===0)return 0;if(e.every(a=>a.progress.uploadComplete))return 1;let t=a=>a.progress.bytesTotal!=null&&a.progress.bytesTotal!==0,r=e.filter(t),s=e.filter(a=>!t(a));if(r.every(a=>a.progress.uploadComplete)&&s.length>0&&!s.every(a=>a.progress.uploadComplete))return null;let n=r.reduce((a,l)=>{var c;return a+((c=l.progress.bytesTotal)!=null?c:0)},0),o=r.reduce((a,l)=>a+(l.progress.bytesUploaded||0),0);return n===0?0:o/n}function Bw(){let i=(r,s,n)=>{let o=r.message||"Unknown error";r.details&&(o+=` ${r.details}`),this.setState({error:o}),s!=null&&s.id in this.getState().files&&this.setFileState(s.id,{error:o,response:n})};this.on("error",i),this.on("upload-error",(r,s,n)=>{if(i(s,r,n),typeof s=="object"&&s.message){var o;this.log(s.message,"error");let a=new Error(this.i18n("failedToUpload",{file:(o=r?.name)!=null?o:""}));a.isUserFacing=!0,a.details=s.message,s.details&&(a.details+=` ${s.details}`),W(this,Rt)[Rt]([a])}else W(this,Rt)[Rt]([s])});let e=null;this.on("upload-stalled",(r,s)=>{let{message:n}=r,o=s.map(a=>a.meta.name).join(", ");e||(this.info({message:n,details:o},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${n} ${o}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let t=r=>{let s=r.filter(o=>{let a=o!=null&&this.getFile(o.id);return a||this.log(`Not setting progress for a file that has been removed: ${o?.id}`),a}),n=Object.fromEntries(s.map(o=>[o.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:o.size}}]));this.patchFilesState(n)};this.on("upload-start",t),this.on("upload-progress",W(this,Zc)[Zc]),this.on("upload-success",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let n=this.getFile(r.id).progress;this.setFileState(r.id,{progress:{...n,postprocess:W(this,Hi)[Hi].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:s,uploadURL:s.uploadURL,isPaused:!1}),r.size==null&&this.setFileState(r.id,{size:s.bytesUploaded||n.bytesTotal}),W(this,$i)[$i]()}),this.on("preprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:{...this.getFile(r.id).progress,preprocess:s}})}),this.on("preprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.preprocess,this.setState({files:s})}),this.on("postprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:{...this.getState().files[r.id].progress,postprocess:s}})}),this.on("postprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.postprocess,this.setState({files:s})}),this.on("restored",()=>{W(this,$i)[$i]()}),this.on("dashboard:file-edit-complete",r=>{r&&W(this,Dn)[Dn](r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",W(this,li)[li]),window.addEventListener("offline",W(this,li)[li]),setTimeout(W(this,li)[li],3e3))}function Uw(i,e){e===void 0&&(e={});let{forceAllowNewUpload:t=!1}=e,{allowNewUpload:r,currentUploads:s}=this.getState();if(!r&&!t)throw new Error("Cannot create a new upload: already uploading.");let n=Up();return this.emit("upload",n,this.getFilesByIds(i)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...s,[n]:{fileIDs:i,step:0,result:{}}}}),n}function zw(i){let{currentUploads:e}=this.getState();return e[i]}function Hw(i){let e={...this.getState().currentUploads};delete e[i],this.setState({currentUploads:e})}async function $w(i){let e=()=>{let{currentUploads:n}=this.getState();return n[i]},t=e(),r=[...W(this,Nr)[Nr],...W(this,Br)[Br],...W(this,Hi)[Hi]];try{for(let n=t.step||0;n<r.length&&t;n++){let o=r[n];this.setState({currentUploads:{...this.getState().currentUploads,[i]:{...t,step:n}}});let{fileIDs:a}=t;await o(a,i),t=e()}}catch(n){throw W(this,Ur)[Ur](i),n}if(t){t.fileIDs.forEach(l=>{let c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});let n=t.fileIDs.map(l=>this.getFile(l)),o=n.filter(l=>!l.error),a=n.filter(l=>l.error);this.addResultData(i,{successful:o,failed:a,uploadID:i}),t=e()}let s;return t&&(s=t.result,this.emit("complete",s),W(this,Ur)[Ur](i)),s==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),s}Ca.VERSION=Cw.version;var Jc=Ca;var Un,Ee,Hf,qw,zr,Nf,$f,eu,ru,tu,iu,Vw,Bn={},qf=[],jw=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Oa=Array.isArray;function qi(i,e){for(var t in e)i[t]=e[t];return i}function Vf(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function u(i,e,t){var r,s,n,o={};for(n in e)n=="key"?r=e[n]:n=="ref"?s=e[n]:o[n]=e[n];if(arguments.length>2&&(o.children=arguments.length>3?Un.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(n in i.defaultProps)o[n]===void 0&&(o[n]=i.defaultProps[n]);return Nn(i,o,r,s,null)}function Nn(i,e,t,r,s){var n={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++Hf,__i:-1,__u:0};return s==null&&Ee.vnode!=null&&Ee.vnode(n),n}function jf(){return{current:null}}function Lt(i){return i.children}function ht(i,e){this.props=i,this.context=e}function Cs(i,e){if(e==null)return i.__?Cs(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?Cs(i):null}function Wf(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return Wf(i)}}function Bf(i){(!i.__d&&(i.__d=!0)&&zr.push(i)&&!_a.__r++||Nf!==Ee.debounceRendering)&&((Nf=Ee.debounceRendering)||$f)(_a)}function _a(){var i,e,t,r,s,n,o,a;for(zr.sort(eu);i=zr.shift();)i.__d&&(e=zr.length,r=void 0,n=(s=(t=i).__v).__e,o=[],a=[],t.__P&&((r=qi({},s)).__v=s.__v+1,Ee.vnode&&Ee.vnode(r),su(t.__P,r,s,t.__n,t.__P.namespaceURI,32&s.__u?[n]:null,o,n??Cs(s),!!(32&s.__u),a),r.__v=s.__v,r.__.__k[r.__i]=r,Xf(o,r,a),r.__e!=n&&Wf(r)),zr.length>e&&zr.sort(eu));_a.__r=0}function Gf(i,e,t,r,s,n,o,a,l,c,d){var f,y,v,x,P,C=r&&r.__k||qf,I=e.length;for(t.__d=l,Ww(t,e,C),l=t.__d,f=0;f<I;f++)(v=t.__k[f])!=null&&(y=v.__i===-1?Bn:C[v.__i]||Bn,v.__i=f,su(i,v,y,s,n,o,a,l,c,d),x=v.__e,v.ref&&y.ref!=v.ref&&(y.ref&&nu(y.ref,null,v),d.push(v.ref,v.__c||x,v)),P==null&&x!=null&&(P=x),65536&v.__u||y.__k===v.__k?l=Kf(v,l,i):typeof v.type=="function"&&v.__d!==void 0?l=v.__d:x&&(l=x.nextSibling),v.__d=void 0,v.__u&=-196609);t.__d=l,t.__e=P}function Ww(i,e,t){var r,s,n,o,a,l=e.length,c=t.length,d=c,f=0;for(i.__k=[],r=0;r<l;r++)(s=e[r])!=null&&typeof s!="boolean"&&typeof s!="function"?(o=r+f,(s=i.__k[r]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?Nn(null,s,null,null,null):Oa(s)?Nn(Lt,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?Nn(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=i,s.__b=i.__b+1,n=null,(a=s.__i=Gw(s,t,o,d))!==-1&&(d--,(n=t[a])&&(n.__u|=131072)),n==null||n.__v===null?(a==-1&&f--,typeof s.type!="function"&&(s.__u|=65536)):a!==o&&(a==o-1?f--:a==o+1?f++:(a>o?f--:f++,s.__u|=65536))):s=i.__k[r]=null;if(d)for(r=0;r<c;r++)(n=t[r])!=null&&!(131072&n.__u)&&(n.__e==i.__d&&(i.__d=Cs(n)),Yf(n,n))}function Kf(i,e,t){var r,s;if(typeof i.type=="function"){for(r=i.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=i,e=Kf(r[s],e,t));return e}i.__e!=e&&(e&&i.type&&!t.contains(e)&&(e=Cs(i)),t.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function Si(i,e){return e=e||[],i==null||typeof i=="boolean"||(Oa(i)?i.some(function(t){Si(t,e)}):e.push(i)),e}function Gw(i,e,t,r){var s=i.key,n=i.type,o=t-1,a=t+1,l=e[t];if(l===null||l&&s==l.key&&n===l.type&&!(131072&l.__u))return t;if(r>(l!=null&&!(131072&l.__u)?1:0))for(;o>=0||a<e.length;){if(o>=0){if((l=e[o])&&!(131072&l.__u)&&s==l.key&&n===l.type)return o;o--}if(a<e.length){if((l=e[a])&&!(131072&l.__u)&&s==l.key&&n===l.type)return a;a++}}return-1}function Uf(i,e,t){e[0]==="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||jw.test(e)?t:t+"px"}function Fa(i,e,t,r,s){var n;e:if(e==="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)t&&e in t||Uf(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||Uf(i.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")n=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in i||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+n]=t,t?r?t.u=r.u:(t.u=ru,i.addEventListener(e,n?iu:tu,n)):i.removeEventListener(e,n?iu:tu,n);else{if(s=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function zf(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=ru++;else if(e.t<t.u)return;return t(Ee.event?Ee.event(e):e)}}}function su(i,e,t,r,s,n,o,a,l,c){var d,f,y,v,x,P,C,I,D,q,M,H,R,G,K,Y,ie=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),n=[a=e.__e=t.__e]),(d=Ee.__b)&&d(e);e:if(typeof ie=="function")try{if(I=e.props,D="prototype"in ie&&ie.prototype.render,q=(d=ie.contextType)&&r[d.__c],M=d?q?q.props.value:d.__:r,t.__c?C=(f=e.__c=t.__c).__=f.__E:(D?e.__c=f=new ie(I,M):(e.__c=f=new ht(I,M),f.constructor=ie,f.render=Xw),q&&q.sub(f),f.props=I,f.state||(f.state={}),f.context=M,f.__n=r,y=f.__d=!0,f.__h=[],f._sb=[]),D&&f.__s==null&&(f.__s=f.state),D&&ie.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=qi({},f.__s)),qi(f.__s,ie.getDerivedStateFromProps(I,f.__s))),v=f.props,x=f.state,f.__v=e,y)D&&ie.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),D&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(D&&ie.getDerivedStateFromProps==null&&I!==v&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(I,M),!f.__e&&(f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(I,f.__s,M)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(f.props=I,f.state=f.__s,f.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(Q){Q&&(Q.__=e)}),H=0;H<f._sb.length;H++)f.__h.push(f._sb[H]);f._sb=[],f.__h.length&&o.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(I,f.__s,M),D&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(v,x,P)})}if(f.context=M,f.props=I,f.__P=i,f.__e=!1,R=Ee.__r,G=0,D){for(f.state=f.__s,f.__d=!1,R&&R(e),d=f.render(f.props,f.state,f.context),K=0;K<f._sb.length;K++)f.__h.push(f._sb[K]);f._sb=[]}else do f.__d=!1,R&&R(e),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++G<25);f.state=f.__s,f.getChildContext!=null&&(r=qi(qi({},r),f.getChildContext())),D&&!y&&f.getSnapshotBeforeUpdate!=null&&(P=f.getSnapshotBeforeUpdate(v,x)),Gf(i,Oa(Y=d!=null&&d.type===Lt&&d.key==null?d.props.children:d)?Y:[Y],e,t,r,s,n,o,a,l,c),f.base=e.__e,e.__u&=-161,f.__h.length&&o.push(f),C&&(f.__E=f.__=null)}catch(Q){if(e.__v=null,l||n!=null){for(e.__u|=l?160:128;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;n[n.indexOf(a)]=null,e.__e=a}else e.__e=t.__e,e.__k=t.__k;Ee.__e(Q,e,t)}else n==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=Kw(t.__e,e,t,r,s,n,o,l,c);(d=Ee.diffed)&&d(e)}function Xf(i,e,t){e.__d=void 0;for(var r=0;r<t.length;r++)nu(t[r],t[++r],t[++r]);Ee.__c&&Ee.__c(e,i),i.some(function(s){try{i=s.__h,s.__h=[],i.some(function(n){n.call(s)})}catch(n){Ee.__e(n,s.__v)}})}function Kw(i,e,t,r,s,n,o,a,l){var c,d,f,y,v,x,P,C=t.props,I=e.props,D=e.type;if(D==="svg"?s="http://www.w3.org/2000/svg":D==="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),n!=null){for(c=0;c<n.length;c++)if((v=n[c])&&"setAttribute"in v==!!D&&(D?v.localName===D:v.nodeType===3)){i=v,n[c]=null;break}}if(i==null){if(D===null)return document.createTextNode(I);i=document.createElementNS(s,D,I.is&&I),a&&(Ee.__m&&Ee.__m(e,n),a=!1),n=null}if(D===null)C===I||a&&i.data===I||(i.data=I);else{if(n=n&&Un.call(i.childNodes),C=t.props||Bn,!a&&n!=null)for(C={},c=0;c<i.attributes.length;c++)C[(v=i.attributes[c]).name]=v.value;for(c in C)if(v=C[c],c!="children"){if(c=="dangerouslySetInnerHTML")f=v;else if(!(c in I)){if(c=="value"&&"defaultValue"in I||c=="checked"&&"defaultChecked"in I)continue;Fa(i,c,null,v,s)}}for(c in I)v=I[c],c=="children"?y=v:c=="dangerouslySetInnerHTML"?d=v:c=="value"?x=v:c=="checked"?P=v:a&&typeof v!="function"||C[c]===v||Fa(i,c,v,C[c],s);if(d)a||f&&(d.__html===f.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),e.__k=[];else if(f&&(i.innerHTML=""),Gf(i,Oa(y)?y:[y],e,t,r,D==="foreignObject"?"http://www.w3.org/1999/xhtml":s,n,o,n?n[0]:t.__k&&Cs(t,0),a,l),n!=null)for(c=n.length;c--;)Vf(n[c]);a||(c="value",D==="progress"&&x==null?i.removeAttribute("value"):x!==void 0&&(x!==i[c]||D==="progress"&&!x||D==="option"&&x!==C[c])&&Fa(i,c,x,C[c],s),c="checked",P!==void 0&&P!==i[c]&&Fa(i,c,P,C[c],s))}return i}function nu(i,e,t){try{if(typeof i=="function"){var r=typeof i.__u=="function";r&&i.__u(),r&&e==null||(i.__u=i(e))}else i.current=e}catch(s){Ee.__e(s,t)}}function Yf(i,e,t){var r,s;if(Ee.unmount&&Ee.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||nu(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(n){Ee.__e(n,e)}r.base=r.__P=null}if(r=i.__k)for(s=0;s<r.length;s++)r[s]&&Yf(r[s],e,t||typeof i.type!="function");t||Vf(i.__e),i.__c=i.__=i.__e=i.__d=void 0}function Xw(i,e,t){return this.constructor(i,t)}function ou(i,e,t){var r,s,n,o;Ee.__&&Ee.__(i,e),s=(r=typeof t=="function")?null:t&&t.__k||e.__k,n=[],o=[],su(e,i=(!r&&t||e).__k=u(Lt,null,[i]),s||Bn,Bn,e.namespaceURI,!r&&t?[t]:s?null:e.firstChild?Un.call(e.childNodes):null,n,!r&&t?t:s?s.__e:e.firstChild,r,o),Xf(n,i,o)}function Ra(i,e,t){var r,s,n,o,a=qi({},i.props);for(n in i.type&&i.type.defaultProps&&(o=i.type.defaultProps),e)n=="key"?r=e[n]:n=="ref"?s=e[n]:a[n]=e[n]===void 0&&o!==void 0?o[n]:e[n];return arguments.length>2&&(a.children=arguments.length>3?Un.call(arguments,2):t),Nn(i.type,a,r||i.key,s||i.ref,null)}Un=qf.slice,Ee={__e:function(i,e,t,r){for(var s,n,o;e=e.__;)if((s=e.__c)&&!s.__)try{if((n=s.constructor)&&n.getDerivedStateFromError!=null&&(s.setState(n.getDerivedStateFromError(i)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(i,r||{}),o=s.__d),o)return s.__E=s}catch(a){i=a}throw i}},Hf=0,qw=function(i){return i!=null&&i.constructor==null},ht.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=qi({},this.state),typeof i=="function"&&(i=i(qi({},t),this.props)),i&&qi(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),Bf(this))},ht.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Bf(this))},ht.prototype.render=Lt,zr=[],$f=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,eu=function(i,e){return i.__v.__b-e.__v.__b},_a.__r=0,ru=0,tu=zf(!1),iu=zf(!0),Vw=0;function zn(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function Yw(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):zn(i)?i:null}var Zf=Yw;function Zw(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}var La=Zw;var Hr=class{constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new Mr([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}};function Qf(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Qw=0;function Jw(i){return"__private_"+Qw+++"_"+i}function e1(i){let e=null,t;return function(){for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=s,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e}}var Hn=Jw("updateUI"),au=class i extends Hr{constructor(){super(...arguments),Object.defineProperty(this,Hn,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t instanceof i||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:i}}));else if(typeof e=="function"){let r=e;this.uppy.iteratePlugins(s=>{s instanceof r&&(t=s)})}return t}mount(e,t){let r=t.id,s=Zf(e);if(s){this.isTargetDOMEl=!0;let a=document.createElement("div");return a.classList.add("uppy-Root"),Qf(this,Hn)[Hn]=e1(l=>{this.uppy.getPlugin(this.id)&&(ou(this.render(l,a),a),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),ou(this.render(this.uppy.getState(),a),a),this.el=a,s.appendChild(a),a.dir=this.opts.direction||La(a)||"ltr",this.onMount(),this.el}let n=this.getTargetPlugin(e);if(n)return this.uppy.log(`Installing ${r} to ${n.id}`),this.parent=n,this.el=n.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let o=`Invalid target option given to ${r}.`;throw typeof e=="function"?o+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":o+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)}render(e,t){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,r;(t=(r=Qf(this,Hn))[Hn])==null||t.call(r,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},ci=au;function Ma(i,e,t,r){return t===0||i===e?i:r===0?e:i+(e-i)*2**(-r/t)}var Mt={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var fu=Ce(bt(),1);function $n(i){let e=[],t="indeterminate",r;for(let{progress:n}of Object.values(i)){let{preprocess:o,postprocess:a}=n;r==null&&(o||a)&&({mode:t,message:r}=o||a),o?.mode==="determinate"&&e.push(o.value),a?.mode==="determinate"&&e.push(a.value)}let s=e.reduce((n,o)=>n+o/e.length,0);return{mode:t,message:r,value:s}}var hu=Ce(bt(),1),uu=Ce(ka(),1);function lu(i){let e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,r=Math.floor(i%60);return{hours:e,minutes:t,seconds:r}}function cu(i){let e=lu(i),t=e.hours===0?"":`${e.hours}h`,r=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,s=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${r}${s}`}var t1="\xB7",Jf=()=>` ${t1} `;function em(i){let{newFiles:e,isUploadStarted:t,recoveredState:r,i18n:s,uploadState:n,isSomeGhost:o,startUpload:a}=i,l=(0,hu.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===Mt.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":o}),c=e&&t&&!r?s("uploadXNewFiles",{smart_count:e}):s("uploadXFiles",{smart_count:e});return u("button",{type:"button",className:l,"aria-label":s("uploadXFiles",{smart_count:e}),onClick:a,disabled:o,"data-uppy-super-focusable":!0},c)}function tm(i){let{i18n:e,uppy:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},u("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),e("retry"))}function im(i){let{i18n:e,uppy:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))}function rm(i){let{isAllPaused:e,i18n:t,isAllComplete:r,resumableUploads:s,uppy:n}=i,o=t(e?"resume":"pause");function a(){if(!r){if(!s){n.cancelAll();return}if(e){n.resumeAll();return}n.pauseAll()}}return u("button",{title:o,"aria-label":o,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:a,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function sm(i){let{i18n:e,doneButtonHandler:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0},e("done"))}function nm(){return u("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},u("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function om(i){let{progress:e}=i,{value:t,mode:r,message:s}=e;return u("div",{className:"uppy-StatusBar-content"},u(nm,null),r==="determinate"?`${Math.round(t*100)}% \xB7 `:"",s)}function i1(i){let{numUploads:e,complete:t,totalUploadedSize:r,totalSize:s,totalETA:n,i18n:o}=i,a=e>1,l=(0,uu.default)(r);return u("div",{className:"uppy-StatusBar-statusSecondary"},a&&o("filesUploadedOfTotal",{complete:t,smart_count:e}),u("span",{className:"uppy-StatusBar-additionalInfo"},a&&Jf(),s!=null?o("dataUploadedOfTotal",{complete:l,total:(0,uu.default)(s)}):o("dataUploadedOfUnknown",{complete:l}),Jf(),n!=null&&o("xTimeLeft",{time:cu(n)})))}function am(i){let{i18n:e,complete:t,numUploads:r}=i;return u("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:r}))}function r1(i){let{i18n:e,newFiles:t,startUpload:r}=i,s=(0,hu.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return u("div",{className:"uppy-StatusBar-statusSecondary"},u("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:t})),u("button",{type:"button",className:s,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:r},e("upload")))}function lm(i){let{i18n:e,supportsUploadProgress:t,totalProgress:r,showProgressDetails:s,isUploadStarted:n,isAllComplete:o,isAllPaused:a,newFiles:l,numUploads:c,complete:d,totalUploadedSize:f,totalSize:y,totalETA:v,startUpload:x}=i,P=l&&n;if(!n||o)return null;let C=e(a?"paused":"uploading");function I(){return!a&&!P&&s?t?u(i1,{numUploads:c,complete:d,totalUploadedSize:f,totalSize:y,totalETA:v,i18n:e}):u(am,{i18n:e,complete:d,numUploads:c}):null}return u("div",{className:"uppy-StatusBar-content","aria-label":C,title:C},a?null:u(nm,null),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t&&r!==0?`${C}: ${r}%`:C),I(),P?u(r1,{i18n:e,newFiles:l,startUpload:x}):null))}function cm(i){let{i18n:e}=i;return u("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},u("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}function um(i){let{error:e,i18n:t,complete:r,numUploads:s}=i;function n(){let o=`${t("uploadFailed")}
66
+ type: ${a.type}`)}),r.length>0&&G(this,_n)[_n]()}removeFiles(e){let{files:t,currentUploads:r}=this.getState(),s={...t},n={...r},o=Object.create(null);e.forEach(d=>{t[d]&&(o[d]=t[d],delete s[d])});function a(d){return o[d]===void 0}Object.keys(n).forEach(d=>{let p=r[d].fileIDs.filter(a);if(p.length===0){delete n[d];return}let{capabilities:y}=this.getState();if(p.length!==r[d].fileIDs.length&&!y.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");n[d]={...r[d],fileIDs:p}});let l={currentUploads:n,files:s};Object.keys(s).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),G(this,Vi)[Vi]();let c=Object.keys(o);c.forEach(d=>{this.emit("file-removed",o[d])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let t=this.getFile(e),s=!(t.isPaused||!1);return this.setFileState(e,{isPaused:s}),this.emit("upload-pause",t,s),s}pauseAll(){let e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{let s={...e[r],isPaused:!0};e[r]=s}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{let s={...e[r],isPaused:!1,error:null};e[r]=s}),this.setState({files:e}),this.emit("resume-all")}retryAll(){let e={...this.getState().files},t=Object.keys(e).filter(s=>e[s].error);if(t.forEach(s=>{let n={...e[s],isPaused:!1,error:null};e[s]=n}),this.setState({files:e,error:null}),this.emit("retry-all",Object.values(e)),t.length===0)return Promise.resolve({successful:[],failed:[]});let r=G(this,Hi)[Hi](t,{forceAllowNewUpload:!0});return G(this,$i)[$i](r)}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(Ca)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let t=G(this,Hi)[Hi]([e],{forceAllowNewUpload:!0});return G(this,$i)[$i](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return G(this,Rn)[Rn]()}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e){if(typeof e!="function"){let l=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(l)}for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];let n=new e(this,...r),o=n.id;if(!o)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");let a=this.getPlugin(o);if(a){let l=`Already found a plugin named '${a.id}'. Tried to use: '${o}'.
67
+ Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return e.VERSION&&this.log(`Using ${o} v${e.VERSION}`),n.type in G(this,at)[at]?G(this,at)[at][n.type].push(n):G(this,at)[at][n.type]=[n],n.install(),this.emit("plugin-added",n),this}getPlugin(e){for(let t of Object.values(G(this,at)[at])){let r=t.find(s=>s.id===e);if(r!=null)return r}}[Symbol.for("uppy test: getPlugins")](e){return G(this,at)[at][e]}iteratePlugins(e){Object.values(G(this,at)[at]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=G(this,at)[at][e.type],r=t.findIndex(o=>o.id===e.id);r!==-1&&t.splice(r,1);let n={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(n)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),G(this,Cn)[Cn](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",G(this,ci)[ci]),window.removeEventListener("offline",G(this,ci)[ci]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,r){t===void 0&&(t="info"),r===void 0&&(r=3e3);let s=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:s?e.message:e,details:s?e.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(e,t){let{logger:r}=this.opts;switch(t){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e);break}}registerRequestClient(e,t){G(this,Ln)[Ln].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=G(this,Ln)[Ln].get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?G(this,$i)[$i](e):(G(this,$r)[$r](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return G(this,Hi)[Hi](...arguments)}addResultData(e,t){if(!G(this,Zc)[Zc](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:r}=this.getState(),s={...r[e],result:{...r[e].result,...t}};this.setState({currentUploads:{...r,[e]:s}})}upload(){var e;(e=G(this,at)[at].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState(),r=this.opts.onBeforeUpload(t);return r===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&typeof r=="object"&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>G(this,lt)[lt].validateMinNumberOfFiles(t)).catch(s=>{throw G(this,Lt)[Lt]([s]),s}).then(()=>{if(!G(this,Xc)[Xc](t))throw new Ct(this.i18n("missingRequiredMetaField"))}).catch(s=>{throw s}).then(()=>{let{currentUploads:s}=this.getState(),n=Object.values(s).flatMap(l=>l.fileIDs),o=[];Object.keys(t).forEach(l=>{let c=this.getFile(l);!c.progress.uploadStarted&&n.indexOf(l)===-1&&o.push(c.id)});let a=G(this,Hi)[Hi](o);return G(this,$i)[$i](a)}).catch(s=>{throw this.emit("error",s),this.log(s,"error"),s}))}};function Zw(i){for(let n of i)n.isRestriction?this.emit("restriction-failed",n.file,n):this.emit("error",n,n.file),this.log(n,"warning");let e=i.filter(n=>n.isUserFacing),t=4,r=e.slice(0,t),s=e.slice(t);r.forEach(n=>{let{message:o,details:a=""}=n;this.info({message:o,details:a},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}function Qw(i){let{missingFields:e,error:t}=G(this,lt)[lt].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",i,t),!1):!0}function Jw(i){let e=!0;for(let t of Object.values(i))G(this,Mn)[Mn](t)||(e=!1);return e}function e1(i){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new Ct(this.i18n("noMoreFilesAllowed"),{file:i});throw G(this,Lt)[Lt]([t]),t}}function t1(i){let e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=An(e),r=Gc(t,e),s=Ur(r).extension,n=ka(e,this.getID()),o=e.meta||{};o.name=r,o.type=t;let a=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:n,name:r,extension:s||"",meta:{...this.getState().meta,...o},type:t,data:e.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:a,uploadComplete:!1,uploadStarted:null},size:a,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote,preview:e.preview}}function i1(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}function r1(i){let{files:e}=this.getState(),t={...e},r=[],s=[];for(let a of i)try{var n;let l=G(this,Qc)[Qc](a),c=(n=e[l.id])==null?void 0:n.isGhost;c&&(l={...e[l.id],isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`));let d=this.opts.onBeforeFileAdded(l,t);if(!d&&this.checkIfFileAlreadyExists(l.id)){var o;throw new Ct(this.i18n("noDuplicates",{fileName:(o=l.name)!=null?o:this.i18n("unnamed")}),{file:a})}if(d===!1&&!c)throw new Ct("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof d=="object"&&d!==null&&(l=d),G(this,lt)[lt].validateSingleFile(l),t[l.id]=l,r.push(l)}catch(l){s.push(l)}try{G(this,lt)[lt].validateAggregateRestrictions(Object.values(e),r)}catch(a){return s.push(a),{nextFilesState:e,validFilesToAdd:[],errors:s}}return{nextFilesState:t,validFilesToAdd:r,errors:s}}function s1(){var i,e;let t=G(this,eu)[eu](),r=null;t!=null&&(r=Math.round(t*100),r>100?r=100:r<0&&(r=0)),this.emit("progress",(i=r)!=null?i:0),this.setState({totalProgress:(e=r)!=null?e:0})}function n1(){let e=this.getFiles().filter(a=>a.progress.uploadStarted||a.progress.preprocess||a.progress.postprocess);if(e.length===0)return 0;if(e.every(a=>a.progress.uploadComplete))return 1;let t=a=>a.progress.bytesTotal!=null&&a.progress.bytesTotal!==0,r=e.filter(t),s=e.filter(a=>!t(a));if(r.every(a=>a.progress.uploadComplete)&&s.length>0&&!s.every(a=>a.progress.uploadComplete))return null;let n=r.reduce((a,l)=>{var c;return a+((c=l.progress.bytesTotal)!=null?c:0)},0),o=r.reduce((a,l)=>a+(l.progress.bytesUploaded||0),0);return n===0?0:o/n}function o1(){let i=(r,s,n)=>{let o=r.message||"Unknown error";r.details&&(o+=` ${r.details}`),this.setState({error:o}),s!=null&&s.id in this.getState().files&&this.setFileState(s.id,{error:o,response:n})};this.on("error",i),this.on("upload-error",(r,s,n)=>{if(i(s,r,n),typeof s=="object"&&s.message){var o;this.log(s.message,"error");let a=new Error(this.i18n("failedToUpload",{file:(o=r?.name)!=null?o:""}));a.isUserFacing=!0,a.details=s.message,s.details&&(a.details+=` ${s.details}`),G(this,Lt)[Lt]([a])}else G(this,Lt)[Lt]([s])});let e=null;this.on("upload-stalled",(r,s)=>{let{message:n}=r,o=s.map(a=>a.meta.name).join(", ");e||(this.info({message:n,details:o},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${n} ${o}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let t=r=>{let s=r.filter(o=>{let a=o!=null&&this.getFile(o.id);return a||this.log(`Not setting progress for a file that has been removed: ${o?.id}`),a}),n=Object.fromEntries(s.map(o=>[o.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:o.size}}]));this.patchFilesState(n)};this.on("upload-start",t),this.on("upload-progress",G(this,Jc)[Jc]),this.on("upload-success",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let n=this.getFile(r.id).progress;this.setFileState(r.id,{progress:{...n,postprocess:G(this,qi)[qi].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:s,uploadURL:s.uploadURL,isPaused:!1}),r.size==null&&this.setFileState(r.id,{size:s.bytesUploaded||n.bytesTotal}),G(this,Vi)[Vi]()}),this.on("preprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:{...this.getFile(r.id).progress,preprocess:s}})}),this.on("preprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.preprocess,this.setState({files:s})}),this.on("postprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:{...this.getState().files[r.id].progress,postprocess:s}})}),this.on("postprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.postprocess,this.setState({files:s})}),this.on("restored",()=>{G(this,Vi)[Vi]()}),this.on("dashboard:file-edit-complete",r=>{r&&G(this,Mn)[Mn](r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",G(this,ci)[ci]),window.addEventListener("offline",G(this,ci)[ci]),setTimeout(G(this,ci)[ci],3e3))}function a1(i,e){e===void 0&&(e={});let{forceAllowNewUpload:t=!1}=e,{allowNewUpload:r,currentUploads:s}=this.getState();if(!r&&!t)throw new Error("Cannot create a new upload: already uploading.");let n=dr();return this.emit("upload",n,this.getFilesByIds(i)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...s,[n]:{fileIDs:i,step:0,result:{}}}}),n}function l1(i){let{currentUploads:e}=this.getState();return e[i]}function c1(i){let e={...this.getState().currentUploads};delete e[i],this.setState({currentUploads:e})}async function u1(i){let e=()=>{let{currentUploads:n}=this.getState();return n[i]},t=e(),r=[...G(this,zr)[zr],...G(this,Hr)[Hr],...G(this,qi)[qi]];try{for(let n=t.step||0;n<r.length&&t;n++){let o=r[n];this.setState({currentUploads:{...this.getState().currentUploads,[i]:{...t,step:n}}});let{fileIDs:a}=t;await o(a,i),t=e()}}catch(n){throw G(this,$r)[$r](i),n}if(t){t.fileIDs.forEach(l=>{let c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});let n=t.fileIDs.map(l=>this.getFile(l)),o=n.filter(l=>!l.error),a=n.filter(l=>l.error);this.addResultData(i,{successful:o,failed:a,uploadID:i}),t=e()}let s;return t&&(s=t.result,this.emit("complete",s),G(this,$r)[$r](i)),s==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),s}Fa.VERSION=Yw.version;var _a=Fa;var Nn,Te,Xf,h1,qr,jf,Yf,Zf,Qf,ru,tu,iu,d1,Dn={},Jf=[],p1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Bn=Array.isArray;function Ei(i,e){for(var t in e)i[t]=e[t];return i}function su(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function u(i,e,t){var r,s,n,o={};for(n in e)n=="key"?r=e[n]:n=="ref"?s=e[n]:o[n]=e[n];if(arguments.length>2&&(o.children=arguments.length>3?Nn.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(n in i.defaultProps)o[n]===void 0&&(o[n]=i.defaultProps[n]);return In(i,o,r,s,null)}function In(i,e,t,r,s){var n={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++Xf,__i:-1,__u:0};return s==null&&Te.vnode!=null&&Te.vnode(n),n}function em(){return{current:null}}function Mt(i){return i.children}function dt(i,e){this.props=i,this.context=e}function Os(i,e){if(e==null)return i.__?Os(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?Os(i):null}function tm(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return tm(i)}}function Wf(i){(!i.__d&&(i.__d=!0)&&qr.push(i)&&!Ra.__r++||jf!==Te.debounceRendering)&&((jf=Te.debounceRendering)||Yf)(Ra)}function Ra(){for(var i,e,t,r,s,n,o,a=1;qr.length;)qr.length>a&&qr.sort(Zf),i=qr.shift(),a=qr.length,i.__d&&(t=void 0,s=(r=(e=i).__v).__e,n=[],o=[],e.__P&&((t=Ei({},r)).__v=r.__v+1,Te.vnode&&Te.vnode(t),nu(e.__P,t,r,e.__n,e.__P.namespaceURI,32&r.__u?[s]:null,n,s??Os(r),!!(32&r.__u),o),t.__v=r.__v,t.__.__k[t.__i]=t,sm(n,t,o),t.__e!=s&&tm(t)));Ra.__r=0}function im(i,e,t,r,s,n,o,a,l,c,d){var p,y,v,x,P,F,R=r&&r.__k||Jf,D=e.length;for(l=f1(t,e,R,l,D),p=0;p<D;p++)(v=t.__k[p])!=null&&(y=v.__i===-1?Dn:R[v.__i]||Dn,v.__i=p,F=nu(i,v,y,s,n,o,a,l,c,d),x=v.__e,v.ref&&y.ref!=v.ref&&(y.ref&&ou(y.ref,null,v),d.push(v.ref,v.__c||x,v)),P==null&&x!=null&&(P=x),4&v.__u||y.__k===v.__k?l=rm(v,l,i):typeof v.type=="function"&&F!==void 0?l=F:x&&(l=x.nextSibling),v.__u&=-7);return t.__e=P,l}function f1(i,e,t,r,s){var n,o,a,l,c,d=t.length,p=d,y=0;for(i.__k=new Array(s),n=0;n<s;n++)(o=e[n])!=null&&typeof o!="boolean"&&typeof o!="function"?(l=n+y,(o=i.__k[n]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?In(null,o,null,null,null):Bn(o)?In(Mt,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?In(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=i,o.__b=i.__b+1,a=null,(c=o.__i=m1(o,t,l,p))!==-1&&(p--,(a=t[c])&&(a.__u|=2)),a==null||a.__v===null?(c==-1&&(s>d?y--:s<d&&y++),typeof o.type!="function"&&(o.__u|=4)):c!=l&&(c==l-1?y--:c==l+1?y++:(c>l?y--:y++,o.__u|=4))):i.__k[n]=null;if(p)for(n=0;n<d;n++)(a=t[n])!=null&&!(2&a.__u)&&(a.__e==r&&(r=Os(a)),om(a,a));return r}function rm(i,e,t){var r,s;if(typeof i.type=="function"){for(r=i.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=i,e=rm(r[s],e,t));return e}i.__e!=e&&(e&&i.type&&!t.contains(e)&&(e=Os(i)),t.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function xi(i,e){return e=e||[],i==null||typeof i=="boolean"||(Bn(i)?i.some(function(t){xi(t,e)}):e.push(i)),e}function m1(i,e,t,r){var s,n,o=i.key,a=i.type,l=e[t];if(l===null&&i.key==null||l&&o==l.key&&a===l.type&&!(2&l.__u))return t;if(r>(l!=null&&!(2&l.__u)?1:0))for(s=t-1,n=t+1;s>=0||n<e.length;){if(s>=0){if((l=e[s])&&!(2&l.__u)&&o==l.key&&a===l.type)return s;s--}if(n<e.length){if((l=e[n])&&!(2&l.__u)&&o==l.key&&a===l.type)return n;n++}}return-1}function Gf(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||p1.test(e)?t:t+"px"}function Oa(i,e,t,r,s){var n;e:if(e=="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)t&&e in t||Gf(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||Gf(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(Qf,"$1")),e=e.toLowerCase()in i||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+n]=t,t?r?t.t=r.t:(t.t=ru,i.addEventListener(e,n?iu:tu,n)):i.removeEventListener(e,n?iu:tu,n);else{if(s=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function Kf(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.u==null)e.u=ru++;else if(e.u<t.t)return;return t(Te.event?Te.event(e):e)}}}function nu(i,e,t,r,s,n,o,a,l,c){var d,p,y,v,x,P,F,R,D,q,I,z,L,j,K,Z,ne,Y=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),n=[a=e.__e=t.__e]),(d=Te.__b)&&d(e);e:if(typeof Y=="function")try{if(R=e.props,D="prototype"in Y&&Y.prototype.render,q=(d=Y.contextType)&&r[d.__c],I=d?q?q.props.value:d.__:r,t.__c?F=(p=e.__c=t.__c).__=p.__E:(D?e.__c=p=new Y(R,I):(e.__c=p=new dt(R,I),p.constructor=Y,p.render=v1),q&&q.sub(p),p.props=R,p.state||(p.state={}),p.context=I,p.__n=r,y=p.__d=!0,p.__h=[],p._sb=[]),D&&p.__s==null&&(p.__s=p.state),D&&Y.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Ei({},p.__s)),Ei(p.__s,Y.getDerivedStateFromProps(R,p.__s))),v=p.props,x=p.state,p.__v=e,y)D&&Y.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),D&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(D&&Y.getDerivedStateFromProps==null&&R!==v&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(R,I),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(R,p.__s,I)===!1||e.__v==t.__v)){for(e.__v!=t.__v&&(p.props=R,p.state=p.__s,p.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(re){re&&(re.__=e)}),z=0;z<p._sb.length;z++)p.__h.push(p._sb[z]);p._sb=[],p.__h.length&&o.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(R,p.__s,I),D&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(v,x,P)})}if(p.context=I,p.props=R,p.__P=i,p.__e=!1,L=Te.__r,j=0,D){for(p.state=p.__s,p.__d=!1,L&&L(e),d=p.render(p.props,p.state,p.context),K=0;K<p._sb.length;K++)p.__h.push(p._sb[K]);p._sb=[]}else do p.__d=!1,L&&L(e),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++j<25);p.state=p.__s,p.getChildContext!=null&&(r=Ei(Ei({},r),p.getChildContext())),D&&!y&&p.getSnapshotBeforeUpdate!=null&&(P=p.getSnapshotBeforeUpdate(v,x)),Z=d,d!=null&&d.type===Mt&&d.key==null&&(Z=nm(d.props.children)),a=im(i,Bn(Z)?Z:[Z],e,t,r,s,n,o,a,l,c),p.base=e.__e,e.__u&=-161,p.__h.length&&o.push(p),F&&(p.__E=p.__=null)}catch(re){if(e.__v=null,l||n!=null)if(re.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;n[n.indexOf(a)]=null,e.__e=a}else for(ne=n.length;ne--;)su(n[ne]);else e.__e=t.__e,e.__k=t.__k;Te.__e(re,e,t)}else n==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):a=e.__e=g1(t.__e,e,t,r,s,n,o,l,c);return(d=Te.diffed)&&d(e),128&e.__u?void 0:a}function sm(i,e,t){for(var r=0;r<t.length;r++)ou(t[r],t[++r],t[++r]);Te.__c&&Te.__c(e,i),i.some(function(s){try{i=s.__h,s.__h=[],i.some(function(n){n.call(s)})}catch(n){Te.__e(n,s.__v)}})}function nm(i){return typeof i!="object"||i==null?i:Bn(i)?i.map(nm):Ei({},i)}function g1(i,e,t,r,s,n,o,a,l){var c,d,p,y,v,x,P,F=t.props,R=e.props,D=e.type;if(D=="svg"?s="http://www.w3.org/2000/svg":D=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),n!=null){for(c=0;c<n.length;c++)if((v=n[c])&&"setAttribute"in v==!!D&&(D?v.localName==D:v.nodeType==3)){i=v,n[c]=null;break}}if(i==null){if(D==null)return document.createTextNode(R);i=document.createElementNS(s,D,R.is&&R),a&&(Te.__m&&Te.__m(e,n),a=!1),n=null}if(D===null)F===R||a&&i.data===R||(i.data=R);else{if(n=n&&Nn.call(i.childNodes),F=t.props||Dn,!a&&n!=null)for(F={},c=0;c<i.attributes.length;c++)F[(v=i.attributes[c]).name]=v.value;for(c in F)if(v=F[c],c!="children"){if(c=="dangerouslySetInnerHTML")p=v;else if(!(c in R)){if(c=="value"&&"defaultValue"in R||c=="checked"&&"defaultChecked"in R)continue;Oa(i,c,null,v,s)}}for(c in R)v=R[c],c=="children"?y=v:c=="dangerouslySetInnerHTML"?d=v:c=="value"?x=v:c=="checked"?P=v:a&&typeof v!="function"||F[c]===v||Oa(i,c,v,F[c],s);if(d)a||p&&(d.__html===p.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),e.__k=[];else if(p&&(i.innerHTML=""),im(e.type==="template"?i.content:i,Bn(y)?y:[y],e,t,r,D=="foreignObject"?"http://www.w3.org/1999/xhtml":s,n,o,n?n[0]:t.__k&&Os(t,0),a,l),n!=null)for(c=n.length;c--;)su(n[c]);a||(c="value",D=="progress"&&x==null?i.removeAttribute("value"):x!==void 0&&(x!==i[c]||D=="progress"&&!x||D=="option"&&x!==F[c])&&Oa(i,c,x,F[c],s),c="checked",P!==void 0&&P!==i[c]&&Oa(i,c,P,F[c],s))}return i}function ou(i,e,t){try{if(typeof i=="function"){var r=typeof i.__u=="function";r&&i.__u(),r&&e==null||(i.__u=i(e))}else i.current=e}catch(s){Te.__e(s,t)}}function om(i,e,t){var r,s;if(Te.unmount&&Te.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||ou(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(n){Te.__e(n,e)}r.base=r.__P=null}if(r=i.__k)for(s=0;s<r.length;s++)r[s]&&om(r[s],e,t||typeof i.type!="function");t||su(i.__e),i.__c=i.__=i.__e=void 0}function v1(i,e,t){return this.constructor(i,t)}function au(i,e,t){var r,s,n,o;e==document&&(e=document.documentElement),Te.__&&Te.__(i,e),s=(r=typeof t=="function")?null:t&&t.__k||e.__k,n=[],o=[],nu(e,i=(!r&&t||e).__k=u(Mt,null,[i]),s||Dn,Dn,e.namespaceURI,!r&&t?[t]:s?null:e.firstChild?Nn.call(e.childNodes):null,n,!r&&t?t:s?s.__e:e.firstChild,r,o),sm(n,i,o)}function La(i,e,t){var r,s,n,o,a=Ei({},i.props);for(n in i.type&&i.type.defaultProps&&(o=i.type.defaultProps),e)n=="key"?r=e[n]:n=="ref"?s=e[n]:a[n]=e[n]===void 0&&o!==void 0?o[n]:e[n];return arguments.length>2&&(a.children=arguments.length>3?Nn.call(arguments,2):t),In(i.type,a,r||i.key,s||i.ref,null)}Nn=Jf.slice,Te={__e:function(i,e,t,r){for(var s,n,o;e=e.__;)if((s=e.__c)&&!s.__)try{if((n=s.constructor)&&n.getDerivedStateFromError!=null&&(s.setState(n.getDerivedStateFromError(i)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(i,r||{}),o=s.__d),o)return s.__E=s}catch(a){i=a}throw i}},Xf=0,h1=function(i){return i!=null&&i.constructor==null},dt.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ei({},this.state),typeof i=="function"&&(i=i(Ei({},t),this.props)),i&&Ei(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),Wf(this))},dt.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Wf(this))},dt.prototype.render=Mt,qr=[],Yf=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Zf=function(i,e){return i.__v.__b-e.__v.__b},Ra.__r=0,Qf=/(PointerCapture)$|Capture$/i,ru=0,tu=Kf(!1),iu=Kf(!0),d1=0;function Un(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function b1(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):Un(i)?i:null}var am=b1;function y1(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}var Ma=y1;var pr=class{constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new Nr([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}};function lm(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var w1=0;function S1(i){return"__private_"+w1+++"_"+i}function T1(i){let e=null,t;return function(){for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=s,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e}}var zn=S1("updateUI"),lu=class i extends pr{constructor(){super(...arguments),Object.defineProperty(this,zn,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t instanceof i||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:i}}));else if(typeof e=="function"){let r=e;this.uppy.iteratePlugins(s=>{s instanceof r&&(t=s)})}return t}mount(e,t){let r=t.id,s=am(e);if(s){this.isTargetDOMEl=!0;let a=document.createElement("div");return a.classList.add("uppy-Root"),lm(this,zn)[zn]=T1(l=>{this.uppy.getPlugin(this.id)&&(au(this.render(l,a),a),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),au(this.render(this.uppy.getState(),a),a),this.el=a,s.appendChild(a),a.dir=this.opts.direction||Ma(a)||"ltr",this.onMount(),this.el}let n=this.getTargetPlugin(e);if(n)return this.uppy.log(`Installing ${r} to ${n.id}`),this.parent=n,this.el=n.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let o=`Invalid target option given to ${r}.`;throw typeof e=="function"?o+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":o+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)}render(e,t){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,r;(t=(r=lm(this,zn))[zn])==null||t.call(r,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},ui=lu;function Ia(i,e,t,r){return t===0||i===e?i:r===0?e:i+(e-i)*2**(-r/t)}var It={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var mu=Ce(wt(),1);function Hn(i){let e=[],t="indeterminate",r;for(let{progress:n}of Object.values(i)){let{preprocess:o,postprocess:a}=n;r==null&&(o||a)&&({mode:t,message:r}=o||a),o?.mode==="determinate"&&e.push(o.value),a?.mode==="determinate"&&e.push(a.value)}let s=e.reduce((n,o)=>n+o/e.length,0);return{mode:t,message:r,value:s}}var du=Ce(wt(),1),hu=Ce(Aa(),1);function cu(i){let e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,r=Math.floor(i%60);return{hours:e,minutes:t,seconds:r}}function uu(i){let e=cu(i),t=e.hours===0?"":`${e.hours}h`,r=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,s=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${r}${s}`}var E1="\xB7",cm=()=>` ${E1} `;function um(i){let{newFiles:e,isUploadStarted:t,recoveredState:r,i18n:s,uploadState:n,isSomeGhost:o,startUpload:a}=i,l=(0,du.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===It.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":o}),c=e&&t&&!r?s("uploadXNewFiles",{smart_count:e}):s("uploadXFiles",{smart_count:e});return u("button",{type:"button",className:l,"aria-label":s("uploadXFiles",{smart_count:e}),onClick:a,disabled:o,"data-uppy-super-focusable":!0},c)}function hm(i){let{i18n:e,uppy:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},u("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),e("retry"))}function dm(i){let{i18n:e,uppy:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))}function pm(i){let{isAllPaused:e,i18n:t,isAllComplete:r,resumableUploads:s,uppy:n}=i,o=t(e?"resume":"pause");function a(){if(!r){if(!s){n.cancelAll();return}if(e){n.resumeAll();return}n.pauseAll()}}return u("button",{title:o,"aria-label":o,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:a,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function fm(i){let{i18n:e,doneButtonHandler:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0},e("done"))}function mm(){return u("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},u("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function gm(i){let{progress:e}=i,{value:t,mode:r,message:s}=e;return u("div",{className:"uppy-StatusBar-content"},u(mm,null),r==="determinate"?`${Math.round(t*100)}% \xB7 `:"",s)}function x1(i){let{numUploads:e,complete:t,totalUploadedSize:r,totalSize:s,totalETA:n,i18n:o}=i,a=e>1,l=(0,hu.default)(r);return u("div",{className:"uppy-StatusBar-statusSecondary"},a&&o("filesUploadedOfTotal",{complete:t,smart_count:e}),u("span",{className:"uppy-StatusBar-additionalInfo"},a&&cm(),s!=null?o("dataUploadedOfTotal",{complete:l,total:(0,hu.default)(s)}):o("dataUploadedOfUnknown",{complete:l}),cm(),n!=null&&o("xTimeLeft",{time:uu(n)})))}function vm(i){let{i18n:e,complete:t,numUploads:r}=i;return u("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:r}))}function k1(i){let{i18n:e,newFiles:t,startUpload:r}=i,s=(0,du.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return u("div",{className:"uppy-StatusBar-statusSecondary"},u("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:t})),u("button",{type:"button",className:s,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:r},e("upload")))}function bm(i){let{i18n:e,supportsUploadProgress:t,totalProgress:r,showProgressDetails:s,isUploadStarted:n,isAllComplete:o,isAllPaused:a,newFiles:l,numUploads:c,complete:d,totalUploadedSize:p,totalSize:y,totalETA:v,startUpload:x}=i,P=l&&n;if(!n||o)return null;let F=e(a?"paused":"uploading");function R(){return!a&&!P&&s?t?u(x1,{numUploads:c,complete:d,totalUploadedSize:p,totalSize:y,totalETA:v,i18n:e}):u(vm,{i18n:e,complete:d,numUploads:c}):null}return u("div",{className:"uppy-StatusBar-content","aria-label":F,title:F},a?null:u(mm,null),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t&&r!==0?`${F}: ${r}%`:F),R(),P?u(k1,{i18n:e,newFiles:l,startUpload:x}):null))}function ym(i){let{i18n:e}=i;return u("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},u("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}function wm(i){let{error:e,i18n:t,complete:r,numUploads:s}=i;function n(){let o=`${t("uploadFailed")}
68
68
 
69
- ${e}`;alert(o)}return u("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),u("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:n,type:"button"},"?")),u(am,{i18n:t,complete:r,numUploads:s})))}var{STATE_ERROR:hm,STATE_WAITING:s1,STATE_PREPROCESSING:du,STATE_UPLOADING:Da,STATE_POSTPROCESSING:pu,STATE_COMPLETE:Na}=Mt;function mu(i){let{newFiles:e,allowNewUpload:t,isUploadInProgress:r,isAllPaused:s,resumableUploads:n,error:o,hideUploadButton:a=void 0,hidePauseResumeButton:l=!1,hideCancelButton:c=!1,hideRetryButton:d=!1,recoveredState:f,uploadState:y,totalProgress:v,files:x,supportsUploadProgress:P,hideAfterFinish:C=!1,isSomeGhost:I,doneButtonHandler:D=void 0,isUploadStarted:q,i18n:M,startUpload:H,uppy:R,isAllComplete:G,showProgressDetails:K=void 0,numUploads:Y,complete:ie,totalSize:Q,totalETA:oe,totalUploadedSize:le}=i;function ke(){switch(y){case pu:case du:{let He=$n(x);return He.mode==="determinate"?He.value*100:v}case hm:return null;case Da:return P?v:null;default:return v}}function We(){switch(y){case pu:case du:{let{mode:He}=$n(x);return He==="indeterminate"}case Da:return!P;default:return!1}}let T=ke(),k=T??100,A=!o&&e&&(!r&&!s||f)&&t&&!a,$=!c&&y!==s1&&y!==Na,j=n&&!l&&y===Da,z=o&&!G&&!d,J=D&&y===Na,ee=(0,fu.default)("uppy-StatusBar-progress",{"is-indeterminate":We()}),Ae=(0,fu.default)("uppy-StatusBar",`is-${y}`,{"has-ghosts":I}),ne=(()=>{switch(y){case du:case pu:return u(om,{progress:$n(x)});case Na:return u(cm,{i18n:M});case hm:return u(um,{error:o,i18n:M,numUploads:Y,complete:ie});case Da:return u(lm,{i18n:M,supportsUploadProgress:P,totalProgress:v,showProgressDetails:K,isUploadStarted:q,isAllComplete:G,isAllPaused:s,newFiles:e,numUploads:Y,complete:ie,totalUploadedSize:le,totalSize:Q,totalETA:oe,startUpload:H});default:return null}})();return u("div",{className:Ae,"aria-hidden":!(A||z||j||$||J)&&!ne||y===Na&&C},u("div",{className:ee,style:{width:`${k}%`},role:"progressbar","aria-label":`${k}%`,"aria-valuetext":`${k}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":T}),ne,u("div",{className:"uppy-StatusBar-actions"},A?u(em,{newFiles:e,isUploadStarted:q,recoveredState:f,i18n:M,isSomeGhost:I,startUpload:H,uploadState:y}):null,z?u(tm,{i18n:M,uppy:R}):null,j?u(rm,{isAllPaused:s,i18n:M,isAllComplete:G,resumableUploads:n,uppy:R}):null,$?u(im,{i18n:M,uppy:R}):null,J?u(sm,{i18n:M,doneButtonHandler:D}):null))}var dm={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",dataUploadedOfUnknown:"%{complete} of unknown",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Oe(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var n1=0;function Fs(i){return"__private_"+n1+++"_"+i}var o1={version:"4.0.6"},a1=2e3,l1=2e3;function c1(i,e,t,r){if(i)return Mt.STATE_ERROR;if(e)return Mt.STATE_COMPLETE;if(t)return Mt.STATE_WAITING;let s=Mt.STATE_WAITING,n=Object.keys(r);for(let o=0;o<n.length;o++){let{progress:a}=r[n[o]];if(a.uploadStarted&&!a.uploadComplete)return Mt.STATE_UPLOADING;a.preprocess&&(s=Mt.STATE_PREPROCESSING),a.postprocess&&s!==Mt.STATE_PREPROCESSING&&(s=Mt.STATE_POSTPROCESSING)}return s}var u1={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},Gt=Fs("lastUpdateTime"),ui=Fs("previousUploadedBytes"),Vi=Fs("previousSpeed"),It=Fs("previousETA"),gu=Fs("computeSmoothETA"),qn=Fs("onUploadStart"),$r=class extends ci{constructor(e,t){super(e,{...u1,...t}),Object.defineProperty(this,gu,{value:h1}),Object.defineProperty(this,Gt,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),Object.defineProperty(this,Vi,{writable:!0,value:void 0}),Object.defineProperty(this,It,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,qn,{writable:!0,value:()=>{let{recoveredState:r}=this.uppy.getState();if(Oe(this,Vi)[Vi]=null,Oe(this,It)[It]=null,r){Oe(this,ui)[ui]=Object.values(r.files).reduce((s,n)=>{let{progress:o}=n;return s+o.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Oe(this,Gt)[Gt]=performance.now(),Oe(this,ui)[ui]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=dm,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){let{capabilities:t,files:r,allowNewUpload:s,totalProgress:n,error:o,recoveredState:a}=e,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:f,isAllComplete:y,isAllPaused:v,isUploadInProgress:x,isSomeGhost:P}=this.uppy.getObjectOfFilesPerState(),C=a?Object.values(r):l,I=!!t.resumableUploads,D=t.uploadProgress!==!1,q=null,M=0;c.every(R=>R.progress.bytesTotal!=null&&R.progress.bytesTotal!==0)&&(q=0,c.forEach(R=>{q+=R.progress.bytesTotal||0,M+=R.progress.bytesUploaded||0})),c.forEach(R=>{M+=R.progress.bytesUploaded||0});let H=Oe(this,gu)[gu]({uploaded:M,total:q});return mu({error:o,uploadState:c1(o,y,a,e.files||{}),allowNewUpload:s,totalProgress:n,totalSize:q,totalUploadedSize:M,isAllComplete:!1,isAllPaused:v,isUploadStarted:f,isUploadInProgress:x,isSomeGhost:P,recoveredState:a,complete:d.length,newFiles:C.length,numUploads:c.length,totalETA:H,files:r,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:I,supportsUploadProgress:D,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish})}onMount(){let e=this.el;La(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Oe(this,qn)[qn]),Oe(this,Gt)[Gt]=performance.now(),Oe(this,ui)[ui]=this.uppy.getFiles().reduce((t,r)=>t+r.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Oe(this,qn)[qn])}};function h1(i){var e,t;if(i.total==null||i.total===0)return null;let r=i.total-i.uploaded;if(r<=0)return null;(t=(e=Oe(this,Gt))[Gt])!=null||(e[Gt]=performance.now());let s=performance.now()-Oe(this,Gt)[Gt];if(s===0){var n;return Math.round(((n=Oe(this,It)[It])!=null?n:0)/100)/10}let o=i.uploaded-Oe(this,ui)[ui];if(Oe(this,ui)[ui]=i.uploaded,o<=0){var a;return Math.round(((a=Oe(this,It)[It])!=null?a:0)/100)/10}let l=o/s,c=Oe(this,Vi)[Vi]==null?l:Ma(l,Oe(this,Vi)[Vi],a1,s);Oe(this,Vi)[Vi]=c;let d=r/c,f=Math.max(Oe(this,It)[It]-s,0),y=Oe(this,It)[It]==null?d:Ma(d,f,l1,s);return Oe(this,It)[It]=y,Oe(this,Gt)[Gt]=performance.now(),Math.round(y/100)/10}$r.VERSION=o1.version;var pm=300,Vn=class extends ht{constructor(){super(...arguments),this.ref=jf()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,pm)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,pm)}render(){let{children:e}=this.props;return u("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function d1(i,e){return Object.assign(i,e)}function p1(i,e){var t;return(t=i?.key)!=null?t:e}function f1(i,e){let t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=r=>{i.refs[e]=r})}function jn(i){let e={};for(let t=0;t<i.length;t++)if(i[t]!=null){let r=p1(i[t],t.toString(36));e[r]=i[t]}return e}function m1(i,e){i=i||{},e=e||{};let t=o=>e.hasOwnProperty(o)?e[o]:i[o],r={},s=[];for(let o in i)e.hasOwnProperty(o)?s.length&&(r[o]=s,s=[]):s.push(o);let n={};for(let o in e){if(r.hasOwnProperty(o))for(let a=0;a<r[o].length;a++){let l=r[o][a];n[r[o][a]]=t(l)}n[o]=t(o)}for(let o=0;o<s.length;o++)n[s[o]]=t(s[o]);return n}var g1=i=>i,Ba=class extends ht{constructor(e,t){super(e,t),this.refs={},this.state={children:jn(Si(Si(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let e=this.state.children;for(let t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){let t=jn(Si(e.children)||[]),r=this.state.children;this.setState(n=>({children:m1(n.children,t)}));let s;for(s in t)if(t.hasOwnProperty(s)){let n=r&&r.hasOwnProperty(s);t[s]&&n&&this.currentlyTransitioningKeys[s]?(this.keysToEnter.push(s),this.keysToAbortLeave.push(s)):t[s]&&!n&&!this.currentlyTransitioningKeys[s]&&this.keysToEnter.push(s)}for(s in r)if(r.hasOwnProperty(s)){let n=t&&t.hasOwnProperty(s);r[s]&&!n&&!this.currentlyTransitioningKeys[s]&&this.keysToLeave.push(s)}}componentDidUpdate(){let{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);let{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){let t=this.keysToAbortLeave.indexOf(e);t!==-1&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t!=null&&t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){let t=this.refs[e];t!=null&&t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=jn(Si(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t!=null&&t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){let t=this.refs[e];t!=null&&t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=jn(Si(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;let r=this.refs[e];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;let r=this.refs[e];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let s=jn(Si(this.props.children)||[]);if(s&&s.hasOwnProperty(e))this.performEnter(e);else{let n=d1({},this.state.children);delete n[e],this.setState({children:n})}}render(e,t){let{childFactory:r,transitionLeave:s,transitionName:n,transitionAppear:o,transitionEnter:a,transitionLeaveTimeout:l,transitionEnterTimeout:c,transitionAppearTimeout:d,component:f,...y}=e,{children:v}=t,x=Object.entries(v).map(P=>{let[C,I]=P;if(!I)return;let D=f1(this,C);return Ra(r(I),{ref:D,key:C})}).filter(Boolean);return u(f,y,x)}};Ba.defaultProps={component:"span",childFactory:g1};var fm=Ba;var v1={version:"4.1.2"},qr=class extends ci{constructor(e,t){super(e,t),this.render=r=>u("div",{className:"uppy uppy-Informer"},u(fm,null,r.info.map(s=>u(Vn,{key:s.message},u("p",{role:"alert"},s.message," ",s.details&&u("span",{"aria-label":s.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${s.message}
69
+ ${e}`;alert(o)}return u("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),u("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:n,type:"button"},"?")),u(vm,{i18n:t,complete:r,numUploads:s})))}var{STATE_ERROR:Sm,STATE_WAITING:A1,STATE_PREPROCESSING:pu,STATE_UPLOADING:Na,STATE_POSTPROCESSING:fu,STATE_COMPLETE:Ba}=It;function gu(i){let{newFiles:e,allowNewUpload:t,isUploadInProgress:r,isAllPaused:s,resumableUploads:n,error:o,hideUploadButton:a=void 0,hidePauseResumeButton:l=!1,hideCancelButton:c=!1,hideRetryButton:d=!1,recoveredState:p,uploadState:y,totalProgress:v,files:x,supportsUploadProgress:P,hideAfterFinish:F=!1,isSomeGhost:R,doneButtonHandler:D=void 0,isUploadStarted:q,i18n:I,startUpload:z,uppy:L,isAllComplete:j,showProgressDetails:K=void 0,numUploads:Z,complete:ne,totalSize:Y,totalETA:re,totalUploadedSize:le}=i;function ke(){switch(y){case fu:case pu:{let He=Hn(x);return He.mode==="determinate"?He.value*100:v}case Sm:return null;case Na:return P?v:null;default:return v}}function We(){switch(y){case fu:case pu:{let{mode:He}=Hn(x);return He==="indeterminate"}case Na:return!P;default:return!1}}let E=ke(),k=E??100,A=!o&&e&&(!r&&!s||p)&&t&&!a,$=!c&&y!==A1&&y!==Ba,W=n&&!l&&y===Na,H=o&&!j&&!d,J=D&&y===Ba,ee=(0,mu.default)("uppy-StatusBar-progress",{"is-indeterminate":We()}),Ae=(0,mu.default)("uppy-StatusBar",`is-${y}`,{"has-ghosts":R}),oe=(()=>{switch(y){case pu:case fu:return u(gm,{progress:Hn(x)});case Ba:return u(ym,{i18n:I});case Sm:return u(wm,{error:o,i18n:I,numUploads:Z,complete:ne});case Na:return u(bm,{i18n:I,supportsUploadProgress:P,totalProgress:v,showProgressDetails:K,isUploadStarted:q,isAllComplete:j,isAllPaused:s,newFiles:e,numUploads:Z,complete:ne,totalUploadedSize:le,totalSize:Y,totalETA:re,startUpload:z});default:return null}})();return!(A||H||W||$||J)&&!oe||y===Ba&&F?null:u("div",{className:Ae},u("div",{className:ee,style:{width:`${k}%`},role:"progressbar","aria-label":`${k}%`,"aria-valuetext":`${k}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":E}),oe,u("div",{className:"uppy-StatusBar-actions"},A?u(um,{newFiles:e,isUploadStarted:q,recoveredState:p,i18n:I,isSomeGhost:R,startUpload:z,uploadState:y}):null,H?u(hm,{i18n:I,uppy:L}):null,W?u(pm,{isAllPaused:s,i18n:I,isAllComplete:j,resumableUploads:n,uppy:L}):null,$?u(dm,{i18n:I,uppy:L}):null,J?u(fm,{i18n:I,doneButtonHandler:D}):null))}var Tm={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",dataUploadedOfUnknown:"%{complete} of unknown",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Oe(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var P1=0;function Rs(i){return"__private_"+P1+++"_"+i}var C1={version:"4.1.2"},F1=2e3,_1=2e3;function O1(i,e,t,r){if(i)return It.STATE_ERROR;if(e)return It.STATE_COMPLETE;if(t)return It.STATE_WAITING;let s=It.STATE_WAITING,n=Object.keys(r);for(let o=0;o<n.length;o++){let{progress:a}=r[n[o]];if(a.uploadStarted&&!a.uploadComplete)return It.STATE_UPLOADING;a.preprocess&&(s=It.STATE_PREPROCESSING),a.postprocess&&s!==It.STATE_PREPROCESSING&&(s=It.STATE_POSTPROCESSING)}return s}var R1={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},Kt=Rs("lastUpdateTime"),hi=Rs("previousUploadedBytes"),ji=Rs("previousSpeed"),Dt=Rs("previousETA"),vu=Rs("computeSmoothETA"),$n=Rs("onUploadStart"),Vr=class extends ui{constructor(e,t){super(e,{...R1,...t}),Object.defineProperty(this,vu,{value:L1}),Object.defineProperty(this,Kt,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),Object.defineProperty(this,Dt,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,$n,{writable:!0,value:()=>{let{recoveredState:r}=this.uppy.getState();if(Oe(this,ji)[ji]=null,Oe(this,Dt)[Dt]=null,r){Oe(this,hi)[hi]=Object.values(r.files).reduce((s,n)=>{let{progress:o}=n;return s+o.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Oe(this,Kt)[Kt]=performance.now(),Oe(this,hi)[hi]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Tm,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){let{capabilities:t,files:r,allowNewUpload:s,totalProgress:n,error:o,recoveredState:a}=e,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:p,isAllComplete:y,isAllPaused:v,isUploadInProgress:x,isSomeGhost:P}=this.uppy.getObjectOfFilesPerState(),F=a?Object.values(r):l,R=!!t.resumableUploads,D=t.uploadProgress!==!1,q=null,I=0;c.every(L=>L.progress.bytesTotal!=null&&L.progress.bytesTotal!==0)?(q=0,c.forEach(L=>{q+=L.progress.bytesTotal||0,I+=L.progress.bytesUploaded||0})):c.forEach(L=>{I+=L.progress.bytesUploaded||0});let z=Oe(this,vu)[vu]({uploaded:I,total:q});return gu({error:o,uploadState:O1(o,y,a,e.files||{}),allowNewUpload:s,totalProgress:n,totalSize:q,totalUploadedSize:I,isAllComplete:!1,isAllPaused:v,isUploadStarted:p,isUploadInProgress:x,isSomeGhost:P,recoveredState:a,complete:d.length,newFiles:F.length,numUploads:c.length,totalETA:z,files:r,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:R,supportsUploadProgress:D,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish})}onMount(){let e=this.el;Ma(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Oe(this,$n)[$n]),Oe(this,Kt)[Kt]=performance.now(),Oe(this,hi)[hi]=this.uppy.getFiles().reduce((t,r)=>t+r.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Oe(this,$n)[$n])}};function L1(i){var e,t;if(i.total==null||i.total===0)return null;let r=i.total-i.uploaded;if(r<=0)return null;(t=(e=Oe(this,Kt))[Kt])!=null||(e[Kt]=performance.now());let s=performance.now()-Oe(this,Kt)[Kt];if(s===0){var n;return Math.round(((n=Oe(this,Dt)[Dt])!=null?n:0)/100)/10}let o=i.uploaded-Oe(this,hi)[hi];if(Oe(this,hi)[hi]=i.uploaded,o<=0){var a;return Math.round(((a=Oe(this,Dt)[Dt])!=null?a:0)/100)/10}let l=o/s,c=Oe(this,ji)[ji]==null?l:Ia(l,Oe(this,ji)[ji],F1,s);Oe(this,ji)[ji]=c;let d=r/c,p=Math.max(Oe(this,Dt)[Dt]-s,0),y=Oe(this,Dt)[Dt]==null?d:Ia(d,p,_1,s);return Oe(this,Dt)[Dt]=y,Oe(this,Kt)[Kt]=performance.now(),Math.round(y/100)/10}Vr.VERSION=C1.version;var Em=300,qn=class extends dt{constructor(){super(...arguments),this.ref=em()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,Em)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,Em)}render(){let{children:e}=this.props;return u("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function M1(i,e){return Object.assign(i,e)}function I1(i,e){var t;return(t=i?.key)!=null?t:e}function D1(i,e){let t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=r=>{i.refs[e]=r})}function Vn(i){let e={};for(let t=0;t<i.length;t++)if(i[t]!=null){let r=I1(i[t],t.toString(36));e[r]=i[t]}return e}function N1(i,e){i=i||{},e=e||{};let t=o=>e.hasOwnProperty(o)?e[o]:i[o],r={},s=[];for(let o in i)e.hasOwnProperty(o)?s.length&&(r[o]=s,s=[]):s.push(o);let n={};for(let o in e){if(r.hasOwnProperty(o))for(let a=0;a<r[o].length;a++){let l=r[o][a];n[r[o][a]]=t(l)}n[o]=t(o)}for(let o=0;o<s.length;o++)n[s[o]]=t(s[o]);return n}var B1=i=>i,Ua=class extends dt{constructor(e,t){super(e,t),this.refs={},this.state={children:Vn(xi(xi(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let e=this.state.children;for(let t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){let t=Vn(xi(e.children)||[]),r=this.state.children;this.setState(n=>({children:N1(n.children,t)}));let s;for(s in t)if(t.hasOwnProperty(s)){let n=r&&r.hasOwnProperty(s);t[s]&&n&&this.currentlyTransitioningKeys[s]?(this.keysToEnter.push(s),this.keysToAbortLeave.push(s)):t[s]&&!n&&!this.currentlyTransitioningKeys[s]&&this.keysToEnter.push(s)}for(s in r)if(r.hasOwnProperty(s)){let n=t&&t.hasOwnProperty(s);r[s]&&!n&&!this.currentlyTransitioningKeys[s]&&this.keysToLeave.push(s)}}componentDidUpdate(){let{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);let{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){let t=this.keysToAbortLeave.indexOf(e);t!==-1&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t!=null&&t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){let t=this.refs[e];t!=null&&t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=Vn(xi(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t!=null&&t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){let t=this.refs[e];t!=null&&t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=Vn(xi(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;let r=this.refs[e];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;let r=this.refs[e];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let s=Vn(xi(this.props.children)||[]);if(s&&s.hasOwnProperty(e))this.performEnter(e);else{let n=M1({},this.state.children);delete n[e],this.setState({children:n})}}render(e,t){let{childFactory:r,transitionLeave:s,transitionName:n,transitionAppear:o,transitionEnter:a,transitionLeaveTimeout:l,transitionEnterTimeout:c,transitionAppearTimeout:d,component:p,...y}=e,{children:v}=t,x=Object.entries(v).map(P=>{let[F,R]=P;if(!R)return;let D=D1(this,F);return La(r(R),{ref:D,key:F})}).filter(Boolean);return u(p,y,x)}};Ua.defaultProps={component:"span",childFactory:B1};var xm=Ua;var U1={version:"4.2.1"},jr=class extends ui{constructor(e,t){super(e,t),this.render=r=>u("div",{className:"uppy uppy-Informer"},u(xm,null,r.info.map(s=>u(qn,{key:s.message},u("p",{role:"alert"},s.message," ",s.details&&u("span",{"aria-label":s.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${s.message}
70
70
 
71
- ${s.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:e}=this.opts;e&&this.mount(e,this)}};qr.VERSION=v1.version;var b1=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function y1(i,e,t){var r,s;let n=b1.exec(i),o=(r=(s=e.mimeType)!=null?s:n?.[1])!=null?r:"plain/text",a;if(n?.[2]!=null){let l=atob(decodeURIComponent(n[3])),c=new Uint8Array(l.length);for(let d=0;d<l.length;d++)c[d]=l.charCodeAt(d);a=[c]}else n?.[3]!=null&&(a=[decodeURIComponent(n[3])]);return t?new File(a,e.name||"",{type:o}):new Blob(a,{type:o})}var mm=y1;function Ua(i){return i.startsWith("blob:")}function za(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function ge(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var xm=typeof self<"u"?self:global,Xn=typeof navigator<"u",w1=Xn&&typeof HTMLImageElement>"u",gm=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),km=xm.Buffer,Am=!!km,S1=i=>i!==void 0;function Pm(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(S1).length===0)}function it(i){let e=new Error(i);throw delete e.stack,e}function vm(i){let e=function(t){let r=0;return t.ifd0.enabled&&(r+=1024),t.exif.enabled&&(r+=2048),t.makerNote&&(r+=2048),t.userComment&&(r+=1024),t.gps.enabled&&(r+=512),t.interop.enabled&&(r+=100),t.ifd1.enabled&&(r+=1024),r+2048}(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}var vu=i=>String.fromCharCode.apply(null,i),bm=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,jr=class i{static from(e,t){return e instanceof this&&e.le===t?e:new i(e,void 0,void 0,t)}constructor(e,t=0,r,s){if(typeof s=="boolean"&&(this.le=s),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){r===void 0&&(r=e.byteLength-t);let n=new DataView(e,t,r);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof i){r===void 0&&(r=e.byteLength-t),(t+=e.byteOffset)+r>e.byteOffset+e.byteLength&&it("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,r);this._swapDataView(n)}else if(typeof e=="number"){let n=new DataView(new ArrayBuffer(e));this._swapDataView(n)}else it("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,r=i){return e instanceof DataView||e instanceof i?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||it("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new r(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new i(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return s=this.getUint8Array(e,t),bm?bm.decode(s):Am?Buffer.from(s).toString("utf8"):decodeURIComponent(escape(vu(s)));var s}getLatin1String(e=0,t=this.byteLength){let r=this.getUint8Array(e,t);return vu(r)}getUnicodeString(e=0,t=this.byteLength){let r=[];for(let s=0;s<t&&e+s<this.byteLength;s+=2)r.push(this.getUint16(e+s));return vu(r)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,r){switch(t){case 1:return this.getUint8(e,r);case 2:return this.getUint16(e,r);case 4:return this.getUint32(e,r);case 8:return this.getUint64&&this.getUint64(e,r)}}getUint(e,t,r){switch(t){case 8:return this.getUint8(e,r);case 16:return this.getUint16(e,r);case 32:return this.getUint32(e,r);case 64:return this.getUint64&&this.getUint64(e,r)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function yu(i,e){it(`${i} '${e}' was not loaded, try using full build of exifr.`)}var Yn=class extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||yu(this.kind,e),t&&(e in t||function(r,s){it(`Unknown ${r} '${s}'.`)}(this.kind,e),t[e].enabled||yu(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},ja=new Yn("file parser"),Dt=new Yn("segment parser"),Jn=new Yn("file reader"),E1=xm.fetch;function ym(i,e){return(t=i).startsWith("data:")||t.length>1e4?Su(i,e,"base64"):gm&&i.includes("://")?wu(i,e,"url",Ha):gm?Su(i,e,"fs"):Xn?wu(i,e,"url",Ha):void it("Invalid input argument");var t}async function wu(i,e,t,r){return Jn.has(t)?Su(i,e,t):r?async function(s,n){let o=await n(s);return new jr(o)}(i,r):void it(`Parser ${t} is not loaded`)}async function Su(i,e,t){let r=new(Jn.get(t))(i,e);return await r.read(),r}var Ha=i=>E1(i).then(e=>e.arrayBuffer()),Zn=i=>new Promise((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result||new ArrayBuffer),r.onerror=t,r.readAsArrayBuffer(i)}),Eu=class extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}};function Cm(i,e,t){let r=new Eu;for(let[s,n]of t)r.set(s,n);if(Array.isArray(e))for(let s of e)i.set(s,r);else i.set(e,r);return r}function Fm(i,e,t){let r,s=i.get(e);for(r of t)s.set(r[0],r[1])}var eo=new Map,Pu=new Map,Cu=new Map,_s=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Wa=["jfif","xmp","icc","iptc","ihdr"],Qn=["tiff",...Wa],Ve=["ifd0","ifd1","exif","gps","interop"],Os=[...Qn,...Ve],Rs=["makerNote","userComment"],Ga=["translateKeys","translateValues","reviveValues","multiSegment"],Ls=[...Ga,"sanitize","mergeOutput","silentErrors"],$a=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},Vr=class extends $a{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,r,s){if(super(),ge(this,"enabled",!1),ge(this,"skip",new Set),ge(this,"pick",new Set),ge(this,"deps",new Set),ge(this,"translateKeys",!1),ge(this,"translateValues",!1),ge(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(s),this.canBeFiltered=Ve.includes(e),this.canBeFiltered&&(this.dict=eo.get(e)),r!==void 0)if(Array.isArray(r))this.parse=this.enabled=!0,this.canBeFiltered&&r.length>0&&this.translateTagSet(r,this.pick);else if(typeof r=="object"){if(this.enabled=!0,this.parse=r.parse!==!1,this.canBeFiltered){let{pick:n,skip:o}=r;n&&n.length>0&&this.translateTagSet(n,this.pick),o&&o.length>0&&this.translateTagSet(o,this.skip)}this.applyInheritables(r)}else r===!0||r===!1?this.parse=this.enabled=r:it(`Invalid options argument: ${r}`)}applyInheritables(e){let t,r;for(t of Ga)r=e[t],r!==void 0&&(this[t]=r)}translateTagSet(e,t){if(this.dict){let r,s,{tagKeys:n,tagValues:o}=this.dict;for(r of e)typeof r=="string"?(s=o.indexOf(r),s===-1&&(s=n.indexOf(Number(r))),s!==-1&&t.add(Number(n[s]))):t.add(r)}else for(let r of e)t.add(r)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,qa(this.pick,this.deps)):this.enabled&&this.pick.size>0&&qa(this.pick,this.deps)}},yt={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},wm=new Map,Wr=class extends $a{static useCached(e){let t=wm.get(e);return t!==void 0||(t=new this(e),wm.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):it(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Xn?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of _s)this[e]=yt[e];for(e of Ls)this[e]=yt[e];for(e of Rs)this[e]=yt[e];for(e of Os)this[e]=new Vr(e,yt[e],void 0,this)}setupFromTrue(){let e;for(e of _s)this[e]=yt[e];for(e of Ls)this[e]=yt[e];for(e of Rs)this[e]=!0;for(e of Os)this[e]=new Vr(e,!0,void 0,this)}setupFromArray(e){let t;for(t of _s)this[t]=yt[t];for(t of Ls)this[t]=yt[t];for(t of Rs)this[t]=yt[t];for(t of Os)this[t]=new Vr(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ve)}setupFromObject(e){let t;for(t of(Ve.ifd0=Ve.ifd0||Ve.image,Ve.ifd1=Ve.ifd1||Ve.thumbnail,Object.assign(this,e),_s))this[t]=bu(e[t],yt[t]);for(t of Ls)this[t]=bu(e[t],yt[t]);for(t of Rs)this[t]=bu(e[t],yt[t]);for(t of Qn)this[t]=new Vr(t,yt[t],e[t],this);for(t of Ve)this[t]=new Vr(t,yt[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ve,Os),e.tiff===!0?this.batchEnableWithBool(Ve,!0):e.tiff===!1?this.batchEnableWithUserValue(Ve,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ve):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ve)}batchEnableWithBool(e,t){for(let r of e)this[r].enabled=t}batchEnableWithUserValue(e,t){for(let r of e){let s=t[r];this[r].enabled=s!==!1&&s!==void 0}}setupGlobalFilters(e,t,r,s=r){if(e&&e.length){for(let o of s)this[o].enabled=!1;let n=Sm(e,r);for(let[o,a]of n)qa(this[o].pick,a),this[o].enabled=!0}else if(t&&t.length){let n=Sm(t,r);for(let[o,a]of n)qa(this[o].skip,a)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:r,iptc:s,icc:n}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),r.enabled||e.skip.add(700),s.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:r,interop:s}=this;s.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),r.needed&&e.deps.add(34853),this.tiff.enabled=Ve.some(n=>this[n].enabled===!0)||this.makerNote||this.userComment;for(let n of Ve)this[n].finalizeFilters()}get onlyTiff(){return!Wa.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of Qn)this[e].enabled&&!Dt.has(e)&&yu("segment parser",e)}};function Sm(i,e){let t,r,s,n,o=[];for(s of e){for(n of(t=eo.get(s),r=[],t))(i.includes(n[0])||i.includes(n[1]))&&r.push(n[0]);r.length&&o.push([s,r])}return o}function bu(i,e){return i!==void 0?i:e!==void 0?e:void 0}function qa(i,e){for(let t of e)i.add(t)}ge(Wr,"default",yt);var Ms=class{constructor(e){ge(this,"parsers",{}),ge(this,"output",{}),ge(this,"errors",[]),ge(this,"pushToErrors",t=>this.errors.push(t)),this.options=Wr.useCached(e)}async read(e){this.file=await function(t,r){return typeof t=="string"?ym(t,r):Xn&&!w1&&t instanceof HTMLImageElement?ym(t.src,r):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new jr(t):Xn&&t instanceof Blob?wu(t,r,"blob",Zn):void it("Invalid input argument")}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[r,s]of ja)if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[r]=!0;this.file.close&&this.file.close(),it("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),Pm(r=e)?void 0:r;var r}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async r=>{let s=await r.parse();r.assignToOutput(e,s)});this.options.silentErrors&&(t=t.map(r=>r.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,r=Dt.get("tiff",e);var s;if(t.tiff?s={start:0,type:"tiff"}:t.jpeg&&(s=await this.fileParser.getOrFindSegment("tiff")),s===void 0)return;let n=await this.fileParser.ensureSegmentChunk(s),o=this.parsers.tiff=new r(n,e,t),a=await o.extractThumbnail();return t.close&&t.close(),a}};async function _m(i,e){let t=new Ms(e);return await t.read(i),t.parse()}var T1=Object.freeze({__proto__:null,parse:_m,Exifr:Ms,fileParsers:ja,segmentParsers:Dt,fileReaders:Jn,tagKeys:eo,tagValues:Pu,tagRevivers:Cu,createDictionary:Cm,extendDictionary:Fm,fetchUrlAsArrayBuffer:Ha,readBlobAsArrayBuffer:Zn,chunkedProps:_s,otherSegments:Wa,segments:Qn,tiffBlocks:Ve,segmentsAndBlocks:Os,tiffExtractables:Rs,inheritables:Ga,allFormatters:Ls,Options:Wr}),hr=class{static findPosition(e,t){let r=e.getUint16(t+2)+2,s=typeof this.headerLength=="function"?this.headerLength(e,t,r):this.headerLength,n=t+s,o=r-s;return{offset:t,length:r,headerLength:s,start:n,size:o,end:n+o}}static parse(e,t={}){return new this(e,new Wr({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof jr?e:new jr(e)}constructor(e,t={},r){ge(this,"errors",[]),ge(this,"raw",new Map),ge(this,"handleError",s=>{if(!this.options.silentErrors)throw s;this.errors.push(s.message)}),this.chunk=this.normalizeInput(e),this.file=r,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let r=Cu.get(t),s=Pu.get(t),n=eo.get(t),o=this.options[t],a=o.reviveValues&&!!r,l=o.translateValues&&!!s,c=o.translateKeys&&!!n,d={};for(let[f,y]of e)a&&r.has(f)?y=r.get(f)(y):l&&s.has(f)&&(y=this.translateValue(y,s.get(f))),c&&n.has(f)&&(f=n.get(f)||f),d[f]=y;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,r){if(this.globalOptions.mergeOutput)return Object.assign(e,r);e[t]?Object.assign(e[t],r):e[t]=r}};ge(hr,"headerLength",4),ge(hr,"type",void 0),ge(hr,"multiSegment",!1),ge(hr,"canHandle",()=>!1);function x1(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function k1(i){return i>=224&&i<=239}function A1(i,e,t){for(let[r,s]of Dt)if(s.canHandle(i,e,t))return r}var Va=class extends class{constructor(e,t,r){ge(this,"errors",[]),ge(this,"ensureSegmentChunk",async s=>{let n=s.start,o=s.size||65536;if(this.file.chunked)if(this.file.available(n,o))s.chunk=this.file.subarray(n,o);else try{s.chunk=await this.file.readChunk(n,o)}catch(a){it(`Couldn't read segment: ${JSON.stringify(s)}. ${a.message}`)}else this.file.byteLength>n+o?s.chunk=this.file.subarray(n,o):s.size===void 0?s.chunk=this.file.subarray(n):it("Segment unreachable: "+JSON.stringify(s));return s.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=r}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let r=new(Dt.get(e))(t,this.options,this.file);return this.parsers[e]=r}createParsers(e){for(let t of e){let{type:r,chunk:s}=t,n=this.options[r];if(n&&n.enabled){let o=this.parsers[r];o&&o.append||o||this.createParser(r,s)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),ge(this,"appSegments",[]),ge(this,"jpegSegments",[]),ge(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Dt.keyList())):(e=e===void 0?Dt.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&Dt.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:r,findAll:s,wanted:n,remaining:o}=this;if(!s&&this.file.chunked&&(s=Array.from(n).some(a=>{let l=Dt.get(a),c=this.options[a];return l.multiSegment&&c.multiSegment}),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,r.byteLength),!this.options.onlyTiff&&r.chunked){let a=!1;for(;o.size>0&&!a&&(r.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=r,c=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(a=e>l&&!c?!await r.readNextChunk(e):!await r.readNextChunk(l),(e=this.findAppSegmentsInRange(e,r.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let r,s,n,o,a,l,{file:c,findAll:d,wanted:f,remaining:y,options:v}=this;for(;e<t;e++)if(c.getUint8(e)===255){if(r=c.getUint8(e+1),k1(r)){if(s=c.getUint16(e+2),n=A1(c,e,s),n&&f.has(n)&&(o=Dt.get(n),a=o.findPosition(c,e),l=v[n],a.type=n,this.appSegments.push(a),!d&&(o.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||y.delete(n)):y.delete(n),y.size===0)))break;v.recordUnknownSegments&&(a=hr.findPosition(c,e),a.marker=r,this.unknownSegments.push(a)),e+=s+1}else if(x1(r)){if(s=c.getUint16(e+2),r===218&&v.stopAfterSos!==!1)return;v.recordJpegSegments&&this.jpegSegments.push({offset:e,length:s,marker:r}),e+=s+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,r){let s,n,o,a=new Map;for(let l=0;l<t.length;l++)s=t[l],n=s[r],a.has(n)?o=a.get(n):a.set(n,o=[]),o.push(s);return Array.from(a)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,r])=>{let s=Dt.get(t,this.options);return s.handleMultiSegments?{type:t,chunk:s.handleMultiSegments(r)}:r[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return t===void 0&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}};ge(Va,"type","jpeg"),ja.set("jpeg",Va);var P1=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Tu=class extends hr{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,r=new Map){let{pick:s,skip:n}=this.options[t];s=new Set(s);let o=s.size>0,a=n.size===0,l=this.chunk.getUint16(e);e+=2;for(let c=0;c<l;c++){let d=this.chunk.getUint16(e);if(o){if(s.has(d)&&(r.set(d,this.parseTag(e,d,t)),s.delete(d),s.size===0))break}else!a&&n.has(d)||r.set(d,this.parseTag(e,d,t));e+=12}return r}parseTag(e,t,r){let{chunk:s}=this,n=s.getUint16(e+2),o=s.getUint32(e+4),a=P1[n];if(a*o<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&it(`Invalid TIFF value type. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&it(`Invalid TIFF value offset. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),n===1)return s.getUint8Array(e,o);if(n===2)return(l=function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c}(l=s.getString(e,o)).trim())===""?void 0:l;var l;if(n===7)return s.getUint8Array(e,o);if(o===1)return this.parseTagValue(n,e);{let c=new(function(f){switch(f){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}(n))(o),d=a;for(let f=0;f<o;f++)c[f]=this.parseTagValue(n,e),e+=d;return c}}parseTagValue(e,t){let{chunk:r}=this;switch(e){case 1:return r.getUint8(t);case 3:return r.getUint16(t);case 4:return r.getUint32(t);case 5:return r.getUint32(t)/r.getUint32(t+4);case 6:return r.getInt8(t);case 8:return r.getInt16(t);case 9:return r.getInt32(t);case 10:return r.getInt32(t)/r.getInt32(t+4);case 11:return r.getFloat(t);case 12:return r.getDouble(t);case 13:return r.getUint32(t);default:it(`Invalid tiff type ${e}`)}}},Kn=class extends Tu{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let r=new Map;return this[t]=r,this.parseTags(e,t,r),r}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&it("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&it(`IFD0 offset points to outside of file.
72
- this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,vm(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,vm(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let r=e.get(t);r&&r.length===1&&e.set(t,r[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Em(...e.get(2),e.get(1))),e.set("longitude",Em(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,r,s={};for(t of Ve)if(e=this[t],!Pm(e))if(r=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(s,r)}else s[t]=r;return this.makerNote&&(s.makerNote=this.makerNote),this.userComment&&(s.userComment=this.userComment),s}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[r,s]of Object.entries(t))this.assignObjectToOutput(e,r,s)}};function Em(i,e,t,r){var s=i+e/60+t/3600;return r!=="S"&&r!=="W"||(s*=-1),s}ge(Kn,"type","tiff"),ge(Kn,"headerLength",10),Dt.set("tiff",Kn);var rF=Object.freeze({__proto__:null,default:T1,Exifr:Ms,fileParsers:ja,segmentParsers:Dt,fileReaders:Jn,tagKeys:eo,tagValues:Pu,tagRevivers:Cu,createDictionary:Cm,extendDictionary:Fm,fetchUrlAsArrayBuffer:Ha,readBlobAsArrayBuffer:Zn,chunkedProps:_s,otherSegments:Wa,segments:Qn,tiffBlocks:Ve,segmentsAndBlocks:Os,tiffExtractables:Rs,inheritables:Ga,allFormatters:Ls,Options:Wr,parse:_m}),Fu={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},sF=Object.assign({},Fu,{firstChunkSize:4e4,gps:[1,2,3,4]});var nF=Object.assign({},Fu,{tiff:!1,ifd1:!0,mergeOutput:!1});var C1=Object.assign({},Fu,{firstChunkSize:4e4,ifd0:[274]});async function F1(i){let e=new Ms(C1);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}var _1=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}}),Wn=!0,Gn=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,r]=e;Wn=Number(t)+.1*Number(r)<13.4,Gn=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Wn=Gn=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Wn=Gn=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Wn=Gn=Number(e)<77}}async function Om(i){let e=await F1(i);return Object.assign({canvas:Wn,css:Gn},_1[e])}var xu=class extends jr{constructor(...e){super(...e),ge(this,"ranges",new ku),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,r){if(e===0&&this.byteLength===0&&r){let s=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(s)}else{let s=e+t;if(s>this.byteLength){let{dataView:n}=this._extend(s);this._swapDataView(n)}}}_extend(e){let t;t=Am?km.allocUnsafe(e):new Uint8Array(e);let r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}subarray(e,t,r=!1){return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,r=!1){r&&this._tryExtend(t,e.byteLength,e);let s=super.set(e,t);return this.ranges.add(t,s.byteLength),s}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}},ku=class{constructor(){ge(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let s=e+t,n=this.list.filter(o=>Tm(e,o.offset,s)||Tm(e,o.end,s));if(n.length>0){e=Math.min(e,...n.map(a=>a.offset)),s=Math.max(s,...n.map(a=>a.end)),t=s-e;let o=n.shift();o.offset=e,o.length=t,o.end=s,this.list=this.list.filter(a=>!n.includes(a))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let r=e+t;return this.list.some(s=>s.offset<=e&&r<=s.end)}};function Tm(i,e,t){return i<=e&&e<=t}var Au=class extends xu{constructor(e,t){super(0),ge(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,r=await this.readChunk(e,t);return!!r&&r.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};Jn.set("blob",class extends Au{async readWhole(){this.chunked=!1;let i=await Zn(this.input);this._swapArrayBuffer(i)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(i,e){let t=e?i+e:void 0,r=this.input.slice(i,t),s=await Zn(r);return this.set(s,i,!0)}});var Rm={strings:{generatingThumbnails:"Generating thumbnails..."}};var O1={version:"4.0.2"};function R1(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(r){if(r.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(r=>{i.toBlob(r,e,t)}).then(r=>{if(r===null)throw new Error("cannot read image, probably an svg with external resources");return r}):Promise.resolve().then(()=>mm(i.toDataURL(e,t),{})).then(r=>{if(r===null)throw new Error("could not extract blob, probably an old browser");return r})}function L1(i,e){let t=i.width,r=i.height;(e.deg===90||e.deg===270)&&(t=i.height,r=i.width);let s=document.createElement("canvas");s.width=t,s.height=r;let n=s.getContext("2d");return n.translate(t/2,r/2),e.canvas&&(n.rotate(e.rad),n.scale(e.scaleX,e.scaleY)),n.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),s}function M1(i){let e=i.width/i.height,t=5e6,r=4096,s=Math.floor(Math.sqrt(t*e)),n=Math.floor(t/Math.sqrt(t*e));if(s>r&&(s=r,n=Math.round(s/e)),n>r&&(n=r,s=Math.round(e*n)),i.width>s){let o=document.createElement("canvas");return o.width=s,o.height=n,o.getContext("2d").drawImage(i,0,0,s,n),o}return i}var I1={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},Is=class extends ci{constructor(e,t){if(super(e,{...I1,...t}),this.onFileAdded=r=>{!r.preview&&r.data&&za(r.type)&&!r.isRemote&&this.addToQueue(r.id)},this.onCancelRequest=r=>{let s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1)},this.onFileRemoved=r=>{let s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1),r.preview&&Ua(r.preview)&&URL.revokeObjectURL(r.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(s=>s.isRestored).forEach(s=>{(!s.preview||Ua(s.preview))&&this.addToQueue(s.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=r=>{r.forEach(n=>{let o=this.uppy.getFile(n);this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let s=()=>{r.forEach(n=>{let o=this.uppy.getFile(n);this.uppy.emit("preprocess-complete",o)})};return new Promise(n=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{s(),n()}):(s(),n())})},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=Rm,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,r){let s=URL.createObjectURL(e.data),n=new Promise((a,l)=>{let c=new Image;c.src=s,c.addEventListener("load",()=>{URL.revokeObjectURL(s),a(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(s),l(d.error||new Error("Could not create thumbnail"))})}),o=Om(e.data).catch(()=>1);return Promise.all([n,o]).then(a=>{let[l,c]=a,d=this.getProportionalDimensions(l,t,r,c.deg),f=L1(l,c),y=this.resizeImage(f,d.width,d.height);return R1(y,this.thumbnailType,80)}).then(a=>URL.createObjectURL(a))}getProportionalDimensions(e,t,r,s){let n=e.width/e.height;return(s===90||s===270)&&(n=e.height/e.width),t!=null?{width:t,height:Math.round(t/n)}:r!=null?{width:Math.round(r*n),height:r}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(e,t,r){let s=M1(e),n=Math.ceil(Math.log2(s.width/t));n<1&&(n=1);let o=t*2**(n-1),a=r*2**(n-1),l=2;for(;n--;){let c=document.createElement("canvas");c.width=o,c.height=a,c.getContext("2d").drawImage(s,0,0,o,a),s=c,o=Math.round(o/l),a=Math.round(a/l)}return s}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return za(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};Is.VERSION=O1.version;function D1(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&zn(i)?[i]:null}var _u=D1;var dr=Array.from;function Ka(i,e,t,r){let{onSuccess:s}=r;i.readEntries(n=>{let o=[...e,...n];n.length?queueMicrotask(()=>{Ka(i,o,t,{onSuccess:s})}):s(o)},n=>{t(n),s(e)})}function Lm(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,r)=>i.file(t,r))},async*values(){let t=i.createReader();yield*await new Promise(s=>{Ka(t,[],e,{onSuccess:n=>s(n.map(o=>Lm(o,e)))})})},isSameEntry:void 0}}function Mm(i,e,t){try{return t===void 0&&(t=void 0),async function*(){let r=()=>`${e}/${i.name}`;if(i.kind==="file"){let s=await i.getFile();s!=null?(s.relativePath=e?r():null,yield s):t!=null&&(yield t)}else if(i.kind==="directory")for await(let s of i.values())yield*Mm(s,e?r():i.name);else t!=null&&(yield t)}()}catch(r){return Promise.reject(r)}}async function*Ou(i,e){let t=await Promise.all(Array.from(i.items,async r=>{var s;let n,o=()=>typeof r.getAsEntry=="function"?r.getAsEntry():r.webkitGetAsEntry();return(s=n)!=null||(n=Lm(o(),e)),{fileSystemHandle:n,lastResortFile:r.getAsFile()}}));for(let{lastResortFile:r,fileSystemHandle:s}of t)if(s!=null)try{yield*Mm(s,"",r)}catch(n){r!=null?yield r:e(n)}else r!=null&&(yield r)}function Ru(i){let e=dr(i.files);return Promise.resolve(e)}async function Lu(i,e){var t;let r=(t=e?.logDropError)!=null?t:Function.prototype;try{let s=[];for await(let n of Ou(i,r))s.push(n);return s}catch{return Ru(i)}}var hg=Ce(bt(),1);function to(i){return{...i,type:i.mimeType,extension:i.name?Dr(i.name).extension:null}}var io,ze,Mu,Im,ro=0,qm=[],je=Ee,Dm=je.__b,Nm=je.__r,Bm=je.diffed,Um=je.__c,zm=je.unmount,Hm=je.__;function Du(i,e){je.__h&&je.__h(ze,i,ro||e),ro=0;var t=ze.__H||(ze.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function hi(i){return ro=1,N1(jm,i)}function N1(i,e,t){var r=Du(io++,2);if(r.t=i,!r.__c&&(r.__=[t?t(e):jm(void 0,e),function(a){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,a);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=ze,!ze.u)){var s=function(a,l,c){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(y){return!!y.__c});if(d.every(function(y){return!y.__N}))return!n||n.call(this,a,l,c);var f=!1;return d.forEach(function(y){if(y.__N){var v=y.__[0];y.__=y.__N,y.__N=void 0,v!==y.__[0]&&(f=!0)}}),!(!f&&r.__c.props===a)&&(!n||n.call(this,a,l,c))};ze.u=!0;var n=ze.shouldComponentUpdate,o=ze.componentWillUpdate;ze.componentWillUpdate=function(a,l,c){if(this.__e){var d=n;n=void 0,s(a,l,c),n=d}o&&o.call(this,a,l,c)},ze.shouldComponentUpdate=s}return r.__N||r.__}function Ei(i,e){var t=Du(io++,3);!je.__s&&Vm(t.__H,e)&&(t.__=i,t.i=e,ze.__H.__h.push(t))}function Gr(i){return ro=5,Kr(function(){return{current:i}},[])}function Kr(i,e){var t=Du(io++,7);return Vm(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function Xr(i,e){return ro=8,Kr(function(){return i},e)}function B1(){for(var i;i=qm.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Xa),i.__H.__h.forEach(Iu),i.__H.__h=[]}catch(e){i.__H.__h=[],je.__e(e,i.__v)}}je.__b=function(i){ze=null,Dm&&Dm(i)},je.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Hm&&Hm(i,e)},je.__r=function(i){Nm&&Nm(i),io=0;var e=(ze=i.__c).__H;e&&(Mu===ze?(e.__h=[],ze.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0})):(e.__h.forEach(Xa),e.__h.forEach(Iu),e.__h=[],io=0)),Mu=ze},je.diffed=function(i){Bm&&Bm(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(qm.push(e)!==1&&Im===je.requestAnimationFrame||((Im=je.requestAnimationFrame)||U1)(B1)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.i=void 0})),Mu=ze=null},je.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Xa),t.__h=t.__h.filter(function(r){return!r.__||Iu(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],je.__e(r,t.__v)}}),Um&&Um(i,e)},je.unmount=function(i){zm&&zm(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{Xa(r)}catch(s){e=s}}),t.__H=void 0,e&&je.__e(e,t.__v))};var $m=typeof requestAnimationFrame=="function";function U1(i){var e,t=function(){clearTimeout(r),$m&&cancelAnimationFrame(e),setTimeout(i)},r=setTimeout(t,100);$m&&(e=requestAnimationFrame(t))}function Xa(i){var e=ze,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),ze=e}function Iu(i){var e=ze;i.__c=i.__(),ze=e}function Vm(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}function jm(i,e){return typeof e=="function"?e(i):e}function z1(){return u("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},u("g",{fill:"none","fill-rule":"evenodd"},u("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),u("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),u("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),u("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),u("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),u("path",{d:"M4 4h18v18H4z"})))}function H1(i){let{pluginName:e,i18n:t,onAuth:r}=i,s=e==="Google Drive",n=Xr(o=>{o.preventDefault(),r()},[r]);return u("form",{onSubmit:n},s?u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0},u(z1,null),t("signInWithGoogle")):u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}var $1=i=>{let{pluginName:e,i18n:t,onAuth:r}=i;return u(H1,{pluginName:e,i18n:t,onAuth:r})};function Ya(i){let{loading:e,pluginName:t,pluginIcon:r,i18n:s,handleAuth:n,renderForm:o=$1}=i;return u("div",{className:"uppy-Provider-auth"},u("div",{className:"uppy-Provider-authIcon"},r()),u("div",{className:"uppy-Provider-authTitle"},s("authenticateWithTitle",{pluginName:t})),o({pluginName:t,i18n:s,loading:e,onAuth:n}))}var Wm=Ce(bt(),1);function Nu(i){let{i18n:e,logout:t,username:r}=i;return u(Lt,null,r&&u("span",{className:"uppy-ProviderBrowser-user",key:"username"},r),u("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function Bu(i){let{openFolder:e,title:t,breadcrumbsIcon:r,breadcrumbs:s,i18n:n}=i;return u("div",{className:"uppy-Provider-breadcrumbs"},u("div",{className:"uppy-Provider-breadcrumbsIcon"},r),s.map((o,a)=>{var l;return u(Lt,null,u("button",{key:o.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(o.id)},o.type==="root"?t:(l=o.data.name)!=null?l:n("unnamed")),s.length===a+1?"":" / ")}))}function Uu(i){return u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:(0,Wm.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&u(Bu,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),u(Nu,{logout:i.logout,username:i.username,i18n:i.i18n})))}function zu(){return zu=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},zu.apply(null,arguments)}var q1={position:"relative",width:"100%",minHeight:"100%"},V1={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Hu=class extends ht{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:r,renderRow:s,overscanCount:n=10,...o}=e,{offset:a,height:l}=this.state,c=Math.floor(a/r),d=Math.floor(l/r);n&&(c=Math.max(0,c-c%n),d+=n);let f=c+d+4,y=t.slice(c,f),v={...q1,height:t.length*r},x={...V1,top:c*r};return u("div",zu({onScroll:this.handleScroll},o),u("div",{role:"presentation",style:v},u("div",{role:"presentation",style:x},y.map(s))))}},Za=Hu;var Gm=Ce(bt(),1);function j1(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},u("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function W1(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},u("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function G1(){return u("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},u("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),u("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}function Ds(i){let{itemIconString:e,alt:t=void 0}=i;if(e===null)return null;switch(e){case"file":return u(j1,null);case"folder":return u(W1,null);case"video":return u(G1,null);default:return u("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function K1(i){var e,t;let{file:r,toggleCheckbox:s,className:n,isDisabled:o,restrictionError:a,showTitles:l,children:c=null,i18n:d}=i;return u("li",{className:n,title:o&&a?a:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:s,name:"listitem",id:r.id,checked:r.status==="checked",disabled:o,"data-uppy-super-focusable":!0}),u("label",{htmlFor:r.id,"aria-label":(e=r.data.name)!=null?e:d("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u(Ds,{itemIconString:r.data.thumbnail||r.data.icon}),l&&((t=r.data.name)!=null?t:d("unnamed")),c))}var $u=K1;function qu(i){var e,t,r;let{file:s,openFolder:n,className:o,isDisabled:a,restrictionError:l,toggleCheckbox:c,showTitles:d,i18n:f}=i;return u("li",{className:o,title:s.status!=="checked"&&l?l:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:c,name:"listitem",id:s.id,checked:s.status==="checked","aria-label":s.data.isFolder?f("allFilesFromFolderNamed",{name:(e=s.data.name)!=null?e:f("unnamed")}):null,disabled:a,"data-uppy-super-focusable":!0}),s.data.isFolder?u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>n(s.id),"aria-label":f("openFolderNamed",{name:(t=s.data.name)!=null?t:f("unnamed")})},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(Ds,{itemIconString:s.data.icon})),d&&s.data.name?u("span",null,s.data.name):f("unnamed")):u("label",{htmlFor:s.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(Ds,{itemIconString:s.data.icon})),d&&((r=s.data.name)!=null?r:f("unnamed"))))}function Vu(i){let{viewType:e,toggleCheckbox:t,showTitles:r,i18n:s,openFolder:n,file:o}=i,a=o.type==="folder"?null:o.restrictionError,l=!!a&&o.status!=="checked",c={file:o,openFolder:n,toggleCheckbox:t,i18n:s,viewType:e,showTitles:r,className:(0,Gm.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":l},{"uppy-ProviderBrowserItem--noPreview":o.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":o.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":o.status==="partial"}),isDisabled:l,restrictionError:a};switch(e){case"grid":return u($u,c);case"list":return u(qu,c);case"unsplash":return u($u,c,u("a",{href:`${o.data.author.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},o.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function X1(i){let{displayedPartialTree:e,viewType:t,toggleCheckbox:r,handleScroll:s,showTitles:n,i18n:o,isLoading:a,openFolder:l,noResultsLabel:c,virtualList:d}=i,[f,y]=hi(!1);if(Ei(()=>{let x=C=>{C.key==="Shift"&&y(!1)},P=C=>{C.key==="Shift"&&y(!0)};return document.addEventListener("keyup",x),document.addEventListener("keydown",P),()=>{document.removeEventListener("keyup",x),document.removeEventListener("keydown",P)}},[]),a)return u("div",{className:"uppy-Provider-loading"},typeof a=="string"?a:o("loading"));if(e.length===0)return u("div",{className:"uppy-Provider-empty"},c);let v=x=>u(Vu,{viewType:t,toggleCheckbox:P=>{var C;P.stopPropagation(),P.preventDefault(),(C=document.getSelection())==null||C.removeAllRanges(),r(x,f)},showTitles:n,i18n:o,openFolder:l,file:x});return d?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(Za,{data:e,renderRow:v,rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:s,role:"listbox",tabIndex:-1},e.map(v)))}var Qa=X1;var Y1=(i,e,t,r,s)=>{let n=e.filter(v=>v.isFolder===!0),o=e.filter(v=>v.isFolder===!1),a=t.type==="folder"&&t.status==="checked",l=n.map(v=>({type:"folder",id:v.requestPath,cached:!1,nextPagePath:null,status:a?"checked":"unchecked",parentId:t.id,data:v})),c=o.map(v=>{let x=s(v);return{type:"file",id:v.requestPath,restrictionError:x,status:a&&!x?"checked":"unchecked",parentId:t.id,data:v}}),d={...t,cached:!0,nextPagePath:r};return[...i.map(v=>v.id===d.id?d:v),...l,...c]},Km=Y1;var Z1=(i,e,t,r,s)=>{let n=i.find(x=>x.id===e),o=t.filter(x=>x.isFolder===!0),a=t.filter(x=>x.isFolder===!1),l={...n,nextPagePath:r},c=i.map(x=>x.id===l.id?l:x),d=l.type==="folder"&&l.status==="checked",f=o.map(x=>({type:"folder",id:x.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:x})),y=a.map(x=>{let P=s(x);return{type:"file",id:x.requestPath,restrictionError:P,status:d&&!P?"checked":"unchecked",parentId:l.id,data:x}});return[...c,...f,...y]},Xm=Z1;var Q1=i=>i.map(e=>({...e})),Ja=Q1;var ju=(i,e,t)=>{i.filter(s=>s.type!=="root"&&s.parentId===e).forEach(s=>{s.status=t&&!(s.type==="file"&&s.restrictionError)?"checked":"unchecked",ju(i,s.id,t)})},Wu=(i,e)=>{let t=i.find(o=>o.id===e);if(t.type==="root")return;let r=i.filter(o=>o.type!=="root"&&o.parentId===t.id&&!(o.type==="file"&&o.restrictionError)),s=r.every(o=>o.status==="checked"),n=r.every(o=>o.status==="unchecked");s?t.status="checked":n?t.status="unchecked":t.status="partial",Wu(i,t.parentId)},J1=(i,e)=>{let t=Ja(i);if(e.length>=2){let r=t.filter(s=>s.type!=="root"&&e.includes(s.id));r.forEach(s=>{s.type==="file"?s.status=s.restrictionError?"unchecked":"checked":s.status="checked"}),r.forEach(s=>{ju(t,s.id,!0)}),Wu(t,r[0].parentId)}else{let r=t.find(s=>s.id===e[0]);r.status=r.status==="checked"?"unchecked":"checked",ju(t,r.id,r.status==="checked"),Wu(t,r.parentId)}return t},Ym=J1;var Ku=Ce(Qm(),1);var no=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Xu=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Jm=i=>globalThis.DOMException===void 0?new Xu(i):new DOMException(i),eg=i=>{let e=i.reason===void 0?Jm("This operation was aborted."):i.reason;return e instanceof Error?e:Jm(e)};function Yu(i,e){let{milliseconds:t,fallback:r,message:s,customTimers:n={setTimeout,clearTimeout}}=e,o,l=new Promise((c,d)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:y}=e;y.aborted&&d(eg(y));let v=()=>{d(eg(y))};y.addEventListener("abort",v,{once:!0}),i.finally(()=>{y.removeEventListener("abort",v)})}if(t===Number.POSITIVE_INFINITY){i.then(c,d);return}let f=new no;o=n.setTimeout.call(void 0,()=>{if(r){try{c(r())}catch(y){d(y)}return}typeof i.cancel=="function"&&i.cancel(),s===!1?c():s instanceof Error?d(s):(f.message=s??`Promise timed out after ${t} milliseconds`,d(f))},t),(async()=>{try{c(await i)}catch(y){d(y)}})()}).finally(()=>{l.clear()});return l.clear=()=>{n.clearTimeout.call(void 0,o),o=void 0},l}function Zu(i,e,t){let r=0,s=i.length;for(;s>0;){let n=Math.trunc(s/2),o=r+n;t(i[o],e)<=0?(r=++o,s-=n+1):s=n}return r}var oo=class{#e=[];enqueue(e,t){t={priority:0,...t};let r={priority:t.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority){this.#e.push(r);return}let s=Zu(this.#e,r,(n,o)=>o.priority-n.priority);this.#e.splice(s,0,r)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var ao=class extends Ku.default{#e;#t;#i=0;#s;#r;#n=0;#a;#c;#l;#u;#o=0;#d;#h;#f;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:oo,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#t=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#s=e.intervalCap,this.#r=e.interval,this.#l=new e.queueClass,this.#u=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#f=e.throwOnTimeout===!0,this.#h=e.autoStart===!1}get#p(){return this.#t||this.#i<this.#s}get#v(){return this.#o<this.#d}#m(){this.#o--,this.#g(),this.emit("next")}#b(){this.#T(),this.#E(),this.#c=void 0}get#y(){let e=Date.now();if(this.#a===void 0){let t=this.#n-e;if(t<0)this.#i=this.#e?this.#o:0;else return this.#c===void 0&&(this.#c=setTimeout(()=>{this.#b()},t)),!0}return!1}#g(){if(this.#l.size===0)return this.#a&&clearInterval(this.#a),this.#a=void 0,this.emit("empty"),this.#o===0&&this.emit("idle"),!1;if(!this.#h){let e=!this.#y;if(this.#p&&this.#v){let t=this.#l.dequeue();return t?(this.emit("active"),t(),e&&this.#E(),!0):!1}}return!1}#E(){this.#t||this.#a!==void 0||(this.#a=setInterval(()=>{this.#T()},this.#r),this.#n=Date.now()+this.#r)}#T(){this.#i===0&&this.#o===0&&this.#a&&(clearInterval(this.#a),this.#a=void 0),this.#i=this.#e?this.#o:0,this.#w()}#w(){for(;this.#g(););}get concurrency(){return this.#d}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#d=e,this.#w()}async#x(e){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(e.reason)},{once:!0})})}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:this.#f,...t},new Promise((r,s)=>{this.#l.enqueue(async()=>{this.#o++,this.#i++;try{t.signal?.throwIfAborted();let n=e({signal:t.signal});t.timeout&&(n=Yu(Promise.resolve(n),{milliseconds:t.timeout})),t.signal&&(n=Promise.race([n,this.#x(t.signal)]));let o=await n;r(o),this.emit("completed",o)}catch(n){if(n instanceof no&&!t.throwOnTimeout){r();return}s(n),this.emit("error",n)}finally{this.#m()}},t),this.emit("add"),this.#g()})}async addAll(e,t){return Promise.all(e.map(async r=>this.add(r,t)))}start(){return this.#h?(this.#h=!1,this.#w(),this):this}pause(){this.#h=!0}clear(){this.#l=new this.#u}async onEmpty(){this.#l.size!==0&&await this.#S("empty")}async onSizeLessThan(e){this.#l.size<e||await this.#S("next",()=>this.#l.size<e)}async onIdle(){this.#o===0&&this.#l.size===0||await this.#S("idle")}async#S(e,t){return new Promise(r=>{let s=()=>{t&&!t()||(this.off(e,s),r())};this.on(e,s)})}get size(){return this.#l.size}sizeBy(e){return this.#l.filter(e).length}get pending(){return this.#o}get isPaused(){return this.#h}};var tg=async(i,e,t,r,s)=>{let n=[],o=t.cached?t.nextPagePath:t.id;for(;o;){let f=await r(o);n=n.concat(f.items),o=f.nextPagePath}let a=n.filter(f=>f.isFolder===!0),l=n.filter(f=>f.isFolder===!1),c=a.map(f=>({type:"folder",id:f.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:t.id,data:f})),d=l.map(f=>{let y=s(f);return{type:"file",id:f.requestPath,restrictionError:y,status:y?"unchecked":"checked",parentId:t.id,data:f}});t.cached=!0,t.nextPagePath=null,e.push(...d,...c),c.forEach(async f=>{i.add(()=>tg(i,e,f,r,s))})},iS=async(i,e,t,r)=>{let s=new ao({concurrency:6}),n=Ja(i);return n.filter(a=>a.type==="folder"&&a.status==="checked"&&(a.cached===!1||a.nextPagePath)).forEach(a=>{s.add(()=>tg(s,n,a,e,t))}),s.on("completed",()=>{let a=n.filter(l=>l.type==="file"&&l.status==="checked").length;r(a)}),await s.onIdle(),n},ig=iS;var Yr={afterOpenFolder:Km,afterScrollFolder:Xm,afterToggleCheckbox:Ym,afterFill:ig};var rS=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:r}=i.target;return e-(t+r)<50},tl=rS;var sS=i=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){i.log("Aborting request","warning");return}i.log(e,"error"),e.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(e.message)},"warning",5e3)}},ji=sS;var nS=(i,e,t,r)=>{let s=e.findIndex(n=>n.id===r);if(s!==-1&&t){let n=e.findIndex(a=>a.id===i);return e.slice(Math.min(s,n),Math.max(s,n)+1).map(a=>a.id)}return[i]},il=nS;var oS="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var rg=(i=21)=>{let e="",t=i|0;for(;t--;)e+=oS[Math.random()*64|0];return e};function aS(i){let{searchString:e,setSearchString:t,submitSearchString:r,wrapperClassName:s,inputClassName:n,inputLabel:o,clearSearchLabel:a="",showButton:l=!1,buttonLabel:c="",buttonCSSClassName:d=""}=i,f=x=>{t(x.target.value)},y=Xr(x=>{x.preventDefault(),r()},[r]),[v]=hi(()=>{let x=document.createElement("form");return x.setAttribute("tabindex","-1"),x.id=rg(),x});return Ei(()=>(document.body.appendChild(v),v.addEventListener("submit",y),()=>{v.removeEventListener("submit",y),document.body.removeChild(v)}),[v,y]),u("section",{className:s},u("input",{className:`uppy-u-reset ${n}`,type:"search","aria-label":o,placeholder:o,value:e,onInput:f,form:v.id,"data-uppy-super-focusable":!0}),!l&&u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},u("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!l&&e&&u("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>t("")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},u("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),l&&u("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:v.id},c))}var Ns=aS;var ng=Ce(bt(),1);var lS=i=>i.filter(t=>t.type==="file"&&t.status==="checked"?!0:t.type==="folder"&&t.status==="checked"?!i.some(s=>s.type!=="root"&&s.parentId===t.id):!1).length,sg=lS;function lo(i){let{cancelSelection:e,donePicking:t,i18n:r,partialTree:s,validateAggregateRestrictions:n}=i,o=Kr(()=>n(s),[s,n]),a=Kr(()=>sg(s),[s]);return a===0?null:u("div",{className:"uppy-ProviderBrowser-footer"},u("div",{className:"uppy-ProviderBrowser-footer-buttons"},u("button",{className:(0,ng.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":o}),disabled:!!o,onClick:t,type:"button"},r("selectX",{smart_count:a})),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},r("cancel"))),o&&u("div",{className:"uppy-ProviderBrowser-footer-error"},o))}var cS=(i,e,t)=>{var r,s;return{id:i.id,source:e.id,name:i.name||i.id,type:i.mimeType,isRemote:!0,data:i,preview:i.thumbnail||void 0,meta:{authorName:(r=i.author)==null?void 0:r.name,authorUrl:(s=i.author)==null?void 0:s.url,relativePath:i.relDirPath||null,absolutePath:i.absDirPath},body:{fileId:i.id},remote:{companionUrl:e.opts.companionUrl,url:`${t.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:t.name,provider:t.provider,requestClientId:t.provider}}},og=cS;var uS=(i,e,t)=>{let r=i.map(o=>og(o,e,t)),s=[],n=[];r.forEach(o=>{e.uppy.checkIfFileAlreadyExists(xa(o,e.uppy.getID()))?n.push(o):s.push(o)}),s.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:s.length})),n.length>0&&e.uppy.info(`Not adding ${n.length} files because they already exist`),e.uppy.addFiles(s)},rl=uS;var ag=(i,e,t)=>{let r=e===null?"null":e;if(t[r])return t[r];let s=i.find(o=>o.id===e);if(s.type==="root")return[];let n=[...ag(i,s.parentId,t),s];return t[r]=n,n},hS=i=>{let e=Object.create(null);return i.filter(s=>s.type==="file"&&s.status==="checked").map(s=>{let n=ag(i,s.id,e),o=n.findIndex(d=>d.type==="folder"&&d.status==="checked"),a=n.slice(o),l=`/${n.map(d=>d.data.name).join("/")}`,c=a.length===1?void 0:a.map(d=>d.data.name).join("/");return{...s.data,absDirPath:l,relDirPath:c}})},sl=hS;var dS=(i,e)=>{let t=i.find(s=>s.id===e),r=[];for(;r=[t,...r],t.type!=="root";){let s=t.parentId;t=i.find(n=>n.id===s)}return r},lg=dS;function pr(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var pS=0;function ug(i){return"__private_"+pS+++"_"+i}var fS={version:"4.2.0"};function co(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},u("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var cg=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),Zr=ug("abortController"),di=ug("withAbort"),Bs=class{constructor(e,t){Object.defineProperty(this,di,{value:mS}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,Zr,{writable:!0,value:void 0}),this.validateSingleFile=s=>{let n=to(s);return this.plugin.uppy.validateSingleFile(n)},this.getDisplayedPartialTree=()=>{let{partialTree:s,currentFolderId:n,searchString:o}=this.plugin.getPluginState(),a=s.filter(c=>c.type!=="root"&&c.parentId===n);return o===""?a:a.filter(c=>{var d;return((d=c.data.name)!=null?d:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(o.toLowerCase())!==-1})},this.validateAggregateRestrictions=s=>{let o=s.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(o)},this.plugin=e,this.provider=t.provider;let r={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts={...r,...t},this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState(cg(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:{...r,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async openFolder(e){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),r=t.find(s=>s.id===e);if(r.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),await pr(this,di)[di](async s=>{let n=e,o=[];do{let{username:l,nextPagePath:c,items:d}=await this.provider.list(n,{signal:s});this.plugin.setPluginState({username:l}),n=c,o=o.concat(d),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:o.length}))}while(this.opts.loadAllFiles&&n);let a=Yr.afterOpenFolder(t,o,r,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})}).catch(ji(this.plugin.uppy)),this.setLoading(!1)}async logout(){await pr(this,di)[di](async e=>{let t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let r=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(r,"info",7e3)}this.plugin.setPluginState({...cg(this.plugin.rootFolderId),authenticated:!1})}}).catch(ji(this.plugin.uppy))}async handleAuth(e){await pr(this,di)[di](async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),await Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])}).catch(ji(this.plugin.uppy)),this.setLoading(!1)}async handleScroll(e){let{partialTree:t,currentFolderId:r}=this.plugin.getPluginState(),s=t.find(n=>n.id===r);tl(e)&&!this.isHandlingScroll&&s.nextPagePath&&(this.isHandlingScroll=!0,await pr(this,di)[di](async n=>{let{nextPagePath:o,items:a}=await this.provider.list(s.nextPagePath,{signal:n}),l=Yr.afterScrollFolder(t,r,a,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})}).catch(ji(this.plugin.uppy)),this.isHandlingScroll=!1)}async donePicking(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),await pr(this,di)[di](async t=>{let r=await Yr.afterFill(e,o=>this.provider.list(o,{signal:t}),this.validateSingleFile,o=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:o}))});if(this.validateAggregateRestrictions(r)){this.plugin.setPluginState({partialTree:r});return}let n=sl(r);rl(n,this.plugin,this.provider),this.resetPluginState()}).catch(ji(this.plugin.uppy)),this.setLoading(!1)}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),s=il(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=Yr.afterToggleCheckbox(r,s);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{didFirstRender:r}=this.plugin.getPluginState(),{i18n:s}=this.plugin.uppy;r||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let n={...this.opts,...t},{authenticated:o,loading:a}=this.plugin.getPluginState(),l=this.plugin.icon||co;if(o===!1)return u(Ya,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:n.renderAuthForm,loading:a});let{partialTree:c,currentFolderId:d,username:f,searchString:y}=this.plugin.getPluginState(),v=lg(c,d);return u("div",{className:(0,hg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n.viewType}`)},u(Uu,{showBreadcrumbs:n.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:v,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:f,i18n:s}),n.showFilter&&u(Ns,{searchString:y,setSearchString:x=>{this.plugin.setPluginState({searchString:x})},submitSearchString:()=>{},inputLabel:s("filter"),clearSearchLabel:s("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(Qa,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:n.virtualList,noResultsLabel:s("noFilesFound"),handleScroll:this.handleScroll,viewType:n.viewType,showTitles:n.showTitles,i18n:this.plugin.uppy.i18n,isLoading:a}),u(lo,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};async function mS(i){var e;(e=pr(this,Zr)[Zr])==null||e.abort();let t=new AbortController;pr(this,Zr)[Zr]=t;let r=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",r),this.plugin.uppy.on("cancel-all",r),await i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",r),this.plugin.uppy.off("cancel-all",r),pr(this,Zr)[Zr]=void 0}}Bs.VERSION=fS.version;var dg=Ce(bt(),1);var gS={version:"4.2.0"},vS={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},Us=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=s=>{let n=to(s);return this.plugin.uppy.validateSingleFile(n)},this.getDisplayedPartialTree=()=>{let{partialTree:s}=this.plugin.getPluginState();return s.filter(n=>n.type!=="root")},this.setSearchString=s=>{this.plugin.setPluginState({searchString:s}),s===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=s=>{let o=s.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(o)},this.plugin=e,this.provider=t.provider;let r={viewType:"grid",showTitles:!0,showFilter:!0};this.opts={...r,...t},this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(vS)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:{...r,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async search(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let t=await this.provider.search(e),r=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(s=>({type:"file",id:s.requestPath,status:"unchecked",parentId:null,data:s}))];this.plugin.setPluginState({partialTree:r,isInputMode:!1})}catch(t){ji(this.plugin.uppy)(t)}this.setLoading(!1)}}async handleScroll(e){let{partialTree:t,searchString:r}=this.plugin.getPluginState(),s=t.find(n=>n.type==="root");if(tl(e)&&!this.isHandlingScroll&&s.nextPagePath){this.isHandlingScroll=!0;try{let n=await this.provider.search(r,s.nextPagePath),o={...s,nextPagePath:n.nextPageQuery},a=t.filter(c=>c.type!=="root"),l=[o,...a,...n.items.map(c=>({type:"file",id:c.requestPath,status:"unchecked",parentId:null,data:c}))];this.plugin.setPluginState({partialTree:l})}catch(n){ji(this.plugin.uppy)(n)}this.isHandlingScroll=!1}}async donePicking(){let{partialTree:e}=this.plugin.getPluginState(),t=sl(e);rl(t,this.plugin,this.provider),this.resetPluginState()}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),s=il(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=Yr.afterToggleCheckbox(r,s);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{isInputMode:r,searchString:s,loading:n,partialTree:o}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,l={...this.opts,...t};return r?u(Ns,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):u("div",{className:(0,dg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&u(Ns,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(Qa,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:async()=>{},noResultsLabel:a("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:n,i18n:a,virtualList:!1}),u(lo,{partialTree:o,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};Us.VERSION=gS.version;var bS="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var nl=(i=21)=>{let e="",t=i|0;for(;t--;)e+=bS[Math.random()*64|0];return e};var pg=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function yS(i,e){return!!(i===e||pg(i)&&pg(e))}function wS(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!yS(i[t],e[t]))return!1;return!0}function Qu(i,e){e===void 0&&(e=wS);var t=null;function r(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];if(t&&t.lastThis===this&&e(s,t.lastArgs))return t.lastResult;var o=i.apply(this,s);return t={lastResult:o,lastArgs:s,lastThis:this},o}return r.clear=function(){t=null},r}var ol=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function uo(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function fg(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function SS(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function ES(i){return i.contains(document.activeElement)}function Ju(i,e,t){let r=uo(t,e),s=dr(r.querySelectorAll(ol)),n=s.indexOf(document.activeElement);ES(r)?i.shiftKey&&n===0?SS(i,s):!i.shiftKey&&n===s.length-1&&fg(i,s):fg(i,s)}function mg(i,e,t){e===null||Ju(i,e,t)}var gg=Ce(Hc(),1);function eh(){let i=!1;return(0,gg.default)((t,r)=>{let s=uo(t,r),n=s.contains(document.activeElement);if(n&&i)return;let o=s.querySelector("[data-uppy-super-focusable]");if(!(n&&!o))if(o)o.focus({preventScroll:!0}),i=!0;else{let a=s.querySelector(ol);a?.focus({preventScroll:!0}),i=!1}},260)}var Mg=Ce(bt(),1);function th(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var wg=Ce(bt(),1);function vg(i,e){if(i===e)return!0;if(!i||!e)return!1;let t=Object.keys(i),r=Object.keys(e),s=t.length;if(r.length!==s)return!1;for(let n=0;n<s;n++){let o=t[n];if(i[o]!==e[o]||!Object.prototype.hasOwnProperty.call(e,o))return!1}return!0}function xS(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#686DE0",fillRule:"evenodd"},u("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),u("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),u("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function kS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}function AS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}function PS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}function CS(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}function FS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#A7AFB7",fillRule:"nonzero"},u("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),u("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function _S(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}function Qr(i){let e={color:"#838999",icon:FS()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:_S()}:t==="image"?{color:"#686de0",icon:xS()}:t==="audio"?{color:"#068dbb",icon:kS()}:t==="video"?{color:"#19af67",icon:AS()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:PS()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:CS()}:e}function ho(i){let{file:e}=i;if(e.preview)return u("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:r}=Qr(e.type);return u("div",{className:"uppy-Dashboard-Item-previewIconWrap"},u("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},r),u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},u("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}var OS=(i,e)=>(typeof e=="function"?e():e).filter(s=>s.id===i)[0].name;function po(i){let{file:e,toggleFileCard:t,i18n:r,metaFields:s}=i,{missingRequiredMetaFields:n}=e;if(!(n!=null&&n.length))return null;let o=n.map(a=>OS(a,s)).join(", ");return u("div",{className:"uppy-Dashboard-Item-errorMessage"},r("missingRequiredMetaFields",{smart_count:n.length,fields:o})," ",u("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},r("editFile")))}function ih(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,showLinkToFileUploadResult:n}=i,a=e.preview?"rgba(255, 255, 255, 0.5)":Qr(e.type).color;return u("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:a}},n&&e.uploadURL&&u("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},u("span",{hidden:!0},e.meta.name)),u(ho,{file:e}),u(po,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function RS(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function bg(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function rh(i){return u("div",{className:"uppy-Dashboard-Item-progress"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":bg(i),title:bg(i),onClick:()=>RS(i)},i.children))}function al(i){let{children:e}=i;return u("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function sh(i){let{progress:e}=i,t=2*Math.PI*15;return u("g",null,u("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),u("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":t,"stroke-dashoffset":t-t/100*e}))}function nh(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(al,null,u("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),u("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):i.recoveredState?null:i.error&&!i.hideRetryButton?u(rh,i,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},u("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),u("path",{d:"M7.9 3H10v2H7.9z"}),u("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),u("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?u(rh,i,u(al,null,u(sh,{progress:i.file.progress.percentage}),i.file.isPaused?u("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):u("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},u("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),u("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?u(rh,i,u(al,null,u(sh,{progress:i.file.progress.percentage}),u("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(al,null,u(sh,{progress:i.file.progress.percentage}))))}var yg=Ce(ka(),1);var oh="...";function ll(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=oh.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-oh.length,r=Math.ceil(t/2),s=Math.floor(t/2);return i.slice(0,r)+oh+i.slice(-s)}var LS=i=>{let{author:e,name:t}=i.file.meta;function r(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return u("div",{className:"uppy-Dashboard-Item-name",title:t},ll(t,r()))},MS=i=>{var e;let{author:t}=i.file.meta,r=(e=i.file.remote)==null?void 0:e.providerName,s="\xB7";return t?u("div",{className:"uppy-Dashboard-Item-author"},u("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},ll(t.name,13)),r?u(Fragment,null,` ${s} `,r,` ${s} `):null):null},IS=i=>i.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},(0,yg.default)(i.file.size)),DS=i=>i.file.isGhost&&u("span",null," \u2022 ",u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0)},i.i18n("reSelect"))),NS=i=>{let{file:e,onClick:t}=i;return e.error?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function ah(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,toggleAddFilesPanel:n,isSingleFile:o,containerHeight:a,containerWidth:l}=i;return u("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},u("div",{className:"uppy-Dashboard-Item-fileName"},LS({file:e,isSingleFile:o,containerHeight:a,containerWidth:l}),u(NS,{file:e,onClick:()=>alert(e.error)})),u("div",{className:"uppy-Dashboard-Item-status"},MS({file:e}),IS({file:e}),DS({file:e,toggleAddFilesPanel:n,i18n:t})),u(po,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function lh(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=i,document.body.appendChild(r),r.select();let s=()=>{document.body.removeChild(r),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(r),t()):s()}catch{return document.body.removeChild(r),s()}})}function BS(i){let{file:e,uploadInProgressOrComplete:t,metaFields:r,canEditFile:s,i18n:n,onClick:o}=i;return!t&&r&&r.length>0||!t&&s(e)?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":n("editFileWithFilename",{file:e.meta.name}),title:n("editFileWithFilename",{file:e.meta.name}),onClick:()=>o()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},u("g",{fillRule:"evenodd"},u("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),u("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),u("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function US(i){let{i18n:e,onClick:t,file:r}=i;return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:r.meta.name}),title:e("removeFile",{file:r.meta.name}),onClick:()=>t()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},u("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),u("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function zS(i){let{file:e,uppy:t,i18n:r}=i,s=n=>{lh(e.uploadURL,r("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(r("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>n.target.focus({preventScroll:!0}))};return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":r("copyLink"),title:r("copyLink"),onClick:n=>s(n)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},u("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}function ch(i){let{uppy:e,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,showLinkToFileUploadResult:o,showRemoveButton:a,i18n:l,toggleFileCard:c,openFileEditor:d}=i;return u("div",{className:"uppy-Dashboard-Item-actionWrapper"},u(BS,{i18n:l,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,onClick:()=>{n&&n.length>0?c(!0,t.id):d(t)}}),o&&t.uploadURL?u(zS,{file:t,uppy:e,i18n:l}):null,a?u(US,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var fo=class extends ht{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!vg(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,r=!!e.progress.uploadComplete&&!t&&!e.error,s=!!e.progress.uploadStarted||!!t,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:a}=e,l=(this.props.individualCancellation||!n)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(l=!0);let c=(0,wg.default)({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":r,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a});return u("div",{className:c,id:`uppy_${e.id}`,role:this.props.role},u("div",{className:"uppy-Dashboard-Item-preview"},u(ih,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),u(nh,{uppy:this.props.uppy,file:e,error:o,isUploaded:r,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),u("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},u(ah,{file:e,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),u(ch,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:s,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function HS(i,e){let t=[],r=[];return i.forEach(s=>{r.length<e?r.push(s):(t.push(r),r=[s])}),r.length&&t.push(r),t}function uh(i){let{id:e,i18n:t,uppy:r,files:s,resumableUploads:n,hideRetryButton:o,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:f,isSingleFile:y,toggleFileCard:v,handleRequestThumbnail:x,handleCancelThumbnail:P,recoveredState:C,individualCancellation:I,itemsPerRow:D,openFileEditor:q,canEditFile:M,toggleAddFilesPanel:H,containerWidth:R,containerHeight:G}=i,K=D===1?71:200,Y=Kr(()=>{let Q=(le,ke)=>Number(s[ke].isGhost)-Number(s[le].isGhost),oe=Object.keys(s);return C&&oe.sort(Q),HS(oe,D)},[s,D,C]),ie=Q=>u("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:Q[0]},Q.map(oe=>u(fo,{key:oe,uppy:r,id:e,i18n:t,resumableUploads:n,individualCancellation:I,hideRetryButton:o,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:f,recoveredState:C,isSingleFile:y,containerWidth:R,containerHeight:G,toggleFileCard:v,handleRequestThumbnail:x,handleCancelThumbnail:P,role:"listitem",openFileEditor:q,canEditFile:M,toggleAddFilesPanel:H,file:s[oe]})));return y?u("div",{class:"uppy-Dashboard-files"},ie(Y[0])):u(Za,{class:"uppy-Dashboard-files",role:"list",data:Y,renderRow:ie,rowHeight:K})}var hh=class extends ht{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var e;(e=this.fileInput)==null||e.click()},this.triggerFolderInputClick=()=>{var e;(e=this.folderInput)==null||e.click()},this.triggerVideoCameraInputClick=()=>{var e;(e=this.mobileVideoFileInput)==null||e.click()},this.triggerPhotoCameraInputClick=()=>{var e;(e=this.mobilePhotoFileInput)==null||e.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""},this.renderHiddenInput=(e,t)=>{var r;return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(r=this.props.allowedFileTypes)==null?void 0:r.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,r)=>{let n={photo:"image/*",video:"video/*"}[e];return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:n,ref:r})},this.renderMyDeviceAcquirer=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{let r=this.props.acquirers.length;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":r===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),r=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),s=this.props.fileManagerSelectionType,n=s.charAt(0).toUpperCase()+s.slice(1);return u("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${n}`,{browseFiles:t,browseFolders:r,browse:t}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:t,browseFolders:r,browse:t}))},this.renderAcquirer=e=>{var t;return u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},u("div",{className:"uppy-DashboardTab-inner"},e.icon()),u("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],r=t.splice(e.length-2,e.length);return u(Lt,null,t.map(s=>this.renderAcquirer(s)),u("span",{role:"presentation",style:{"white-space":"nowrap"}},r.map(s=>this.renderAcquirer(s))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:r,showNativeVideoCameraButton:s}=this.props,n=[],o="myDevice";t||n.push({key:o,elements:this.renderMyDeviceAcquirer()}),r&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),s&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...e.map(d=>({key:d.id,elements:this.renderAcquirer(d)}))),n.length===1&&n[0].key===o&&(n=[]);let l=[...n],c=l.splice(n.length-2,n.length);return u(Lt,null,this.renderDropPasteBrowseTagline(n.length),u("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(d=>{let{key:f,elements:y}=d;return u(Lt,{key:f},y)}),u("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:f,elements:y}=d;return u(Lt,{key:f},y)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:e}=this.props,t=u("span",null,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),u("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),r=e("poweredBy",{uppy:t});return u("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},r)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:r}=this.props;return u("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,s=>{this.fileInput=s}),this.renderHiddenInput(!0,s=>{this.folderInput=s}),e&&this.renderHiddenCameraInput("photo",r,s=>{this.mobilePhotoFileInput=s}),t&&this.renderHiddenCameraInput("video",r,s=>{this.mobileVideoFileInput=s}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),u("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&u("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}},cl=hh;var Sg=Ce(bt(),1);var $S=i=>u("div",{className:(0,Sg.default)("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),u(cl,i)),Eg=$S;var Tg=Ce(bt(),1);function qS(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ti=qS;function VS(i){let{activePickerPanel:e,className:t,hideAllPanels:r,i18n:s,state:n,uppy:o}=i,a=Gr(null);return u("div",{className:(0,Tg.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:Ti,onDragLeave:Ti,onDrop:Ti,onPaste:Ti},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},s("importFrom",{name:e.name})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:r},s("cancel"))),u("div",{ref:a,className:"uppy-DashboardContent-panelBody"},o.getPlugin(e.id).render(n,a.current)))}var xg=VS;var kg=Ce(bt(),1);function jS(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return u("div",{className:(0,kg.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),u("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),u("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(r=>i.uppy.getPlugin(r.id).render(i.state))))}var Ag=jS;var xi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function WS(i,e,t,r){if(r===void 0&&(r={}),i)return xi.STATE_ERROR;if(e)return xi.STATE_COMPLETE;if(t)return xi.STATE_PAUSED;let s=xi.STATE_WAITING,n=Object.keys(r);for(let o=0;o<n.length;o++){let{progress:a}=r[n[o]];if(a.uploadStarted&&!a.uploadComplete)return xi.STATE_UPLOADING;a.preprocess&&s!==xi.STATE_UPLOADING&&(s=xi.STATE_PREPROCESSING),a.postprocess&&s!==xi.STATE_UPLOADING&&s!==xi.STATE_PREPROCESSING&&(s=xi.STATE_POSTPROCESSING)}return s}function GS(i){let{files:e,i18n:t,isAllComplete:r,isAllErrored:s,isAllPaused:n,inProgressNotPausedFiles:o,newFiles:a,processingFiles:l}=i;switch(WS(s,r,n,e)){case"uploading":return t("uploadingXFiles",{smart_count:o.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:a.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}function KS(i){let{i18n:e,isAllComplete:t,hideCancelButton:r,maxNumberOfFiles:s,toggleAddFilesPanel:n,uppy:o}=i,{allowNewUpload:a}=i;return a&&s&&(a=i.totalFileCount<i.maxNumberOfFiles),u("div",{className:"uppy-DashboardContent-bar"},!t&&!r?u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>o.cancelAll()},e("cancel")):u("div",null),u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},u(GS,i)),a?u("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>n(!0)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},u("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),u("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):u("div",null))}var Pg=KS;var Cg=Ce(bt(),1);function dh(i){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:r,form:s,formState:n}=i,o={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(a=>{let l=`uppy-Dashboard-FileCard-input-${a.id}`,c=t.includes(a.id);return u("fieldset",{key:a.id,className:"uppy-Dashboard-FileCard-fieldset"},u("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},a.name),a.render!==void 0?a.render({value:n[a.id],onChange:d=>r(d,a.id),fieldCSSClasses:o,required:c,form:s.id},u):u("input",{className:o.text,id:l,form:s.id,type:a.type||"text",required:c,value:n[a.id],placeholder:a.placeholder,onInput:d=>r(d.target.value,a.id),"data-uppy-super-focusable":!0}))})}function ph(i){var e;let{files:t,fileCardFor:r,toggleFileCard:s,saveFileCard:n,metaFields:o,requiredMetaFields:a,openFileEditor:l,i18n:c,i18nArray:d,className:f,canEditFile:y}=i,v=()=>typeof o=="function"?o(t[r]):o,x=t[r],P=(e=v())!=null?e:[],C=y(x),I={};P.forEach(K=>{var Y;I[K.id]=(Y=x.meta[K.id])!=null?Y:""});let[D,q]=hi(I),M=Xr(K=>{K.preventDefault(),n(D,r)},[n,D,r]),H=(K,Y)=>{q({...D,[Y]:K})},R=()=>{s(!1)},[G]=hi(()=>{let K=document.createElement("form");return K.setAttribute("tabindex","-1"),K.id=nl(),K});return Ei(()=>(document.body.appendChild(G),G.addEventListener("submit",M),()=>{G.removeEventListener("submit",M),document.body.removeChild(G)}),[G,M]),u("div",{className:(0,Cg.default)("uppy-Dashboard-FileCard",f),"data-uppy-panelType":"FileCard",onDragOver:Ti,onDragLeave:Ti,onDrop:Ti,onPaste:Ti},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},x.meta?x.meta.name:x.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",form:G.id,title:c("finishEditingFile"),onClick:R},c("cancel"))),u("div",{className:"uppy-Dashboard-FileCard-inner"},u("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:Qr(x.type).color}},u(ho,{file:x}),C&&u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:K=>{M(K),l(x)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(dh,{computedMetaFields:P,requiredMetaFields:a,updateMeta:H,form:G,formState:D})),u("div",{className:"uppy-Dashboard-FileCard-actions"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:G.id},c("saveChanges")),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:R,form:G.id},c("cancel")))))}var _g=Ce(bt(),1),zs="uppy-transition-slideDownUp",Fg=250;function XS(i){let{children:e}=i,[t,r]=hi(null),[s,n]=hi(""),o=Gr(),a=Gr(),l=Gr(),c=()=>{n(`${zs}-enter`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{n(`${zs}-enter ${zs}-enter-active`),o.current=setTimeout(()=>{n("")},Fg)})},d=()=>{n(`${zs}-leave`),cancelAnimationFrame(l.current),clearTimeout(o.current),o.current=void 0,l.current=requestAnimationFrame(()=>{n(`${zs}-leave ${zs}-leave-active`),a.current=setTimeout(()=>{r(null),n("")},Fg)})};return Ei(()=>{let f=Si(e)[0];t!==f&&(f&&!t?c():t&&!f&&!a.current&&d(),r(f))},[e,t]),Ei(()=>()=>{clearTimeout(o.current),clearTimeout(a.current),cancelAnimationFrame(l.current)},[]),t?Ra(t,{className:(0,_g.default)(s,t.props.className)}):null}var mo=XS;function Hs(){return Hs=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Hs.apply(null,arguments)}var Og=900,Rg=700,fh=576,Lg=330;function mh(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>fh,s=i.containerHeight>Lg,n=(0,Mg.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>fh,"uppy-size--lg":i.containerWidth>Rg,"uppy-size--xl":i.containerWidth>Og,"uppy-size--height-md":i.containerHeight>Lg,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&s}),o=1;i.containerWidth>Og?o=5:i.containerWidth>Rg?o=4:i.containerWidth>fh&&(o=3);let a=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,c=i.files?Object.keys(i.files).filter(y=>i.files[y].isGhost).length:0,d=()=>c>0?i.i18n("recoveredXFiles",{smart_count:c}):i.i18n("recoveredAllFiles");return u("div",{className:n,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&th(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},u("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),u("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:u("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},u("span",{"aria-hidden":"true"},"\xD7")),u("div",{className:"uppy-Dashboard-innerWrap"},u("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),a&&u(Pg,i),l&&u("div",{className:"uppy-Dashboard-serviceMsg"},u("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},u("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},u("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),u("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),u("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),u("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),u("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),a?u(uh,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:o,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):u(cl,{i18n:i.i18n,i18nArray:i.i18nArray,acquirers:i.acquirers,handleInputChange:i.handleInputChange,maxNumberOfFiles:i.maxNumberOfFiles,allowedFileTypes:i.allowedFileTypes,showNativePhotoCameraButton:i.showNativePhotoCameraButton,showNativeVideoCameraButton:i.showNativeVideoCameraButton,nativeCameraFacingMode:i.nativeCameraFacingMode,showPanel:i.showPanel,activePickerPanel:i.activePickerPanel,disableLocalFiles:i.disableLocalFiles,fileManagerSelectionType:i.fileManagerSelectionType,note:i.note,proudlyDisplayPoweredByUppy:i.proudlyDisplayPoweredByUppy}),u(mo,null,i.showAddFilesPanel?u(Eg,Hs({key:"AddFiles"},i,{isSizeMD:r})):null),u(mo,null,i.fileCardFor?u(ph,Hs({key:"FileCard"},i)):null),u(mo,null,i.activePickerPanel?u(xg,Hs({key:"Picker"},i)):null),u(mo,null,i.showFileEditor?u(Ag,Hs({key:"Editor"},i)):null),u("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(y=>i.uppy.getPlugin(y.id).render(i.state))))))}var Ig={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function de(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var YS=0;function lt(i){return"__private_"+YS+++"_"+i}var ZS={version:"4.1.3"},gh=Qu.default||Qu,Dg=9,QS=27;function Ng(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var JS={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:co,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:()=>{},onDragOver:()=>{},onDrop:()=>{},plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550},Jr=lt("disabledNodes"),Wi=lt("generateLargeThumbnailIfSingleFile"),go=lt("openFileEditorWhenFilesAdded"),es=lt("attachRenderFunctionToTarget"),vh=lt("isTargetSupported"),bh=lt("getAcquirers"),yh=lt("getProgressIndicators"),Gi=lt("getEditors"),wh=lt("addSpecifiedPluginsFromOptions"),Sh=lt("autoDiscoverPlugins"),ts=lt("addSupportedPluginIfNoTarget"),vo=lt("getStatusBarOpts"),bo=lt("getThumbnailGeneratorOpts"),Eh=lt("getInformerOpts"),yo=lt("getStatusBarId"),wo=lt("getThumbnailGeneratorId"),Th=lt("getInformerId"),fr=class extends ci{constructor(e,t){var r,s,n;let o=(r=t?.autoOpen)!=null?r:null;super(e,{...JS,...t,autoOpen:o}),Object.defineProperty(this,Th,{value:nE}),Object.defineProperty(this,wo,{value:sE}),Object.defineProperty(this,yo,{value:rE}),Object.defineProperty(this,Eh,{value:iE}),Object.defineProperty(this,bo,{value:tE}),Object.defineProperty(this,vo,{value:eE}),Object.defineProperty(this,Jr,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${nl()}`,this.superFocus=eh(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=a=>{let c=this.getPluginState().targets.filter(d=>d.id!==a.id);this.setPluginState({targets:c})},this.addTarget=a=>{let l=a.id||a.constructor.name,c=a.title||l,d=a.type;if(d!=="acquirer"&&d!=="progressindicator"&&d!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let f={id:l,name:c,type:d},v=this.getPluginState().targets.slice();return v.push(f),this.setPluginState({targets:v}),this.el},this.hideAllPanels=()=>{var a;let l=this.getPluginState(),c={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===c.activePickerPanel&&l.showAddFilesPanel===c.showAddFilesPanel&&l.showFileEditor===c.showFileEditor&&l.activeOverlayType===c.activeOverlayType||(this.setPluginState(c),this.uppy.emit("dashboard:close-panel",(a=l.activePickerPanel)==null?void 0:a.id))},this.showPanel=a=>{let{targets:l}=this.getPluginState(),c=l.find(d=>d.type==="acquirer"&&d.id===a);this.setPluginState({activePickerPanel:c,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",a)},this.canEditFile=a=>{let{targets:l}=this.getPluginState();return de(this,Gi)[Gi](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(a))},this.openFileEditor=a=>{let{targets:l}=this.getPluginState(),c=de(this,Gi)[Gi](l);this.setPluginState({showFileEditor:!0,fileCardFor:a.id||null,activeOverlayType:"FileEditor"}),c.forEach(d=>{this.uppy.getPlugin(d.id).selectFile(a)})},this.closeFileEditor=()=>{let{metaFields:a}=this.getPluginState();a&&a.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:a}=this.getPluginState();de(this,Gi)[Gi](a).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:a,resolve:l}=Ng();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let c=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",c,!1),l()};this.el.addEventListener("animationend",c,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),a},this.closeModal=a=>{var l;let c=(l=a?.manualClose)!=null?l:!0,{isHidden:d,isClosing:f}=this.getPluginState();if(d||f)return;let{promise:y,resolve:v}=Ng();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let P=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",P,!1),v()};this.el.addEventListener("animationend",P,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),v();if(document.removeEventListener("keydown",this.handleKeyDownInModal),c&&this.opts.browserBackButtonClose){var x;(x=history.state)!=null&&x[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),y},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=a=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:{...l,darkMode:a}})},this.handleSystemDarkModeChange=a=>{let l=a.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(a,l)=>{let c=this.uppy.getFile(l);a?this.uppy.emit("dashboard:file-edit-start",c):this.uppy.emit("dashboard:file-edit-complete",c),this.setPluginState({fileCardFor:a?l:null,activeOverlayType:a?"FileCard":null})},this.toggleAddFilesPanel=a=>{this.setPluginState({showAddFilesPanel:a,activeOverlayType:a?"AddFiles":null})},this.addFiles=a=>{let l=a.map(c=>({source:this.id,name:c.name,type:c.type,data:c,meta:{relativePath:c.relativePath||c.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(c){this.uppy.log(c)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(a=>{let l=a[0],{width:c,height:d}=l.contentRect;this.setPluginState({containerWidth:c,containerHeight:d,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let a=this.getPluginState(),l=!this.opts.inline&&a.isHidden;!a.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn\u2019t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=a=>{this.el.contains(a.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=a=>{var l;let c=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],d=(l=de(this,Jr)[Jr])!=null?l:dr(this.el.querySelectorAll(c)).filter(f=>!f.classList.contains("uppy-Dashboard-close"));for(let f of d)f.tagName==="A"?f.setAttribute("aria-disabled",a):f.disabled=a;a?de(this,Jr)[Jr]=d:de(this,Jr)[Jr]=null,this.dashboardIsDisabled=a},this.updateBrowserHistory=()=>{var a;(a=history.state)!=null&&a[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=a=>{var l;this.isModalOpen()&&(!a.state||!a.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=a.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=a=>{a.keyCode===QS&&this.requestCloseModal(),a.keyCode===Dg&&Ju(a,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=a=>{this.uppy.iteratePlugins(c=>{c.type==="acquirer"&&(c.handleRootPaste==null||c.handleRootPaste(a))});let l=dr(a.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=a=>{a.preventDefault();let l=dr(a.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=a=>{a.preventDefault(),a.stopPropagation();let l=()=>{let y=!0;return this.uppy.iteratePlugins(v=>{v.canHandleRootDrop!=null&&v.canHandleRootDrop(a)&&(y=!0)}),y},c=()=>{let{types:y}=a.dataTransfer;return y.some(v=>v==="Files")},d=l(),f=c();if(!d&&!f||this.opts.disabled||this.opts.disableLocalFiles&&(f||!d)||!this.uppy.getState().allowNewUpload){a.dataTransfer.dropEffect="none";return}a.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(a)},this.handleDragLeave=a=>{a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(a)},this.handleDrop=async a=>{a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(f=>{f.type==="acquirer"&&(f.handleRootDrop==null||f.handleRootDrop(a))});let l=!1,c=f=>{this.uppy.log(f,"error"),l||(this.uppy.info(f.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let d=await Lu(a.dataTransfer,{logDropError:c});d.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(d)),this.opts.onDrop(a)},this.handleRequestThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",a)},this.handleCancelThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",a)},this.handleKeyDownInInline=a=>{a.keyCode===Dg&&mg(a,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=a=>{this.el.contains(document.activeElement)&&this.handlePaste(a)},this.handleComplete=a=>{let{failed:l}=a;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Wi,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let a=600,l=this.uppy.getFiles();if(l.length===1){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c?.setOptions({thumbnailWidth:a});let d={...l[0],preview:void 0};c?.requestThumbnail(d).then(()=>{c?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,go,{writable:!0,value:a=>{let l=a[0],{metaFields:c}=this.getPluginState(),d=c&&c.length>0,f=this.canEditFile(l);d&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):f&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let a=_u(this.opts.trigger);a?a.forEach(l=>l.addEventListener("click",this.openModal)):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",de(this,ts)[ts]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",de(this,Wi)[Wi]),this.uppy.on("file-removed",de(this,Wi)[Wi]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",de(this,go)[go])},this.removeEvents=()=>{let a=_u(this.opts.trigger);!this.opts.inline&&a&&a.forEach(l=>l.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",de(this,ts)[ts]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",de(this,Wi)[Wi]),this.uppy.off("file-removed",de(this,Wi)[Wi]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",de(this,go)[go])},this.superFocusOnEachUpdate=()=>{let a=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,c=this.uppy.getState().info.length===0,d=!this.opts.inline;c&&(d||a||l&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(a,l)=>{this.uppy.setFileMeta(l,a),this.toggleFileCard(!1,l)},Object.defineProperty(this,es,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return{...a,icon:l.icon||this.opts.defaultPickerIcon,render:l.render}}}),Object.defineProperty(this,vh,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,bh,{writable:!0,value:gh(a=>a.filter(l=>l.type==="acquirer"&&de(this,vh)[vh](l)).map(de(this,es)[es]))}),Object.defineProperty(this,yh,{writable:!0,value:gh(a=>a.filter(l=>l.type==="progressindicator").map(de(this,es)[es]))}),Object.defineProperty(this,Gi,{writable:!0,value:gh(a=>a.filter(l=>l.type==="editor").map(de(this,es)[es]))}),this.render=a=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:f}=a,{newFiles:y,uploadStartedFiles:v,completeFiles:x,erroredFiles:P,inProgressFiles:C,inProgressNotPausedFiles:I,processingFiles:D,isUploadStarted:q,isAllComplete:M,isAllPaused:H}=this.uppy.getObjectOfFilesPerState(),R=de(this,bh)[bh](l.targets),G=de(this,yh)[yh](l.targets),K=de(this,Gi)[Gi](l.targets),Y;return this.opts.theme==="auto"?Y=d.darkMode?"dark":"light":Y=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),mh({state:a,isHidden:l.isHidden,files:c,newFiles:y,uploadStartedFiles:v,completeFiles:x,erroredFiles:P,inProgressFiles:C,inProgressNotPausedFiles:I,processingFiles:D,isUploadStarted:q,isAllComplete:M,isAllPaused:H,totalFileCount:Object.keys(c).length,totalProgress:a.totalProgress,allowNewUpload:f,acquirers:R,theme:Y,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:l.activePickerPanel,showFileEditor:l.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:l.isClosing,progressindicators:G,editors:K,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:a.recoveredState,metaFields:l.metaFields,resumableUploads:d.resumableUploads||!1,individualCancellation:d.individualCancellation,isMobileDevice:d.isMobileDevice,fileCardFor:l.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:l.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:l.containerWidth,containerHeight:l.containerHeight,areInsidesReadyToBeVisible:l.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:l.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,wh,{writable:!0,value:()=>{let{plugins:a}=this.opts;a.forEach(l=>{let c=this.uppy.getPlugin(l);c?c.mount(this,c):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,Sh,{writable:!0,value:()=>{this.uppy.iteratePlugins(de(this,ts)[ts])}}),Object.defineProperty(this,ts,{writable:!0,value:a=>{var l;let c=["acquirer","editor"];a&&!((l=a.opts)!=null&&l.target)&&c.includes(a.type)&&(this.getPluginState().targets.some(f=>a.id===f.id)||a.mount(this,a))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:a,closeAfterFinish:l}=this.opts;if(a&&l)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");let{allowMultipleUploads:c,allowMultipleUploadBatches:d}=this.uppy.opts;(c||d)&&l&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:f}=this.opts;f&&this.mount(f,this),this.opts.disableStatusBar||this.uppy.use($r,{id:de(this,yo)[yo](),target:this,...de(this,vo)[vo]()}),this.opts.disableInformer||this.uppy.use(qr,{id:de(this,Th)[Th](),target:this,...de(this,Eh)[Eh]()}),this.opts.disableThumbnailGenerator||this.uppy.use(Is,{id:de(this,wo)[wo](),...de(this,bo)[bo]()}),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let y=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${y?"on":"off"}`),this.setDarkModeCapability(y),this.opts.theme==="auto"){var v;(v=this.darkModeMediaQuery)==null||v.addListener(this.handleSystemDarkModeChange)}de(this,wh)[wh](),de(this,Sh)[Sh](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let c=this.uppy.getPlugin(`${this.id}:Informer`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableStatusBar){let c=this.uppy.getPlugin(`${this.id}:StatusBar`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableThumbnailGenerator){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c&&this.uppy.removePlugin(c)}let{plugins:a}=this.opts;if(a.forEach(c=>{let d=this.uppy.getPlugin(c);d&&d.unmount()}),this.opts.theme==="auto"){var l;(l=this.darkModeMediaQuery)==null||l.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=Ig,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(n=(s=this.opts).onRequestCloseModal)!=null||(s.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,r;super.setOptions(e),(t=this.uppy.getPlugin(de(this,yo)[yo]()))==null||t.setOptions(de(this,vo)[vo]()),(r=this.uppy.getPlugin(de(this,wo)[wo]()))==null||r.setOptions(de(this,bo)[bo]())}};function eE(){let{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:s,hideProgressAfterFinish:n,locale:o,doneButtonHandler:a}=this.opts;return{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:s,hideAfterFinish:n,locale:o,doneButtonHandler:a}}function tE(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r,lazy:!r}}function iE(){return{}}function rE(){return`${this.id}:StatusBar`}function sE(){return`${this.id}:ThumbnailGenerator`}function nE(){return`${this.id}:Informer`}fr.VERSION=ZS.version;var qg=Ce(Bg(),1);function oE(i,e){let t=i.width/e.width,r=i.height/e.height,s=Math.min(t,r),n=e.width*s,o=e.height*s,a=(i.width-n)/2,l=(i.height-o)/2;return{width:n,height:o,left:a,top:l}}var Ug=oE;function aE(i){return i*(Math.PI/180)}function lE(i,e,t){let r=Math.abs(aE(t));return Math.max((Math.sin(r)*i+Math.cos(r)*e)/e,(Math.sin(r)*e+Math.cos(r)*i)/i)}var zg=lE;function cE(i,e,t){return e.left<i.left?{left:i.left,width:t.width}:e.top<i.top?{top:i.top,height:t.height}:e.left+e.width>i.left+i.width?{left:i.left+i.width-t.width,width:t.width}:e.top+e.height>i.top+i.height?{top:i.top+i.height-t.height,height:t.height}:null}var Hg=cE;function uE(i,e,t){return e.left<i.left?{left:i.left,width:t.left+t.width-i.left}:e.top<i.top?{top:i.top,height:t.top+t.height-i.top}:e.left+e.width>i.left+i.width?{left:t.left,width:i.left+i.width-t.left}:e.top+e.height>i.top+i.height?{top:t.top,height:i.top+i.height-t.top}:null}var $g=uE;var So=class extends ht{constructor(e){super(e),this.onRotate90Deg=()=>{let{angle90Deg:t}=this.state,r=t-90;this.setState({angle90Deg:r,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(r);let s=this.cropper.getCanvasData(),n=this.cropper.getContainerData(),o=Ug(n,s);this.cropper.setCanvasData(o),this.cropper.setCropBoxData(o)},this.onRotateGranular=t=>{let r=Number(t.target.value);this.setState({angleGranular:r});let{angle90Deg:s}=this.state,n=s+r;this.cropper.rotateTo(n);let o=this.cropper.getImageData(),a=zg(o.naturalWidth,o.naturalHeight,r),l=this.cropper.getImageData().scaleX<0?-a:a;this.cropper.scale(l,a)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){let{opts:e,storeCropperInstance:t}=this.props;this.cropper=new qg.default(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){let t=this.cropper.getCanvasData(),r=this.cropper.getCropBoxData(),{prevCropboxData:s}=this.state;if(e.detail.action==="all"){let n=Hg(t,r,s);n&&this.cropper.setCropBoxData(n)}else{let n=$g(t,r,s);n&&this.cropper.setCropBoxData(n)}}renderGranularRotate(){let{i18n:e}=this.props,{angleGranular:t}=this.state;return u("label",{role:"tooltip","aria-label":`${t}\xBA`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},u("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){let{i18n:e,opts:t}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})}},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))}renderRotate(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))}renderFlip(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))}renderZoomIn(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.cropper.zoom(.1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},u("path",{d:"M0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),u("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.cropper.zoom(-.1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))}renderCropSquare(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M19 5v14H5V5h14m0-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-2z"})))}renderCropWidescreen(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),u("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),u("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){let{currentImage:e,opts:t}=this.props,{actions:r}=t,s=URL.createObjectURL(e.data);return u("div",{className:"uppy-ImageCropper"},u("div",{className:"uppy-ImageCropper-container"},u("img",{className:"uppy-ImageCropper-image",alt:e.name,src:s,ref:n=>{this.imgElement=n}})),u("div",{className:"uppy-ImageCropper-controls"},r.revert&&this.renderRevert(),r.rotate&&this.renderRotate(),r.granularRotate&&this.renderGranularRotate(),r.flip&&this.renderFlip(),r.zoomIn&&this.renderZoomIn(),r.zoomOut&&this.renderZoomOut(),r.cropSquare&&this.renderCropSquare(),r.cropWidescreen&&this.renderCropWidescreen(),r.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}};var Vg={strings:{revert:"Reset",rotate:"Rotate 90\xB0",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}};var hE={version:"3.2.1"},jg={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},Wg={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},dE={quality:.8,actions:Wg,cropperOptions:jg},is=class extends ci{constructor(e,t){super(e,{...dE,...t,actions:{...Wg,...t?.actions},cropperOptions:{...jg,...t?.cropperOptions}}),this.save=()=>{let r=o=>{var a;let{currentImage:l}=this.getPluginState();this.uppy.setFileState(l.id,{data:new File([o],(a=l.name)!=null?a:this.i18n("unnamed"),{type:o.type}),size:o.size,preview:void 0});let c=this.uppy.getFile(l.id);this.uppy.emit("thumbnail:request",c),this.setPluginState({currentImage:c}),this.uppy.emit("file-editor:complete",c)},{currentImage:s}=this.getPluginState(),n=this.cropper.getCroppedCanvas({});n.width%2!==0&&this.cropper.setData({width:n.width-1}),n.height%2!==0&&this.cropper.setData({height:n.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob(r,s.type,this.opts.quality)},this.storeCropperInstance=r=>{this.cropper=r},this.selectFile=r=>{this.uppy.emit("file-editor:start",r),this.setPluginState({currentImage:r})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=Vg,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;let t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){let{currentImage:e}=this.getPluginState();if(e){let t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){let{currentImage:e}=this.getPluginState();return e===null||e.isRemote?null:u(So,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}};is.VERSION=hE.version;function Ki(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var pE=0;function Gg(i){return"__private_"+pE+++"_"+i}var St=Gg("uppy"),Eo=Gg("events"),To=class{constructor(e){Object.defineProperty(this,St,{writable:!0,value:void 0}),Object.defineProperty(this,Eo,{writable:!0,value:[]}),Ki(this,St)[St]=e}on(e,t){return Ki(this,Eo)[Eo].push([e,t]),Ki(this,St)[St].on(e,t)}remove(){for(let[e,t]of Ki(this,Eo)[Eo].splice(0))Ki(this,St)[St].off(e,t)}onFilePause(e,t){this.on("upload-pause",(r,s)=>{e===r?.id&&t(s)})}onFileRemove(e,t){this.on("file-removed",r=>{e===r.id&&t(r.id)})}onPause(e,t){this.on("upload-pause",(r,s)=>{e===r?.id&&t(s)})}onRetry(e,t){this.on("upload-retry",r=>{e===r?.id&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{Ki(this,St)[St].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{Ki(this,St)[St].getFile(e)&&t()})}onCancelAll(e,t){var r=this;this.on("cancel-all",function(){Ki(r,St)[St].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{Ki(this,St)[St].getFile(e)&&t()})}};function te(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var fE=0;function Pt(i){return"__private_"+fE+++"_"+i}function mE(i){return new Error("Cancelled",{cause:i})}function Kg(i){if(i!=null){var e;let t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});let r=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,r,r)}return this}var Bt=Pt("activeRequests"),Tt=Pt("queuedHandlers"),Nt=Pt("paused"),rs=Pt("pauseTimer"),Et=Pt("downLimit"),ss=Pt("upperLimit"),Xi=Pt("rateLimitingTimer"),xo=Pt("call"),Yi=Pt("queueNext"),Ch=Pt("next"),Ah=Pt("queue"),Fh=Pt("dequeue"),Ph=Pt("resume"),ns=Pt("increaseLimit"),ul=class{constructor(e){Object.defineProperty(this,Fh,{value:wE}),Object.defineProperty(this,Ah,{value:yE}),Object.defineProperty(this,Ch,{value:bE}),Object.defineProperty(this,Yi,{value:vE}),Object.defineProperty(this,xo,{value:gE}),Object.defineProperty(this,Bt,{writable:!0,value:0}),Object.defineProperty(this,Tt,{writable:!0,value:[]}),Object.defineProperty(this,Nt,{writable:!0,value:!1}),Object.defineProperty(this,rs,{writable:!0,value:void 0}),Object.defineProperty(this,Et,{writable:!0,value:1}),Object.defineProperty(this,ss,{writable:!0,value:void 0}),Object.defineProperty(this,Xi,{writable:!0,value:void 0}),Object.defineProperty(this,Ph,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,ns,{writable:!0,value:()=>{if(te(this,Nt)[Nt]){te(this,Xi)[Xi]=setTimeout(te(this,ns)[ns],0);return}te(this,Et)[Et]=this.limit,this.limit=Math.ceil((te(this,ss)[ss]+te(this,Et)[Et])/2);for(let t=te(this,Et)[Et];t<=this.limit;t++)te(this,Yi)[Yi]();te(this,ss)[ss]-te(this,Et)[Et]>3?te(this,Xi)[Xi]=setTimeout(te(this,ns)[ns],2e3):te(this,Et)[Et]=Math.floor(te(this,Et)[Et]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!te(this,Nt)[Nt]&&te(this,Bt)[Bt]<this.limit?te(this,xo)[xo](e):te(this,Ah)[Ah](e,t)}wrapSyncFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];let a=r.run(()=>(e(...n),queueMicrotask(()=>a.done()),()=>{}),t);return{abortOn:Kg,abort(){a.abort()}}}}wrapPromiseFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];let a,l=new Promise((c,d)=>{a=r.run(()=>{let f,y;try{y=Promise.resolve(e(...n))}catch(v){y=Promise.reject(v)}return y.then(v=>{f?d(f):(a.done(),c(v))},v=>{f?d(f):(a.done(),d(v))}),v=>{f=mE(v)}},t)});return l.abort=c=>{a.abort(c)},l.abortOn=Kg,l}}resume(){te(this,Nt)[Nt]=!1,clearTimeout(te(this,rs)[rs]);for(let e=0;e<this.limit;e++)te(this,Yi)[Yi]()}pause(e){e===void 0&&(e=null),te(this,Nt)[Nt]=!0,clearTimeout(te(this,rs)[rs]),e!=null&&(te(this,rs)[rs]=setTimeout(te(this,Ph)[Ph],e))}rateLimit(e){clearTimeout(te(this,Xi)[Xi]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(te(this,ss)[ss]=this.limit-1,this.limit=te(this,Et)[Et],te(this,Xi)[Xi]=setTimeout(te(this,ns)[ns],e))}get isPaused(){return te(this,Nt)[Nt]}};function gE(i){te(this,Bt)[Bt]+=1;let e=!1,t;try{t=i()}catch(r){throw te(this,Bt)[Bt]-=1,r}return{abort:r=>{e||(e=!0,te(this,Bt)[Bt]-=1,t?.(r),te(this,Yi)[Yi]())},done:()=>{e||(e=!0,te(this,Bt)[Bt]-=1,te(this,Yi)[Yi]())}}}function vE(){queueMicrotask(()=>te(this,Ch)[Ch]())}function bE(){if(te(this,Nt)[Nt]||te(this,Bt)[Bt]>=this.limit||te(this,Tt)[Tt].length===0)return;let i=te(this,Tt)[Tt].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=te(this,xo)[xo](i.fn);i.abort=e.abort,i.done=e.done}function yE(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{te(this,Fh)[Fh](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=te(this,Tt)[Tt].findIndex(s=>t.priority>s.priority);return r===-1?te(this,Tt)[Tt].push(t):te(this,Tt)[Tt].splice(r,0,t),t}function wE(i){let e=te(this,Tt)[Tt].indexOf(i);e!==-1&&te(this,Tt)[Tt].splice(e,1)}var hl=Symbol("__queue");var _h=class extends Error{constructor(e,t){t===void 0&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}},$s=_h;function SE(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}var Xg=SE;function Kt(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var EE=0;function dl(i){return"__private_"+EE+++"_"+i}var Zi=dl("aliveTimer"),os=dl("isDone"),ko=dl("onTimedOut"),as=dl("timeout"),Oh=class{constructor(e,t){Object.defineProperty(this,Zi,{writable:!0,value:void 0}),Object.defineProperty(this,os,{writable:!0,value:!1}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,as,{writable:!0,value:void 0}),Kt(this,as)[as]=e,Kt(this,ko)[ko]=()=>t(e)}progress(){Kt(this,os)[os]||Kt(this,as)[as]>0&&(clearTimeout(Kt(this,Zi)[Zi]),Kt(this,Zi)[Zi]=setTimeout(Kt(this,ko)[ko],Kt(this,as)[as]))}done(){Kt(this,os)[os]||(clearTimeout(Kt(this,Zi)[Zi]),Kt(this,Zi)[Zi]=void 0,Kt(this,os)[os]=!0)}},Yg=Oh;var pl=()=>{};function Zg(i,e){e===void 0&&(e={});let{body:t=null,headers:r={},method:s="GET",onBeforeRequest:n=pl,onUploadProgress:o=pl,shouldRetry:a=()=>!0,onAfterResponse:l=pl,onTimeout:c=pl,responseType:d,retries:f=3,signal:y=null,timeout:v=3e4,withCredentials:x=!1}=e,P=D=>.3*2**(D-1)*1e3,C=new Yg(v,c);function I(D){return D===void 0&&(D=0),new Promise(async(q,M)=>{let H=new XMLHttpRequest;H.open(s,i,!0),H.withCredentials=x,d&&(H.responseType=d),y?.addEventListener("abort",()=>{H.abort(),M(new DOMException("Aborted","AbortError"))}),H.onload=async()=>{await l(H,D),H.status>=200&&H.status<300?(C.done(),q(H)):a(H)&&D<f?setTimeout(()=>{I(D+1).then(q,M)},P(D)):(C.done(),M(new $s(H.statusText,H)))},H.onerror=()=>{a(H)&&D<f?setTimeout(()=>{I(D+1).then(q,M)},P(D)):(C.done(),M(new $s(H.statusText,H)))},H.upload.onprogress=R=>{C.progress(),o(R)},r&&Object.keys(r).forEach(R=>{H.setRequestHeader(R,r[R])}),await n(H,D),H.send(t)})}return I()}function Qg(i){let e=t=>"error"in t&&!!t.error;return i.filter(t=>!e(t))}function Jg(i){return i.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}function fl(i,e){return i===!0?Object.keys(e):Array.isArray(i)?i:[]}var ev={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function Qi(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var TE=0;function Vs(i){return"__private_"+TE+++"_"+i}var xE={version:"4.2.3"};function kE(i,e){let t=e;return t||(t=new Error("Upload error")),typeof t=="string"&&(t=new Error(t)),t instanceof Error||(t=Object.assign(new Error("Upload error"),{data:t})),Xg(i)?(t=new $s(t,i),t):(t.request=i,t)}function tv(i){return i.data.slice(0,i.data.size,i.meta.type)}var AE={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""},ls=Vs("getFetcher"),Mh=Vs("uploadLocalFile"),Rh=Vs("uploadBundle"),Ih=Vs("getCompanionClientArgs"),Lh=Vs("uploadFiles"),Ao=Vs("handleUpload"),qs=class extends Hr{constructor(e,t){if(super(e,{...AE,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,Lh,{value:_E}),Object.defineProperty(this,Ih,{value:FE}),Object.defineProperty(this,Rh,{value:CE}),Object.defineProperty(this,Mh,{value:PE}),Object.defineProperty(this,ls,{writable:!0,value:void 0}),Object.defineProperty(this,Ao,{writable:!0,value:async r=>{if(r.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[hl]&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");let s=this.uppy.getFilesByIds(r),n=Qg(s),o=Jg(n);if(this.uppy.emit("upload-start",o),this.opts.bundle){if(n.some(l=>l.isRemote))throw new Error("Can\u2019t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await Qi(this,Rh)[Rh](n)}else await Qi(this,Lh)[Lh](n)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=ev,this.i18nInit(),hl in this.opts?this.requests=this.opts[hl]:this.requests=new ul(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(t?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),Qi(this,ls)[ls]=r=>async(s,n)=>{try{var o,a,l;let d=await Zg(s,{...n,onBeforeRequest:(v,x)=>{var P,C;return(P=(C=this.opts).onBeforeRequest)==null?void 0:P.call(C,v,x,r)},shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:v=>{let x=Math.ceil(v/1e3),P=new Error(this.i18n("uploadStalled",{seconds:x}));this.uppy.emit("upload-stalled",P,r)},onUploadProgress:v=>{if(v.lengthComputable)for(let{id:P}of r){var x;let C=this.uppy.getFile(P);this.uppy.emit("upload-progress",C,{uploadStarted:(x=C.progress.uploadStarted)!=null?x:0,bytesUploaded:v.loaded/v.total*C.size,bytesTotal:C.size})}}}),f=await((o=(a=this.opts).getResponseData)==null?void 0:o.call(a,d));try{var c;(c=f)!=null||(f=JSON.parse(d.responseText))}catch(v){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:v})}let y=typeof((l=f)==null?void 0:l.url)=="string"?f.url:void 0;for(let{id:v}of r)this.uppy.emit("upload-success",this.uppy.getFile(v),{status:d.status,body:f,uploadURL:y});return d}catch(d){if(d.name==="AbortError")return;if(d instanceof $s){let f=d.request;for(let y of r)this.uppy.emit("upload-error",this.uppy.getFile(y.id),kE(f,d),f)}throw d}}}getOptions(e){let t=this.uppy.getState().xhrUpload,{headers:r}=this.opts,s={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return typeof r=="function"?s.headers=r(e):Object.assign(s.headers,this.opts.headers),t&&Object.assign(s.headers,t.headers),e.xhrUpload&&Object.assign(s.headers,e.xhrUpload.headers),s}addMetadata(e,t,r){fl(r.allowedMetaFields,t).forEach(n=>{let o=t[n];Array.isArray(o)?o.forEach(a=>e.append(n,a)):e.append(n,o)})}createFormDataUpload(e,t){let r=new FormData;this.addMetadata(r,e.meta,t);let s=tv(e);return e.name?r.append(t.fieldName,s,e.meta.name):r.append(t.fieldName,s),r}createBundledUpload(e,t){let r=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(r,s,t),e.forEach(n=>{let o=this.getOptions(n),a=tv(n);n.name?r.append(o.fieldName,a,n.name):r.append(o.fieldName,a)}),r}install(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(Qi(this,Ao)[Ao])}uninstall(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(Qi(this,Ao)[Ao])}};async function PE(i){let e=new To(this.uppy),t=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{let s=this.getOptions(i),n=Qi(this,ls)[ls]([i]),o=s.formData?this.createFormDataUpload(i,s):i.data;return n(s.endpoint,{...s,body:o,signal:t.signal})});e.onFileRemove(i.id,()=>t.abort()),e.onCancelAll(i.id,()=>{t.abort()});try{await r().abortOn(t.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{e.remove()}}async function CE(i){let e=new AbortController,t=this.requests.wrapPromiseFunction(async()=>{var s;let n=(s=this.uppy.getState().xhrUpload)!=null?s:{},o=Qi(this,ls)[ls](i),a=this.createBundledUpload(i,{...this.opts,...n});return o(this.opts.endpoint,{...this.opts,body:a,signal:e.signal})});function r(){e.abort()}this.uppy.once("cancel-all",r);try{await t().abortOn(e.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{this.uppy.off("cancel-all",r)}}function FE(i){var e;let t=this.getOptions(i),r=fl(t.allowedMetaFields,i.meta);return{...(e=i.remote)==null?void 0:e.body,protocol:"multipart",endpoint:t.endpoint,size:i.data.size,fieldname:t.fieldName,metadata:Object.fromEntries(r.map(s=>[s,i.meta[s]])),httpMethod:t.method,useFormData:t.formData,headers:t.headers}}async function _E(i){await Promise.allSettled(i.map(e=>{if(e.isRemote){let t=()=>this.requests,r=new AbortController,s=o=>{o.id===e.id&&r.abort()};this.uppy.on("file-removed",s);let n=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,Qi(this,Ih)[Ih](e),{signal:r.signal,getQueue:t});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",s)},{priority:-1})(),n}return Qi(this,Mh)[Mh](e)}))}qs.VERSION=xE.version;var ct=class{static fromTemplate(i){if(Ts.isSupported)return Ts.sanitize(i,{USE_PROFILES:{html:!0,svg:!0},RETURN_DOM:!0}).children[0];{let e=new DOMParser().parseFromString(i,"text/html").body.children[0];return OE(e)}}};function OE(i){return RE(i),iv(i),i}function RE(i){let e=i.querySelectorAll("script");for(let t of e)t.remove()}function LE(i,e){let t=e.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(i)&&(t.includes("javascript:")||t.includes("data:"))||i.startsWith("on"))return!0}function ME(i){let e=i.attributes;for(let{name:t,value:r}of e)LE(t,r)&&i.removeAttribute(t)}function iv(i){let e=i.children;for(let t of e)ME(t),iv(t)}var ml=class extends re{static values={identifier:String,maxFileSize:{type:Number,default:null},minFileSize:{type:Number,default:null},maxTotalSize:{type:Number,default:null},maxFileNum:{type:Number,default:null},minFileNum:{type:Number,default:null},allowedFileTypes:{type:Array,default:null},requiredMetaFields:{type:Array,default:[]}};static outlets=["attachment-preview","attachment-preview-container"];connect(){this.uploadedFiles=[],this.element.style.display="none",this.configureUppy(),this.#n(),this.#r()}disconnect(){this.uppy=null}attachmentPreviewOutletConnected(i,e){this.#r()}attachmentPreviewOutletDisconnected(i,e){this.#r()}configureUppy(){this.uppy=new Jc({restrictions:{maxFileSize:this.maxFileSizeValue,minFileSize:this.minFileSizeValue,maxTotalFileSize:this.maxTotalSizeValue,maxNumberOfFiles:this.maxFileNumValue,minNumberOfFiles:this.minFileNumValue,allowedFileTypes:this.allowedFileTypesValue,requiredMetaFields:this.requiredMetaFieldsValue}}).use(fr,{inline:!1,closeAfterFinish:!0}).use(is,{target:fr}),this.#e(),this.#t()}#e(){this.uppy.use(qs,{endpoint:"/upload"})}#t(){this.uppy.on("upload-success",this.#s.bind(this))}#i(){let i=document.documentElement.getAttribute("data-bs-theme")||"auto";this.#o.setOptions({theme:i});let e=null;for(;e=this.uploadedFiles.pop();)this.uppy.removeFile(e.id);this.#o.openModal()}#s(i,e){this.uploadedFiles.push(i),this.multiple||this.attachmentPreviewOutlets.forEach(s=>s.remove());let t=e.body.data,r=e.body.url;this.attachmentPreviewContainerOutlet.element.appendChild(this.#l(t,r))}#r(){if(!this.deleteAllTrigger)return;this.attachmentPreviewOutlets.length>1?(this.deleteAllTrigger.style.display="initial",this.deleteAllTrigger.textContent=`Delete ${this.attachmentPreviewOutlets.length}`):this.deleteAllTrigger.style.display="none"}#n(){this.triggerContainer=document.createElement("div"),this.triggerContainer.className="flex items-center gap-2",this.element.insertAdjacentElement("afterend",this.triggerContainer),this.#a(),this.uploadTrigger&&this.triggerContainer.append(this.uploadTrigger),this.deleteAllTrigger&&this.triggerContainer.append(this.deleteAllTrigger)}#a(){let i=this.multiple?"Choose files":"Choose file";this.uploadTrigger=ct.fromTemplate(`<button type="button" class="text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700 inline-flex items-center">
71
+ ${s.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:e}=this.opts;e&&this.mount(e,this)}};jr.VERSION=U1.version;var z1=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function H1(i,e,t){var r,s;let n=z1.exec(i),o=(r=(s=e.mimeType)!=null?s:n?.[1])!=null?r:"plain/text",a;if(n?.[2]!=null){let l=atob(decodeURIComponent(n[3])),c=new Uint8Array(l.length);for(let d=0;d<l.length;d++)c[d]=l.charCodeAt(d);a=[c]}else n?.[3]!=null&&(a=[decodeURIComponent(n[3])]);return t?new File(a,e.name||"",{type:o}):new Blob(a,{type:o})}var km=H1;function za(i){return i.startsWith("blob:")}function Ha(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function ve(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Mm=typeof self<"u"?self:global,Kn=typeof navigator<"u",$1=Kn&&typeof HTMLImageElement>"u",Am=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),Im=Mm.Buffer,Dm=!!Im,q1=i=>i!==void 0;function Nm(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(q1).length===0)}function it(i){let e=new Error(i);throw delete e.stack,e}function Pm(i){let e=function(t){let r=0;return t.ifd0.enabled&&(r+=1024),t.exif.enabled&&(r+=2048),t.makerNote&&(r+=2048),t.userComment&&(r+=1024),t.gps.enabled&&(r+=512),t.interop.enabled&&(r+=100),t.ifd1.enabled&&(r+=1024),r+2048}(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}var bu=i=>String.fromCharCode.apply(null,i),Cm=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,Gr=class i{static from(e,t){return e instanceof this&&e.le===t?e:new i(e,void 0,void 0,t)}constructor(e,t=0,r,s){if(typeof s=="boolean"&&(this.le=s),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){r===void 0&&(r=e.byteLength-t);let n=new DataView(e,t,r);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof i){r===void 0&&(r=e.byteLength-t),(t+=e.byteOffset)+r>e.byteOffset+e.byteLength&&it("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,r);this._swapDataView(n)}else if(typeof e=="number"){let n=new DataView(new ArrayBuffer(e));this._swapDataView(n)}else it("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,r=i){return e instanceof DataView||e instanceof i?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||it("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new r(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new i(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return s=this.getUint8Array(e,t),Cm?Cm.decode(s):Dm?Buffer.from(s).toString("utf8"):decodeURIComponent(escape(bu(s)));var s}getLatin1String(e=0,t=this.byteLength){let r=this.getUint8Array(e,t);return bu(r)}getUnicodeString(e=0,t=this.byteLength){let r=[];for(let s=0;s<t&&e+s<this.byteLength;s+=2)r.push(this.getUint16(e+s));return bu(r)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,r){switch(t){case 1:return this.getUint8(e,r);case 2:return this.getUint16(e,r);case 4:return this.getUint32(e,r);case 8:return this.getUint64&&this.getUint64(e,r)}}getUint(e,t,r){switch(t){case 8:return this.getUint8(e,r);case 16:return this.getUint16(e,r);case 32:return this.getUint32(e,r);case 64:return this.getUint64&&this.getUint64(e,r)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function wu(i,e){it(`${i} '${e}' was not loaded, try using full build of exifr.`)}var Xn=class extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||wu(this.kind,e),t&&(e in t||function(r,s){it(`Unknown ${r} '${s}'.`)}(this.kind,e),t[e].enabled||wu(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},Wa=new Xn("file parser"),Nt=new Xn("segment parser"),Qn=new Xn("file reader"),V1=Mm.fetch;function Fm(i,e){return(t=i).startsWith("data:")||t.length>1e4?Tu(i,e,"base64"):Am&&i.includes("://")?Su(i,e,"url",$a):Am?Tu(i,e,"fs"):Kn?Su(i,e,"url",$a):void it("Invalid input argument");var t}async function Su(i,e,t,r){return Qn.has(t)?Tu(i,e,t):r?async function(s,n){let o=await n(s);return new Gr(o)}(i,r):void it(`Parser ${t} is not loaded`)}async function Tu(i,e,t){let r=new(Qn.get(t))(i,e);return await r.read(),r}var $a=i=>V1(i).then(e=>e.arrayBuffer()),Yn=i=>new Promise((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result||new ArrayBuffer),r.onerror=t,r.readAsArrayBuffer(i)}),Eu=class extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}};function Bm(i,e,t){let r=new Eu;for(let[s,n]of t)r.set(s,n);if(Array.isArray(e))for(let s of e)i.set(s,r);else i.set(e,r);return r}function Um(i,e,t){let r,s=i.get(e);for(r of t)s.set(r[0],r[1])}var Jn=new Map,Cu=new Map,Fu=new Map,Ls=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Ga=["jfif","xmp","icc","iptc","ihdr"],Zn=["tiff",...Ga],Ve=["ifd0","ifd1","exif","gps","interop"],Ms=[...Zn,...Ve],Is=["makerNote","userComment"],Ka=["translateKeys","translateValues","reviveValues","multiSegment"],Ds=[...Ka,"sanitize","mergeOutput","silentErrors"],qa=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},Wr=class extends qa{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,r,s){if(super(),ve(this,"enabled",!1),ve(this,"skip",new Set),ve(this,"pick",new Set),ve(this,"deps",new Set),ve(this,"translateKeys",!1),ve(this,"translateValues",!1),ve(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(s),this.canBeFiltered=Ve.includes(e),this.canBeFiltered&&(this.dict=Jn.get(e)),r!==void 0)if(Array.isArray(r))this.parse=this.enabled=!0,this.canBeFiltered&&r.length>0&&this.translateTagSet(r,this.pick);else if(typeof r=="object"){if(this.enabled=!0,this.parse=r.parse!==!1,this.canBeFiltered){let{pick:n,skip:o}=r;n&&n.length>0&&this.translateTagSet(n,this.pick),o&&o.length>0&&this.translateTagSet(o,this.skip)}this.applyInheritables(r)}else r===!0||r===!1?this.parse=this.enabled=r:it(`Invalid options argument: ${r}`)}applyInheritables(e){let t,r;for(t of Ka)r=e[t],r!==void 0&&(this[t]=r)}translateTagSet(e,t){if(this.dict){let r,s,{tagKeys:n,tagValues:o}=this.dict;for(r of e)typeof r=="string"?(s=o.indexOf(r),s===-1&&(s=n.indexOf(Number(r))),s!==-1&&t.add(Number(n[s]))):t.add(r)}else for(let r of e)t.add(r)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Va(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Va(this.pick,this.deps)}},St={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},_m=new Map,Kr=class extends qa{static useCached(e){let t=_m.get(e);return t!==void 0||(t=new this(e),_m.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):it(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Kn?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Ls)this[e]=St[e];for(e of Ds)this[e]=St[e];for(e of Is)this[e]=St[e];for(e of Ms)this[e]=new Wr(e,St[e],void 0,this)}setupFromTrue(){let e;for(e of Ls)this[e]=St[e];for(e of Ds)this[e]=St[e];for(e of Is)this[e]=!0;for(e of Ms)this[e]=new Wr(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Ls)this[t]=St[t];for(t of Ds)this[t]=St[t];for(t of Is)this[t]=St[t];for(t of Ms)this[t]=new Wr(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ve)}setupFromObject(e){let t;for(t of(Ve.ifd0=Ve.ifd0||Ve.image,Ve.ifd1=Ve.ifd1||Ve.thumbnail,Object.assign(this,e),Ls))this[t]=yu(e[t],St[t]);for(t of Ds)this[t]=yu(e[t],St[t]);for(t of Is)this[t]=yu(e[t],St[t]);for(t of Zn)this[t]=new Wr(t,St[t],e[t],this);for(t of Ve)this[t]=new Wr(t,St[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ve,Ms),e.tiff===!0?this.batchEnableWithBool(Ve,!0):e.tiff===!1?this.batchEnableWithUserValue(Ve,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ve):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ve)}batchEnableWithBool(e,t){for(let r of e)this[r].enabled=t}batchEnableWithUserValue(e,t){for(let r of e){let s=t[r];this[r].enabled=s!==!1&&s!==void 0}}setupGlobalFilters(e,t,r,s=r){if(e&&e.length){for(let o of s)this[o].enabled=!1;let n=Om(e,r);for(let[o,a]of n)Va(this[o].pick,a),this[o].enabled=!0}else if(t&&t.length){let n=Om(t,r);for(let[o,a]of n)Va(this[o].skip,a)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:r,iptc:s,icc:n}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),r.enabled||e.skip.add(700),s.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:r,interop:s}=this;s.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),r.needed&&e.deps.add(34853),this.tiff.enabled=Ve.some(n=>this[n].enabled===!0)||this.makerNote||this.userComment;for(let n of Ve)this[n].finalizeFilters()}get onlyTiff(){return!Ga.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of Zn)this[e].enabled&&!Nt.has(e)&&wu("segment parser",e)}};function Om(i,e){let t,r,s,n,o=[];for(s of e){for(n of(t=Jn.get(s),r=[],t))(i.includes(n[0])||i.includes(n[1]))&&r.push(n[0]);r.length&&o.push([s,r])}return o}function yu(i,e){return i!==void 0?i:e!==void 0?e:void 0}function Va(i,e){for(let t of e)i.add(t)}ve(Kr,"default",St);var Ns=class{constructor(e){ve(this,"parsers",{}),ve(this,"output",{}),ve(this,"errors",[]),ve(this,"pushToErrors",t=>this.errors.push(t)),this.options=Kr.useCached(e)}async read(e){this.file=await function(t,r){return typeof t=="string"?Fm(t,r):Kn&&!$1&&t instanceof HTMLImageElement?Fm(t.src,r):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Gr(t):Kn&&t instanceof Blob?Su(t,r,"blob",Yn):void it("Invalid input argument")}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[r,s]of Wa)if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[r]=!0;this.file.close&&this.file.close(),it("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),Nm(r=e)?void 0:r;var r}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async r=>{let s=await r.parse();r.assignToOutput(e,s)});this.options.silentErrors&&(t=t.map(r=>r.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,r=Nt.get("tiff",e);var s;if(t.tiff?s={start:0,type:"tiff"}:t.jpeg&&(s=await this.fileParser.getOrFindSegment("tiff")),s===void 0)return;let n=await this.fileParser.ensureSegmentChunk(s),o=this.parsers.tiff=new r(n,e,t),a=await o.extractThumbnail();return t.close&&t.close(),a}};async function zm(i,e){let t=new Ns(e);return await t.read(i),t.parse()}var j1=Object.freeze({__proto__:null,parse:zm,Exifr:Ns,fileParsers:Wa,segmentParsers:Nt,fileReaders:Qn,tagKeys:Jn,tagValues:Cu,tagRevivers:Fu,createDictionary:Bm,extendDictionary:Um,fetchUrlAsArrayBuffer:$a,readBlobAsArrayBuffer:Yn,chunkedProps:Ls,otherSegments:Ga,segments:Zn,tiffBlocks:Ve,segmentsAndBlocks:Ms,tiffExtractables:Is,inheritables:Ka,allFormatters:Ds,Options:Kr}),fr=class{static findPosition(e,t){let r=e.getUint16(t+2)+2,s=typeof this.headerLength=="function"?this.headerLength(e,t,r):this.headerLength,n=t+s,o=r-s;return{offset:t,length:r,headerLength:s,start:n,size:o,end:n+o}}static parse(e,t={}){return new this(e,new Kr({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Gr?e:new Gr(e)}constructor(e,t={},r){ve(this,"errors",[]),ve(this,"raw",new Map),ve(this,"handleError",s=>{if(!this.options.silentErrors)throw s;this.errors.push(s.message)}),this.chunk=this.normalizeInput(e),this.file=r,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let r=Fu.get(t),s=Cu.get(t),n=Jn.get(t),o=this.options[t],a=o.reviveValues&&!!r,l=o.translateValues&&!!s,c=o.translateKeys&&!!n,d={};for(let[p,y]of e)a&&r.has(p)?y=r.get(p)(y):l&&s.has(p)&&(y=this.translateValue(y,s.get(p))),c&&n.has(p)&&(p=n.get(p)||p),d[p]=y;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,r){if(this.globalOptions.mergeOutput)return Object.assign(e,r);e[t]?Object.assign(e[t],r):e[t]=r}};ve(fr,"headerLength",4),ve(fr,"type",void 0),ve(fr,"multiSegment",!1),ve(fr,"canHandle",()=>!1);function W1(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function G1(i){return i>=224&&i<=239}function K1(i,e,t){for(let[r,s]of Nt)if(s.canHandle(i,e,t))return r}var ja=class extends class{constructor(e,t,r){ve(this,"errors",[]),ve(this,"ensureSegmentChunk",async s=>{let n=s.start,o=s.size||65536;if(this.file.chunked)if(this.file.available(n,o))s.chunk=this.file.subarray(n,o);else try{s.chunk=await this.file.readChunk(n,o)}catch(a){it(`Couldn't read segment: ${JSON.stringify(s)}. ${a.message}`)}else this.file.byteLength>n+o?s.chunk=this.file.subarray(n,o):s.size===void 0?s.chunk=this.file.subarray(n):it("Segment unreachable: "+JSON.stringify(s));return s.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=r}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let r=new(Nt.get(e))(t,this.options,this.file);return this.parsers[e]=r}createParsers(e){for(let t of e){let{type:r,chunk:s}=t,n=this.options[r];if(n&&n.enabled){let o=this.parsers[r];o&&o.append||o||this.createParser(r,s)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),ve(this,"appSegments",[]),ve(this,"jpegSegments",[]),ve(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Nt.keyList())):(e=e===void 0?Nt.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&Nt.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:r,findAll:s,wanted:n,remaining:o}=this;if(!s&&this.file.chunked&&(s=Array.from(n).some(a=>{let l=Nt.get(a),c=this.options[a];return l.multiSegment&&c.multiSegment}),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,r.byteLength),!this.options.onlyTiff&&r.chunked){let a=!1;for(;o.size>0&&!a&&(r.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=r,c=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(a=e>l&&!c?!await r.readNextChunk(e):!await r.readNextChunk(l),(e=this.findAppSegmentsInRange(e,r.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let r,s,n,o,a,l,{file:c,findAll:d,wanted:p,remaining:y,options:v}=this;for(;e<t;e++)if(c.getUint8(e)===255){if(r=c.getUint8(e+1),G1(r)){if(s=c.getUint16(e+2),n=K1(c,e,s),n&&p.has(n)&&(o=Nt.get(n),a=o.findPosition(c,e),l=v[n],a.type=n,this.appSegments.push(a),!d&&(o.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||y.delete(n)):y.delete(n),y.size===0)))break;v.recordUnknownSegments&&(a=fr.findPosition(c,e),a.marker=r,this.unknownSegments.push(a)),e+=s+1}else if(W1(r)){if(s=c.getUint16(e+2),r===218&&v.stopAfterSos!==!1)return;v.recordJpegSegments&&this.jpegSegments.push({offset:e,length:s,marker:r}),e+=s+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,r){let s,n,o,a=new Map;for(let l=0;l<t.length;l++)s=t[l],n=s[r],a.has(n)?o=a.get(n):a.set(n,o=[]),o.push(s);return Array.from(a)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,r])=>{let s=Nt.get(t,this.options);return s.handleMultiSegments?{type:t,chunk:s.handleMultiSegments(r)}:r[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return t===void 0&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}};ve(ja,"type","jpeg"),Wa.set("jpeg",ja);var X1=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],xu=class extends fr{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,r=new Map){let{pick:s,skip:n}=this.options[t];s=new Set(s);let o=s.size>0,a=n.size===0,l=this.chunk.getUint16(e);e+=2;for(let c=0;c<l;c++){let d=this.chunk.getUint16(e);if(o){if(s.has(d)&&(r.set(d,this.parseTag(e,d,t)),s.delete(d),s.size===0))break}else!a&&n.has(d)||r.set(d,this.parseTag(e,d,t));e+=12}return r}parseTag(e,t,r){let{chunk:s}=this,n=s.getUint16(e+2),o=s.getUint32(e+4),a=X1[n];if(a*o<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&it(`Invalid TIFF value type. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&it(`Invalid TIFF value offset. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),n===1)return s.getUint8Array(e,o);if(n===2)return(l=function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c}(l=s.getString(e,o)).trim())===""?void 0:l;var l;if(n===7)return s.getUint8Array(e,o);if(o===1)return this.parseTagValue(n,e);{let c=new(function(p){switch(p){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}(n))(o),d=a;for(let p=0;p<o;p++)c[p]=this.parseTagValue(n,e),e+=d;return c}}parseTagValue(e,t){let{chunk:r}=this;switch(e){case 1:return r.getUint8(t);case 3:return r.getUint16(t);case 4:return r.getUint32(t);case 5:return r.getUint32(t)/r.getUint32(t+4);case 6:return r.getInt8(t);case 8:return r.getInt16(t);case 9:return r.getInt32(t);case 10:return r.getInt32(t)/r.getInt32(t+4);case 11:return r.getFloat(t);case 12:return r.getDouble(t);case 13:return r.getUint32(t);default:it(`Invalid tiff type ${e}`)}}},Gn=class extends xu{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let r=new Map;return this[t]=r,this.parseTags(e,t,r),r}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&it("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&it(`IFD0 offset points to outside of file.
72
+ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,Pm(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,Pm(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let r=e.get(t);r&&r.length===1&&e.set(t,r[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Rm(...e.get(2),e.get(1))),e.set("longitude",Rm(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,r,s={};for(t of Ve)if(e=this[t],!Nm(e))if(r=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(s,r)}else s[t]=r;return this.makerNote&&(s.makerNote=this.makerNote),this.userComment&&(s.userComment=this.userComment),s}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[r,s]of Object.entries(t))this.assignObjectToOutput(e,r,s)}};function Rm(i,e,t,r){var s=i+e/60+t/3600;return r!=="S"&&r!=="W"||(s*=-1),s}ve(Gn,"type","tiff"),ve(Gn,"headerLength",10),Nt.set("tiff",Gn);var kF=Object.freeze({__proto__:null,default:j1,Exifr:Ns,fileParsers:Wa,segmentParsers:Nt,fileReaders:Qn,tagKeys:Jn,tagValues:Cu,tagRevivers:Fu,createDictionary:Bm,extendDictionary:Um,fetchUrlAsArrayBuffer:$a,readBlobAsArrayBuffer:Yn,chunkedProps:Ls,otherSegments:Ga,segments:Zn,tiffBlocks:Ve,segmentsAndBlocks:Ms,tiffExtractables:Is,inheritables:Ka,allFormatters:Ds,Options:Kr,parse:zm}),_u={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},AF=Object.assign({},_u,{firstChunkSize:4e4,gps:[1,2,3,4]});var PF=Object.assign({},_u,{tiff:!1,ifd1:!0,mergeOutput:!1});var Y1=Object.assign({},_u,{firstChunkSize:4e4,ifd0:[274]});async function Z1(i){let e=new Ns(Y1);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}var Q1=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}}),jn=!0,Wn=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,r]=e;jn=Number(t)+.1*Number(r)<13.4,Wn=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);jn=Wn=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);jn=Wn=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);jn=Wn=Number(e)<77}}async function Hm(i){let e=await Z1(i);return Object.assign({canvas:jn,css:Wn},Q1[e])}var ku=class extends Gr{constructor(...e){super(...e),ve(this,"ranges",new Au),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,r){if(e===0&&this.byteLength===0&&r){let s=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(s)}else{let s=e+t;if(s>this.byteLength){let{dataView:n}=this._extend(s);this._swapDataView(n)}}}_extend(e){let t;t=Dm?Im.allocUnsafe(e):new Uint8Array(e);let r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}subarray(e,t,r=!1){return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,r=!1){r&&this._tryExtend(t,e.byteLength,e);let s=super.set(e,t);return this.ranges.add(t,s.byteLength),s}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}},Au=class{constructor(){ve(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let s=e+t,n=this.list.filter(o=>Lm(e,o.offset,s)||Lm(e,o.end,s));if(n.length>0){e=Math.min(e,...n.map(a=>a.offset)),s=Math.max(s,...n.map(a=>a.end)),t=s-e;let o=n.shift();o.offset=e,o.length=t,o.end=s,this.list=this.list.filter(a=>!n.includes(a))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let r=e+t;return this.list.some(s=>s.offset<=e&&r<=s.end)}};function Lm(i,e,t){return i<=e&&e<=t}var Pu=class extends ku{constructor(e,t){super(0),ve(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,r=await this.readChunk(e,t);return!!r&&r.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};Qn.set("blob",class extends Pu{async readWhole(){this.chunked=!1;let i=await Yn(this.input);this._swapArrayBuffer(i)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(i,e){let t=e?i+e:void 0,r=this.input.slice(i,t),s=await Yn(r);return this.set(s,i,!0)}});var $m={strings:{generatingThumbnails:"Generating thumbnails..."}};var J1={version:"4.1.1"};function eS(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(r){if(r.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(r=>{i.toBlob(r,e,t)}).then(r=>{if(r===null)throw new Error("cannot read image, probably an svg with external resources");return r}):Promise.resolve().then(()=>km(i.toDataURL(e,t),{})).then(r=>{if(r===null)throw new Error("could not extract blob, probably an old browser");return r})}function tS(i,e){let t=i.width,r=i.height;(e.deg===90||e.deg===270)&&(t=i.height,r=i.width);let s=document.createElement("canvas");s.width=t,s.height=r;let n=s.getContext("2d");return n.translate(t/2,r/2),e.canvas&&(n.rotate(e.rad),n.scale(e.scaleX,e.scaleY)),n.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),s}function iS(i){let e=i.width/i.height,t=5e6,r=4096,s=Math.floor(Math.sqrt(t*e)),n=Math.floor(t/Math.sqrt(t*e));if(s>r&&(s=r,n=Math.round(s/e)),n>r&&(n=r,s=Math.round(e*n)),i.width>s){let o=document.createElement("canvas");return o.width=s,o.height=n,o.getContext("2d").drawImage(i,0,0,s,n),o}return i}var rS={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},Bs=class extends ui{constructor(e,t){if(super(e,{...rS,...t}),this.onFileAdded=r=>{!r.preview&&r.data&&Ha(r.type)&&!r.isRemote&&this.addToQueue(r.id)},this.onCancelRequest=r=>{let s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1)},this.onFileRemoved=r=>{let s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1),r.preview&&za(r.preview)&&URL.revokeObjectURL(r.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(s=>s.isRestored).forEach(s=>{(!s.preview||za(s.preview))&&this.addToQueue(s.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=r=>{r.forEach(n=>{let o=this.uppy.getFile(n);this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let s=()=>{r.forEach(n=>{let o=this.uppy.getFile(n);this.uppy.emit("preprocess-complete",o)})};return new Promise(n=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{s(),n()}):(s(),n())})},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=$m,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,r){let s=URL.createObjectURL(e.data),n=new Promise((a,l)=>{let c=new Image;c.src=s,c.addEventListener("load",()=>{URL.revokeObjectURL(s),a(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(s),l(d.error||new Error("Could not create thumbnail"))})}),o=Hm(e.data).catch(()=>1);return Promise.all([n,o]).then(a=>{let[l,c]=a,d=this.getProportionalDimensions(l,t,r,c.deg),p=tS(l,c),y=this.resizeImage(p,d.width,d.height);return eS(y,this.thumbnailType,80)}).then(a=>URL.createObjectURL(a))}getProportionalDimensions(e,t,r,s){let n=e.width/e.height;return(s===90||s===270)&&(n=e.height/e.width),t!=null?{width:t,height:Math.round(t/n)}:r!=null?{width:Math.round(r*n),height:r}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(e,t,r){let s=iS(e),n=Math.ceil(Math.log2(s.width/t));n<1&&(n=1);let o=t*2**(n-1),a=r*2**(n-1),l=2;for(;n--;){let c=document.createElement("canvas");c.width=o,c.height=a,c.getContext("2d").drawImage(s,0,0,o,a),s=c,o=Math.round(o/l),a=Math.round(a/l)}return s}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return Ha(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};Bs.VERSION=J1.version;function sS(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&Un(i)?[i]:null}var Ou=sS;var mr=Array.from;function Xa(i,e,t,r){let{onSuccess:s}=r;i.readEntries(n=>{let o=[...e,...n];n.length?queueMicrotask(()=>{Xa(i,o,t,{onSuccess:s})}):s(o)},n=>{t(n),s(e)})}function qm(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,r)=>i.file(t,r))},async*values(){let t=i.createReader();yield*await new Promise(s=>{Xa(t,[],e,{onSuccess:n=>s(n.map(o=>qm(o,e)))})})},isSameEntry:void 0}}function Vm(i,e,t){try{return t===void 0&&(t=void 0),async function*(){let r=()=>`${e}/${i.name}`;if(i.kind==="file"){let s=await i.getFile();s!=null?(s.relativePath=e?r():null,yield s):t!=null&&(yield t)}else if(i.kind==="directory")for await(let s of i.values())yield*Vm(s,e?r():i.name);else t!=null&&(yield t)}()}catch(r){return Promise.reject(r)}}async function*Ru(i,e){let t=await Promise.all(Array.from(i.items,async r=>{var s;let n,o=()=>typeof r.getAsEntry=="function"?r.getAsEntry():r.webkitGetAsEntry();return(s=n)!=null||(n=qm(o(),e)),{fileSystemHandle:n,lastResortFile:r.getAsFile()}}));for(let{lastResortFile:r,fileSystemHandle:s}of t)if(s!=null)try{yield*Vm(s,"",r)}catch(n){r!=null?yield r:e(n)}else r!=null&&(yield r)}function Lu(i){let e=mr(i.files);return Promise.resolve(e)}async function Mu(i,e){var t;let r=(t=e?.logDropError)!=null?t:Function.prototype;try{let s=[];for await(let n of Ru(i,r))s.push(n);return s}catch{return Lu(i)}}var wg=Ce(wt(),1);function eo(i){return{...i,type:i.mimeType,extension:i.name?Ur(i.name).extension:null}}var to,Ue,Iu,jm,io=0,Jm=[],je=Te,Wm=je.__b,Gm=je.__r,Km=je.diffed,Xm=je.__c,Ym=je.unmount,Zm=je.__;function Nu(i,e){je.__h&&je.__h(Ue,i,io||e),io=0;var t=Ue.__H||(Ue.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function di(i){return io=1,nS(tg,i)}function nS(i,e,t){var r=Nu(to++,2);if(r.t=i,!r.__c&&(r.__=[t?t(e):tg(void 0,e),function(a){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,a);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=Ue,!Ue.__f)){var s=function(a,l,c){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(y){return!!y.__c});if(d.every(function(y){return!y.__N}))return!n||n.call(this,a,l,c);var p=r.__c.props!==a;return d.forEach(function(y){if(y.__N){var v=y.__[0];y.__=y.__N,y.__N=void 0,v!==y.__[0]&&(p=!0)}}),n&&n.call(this,a,l,c)||p};Ue.__f=!0;var n=Ue.shouldComponentUpdate,o=Ue.componentWillUpdate;Ue.componentWillUpdate=function(a,l,c){if(this.__e){var d=n;n=void 0,s(a,l,c),n=d}o&&o.call(this,a,l,c)},Ue.shouldComponentUpdate=s}return r.__N||r.__}function ki(i,e){var t=Nu(to++,3);!je.__s&&eg(t.__H,e)&&(t.__=i,t.u=e,Ue.__H.__h.push(t))}function Xr(i){return io=5,Yr(function(){return{current:i}},[])}function Yr(i,e){var t=Nu(to++,7);return eg(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function Zr(i,e){return io=8,Yr(function(){return i},e)}function oS(){for(var i;i=Jm.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Ya),i.__H.__h.forEach(Du),i.__H.__h=[]}catch(e){i.__H.__h=[],je.__e(e,i.__v)}}je.__b=function(i){Ue=null,Wm&&Wm(i)},je.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Zm&&Zm(i,e)},je.__r=function(i){Gm&&Gm(i),to=0;var e=(Ue=i.__c).__H;e&&(Iu===Ue?(e.__h=[],Ue.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(Ya),e.__h.forEach(Du),e.__h=[],to=0)),Iu=Ue},je.diffed=function(i){Km&&Km(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(Jm.push(e)!==1&&jm===je.requestAnimationFrame||((jm=je.requestAnimationFrame)||aS)(oS)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),Iu=Ue=null},je.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Ya),t.__h=t.__h.filter(function(r){return!r.__||Du(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],je.__e(r,t.__v)}}),Xm&&Xm(i,e)},je.unmount=function(i){Ym&&Ym(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{Ya(r)}catch(s){e=s}}),t.__H=void 0,e&&je.__e(e,t.__v))};var Qm=typeof requestAnimationFrame=="function";function aS(i){var e,t=function(){clearTimeout(r),Qm&&cancelAnimationFrame(e),setTimeout(i)},r=setTimeout(t,100);Qm&&(e=requestAnimationFrame(t))}function Ya(i){var e=Ue,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),Ue=e}function Du(i){var e=Ue;i.__c=i.__(),Ue=e}function eg(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}function tg(i,e){return typeof e=="function"?e(i):e}function lS(){return u("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},u("g",{fill:"none","fill-rule":"evenodd"},u("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),u("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),u("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),u("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),u("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),u("path",{d:"M4 4h18v18H4z"})))}function cS(i){let{pluginName:e,i18n:t,onAuth:r}=i,s=e==="Google Drive",n=Zr(o=>{o.preventDefault(),r()},[r]);return u("form",{onSubmit:n},s?u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0},u(lS,null),t("signInWithGoogle")):u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}var uS=i=>{let{pluginName:e,i18n:t,onAuth:r}=i;return u(cS,{pluginName:e,i18n:t,onAuth:r})};function Za(i){let{loading:e,pluginName:t,pluginIcon:r,i18n:s,handleAuth:n,renderForm:o=uS}=i;return u("div",{className:"uppy-Provider-auth"},u("div",{className:"uppy-Provider-authIcon"},r()),u("div",{className:"uppy-Provider-authTitle"},s("authenticateWithTitle",{pluginName:t})),o({pluginName:t,i18n:s,loading:e,onAuth:n}))}var ig=Ce(wt(),1);function Bu(i){let{i18n:e,logout:t,username:r}=i;return u(Mt,null,r&&u("span",{className:"uppy-ProviderBrowser-user",key:"username"},r),u("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function Uu(i){let{openFolder:e,title:t,breadcrumbsIcon:r,breadcrumbs:s,i18n:n}=i;return u("div",{className:"uppy-Provider-breadcrumbs"},u("div",{className:"uppy-Provider-breadcrumbsIcon"},r),s.map((o,a)=>{var l;return u(Mt,null,u("button",{key:o.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(o.id)},o.type==="root"?t:(l=o.data.name)!=null?l:n("unnamed")),s.length===a+1?"":" / ")}))}function zu(i){return u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:(0,ig.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&u(Uu,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),u(Bu,{logout:i.logout,username:i.username,i18n:i.i18n})))}function Hu(){return Hu=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Hu.apply(null,arguments)}var hS={position:"relative",width:"100%",minHeight:"100%"},dS={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},$u=class extends dt{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:r,renderRow:s,overscanCount:n=10,...o}=e,{offset:a,height:l}=this.state,c=Math.floor(a/r),d=Math.floor(l/r);n&&(c=Math.max(0,c-c%n),d+=n);let p=c+d+4,y=t.slice(c,p),v={...hS,height:t.length*r},x={...dS,top:c*r};return u("div",Hu({onScroll:this.handleScroll},o),u("div",{role:"presentation",style:v},u("div",{role:"presentation",style:x},y.map(s))))}},Qa=$u;var rg=Ce(wt(),1);function pS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},u("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function fS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},u("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function mS(){return u("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},u("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),u("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}function Us(i){let{itemIconString:e,alt:t=void 0}=i;if(e===null)return null;switch(e){case"file":return u(pS,null);case"folder":return u(fS,null);case"video":return u(mS,null);default:return u("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function gS(i){var e,t;let{file:r,toggleCheckbox:s,className:n,isDisabled:o,restrictionError:a,showTitles:l,children:c=null,i18n:d}=i;return u("li",{className:n,title:o&&a?a:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:s,name:"listitem",id:r.id,checked:r.status==="checked",disabled:o,"data-uppy-super-focusable":!0}),u("label",{htmlFor:r.id,"aria-label":(e=r.data.name)!=null?e:d("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u(Us,{itemIconString:r.data.thumbnail||r.data.icon}),l&&((t=r.data.name)!=null?t:d("unnamed")),c))}var qu=gS;function Vu(i){var e,t,r;let{file:s,openFolder:n,className:o,isDisabled:a,restrictionError:l,toggleCheckbox:c,showTitles:d,i18n:p}=i;return u("li",{className:o,title:s.status!=="checked"&&l?l:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:c,name:"listitem",id:s.id,checked:s.status==="checked","aria-label":s.data.isFolder?p("allFilesFromFolderNamed",{name:(e=s.data.name)!=null?e:p("unnamed")}):null,disabled:a,"data-uppy-super-focusable":!0}),s.data.isFolder?u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>n(s.id),"aria-label":p("openFolderNamed",{name:(t=s.data.name)!=null?t:p("unnamed")})},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(Us,{itemIconString:s.data.icon})),d&&s.data.name?u("span",null,s.data.name):p("unnamed")):u("label",{htmlFor:s.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(Us,{itemIconString:s.data.icon})),d&&((r=s.data.name)!=null?r:p("unnamed"))))}function ju(i){let{viewType:e,toggleCheckbox:t,showTitles:r,i18n:s,openFolder:n,file:o,utmSource:a}=i,l=o.type==="folder"?null:o.restrictionError,c=!!l&&o.status!=="checked",d={file:o,openFolder:n,toggleCheckbox:t,utmSource:a,i18n:s,viewType:e,showTitles:r,className:(0,rg.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":c},{"uppy-ProviderBrowserItem--noPreview":o.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":o.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":o.status==="partial"}),isDisabled:c,restrictionError:l};switch(e){case"grid":return u(qu,d);case"list":return u(Vu,d);case"unsplash":return u(qu,d,u("a",{href:`${o.data.author.url}?utm_source=${a}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},o.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function vS(i){let{displayedPartialTree:e,viewType:t,toggleCheckbox:r,handleScroll:s,showTitles:n,i18n:o,isLoading:a,openFolder:l,noResultsLabel:c,virtualList:d,utmSource:p}=i,[y,v]=di(!1);if(ki(()=>{let P=R=>{R.key==="Shift"&&v(!1)},F=R=>{R.key==="Shift"&&v(!0)};return document.addEventListener("keyup",P),document.addEventListener("keydown",F),()=>{document.removeEventListener("keyup",P),document.removeEventListener("keydown",F)}},[]),a)return u("div",{className:"uppy-Provider-loading"},typeof a=="string"?a:o("loading"));if(e.length===0)return u("div",{className:"uppy-Provider-empty"},c);let x=P=>u(ju,{viewType:t,toggleCheckbox:F=>{var R;F.stopPropagation(),F.preventDefault(),(R=document.getSelection())==null||R.removeAllRanges(),r(P,y)},showTitles:n,i18n:o,openFolder:l,file:P,utmSource:p});return d?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(Qa,{data:e,renderRow:x,rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:s,role:"listbox",tabIndex:-1},e.map(x)))}var Ja=vS;var bS=(i,e,t,r,s)=>{let n=e.filter(v=>v.isFolder===!0),o=e.filter(v=>v.isFolder===!1),a=t.type==="folder"&&t.status==="checked",l=n.map(v=>({type:"folder",id:v.requestPath,cached:!1,nextPagePath:null,status:a?"checked":"unchecked",parentId:t.id,data:v})),c=o.map(v=>{let x=s(v);return{type:"file",id:v.requestPath,restrictionError:x,status:a&&!x?"checked":"unchecked",parentId:t.id,data:v}}),d={...t,cached:!0,nextPagePath:r};return[...i.map(v=>v.id===d.id?d:v),...l,...c]},sg=bS;var yS=(i,e,t,r,s)=>{let n=i.find(x=>x.id===e),o=t.filter(x=>x.isFolder===!0),a=t.filter(x=>x.isFolder===!1),l={...n,nextPagePath:r},c=i.map(x=>x.id===l.id?l:x),d=l.type==="folder"&&l.status==="checked",p=o.map(x=>({type:"folder",id:x.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:x})),y=a.map(x=>{let P=s(x);return{type:"file",id:x.requestPath,restrictionError:P,status:d&&!P?"checked":"unchecked",parentId:l.id,data:x}});return[...c,...p,...y]},ng=yS;var wS=i=>i.map(e=>({...e})),el=wS;var Wu=(i,e,t)=>{i.filter(s=>s.type!=="root"&&s.parentId===e).forEach(s=>{s.status=t&&!(s.type==="file"&&s.restrictionError)?"checked":"unchecked",Wu(i,s.id,t)})},Gu=(i,e)=>{let t=i.find(o=>o.id===e);if(t.type==="root")return;let r=i.filter(o=>o.type!=="root"&&o.parentId===t.id&&!(o.type==="file"&&o.restrictionError)),s=r.every(o=>o.status==="checked"),n=r.every(o=>o.status==="unchecked");s?t.status="checked":n?t.status="unchecked":t.status="partial",Gu(i,t.parentId)},SS=(i,e)=>{let t=el(i);if(e.length>=2){let r=t.filter(s=>s.type!=="root"&&e.includes(s.id));r.forEach(s=>{s.type==="file"?s.status=s.restrictionError?"unchecked":"checked":s.status="checked"}),r.forEach(s=>{Wu(t,s.id,!0)}),Gu(t,r[0].parentId)}else{let r=t.find(s=>s.id===e[0]);r.status=r.status==="checked"?"unchecked":"checked",Wu(t,r.id,r.status==="checked"),Gu(t,r.parentId)}return t},og=SS;var Xu=Ce(lg(),1);var so=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Yu=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},cg=i=>globalThis.DOMException===void 0?new Yu(i):new DOMException(i),ug=i=>{let e=i.reason===void 0?cg("This operation was aborted."):i.reason;return e instanceof Error?e:cg(e)};function Zu(i,e){let{milliseconds:t,fallback:r,message:s,customTimers:n={setTimeout,clearTimeout}}=e,o,a,c=new Promise((d,p)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:v}=e;v.aborted&&p(ug(v)),a=()=>{p(ug(v))},v.addEventListener("abort",a,{once:!0})}if(t===Number.POSITIVE_INFINITY){i.then(d,p);return}let y=new so;o=n.setTimeout.call(void 0,()=>{if(r){try{d(r())}catch(v){p(v)}return}typeof i.cancel=="function"&&i.cancel(),s===!1?d():s instanceof Error?p(s):(y.message=s??`Promise timed out after ${t} milliseconds`,p(y))},t),(async()=>{try{d(await i)}catch(v){p(v)}})()}).finally(()=>{c.clear(),a&&e.signal&&e.signal.removeEventListener("abort",a)});return c.clear=()=>{n.clearTimeout.call(void 0,o),o=void 0},c}function Qu(i,e,t){let r=0,s=i.length;for(;s>0;){let n=Math.trunc(s/2),o=r+n;t(i[o],e)<=0?(r=++o,s-=n+1):s=n}return r}var no=class{#e=[];enqueue(e,t){t={priority:0,...t};let r={priority:t.priority,id:t.id,run:e};if(this.size===0||this.#e[this.size-1].priority>=t.priority){this.#e.push(r);return}let s=Qu(this.#e,r,(n,o)=>o.priority-n.priority);this.#e.splice(s,0,r)}setPriority(e,t){let r=this.#e.findIndex(n=>n.id===e);if(r===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[s]=this.#e.splice(r,1);this.enqueue(s.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var oo=class extends Xu.default{#e;#t;#i=0;#o;#s;#a=0;#r;#c;#n;#d;#l=0;#p;#u;#g;#v=1n;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:no,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#t=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#o=e.intervalCap,this.#s=e.interval,this.#n=new e.queueClass,this.#d=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#u=e.autoStart===!1}get#h(){return this.#t||this.#i<this.#o}get#b(){return this.#l<this.#p}#f(){this.#l--,this.#m(),this.emit("next")}#y(){this.#x(),this.#E(),this.#c=void 0}get#w(){let e=Date.now();if(this.#r===void 0){let t=this.#a-e;if(t<0)this.#i=this.#e?this.#l:0;else return this.#c===void 0&&(this.#c=setTimeout(()=>{this.#y()},t)),!0}return!1}#m(){if(this.#n.size===0)return this.#r&&clearInterval(this.#r),this.#r=void 0,this.emit("empty"),this.#l===0&&this.emit("idle"),!1;if(!this.#u){let e=!this.#w;if(this.#h&&this.#b){let t=this.#n.dequeue();return t?(this.emit("active"),t(),e&&this.#E(),!0):!1}}return!1}#E(){this.#t||this.#r!==void 0||(this.#r=setInterval(()=>{this.#x()},this.#s),this.#a=Date.now()+this.#s)}#x(){this.#i===0&&this.#l===0&&this.#r&&(clearInterval(this.#r),this.#r=void 0),this.#i=this.#e?this.#l:0,this.#S()}#S(){for(;this.#m(););}get concurrency(){return this.#p}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#p=e,this.#S()}async#k(e){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(e.reason)},{once:!0})})}setPriority(e,t){this.#n.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#v++).toString(),t={timeout:this.timeout,throwOnTimeout:this.#g,...t},new Promise((r,s)=>{this.#n.enqueue(async()=>{this.#l++,this.#i++;try{t.signal?.throwIfAborted();let n=e({signal:t.signal});t.timeout&&(n=Zu(Promise.resolve(n),{milliseconds:t.timeout})),t.signal&&(n=Promise.race([n,this.#k(t.signal)]));let o=await n;r(o),this.emit("completed",o)}catch(n){if(n instanceof so&&!t.throwOnTimeout){r();return}s(n),this.emit("error",n)}finally{this.#f()}},t),this.emit("add"),this.#m()})}async addAll(e,t){return Promise.all(e.map(async r=>this.add(r,t)))}start(){return this.#u?(this.#u=!1,this.#S(),this):this}pause(){this.#u=!0}clear(){this.#n=new this.#d}async onEmpty(){this.#n.size!==0&&await this.#T("empty")}async onSizeLessThan(e){this.#n.size<e||await this.#T("next",()=>this.#n.size<e)}async onIdle(){this.#l===0&&this.#n.size===0||await this.#T("idle")}async#T(e,t){return new Promise(r=>{let s=()=>{t&&!t()||(this.off(e,s),r())};this.on(e,s)})}get size(){return this.#n.size}sizeBy(e){return this.#n.filter(e).length}get pending(){return this.#l}get isPaused(){return this.#u}};var hg=async(i,e,t,r,s)=>{let n=[],o=t.cached?t.nextPagePath:t.id;for(;o;){let p=await r(o);n=n.concat(p.items),o=p.nextPagePath}let a=n.filter(p=>p.isFolder===!0),l=n.filter(p=>p.isFolder===!1),c=a.map(p=>({type:"folder",id:p.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:t.id,data:p})),d=l.map(p=>{let y=s(p);return{type:"file",id:p.requestPath,restrictionError:y,status:y?"unchecked":"checked",parentId:t.id,data:p}});t.cached=!0,t.nextPagePath=null,e.push(...d,...c),c.forEach(async p=>{i.add(()=>hg(i,e,p,r,s))})},xS=async(i,e,t,r)=>{let s=new oo({concurrency:6}),n=el(i);return n.filter(a=>a.type==="folder"&&a.status==="checked"&&(a.cached===!1||a.nextPagePath)).forEach(a=>{s.add(()=>hg(s,n,a,e,t))}),s.on("completed",()=>{let a=n.filter(l=>l.type==="file"&&l.status==="checked").length;r(a)}),await s.onIdle(),n},dg=xS;var Qr={afterOpenFolder:sg,afterScrollFolder:ng,afterToggleCheckbox:og,afterFill:dg};var kS=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:r}=i.target;return e-(t+r)<50},il=kS;var AS=i=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){i.log("Aborting request","warning");return}i.log(e,"error"),e.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(e.message)},"warning",5e3)}},Wi=AS;var PS=(i,e,t,r)=>{let s=e.findIndex(n=>n.id===r);if(s!==-1&&t){let n=e.findIndex(a=>a.id===i);return e.slice(Math.min(s,n),Math.max(s,n)+1).map(a=>a.id)}return[i]},rl=PS;function CS(i){let{searchString:e,setSearchString:t,submitSearchString:r,wrapperClassName:s,inputClassName:n,inputLabel:o,clearSearchLabel:a="",showButton:l=!1,buttonLabel:c="",buttonCSSClassName:d=""}=i,p=x=>{t(x.target.value)},y=Zr(x=>{x.preventDefault(),r()},[r]),[v]=di(()=>{let x=document.createElement("form");return x.setAttribute("tabindex","-1"),x.id=dr(),x});return ki(()=>(document.body.appendChild(v),v.addEventListener("submit",y),()=>{v.removeEventListener("submit",y),document.body.removeChild(v)}),[v,y]),u("section",{className:s},u("input",{className:`uppy-u-reset ${n}`,type:"search","aria-label":o,placeholder:o,value:e,onInput:p,form:v.id,"data-uppy-super-focusable":!0}),!l&&u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},u("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!l&&e&&u("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>t("")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},u("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),l&&u("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:v.id},c))}var zs=CS;var fg=Ce(wt(),1);var FS=i=>i.filter(t=>t.type==="file"&&t.status==="checked"?!0:t.type==="folder"&&t.status==="checked"?!i.some(s=>s.type!=="root"&&s.parentId===t.id):!1).length,pg=FS;function ao(i){let{cancelSelection:e,donePicking:t,i18n:r,partialTree:s,validateAggregateRestrictions:n}=i,o=Yr(()=>n(s),[s,n]),a=Yr(()=>pg(s),[s]);return a===0?null:u("div",{className:"uppy-ProviderBrowser-footer"},u("div",{className:"uppy-ProviderBrowser-footer-buttons"},u("button",{className:(0,fg.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":o}),disabled:!!o,onClick:t,type:"button"},r("selectX",{smart_count:a})),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},r("cancel"))),o&&u("div",{className:"uppy-ProviderBrowser-footer-error"},o))}var _S=(i,e,t)=>{var r,s;return{id:i.id,source:e.id,name:i.name||i.id,type:i.mimeType,isRemote:!0,data:i,preview:i.thumbnail||void 0,meta:{authorName:(r=i.author)==null?void 0:r.name,authorUrl:(s=i.author)==null?void 0:s.url,relativePath:i.relDirPath||null,absolutePath:i.absDirPath},body:{fileId:i.id},remote:{companionUrl:e.opts.companionUrl,url:`${t.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:t.name,provider:t.provider,requestClientId:t.provider}}},mg=_S;var OS=(i,e,t)=>{let r=i.map(o=>mg(o,e,t)),s=[],n=[];r.forEach(o=>{e.uppy.checkIfFileAlreadyExists(ka(o,e.uppy.getID()))?n.push(o):s.push(o)}),s.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:s.length})),n.length>0&&e.uppy.info(`Not adding ${n.length} files because they already exist`),e.uppy.addFiles(s)},sl=OS;var gg=(i,e,t)=>{let r=e===null?"null":e;if(t[r])return t[r];let s=i.find(o=>o.id===e);if(s.type==="root")return[];let n=[...gg(i,s.parentId,t),s];return t[r]=n,n},RS=i=>{let e=Object.create(null);return i.filter(s=>s.type==="file"&&s.status==="checked").map(s=>{let n=gg(i,s.id,e),o=n.findIndex(d=>d.type==="folder"&&d.status==="checked"),a=n.slice(o),l=`/${n.map(d=>d.data.name).join("/")}`,c=a.length===1?void 0:a.map(d=>d.data.name).join("/");return{...s.data,absDirPath:l,relDirPath:c}})},nl=RS;var LS=(i,e)=>{let t=i.find(s=>s.id===e),r=[];for(;r=[t,...r],t.type!=="root";){let s=t.parentId;t=i.find(n=>n.id===s)}return r},vg=LS;function gr(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var MS=0;function yg(i){return"__private_"+MS+++"_"+i}var IS={version:"4.4.2"};function lo(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},u("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var bg=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),Jr=yg("abortController"),pi=yg("withAbort"),Hs=class{constructor(e,t){Object.defineProperty(this,pi,{value:DS}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,Jr,{writable:!0,value:void 0}),this.validateSingleFile=s=>{let n=eo(s);return this.plugin.uppy.validateSingleFile(n)},this.getDisplayedPartialTree=()=>{let{partialTree:s,currentFolderId:n,searchString:o}=this.plugin.getPluginState(),a=s.filter(c=>c.type!=="root"&&c.parentId===n);return o===""?a:a.filter(c=>{var d;return((d=c.data.name)!=null?d:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(o.toLowerCase())!==-1})},this.validateAggregateRestrictions=s=>{let o=s.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(o)},this.plugin=e,this.provider=t.provider;let r={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts={...r,...t},this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState(bg(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:{...r,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async openFolder(e){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),r=t.find(s=>s.id===e);if(r.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),await gr(this,pi)[pi](async s=>{let n=e,o=[];do{let{username:l,nextPagePath:c,items:d}=await this.provider.list(n,{signal:s});this.plugin.setPluginState({username:l}),n=c,o=o.concat(d),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:o.length}))}while(this.opts.loadAllFiles&&n);let a=Qr.afterOpenFolder(t,o,r,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})}).catch(Wi(this.plugin.uppy)),this.setLoading(!1)}async logout(){await gr(this,pi)[pi](async e=>{let t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let r=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(r,"info",7e3)}this.plugin.setPluginState({...bg(this.plugin.rootFolderId),authenticated:!1})}}).catch(Wi(this.plugin.uppy))}async handleAuth(e){await gr(this,pi)[pi](async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),await Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])}).catch(Wi(this.plugin.uppy)),this.setLoading(!1)}async handleScroll(e){let{partialTree:t,currentFolderId:r}=this.plugin.getPluginState(),s=t.find(n=>n.id===r);il(e)&&!this.isHandlingScroll&&s.nextPagePath&&(this.isHandlingScroll=!0,await gr(this,pi)[pi](async n=>{let{nextPagePath:o,items:a}=await this.provider.list(s.nextPagePath,{signal:n}),l=Qr.afterScrollFolder(t,r,a,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})}).catch(Wi(this.plugin.uppy)),this.isHandlingScroll=!1)}async donePicking(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),await gr(this,pi)[pi](async t=>{let r=await Qr.afterFill(e,o=>this.provider.list(o,{signal:t}),this.validateSingleFile,o=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:o}))});if(this.validateAggregateRestrictions(r)){this.plugin.setPluginState({partialTree:r});return}let n=nl(r);sl(n,this.plugin,this.provider),this.resetPluginState()}).catch(Wi(this.plugin.uppy)),this.setLoading(!1)}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),s=rl(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=Qr.afterToggleCheckbox(r,s);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{didFirstRender:r}=this.plugin.getPluginState(),{i18n:s}=this.plugin.uppy;r||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let n={...this.opts,...t},{authenticated:o,loading:a}=this.plugin.getPluginState(),l=this.plugin.icon||lo;if(o===!1)return u(Za,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:n.renderAuthForm,loading:a});let{partialTree:c,currentFolderId:d,username:p,searchString:y}=this.plugin.getPluginState(),v=vg(c,d);return u("div",{className:(0,wg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n.viewType}`)},u(zu,{showBreadcrumbs:n.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:v,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:p,i18n:s}),n.showFilter&&u(zs,{searchString:y,setSearchString:x=>{this.plugin.setPluginState({searchString:x})},submitSearchString:()=>{},inputLabel:s("filter"),clearSearchLabel:s("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(Ja,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:n.virtualList,noResultsLabel:s("noFilesFound"),handleScroll:this.handleScroll,viewType:n.viewType,showTitles:n.showTitles,i18n:this.plugin.uppy.i18n,isLoading:a,utmSource:"Companion"}),u(ao,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};async function DS(i){var e;(e=gr(this,Jr)[Jr])==null||e.abort();let t=new AbortController;gr(this,Jr)[Jr]=t;let r=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",r),this.plugin.uppy.on("cancel-all",r),await i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",r),this.plugin.uppy.off("cancel-all",r),gr(this,Jr)[Jr]=void 0}}Hs.VERSION=IS.version;var Sg=Ce(wt(),1);var NS={version:"4.4.2"},BS={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},US={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},$s=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=r=>{let s=eo(r);return this.plugin.uppy.validateSingleFile(s)},this.getDisplayedPartialTree=()=>{let{partialTree:r}=this.plugin.getPluginState();return r.filter(s=>s.type!=="root")},this.setSearchString=r=>{this.plugin.setPluginState({searchString:r}),r===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=r=>{let n=r.filter(o=>o.type==="file"&&o.status==="checked").map(o=>o.data);return this.plugin.uppy.validateAggregateRestrictions(n)},this.plugin=e,this.provider=t.provider,this.opts={...US,...t},this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(BS)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:{...r,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async search(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let t=await this.provider.search(e),r=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(s=>({type:"file",id:s.requestPath,status:"unchecked",parentId:null,data:s}))];this.plugin.setPluginState({partialTree:r,isInputMode:!1})}catch(t){Wi(this.plugin.uppy)(t)}this.setLoading(!1)}}async handleScroll(e){let{partialTree:t,searchString:r}=this.plugin.getPluginState(),s=t.find(n=>n.type==="root");if(il(e)&&!this.isHandlingScroll&&s.nextPagePath){this.isHandlingScroll=!0;try{let n=await this.provider.search(r,s.nextPagePath),o={...s,nextPagePath:n.nextPageQuery},a=t.filter(c=>c.type!=="root"),l=[o,...a,...n.items.map(c=>({type:"file",id:c.requestPath,status:"unchecked",parentId:null,data:c}))];this.plugin.setPluginState({partialTree:l})}catch(n){Wi(this.plugin.uppy)(n)}this.isHandlingScroll=!1}}async donePicking(){let{partialTree:e}=this.plugin.getPluginState(),t=nl(e);sl(t,this.plugin,this.provider),this.resetPluginState()}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),s=rl(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=Qr.afterToggleCheckbox(r,s);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{isInputMode:r,searchString:s,loading:n,partialTree:o}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,l={...this.opts,...t};return r?u(zs,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):u("div",{className:(0,Sg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&u(zs,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(Ja,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:async()=>{},noResultsLabel:a("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:n,i18n:a,virtualList:!1,utmSource:this.opts.utmSource}),u(ao,{partialTree:o,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};$s.VERSION=NS.version;var Tg=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function zS(i,e){return!!(i===e||Tg(i)&&Tg(e))}function HS(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!zS(i[t],e[t]))return!1;return!0}function Ju(i,e){e===void 0&&(e=HS);var t=null;function r(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];if(t&&t.lastThis===this&&e(s,t.lastArgs))return t.lastResult;var o=i.apply(this,s);return t={lastResult:o,lastArgs:s,lastThis:this},o}return r.clear=function(){t=null},r}var ol=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function co(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function Eg(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function $S(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function qS(i){return i.contains(document.activeElement)}function eh(i,e,t){let r=co(t,e),s=mr(r.querySelectorAll(ol)),n=s.indexOf(document.activeElement);qS(r)?i.shiftKey&&n===0?$S(i,s):!i.shiftKey&&n===s.length-1&&Eg(i,s):Eg(i,s)}function xg(i,e,t){e===null||eh(i,e,t)}var kg=Ce(qc(),1);function th(){let i=!1;return(0,kg.default)((t,r)=>{let s=co(t,r),n=s.contains(document.activeElement);if(n&&i)return;let o=s.querySelector("[data-uppy-super-focusable]");if(!(n&&!o))if(o)o.focus({preventScroll:!0}),i=!0;else{let a=s.querySelector(ol);a?.focus({preventScroll:!0}),i=!1}},260)}var qg=Ce(wt(),1);function ih(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var Fg=Ce(wt(),1);function Ag(i,e){if(i===e)return!0;if(!i||!e)return!1;let t=Object.keys(i),r=Object.keys(e),s=t.length;if(r.length!==s)return!1;for(let n=0;n<s;n++){let o=t[n];if(i[o]!==e[o]||!Object.prototype.hasOwnProperty.call(e,o))return!1}return!0}function jS(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#686DE0",fillRule:"evenodd"},u("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),u("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),u("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function WS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}function GS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}function KS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}function XS(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}function YS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#A7AFB7",fillRule:"nonzero"},u("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),u("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function ZS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}function es(i){let e={color:"#838999",icon:YS()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:ZS()}:t==="image"?{color:"#686de0",icon:jS()}:t==="audio"?{color:"#068dbb",icon:WS()}:t==="video"?{color:"#19af67",icon:GS()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:KS()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:XS()}:e}function uo(i){let{file:e}=i;if(e.preview)return u("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:r}=es(e.type);return u("div",{className:"uppy-Dashboard-Item-previewIconWrap"},u("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},r),u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},u("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}var QS=(i,e)=>(typeof e=="function"?e():e).filter(s=>s.id===i)[0].name;function ho(i){let{file:e,toggleFileCard:t,i18n:r,metaFields:s}=i,{missingRequiredMetaFields:n}=e;if(!(n!=null&&n.length))return null;let o=n.map(a=>QS(a,s)).join(", ");return u("div",{className:"uppy-Dashboard-Item-errorMessage"},r("missingRequiredMetaFields",{smart_count:n.length,fields:o})," ",u("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},r("editFile")))}function rh(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,showLinkToFileUploadResult:n}=i,a=e.preview?"rgba(255, 255, 255, 0.5)":es(e.type).color;return u("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:a}},n&&e.uploadURL&&u("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},u("span",{hidden:!0},e.meta.name)),u(uo,{file:e}),u(ho,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function JS(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function Pg(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function sh(i){return u("div",{className:"uppy-Dashboard-Item-progress"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":Pg(i),title:Pg(i),onClick:()=>JS(i)},i.children))}function al(i){let{children:e}=i;return u("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function nh(i){let{progress:e}=i,t=2*Math.PI*15;return u("g",null,u("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),u("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":t,"stroke-dashoffset":t-t/100*e}))}function oh(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(al,null,u("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),u("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):i.recoveredState?null:i.error&&!i.hideRetryButton?u(sh,i,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},u("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),u("path",{d:"M7.9 3H10v2H7.9z"}),u("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),u("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?u(sh,i,u(al,null,u(nh,{progress:i.file.progress.percentage}),i.file.isPaused?u("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):u("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},u("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),u("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?u(sh,i,u(al,null,u(nh,{progress:i.file.progress.percentage}),u("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(al,null,u(nh,{progress:i.file.progress.percentage}))))}var Cg=Ce(Aa(),1);var ah="...";function ll(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=ah.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-ah.length,r=Math.ceil(t/2),s=Math.floor(t/2);return i.slice(0,r)+ah+i.slice(-s)}var eT=i=>{let{author:e,name:t}=i.file.meta;function r(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return u("div",{className:"uppy-Dashboard-Item-name",title:t},ll(t,r()))},tT=i=>{var e;let{author:t}=i.file.meta,r=(e=i.file.remote)==null?void 0:e.providerName,s="\xB7";return t?u("div",{className:"uppy-Dashboard-Item-author"},u("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},ll(t.name,13)),r?u(Fragment,null,` ${s} `,r,` ${s} `):null):null},iT=i=>i.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},(0,Cg.default)(i.file.size)),rT=i=>i.file.isGhost&&u("span",null," \u2022 ",u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0)},i.i18n("reSelect"))),sT=i=>{let{file:e,onClick:t}=i;return e.error?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function lh(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,toggleAddFilesPanel:n,isSingleFile:o,containerHeight:a,containerWidth:l}=i;return u("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},u("div",{className:"uppy-Dashboard-Item-fileName"},eT({file:e,isSingleFile:o,containerHeight:a,containerWidth:l}),u(sT,{file:e,onClick:()=>alert(e.error)})),u("div",{className:"uppy-Dashboard-Item-status"},tT({file:e}),iT({file:e}),rT({file:e,toggleAddFilesPanel:n,i18n:t})),u(ho,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function ch(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=i,document.body.appendChild(r),r.select();let s=()=>{document.body.removeChild(r),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(r),t()):s()}catch{return document.body.removeChild(r),s()}})}function nT(i){let{file:e,uploadInProgressOrComplete:t,metaFields:r,canEditFile:s,i18n:n,onClick:o}=i;return!t&&r&&r.length>0||!t&&s(e)?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":n("editFileWithFilename",{file:e.meta.name}),title:n("editFileWithFilename",{file:e.meta.name}),onClick:()=>o()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},u("g",{fillRule:"evenodd"},u("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),u("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),u("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function oT(i){let{i18n:e,onClick:t,file:r}=i;return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:r.meta.name}),title:e("removeFile",{file:r.meta.name}),onClick:()=>t()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},u("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),u("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function aT(i){let{file:e,uppy:t,i18n:r}=i,s=n=>{ch(e.uploadURL,r("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(r("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>n.target.focus({preventScroll:!0}))};return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":r("copyLink"),title:r("copyLink"),onClick:n=>s(n)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},u("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}function uh(i){let{uppy:e,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,showLinkToFileUploadResult:o,showRemoveButton:a,i18n:l,toggleFileCard:c,openFileEditor:d}=i;return u("div",{className:"uppy-Dashboard-Item-actionWrapper"},u(nT,{i18n:l,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,onClick:()=>{n&&n.length>0?c(!0,t.id):d(t)}}),o&&t.uploadURL?u(aT,{file:t,uppy:e,i18n:l}):null,a?u(oT,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var po=class extends dt{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Ag(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,r=!!e.progress.uploadComplete&&!t&&!e.error,s=!!e.progress.uploadStarted||!!t,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:a}=e,l=(this.props.individualCancellation||!n)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(l=!0);let c=(0,Fg.default)({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":r,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a});return u("div",{className:c,id:`uppy_${e.id}`,role:this.props.role},u("div",{className:"uppy-Dashboard-Item-preview"},u(rh,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),u(oh,{uppy:this.props.uppy,file:e,error:o,isUploaded:r,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),u("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},u(lh,{file:e,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),u(uh,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:s,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function lT(i,e){let t=[],r=[];return i.forEach(s=>{r.length<e?r.push(s):(t.push(r),r=[s])}),r.length&&t.push(r),t}function hh(i){let{id:e,i18n:t,uppy:r,files:s,resumableUploads:n,hideRetryButton:o,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:p,isSingleFile:y,toggleFileCard:v,handleRequestThumbnail:x,handleCancelThumbnail:P,recoveredState:F,individualCancellation:R,itemsPerRow:D,openFileEditor:q,canEditFile:I,toggleAddFilesPanel:z,containerWidth:L,containerHeight:j}=i,K=D===1?71:200,Z=Yr(()=>{let Y=(le,ke)=>Number(s[ke].isGhost)-Number(s[le].isGhost),re=Object.keys(s);return F&&re.sort(Y),lT(re,D)},[s,D,F]),ne=Y=>u("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:Y[0]},Y.map(re=>u(po,{key:re,uppy:r,id:e,i18n:t,resumableUploads:n,individualCancellation:R,hideRetryButton:o,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:p,recoveredState:F,isSingleFile:y,containerWidth:L,containerHeight:j,toggleFileCard:v,handleRequestThumbnail:x,handleCancelThumbnail:P,role:"listitem",openFileEditor:q,canEditFile:I,toggleAddFilesPanel:z,file:s[re]})));return y?u("div",{class:"uppy-Dashboard-files"},ne(Z[0])):u(Qa,{class:"uppy-Dashboard-files",role:"list",data:Z,renderRow:ne,rowHeight:K})}var dh=class extends dt{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var e;(e=this.fileInput)==null||e.click()},this.triggerFolderInputClick=()=>{var e;(e=this.folderInput)==null||e.click()},this.triggerVideoCameraInputClick=()=>{var e;(e=this.mobileVideoFileInput)==null||e.click()},this.triggerPhotoCameraInputClick=()=>{var e;(e=this.mobilePhotoFileInput)==null||e.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""},this.renderHiddenInput=(e,t)=>{var r;return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(r=this.props.allowedFileTypes)==null?void 0:r.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,r)=>{let n={photo:"image/*",video:"video/*"}[e];return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:n,ref:r})},this.renderMyDeviceAcquirer=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{let r=this.props.acquirers.length;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":r===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),r=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),s=this.props.fileManagerSelectionType,n=s.charAt(0).toUpperCase()+s.slice(1);return u("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${n}`,{browseFiles:t,browseFolders:r,browse:t}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:t,browseFolders:r,browse:t}))},this.renderAcquirer=e=>{var t;return u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},u("div",{className:"uppy-DashboardTab-inner"},e.icon()),u("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],r=t.splice(e.length-2,e.length);return u(Mt,null,t.map(s=>this.renderAcquirer(s)),u("span",{role:"presentation",style:{"white-space":"nowrap"}},r.map(s=>this.renderAcquirer(s))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:r,showNativeVideoCameraButton:s}=this.props,n=[],o="myDevice";t||n.push({key:o,elements:this.renderMyDeviceAcquirer()}),r&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),s&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...e.map(d=>({key:d.id,elements:this.renderAcquirer(d)}))),n.length===1&&n[0].key===o&&(n=[]);let l=[...n],c=l.splice(n.length-2,n.length);return u(Mt,null,this.renderDropPasteBrowseTagline(n.length),u("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(d=>{let{key:p,elements:y}=d;return u(Mt,{key:p},y)}),u("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:p,elements:y}=d;return u(Mt,{key:p},y)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:e}=this.props,t=u("span",null,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),u("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),r=e("poweredBy",{uppy:t});return u("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},r)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:r}=this.props;return u("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,s=>{this.fileInput=s}),this.renderHiddenInput(!0,s=>{this.folderInput=s}),e&&this.renderHiddenCameraInput("photo",r,s=>{this.mobilePhotoFileInput=s}),t&&this.renderHiddenCameraInput("video",r,s=>{this.mobileVideoFileInput=s}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),u("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&u("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}},cl=dh;var _g=Ce(wt(),1);var cT=i=>u("div",{className:(0,_g.default)("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),u(cl,i)),Og=cT;var Rg=Ce(wt(),1);function uT(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ai=uT;function hT(i){let{activePickerPanel:e,className:t,hideAllPanels:r,i18n:s,state:n,uppy:o}=i,a=Xr(null);return u("div",{className:(0,Rg.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:Ai,onDragLeave:Ai,onDrop:Ai,onPaste:Ai},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},s("importFrom",{name:e.name})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:r},s("cancel"))),u("div",{ref:a,className:"uppy-DashboardContent-panelBody"},o.getPlugin(e.id).render(n,a.current)))}var Lg=hT;var Mg=Ce(wt(),1);function dT(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return u("div",{className:(0,Mg.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),u("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),u("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(r=>i.uppy.getPlugin(r.id).render(i.state))))}var Ig=dT;var Pi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function pT(i,e,t,r){if(r===void 0&&(r={}),i)return Pi.STATE_ERROR;if(e)return Pi.STATE_COMPLETE;if(t)return Pi.STATE_PAUSED;let s=Pi.STATE_WAITING,n=Object.keys(r);for(let o=0;o<n.length;o++){let{progress:a}=r[n[o]];if(a.uploadStarted&&!a.uploadComplete)return Pi.STATE_UPLOADING;a.preprocess&&s!==Pi.STATE_UPLOADING&&(s=Pi.STATE_PREPROCESSING),a.postprocess&&s!==Pi.STATE_UPLOADING&&s!==Pi.STATE_PREPROCESSING&&(s=Pi.STATE_POSTPROCESSING)}return s}function fT(i){let{files:e,i18n:t,isAllComplete:r,isAllErrored:s,isAllPaused:n,inProgressNotPausedFiles:o,newFiles:a,processingFiles:l}=i;switch(pT(s,r,n,e)){case"uploading":return t("uploadingXFiles",{smart_count:o.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:a.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}function mT(i){let{i18n:e,isAllComplete:t,hideCancelButton:r,maxNumberOfFiles:s,toggleAddFilesPanel:n,uppy:o}=i,{allowNewUpload:a}=i;return a&&s&&(a=i.totalFileCount<i.maxNumberOfFiles),u("div",{className:"uppy-DashboardContent-bar"},!t&&!r?u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>o.cancelAll()},e("cancel")):u("div",null),u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},u(fT,i)),a?u("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>n(!0)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},u("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),u("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):u("div",null))}var Dg=mT;var Ng=Ce(wt(),1);function ph(i){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:r,form:s,formState:n}=i,o={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(a=>{let l=`uppy-Dashboard-FileCard-input-${a.id}`,c=t.includes(a.id);return u("fieldset",{key:a.id,className:"uppy-Dashboard-FileCard-fieldset"},u("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},a.name),a.render!==void 0?a.render({value:n[a.id],onChange:d=>r(d,a.id),fieldCSSClasses:o,required:c,form:s.id},u):u("input",{className:o.text,id:l,form:s.id,type:a.type||"text",required:c,value:n[a.id],placeholder:a.placeholder,onInput:d=>r(d.target.value,a.id),"data-uppy-super-focusable":!0}))})}function fh(i){var e;let{files:t,fileCardFor:r,toggleFileCard:s,saveFileCard:n,metaFields:o,requiredMetaFields:a,openFileEditor:l,i18n:c,i18nArray:d,className:p,canEditFile:y}=i,v=()=>typeof o=="function"?o(t[r]):o,x=t[r],P=(e=v())!=null?e:[],F=y(x),R={};P.forEach(K=>{var Z;R[K.id]=(Z=x.meta[K.id])!=null?Z:""});let[D,q]=di(R),I=Zr(K=>{K.preventDefault(),n(D,r)},[n,D,r]),z=(K,Z)=>{q({...D,[Z]:K})},L=()=>{s(!1)},[j]=di(()=>{let K=document.createElement("form");return K.setAttribute("tabindex","-1"),K.id=dr(),K});return ki(()=>(document.body.appendChild(j),j.addEventListener("submit",I),()=>{j.removeEventListener("submit",I),document.body.removeChild(j)}),[j,I]),u("div",{className:(0,Ng.default)("uppy-Dashboard-FileCard",p),"data-uppy-panelType":"FileCard",onDragOver:Ai,onDragLeave:Ai,onDrop:Ai,onPaste:Ai},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},x.meta?x.meta.name:x.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",form:j.id,title:c("finishEditingFile"),onClick:L},c("cancel"))),u("div",{className:"uppy-Dashboard-FileCard-inner"},u("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:es(x.type).color}},u(uo,{file:x}),F&&u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:K=>{I(K),l(x)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(ph,{computedMetaFields:P,requiredMetaFields:a,updateMeta:z,form:j,formState:D})),u("div",{className:"uppy-Dashboard-FileCard-actions"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:j.id},c("saveChanges")),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:L,form:j.id},c("cancel")))))}var Ug=Ce(wt(),1),qs="uppy-transition-slideDownUp",Bg=250;function gT(i){let{children:e}=i,[t,r]=di(null),[s,n]=di(""),o=Xr(),a=Xr(),l=Xr(),c=()=>{n(`${qs}-enter`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{n(`${qs}-enter ${qs}-enter-active`),o.current=setTimeout(()=>{n("")},Bg)})},d=()=>{n(`${qs}-leave`),cancelAnimationFrame(l.current),clearTimeout(o.current),o.current=void 0,l.current=requestAnimationFrame(()=>{n(`${qs}-leave ${qs}-leave-active`),a.current=setTimeout(()=>{r(null),n("")},Bg)})};return ki(()=>{let p=xi(e)[0];t!==p&&(p&&!t?c():t&&!p&&!a.current&&d(),r(p))},[e,t]),ki(()=>()=>{clearTimeout(o.current),clearTimeout(a.current),cancelAnimationFrame(l.current)},[]),t?La(t,{className:(0,Ug.default)(s,t.props.className)}):null}var fo=gT;function Vs(){return Vs=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Vs.apply(null,arguments)}var zg=900,Hg=700,mh=576,$g=330;function gh(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>mh,s=i.containerHeight>$g,n=(0,qg.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>mh,"uppy-size--lg":i.containerWidth>Hg,"uppy-size--xl":i.containerWidth>zg,"uppy-size--height-md":i.containerHeight>$g,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&s}),o=1;i.containerWidth>zg?o=5:i.containerWidth>Hg?o=4:i.containerWidth>mh&&(o=3);let a=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,c=i.files?Object.keys(i.files).filter(y=>i.files[y].isGhost).length:0,d=()=>c>0?i.i18n("recoveredXFiles",{smart_count:c}):i.i18n("recoveredAllFiles");return u("div",{className:n,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&ih(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},u("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),u("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:u("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},u("span",{"aria-hidden":"true"},"\xD7")),u("div",{className:"uppy-Dashboard-innerWrap"},u("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),a&&u(Dg,i),l&&u("div",{className:"uppy-Dashboard-serviceMsg"},u("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},u("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},u("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),u("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),u("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),u("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),u("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),a?u(hh,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:o,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):u(cl,{i18n:i.i18n,i18nArray:i.i18nArray,acquirers:i.acquirers,handleInputChange:i.handleInputChange,maxNumberOfFiles:i.maxNumberOfFiles,allowedFileTypes:i.allowedFileTypes,showNativePhotoCameraButton:i.showNativePhotoCameraButton,showNativeVideoCameraButton:i.showNativeVideoCameraButton,nativeCameraFacingMode:i.nativeCameraFacingMode,showPanel:i.showPanel,activePickerPanel:i.activePickerPanel,disableLocalFiles:i.disableLocalFiles,fileManagerSelectionType:i.fileManagerSelectionType,note:i.note,proudlyDisplayPoweredByUppy:i.proudlyDisplayPoweredByUppy}),u(fo,null,i.showAddFilesPanel?u(Og,Vs({key:"AddFiles"},i,{isSizeMD:r})):null),u(fo,null,i.fileCardFor?u(fh,Vs({key:"FileCard"},i)):null),u(fo,null,i.activePickerPanel?u(Lg,Vs({key:"Picker"},i)):null),u(fo,null,i.showFileEditor?u(Ig,Vs({key:"Editor"},i)):null),u("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(y=>i.uppy.getPlugin(y.id).render(i.state))))))}var Vg={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function de(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var vT=0;function ct(i){return"__private_"+vT+++"_"+i}var bT={version:"4.3.2"},vh=Ju.default||Ju,jg=9,yT=27;function Wg(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var wT={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:lo,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:()=>{},onDragOver:()=>{},onDrop:()=>{},plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550},ts=ct("disabledNodes"),Gi=ct("generateLargeThumbnailIfSingleFile"),mo=ct("openFileEditorWhenFilesAdded"),is=ct("attachRenderFunctionToTarget"),bh=ct("isTargetSupported"),yh=ct("getAcquirers"),wh=ct("getProgressIndicators"),Ki=ct("getEditors"),Sh=ct("addSpecifiedPluginsFromOptions"),Th=ct("autoDiscoverPlugins"),rs=ct("addSupportedPluginIfNoTarget"),go=ct("getStatusBarOpts"),vo=ct("getThumbnailGeneratorOpts"),Eh=ct("getInformerOpts"),bo=ct("getStatusBarId"),yo=ct("getThumbnailGeneratorId"),xh=ct("getInformerId"),vr=class extends ui{constructor(e,t){var r,s,n;let o=(r=t?.autoOpen)!=null?r:null;super(e,{...wT,...t,autoOpen:o}),Object.defineProperty(this,xh,{value:AT}),Object.defineProperty(this,yo,{value:kT}),Object.defineProperty(this,bo,{value:xT}),Object.defineProperty(this,Eh,{value:ET}),Object.defineProperty(this,vo,{value:TT}),Object.defineProperty(this,go,{value:ST}),Object.defineProperty(this,ts,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${dr()}`,this.superFocus=th(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=a=>{let c=this.getPluginState().targets.filter(d=>d.id!==a.id);this.setPluginState({targets:c})},this.addTarget=a=>{let l=a.id||a.constructor.name,c=a.title||l,d=a.type;if(d!=="acquirer"&&d!=="progressindicator"&&d!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let p={id:l,name:c,type:d},v=this.getPluginState().targets.slice();return v.push(p),this.setPluginState({targets:v}),this.el},this.hideAllPanels=()=>{var a;let l=this.getPluginState(),c={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===c.activePickerPanel&&l.showAddFilesPanel===c.showAddFilesPanel&&l.showFileEditor===c.showFileEditor&&l.activeOverlayType===c.activeOverlayType||(this.setPluginState(c),this.uppy.emit("dashboard:close-panel",(a=l.activePickerPanel)==null?void 0:a.id))},this.showPanel=a=>{let{targets:l}=this.getPluginState(),c=l.find(d=>d.type==="acquirer"&&d.id===a);this.setPluginState({activePickerPanel:c,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",a)},this.canEditFile=a=>{let{targets:l}=this.getPluginState();return de(this,Ki)[Ki](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(a))},this.openFileEditor=a=>{let{targets:l}=this.getPluginState(),c=de(this,Ki)[Ki](l);this.setPluginState({showFileEditor:!0,fileCardFor:a.id||null,activeOverlayType:"FileEditor"}),c.forEach(d=>{this.uppy.getPlugin(d.id).selectFile(a)})},this.closeFileEditor=()=>{let{metaFields:a}=this.getPluginState();a&&a.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:a}=this.getPluginState();de(this,Ki)[Ki](a).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:a,resolve:l}=Wg();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let c=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",c,!1),l()};this.el.addEventListener("animationend",c,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),a},this.closeModal=a=>{var l;let c=(l=a?.manualClose)!=null?l:!0,{isHidden:d,isClosing:p}=this.getPluginState();if(d||p)return;let{promise:y,resolve:v}=Wg();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let P=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",P,!1),v()};this.el.addEventListener("animationend",P,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),v();if(document.removeEventListener("keydown",this.handleKeyDownInModal),c&&this.opts.browserBackButtonClose){var x;(x=history.state)!=null&&x[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),y},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=a=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:{...l,darkMode:a}})},this.handleSystemDarkModeChange=a=>{let l=a.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(a,l)=>{let c=this.uppy.getFile(l);a?this.uppy.emit("dashboard:file-edit-start",c):this.uppy.emit("dashboard:file-edit-complete",c),this.setPluginState({fileCardFor:a?l:null,activeOverlayType:a?"FileCard":null})},this.toggleAddFilesPanel=a=>{this.setPluginState({showAddFilesPanel:a,activeOverlayType:a?"AddFiles":null})},this.addFiles=a=>{let l=a.map(c=>({source:this.id,name:c.name,type:c.type,data:c,meta:{relativePath:c.relativePath||c.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(c){this.uppy.log(c)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(a=>{let l=a[0],{width:c,height:d}=l.contentRect;this.setPluginState({containerWidth:c,containerHeight:d,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let a=this.getPluginState(),l=!this.opts.inline&&a.isHidden;!a.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn\u2019t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=a=>{this.el.contains(a.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=a=>{var l;let c=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],d=(l=de(this,ts)[ts])!=null?l:mr(this.el.querySelectorAll(c)).filter(p=>!p.classList.contains("uppy-Dashboard-close"));for(let p of d)p.tagName==="A"?p.setAttribute("aria-disabled",a):p.disabled=a;a?de(this,ts)[ts]=d:de(this,ts)[ts]=null,this.dashboardIsDisabled=a},this.updateBrowserHistory=()=>{var a;(a=history.state)!=null&&a[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=a=>{var l;this.isModalOpen()&&(!a.state||!a.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=a.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=a=>{a.keyCode===yT&&this.requestCloseModal(),a.keyCode===jg&&eh(a,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=a=>{this.uppy.iteratePlugins(c=>{c.type==="acquirer"&&(c.handleRootPaste==null||c.handleRootPaste(a))});let l=mr(a.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=a=>{a.preventDefault();let l=mr(a.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=a=>{a.preventDefault(),a.stopPropagation();let l=()=>{let y=!0;return this.uppy.iteratePlugins(v=>{v.canHandleRootDrop!=null&&v.canHandleRootDrop(a)&&(y=!0)}),y},c=()=>{let{types:y}=a.dataTransfer;return y.some(v=>v==="Files")},d=l(),p=c();if(!d&&!p||this.opts.disabled||this.opts.disableLocalFiles&&(p||!d)||!this.uppy.getState().allowNewUpload){a.dataTransfer.dropEffect="none";return}a.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(a)},this.handleDragLeave=a=>{a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(a)},this.handleDrop=async a=>{a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(p=>{p.type==="acquirer"&&(p.handleRootDrop==null||p.handleRootDrop(a))});let l=!1,c=p=>{this.uppy.log(p,"error"),l||(this.uppy.info(p.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let d=await Mu(a.dataTransfer,{logDropError:c});d.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(d)),this.opts.onDrop(a)},this.handleRequestThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",a)},this.handleCancelThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",a)},this.handleKeyDownInInline=a=>{a.keyCode===jg&&xg(a,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=a=>{this.el.contains(document.activeElement)&&this.handlePaste(a)},this.handleComplete=a=>{let{failed:l}=a;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Gi,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let a=600,l=this.uppy.getFiles();if(l.length===1){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c?.setOptions({thumbnailWidth:a});let d={...l[0],preview:void 0};c?.requestThumbnail(d).then(()=>{c?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,mo,{writable:!0,value:a=>{let l=a[0],{metaFields:c}=this.getPluginState(),d=c&&c.length>0,p=this.canEditFile(l);d&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):p&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let a=Ou(this.opts.trigger);a?a.forEach(l=>l.addEventListener("click",this.openModal)):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",de(this,rs)[rs]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",de(this,Gi)[Gi]),this.uppy.on("file-removed",de(this,Gi)[Gi]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",de(this,mo)[mo])},this.removeEvents=()=>{let a=Ou(this.opts.trigger);!this.opts.inline&&a&&a.forEach(l=>l.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",de(this,rs)[rs]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",de(this,Gi)[Gi]),this.uppy.off("file-removed",de(this,Gi)[Gi]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",de(this,mo)[mo])},this.superFocusOnEachUpdate=()=>{let a=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,c=this.uppy.getState().info.length===0,d=!this.opts.inline;c&&(d||a||l&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(a,l)=>{this.uppy.setFileMeta(l,a),this.toggleFileCard(!1,l)},Object.defineProperty(this,is,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return{...a,icon:l.icon||this.opts.defaultPickerIcon,render:l.render}}}),Object.defineProperty(this,bh,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,yh,{writable:!0,value:vh(a=>a.filter(l=>l.type==="acquirer"&&de(this,bh)[bh](l)).map(de(this,is)[is]))}),Object.defineProperty(this,wh,{writable:!0,value:vh(a=>a.filter(l=>l.type==="progressindicator").map(de(this,is)[is]))}),Object.defineProperty(this,Ki,{writable:!0,value:vh(a=>a.filter(l=>l.type==="editor").map(de(this,is)[is]))}),this.render=a=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:p}=a,{newFiles:y,uploadStartedFiles:v,completeFiles:x,erroredFiles:P,inProgressFiles:F,inProgressNotPausedFiles:R,processingFiles:D,isUploadStarted:q,isAllComplete:I,isAllPaused:z}=this.uppy.getObjectOfFilesPerState(),L=de(this,yh)[yh](l.targets),j=de(this,wh)[wh](l.targets),K=de(this,Ki)[Ki](l.targets),Z;return this.opts.theme==="auto"?Z=d.darkMode?"dark":"light":Z=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),gh({state:a,isHidden:l.isHidden,files:c,newFiles:y,uploadStartedFiles:v,completeFiles:x,erroredFiles:P,inProgressFiles:F,inProgressNotPausedFiles:R,processingFiles:D,isUploadStarted:q,isAllComplete:I,isAllPaused:z,totalFileCount:Object.keys(c).length,totalProgress:a.totalProgress,allowNewUpload:p,acquirers:L,theme:Z,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:l.activePickerPanel,showFileEditor:l.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:l.isClosing,progressindicators:j,editors:K,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:a.recoveredState,metaFields:l.metaFields,resumableUploads:d.resumableUploads||!1,individualCancellation:d.individualCancellation,isMobileDevice:d.isMobileDevice,fileCardFor:l.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:l.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:l.containerWidth,containerHeight:l.containerHeight,areInsidesReadyToBeVisible:l.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:l.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,Sh,{writable:!0,value:()=>{let{plugins:a}=this.opts;a.forEach(l=>{let c=this.uppy.getPlugin(l);c?c.mount(this,c):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,Th,{writable:!0,value:()=>{this.uppy.iteratePlugins(de(this,rs)[rs])}}),Object.defineProperty(this,rs,{writable:!0,value:a=>{var l;let c=["acquirer","editor"];a&&!((l=a.opts)!=null&&l.target)&&c.includes(a.type)&&(this.getPluginState().targets.some(p=>a.id===p.id)||a.mount(this,a))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:a,closeAfterFinish:l}=this.opts;if(a&&l)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");let{allowMultipleUploads:c,allowMultipleUploadBatches:d}=this.uppy.opts;(c||d)&&l&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:p}=this.opts;p&&this.mount(p,this),this.opts.disableStatusBar||this.uppy.use(Vr,{id:de(this,bo)[bo](),target:this,...de(this,go)[go]()}),this.opts.disableInformer||this.uppy.use(jr,{id:de(this,xh)[xh](),target:this,...de(this,Eh)[Eh]()}),this.opts.disableThumbnailGenerator||this.uppy.use(Bs,{id:de(this,yo)[yo](),...de(this,vo)[vo]()}),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let y=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${y?"on":"off"}`),this.setDarkModeCapability(y),this.opts.theme==="auto"){var v;(v=this.darkModeMediaQuery)==null||v.addListener(this.handleSystemDarkModeChange)}de(this,Sh)[Sh](),de(this,Th)[Th](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let c=this.uppy.getPlugin(`${this.id}:Informer`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableStatusBar){let c=this.uppy.getPlugin(`${this.id}:StatusBar`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableThumbnailGenerator){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c&&this.uppy.removePlugin(c)}let{plugins:a}=this.opts;if(a.forEach(c=>{let d=this.uppy.getPlugin(c);d&&d.unmount()}),this.opts.theme==="auto"){var l;(l=this.darkModeMediaQuery)==null||l.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=Vg,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(n=(s=this.opts).onRequestCloseModal)!=null||(s.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,r;super.setOptions(e),(t=this.uppy.getPlugin(de(this,bo)[bo]()))==null||t.setOptions(de(this,go)[go]()),(r=this.uppy.getPlugin(de(this,yo)[yo]()))==null||r.setOptions(de(this,vo)[vo]())}};function ST(){let{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:s,hideProgressAfterFinish:n,locale:o,doneButtonHandler:a}=this.opts;return{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:s,hideAfterFinish:n,locale:o,doneButtonHandler:a}}function TT(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r,lazy:!r}}function ET(){return{}}function xT(){return`${this.id}:StatusBar`}function kT(){return`${this.id}:ThumbnailGenerator`}function AT(){return`${this.id}:Informer`}vr.VERSION=bT.version;var Qg=Ce(Gg(),1);function PT(i,e){let t=i.width/e.width,r=i.height/e.height,s=Math.min(t,r),n=e.width*s,o=e.height*s,a=(i.width-n)/2,l=(i.height-o)/2;return{width:n,height:o,left:a,top:l}}var Kg=PT;function CT(i){return i*(Math.PI/180)}function FT(i,e,t){let r=Math.abs(CT(t));return Math.max((Math.sin(r)*i+Math.cos(r)*e)/e,(Math.sin(r)*e+Math.cos(r)*i)/i)}var Xg=FT;function _T(i,e,t){return e.left<i.left?{left:i.left,width:t.width}:e.top<i.top?{top:i.top,height:t.height}:e.left+e.width>i.left+i.width?{left:i.left+i.width-t.width,width:t.width}:e.top+e.height>i.top+i.height?{top:i.top+i.height-t.height,height:t.height}:null}var Yg=_T;function OT(i,e,t){return e.left<i.left?{left:i.left,width:t.left+t.width-i.left}:e.top<i.top?{top:i.top,height:t.top+t.height-i.top}:e.left+e.width>i.left+i.width?{left:t.left,width:i.left+i.width-t.left}:e.top+e.height>i.top+i.height?{top:t.top,height:i.top+i.height-t.top}:null}var Zg=OT;var wo=class extends dt{constructor(e){super(e),this.onRotate90Deg=()=>{let{angle90Deg:t}=this.state,r=t-90;this.setState({angle90Deg:r,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(r);let s=this.cropper.getCanvasData(),n=this.cropper.getContainerData(),o=Kg(n,s);this.cropper.setCanvasData(o),this.cropper.setCropBoxData(o)},this.onRotateGranular=t=>{let r=Number(t.target.value);this.setState({angleGranular:r});let{angle90Deg:s}=this.state,n=s+r;this.cropper.rotateTo(n);let o=this.cropper.getImageData(),a=Xg(o.naturalWidth,o.naturalHeight,r),l=this.cropper.getImageData().scaleX<0?-a:a;this.cropper.scale(l,a)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){let{opts:e,storeCropperInstance:t}=this.props;this.cropper=new Qg.default(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){let t=this.cropper.getCanvasData(),r=this.cropper.getCropBoxData(),{prevCropboxData:s}=this.state;if(e.detail.action==="all"){let n=Yg(t,r,s);n&&this.cropper.setCropBoxData(n)}else{let n=Zg(t,r,s);n&&this.cropper.setCropBoxData(n)}}renderGranularRotate(){let{i18n:e}=this.props,{angleGranular:t}=this.state;return u("label",{role:"tooltip","aria-label":`${t}\xBA`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},u("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){let{i18n:e,opts:t}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})}},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))}renderRotate(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))}renderFlip(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))}renderZoomIn(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.cropper.zoom(.1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},u("path",{d:"M0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),u("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.cropper.zoom(-.1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))}renderCropSquare(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M19 5v14H5V5h14m0-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-2z"})))}renderCropWidescreen(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),u("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),u("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){let{currentImage:e,opts:t}=this.props,{actions:r}=t,s=URL.createObjectURL(e.data);return u("div",{className:"uppy-ImageCropper"},u("div",{className:"uppy-ImageCropper-container"},u("img",{className:"uppy-ImageCropper-image",alt:e.name,src:s,ref:n=>{this.imgElement=n}})),u("div",{className:"uppy-ImageCropper-controls"},r.revert&&this.renderRevert(),r.rotate&&this.renderRotate(),r.granularRotate&&this.renderGranularRotate(),r.flip&&this.renderFlip(),r.zoomIn&&this.renderZoomIn(),r.zoomOut&&this.renderZoomOut(),r.cropSquare&&this.renderCropSquare(),r.cropWidescreen&&this.renderCropWidescreen(),r.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}};var Jg={strings:{revert:"Reset",rotate:"Rotate 90\xB0",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}};var RT={version:"3.3.1"},ev={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},tv={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},LT={quality:.8,actions:tv,cropperOptions:ev},ss=class extends ui{constructor(e,t){super(e,{...LT,...t,actions:{...tv,...t?.actions},cropperOptions:{...ev,...t?.cropperOptions}}),this.save=()=>{let r=o=>{var a;let{currentImage:l}=this.getPluginState();this.uppy.setFileState(l.id,{data:new File([o],(a=l.name)!=null?a:this.i18n("unnamed"),{type:o.type}),size:o.size,preview:void 0});let c=this.uppy.getFile(l.id);this.uppy.emit("thumbnail:request",c),this.setPluginState({currentImage:c}),this.uppy.emit("file-editor:complete",c)},{currentImage:s}=this.getPluginState(),n=this.cropper.getCroppedCanvas({});n.width%2!==0&&this.cropper.setData({width:n.width-1}),n.height%2!==0&&this.cropper.setData({height:n.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob(r,s.type,this.opts.quality)},this.storeCropperInstance=r=>{this.cropper=r},this.selectFile=r=>{this.uppy.emit("file-editor:start",r),this.setPluginState({currentImage:r})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=Jg,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;let t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){let{currentImage:e}=this.getPluginState();if(e){let t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){let{currentImage:e}=this.getPluginState();return e===null||e.isRemote?null:u(wo,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}};ss.VERSION=RT.version;function Xi(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var MT=0;function iv(i){return"__private_"+MT+++"_"+i}var Et=iv("uppy"),So=iv("events"),To=class{constructor(e){Object.defineProperty(this,Et,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:[]}),Xi(this,Et)[Et]=e}on(e,t){return Xi(this,So)[So].push([e,t]),Xi(this,Et)[Et].on(e,t)}remove(){for(let[e,t]of Xi(this,So)[So].splice(0))Xi(this,Et)[Et].off(e,t)}onFilePause(e,t){this.on("upload-pause",(r,s)=>{e===r?.id&&t(s)})}onFileRemove(e,t){this.on("file-removed",r=>{e===r.id&&t(r.id)})}onPause(e,t){this.on("upload-pause",(r,s)=>{e===r?.id&&t(s)})}onRetry(e,t){this.on("upload-retry",r=>{e===r?.id&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{Xi(this,Et)[Et].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{Xi(this,Et)[Et].getFile(e)&&t()})}onCancelAll(e,t){var r=this;this.on("cancel-all",function(){Xi(r,Et)[Et].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{Xi(this,Et)[Et].getFile(e)&&t()})}};function te(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var IT=0;function Ft(i){return"__private_"+IT+++"_"+i}function DT(i){return new Error("Cancelled",{cause:i})}function rv(i){if(i!=null){var e;let t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});let r=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,r,r)}return this}var Ut=Ft("activeRequests"),kt=Ft("queuedHandlers"),Bt=Ft("paused"),ns=Ft("pauseTimer"),xt=Ft("downLimit"),os=Ft("upperLimit"),Yi=Ft("rateLimitingTimer"),Eo=Ft("call"),Zi=Ft("queueNext"),Fh=Ft("next"),Ph=Ft("queue"),_h=Ft("dequeue"),Ch=Ft("resume"),as=Ft("increaseLimit"),ul=class{constructor(e){Object.defineProperty(this,_h,{value:HT}),Object.defineProperty(this,Ph,{value:zT}),Object.defineProperty(this,Fh,{value:UT}),Object.defineProperty(this,Zi,{value:BT}),Object.defineProperty(this,Eo,{value:NT}),Object.defineProperty(this,Ut,{writable:!0,value:0}),Object.defineProperty(this,kt,{writable:!0,value:[]}),Object.defineProperty(this,Bt,{writable:!0,value:!1}),Object.defineProperty(this,ns,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:1}),Object.defineProperty(this,os,{writable:!0,value:void 0}),Object.defineProperty(this,Yi,{writable:!0,value:void 0}),Object.defineProperty(this,Ch,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,as,{writable:!0,value:()=>{if(te(this,Bt)[Bt]){te(this,Yi)[Yi]=setTimeout(te(this,as)[as],0);return}te(this,xt)[xt]=this.limit,this.limit=Math.ceil((te(this,os)[os]+te(this,xt)[xt])/2);for(let t=te(this,xt)[xt];t<=this.limit;t++)te(this,Zi)[Zi]();te(this,os)[os]-te(this,xt)[xt]>3?te(this,Yi)[Yi]=setTimeout(te(this,as)[as],2e3):te(this,xt)[xt]=Math.floor(te(this,xt)[xt]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!te(this,Bt)[Bt]&&te(this,Ut)[Ut]<this.limit?te(this,Eo)[Eo](e):te(this,Ph)[Ph](e,t)}wrapSyncFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];let a=r.run(()=>(e(...n),queueMicrotask(()=>a.done()),()=>{}),t);return{abortOn:rv,abort(){a.abort()}}}}wrapPromiseFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];let a,l=new Promise((c,d)=>{a=r.run(()=>{let p,y;try{y=Promise.resolve(e(...n))}catch(v){y=Promise.reject(v)}return y.then(v=>{p?d(p):(a.done(),c(v))},v=>{p?d(p):(a.done(),d(v))}),v=>{p=DT(v)}},t)});return l.abort=c=>{a.abort(c)},l.abortOn=rv,l}}resume(){te(this,Bt)[Bt]=!1,clearTimeout(te(this,ns)[ns]);for(let e=0;e<this.limit;e++)te(this,Zi)[Zi]()}pause(e){e===void 0&&(e=null),te(this,Bt)[Bt]=!0,clearTimeout(te(this,ns)[ns]),e!=null&&(te(this,ns)[ns]=setTimeout(te(this,Ch)[Ch],e))}rateLimit(e){clearTimeout(te(this,Yi)[Yi]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(te(this,os)[os]=this.limit-1,this.limit=te(this,xt)[xt],te(this,Yi)[Yi]=setTimeout(te(this,as)[as],e))}get isPaused(){return te(this,Bt)[Bt]}};function NT(i){te(this,Ut)[Ut]+=1;let e=!1,t;try{t=i()}catch(r){throw te(this,Ut)[Ut]-=1,r}return{abort:r=>{e||(e=!0,te(this,Ut)[Ut]-=1,t?.(r),te(this,Zi)[Zi]())},done:()=>{e||(e=!0,te(this,Ut)[Ut]-=1,te(this,Zi)[Zi]())}}}function BT(){queueMicrotask(()=>te(this,Fh)[Fh]())}function UT(){if(te(this,Bt)[Bt]||te(this,Ut)[Ut]>=this.limit||te(this,kt)[kt].length===0)return;let i=te(this,kt)[kt].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=te(this,Eo)[Eo](i.fn);i.abort=e.abort,i.done=e.done}function zT(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{te(this,_h)[_h](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=te(this,kt)[kt].findIndex(s=>t.priority>s.priority);return r===-1?te(this,kt)[kt].push(t):te(this,kt)[kt].splice(r,0,t),t}function HT(i){let e=te(this,kt)[kt].indexOf(i);e!==-1&&te(this,kt)[kt].splice(e,1)}var hl=Symbol("__queue");var Oh=class extends Error{constructor(e,t){t===void 0&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}},xo=Oh;function $T(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}var sv=$T;function Xt(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var qT=0;function dl(i){return"__private_"+qT+++"_"+i}var Qi=dl("aliveTimer"),ls=dl("isDone"),ko=dl("onTimedOut"),cs=dl("timeout"),Rh=class{constructor(e,t){Object.defineProperty(this,Qi,{writable:!0,value:void 0}),Object.defineProperty(this,ls,{writable:!0,value:!1}),Object.defineProperty(this,ko,{writable:!0,value:void 0}),Object.defineProperty(this,cs,{writable:!0,value:void 0}),Xt(this,cs)[cs]=e,Xt(this,ko)[ko]=()=>t(e)}progress(){Xt(this,ls)[ls]||Xt(this,cs)[cs]>0&&(clearTimeout(Xt(this,Qi)[Qi]),Xt(this,Qi)[Qi]=setTimeout(Xt(this,ko)[ko],Xt(this,cs)[cs]))}done(){Xt(this,ls)[ls]||(clearTimeout(Xt(this,Qi)[Qi]),Xt(this,Qi)[Qi]=void 0,Xt(this,ls)[ls]=!0)}},nv=Rh;var pl=()=>{};function ov(i,e){e===void 0&&(e={});let{body:t=null,headers:r={},method:s="GET",onBeforeRequest:n=pl,onUploadProgress:o=pl,shouldRetry:a=()=>!0,onAfterResponse:l=pl,onTimeout:c=pl,responseType:d,retries:p=3,signal:y=null,timeout:v=3e4,withCredentials:x=!1}=e,P=D=>.3*2**(D-1)*1e3,F=new nv(v,c);function R(D){return D===void 0&&(D=0),new Promise(async(q,I)=>{let z=new XMLHttpRequest,L=j=>{a(z)&&D<p?setTimeout(()=>{R(D+1).then(q,I)},P(D)):(F.done(),I(j))};z.open(s,i,!0),z.withCredentials=x,d&&(z.responseType=d),y?.addEventListener("abort",()=>{z.abort(),I(new DOMException("Aborted","AbortError"))}),z.onload=async()=>{try{await l(z,D)}catch(j){j.request=z,L(j);return}z.status>=200&&z.status<300?(F.done(),q(z)):a(z)&&D<p?setTimeout(()=>{R(D+1).then(q,I)},P(D)):(F.done(),I(new xo(z.statusText,z)))},z.onerror=()=>L(new xo(z.statusText,z)),z.upload.onprogress=j=>{F.progress(),o(j)},r&&Object.keys(r).forEach(j=>{z.setRequestHeader(j,r[j])}),await n(z,D),z.send(t)})}return R()}function av(i){let e=t=>"error"in t&&!!t.error;return i.filter(t=>!e(t))}function lv(i){return i.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}function fl(i,e){return i===!0?Object.keys(e):Array.isArray(i)?i:[]}var cv={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function Ji(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var VT=0;function Ws(i){return"__private_"+VT+++"_"+i}var jT={version:"4.3.3"};function WT(i,e){let t=e;return t||(t=new Error("Upload error")),typeof t=="string"&&(t=new Error(t)),t instanceof Error||(t=Object.assign(new Error("Upload error"),{data:t})),sv(i)?(t=new xo(t,i),t):(t.request=i,t)}function uv(i){return i.data.slice(0,i.data.size,i.meta.type)}var GT={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""},us=Ws("getFetcher"),Ih=Ws("uploadLocalFile"),Lh=Ws("uploadBundle"),Dh=Ws("getCompanionClientArgs"),Mh=Ws("uploadFiles"),Ao=Ws("handleUpload"),js=class extends pr{constructor(e,t){if(super(e,{...GT,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,Mh,{value:ZT}),Object.defineProperty(this,Dh,{value:YT}),Object.defineProperty(this,Lh,{value:XT}),Object.defineProperty(this,Ih,{value:KT}),Object.defineProperty(this,us,{writable:!0,value:void 0}),Object.defineProperty(this,Ao,{writable:!0,value:async r=>{if(r.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[hl]&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");let s=this.uppy.getFilesByIds(r),n=av(s),o=lv(n);if(this.uppy.emit("upload-start",o),this.opts.bundle){if(n.some(l=>l.isRemote))throw new Error("Can\u2019t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await Ji(this,Lh)[Lh](n)}else await Ji(this,Mh)[Mh](n)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=cv,this.i18nInit(),hl in this.opts?this.requests=this.opts[hl]:this.requests=new ul(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(t?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),Ji(this,us)[us]=r=>async(s,n)=>{try{var o,a,l;let p=await ov(s,{...n,onBeforeRequest:(x,P)=>{var F,R;return(F=(R=this.opts).onBeforeRequest)==null?void 0:F.call(R,x,P,r)},shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:x=>{let P=Math.ceil(x/1e3),F=new Error(this.i18n("uploadStalled",{seconds:P}));this.uppy.emit("upload-stalled",F,r)},onUploadProgress:x=>{if(x.lengthComputable)for(let{id:F}of r){var P;let R=this.uppy.getFile(F);this.uppy.emit("upload-progress",R,{uploadStarted:(P=R.progress.uploadStarted)!=null?P:0,bytesUploaded:x.loaded/x.total*R.size,bytesTotal:R.size})}}}),y=await((o=(a=this.opts).getResponseData)==null?void 0:o.call(a,p));if(p.responseType==="json"){var c;(c=y)!=null||(y=p.response)}else try{var d;(d=y)!=null||(y=JSON.parse(p.responseText))}catch(x){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:x})}let v=typeof((l=y)==null?void 0:l.url)=="string"?y.url:void 0;for(let{id:x}of r)this.uppy.emit("upload-success",this.uppy.getFile(x),{status:p.status,body:y,uploadURL:v});return p}catch(p){if(p.name==="AbortError")return;let y=p.request;for(let v of r)this.uppy.emit("upload-error",this.uppy.getFile(v.id),WT(y,p),y);throw p}}}getOptions(e){let t=this.uppy.getState().xhrUpload,{headers:r}=this.opts,s={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return typeof r=="function"?s.headers=r(e):Object.assign(s.headers,this.opts.headers),t&&Object.assign(s.headers,t.headers),e.xhrUpload&&Object.assign(s.headers,e.xhrUpload.headers),s}addMetadata(e,t,r){fl(r.allowedMetaFields,t).forEach(n=>{let o=t[n];Array.isArray(o)?o.forEach(a=>e.append(n,a)):e.append(n,o)})}createFormDataUpload(e,t){let r=new FormData;this.addMetadata(r,e.meta,t);let s=uv(e);return e.name?r.append(t.fieldName,s,e.meta.name):r.append(t.fieldName,s),r}createBundledUpload(e,t){let r=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(r,s,t),e.forEach(n=>{let o=this.getOptions(n),a=uv(n);n.name?r.append(o.fieldName,a,n.name):r.append(o.fieldName,a)}),r}install(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(Ji(this,Ao)[Ao])}uninstall(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(Ji(this,Ao)[Ao])}};async function KT(i){let e=new To(this.uppy),t=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{let s=this.getOptions(i),n=Ji(this,us)[us]([i]),o=s.formData?this.createFormDataUpload(i,s):i.data;return n(s.endpoint,{...s,body:o,signal:t.signal})});e.onFileRemove(i.id,()=>t.abort()),e.onCancelAll(i.id,()=>{t.abort()});try{await r().abortOn(t.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{e.remove()}}async function XT(i){let e=new AbortController,t=this.requests.wrapPromiseFunction(async()=>{var s;let n=(s=this.uppy.getState().xhrUpload)!=null?s:{},o=Ji(this,us)[us](i),a=this.createBundledUpload(i,{...this.opts,...n});return o(this.opts.endpoint,{...this.opts,body:a,signal:e.signal})});function r(){e.abort()}this.uppy.once("cancel-all",r);try{await t().abortOn(e.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{this.uppy.off("cancel-all",r)}}function YT(i){var e;let t=this.getOptions(i),r=fl(t.allowedMetaFields,i.meta);return{...(e=i.remote)==null?void 0:e.body,protocol:"multipart",endpoint:t.endpoint,size:i.data.size,fieldname:t.fieldName,metadata:Object.fromEntries(r.map(s=>[s,i.meta[s]])),httpMethod:t.method,useFormData:t.formData,headers:t.headers}}async function ZT(i){await Promise.allSettled(i.map(e=>{if(e.isRemote){let t=()=>this.requests,r=new AbortController,s=o=>{o.id===e.id&&r.abort()};this.uppy.on("file-removed",s);let n=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,Ji(this,Dh)[Dh](e),{signal:r.signal,getQueue:t});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",s)},{priority:-1})(),n}return Ji(this,Ih)[Ih](e)}))}js.VERSION=jT.version;var ut=class{static fromTemplate(i){if(As.isSupported)return As.sanitize(i,{USE_PROFILES:{html:!0,svg:!0},RETURN_DOM:!0}).children[0];{let e=new DOMParser().parseFromString(i,"text/html").body.children[0];return QT(e)}}};function QT(i){return JT(i),hv(i),i}function JT(i){let e=i.querySelectorAll("script");for(let t of e)t.remove()}function eE(i,e){let t=e.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(i)&&(t.includes("javascript:")||t.includes("data:"))||i.startsWith("on"))return!0}function tE(i){let e=i.attributes;for(let{name:t,value:r}of e)eE(t,r)&&i.removeAttribute(t)}function hv(i){let e=i.children;for(let t of e)tE(t),hv(t)}var ml=class extends ie{static values={identifier:String,maxFileSize:{type:Number,default:null},minFileSize:{type:Number,default:null},maxTotalSize:{type:Number,default:null},maxFileNum:{type:Number,default:null},minFileNum:{type:Number,default:null},allowedFileTypes:{type:Array,default:null},requiredMetaFields:{type:Array,default:[]}};static outlets=["attachment-preview","attachment-preview-container"];connect(){this.uploadedFiles=[],this.element.style.display="none",this.configureUppy(),this.#a(),this.#s()}disconnect(){this.uppy=null}attachmentPreviewOutletConnected(i,e){this.#s()}attachmentPreviewOutletDisconnected(i,e){this.#s()}configureUppy(){this.uppy=new _a({restrictions:{maxFileSize:this.maxFileSizeValue,minFileSize:this.minFileSizeValue,maxTotalFileSize:this.maxTotalSizeValue,maxNumberOfFiles:this.maxFileNumValue,minNumberOfFiles:this.minFileNumValue,allowedFileTypes:this.allowedFileTypesValue,requiredMetaFields:this.requiredMetaFieldsValue}}).use(vr,{inline:!1,closeAfterFinish:!0}).use(ss,{target:vr}),this.#e(),this.#t()}#e(){this.uppy.use(js,{endpoint:"/upload"})}#t(){this.uppy.on("upload-success",this.#o.bind(this))}#i(){let i=document.documentElement.getAttribute("data-bs-theme")||"auto";this.#l.setOptions({theme:i});let e=null;for(;e=this.uploadedFiles.pop();)this.uppy.removeFile(e.id);this.#l.openModal()}#o(i,e){this.uploadedFiles.push(i),this.multiple||this.attachmentPreviewOutlets.forEach(s=>s.remove());let t=e.body.data,r=e.body.url;this.attachmentPreviewContainerOutlet.element.appendChild(this.#n(t,r))}#s(){if(!this.deleteAllTrigger)return;this.attachmentPreviewOutlets.length>1?(this.deleteAllTrigger.style.display="initial",this.deleteAllTrigger.textContent=`Delete ${this.attachmentPreviewOutlets.length}`):this.deleteAllTrigger.style.display="none"}#a(){this.triggerContainer=document.createElement("div"),this.triggerContainer.className="flex items-center gap-2",this.element.insertAdjacentElement("afterend",this.triggerContainer),this.#r(),this.uploadTrigger&&this.triggerContainer.append(this.uploadTrigger),this.deleteAllTrigger&&this.triggerContainer.append(this.deleteAllTrigger)}#r(){let i=this.multiple?"Choose files":"Choose file";this.uploadTrigger=ut.fromTemplate(`<button type="button" class="text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700 inline-flex items-center">
73
73
  <svg class="w-4 h-4 mr-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 16">
74
74
  <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"/>
75
75
  </svg>
76
76
  ${i}
77
- </button>`,!1),this.uploadTrigger.addEventListener("click",this.#i.bind(this))}#c(){this.deleteAllTrigger=ct.fromTemplate(`<button type="button" class="text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-red-600 dark:hover:bg-red-700 focus:outline-none dark:focus:ring-red-800 inline-flex items-center">
77
+ </button>`,!1),this.uploadTrigger.addEventListener("click",this.#i.bind(this))}#c(){this.deleteAllTrigger=ut.fromTemplate(`<button type="button" class="text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-red-600 dark:hover:bg-red-700 focus:outline-none dark:focus:ring-red-800 inline-flex items-center">
78
78
  Delete ${this.attachmentPreviewOutlets.length}
79
- </button>`,!1),this.deleteAllTrigger.addEventListener("click",()=>{confirm("Are you sure?")&&this.attachmentPreviewContainerOutlet.clear()})}#l(i,e){let t=i.metadata.filename,r=t.substring(t.lastIndexOf(".")+1,t.length)||t,s=this.multiple?"multiple":"",n=i.metadata.mime_type,a=["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/bmp","image/tiff"].includes(n.toLowerCase()),l=ct.fromTemplate(this.#u(t,r,n,e,a)),c=ct.fromTemplate(`<input name="${this.element.name}" ${s} type="hidden" autocomplete="off" hidden />`);return c.value=JSON.stringify(i),l.appendChild(c),l}#u(i,e,t,r,s){return`
79
+ </button>`,!1),this.deleteAllTrigger.addEventListener("click",()=>{confirm("Are you sure?")&&this.attachmentPreviewContainerOutlet.clear()})}#n(i,e){let t=i.metadata.filename,r=t.substring(t.lastIndexOf(".")+1,t.length)||t,s=this.multiple?"multiple":"",n=i.metadata.mime_type,a=["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/bmp","image/tiff"].includes(n.toLowerCase()),l=ut.fromTemplate(this.#d(t,r,n,e,a)),c=ut.fromTemplate(`<input name="${this.element.name}" ${s} type="hidden" autocomplete="off" hidden />`);return c.value=JSON.stringify(i),l.appendChild(c),l}#d(i,e,t,r,s){return`
80
80
  <div class="${this.identifierValue} attachment-preview group relative bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm hover:shadow-md transition-all duration-300"
81
81
  data-controller="attachment-preview"
82
82
  data-attachment-preview-mime-type-value="${t}"
@@ -98,7 +98,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&
98
98
  Delete
99
99
  </button>
100
100
  </div>
101
- `}get#o(){return this.uppy.getPlugin("Dashboard")}get multiple(){return this.maxFileNumValue!=1}};function IE(){return ct.fromTemplate(`
101
+ `}get#l(){return this.uppy.getPlugin("Dashboard")}get multiple(){return this.maxFileNumValue!=1}};function iE(){return ut.fromTemplate(`
102
102
  <svg aria-hidden="true" focusable="false" width="25" height="25" viewBox="0 0 25 25">
103
103
  <g fill="#686DE0" fillRule="evenodd">
104
104
  <path d="M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z" fillRule="nonzero" />
@@ -106,38 +106,38 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&
106
106
  <circle cx="7.5" cy="9.5" r="1.5" />
107
107
  </g>
108
108
  </svg>
109
- `)}function DE(){return ct.fromTemplate(`
109
+ `)}function rE(){return ut.fromTemplate(`
110
110
  <svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
111
111
  <path d="M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z" fill="#049BCF" fillRule="nonzero" />
112
112
  </svg>
113
- `)}function NE(){return ct.fromTemplate(`
113
+ `)}function sE(){return ut.fromTemplate(`
114
114
  <svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
115
115
  <path d="M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z" fill="#19AF67" fillRule="nonzero" />
116
116
  </svg>
117
- `)}function BE(){return ct.fromTemplate(`
117
+ `)}function nE(){return ut.fromTemplate(`
118
118
  <svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
119
119
  <path d="M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z" fill="#E2514A" fillRule="nonzero" />
120
120
  </svg>
121
- `)}function UE(){return ct.fromTemplate(`
121
+ `)}function oE(){return ut.fromTemplate(`
122
122
  <svg aria-hidden="true" focusable="false" width="25" height="25" viewBox="0 0 25 25">
123
123
  <path d="M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z" fill="#00C469" fillRule="nonzero" />
124
124
  </svg>
125
- `)}function zE(){return ct.fromTemplate(`
125
+ `)}function aE(){return ut.fromTemplate(`
126
126
  <svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
127
127
  <g fill="#A7AFB7" fillRule="nonzero">
128
128
  <path d="M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z" />
129
129
  <path d="M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z" />
130
130
  </g>
131
131
  </svg>
132
- `)}function HE(){return ct.fromTemplate(`
132
+ `)}function lE(){return ut.fromTemplate(`
133
133
  <svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
134
134
  <path d="M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z" fill="#5A5E69" fillRule="nonzero" />
135
135
  </svg>
136
- `)}function Dh(i){let e={color:"#838999",icon:zE()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:HE()}:t==="image"?{color:"#686de0",icon:IE()}:t==="audio"?{color:"#068dbb",icon:DE()}:t==="video"?{color:"#19af67",icon:NE()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:BE()}:t==="application"&&["zip","x-7z-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:UE()}:e}var gl=class extends re{static targets=["thumbnail","thumbnailLink"];static values={mimeType:String,thumbnailUrl:String};connect(){this.hasThumbnailTarget&&(this.thumbnailUrlValue?this.useThumbnailPreview():this.useMimeIconPreview())}remove(){this.element.remove()}useThumbnailPreview(){let i=ct.fromTemplate(`
136
+ `)}function Nh(i){let e={color:"#838999",icon:aE()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:lE()}:t==="image"?{color:"#686de0",icon:iE()}:t==="audio"?{color:"#068dbb",icon:rE()}:t==="video"?{color:"#19af67",icon:sE()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:nE()}:t==="application"&&["zip","x-7z-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:oE()}:e}var gl=class extends ie{static targets=["thumbnail","thumbnailLink"];static values={mimeType:String,thumbnailUrl:String};connect(){this.hasThumbnailTarget&&(this.thumbnailUrlValue?this.useThumbnailPreview():this.useMimeIconPreview())}remove(){this.element.remove()}useThumbnailPreview(){let i=ut.fromTemplate(`
137
137
  <img src="${this.thumbnailUrlValue}" class="w-full h-full object-cover" />
138
- `);this.thumbnailLinkTarget.innerHTML=null,this.thumbnailLinkTarget.appendChild(i)}useMimeIconPreview(){let i=Dh(this.mimeTypeValue);i.icon.classList.add("w-3/5","h-4/5","rounded-lg","shadow-lg","bg-white","p-2"),this.thumbnailLinkTarget.classList.add("flex","items-center","justify-center"),this.thumbnailLinkTarget.style.backgroundColor=i.color,this.thumbnailLinkTarget.innerHTML=null,this.thumbnailLinkTarget.appendChild(i.icon)}};var vl=class extends re{connect(){}append(i){this.element.appendChild(i)}clear(){this.element.innerHTML=null}};var bl=class extends re{};var yl=class extends re{static targets=["password","checkbox"];connect(){this.checkboxTarget.checked=!1}toggle(){this.passwordTarget.type=="password"?this.passwordTargets.forEach(i=>i.type="text"):this.passwordTargets.forEach(i=>i.type="password")}};function Nh(i){i.register("password-visibility",yl),i.register("sidebar",bl),i.register("resource-header",Go),i.register("nested-resource-form-fields",Ko),i.register("form",Xo),i.register("resource-drop-down",ia),i.register("resource-collapse",ra),i.register("resource-dismiss",sa),i.register("frame-navigator",na),i.register("color-mode",oa),i.register("easymde",fa),i.register("slim-select",ma),i.register("flatpickr",ga),i.register("intl-tel-input",va),i.register("select-navigator",ba),i.register("resource-tab-list",ya),i.register("attachment-input",ml),i.register("attachment-preview",gl),i.register("attachment-preview-container",vl)}(function(i){if(typeof i.requestSubmit=="function")return;i.requestSubmit=function(r){r?(e(r,this),r.click()):(r=document.createElement("input"),r.type="submit",r.hidden=!0,this.appendChild(r),r.click(),this.removeChild(r))};function e(r,s){r instanceof HTMLElement||t(TypeError,"parameter 1 is not of type 'HTMLElement'"),r.type=="submit"||t(TypeError,"The specified element is not a submit button"),r.form==s||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}function t(r,s,n){throw new r("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+s+".",n)}})(HTMLFormElement.prototype);var lv=new WeakMap;function $E(i){let e=i instanceof Element?i:i instanceof Node?i.parentElement:null,t=e?e.closest("input, button"):null;return t?.type=="submit"?t:null}function qE(i){let e=$E(i.target);e&&e.form&&lv.set(e.form,e)}(function(){if("submitter"in Event.prototype)return;let i=window.Event.prototype;if("SubmitEvent"in window){let e=window.SubmitEvent.prototype;if(/Apple Computer/.test(navigator.vendor)&&!("submitter"in e))i=e;else return}addEventListener("click",qE,!0),Object.defineProperty(i,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return lv.get(this.target)}})})();var Ws={eager:"eager",lazy:"lazy"},ki=class i extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new i.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){e=="loading"?this.delegate.loadingStyleChanged():e=="src"?this.delegate.sourceURLChanged():e=="disabled"&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(e){e?this.setAttribute("refresh",e):this.removeAttribute("refresh")}get loading(){return VE(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}};function VE(i){switch(i.toLowerCase()){case"lazy":return Ws.lazy;default:return Ws.eager}}function rt(i){return new URL(i.toString(),document.baseURI)}function hs(i){let e;if(i.hash)return i.hash.slice(1);if(e=i.href.match(/#(.*)$/))return e[1]}function pd(i,e){let t=e?.getAttribute("formaction")||i.getAttribute("action")||i.action;return rt(t)}function jE(i){return(YE(i).match(/\.[^.]*$/)||[])[0]||""}function WE(i){return!!jE(i).match(/^(?:|\.(?:htm|html|xhtml|php))$/)}function GE(i,e){let t=ZE(e);return i.href===rt(t).href||i.href.startsWith(t)}function mr(i,e){return GE(i,e)&&WE(i)}function Bh(i){let e=hs(i);return e!=null?i.href.slice(0,-(e.length+1)):i.href}function wl(i){return Bh(i)}function KE(i,e){return rt(i).href==rt(e).href}function XE(i){return i.pathname.split("/").slice(1)}function YE(i){return XE(i).slice(-1)[0]}function ZE(i){return QE(i.origin+i.pathname)}function QE(i){return i.endsWith("/")?i:i+"/"}var Po=class{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return rt(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}};function Co(i){if(i.getAttribute("data-turbo-eval")=="false")return i;{let e=document.createElement("script"),t=Zs("csp-nonce");return t&&(e.nonce=t),e.textContent=i.textContent,e.async=!1,JE(e,i),e}}function JE(i,e){for(let{name:t,value:r}of e.attributes)i.setAttribute(t,r)}function eT(i){let e=document.createElement("template");return e.innerHTML=i,e.content}function Le(i,{target:e,cancelable:t,detail:r}={}){let s=new CustomEvent(i,{cancelable:t,bubbles:!0,composed:!0,detail:r});return e&&e.isConnected?e.dispatchEvent(s):document.documentElement.dispatchEvent(s),s}function Ks(){return document.visibilityState==="hidden"?uv():cv()}function cv(){return new Promise(i=>requestAnimationFrame(()=>i()))}function uv(){return new Promise(i=>setTimeout(()=>i(),0))}function tT(){return Promise.resolve()}function hv(i=""){return new DOMParser().parseFromString(i,"text/html")}function dv(i,...e){let t=iT(i,e).replace(/^\n/,"").split(`
138
+ `);this.thumbnailLinkTarget.innerHTML=null,this.thumbnailLinkTarget.appendChild(i)}useMimeIconPreview(){let i=Nh(this.mimeTypeValue);i.icon.classList.add("w-3/5","h-4/5","rounded-lg","shadow-lg","bg-white","p-2"),this.thumbnailLinkTarget.classList.add("flex","items-center","justify-center"),this.thumbnailLinkTarget.style.backgroundColor=i.color,this.thumbnailLinkTarget.innerHTML=null,this.thumbnailLinkTarget.appendChild(i.icon)}};var vl=class extends ie{connect(){}append(i){this.element.appendChild(i)}clear(){this.element.innerHTML=null}};var bl=class extends ie{};var yl=class extends ie{static targets=["password","checkbox"];connect(){this.checkboxTarget.checked=!1}toggle(){this.passwordTarget.type=="password"?this.passwordTargets.forEach(i=>i.type="text"):this.passwordTargets.forEach(i=>i.type="password")}};function Bh(i){i.register("password-visibility",yl),i.register("sidebar",bl),i.register("resource-header",Ko),i.register("nested-resource-form-fields",Xo),i.register("form",Yo),i.register("resource-drop-down",ra),i.register("resource-collapse",sa),i.register("resource-dismiss",na),i.register("frame-navigator",oa),i.register("color-mode",aa),i.register("easymde",ma),i.register("slim-select",ga),i.register("flatpickr",va),i.register("intl-tel-input",ba),i.register("select-navigator",ya),i.register("resource-tab-list",wa),i.register("attachment-input",ml),i.register("attachment-preview",gl),i.register("attachment-preview-container",vl)}(function(i){if(typeof i.requestSubmit=="function")return;i.requestSubmit=function(r){r?(e(r,this),r.click()):(r=document.createElement("input"),r.type="submit",r.hidden=!0,this.appendChild(r),r.click(),this.removeChild(r))};function e(r,s){r instanceof HTMLElement||t(TypeError,"parameter 1 is not of type 'HTMLElement'"),r.type=="submit"||t(TypeError,"The specified element is not a submit button"),r.form==s||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}function t(r,s,n){throw new r("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+s+".",n)}})(HTMLFormElement.prototype);var yv=new WeakMap;function cE(i){let e=i instanceof Element?i:i instanceof Node?i.parentElement:null,t=e?e.closest("input, button"):null;return t?.type=="submit"?t:null}function uE(i){let e=cE(i.target);e&&e.form&&yv.set(e.form,e)}(function(){if("submitter"in Event.prototype)return;let i=window.Event.prototype;if("SubmitEvent"in window){let e=window.SubmitEvent.prototype;if(/Apple Computer/.test(navigator.vendor)&&!("submitter"in e))i=e;else return}addEventListener("click",uE,!0),Object.defineProperty(i,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return yv.get(this.target)}})})();var Ks={eager:"eager",lazy:"lazy"},mi=class i extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new i.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){e=="loading"?this.delegate.loadingStyleChanged():e=="src"?this.delegate.sourceURLChanged():e=="disabled"&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(e){e?this.setAttribute("refresh",e):this.removeAttribute("refresh")}get shouldReloadWithMorph(){return this.src&&this.refresh==="morph"}get loading(){return hE(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}};function hE(i){switch(i.toLowerCase()){case"lazy":return Ks.lazy;default:return Ks.eager}}var dE={enabled:!0,progressBarDelay:500,unvisitableExtensions:new Set([".7z",".aac",".apk",".avi",".bmp",".bz2",".css",".csv",".deb",".dmg",".doc",".docx",".exe",".gif",".gz",".heic",".heif",".ico",".iso",".jpeg",".jpg",".js",".json",".m4a",".mkv",".mov",".mp3",".mp4",".mpeg",".mpg",".msi",".ogg",".ogv",".pdf",".pkg",".png",".ppt",".pptx",".rar",".rtf",".svg",".tar",".tif",".tiff",".txt",".wav",".webm",".webp",".wma",".wmv",".xls",".xlsx",".xml",".zip"])};function Co(i){if(i.getAttribute("data-turbo-eval")=="false")return i;{let e=document.createElement("script"),t=kv();return t&&(e.nonce=t),e.textContent=i.textContent,e.async=!1,pE(e,i),e}}function pE(i,e){for(let{name:t,value:r}of e.attributes)i.setAttribute(t,r)}function fE(i){let e=document.createElement("template");return e.innerHTML=i,e.content}function Re(i,{target:e,cancelable:t,detail:r}={}){let s=new CustomEvent(i,{cancelable:t,bubbles:!0,composed:!0,detail:r});return e&&e.isConnected?e.dispatchEvent(s):document.documentElement.dispatchEvent(s),s}function dv(i){i.preventDefault(),i.stopImmediatePropagation()}function Po(){return document.visibilityState==="hidden"?Sv():wv()}function wv(){return new Promise(i=>requestAnimationFrame(()=>i()))}function Sv(){return new Promise(i=>setTimeout(()=>i(),0))}function mE(){return Promise.resolve()}function Tv(i=""){return new DOMParser().parseFromString(i,"text/html")}function Ev(i,...e){let t=gE(i,e).replace(/^\n/,"").split(`
139
139
  `),r=t[0].match(/^\s+/),s=r?r[0].length:0;return t.map(n=>n.slice(s)).join(`
140
- `)}function iT(i,e){return i.reduce((t,r,s)=>{let n=e[s]==null?"":e[s];return t+r+n},"")}function gr(){return Array.from({length:36}).map((i,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function El(i,...e){for(let t of e.map(r=>r?.getAttribute(i)))if(typeof t=="string")return t;return null}function rT(i,...e){return e.some(t=>t&&t.hasAttribute(i))}function Tl(...i){for(let e of i)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function xl(...i){for(let e of i)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function sT(i,e=2e3){return new Promise(t=>{let r=()=>{i.removeEventListener("error",r),i.removeEventListener("load",r),t()};i.addEventListener("load",r,{once:!0}),i.addEventListener("error",r,{once:!0}),setTimeout(t,e)})}function pv(i){switch(i){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function nT(i){return i=="advance"||i=="replace"||i=="restore"}function ds(...i){let e=El("data-turbo-action",...i);return nT(e)?e:null}function fv(i){return document.querySelector(`meta[name="${i}"]`)}function Zs(i){let e=fv(i);return e&&e.content}function oT(i,e){let t=fv(i);return t||(t=document.createElement("meta"),t.setAttribute("name",i),document.head.appendChild(t)),t.setAttribute("content",e),t}function Xs(i,e){if(i instanceof Element)return i.closest(e)||Xs(i.assignedSlot||i.getRootNode()?.host,e)}function fd(i){return!!i&&i.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof i.focus=="function"}function mv(i){return Array.from(i.querySelectorAll("[autofocus]")).find(fd)}async function aT(i,e){let t=e();i(),await cv();let r=e();return[t,r]}function lT(i){if(i.hasAttribute("target")){for(let e of document.getElementsByName(i.target))if(e instanceof HTMLIFrameElement)return!1}return!0}function cT(i){return Xs(i,"a[href]:not([target^=_]):not([download])")}function gv(i){return rt(i.getAttribute("href")||"")}function uT(i,e){let t=null;return(...r)=>{let s=()=>i.apply(this,r);clearTimeout(t),t=setTimeout(s,e)}}var Uh=class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let r=this.values().next().value;this.delete(r)}super.add(e)}},vv=new Uh(20),hT=window.fetch;function bv(i,e={}){let t=new Headers(e.headers||{}),r=gr();return vv.add(r),t.append("X-Turbo-Request-Id",r),hT(i,{...e,headers:t})}function md(i){switch(i.toLowerCase()){case"get":return Xt.get;case"post":return Xt.post;case"put":return Xt.put;case"patch":return Xt.patch;case"delete":return Xt.delete}}var Xt={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function dT(i){switch(i.toLowerCase()){case us.multipart:return us.multipart;case us.plain:return us.plain;default:return us.urlEncoded}}var us={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},ps=class{abortController=new AbortController;#e=e=>{};constructor(e,t,r,s=new URLSearchParams,n=null,o=us.urlEncoded){let[a,l]=rv(rt(r),t,s,o);this.delegate=e,this.url=a,this.target=n,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t,headers:{...this.defaultHeaders},body:l,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(e){let t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,r=md(e)||Xt.get;this.url.search="";let[s,n]=rv(this.url,r,t,this.enctype);this.url=s,this.fetchOptions.body=n,this.fetchOptions.method=r}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){let{fetchOptions:e}=this;this.delegate.prepareRequest(this);let t=await this.#t(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=bv(this.url.href,e);let r=await this.response;return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw this.#i(r)&&this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new Po(e);return Le("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return gd(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){let t=new Promise(s=>this.#e=s),r=Le("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=r.detail.url,r.defaultPrevented&&await t,r}#i(e){return!Le("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function gd(i){return md(i)==Xt.get}function rv(i,e,t,r){let s=Array.from(t).length>0?new URLSearchParams(yv(t)):i.searchParams;return gd(e)?[pT(i,s),null]:r==us.urlEncoded?[i,s]:[i,t]}function yv(i){let e=[];for(let[t,r]of i)r instanceof File||e.push([t,r]);return e}function pT(i,e){let t=new URLSearchParams(yv(e));return i.search=t.toString(),i}var zh=class{started=!1;constructor(e,t){this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{e.slice(-1)[0]?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}},vr=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(eT(e)):e}constructor(e){this.fragment=fT(e)}};function fT(i){for(let e of i.querySelectorAll("turbo-stream")){let t=document.importNode(e,!0);for(let r of t.templateElement.content.querySelectorAll("script"))r.replaceWith(Co(r));e.replaceWith(t)}return i}var mT=100,Hh=class{#e=null;#t=null;get(e){if(this.#t&&this.#t.url===e&&this.#t.expire>Date.now())return this.#t.request}setLater(e,t,r){this.clear(),this.#e=setTimeout(()=>{t.perform(),this.set(e,t,r),this.#e=null},mT)}set(e,t,r){this.#t={url:e,request:t,expire:new Date(new Date().getTime()+r)}}clear(){this.#e&&clearTimeout(this.#e),this.#t=null}},gT=10*1e3,Gs=new Hh,js={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},Fo=class i{state=js.initialized;static confirmMethod(e,t,r){return Promise.resolve(confirm(e))}constructor(e,t,r,s=!1){let n=ET(t,r),o=ST(wT(t,r),n),a=vT(t,r),l=TT(t,r);this.delegate=e,this.formElement=t,this.submitter=r,this.fetchRequest=new ps(this,n,o,a,t,l),this.mustRedirect=s}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=rt(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){let{initialized:e,requesting:t}=js,r=El("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof r=="string"&&!await i.confirmMethod(r,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=js;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=bT(Zs("csrf-param"))||Zs("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(vr.contentType)}requestStarted(e){this.state=js.waiting,this.submitter?.setAttribute("disabled",""),this.setSubmitsWith(),Tl(this.formElement),Le("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){Gs.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(Gs.clear(),this.requestMustRedirect(e)&&yT(t)){let r=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,r)}else this.state=js.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=js.stopped,this.submitter?.removeAttribute("disabled"),this.resetSubmitterText(),xl(this.formElement),Le("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(!(!this.submitter||!this.submitsWith)){if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){let e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){let e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||rT("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function vT(i,e){let t=new FormData(i),r=e?.getAttribute("name"),s=e?.getAttribute("value");return r&&t.append(r,s||""),t}function bT(i){if(i!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(i));if(t){let r=t.split("=").slice(1).join("=");return r?decodeURIComponent(r):void 0}}}function yT(i){return i.statusCode==200&&!i.redirected}function wT(i,e){let t=typeof i.action=="string"?i.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":i.getAttribute("action")||t||""}function ST(i,e){let t=rt(i);return gd(e)&&(t.search=""),t}function ET(i,e){let t=e?.getAttribute("formmethod")||i.getAttribute("method")||"";return md(t.toLowerCase())||Xt.get}function TT(i,e){return dT(e?.getAttribute("formenctype")||i.enctype)}var Qs=class{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return this.getElementForAnchor(e)!=null}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return mv(this.element)}get permanentElements(){return Sv(this.element)}getPermanentElementById(e){return wv(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let r of this.permanentElements){let{id:s}=r,n=e.getPermanentElementById(s);n&&(t[s]=[r,n])}return t}};function wv(i,e){return i.querySelector(`#${e}[data-turbo-permanent]`)}function Sv(i){return i.querySelectorAll("[id][data-turbo-permanent]")}var _o=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){let t=e.target instanceof HTMLFormElement?e.target:void 0,r=e.submitter||void 0;t&&xT(t,r)&&kT(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}}};function xT(i,e){return(e?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"}function kT(i,e){if(e?.hasAttribute("formtarget")||i.hasAttribute("target")){let t=e?.getAttribute("formtarget")||i.target;for(let r of document.getElementsByName(t))if(r instanceof HTMLIFrameElement)return!1;return!0}else return!0}var kl=class{#e=e=>{};#t=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(hs(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){let{isPreview:t,shouldRender:r,willRender:s,newSnapshot:n}=e,o=s;if(r)try{this.renderPromise=new Promise(d=>this.#e=d),this.renderer=e,await this.prepareToRenderSnapshot(e);let a=new Promise(d=>this.#t=d),l={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(n,l)||await a,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(n,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(void 0),delete this.renderPromise}else o&&this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(e){this.element.setAttribute("data-turbo-visit-direction",e)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}},$h=class extends kl{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new Qs(this.element)}},Al=class{constructor(e,t){this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.respondsToEventTarget(e.target)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.respondsToEventTarget(e.target)&&e.target instanceof Element&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};respondsToEventTarget(e){let t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}},Pl=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){let t=e.composedPath&&e.composedPath()[0]||e.target,r=cT(t);if(r&&lT(r)){let s=gv(r);this.delegate.willFollowLinkToLocation(r,s,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(r,s))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},Cl=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new Pl(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,r){return this.delegate.willSubmitFormLinkToLocation(e,t,r)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){let r=document.createElement("form"),s="hidden";for(let[f,y]of t.searchParams)r.append(Object.assign(document.createElement("input"),{type:s,name:f,value:y}));let n=Object.assign(t,{search:""});r.setAttribute("data-turbo","true"),r.setAttribute("action",n.href),r.setAttribute("hidden","");let o=e.getAttribute("data-turbo-method");o&&r.setAttribute("method",o);let a=e.getAttribute("data-turbo-frame");a&&r.setAttribute("data-turbo-frame",a);let l=ds(e);l&&r.setAttribute("data-turbo-action",l);let c=e.getAttribute("data-turbo-confirm");c&&r.setAttribute("data-turbo-confirm",c),e.hasAttribute("data-turbo-stream")&&r.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,r),document.body.appendChild(r),r.addEventListener("turbo:submit-end",()=>r.remove(),{once:!0}),requestAnimationFrame(()=>r.requestSubmit())}},Fl=class{static async preservingPermanentElements(e,t,r){let s=new this(e,t);s.enter(),await r(),s.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(let e in this.permanentElementMap){let[t,r]=this.permanentElementMap[e];this.delegate.enteringBardo(t,r),this.replaceNewPermanentElementWithPlaceholder(r)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=AT(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){this.getPlaceholderById(e.id)?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function AT(i){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",i.id),e}var Oo=class{#e=null;constructor(e,t,r,s,n=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=s,this.willRender=n,this.renderElement=r,this.promise=new Promise((o,a)=>this.resolvingFunctions={resolve:o,reject:a})}get shouldRender(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await Fl.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){let e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}enteringBardo(e){this.#e||e.contains(this.currentSnapshot.activeElement)&&(this.#e=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#e)&&this.#e instanceof HTMLElement&&(this.#e.focus(),this.#e=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}},Ro=class extends Oo{static renderElement(e,t){let r=document.createRange();r.selectNodeContents(e),r.deleteContents();let s=t,n=s.ownerDocument?.createRange();n&&(n.selectNodeContents(s),e.appendChild(n.extractContents()))}constructor(e,t,r,s,n,o=!0){super(t,r,s,n,o),this.delegate=e}get shouldRender(){return!0}async render(){await Ks(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await Ks(),this.focusFirstAutofocusableElement(),await Ks(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=PT(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=CT(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:r}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=Co(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function PT(i,e){return i=="end"||i=="start"||i=="center"||i=="nearest"?i:e}function CT(i,e){return i=="auto"||i=="smooth"?i:e}var qh=class i{static animationDuration=300;static get defaultCSS(){return dv`
140
+ `)}function gE(i,e){return i.reduce((t,r,s)=>{let n=e[s]==null?"":e[s];return t+r+n},"")}function yr(){return Array.from({length:36}).map((i,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function Tl(i,...e){for(let t of e.map(r=>r?.getAttribute(i)))if(typeof t=="string")return t;return null}function vE(i,...e){return e.some(t=>t&&t.hasAttribute(i))}function El(...i){for(let e of i)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function xl(...i){for(let e of i)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function bE(i,e=2e3){return new Promise(t=>{let r=()=>{i.removeEventListener("error",r),i.removeEventListener("load",r),t()};i.addEventListener("load",r,{once:!0}),i.addEventListener("error",r,{once:!0}),setTimeout(t,e)})}function xv(i){switch(i){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function yE(i){return i=="advance"||i=="replace"||i=="restore"}function ps(...i){let e=Tl("data-turbo-action",...i);return yE(e)?e:null}function bd(i){return document.querySelector(`meta[name="${i}"]`)}function kl(i){let e=bd(i);return e&&e.content}function kv(){let i=bd("csp-nonce");if(i){let{nonce:e,content:t}=i;return e==""?t:e}}function wE(i,e){let t=bd(i);return t||(t=document.createElement("meta"),t.setAttribute("name",i),document.head.appendChild(t)),t.setAttribute("content",e),t}function Ys(i,e){if(i instanceof Element)return i.closest(e)||Ys(i.assignedSlot||i.getRootNode()?.host,e)}function yd(i){return!!i&&i.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof i.focus=="function"}function Av(i){return Array.from(i.querySelectorAll("[autofocus]")).find(yd)}async function SE(i,e){let t=e();i(),await wv();let r=e();return[t,r]}function Pv(i){if(i==="_blank")return!1;if(i){for(let e of document.getElementsByName(i))if(e instanceof HTMLIFrameElement)return!1;return!0}else return!0}function Cv(i){return Ys(i,"a[href]:not([target^=_]):not([download])")}function Fv(i){return st(i.getAttribute("href")||"")}function TE(i,e){let t=null;return(...r)=>{let s=()=>i.apply(this,r);clearTimeout(t),t=setTimeout(s,e)}}var EE={"aria-disabled":{beforeSubmit:i=>{i.setAttribute("aria-disabled","true"),i.addEventListener("click",dv)},afterSubmit:i=>{i.removeAttribute("aria-disabled"),i.removeEventListener("click",dv)}},disabled:{beforeSubmit:i=>i.disabled=!0,afterSubmit:i=>i.disabled=!1}},Uh=class{#e=null;constructor(e){Object.assign(this,e)}get submitter(){return this.#e}set submitter(e){this.#e=EE[e]||e}},xE=new Uh({mode:"on",submitter:"disabled"}),rt={drive:dE,forms:xE};function st(i){return new URL(i.toString(),document.baseURI)}function fs(i){let e;if(i.hash)return i.hash.slice(1);if(e=i.href.match(/#(.*)$/))return e[1]}function wd(i,e){let t=e?.getAttribute("formaction")||i.getAttribute("action")||i.action;return st(t)}function kE(i){return(FE(i).match(/\.[^.]*$/)||[])[0]||""}function AE(i,e){let t=_E(e);return i.href===st(t).href||i.href.startsWith(t)}function br(i,e){return AE(i,e)&&!rt.drive.unvisitableExtensions.has(kE(i))}function zh(i){let e=fs(i);return e!=null?i.href.slice(0,-(e.length+1)):i.href}function wl(i){return zh(i)}function PE(i,e){return st(i).href==st(e).href}function CE(i){return i.pathname.split("/").slice(1)}function FE(i){return CE(i).slice(-1)[0]}function _E(i){return OE(i.origin+i.pathname)}function OE(i){return i.endsWith("/")?i:i+"/"}var Fo=class{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return st(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}},Hh=class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let r=this.values().next().value;this.delete(r)}super.add(e)}},_v=new Hh(20),RE=window.fetch;function Ov(i,e={}){let t=new Headers(e.headers||{}),r=yr();return _v.add(r),t.append("X-Turbo-Request-Id",r),RE(i,{...e,headers:t})}function Sd(i){switch(i.toLowerCase()){case"get":return Yt.get;case"post":return Yt.post;case"put":return Yt.put;case"patch":return Yt.patch;case"delete":return Yt.delete}}var Yt={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function LE(i){switch(i.toLowerCase()){case ds.multipart:return ds.multipart;case ds.plain:return ds.plain;default:return ds.urlEncoded}}var ds={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},ms=class{abortController=new AbortController;#e=e=>{};constructor(e,t,r,s=new URLSearchParams,n=null,o=ds.urlEncoded){let[a,l]=pv(st(r),t,s,o);this.delegate=e,this.url=a,this.target=n,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t.toUpperCase(),headers:{...this.defaultHeaders},body:l,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(e){let t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,r=Sd(e)||Yt.get;this.url.search="";let[s,n]=pv(this.url,r,t,this.enctype);this.url=s,this.fetchOptions.body=n,this.fetchOptions.method=r.toUpperCase()}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){let{fetchOptions:e}=this;this.delegate.prepareRequest(this);let t=await this.#t(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=Ov(this.url.href,e);let r=await this.response;return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw this.#i(r)&&this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new Fo(e);return Re("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return Td(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){let t=new Promise(s=>this.#e=s),r=Re("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=r.detail.url,r.defaultPrevented&&await t,r}#i(e){return!Re("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function Td(i){return Sd(i)==Yt.get}function pv(i,e,t,r){let s=Array.from(t).length>0?new URLSearchParams(Rv(t)):i.searchParams;return Td(e)?[ME(i,s),null]:r==ds.urlEncoded?[i,s]:[i,t]}function Rv(i){let e=[];for(let[t,r]of i)r instanceof File||e.push([t,r]);return e}function ME(i,e){let t=new URLSearchParams(Rv(e));return i.search=t.toString(),i}var $h=class{started=!1;constructor(e,t){this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{e.slice(-1)[0]?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}},wr=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(fE(e)):e}constructor(e){this.fragment=IE(e)}};function IE(i){for(let e of i.querySelectorAll("turbo-stream")){let t=document.importNode(e,!0);for(let r of t.templateElement.content.querySelectorAll("script"))r.replaceWith(Co(r));e.replaceWith(t)}return i}var DE=100,qh=class{#e=null;#t=null;get(e){if(this.#t&&this.#t.url===e&&this.#t.expire>Date.now())return this.#t.request}setLater(e,t,r){this.clear(),this.#e=setTimeout(()=>{t.perform(),this.set(e,t,r),this.#e=null},DE)}set(e,t,r){this.#t={url:e,request:t,expire:new Date(new Date().getTime()+r)}}clear(){this.#e&&clearTimeout(this.#e),this.#t=null}},NE=10*1e3,Xs=new qh,Gs={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},Al=class i{state=Gs.initialized;static confirmMethod(e){return Promise.resolve(confirm(e))}constructor(e,t,r,s=!1){let n=qE(t,r),o=$E(HE(t,r),n),a=BE(t,r),l=VE(t,r);this.delegate=e,this.formElement=t,this.submitter=r,this.fetchRequest=new ms(this,n,o,a,t,l),this.mustRedirect=s}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=st(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){let{initialized:e,requesting:t}=Gs,r=Tl("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof r=="string"&&!await(typeof rt.forms.confirm=="function"?rt.forms.confirm:i.confirmMethod)(r,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=Gs;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=UE(kl("csrf-param"))||kl("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(wr.contentType)}requestStarted(e){this.state=Gs.waiting,this.submitter&&rt.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),El(this.formElement),Re("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){Xs.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(Xs.clear(),this.requestMustRedirect(e)&&zE(t)){let r=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,r)}else this.state=Gs.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=Gs.stopped,this.submitter&&rt.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),xl(this.formElement),Re("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(!(!this.submitter||!this.submitsWith)){if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){let e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){let e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||vE("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function BE(i,e){let t=new FormData(i),r=e?.getAttribute("name"),s=e?.getAttribute("value");return r&&t.append(r,s||""),t}function UE(i){if(i!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(i));if(t){let r=t.split("=").slice(1).join("=");return r?decodeURIComponent(r):void 0}}}function zE(i){return i.statusCode==200&&!i.redirected}function HE(i,e){let t=typeof i.action=="string"?i.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":i.getAttribute("action")||t||""}function $E(i,e){let t=st(i);return Td(e)&&(t.search=""),t}function qE(i,e){let t=e?.getAttribute("formmethod")||i.getAttribute("method")||"";return Sd(t.toLowerCase())||Yt.get}function VE(i,e){return LE(e?.getAttribute("formenctype")||i.enctype)}var Qs=class{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return this.getElementForAnchor(e)!=null}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return Av(this.element)}get permanentElements(){return Mv(this.element)}getPermanentElementById(e){return Lv(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let r of this.permanentElements){let{id:s}=r,n=e.getPermanentElementById(s);n&&(t[s]=[r,n])}return t}};function Lv(i,e){return i.querySelector(`#${e}[data-turbo-permanent]`)}function Mv(i){return i.querySelectorAll("[id][data-turbo-permanent]")}var _o=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){let t=e.target instanceof HTMLFormElement?e.target:void 0,r=e.submitter||void 0;t&&jE(t,r)&&WE(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}}};function jE(i,e){return(e?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"}function WE(i,e){let t=e?.getAttribute("formtarget")||i.getAttribute("target");return Pv(t)}var Pl=class{#e=e=>{};#t=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(fs(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){let{isPreview:t,shouldRender:r,willRender:s,newSnapshot:n}=e,o=s;if(r)try{this.renderPromise=new Promise(d=>this.#e=d),this.renderer=e,await this.prepareToRenderSnapshot(e);let a=new Promise(d=>this.#t=d),l={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(n,l)||await a,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(n,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(void 0),delete this.renderPromise}else o&&this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(e){this.element.setAttribute("data-turbo-visit-direction",e)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}},Vh=class extends Pl{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new Qs(this.element)}},Cl=class{constructor(e,t){this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.clickEventIsSignificant(e)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.clickEventIsSignificant(e)&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};clickEventIsSignificant(e){let t=e.composed?e.target?.parentElement:e.target,r=Cv(t)||t;return r instanceof Element&&r.closest("turbo-frame, html")==this.element}},Fl=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){let t=e.composedPath&&e.composedPath()[0]||e.target,r=Cv(t);if(r&&Pv(r.target)){let s=Fv(r);this.delegate.willFollowLinkToLocation(r,s,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(r,s))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},_l=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new Fl(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,r){return this.delegate.willSubmitFormLinkToLocation(e,t,r)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){let r=document.createElement("form"),s="hidden";for(let[p,y]of t.searchParams)r.append(Object.assign(document.createElement("input"),{type:s,name:p,value:y}));let n=Object.assign(t,{search:""});r.setAttribute("data-turbo","true"),r.setAttribute("action",n.href),r.setAttribute("hidden","");let o=e.getAttribute("data-turbo-method");o&&r.setAttribute("method",o);let a=e.getAttribute("data-turbo-frame");a&&r.setAttribute("data-turbo-frame",a);let l=ps(e);l&&r.setAttribute("data-turbo-action",l);let c=e.getAttribute("data-turbo-confirm");c&&r.setAttribute("data-turbo-confirm",c),e.hasAttribute("data-turbo-stream")&&r.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,r),document.body.appendChild(r),r.addEventListener("turbo:submit-end",()=>r.remove(),{once:!0}),requestAnimationFrame(()=>r.requestSubmit())}},Ol=class{static async preservingPermanentElements(e,t,r){let s=new this(e,t);s.enter(),await r(),s.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(let e in this.permanentElementMap){let[t,r]=this.permanentElementMap[e];this.delegate.enteringBardo(t,r),this.replaceNewPermanentElementWithPlaceholder(r)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=GE(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){this.getPlaceholderById(e.id)?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function GE(i){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",i.id),e}var Oo=class{#e=null;static renderElement(e,t){}constructor(e,t,r,s=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=r,this.willRender=s,this.renderElement=this.constructor.renderElement,this.promise=new Promise((n,o)=>this.resolvingFunctions={resolve:n,reject:o})}get shouldRender(){return!0}get shouldAutofocus(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await Ol.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){if(this.shouldAutofocus){let e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}}enteringBardo(e){this.#e||e.contains(this.currentSnapshot.activeElement)&&(this.#e=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#e)&&this.#e instanceof HTMLElement&&(this.#e.focus(),this.#e=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}},Ro=class extends Oo{static renderElement(e,t){let r=document.createRange();r.selectNodeContents(e),r.deleteContents();let s=t,n=s.ownerDocument?.createRange();n&&(n.selectNodeContents(s),e.appendChild(n.extractContents()))}constructor(e,t,r,s,n,o=!0){super(t,r,s,n,o),this.delegate=e}get shouldRender(){return!0}async render(){await Po(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await Po(),this.focusFirstAutofocusableElement(),await Po(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=KE(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=XE(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:r}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=Co(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function KE(i,e){return i=="end"||i=="start"||i=="center"||i=="nearest"?i:e}function XE(i,e){return i=="auto"||i=="smooth"?i:e}var YE=function(){let i=new Set,e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:y,afterNodeAdded:y,beforeNodeMorphed:y,afterNodeMorphed:y,beforeNodeRemoved:y,afterNodeRemoved:y,beforeAttributeUpdated:y},head:{style:"merge",shouldPreserve:function(E){return E.getAttribute("im-preserve")==="true"},shouldReAppend:function(E){return E.getAttribute("im-re-append")==="true"},shouldRemove:y,afterHeadMorphed:y}};function t(E,k,A={}){E instanceof Document&&(E=E.documentElement),typeof k=="string"&&(k=I(k));let $=z(k),W=x(E,$,A);return r(E,$,W)}function r(E,k,A){if(A.head.block){let $=E.querySelector("head"),W=k.querySelector("head");if($&&W){let H=p(W,$,A);Promise.all(H).then(function(){r(E,k,Object.assign(A,{head:{block:!1,ignore:!0}}))});return}}if(A.morphStyle==="innerHTML")return o(k,E,A),E.children;if(A.morphStyle==="outerHTML"||A.morphStyle==null){let $=j(k,E,A),W=$?.previousSibling,H=$?.nextSibling,J=n(E,$,A);return $?L(W,J,H):[]}else throw"Do not understand how to morph style "+A.morphStyle}function s(E,k){return k.ignoreActiveValue&&E===document.activeElement&&E!==document.body}function n(E,k,A){if(!(A.ignoreActive&&E===document.activeElement))return k==null?A.callbacks.beforeNodeRemoved(E)===!1?E:(E.remove(),A.callbacks.afterNodeRemoved(E),null):F(E,k)?(A.callbacks.beforeNodeMorphed(E,k)===!1||(E instanceof HTMLHeadElement&&A.head.ignore||(E instanceof HTMLHeadElement&&A.head.style!=="morph"?p(k,E,A):(l(k,E,A),s(E,A)||o(k,E,A))),A.callbacks.afterNodeMorphed(E,k)),E):A.callbacks.beforeNodeRemoved(E)===!1||A.callbacks.beforeNodeAdded(k)===!1?E:(E.parentElement.replaceChild(k,E),A.callbacks.afterNodeAdded(k),A.callbacks.afterNodeRemoved(E),k)}function o(E,k,A){let $=E.firstChild,W=k.firstChild,H;for(;$;){if(H=$,$=H.nextSibling,W==null){if(A.callbacks.beforeNodeAdded(H)===!1)return;k.appendChild(H),A.callbacks.afterNodeAdded(H),re(A,H);continue}if(P(H,W,A)){n(W,H,A),W=W.nextSibling,re(A,H);continue}let J=D(E,k,H,W,A);if(J){W=R(W,J,A),n(J,H,A),re(A,H);continue}let ee=q(E,k,H,W,A);if(ee){W=R(W,ee,A),n(ee,H,A),re(A,H);continue}if(A.callbacks.beforeNodeAdded(H)===!1)return;k.insertBefore(H,W),A.callbacks.afterNodeAdded(H),re(A,H)}for(;W!==null;){let J=W;W=W.nextSibling,Z(J,A)}}function a(E,k,A,$){return E==="value"&&$.ignoreActiveValue&&k===document.activeElement?!0:$.callbacks.beforeAttributeUpdated(E,k,A)===!1}function l(E,k,A){let $=E.nodeType;if($===1){let W=E.attributes,H=k.attributes;for(let J of W)a(J.name,k,"update",A)||k.getAttribute(J.name)!==J.value&&k.setAttribute(J.name,J.value);for(let J=H.length-1;0<=J;J--){let ee=H[J];a(ee.name,k,"remove",A)||E.hasAttribute(ee.name)||k.removeAttribute(ee.name)}}($===8||$===3)&&k.nodeValue!==E.nodeValue&&(k.nodeValue=E.nodeValue),s(k,A)||d(E,k,A)}function c(E,k,A,$){if(E[A]!==k[A]){let W=a(A,k,"update",$);W||(k[A]=E[A]),E[A]?W||k.setAttribute(A,E[A]):a(A,k,"remove",$)||k.removeAttribute(A)}}function d(E,k,A){if(E instanceof HTMLInputElement&&k instanceof HTMLInputElement&&E.type!=="file"){let $=E.value,W=k.value;c(E,k,"checked",A),c(E,k,"disabled",A),E.hasAttribute("value")?$!==W&&(a("value",k,"update",A)||(k.setAttribute("value",$),k.value=$)):a("value",k,"remove",A)||(k.value="",k.removeAttribute("value"))}else if(E instanceof HTMLOptionElement)c(E,k,"selected",A);else if(E instanceof HTMLTextAreaElement&&k instanceof HTMLTextAreaElement){let $=E.value,W=k.value;if(a("value",k,"update",A))return;$!==W&&(k.value=$),k.firstChild&&k.firstChild.nodeValue!==$&&(k.firstChild.nodeValue=$)}}function p(E,k,A){let $=[],W=[],H=[],J=[],ee=A.head.style,Ae=new Map;for(let ce of E.children)Ae.set(ce.outerHTML,ce);for(let ce of k.children){let Le=Ae.has(ce.outerHTML),De=A.head.shouldReAppend(ce),He=A.head.shouldPreserve(ce);Le||He?De?W.push(ce):(Ae.delete(ce.outerHTML),H.push(ce)):ee==="append"?De&&(W.push(ce),J.push(ce)):A.head.shouldRemove(ce)!==!1&&W.push(ce)}J.push(...Ae.values());let oe=[];for(let ce of J){let Le=document.createRange().createContextualFragment(ce.outerHTML).firstChild;if(A.callbacks.beforeNodeAdded(Le)!==!1){if(Le.href||Le.src){let De=null,He=new Promise(function(gi){De=gi});Le.addEventListener("load",function(){De()}),oe.push(He)}k.appendChild(Le),A.callbacks.afterNodeAdded(Le),$.push(Le)}}for(let ce of W)A.callbacks.beforeNodeRemoved(ce)!==!1&&(k.removeChild(ce),A.callbacks.afterNodeRemoved(ce));return A.head.afterHeadMorphed(k,{added:$,kept:H,removed:W}),oe}function y(){}function v(E){let k={};return Object.assign(k,e),Object.assign(k,E),k.callbacks={},Object.assign(k.callbacks,e.callbacks),Object.assign(k.callbacks,E.callbacks),k.head={},Object.assign(k.head,e.head),Object.assign(k.head,E.head),k}function x(E,k,A){return A=v(A),{target:E,newContent:k,config:A,morphStyle:A.morphStyle,ignoreActive:A.ignoreActive,ignoreActiveValue:A.ignoreActiveValue,idMap:We(E,k),deadIds:new Set,callbacks:A.callbacks,head:A.head}}function P(E,k,A){return E==null||k==null?!1:E.nodeType===k.nodeType&&E.tagName===k.tagName?E.id!==""&&E.id===k.id?!0:le(A,E,k)>0:!1}function F(E,k){return E==null||k==null?!1:E.nodeType===k.nodeType&&E.tagName===k.tagName}function R(E,k,A){for(;E!==k;){let $=E;E=E.nextSibling,Z($,A)}return re(A,k),k.nextSibling}function D(E,k,A,$,W){let H=le(W,A,k),J=null;if(H>0){let ee=$,Ae=0;for(;ee!=null;){if(P(A,ee,W))return ee;if(Ae+=le(W,ee,E),Ae>H)return null;ee=ee.nextSibling}}return J}function q(E,k,A,$,W){let H=$,J=A.nextSibling,ee=0;for(;H!=null;){if(le(W,H,E)>0)return null;if(F(A,H))return H;if(F(J,H)&&(ee++,J=J.nextSibling,ee>=2))return null;H=H.nextSibling}return H}function I(E){let k=new DOMParser,A=E.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(A.match(/<\/html>/)||A.match(/<\/head>/)||A.match(/<\/body>/)){let $=k.parseFromString(E,"text/html");if(A.match(/<\/html>/))return $.generatedByIdiomorph=!0,$;{let W=$.firstChild;return W?(W.generatedByIdiomorph=!0,W):null}}else{let W=k.parseFromString("<body><template>"+E+"</template></body>","text/html").body.querySelector("template").content;return W.generatedByIdiomorph=!0,W}}function z(E){if(E==null)return document.createElement("div");if(E.generatedByIdiomorph)return E;if(E instanceof Node){let k=document.createElement("div");return k.append(E),k}else{let k=document.createElement("div");for(let A of[...E])k.append(A);return k}}function L(E,k,A){let $=[],W=[];for(;E!=null;)$.push(E),E=E.previousSibling;for(;$.length>0;){let H=$.pop();W.push(H),k.parentElement.insertBefore(H,k)}for(W.push(k);A!=null;)$.push(A),W.push(A),A=A.nextSibling;for(;$.length>0;)k.parentElement.insertBefore($.pop(),k.nextSibling);return W}function j(E,k,A){let $;$=E.firstChild;let W=$,H=0;for(;$;){let J=K($,k,A);J>H&&(W=$,H=J),$=$.nextSibling}return W}function K(E,k,A){return F(E,k)?.5+le(A,E,k):0}function Z(E,k){re(k,E),k.callbacks.beforeNodeRemoved(E)!==!1&&(E.remove(),k.callbacks.afterNodeRemoved(E))}function ne(E,k){return!E.deadIds.has(k)}function Y(E,k,A){return(E.idMap.get(A)||i).has(k)}function re(E,k){let A=E.idMap.get(k)||i;for(let $ of A)E.deadIds.add($)}function le(E,k,A){let $=E.idMap.get(k)||i,W=0;for(let H of $)ne(E,H)&&Y(E,H,A)&&++W;return W}function ke(E,k){let A=E.parentElement,$=E.querySelectorAll("[id]");for(let W of $){let H=W;for(;H!==A&&H!=null;){let J=k.get(H);J==null&&(J=new Set,k.set(H,J)),J.add(W.id),H=H.parentElement}}}function We(E,k){let A=new Map;return ke(E,A),ke(k,A),A}return{morph:t,defaults:e}}();function Ed(i,e,{callbacks:t,...r}={}){YE.morph(i,e,{...r,callbacks:new jh(t)})}function Iv(i,e){Ed(i,e.children,{morphStyle:"innerHTML"})}var jh=class{#e;constructor({beforeNodeMorphed:e}={}){this.#e=e||(()=>!0)}beforeNodeAdded=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));beforeNodeMorphed=(e,t)=>{if(e instanceof Element)return!e.hasAttribute("data-turbo-permanent")&&this.#e(e,t)?!Re("turbo:before-morph-element",{cancelable:!0,target:e,detail:{currentElement:e,newElement:t}}).defaultPrevented:!1};beforeAttributeUpdated=(e,t,r)=>!Re("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:r}}).defaultPrevented;beforeNodeRemoved=e=>this.beforeNodeMorphed(e);afterNodeMorphed=(e,t)=>{e instanceof Element&&Re("turbo:morph-element",{target:e,detail:{currentElement:e,newElement:t}})}},Wh=class extends Ro{static renderElement(e,t){Re("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),Iv(e,t)}async preservingPermanentElements(e){return await e()}},Gh=class i{static animationDuration=300;static get defaultCSS(){return Ev`
141
141
  .turbo-progress-bar {
142
142
  position: fixed;
143
143
  display: block;
@@ -151,7 +151,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&
151
151
  opacity ${i.animationDuration/2}ms ${i.animationDuration/2}ms ease-in;
152
152
  transform: translate3d(0, 0, 0);
153
153
  }
154
- `}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,i.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,i.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");return e.type="text/css",e.textContent=i.defaultCSS,this.cspNonce&&(e.nonce=this.cspNonce),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}get cspNonce(){return Zs("csp-nonce")}},Vh=class extends Qs{detailsByOuterHTML=this.children.filter(e=>!RT(e)).map(e=>IT(e)).reduce((e,t)=>{let{outerHTML:r}=t,s=r in e?e[r]:{type:FT(t),tracked:_T(t),elements:[]};return{...e,[r]:{...s,elements:[...s.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(r=>!(r in t.detailsByOuterHTML)).map(r=>this.detailsByOuterHTML[r]).filter(({type:r})=>r==e).map(({elements:[r]})=>r)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:r,tracked:s,elements:n}=this.detailsByOuterHTML[t];return r==null&&!s?[...e,...n]:n.length>1?[...e,...n.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,r)=>{let{elements:[s]}=this.detailsByOuterHTML[r];return MT(s,e)?s:t},void 0|void 0)}};function FT(i){if(OT(i))return"script";if(LT(i))return"stylesheet"}function _T(i){return i.getAttribute("data-turbo-track")=="reload"}function OT(i){return i.localName=="script"}function RT(i){return i.localName=="noscript"}function LT(i){let e=i.localName;return e=="style"||e=="link"&&i.getAttribute("rel")=="stylesheet"}function MT(i,e){return i.localName=="meta"&&i.getAttribute("name")==e}function IT(i){return i.hasAttribute("nonce")&&i.setAttribute("nonce",""),i}var pi=class i extends Qs{static fromHTMLString(e=""){return this.fromDocument(hv(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:r}){return new this(e,t,new Vh(r))}constructor(e,t,r){super(t),this.documentElement=e,this.headSnapshot=r}clone(){let e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),r=e.querySelectorAll("select");for(let[s,n]of t.entries()){let o=r[s];for(let a of o.selectedOptions)a.selected=!1;for(let a of n.selectedOptions)o.options[a.index].selected=!0}for(let s of e.querySelectorAll('input[type="password"]'))s.value="";return new i(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){let e=this.getSetting("root")??"/";return rt(e)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return this.headSnapshot.getMetaValue("view-transition")==="same-origin"}get shouldMorphPage(){return this.getSetting("refresh-method")==="morph"}get shouldPreserveScrollPosition(){return this.getSetting("refresh-scroll")==="preserve"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},jh=class{#e=!1;#t=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#e?(this.#e=!0,this.#t=this.#t.then(async()=>{await document.startViewTransition(t).finished})):this.#t=this.#t.then(t),this.#t}get viewTransitionsAvailable(){return document.startViewTransition}},DT={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},Sl={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},Ji={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},Ys={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},NT={advance:"forward",restore:"back",replace:"none"},Wh=class{identifier=gr();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=Ji.initialized;viewTransitioner=new jh;constructor(e,t,r,s={}){this.delegate=e,this.location=t,this.restorationIdentifier=r||gr();let{action:n,historyChanged:o,referrer:a,snapshot:l,snapshotHTML:c,response:d,visitCachedSnapshot:f,willRender:y,updateHistory:v,shouldCacheSnapshot:x,acceptsStreamResponse:P,direction:C}={...DT,...s};this.action=n,this.historyChanged=o,this.referrer=a,this.snapshot=l,this.snapshotHTML=c,this.response=d,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=f,this.willRender=y,this.updateHistory=v,this.scrolled=!y,this.shouldCacheSnapshot=x,this.acceptsStreamResponse=P,this.direction=C||NT[n]}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==Ji.initialized&&(this.recordTimingMetric(Sl.visitStart),this.state=Ji.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Ji.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Ji.canceled)}complete(){this.state==Ji.started&&(this.recordTimingMetric(Sl.visitEnd),this.adapter.visitCompleted(this),this.state=Ji.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Ji.started&&(this.state=Ji.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=this.location.href===this.referrer?.href?"replace":this.action,t=pv(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new ps(this,Xt.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(Sl.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;sv(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(Sl.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,sv(e)&&t!=null){let r=pi.fromHTMLString(t);await this.renderPageSnapshot(r,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(pi.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!hs(this.location)||e.hasAnchor(hs(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return pi.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage||this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(vr.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let r=await t.responseHTML,{redirected:s,statusCode:n}=t;r==null?this.recordResponse({statusCode:Ys.contentTypeMismatch,redirected:s}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:n,responseHTML:r,redirected:s}))}async requestFailedWithResponse(e,t){let r=await t.responseHTML,{redirected:s,statusCode:n}=t;r==null?this.recordResponse({statusCode:Ys.contentTypeMismatch,redirected:s}):this.recordResponse({statusCode:n,responseHTML:r,redirected:s})}requestErrored(e,t){this.recordResponse({statusCode:Ys.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&!this.view.shouldPreserveScrollPosition(this)&&(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=hs(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),this.frame=await Ks(),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function sv(i){return i>=200&&i<300}var Gh=class{progressBar=new qh;constructor(e){this.session=e}visitProposedToLocation(e,t){mr(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||gr(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,e.loadCachedSnapshot(),e.issueRequest(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case Ys.networkFailure:case Ys.timeoutFailure:case Ys.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){Le("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}},Kh=class{selector="[data-turbo-temporary]";deprecatedSelector="[data-turbo-cache=false]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(let t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){let e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}},Xh=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new Al(this,t),this.formSubmitObserver=new _o(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,r){return this.#t(e)}linkClickIntercepted(e,t,r){let s=this.#i(e);s&&s.delegate.linkClickIntercepted(e,t,r)}willSubmitForm(e,t){return e.closest("turbo-frame")==null&&this.#e(e,t)&&this.#t(e,t)}formSubmitted(e,t){let r=this.#i(e,t);r&&r.delegate.formSubmitted(e,t)}#e(e,t){let r=pd(e,t),s=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),n=rt(s?.content??"/");return this.#t(e,t)&&mr(r,n)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let s=this.#i(e,t);return s?s!=e.closest("turbo-frame"):!1}else return!1}#i(e,t){let r=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(r&&r!="_top"){let s=this.element.querySelector(`#${r}:not([disabled])`);if(s instanceof ki)return s}}},Yh=class{location;restorationIdentifier=gr();restorationData={};started=!1;pageLoaded=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,r=gr()){e===history.pushState&&++this.currentIndex;let s={turbo:{restorationIdentifier:r,restorationIndex:this.currentIndex}};e.call(history,s,"",t.href),this.location=t,this.restorationIdentifier=r}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,r=this.restorationData[t];this.restorationData[t]={...r,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{if(this.shouldHandlePopState()){let{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);let{restorationIdentifier:r,restorationIndex:s}=t;this.restorationIdentifier=r;let n=s>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,r,n),this.currentIndex=s}}};onPageLoad=async e=>{await tT(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},Zh=class{started=!1;#e=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",this.#t,{once:!0}):this.#t())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#s,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#n,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#s,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#n,!0),this.started=!0};#i=e=>{if(Zs("turbo-prefetch")==="false")return;let t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#c(t)){let s=t,n=gv(s);if(this.delegate.canPrefetchRequestToLocation(s,n)){this.#e=s;let o=new ps(this,Xt.get,n,new URLSearchParams,t);Gs.setLater(n.toString(),o,this.#a)}}};#s=e=>{e.target===this.#e&&this.#r()};#r=()=>{Gs.clear(),this.#e=null};#n=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="get"){let t=Gs.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),Gs.clear()}};prepareRequest(e){let t=e.target;e.headers["X-Sec-Purpose"]="prefetch";let r=t.closest("turbo-frame"),s=t.getAttribute("data-turbo-frame")||r?.getAttribute("target")||r?.id;s&&s!=="_top"&&(e.headers["Turbo-Frame"]=s)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#a(){return Number(Zs("turbo-prefetch-cache-time"))||gT}#c(e){return!(!e.getAttribute("href")||BT(e)||UT(e)||zT(e)||HT(e)||qT(e))}},BT=i=>i.origin!==document.location.origin||!["http:","https:"].includes(i.protocol)||i.hasAttribute("target"),UT=i=>i.pathname+i.search===document.location.pathname+document.location.search||i.href.startsWith("#"),zT=i=>{if(i.getAttribute("data-turbo-prefetch")==="false"||i.getAttribute("data-turbo")==="false")return!0;let e=Xs(i,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},HT=i=>{let e=i.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||$T(i)||i.hasAttribute("data-turbo-confirm")||i.hasAttribute("data-turbo-stream"))},$T=i=>i.hasAttribute("data-remote")||i.hasAttribute("data-behavior")||i.hasAttribute("data-confirm")||i.hasAttribute("data-method"),qT=i=>Le("turbo:before-prefetch",{target:i,cancelable:!0}).defaultPrevented,Qh=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,r={}){this.stop(),this.currentVisit=new Wh(this,rt(e),t,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new Fo(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){let r=await t.responseHTML;if(r){let s=e.isSafe;s||this.view.clearSnapshotCache();let{statusCode:n,redirected:o}=t,l={action:this.#e(e,t),shouldCacheSnapshot:s,response:{statusCode:n,responseHTML:r,redirected:o}};this.proposeVisit(t.location,l)}}}async formSubmissionFailedWithResponse(e,t){let r=await t.responseHTML;if(r){let s=pi.fromHTMLString(r);t.serverError?await this.view.renderError(s,this.currentVisit):await this.view.renderPage(s,!1,!0,this.currentVisit),s.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}locationWithActionIsSamePage(e,t){let r=hs(e),s=hs(this.view.lastRenderedLocation),n=t==="restore"&&typeof r>"u";return t!=="replace"&&Bh(e)===Bh(this.view.lastRenderedLocation)&&(n||r!=null&&r!==s)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,t){let{submitter:r,formElement:s}=e;return ds(r,s)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},cs={initial:0,loading:1,interactive:2,complete:3},Jh=class{stage=cs.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==cs.initial&&(this.stage=cs.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{let{readyState:e}=this;e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==cs.loading&&(this.stage=cs.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==cs.interactive&&(this.stage=cs.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},ed=class{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},td=class{render({fragment:e}){Fl.preservingPermanentElements(this,VT(e),()=>{jT(e,()=>{WT(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function VT(i){let e=Sv(document.documentElement),t={};for(let r of e){let{id:s}=r;for(let n of i.querySelectorAll("turbo-stream")){let o=wv(n.templateElement.content,s);o&&(t[s]=[r,o])}}return t}async function jT(i,e){let t=`turbo-stream-autofocus-${gr()}`,r=i.querySelectorAll("turbo-stream"),s=GT(r),n=null;if(s&&(s.id?n=s.id:n=t,s.id=n),e(),await Ks(),(document.activeElement==null||document.activeElement==document.body)&&n){let a=document.getElementById(n);fd(a)&&a.focus(),a&&a.id==t&&a.removeAttribute("id")}}async function WT(i){let[e,t]=await aT(i,()=>document.activeElement),r=e&&e.id;if(r){let s=document.getElementById(r);fd(s)&&s!=t&&s.focus()}}function GT(i){for(let e of i){let t=mv(e.templateElement.content);if(t)return t}return null}var id=class{sources=new Set;#e=!1;constructor(e){this.delegate=e}start(){this.#e||(this.#e=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#e&&(this.#e=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{let t=KT(e);t&&XT(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#e&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(vr.wrap(e))}};function KT(i){let e=i.detail?.fetchResponse;if(e instanceof Po)return e}function XT(i){return(i.contentType??"").startsWith(vr.contentType)}var _l=class extends Oo{static renderElement(e,t){let{documentElement:r,body:s}=document;r.replaceChild(t,s)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let r=Co(e);t.replaceChild(r,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},YT=function(){let i=new Set,e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:y,afterNodeAdded:y,beforeNodeMorphed:y,afterNodeMorphed:y,beforeNodeRemoved:y,afterNodeRemoved:y,beforeAttributeUpdated:y},head:{style:"merge",shouldPreserve:function(T){return T.getAttribute("im-preserve")==="true"},shouldReAppend:function(T){return T.getAttribute("im-re-append")==="true"},shouldRemove:y,afterHeadMorphed:y}};function t(T,k,A={}){T instanceof Document&&(T=T.documentElement),typeof k=="string"&&(k=M(k));let $=H(k),j=x(T,$,A);return r(T,$,j)}function r(T,k,A){if(A.head.block){let $=T.querySelector("head"),j=k.querySelector("head");if($&&j){let z=f(j,$,A);Promise.all(z).then(function(){r(T,k,Object.assign(A,{head:{block:!1,ignore:!0}}))});return}}if(A.morphStyle==="innerHTML")return o(k,T,A),T.children;if(A.morphStyle==="outerHTML"||A.morphStyle==null){let $=G(k,T,A),j=$?.previousSibling,z=$?.nextSibling,J=n(T,$,A);return $?R(j,J,z):[]}else throw"Do not understand how to morph style "+A.morphStyle}function s(T,k){return k.ignoreActiveValue&&T===document.activeElement&&T!==document.body}function n(T,k,A){if(!(A.ignoreActive&&T===document.activeElement))return k==null?A.callbacks.beforeNodeRemoved(T)===!1?T:(T.remove(),A.callbacks.afterNodeRemoved(T),null):C(T,k)?(A.callbacks.beforeNodeMorphed(T,k)===!1||(T instanceof HTMLHeadElement&&A.head.ignore||(T instanceof HTMLHeadElement&&A.head.style!=="morph"?f(k,T,A):(l(k,T,A),s(T,A)||o(k,T,A))),A.callbacks.afterNodeMorphed(T,k)),T):A.callbacks.beforeNodeRemoved(T)===!1||A.callbacks.beforeNodeAdded(k)===!1?T:(T.parentElement.replaceChild(k,T),A.callbacks.afterNodeAdded(k),A.callbacks.afterNodeRemoved(T),k)}function o(T,k,A){let $=T.firstChild,j=k.firstChild,z;for(;$;){if(z=$,$=z.nextSibling,j==null){if(A.callbacks.beforeNodeAdded(z)===!1)return;k.appendChild(z),A.callbacks.afterNodeAdded(z),oe(A,z);continue}if(P(z,j,A)){n(j,z,A),j=j.nextSibling,oe(A,z);continue}let J=D(T,k,z,j,A);if(J){j=I(j,J,A),n(J,z,A),oe(A,z);continue}let ee=q(T,k,z,j,A);if(ee){j=I(j,ee,A),n(ee,z,A),oe(A,z);continue}if(A.callbacks.beforeNodeAdded(z)===!1)return;k.insertBefore(z,j),A.callbacks.afterNodeAdded(z),oe(A,z)}for(;j!==null;){let J=j;j=j.nextSibling,Y(J,A)}}function a(T,k,A,$){return T==="value"&&$.ignoreActiveValue&&k===document.activeElement?!0:$.callbacks.beforeAttributeUpdated(T,k,A)===!1}function l(T,k,A){let $=T.nodeType;if($===1){let j=T.attributes,z=k.attributes;for(let J of j)a(J.name,k,"update",A)||k.getAttribute(J.name)!==J.value&&k.setAttribute(J.name,J.value);for(let J=z.length-1;0<=J;J--){let ee=z[J];a(ee.name,k,"remove",A)||T.hasAttribute(ee.name)||k.removeAttribute(ee.name)}}($===8||$===3)&&k.nodeValue!==T.nodeValue&&(k.nodeValue=T.nodeValue),s(k,A)||d(T,k,A)}function c(T,k,A,$){if(T[A]!==k[A]){let j=a(A,k,"update",$);j||(k[A]=T[A]),T[A]?j||k.setAttribute(A,T[A]):a(A,k,"remove",$)||k.removeAttribute(A)}}function d(T,k,A){if(T instanceof HTMLInputElement&&k instanceof HTMLInputElement&&T.type!=="file"){let $=T.value,j=k.value;c(T,k,"checked",A),c(T,k,"disabled",A),T.hasAttribute("value")?$!==j&&(a("value",k,"update",A)||(k.setAttribute("value",$),k.value=$)):a("value",k,"remove",A)||(k.value="",k.removeAttribute("value"))}else if(T instanceof HTMLOptionElement)c(T,k,"selected",A);else if(T instanceof HTMLTextAreaElement&&k instanceof HTMLTextAreaElement){let $=T.value,j=k.value;if(a("value",k,"update",A))return;$!==j&&(k.value=$),k.firstChild&&k.firstChild.nodeValue!==$&&(k.firstChild.nodeValue=$)}}function f(T,k,A){let $=[],j=[],z=[],J=[],ee=A.head.style,Ae=new Map;for(let ce of T.children)Ae.set(ce.outerHTML,ce);for(let ce of k.children){let Me=Ae.has(ce.outerHTML),Ne=A.head.shouldReAppend(ce),He=A.head.shouldPreserve(ce);Me||He?Ne?j.push(ce):(Ae.delete(ce.outerHTML),z.push(ce)):ee==="append"?Ne&&(j.push(ce),J.push(ce)):A.head.shouldRemove(ce)!==!1&&j.push(ce)}J.push(...Ae.values());let ne=[];for(let ce of J){let Me=document.createRange().createContextualFragment(ce.outerHTML).firstChild;if(A.callbacks.beforeNodeAdded(Me)!==!1){if(Me.href||Me.src){let Ne=null,He=new Promise(function(fi){Ne=fi});Me.addEventListener("load",function(){Ne()}),ne.push(He)}k.appendChild(Me),A.callbacks.afterNodeAdded(Me),$.push(Me)}}for(let ce of j)A.callbacks.beforeNodeRemoved(ce)!==!1&&(k.removeChild(ce),A.callbacks.afterNodeRemoved(ce));return A.head.afterHeadMorphed(k,{added:$,kept:z,removed:j}),ne}function y(){}function v(T){let k={};return Object.assign(k,e),Object.assign(k,T),k.callbacks={},Object.assign(k.callbacks,e.callbacks),Object.assign(k.callbacks,T.callbacks),k.head={},Object.assign(k.head,e.head),Object.assign(k.head,T.head),k}function x(T,k,A){return A=v(A),{target:T,newContent:k,config:A,morphStyle:A.morphStyle,ignoreActive:A.ignoreActive,ignoreActiveValue:A.ignoreActiveValue,idMap:We(T,k),deadIds:new Set,callbacks:A.callbacks,head:A.head}}function P(T,k,A){return T==null||k==null?!1:T.nodeType===k.nodeType&&T.tagName===k.tagName?T.id!==""&&T.id===k.id?!0:le(A,T,k)>0:!1}function C(T,k){return T==null||k==null?!1:T.nodeType===k.nodeType&&T.tagName===k.tagName}function I(T,k,A){for(;T!==k;){let $=T;T=T.nextSibling,Y($,A)}return oe(A,k),k.nextSibling}function D(T,k,A,$,j){let z=le(j,A,k),J=null;if(z>0){let ee=$,Ae=0;for(;ee!=null;){if(P(A,ee,j))return ee;if(Ae+=le(j,ee,T),Ae>z)return null;ee=ee.nextSibling}}return J}function q(T,k,A,$,j){let z=$,J=A.nextSibling,ee=0;for(;z!=null;){if(le(j,z,T)>0)return null;if(C(A,z))return z;if(C(J,z)&&(ee++,J=J.nextSibling,ee>=2))return null;z=z.nextSibling}return z}function M(T){let k=new DOMParser,A=T.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(A.match(/<\/html>/)||A.match(/<\/head>/)||A.match(/<\/body>/)){let $=k.parseFromString(T,"text/html");if(A.match(/<\/html>/))return $.generatedByIdiomorph=!0,$;{let j=$.firstChild;return j?(j.generatedByIdiomorph=!0,j):null}}else{let j=k.parseFromString("<body><template>"+T+"</template></body>","text/html").body.querySelector("template").content;return j.generatedByIdiomorph=!0,j}}function H(T){if(T==null)return document.createElement("div");if(T.generatedByIdiomorph)return T;if(T instanceof Node){let k=document.createElement("div");return k.append(T),k}else{let k=document.createElement("div");for(let A of[...T])k.append(A);return k}}function R(T,k,A){let $=[],j=[];for(;T!=null;)$.push(T),T=T.previousSibling;for(;$.length>0;){let z=$.pop();j.push(z),k.parentElement.insertBefore(z,k)}for(j.push(k);A!=null;)$.push(A),j.push(A),A=A.nextSibling;for(;$.length>0;)k.parentElement.insertBefore($.pop(),k.nextSibling);return j}function G(T,k,A){let $;$=T.firstChild;let j=$,z=0;for(;$;){let J=K($,k,A);J>z&&(j=$,z=J),$=$.nextSibling}return j}function K(T,k,A){return C(T,k)?.5+le(A,T,k):0}function Y(T,k){oe(k,T),k.callbacks.beforeNodeRemoved(T)!==!1&&(T.remove(),k.callbacks.afterNodeRemoved(T))}function ie(T,k){return!T.deadIds.has(k)}function Q(T,k,A){return(T.idMap.get(A)||i).has(k)}function oe(T,k){let A=T.idMap.get(k)||i;for(let $ of A)T.deadIds.add($)}function le(T,k,A){let $=T.idMap.get(k)||i,j=0;for(let z of $)ie(T,z)&&Q(T,z,A)&&++j;return j}function ke(T,k){let A=T.parentElement,$=T.querySelectorAll("[id]");for(let j of $){let z=j;for(;z!==A&&z!=null;){let J=k.get(z);J==null&&(J=new Set,k.set(z,J)),J.add(j.id),z=z.parentElement}}}function We(T,k){let A=new Map;return ke(T,A),ke(k,A),A}return{morph:t,defaults:e}}(),Js=class extends Oo{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){this.#e(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){let{documentElement:e}=this.currentSnapshot,{lang:t}=this.newSnapshot;t?e.setAttribute("lang",t):e.removeAttribute("lang")}async mergeHead(){let e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){let e=[];for(let t of this.newHeadStylesheetElements)e.push(sT(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(Co(e))}removeUnusedDynamicStylesheetElements(){for(let e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){let e=[...this.newHeadProvisionalElements];for(let t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(let t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(let[r,s]of t.entries()){if(e.tagName=="TITLE"){if(s.tagName!="TITLE")continue;if(e.innerHTML==s.innerHTML)return t.splice(r,1),!0}if(s.isEqualNode(e))return t.splice(r,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=Co(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>e.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},rd=class extends Js{async render(){this.willRender&&await this.#e()}get renderMethod(){return"morph"}async#e(){this.#t(this.currentElement,this.newElement),this.#c(),Le("turbo:morph",{detail:{currentElement:this.currentElement,newElement:this.newElement}})}#t(e,t,r="outerHTML"){this.isMorphingTurboFrame=this.#o(e),YT.morph(e,t,{morphStyle:r,callbacks:{beforeNodeAdded:this.#i,beforeNodeMorphed:this.#s,beforeAttributeUpdated:this.#r,beforeNodeRemoved:this.#a,afterNodeMorphed:this.#n}})}#i=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));#s=(e,t)=>{if(e instanceof HTMLElement)return!e.hasAttribute("data-turbo-permanent")&&(this.isMorphingTurboFrame||!this.#o(e))?!Le("turbo:before-morph-element",{cancelable:!0,target:e,detail:{newElement:t}}).defaultPrevented:!1};#r=(e,t,r)=>!Le("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:r}}).defaultPrevented;#n=(e,t)=>{t instanceof HTMLElement&&Le("turbo:morph-element",{target:e,detail:{newElement:t}})};#a=e=>this.#s(e);#c(){this.#d().forEach(e=>{this.#o(e)&&(this.#l(e),e.reload())})}#l(e){e.addEventListener("turbo:before-frame-render",t=>{t.detail.render=this.#u},{once:!0})}#u=(e,t)=>{Le("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),this.#t(e,t.children,"innerHTML")};#o(e){return e.src&&e.refresh==="morph"}#d(){return Array.from(document.querySelectorAll("turbo-frame[src]")).filter(e=>!e.closest("[data-turbo-permanent]"))}},sd=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return wl(e)in this.snapshots}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[wl(e)]}write(e,t){this.snapshots[wl(e)]=t}touch(e){let t=wl(e),r=this.keys.indexOf(t);r>-1&&this.keys.splice(r,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},nd=class extends kl{snapshotCache=new sd(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,r=!0,s){let o=this.isPageRefresh(s)&&this.snapshot.shouldMorphPage?rd:Js,a=new o(this.snapshot,e,Js.renderElement,t,r);return a.shouldRender?s?.changeHistory():this.forceReloaded=!0,this.render(a)}renderError(e,t){t?.changeHistory();let r=new _l(this.snapshot,e,_l.renderElement,!1);return this.render(r)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:t}=this;await uv();let r=e.clone();return this.snapshotCache.put(t,r),r}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&e.action==="replace"}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return pi.fromElement(this.element)}},od=class{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.#e):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#e)}preloadOnLoadLinksForView(e){for(let t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){let t=new URL(e.href);if(this.snapshotCache.has(t))return;await new ps(this,Xt.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{let r=await t.responseHTML,s=pi.fromHTMLString(r);this.snapshotCache.put(e.url,s)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},ad=class{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#e("")}exemptPageFromCache(){this.#e("no-cache")}exemptPageFromPreview(){this.#e("no-preview")}#e(e){oT("turbo-cache-control",e)}},ld=class{navigator=new Qh(this);history=new Yh(this);view=new nd(this,document.documentElement);adapter=new Gh(this);pageObserver=new Jh(this);cacheObserver=new Kh;linkPrefetchObserver=new Zh(this,document);linkClickObserver=new Pl(this,window);formSubmitObserver=new _o(this,document);scrollObserver=new ed(this);streamObserver=new id(this);formLinkClickObserver=new Cl(this,document.documentElement);frameRedirector=new Xh(this,document.documentElement);streamMessageRenderer=new td;cache=new ad(this);drive=!0;enabled=!0;progressBarDelay=500;started=!1;formMode="on";#e=150;constructor(e){this.recentRequests=e,this.preloader=new od(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){let r=t.frame?document.getElementById(t.frame):null;if(r instanceof ki){let s=t.action||ds(r);r.delegate.proposeVisitIfNavigatedWithAction(r,s),r.src=e.toString()}else this.navigator.proposeVisit(rt(e),t)}refresh(e,t){t&&this.recentRequests.has(t)||this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(vr.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}setFormMode(e){this.formMode=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=uT(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute("data-turbo-method"),r=e.hasAttribute("data-turbo-stream"),s=e.getAttribute("data-turbo-frame"),n=s=="_top"?null:document.getElementById(s)||Xs(e,"turbo-frame:not([disabled])");if(t||r||n instanceof ki)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&mr(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,r){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:r}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&mr(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&mr(t,this.snapshot.rootLocation)}willFollowLinkToLocation(e,t,r){return this.elementIsNavigatable(e)&&mr(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,r)}followedLinkToLocation(e,t){let r=this.getActionForLink(e),s=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:r,acceptsStreamResponse:s})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){nv(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(Tl(document.documentElement),this.view.markVisitDirection(e.direction)),nv(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),xl(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){let r=pd(e,t);return this.submissionIsNavigatable(e,t)&&mr(rt(r),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.navigator.currentVisit?.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){let r=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:s,detail:{render:n}}=r;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!s}viewRenderedSnapshot(e,t,r){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(r)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,r){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,r).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,r){return Le("turbo:click",{target:e,detail:{url:t.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return Le("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return Le("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return Le("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return Le("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return Le("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return Le("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return Le("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return Le("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(this.formMode=="off")return!1;{let r=t?this.elementIsNavigatable(t):!0;return this.formMode=="optin"?r&&e.closest('[data-turbo="true"]')!=null:r&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=Xs(e,"[data-turbo]"),r=Xs(e,"turbo-frame");return this.drive||r?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return ds(e)||"advance"}get snapshot(){return this.view.snapshot}};function nv(i){Object.defineProperties(i,ZT)}var ZT={absoluteURL:{get(){return this.toString()}}},Re=new ld(vv),{cache:QT,navigator:JT}=Re;function Ev(){Re.start()}function ex(i){Re.registerAdapter(i)}function tx(i,e){Re.visit(i,e)}function Tv(i){Re.connectStreamSource(i)}function xv(i){Re.disconnectStreamSource(i)}function ix(i){Re.renderStreamMessage(i)}function rx(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),Re.clearCache()}function sx(i){Re.setProgressBarDelay(i)}function nx(i){Fo.confirmMethod=i}function ox(i){Re.setFormMode(i)}var ax=Object.freeze({__proto__:null,navigator:JT,session:Re,cache:QT,PageRenderer:Js,PageSnapshot:pi,FrameRenderer:Ro,fetch:bv,start:Ev,registerAdapter:ex,visit:tx,connectStreamSource:Tv,disconnectStreamSource:xv,renderStreamMessage:ix,clearCache:rx,setProgressBarDelay:sx,setConfirmMethod:nx,setFormMode:ox}),cd=class extends Error{},ud=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#i=!1;#s=!1;#r=new Set;action=null;constructor(e){this.element=e,this.view=new $h(this,this.element),this.appearanceObserver=new zh(this,this.element),this.formLinkClickObserver=new Cl(this,this.element),this.linkInterceptor=new Al(this,this.element),this.restorationIdentifier=gr(),this.formSubmitObserver=new _o(this,this.element)}connect(){this.#i||(this.#i=!0,this.loadingStyle==Ws.lazy?this.appearanceObserver.start():this.#n(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#i&&(this.#i=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==Ws.eager&&this.#n()}sourceURLChanged(){this.#b("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==Ws.eager||this.#s)&&this.#n())}sourceURLReloaded(){let{src:e}=this.element;return this.element.removeAttribute("complete"),this.element.src=null,this.element.src=e,this.element.loaded}loadingStyleChanged(){this.loadingStyle==Ws.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#n())}async#n(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#c(rt(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#s=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let r=hv(t);pi.fromDocument(r).isVisitable?await this.#a(e,r):await this.#u(e)}}finally{this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,ds(e)),this.#n()}willSubmitFormLinkToLocation(e){return this.#m(e)}submittedFormLinkToLocation(e,t,r){let s=this.#p(e);s&&r.setAttribute("data-turbo-frame",s.id)}shouldInterceptLinkClick(e,t,r){return this.#m(e)}linkClickIntercepted(e,t){this.#l(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#m(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new Fo(this,e,t);let{fetchRequest:r}=this.formSubmission;this.prepareRequest(r),this.formSubmission.start()}prepareRequest(e){e.headers["Turbo-Frame"]=this.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(vr.contentType)}requestStarted(e){Tl(this.element)}requestPreventedHandlingResponse(e,t){this.#t()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#t()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#t()}requestErrored(e,t){console.error(t),this.#t()}requestFinished(e){xl(this.element)}formSubmissionStarted({formElement:e}){Tl(e,this.#p(e))}formSubmissionSucceededWithResponse(e,t){let r=this.#p(e.formElement,e.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,ds(e.submitter,e.formElement,r)),r.delegate.loadResponse(t),e.isSafe||Re.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),Re.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){xl(e,this.#p(e))}allowsImmediateRender({element:e},t){let r=Le("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:s,detail:{render:n}}=r;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!s}viewRenderedSnapshot(e,t,r){}preloadOnLoadLinksForView(e){Re.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{let t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#a(e,t){let r=await this.extractForeignFrameElement(t.body);if(r){let s=new Qs(r),n=new Ro(this,this.view.snapshot,s,Ro.renderElement,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(n),this.complete=!0,Re.frameRendered(e,this.element),Re.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#o(e)&&this.#d(e)}async#c(e){let t=new ps(this,Xt.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=t,new Promise(r=>{this.#t=()=>{this.#t=()=>{},this.#e=null,r()},t.perform()})}#l(e,t,r){let s=this.#p(e,r);s.delegate.proposeVisitIfNavigatedWithAction(s,ds(r,e,s)),this.#g(e,()=>{s.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let r=pi.fromElement(e).clone(),{visitCachedSnapshot:s}=e.delegate;e.delegate.fetchResponseLoaded=async n=>{if(e.src){let{statusCode:o,redirected:a}=n,l=await n.responseHTML,d={response:{statusCode:o,redirected:a,responseHTML:l},visitCachedSnapshot:s,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:r};this.action&&(d.action=this.action),Re.visit(e.src,d)}}}}changeHistory(){if(this.action){let e=pv(this.action);Re.history.update(e,rt(this.element.src||""),this.restorationIdentifier)}}async#u(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#f(e.response)}#o(e){this.element.setAttribute("complete","");let t=e.response,r=async(n,o)=>{n instanceof Response?this.#f(n):Re.visit(n,o)};return!Le("turbo:frame-missing",{target:this.element,detail:{response:t,visit:r},cancelable:!0}).defaultPrevented}#d(e){this.view.missing(),this.#h(e)}#h(e){let t=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new cd(t)}async#f(e){let t=new Po(e),r=await t.responseHTML,{location:s,redirected:n,statusCode:o}=t;return Re.visit(s,{response:{redirected:n,statusCode:o,responseHTML:r}})}#p(e,t){let r=El("data-turbo-frame",t,e)||this.element.getAttribute("target");return ov(r)??this.element}async extractForeignFrameElement(e){let t,r=CSS.escape(this.id);try{if(t=av(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=av(e.querySelector(`turbo-frame[src][recurse~=${r}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(s){return console.error(s),new ki}return null}#v(e,t){let r=pd(e,t);return mr(rt(r),this.rootLocation)}#m(e,t){let r=El("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#v(e,t)||!this.enabled||r=="_top")return!1;if(r){let s=ov(r);if(s)return!s.disabled}return!(!Re.elementIsNavigatable(e)||t&&!Re.elementIsNavigatable(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#y("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.#t()!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#i}get rootLocation(){let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return rt(t)}#b(e){return this.#r.has(e)}#y(e,t){this.#r.add(e),t(),this.#r.delete(e)}#g(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}};function ov(i){if(i!=null){let e=document.getElementById(i);if(e instanceof ki)return e}}function av(i,e){if(i){let t=i.getAttribute("src");if(t!=null&&e!=null&&KE(t,e))throw new Error(`Matching <turbo-frame id="${i.id}"> element has a source URL which references itself`);if(i.ownerDocument!==document&&(i=document.importNode(i,!0)),i instanceof ki)return i.connectedCallback(),i.disconnectedCallback(),i}}var kv={after(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.append(this.templateContent))},before(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.prepend(this.templateContent))},remove(){this.targetElements.forEach(i=>i.remove())},replace(){this.targetElements.forEach(i=>i.replaceWith(this.templateContent))},update(){this.targetElements.forEach(i=>{i.innerHTML="",i.append(this.templateContent)})},refresh(){Re.refresh(this.baseURI,this.requestId)}},hd=class i extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{let e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await Ks(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(r=>[...r.children]).filter(r=>!!r.id),t=[...this.templateContent?.children||[]].filter(r=>!!r.id).map(r=>r.id);return e.filter(r=>t.includes(r.id))}get performAction(){if(this.action){let e=kv[this.action];if(e)return e;this.#e("unknown action")}this.#e("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.#e("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){let e=this.ownerDocument.createElement("template");return this.appendChild(e),e}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#e("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#e(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:i.renderElement}})}get targetElementsById(){let e=this.ownerDocument?.getElementById(this.target);return e!==null?[e]:[]}get targetElementsByQuery(){let e=this.ownerDocument?.querySelectorAll(this.targets);return e.length!==0?Array.prototype.slice.call(e):[]}},dd=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),Tv(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),xv(this.streamSource))}get src(){return this.getAttribute("src")||""}};ki.delegateConstructor=ud;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",ki);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",hd);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",dd);(()=>{let i=document.currentScript;if(i&&!i.hasAttribute("data-turbo-suppress-warning"))for(i=i.parentElement;i;){if(i==document.body)return console.warn(dv`
154
+ `}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,i.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,i.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");e.type="text/css",e.textContent=i.defaultCSS;let t=kv();return t&&(e.nonce=t),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}},Kh=class extends Qs{detailsByOuterHTML=this.children.filter(e=>!ex(e)).map(e=>rx(e)).reduce((e,t)=>{let{outerHTML:r}=t,s=r in e?e[r]:{type:ZE(t),tracked:QE(t),elements:[]};return{...e,[r]:{...s,elements:[...s.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(r=>!(r in t.detailsByOuterHTML)).map(r=>this.detailsByOuterHTML[r]).filter(({type:r})=>r==e).map(({elements:[r]})=>r)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:r,tracked:s,elements:n}=this.detailsByOuterHTML[t];return r==null&&!s?[...e,...n]:n.length>1?[...e,...n.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,r)=>{let{elements:[s]}=this.detailsByOuterHTML[r];return ix(s,e)?s:t},void 0|void 0)}};function ZE(i){if(JE(i))return"script";if(tx(i))return"stylesheet"}function QE(i){return i.getAttribute("data-turbo-track")=="reload"}function JE(i){return i.localName=="script"}function ex(i){return i.localName=="noscript"}function tx(i){let e=i.localName;return e=="style"||e=="link"&&i.getAttribute("rel")=="stylesheet"}function ix(i,e){return i.localName=="meta"&&i.getAttribute("name")==e}function rx(i){return i.hasAttribute("nonce")&&i.setAttribute("nonce",""),i}var fi=class i extends Qs{static fromHTMLString(e=""){return this.fromDocument(Tv(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:r}){return new this(e,t,new Kh(r))}constructor(e,t,r){super(t),this.documentElement=e,this.headSnapshot=r}clone(){let e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),r=e.querySelectorAll("select");for(let[s,n]of t.entries()){let o=r[s];for(let a of o.selectedOptions)a.selected=!1;for(let a of n.selectedOptions)o.options[a.index].selected=!0}for(let s of e.querySelectorAll('input[type="password"]'))s.value="";return new i(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){let e=this.getSetting("root")??"/";return st(e)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return this.headSnapshot.getMetaValue("view-transition")==="same-origin"}get shouldMorphPage(){return this.getSetting("refresh-method")==="morph"}get shouldPreserveScrollPosition(){return this.getSetting("refresh-scroll")==="preserve"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},Xh=class{#e=!1;#t=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#e?(this.#e=!0,this.#t=this.#t.then(async()=>{await document.startViewTransition(t).finished})):this.#t=this.#t.then(t),this.#t}get viewTransitionsAvailable(){return document.startViewTransition}},sx={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},Sl={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},er={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},Zs={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},nx={advance:"forward",restore:"back",replace:"none"},Yh=class{identifier=yr();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=er.initialized;viewTransitioner=new Xh;constructor(e,t,r,s={}){this.delegate=e,this.location=t,this.restorationIdentifier=r||yr();let{action:n,historyChanged:o,referrer:a,snapshot:l,snapshotHTML:c,response:d,visitCachedSnapshot:p,willRender:y,updateHistory:v,shouldCacheSnapshot:x,acceptsStreamResponse:P,direction:F}={...sx,...s};this.action=n,this.historyChanged=o,this.referrer=a,this.snapshot=l,this.snapshotHTML=c,this.response=d,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=p,this.willRender=y,this.updateHistory=v,this.scrolled=!y,this.shouldCacheSnapshot=x,this.acceptsStreamResponse=P,this.direction=F||nx[n]}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==er.initialized&&(this.recordTimingMetric(Sl.visitStart),this.state=er.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==er.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=er.canceled)}complete(){this.state==er.started&&(this.recordTimingMetric(Sl.visitEnd),this.adapter.visitCompleted(this),this.state=er.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==er.started&&(this.state=er.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=this.location.href===this.referrer?.href?"replace":this.action,t=xv(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new ms(this,Yt.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(Sl.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;fv(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(Sl.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,fv(e)&&t!=null){let r=fi.fromHTMLString(t);await this.renderPageSnapshot(r,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(fi.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!fs(this.location)||e.hasAnchor(fs(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return fi.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage||this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(wr.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let r=await t.responseHTML,{redirected:s,statusCode:n}=t;r==null?this.recordResponse({statusCode:Zs.contentTypeMismatch,redirected:s}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:n,responseHTML:r,redirected:s}))}async requestFailedWithResponse(e,t){let r=await t.responseHTML,{redirected:s,statusCode:n}=t;r==null?this.recordResponse({statusCode:Zs.contentTypeMismatch,redirected:s}):this.recordResponse({statusCode:n,responseHTML:r,redirected:s})}requestErrored(e,t){this.recordResponse({statusCode:Zs.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&!this.view.shouldPreserveScrollPosition(this)&&(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=fs(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),await new Promise(t=>{this.frame=document.visibilityState==="hidden"?setTimeout(()=>t(),0):requestAnimationFrame(()=>t())}),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function fv(i){return i>=200&&i<300}var Zh=class{progressBar=new Gh;constructor(e){this.session=e}visitProposedToLocation(e,t){br(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||yr(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,e.loadCachedSnapshot(),e.issueRequest(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case Zs.networkFailure:case Zs.timeoutFailure:case Zs.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){Re("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}},Qh=class{selector="[data-turbo-temporary]";deprecatedSelector="[data-turbo-cache=false]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(let t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){let e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}},Jh=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new Cl(this,t),this.formSubmitObserver=new _o(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,r){return this.#t(e)}linkClickIntercepted(e,t,r){let s=this.#i(e);s&&s.delegate.linkClickIntercepted(e,t,r)}willSubmitForm(e,t){return e.closest("turbo-frame")==null&&this.#e(e,t)&&this.#t(e,t)}formSubmitted(e,t){let r=this.#i(e,t);r&&r.delegate.formSubmitted(e,t)}#e(e,t){let r=wd(e,t),s=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),n=st(s?.content??"/");return this.#t(e,t)&&br(r,n)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let s=this.#i(e,t);return s?s!=e.closest("turbo-frame"):!1}else return!1}#i(e,t){let r=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(r&&r!="_top"){let s=this.element.querySelector(`#${r}:not([disabled])`);if(s instanceof mi)return s}}},ed=class{location;restorationIdentifier=yr();restorationData={};started=!1;pageLoaded=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,r=yr()){e===history.pushState&&++this.currentIndex;let s={turbo:{restorationIdentifier:r,restorationIndex:this.currentIndex}};e.call(history,s,"",t.href),this.location=t,this.restorationIdentifier=r}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,r=this.restorationData[t];this.restorationData[t]={...r,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{if(this.shouldHandlePopState()){let{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);let{restorationIdentifier:r,restorationIndex:s}=t;this.restorationIdentifier=r;let n=s>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,r,n),this.currentIndex=s}}};onPageLoad=async e=>{await mE(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},td=class{started=!1;#e=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",this.#t,{once:!0}):this.#t())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#o,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#a,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#o,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#a,!0),this.started=!0};#i=e=>{if(kl("turbo-prefetch")==="false")return;let t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#c(t)){let s=t,n=Fv(s);if(this.delegate.canPrefetchRequestToLocation(s,n)){this.#e=s;let o=new ms(this,Yt.get,n,new URLSearchParams,t);Xs.setLater(n.toString(),o,this.#r)}}};#o=e=>{e.target===this.#e&&this.#s()};#s=()=>{Xs.clear(),this.#e=null};#a=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="GET"){let t=Xs.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),Xs.clear()}};prepareRequest(e){let t=e.target;e.headers["X-Sec-Purpose"]="prefetch";let r=t.closest("turbo-frame"),s=t.getAttribute("data-turbo-frame")||r?.getAttribute("target")||r?.id;s&&s!=="_top"&&(e.headers["Turbo-Frame"]=s)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#r(){return Number(kl("turbo-prefetch-cache-time"))||NE}#c(e){return!(!e.getAttribute("href")||ox(e)||ax(e)||lx(e)||cx(e)||hx(e))}},ox=i=>i.origin!==document.location.origin||!["http:","https:"].includes(i.protocol)||i.hasAttribute("target"),ax=i=>i.pathname+i.search===document.location.pathname+document.location.search||i.href.startsWith("#"),lx=i=>{if(i.getAttribute("data-turbo-prefetch")==="false"||i.getAttribute("data-turbo")==="false")return!0;let e=Ys(i,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},cx=i=>{let e=i.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||ux(i)||i.hasAttribute("data-turbo-confirm")||i.hasAttribute("data-turbo-stream"))},ux=i=>i.hasAttribute("data-remote")||i.hasAttribute("data-behavior")||i.hasAttribute("data-confirm")||i.hasAttribute("data-method"),hx=i=>Re("turbo:before-prefetch",{target:i,cancelable:!0}).defaultPrevented,id=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,r={}){this.stop(),this.currentVisit=new Yh(this,st(e),t,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new Al(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){let r=await t.responseHTML;if(r){let s=e.isSafe;s||this.view.clearSnapshotCache();let{statusCode:n,redirected:o}=t,l={action:this.#e(e,t),shouldCacheSnapshot:s,response:{statusCode:n,responseHTML:r,redirected:o}};this.proposeVisit(t.location,l)}}}async formSubmissionFailedWithResponse(e,t){let r=await t.responseHTML;if(r){let s=fi.fromHTMLString(r);t.serverError?await this.view.renderError(s,this.currentVisit):await this.view.renderPage(s,!1,!0,this.currentVisit),s.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e),delete this.currentVisit}locationWithActionIsSamePage(e,t){let r=fs(e),s=fs(this.view.lastRenderedLocation),n=t==="restore"&&typeof r>"u";return t!=="replace"&&zh(e)===zh(this.view.lastRenderedLocation)&&(n||r!=null&&r!==s)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,t){let{submitter:r,formElement:s}=e;return ps(r,s)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},hs={initial:0,loading:1,interactive:2,complete:3},rd=class{stage=hs.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==hs.initial&&(this.stage=hs.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{let{readyState:e}=this;e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==hs.loading&&(this.stage=hs.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==hs.interactive&&(this.stage=hs.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},sd=class{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},nd=class{render({fragment:e}){Ol.preservingPermanentElements(this,dx(e),()=>{px(e,()=>{fx(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function dx(i){let e=Mv(document.documentElement),t={};for(let r of e){let{id:s}=r;for(let n of i.querySelectorAll("turbo-stream")){let o=Lv(n.templateElement.content,s);o&&(t[s]=[r,o])}}return t}async function px(i,e){let t=`turbo-stream-autofocus-${yr()}`,r=i.querySelectorAll("turbo-stream"),s=mx(r),n=null;if(s&&(s.id?n=s.id:n=t,s.id=n),e(),await Po(),(document.activeElement==null||document.activeElement==document.body)&&n){let a=document.getElementById(n);yd(a)&&a.focus(),a&&a.id==t&&a.removeAttribute("id")}}async function fx(i){let[e,t]=await SE(i,()=>document.activeElement),r=e&&e.id;if(r){let s=document.getElementById(r);yd(s)&&s!=t&&s.focus()}}function mx(i){for(let e of i){let t=Av(e.templateElement.content);if(t)return t}return null}var od=class{sources=new Set;#e=!1;constructor(e){this.delegate=e}start(){this.#e||(this.#e=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#e&&(this.#e=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{let t=gx(e);t&&vx(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#e&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(wr.wrap(e))}};function gx(i){let e=i.detail?.fetchResponse;if(e instanceof Fo)return e}function vx(i){return(i.contentType??"").startsWith(wr.contentType)}var ad=class extends Oo{static renderElement(e,t){let{documentElement:r,body:s}=document;r.replaceChild(t,s)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let r=Co(e);t.replaceChild(r,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},Lo=class extends Oo{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){this.#e(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){let{documentElement:e}=this.currentSnapshot,{lang:t}=this.newSnapshot;t?e.setAttribute("lang",t):e.removeAttribute("lang")}async mergeHead(){let e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){let e=[];for(let t of this.newHeadStylesheetElements)e.push(bE(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(Co(e))}removeUnusedDynamicStylesheetElements(){for(let e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){let e=[...this.newHeadProvisionalElements];for(let t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(let t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(let[r,s]of t.entries()){if(e.tagName=="TITLE"){if(s.tagName!="TITLE")continue;if(e.innerHTML==s.innerHTML)return t.splice(r,1),!0}if(s.isEqualNode(e))return t.splice(r,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=Co(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>e.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},ld=class extends Lo{static renderElement(e,t){Ed(e,t,{callbacks:{beforeNodeMorphed:r=>!mv(r)}});for(let r of e.querySelectorAll("turbo-frame"))mv(r)&&r.reload();Re("turbo:morph",{detail:{currentElement:e,newElement:t}})}async preservingPermanentElements(e){return await e()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}};function mv(i){return i instanceof mi&&i.src&&i.refresh==="morph"&&!i.closest("[data-turbo-permanent]")}var cd=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return wl(e)in this.snapshots}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[wl(e)]}write(e,t){this.snapshots[wl(e)]=t}touch(e){let t=wl(e),r=this.keys.indexOf(t);r>-1&&this.keys.splice(r,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},ud=class extends Pl{snapshotCache=new cd(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,r=!0,s){let o=this.isPageRefresh(s)&&this.snapshot.shouldMorphPage?ld:Lo,a=new o(this.snapshot,e,t,r);return a.shouldRender?s?.changeHistory():this.forceReloaded=!0,this.render(a)}renderError(e,t){t?.changeHistory();let r=new ad(this.snapshot,e,!1);return this.render(r)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:t}=this;await Sv();let r=e.clone();return this.snapshotCache.put(t,r),r}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&e.action==="replace"}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return fi.fromElement(this.element)}},hd=class{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.#e):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#e)}preloadOnLoadLinksForView(e){for(let t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){let t=new URL(e.href);if(this.snapshotCache.has(t))return;await new ms(this,Yt.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{let r=await t.responseHTML,s=fi.fromHTMLString(r);this.snapshotCache.put(e.url,s)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},dd=class{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#e("")}exemptPageFromCache(){this.#e("no-cache")}exemptPageFromPreview(){this.#e("no-preview")}#e(e){wE("turbo-cache-control",e)}},pd=class{navigator=new id(this);history=new ed(this);view=new ud(this,document.documentElement);adapter=new Zh(this);pageObserver=new rd(this);cacheObserver=new Qh;linkPrefetchObserver=new td(this,document);linkClickObserver=new Fl(this,window);formSubmitObserver=new _o(this,document);scrollObserver=new sd(this);streamObserver=new od(this);formLinkClickObserver=new _l(this,document.documentElement);frameRedirector=new Jh(this,document.documentElement);streamMessageRenderer=new nd;cache=new dd(this);enabled=!0;started=!1;#e=150;constructor(e){this.recentRequests=e,this.preloader=new hd(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){let r=t.frame?document.getElementById(t.frame):null;if(r instanceof mi){let s=t.action||ps(r);r.delegate.proposeVisitIfNavigatedWithAction(r,s),r.src=e.toString()}else this.navigator.proposeVisit(st(e),t)}refresh(e,t){!(t&&this.recentRequests.has(t))&&!this.navigator.currentVisit&&this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(wr.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){console.warn("Please replace `session.setProgressBarDelay(delay)` with `session.progressBarDelay = delay`. The function is deprecated and will be removed in a future version of Turbo.`"),this.progressBarDelay=e}set progressBarDelay(e){rt.drive.progressBarDelay=e}get progressBarDelay(){return rt.drive.progressBarDelay}set drive(e){rt.drive.enabled=e}get drive(){return rt.drive.enabled}set formMode(e){rt.forms.mode=e}get formMode(){return rt.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=TE(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute("data-turbo-method"),r=e.hasAttribute("data-turbo-stream"),s=e.getAttribute("data-turbo-frame"),n=s=="_top"?null:document.getElementById(s)||Ys(e,"turbo-frame:not([disabled])");if(t||r||n instanceof mi)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&br(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,r){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:r}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&br(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&br(t,this.snapshot.rootLocation)}willFollowLinkToLocation(e,t,r){return this.elementIsNavigatable(e)&&br(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,r)}followedLinkToLocation(e,t){let r=this.getActionForLink(e),s=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:r,acceptsStreamResponse:s})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){gv(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(El(document.documentElement),this.view.markVisitDirection(e.direction)),gv(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),xl(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){let r=wd(e,t);return this.submissionIsNavigatable(e,t)&&br(st(r),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.navigator.currentVisit?.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){let r=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:s,detail:{render:n}}=r;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!s}viewRenderedSnapshot(e,t,r){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(r)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,r){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,r).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,r){return Re("turbo:click",{target:e,detail:{url:t.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return Re("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return Re("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return Re("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return Re("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return Re("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return Re("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return Re("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return Re("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(rt.forms.mode=="off")return!1;{let r=t?this.elementIsNavigatable(t):!0;return rt.forms.mode=="optin"?r&&e.closest('[data-turbo="true"]')!=null:r&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=Ys(e,"[data-turbo]"),r=Ys(e,"turbo-frame");return rt.drive.enabled||r?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return ps(e)||"advance"}get snapshot(){return this.view.snapshot}};function gv(i){Object.defineProperties(i,bx)}var bx={absoluteURL:{get(){return this.toString()}}},ze=new pd(_v),{cache:yx,navigator:wx}=ze;function Dv(){ze.start()}function Sx(i){ze.registerAdapter(i)}function Tx(i,e){ze.visit(i,e)}function Nv(i){ze.connectStreamSource(i)}function Bv(i){ze.disconnectStreamSource(i)}function Ex(i){ze.renderStreamMessage(i)}function xx(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),ze.clearCache()}function kx(i){console.warn("Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),rt.drive.progressBarDelay=i}function Ax(i){console.warn("Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),rt.forms.confirm=i}function Px(i){console.warn("Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),rt.forms.mode=i}var Cx=Object.freeze({__proto__:null,navigator:wx,session:ze,cache:yx,PageRenderer:Lo,PageSnapshot:fi,FrameRenderer:Ro,fetch:Ov,config:rt,start:Dv,registerAdapter:Sx,visit:Tx,connectStreamSource:Nv,disconnectStreamSource:Bv,renderStreamMessage:Ex,clearCache:xx,setProgressBarDelay:kx,setConfirmMethod:Ax,setFormMode:Px}),fd=class extends Error{},md=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#i=!1;#o=!1;#s=new Set;#a=!1;action=null;constructor(e){this.element=e,this.view=new Vh(this,this.element),this.appearanceObserver=new $h(this,this.element),this.formLinkClickObserver=new _l(this,this.element),this.linkInterceptor=new Cl(this,this.element),this.restorationIdentifier=yr(),this.formSubmitObserver=new _o(this,this.element)}connect(){this.#i||(this.#i=!0,this.loadingStyle==Ks.lazy?this.appearanceObserver.start():this.#r(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#i&&(this.#i=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==Ks.eager&&this.#r()}sourceURLChanged(){this.#y("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==Ks.eager||this.#o)&&this.#r())}sourceURLReloaded(){let{refresh:e,src:t}=this.element;return this.#a=t&&e==="morph",this.element.removeAttribute("complete"),this.element.src=null,this.element.src=t,this.element.loaded}loadingStyleChanged(){this.loadingStyle==Ks.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#r())}async#r(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#n(st(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#o=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let r=Tv(t);fi.fromDocument(r).isVisitable?await this.#c(e,r):await this.#l(e)}}finally{this.#a=!1,this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,ps(e)),this.#r()}willSubmitFormLinkToLocation(e){return this.#f(e)}submittedFormLinkToLocation(e,t,r){let s=this.#h(e);s&&r.setAttribute("data-turbo-frame",s.id)}shouldInterceptLinkClick(e,t,r){return this.#f(e)}linkClickIntercepted(e,t){this.#d(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#f(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new Al(this,e,t);let{fetchRequest:r}=this.formSubmission;this.prepareRequest(r),this.formSubmission.start()}prepareRequest(e){e.headers["Turbo-Frame"]=this.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(wr.contentType)}requestStarted(e){El(this.element)}requestPreventedHandlingResponse(e,t){this.#t()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#t()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#t()}requestErrored(e,t){console.error(t),this.#t()}requestFinished(e){xl(this.element)}formSubmissionStarted({formElement:e}){El(e,this.#h(e))}formSubmissionSucceededWithResponse(e,t){let r=this.#h(e.formElement,e.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,ps(e.submitter,e.formElement,r)),r.delegate.loadResponse(t),e.isSafe||ze.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),ze.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){xl(e,this.#h(e))}allowsImmediateRender({element:e},t){let r=Re("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:s,detail:{render:n}}=r;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!s}viewRenderedSnapshot(e,t,r){}preloadOnLoadLinksForView(e){ze.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{let t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#c(e,t){let r=await this.extractForeignFrameElement(t.body),s=this.#a?Wh:Ro;if(r){let n=new Qs(r),o=new s(this,this.view.snapshot,n,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(o),this.complete=!0,ze.frameRendered(e,this.element),ze.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#p(e)&&this.#u(e)}async#n(e){let t=new ms(this,Yt.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=t,new Promise(r=>{this.#t=()=>{this.#t=()=>{},this.#e=null,r()},t.perform()})}#d(e,t,r){let s=this.#h(e,r);s.delegate.proposeVisitIfNavigatedWithAction(s,ps(r,e,s)),this.#m(e,()=>{s.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let r=fi.fromElement(e).clone(),{visitCachedSnapshot:s}=e.delegate;e.delegate.fetchResponseLoaded=async n=>{if(e.src){let{statusCode:o,redirected:a}=n,l=await n.responseHTML,d={response:{statusCode:o,redirected:a,responseHTML:l},visitCachedSnapshot:s,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:r};this.action&&(d.action=this.action),ze.visit(e.src,d)}}}}changeHistory(){if(this.action){let e=xv(this.action);ze.history.update(e,st(this.element.src||""),this.restorationIdentifier)}}async#l(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#v(e.response)}#p(e){this.element.setAttribute("complete","");let t=e.response,r=async(n,o)=>{n instanceof Response?this.#v(n):ze.visit(n,o)};return!Re("turbo:frame-missing",{target:this.element,detail:{response:t,visit:r},cancelable:!0}).defaultPrevented}#u(e){this.view.missing(),this.#g(e)}#g(e){let t=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new fd(t)}async#v(e){let t=new Fo(e),r=await t.responseHTML,{location:s,redirected:n,statusCode:o}=t;return ze.visit(s,{response:{redirected:n,statusCode:o,responseHTML:r}})}#h(e,t){let r=Tl("data-turbo-frame",t,e)||this.element.getAttribute("target");return vv(r)??this.element}async extractForeignFrameElement(e){let t,r=CSS.escape(this.id);try{if(t=bv(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=bv(e.querySelector(`turbo-frame[src][recurse~=${r}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(s){return console.error(s),new mi}return null}#b(e,t){let r=wd(e,t);return br(st(r),this.rootLocation)}#f(e,t){let r=Tl("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#b(e,t)||!this.enabled||r=="_top")return!1;if(r){let s=vv(r);if(s)return!s.disabled}return!(!ze.elementIsNavigatable(e)||t&&!ze.elementIsNavigatable(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#w("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.#t()!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#i}get rootLocation(){let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return st(t)}#y(e){return this.#s.has(e)}#w(e,t){this.#s.add(e),t(),this.#s.delete(e)}#m(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}};function vv(i){if(i!=null){let e=document.getElementById(i);if(e instanceof mi)return e}}function bv(i,e){if(i){let t=i.getAttribute("src");if(t!=null&&e!=null&&PE(t,e))throw new Error(`Matching <turbo-frame id="${i.id}"> element has a source URL which references itself`);if(i.ownerDocument!==document&&(i=document.importNode(i,!0)),i instanceof mi)return i.connectedCallback(),i.disconnectedCallback(),i}}var Uv={after(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.append(this.templateContent))},before(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.prepend(this.templateContent))},remove(){this.targetElements.forEach(i=>i.remove())},replace(){let i=this.getAttribute("method");this.targetElements.forEach(e=>{i==="morph"?Ed(e,this.templateContent):e.replaceWith(this.templateContent)})},update(){let i=this.getAttribute("method");this.targetElements.forEach(e=>{i==="morph"?Iv(e,this.templateContent):(e.innerHTML="",e.append(this.templateContent))})},refresh(){ze.refresh(this.baseURI,this.requestId)}},gd=class i extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{let e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await Po(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(r=>[...r.children]).filter(r=>!!r.id),t=[...this.templateContent?.children||[]].filter(r=>!!r.id).map(r=>r.id);return e.filter(r=>t.includes(r.id))}get performAction(){if(this.action){let e=Uv[this.action];if(e)return e;this.#e("unknown action")}this.#e("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.#e("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){let e=this.ownerDocument.createElement("template");return this.appendChild(e),e}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#e("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#e(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:i.renderElement}})}get targetElementsById(){let e=this.ownerDocument?.getElementById(this.target);return e!==null?[e]:[]}get targetElementsByQuery(){let e=this.ownerDocument?.querySelectorAll(this.targets);return e.length!==0?Array.prototype.slice.call(e):[]}},vd=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),Nv(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),Bv(this.streamSource))}get src(){return this.getAttribute("src")||""}};mi.delegateConstructor=md;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",mi);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",gd);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",vd);(()=>{let i=document.currentScript;if(i&&!i.hasAttribute("data-turbo-suppress-warning"))for(i=i.parentElement;i;){if(i==document.body)return console.warn(Ev`
155
155
  You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
156
156
 
157
157
  Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
@@ -160,7 +160,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&
160
160
 
161
161
  ——
162
162
  Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
163
- `,i.outerHTML);i=i.parentElement}})();window.Turbo={...ax,StreamActions:kv};Ev();["turbo:click","turbo:before-visit","turbo:visit","turbo:submit-start","turbo:before-fetch-request","turbo:before-fetch-response","turbo:submit-end","turbo:before-cache","turbo:before-render","turbo:before-stream-render","turbo:render","turbo:load","turbo:before-frame-render","turbo:frame-render","turbo:frame-load","turbo:frame-missing","turbo:fetch-request-error","turbo:reload","turbo:morph","turbo:before-morph-element","turbo:morph-attribute","turbo:morph"].forEach(i=>{document.addEventListener(i,e=>{console.log(e.type,e)})});var lx=jo.start();Nh(lx);})();
163
+ `,i.outerHTML);i=i.parentElement}})();window.Turbo={...Cx,StreamActions:Uv};Dv();["turbo:click","turbo:before-visit","turbo:visit","turbo:submit-start","turbo:before-fetch-request","turbo:before-fetch-response","turbo:submit-end","turbo:before-cache","turbo:before-render","turbo:before-stream-render","turbo:render","turbo:load","turbo:before-frame-render","turbo:frame-render","turbo:frame-load","turbo:frame-missing","turbo:fetch-request-error","turbo:reload","turbo:morph","turbo:before-morph-element","turbo:morph-attribute","turbo:morph"].forEach(i=>{document.addEventListener(i,e=>{console.log(e.type,e)})});var Fx=Wo.start();Bh(Fx);})();
164
164
  /*!
165
165
  * Sanitize an HTML node
166
166
  */
@@ -185,7 +185,7 @@ cropperjs/dist/cropper.js:
185
185
  *)
186
186
 
187
187
  dompurify/dist/purify.es.mjs:
188
- (*! @license DOMPurify 3.2.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.2/LICENSE *)
188
+ (*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE *)
189
189
 
190
190
  @uppy/utils/lib/Translator.js:
191
191
  (**
@@ -201,7 +201,7 @@ dompurify/dist/purify.es.mjs:
201
201
 
202
202
  @hotwired/turbo/dist/turbo.es2017-esm.js:
203
203
  (*!
204
- Turbo 8.0.4
204
+ Turbo 8.0.12
205
205
  Copyright © 2024 37signals LLC
206
206
  *)
207
207
  */