plutonium 0.25.0 → 0.25.2
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.
- checksums.yaml +4 -4
- data/app/assets/plutonium.css +2 -2
- data/app/assets/plutonium.js +23948 -23882
- data/app/assets/plutonium.js.map +4 -4
- data/app/assets/plutonium.min.js +69 -69
- data/app/assets/plutonium.min.js.map +4 -4
- data/app/javascript/controllers/key_value_store_controller.js +119 -0
- data/lib/plutonium/helpers/turbo_stream_actions_helper.rb +1 -1
- data/lib/plutonium/interaction/response/redirect.rb +12 -1
- data/lib/plutonium/resource/controllers/interactive_actions.rb +3 -23
- data/lib/plutonium/ui/form/base.rb +4 -0
- data/lib/plutonium/ui/form/components/key_value_store.rb +234 -0
- data/lib/plutonium/ui/page/interactive_action.rb +10 -8
- data/lib/plutonium/version.rb +1 -1
- data/package.json +1 -1
- data/src/js/controllers/key_value_store_controller.js +109 -0
- data/src/js/controllers/register_controllers.js +2 -0
- data/src/js/plutonium.js +2 -0
- data/src/js/turbo/index.js +2 -4
- metadata +5 -2
data/app/assets/plutonium.min.js
CHANGED
@@ -1,35 +1,60 @@
|
|
1
|
-
(()=>{var Gv=Object.create;var Cd=Object.defineProperty;var Kv=Object.getOwnPropertyDescriptor;var Xv=Object.getOwnPropertyNames;var Yv=Object.getPrototypeOf,Zv=Object.prototype.hasOwnProperty;var Me=(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 Xv(e))!Zv.call(i,s)&&s!==t&&Cd(i,s,{get:()=>e[s],enumerable:!(r=Kv(e,s))||r.enumerable});return i};var Fe=(i,e,t)=>(t=i!=null?Gv(Yv(i)):{},Qv(e||!i||!i.__esModule?Cd(t,"default",{value:i,enumerable:!0}):t,i));var $p=Me((nC,Hp)=>{Hp.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 Ea=Me((aC,qp)=>{function C0(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}qp.exports=C0});var jp=Me((lC,Vp)=>{var F0=typeof global=="object"&&global&&global.Object===Object&&global;Vp.exports=F0});var Uc=Me((cC,Wp)=>{var _0=jp(),O0=typeof self=="object"&&self&&self.Object===Object&&self,R0=_0||O0||Function("return this")();Wp.exports=R0});var Kp=Me((uC,Gp)=>{var L0=Uc(),M0=function(){return L0.Date.now()};Gp.exports=M0});var Yp=Me((hC,Xp)=>{var I0=/\s/;function D0(i){for(var e=i.length;e--&&I0.test(i.charAt(e)););return e}Xp.exports=D0});var Qp=Me((dC,Zp)=>{var N0=Yp(),B0=/^\s+/;function U0(i){return i&&i.slice(0,N0(i)+1).replace(B0,"")}Zp.exports=U0});var zc=Me((pC,Jp)=>{var z0=Uc(),H0=z0.Symbol;Jp.exports=H0});var sf=Me((fC,rf)=>{var ef=zc(),tf=Object.prototype,$0=tf.hasOwnProperty,q0=tf.toString,kn=ef?ef.toStringTag:void 0;function V0(i){var e=$0.call(i,kn),t=i[kn];try{i[kn]=void 0;var r=!0}catch{}var s=q0.call(i);return r&&(e?i[kn]=t:delete i[kn]),s}rf.exports=V0});var of=Me((mC,nf)=>{var j0=Object.prototype,W0=j0.toString;function G0(i){return W0.call(i)}nf.exports=G0});var uf=Me((gC,cf)=>{var af=zc(),K0=sf(),X0=of(),Y0="[object Null]",Z0="[object Undefined]",lf=af?af.toStringTag:void 0;function Q0(i){return i==null?i===void 0?Z0:Y0:lf&&lf in Object(i)?K0(i):X0(i)}cf.exports=Q0});var df=Me((vC,hf)=>{function J0(i){return i!=null&&typeof i=="object"}hf.exports=J0});var ff=Me((bC,pf)=>{var ew=uf(),tw=df(),iw="[object Symbol]";function rw(i){return typeof i=="symbol"||tw(i)&&ew(i)==iw}pf.exports=rw});var bf=Me((yC,vf)=>{var sw=Qp(),mf=Ea(),nw=ff(),gf=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 gf;if(mf(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=mf(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)?gf:+i}vf.exports=uw});var $c=Me((wC,wf)=>{var hw=Ea(),Hc=Kp(),yf=bf(),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=yf(e)||0,hw(t)&&(d=!!t.leading,f="maxWait"in t,n=f?pw(yf(t.maxWait)||0,e):n,y="trailing"in t?!!t.trailing:y);function v(z){var G=r,K=s;return r=s=void 0,c=z,o=i.apply(K,G),o}function x(z){return c=z,a=setTimeout(R,e),d?v(z):o}function P(z){var G=z-l,K=z-c,Q=e-G;return f?fw(Q,n-K):Q}function F(z){var G=z-l,K=z-c;return l===void 0||G>=e||G<0||f&&K>=n}function R(){var z=Hc();if(F(z))return D(z);a=setTimeout(R,P(z))}function D(z){return a=void 0,y&&r?v(z):(r=s=void 0,o)}function V(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function M(){return a===void 0?o:D(Hc())}function $(){var z=Hc(),G=F(z);if(r=arguments,s=this,l=z,G){if(a===void 0)return x(l);if(f)return clearTimeout(a),a=setTimeout(R,e),v(l)}return a===void 0&&(a=setTimeout(R,e)),o}return $.cancel=V,$.flush=M,$}wf.exports=mw});var Ef=Me((SC,Sf)=>{var gw=$c(),vw=Ea(),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})}Sf.exports=yw});var Aa=Me((IC,Ff)=>{"use strict";Ff.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 Rf=Me((DC,Of)=>{"use strict";function _f(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}_f.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};Of.exports=function(i,e,t){var r=new _f(i,t||/[\/\.]/);return typeof e<"u"?r.match(e):r}});var Mf=Me((NC,Lf)=>{var kw=Rf(),Aw=/[\/\+\.]/;Lf.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 wt=Me((g2,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 rg=Me((u_,Gu)=>{"use strict";var eS=Object.prototype.hasOwnProperty,Et="~";function ro(){}Object.create&&(ro.prototype=Object.create(null),new ro().__proto__||(Et=!1));function tS(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function ig(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=Et?Et+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)eS.call(t,r)&&e.push(Et?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};pt.prototype.listeners=function(e){var t=Et?Et+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=Et?Et+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=Et?Et+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};pt.prototype.on=function(e,t,r){return ig(this,e,t,r,!1)};pt.prototype.once=function(e,t,r){return ig(this,e,t,r,!0)};pt.prototype.removeListener=function(e,t,r,s){var n=Et?Et+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=Et?Et+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=Et;pt.EventEmitter=pt;typeof Gu<"u"&&(Gu.exports=pt)});var $g=Me((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",F=P?window:{},R=P&&F.document.documentElement?"ontouchstart"in F.document.documentElement:!1,D=P?"PointerEvent"in F:!1,V="cropper",M="all",$="crop",z="move",G="zoom",K="e",Q="w",ne="s",Y="n",re="ne",le="nw",ke="se",We="sw",T="".concat(V,"-crop"),k="".concat(V,"-disabled"),A="".concat(V,"-hidden"),H="".concat(V,"-hide"),j="".concat(V,"-invisible"),U="".concat(V,"-modal"),J="".concat(V,"-move"),ee="".concat(V,"Action"),Ae="".concat(V,"Preview"),oe="crop",ce="move",Re="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,/,Er=/^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,p){h.call(g,m,p,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,p=new Array(m>1?m-1:0),E=1;E<m;E++)p[E-1]=arguments[E];return ii(h)&&p.length>0&&p.forEach(function(b){ii(b)&&Object.keys(b).forEach(function(S){h[S]=b[S]})}),h},Ll=/\.\d*(?:0|9){12}\d*$/;function Te(g){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Ll.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(p,E){nr.test(E)&&se(p)&&(p="".concat(p,"px")),m[E]=p})}function Do(g,h){return g.classList?g.classList.contains(h):g.className.indexOf(h)>-1}function Le(g,h){if(h){if(se(g.length)){ye(g,function(p){Le(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 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(p){Ri(p,h,m)});return}m?Le(g,h):Ot(g,h)}}var Ml=/([a-z\d])([A-Z])/g;function At(g){return g.replace(Ml,"$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(){},p=Object.defineProperty({},"once",{get:function(){return g=!0,h},set:function(b){h=b}});F.addEventListener("test",m,p),F.removeEventListener("test",m,p)}return g}();function Ne(g,h,m){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},E=m;h.trim().split(ys).forEach(function(b){if(!tn){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 ft(g,h,m){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},E=m;h.trim().split(ys).forEach(function(b){if(p.once&&!tn){var S=g.listeners,C=S===void 0?{}:S;E=function(){delete C[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,_)},C[b]||(C[b]={}),C[b][m]&&g.removeEventListener(b,C[b][m],p),C[b][m]=E,g.listeners=C}g.addEventListener(b,E,p)})}function Li(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 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,Il=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Z(g){var h=g.match(Il);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 I(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 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(p,E){delete h[E],ye(h,function(b){var S=Math.abs(p.startX-b.startX),C=Math.abs(p.startY-b.startY),B=Math.abs(p.endX-b.endX),L=Math.abs(p.endY-b.endY),_=Math.sqrt(S*S+C*C),O=Math.sqrt(B*B+L*L),N=(O-_)/_;Math.abs(N)>Math.abs(m)&&(m=N)})}),m}function be(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=Ht(p),S=Ht(m);if(b&&S){var C=m*h;E==="contain"&&C>p||E==="cover"&&C<p?m=p/h:p=m*h}else b?m=p/h:S&&(p=m*h);return{width:p,height:m}}function ht(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),C=h*S+m*b,B=h*b+m*S;return p>90?{width:B,height:C}:{width:C,height:B}}function $t(g,h,m,p){var E=h.aspectRatio,b=h.naturalWidth,S=h.naturalHeight,C=h.rotate,B=C===void 0?0:C,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,Mi=p.imageSmoothingQuality,Rt=Mi===void 0?"low":Mi,q=p.maxWidth,fe=q===void 0?1/0:q,Xe=p.maxHeight,qt=Xe===void 0?1/0:Xe,Ii=p.minWidth,Tr=Ii===void 0?0:Ii,xr=p.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:Tr,height:cr},"cover"),Dl=Math.min(kr.width,Math.max(zo.width,ue)),Nl=Math.min(kr.height,Math.max(zo.height,Pe)),xd=Se({aspectRatio:E,width:fe,height:qt}),kd=Se({aspectRatio:E,width:Tr,height:cr},"cover"),Ad=Math.min(xd.width,Math.max(kd.width,b)),Pd=Math.min(xd.height,Math.max(kd.height,S)),jv=[-Ad/2,-Pd/2,Ad,Pd];return Si.width=Te(Dl),Si.height=Te(Nl),Pt.fillStyle=Ke,Pt.fillRect(0,0,Dl,Nl),Pt.save(),Pt.translate(Dl/2,Nl/2),Pt.rotate(B*Math.PI/180),Pt.scale(_,N),Pt.imageSmoothingEnabled=$e,Pt.imageSmoothingQuality=Rt,Pt.drawImage.apply(Pt,[g].concat(c(jv.map(function(Wv){return Math.floor(Te(Wv))})))),Pt.restore(),Si}var lr=String.fromCharCode;function nt(g,h,m){var p="";m+=h;for(var E=h;E<m;E+=1)p+=lr(g.getUint8(E));return p}var Bo=/^data:.*,/;function Uo(g){var h=g.replace(Bo,""),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 Iv(g,h){for(var m=[],p=8192,E=new Uint8Array(g);E.length>0;)m.push(lr.apply(null,Io(E.subarray(0,p)))),E=E.subarray(p);return"data:".concat(h,";base64,").concat(btoa(m.join("")))}function Dv(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,C=2;C+1<S;){if(h.getUint8(C)===255&&h.getUint8(C+1)===225){E=C;break}C+=1}if(E){var B=E+4,L=E+10;if(nt(h,B,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 Nv(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 Bv={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);Le(E,A),Ot(h,A);var C={width:Math.max(p.offsetWidth,b>=0?b:rr),height:Math.max(p.offsetHeight,S>=0?S:Js)};this.containerData=C,wi(E,{width:C.width,height:C.height}),Le(h,A),Ot(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,C=b/S,B=h.width,L=h.height;h.height*C>h.width?p===3?B=h.height*C:L=h.width/C:p===3?L=h.width/C:B=h.height*C;var _={aspectRatio:C,naturalWidth:b,naturalHeight:S,width:B,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,C=p.viewMode,B=b.aspectRatio,L=this.cropped&&S;if(h){var _=Number(p.minCanvasWidth)||0,O=Number(p.minCanvasHeight)||0;C>1?(_=Math.max(_,E.width),O=Math.max(O,E.height),C===3&&(O*B>_?_=O*B:O=_/B)):C>0&&(_?_=Math.max(_,L?S.width:0):O?O=Math.max(O,L?S.height:0):L&&(_=S.width,O=S.height,O*B>_?_=O*B:O=_/B));var N=Se({aspectRatio:B,width:_,height:O});_=N.width,O=N.height,b.minWidth=_,b.minHeight=O,b.maxWidth=1/0,b.maxHeight=1/0}if(m)if(C>(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,C===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=ht({width:E.naturalWidth*Math.abs(E.scaleX||1),height:E.naturalHeight*Math.abs(E.scaleY||1),degree:E.rotate||0}),S=b.width,C=b.height,B=p.width*(S/p.naturalWidth),L=p.height*(C/p.naturalHeight);p.left-=(B-p.width)/2,p.top-=(L-p.height)/2,p.width=B,p.height=L,p.aspectRatio=S/C,p.naturalWidth=S,p.naturalHeight=C,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,wi(this.canvas,we({width:p.width,height:p.height},I({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}),wi(this.image,we({width:p.width,height:p.height},I(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,C=this.limited,B=p.aspectRatio;if(h){var L=Number(p.minCropBoxWidth)||0,_=Number(p.minCropBoxHeight)||0,O=C?Math.min(E.width,b.width,b.width+b.left,E.width-b.left):E.width,N=C?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),B&&(L&&_?_*B>L?_=L/B:L=_*B:L?_=L/B:_&&(L=_*B),N*B>O?N=O/B:O=N*B),S.minWidth=Math.min(L,O),S.minHeight=Math.min(_,N),S.maxWidth=O,S.maxHeight=N}m&&(C?(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&&ar(this.face,ee,p.width>=m.width&&p.height>=m.height?z:M),wi(this.cropBox,we({width:p.width,height:p.height},I({translateX:p.left,translateY:p.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Li(this.element,De,this.getData())}},Uv={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 C=p;typeof p=="string"?C=h.ownerDocument.querySelectorAll(p):p.querySelector&&(C=[p]),this.previews=C,ye(C,function(B){var L=document.createElement("img");ar(B,Ae,{width:B.offsetWidth,height:B.offsetHeight,html:B.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;"',B.innerHTML="",B.appendChild(L)})}},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,p=this.cropBoxData,E=p.width,b=p.height,S=h.width,C=h.height,B=p.left-m.left-h.left,L=p.top-m.top-h.top;!this.cropped||this.disabled||(wi(this.viewBoxImage,we({width:S,height:C},I(we({translateX:-B,translateY:-L},h)))),ye(this.previews,function(_){var O=or(_,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),wi(_,{width:ue,height:Pe}),wi(_.getElementsByTagName("img")[0],we({width:S*pe,height:C*pe},I(we({translateX:-B*pe,translateY:-L*pe},h))))}))}},zv={bind:function(){var h=this.element,m=this.options,p=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(p,Ci,this.onCropStart=this.cropStart.bind(this)),m.zoomable&&m.zoomOnWheel&&ft(p,bi,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),m.toggleDragModeOnDblclick&&ft(p,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,p=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(p,Ci,this.onCropStart),m.zoomable&&m.zoomOnWheel&&Ne(p,bi,this.onWheel,{passive:!1,capture:!0}),m.toggleDragModeOnDblclick&&Ne(p,Zt,this.onDblclick),Ne(h.ownerDocument,zt,this.onCropMove),Ne(h.ownerDocument,Fi,this.onCropEnd),m.responsive&&Ne(window,_t,this.onResize)}},Hv={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 C,B;h.restore&&(C=this.getCanvasData(),B=this.getCropBoxData()),this.render(),h.restore&&(this.setCanvasData(ye(C,function(L,_){C[_]=L*S})),this.setCropBoxData(ye(B,function(L,_){B[_]=L*S})))}}},dblclick:function(){this.disabled||this.options.dragMode===Re||this.setDragMode(Do(this.dragBox,T)?ce:oe)},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(C){b[C.identifier]=be(C)}):b[h.pointerId||0]=be(h),Object.keys(b).length>1&&E.zoomable&&E.zoomOnTouch?S=G: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===$&&(this.cropping=!0,Le(this.dragBox,U)))}},cropMove:function(h){var m=this.action;if(!(this.disabled||!m)){var p=this.pointers;h.preventDefault(),Li(this.element,gi,{originalEvent:h,action:m})!==!1&&(h.changedTouches?ye(h.changedTouches,function(E){we(p[E.identifier]||{},be(E,!0))}):we(p[h.pointerId||0]||{},be(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,Ri(this.dragBox,U,this.cropped&&this.options.modal)),Li(this.element,He,{originalEvent:h,action:m}))}}},$v={change:function(h){var m=this.options,p=this.canvasData,E=this.containerData,b=this.cropBoxData,S=this.pointers,C=this.action,B=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,Mi;!B&&h.shiftKey&&(B=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 Rt=S[Object.keys(S)[0]],q={x:Rt.endX-Rt.startX,y:Rt.endY-Rt.startY},fe=function(qt){switch(qt){case K:he+q.x>Ke&&(q.x=Ke-he);break;case Q:L+q.x<Pe&&(q.x=Pe-L);break;case Y:_+q.y<pe&&(q.y=pe-_);break;case ne:ue+q.y>Je&&(q.y=Je-ue);break}};switch(C){case M:L+=q.x,_+=q.y;break;case K:if(q.x>=0&&(he>=Ke||B&&(_<=pe||ue>=Je))){$e=!1;break}fe(K),O+=q.x,O<0&&(C=Q,O=-O,L-=O),B&&(N=O/B,_+=(b.height-N)/2);break;case Y:if(q.y<=0&&(_<=pe||B&&(L<=Pe||he>=Ke))){$e=!1;break}fe(Y),N-=q.y,_+=q.y,N<0&&(C=ne,N=-N,_-=N),B&&(O=N*B,L+=(b.width-O)/2);break;case Q:if(q.x<=0&&(L<=Pe||B&&(_<=pe||ue>=Je))){$e=!1;break}fe(Q),O-=q.x,L+=q.x,O<0&&(C=K,O=-O,L-=O),B&&(N=O/B,_+=(b.height-N)/2);break;case ne:if(q.y>=0&&(ue>=Je||B&&(L<=Pe||he>=Ke))){$e=!1;break}fe(ne),N+=q.y,N<0&&(C=Y,N=-N,_-=N),B&&(O=N*B,L+=(b.width-O)/2);break;case re:if(B){if(q.y<=0&&(_<=pe||he>=Ke)){$e=!1;break}fe(Y),N-=q.y,_+=q.y,O=N*B}else fe(Y),fe(K),q.x>=0?he<Ke?O+=q.x:q.y<=0&&_<=pe&&($e=!1):O+=q.x,q.y<=0?_>pe&&(N-=q.y,_+=q.y):(N-=q.y,_+=q.y);O<0&&N<0?(C=We,N=-N,O=-O,_-=N,L-=O):O<0?(C=le,O=-O,L-=O):N<0&&(C=ke,N=-N,_-=N);break;case le:if(B){if(q.y<=0&&(_<=pe||L<=Pe)){$e=!1;break}fe(Y),N-=q.y,_+=q.y,O=N*B,L+=b.width-O}else fe(Y),fe(Q),q.x<=0?L>Pe?(O-=q.x,L+=q.x):q.y<=0&&_<=pe&&($e=!1):(O-=q.x,L+=q.x),q.y<=0?_>pe&&(N-=q.y,_+=q.y):(N-=q.y,_+=q.y);O<0&&N<0?(C=ke,N=-N,O=-O,_-=N,L-=O):O<0?(C=re,O=-O,L-=O):N<0&&(C=We,N=-N,_-=N);break;case We:if(B){if(q.x<=0&&(L<=Pe||ue>=Je)){$e=!1;break}fe(Q),O-=q.x,L+=q.x,N=O/B}else fe(ne),fe(Q),q.x<=0?L>Pe?(O-=q.x,L+=q.x):q.y>=0&&ue>=Je&&($e=!1):(O-=q.x,L+=q.x),q.y>=0?ue<Je&&(N+=q.y):N+=q.y;O<0&&N<0?(C=re,N=-N,O=-O,_-=N,L-=O):O<0?(C=ke,O=-O,L-=O):N<0&&(C=le,N=-N,_-=N);break;case ke:if(B){if(q.x>=0&&(he>=Ke||ue>=Je)){$e=!1;break}fe(K),O+=q.x,N=O/B}else fe(ne),fe(K),q.x>=0?he<Ke?O+=q.x:q.y>=0&&ue>=Je&&($e=!1):O+=q.x,q.y>=0?ue<Je&&(N+=q.y):N+=q.y;O<0&&N<0?(C=le,N=-N,O=-O,_-=N,L-=O):O<0?(C=We,O=-O,L-=O):N<0&&(C=re,N=-N,_-=N);break;case z:this.move(q.x,q.y),$e=!1;break;case G:this.zoom(X(S),h),$e=!1;break;case $:if(!q.x||!q.y){$e=!1;break}Mi=rn(this.cropper),L=Rt.startX-Mi.left,_=Rt.startY-Mi.top,O=b.minWidth,N=b.minHeight,q.x>0?C=q.y>0?ke:re:q.x<0&&(L-=O,C=q.y>0?We:le),q.y<0&&(_-=N),this.cropped||(Ot(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=C,this.renderCropBox()),ye(S,function(Xe){Xe.startX=Xe.endX,Xe.startY=Xe.endY})}},qv={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Le(this.dragBox,U),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,U),Le(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,Ot(this.cropper,k)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Le(this.cropper,k)),this},destroy:function(){var h=this.element;return h[V]?(h[V]=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(yi(h)?h:E+Number(h),yi(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,C=b.height,B=b.naturalWidth,L=b.naturalHeight;if(h=Number(h),h>=0&&this.ready&&!this.disabled&&E.zoomable){var _=B*h,O=L*h;if(Li(this.element,ir,{ratio:h,oldRatio:S/B,originalEvent:p})===!1)return this;if(p){var N=this.pointers,he=rn(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-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,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 C=p.width/p.naturalWidth;if(ye(S,function(_,O){S[O]=_/C}),h){var B=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=B-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&&sr(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 C=p.width/p.naturalWidth;se(h.x)&&(b.left=h.x*C+E.left),se(h.y)&&(b.top=h.y*C+E.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(p){m[p]=h[p]}),m},setCanvasData:function(h){var m=this.canvasData,p=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/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&&sr(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=$t(this.image,this.imageData,m,h);if(!this.cropped)return p;var E=this.getData(h.rounded),b=E.x,S=E.y,C=E.width,B=E.height,L=p.width/Math.floor(m.naturalWidth);L!==1&&(b*=L,S*=L,C*=L,B*=L);var _=C/B,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:C),height:h.height||(L!==1?p.height:B)}),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,Mi=h.imageSmoothingQuality;Ke.imageSmoothingEnabled=$e,Mi&&(Ke.imageSmoothingQuality=Mi);var Rt=p.width,q=p.height,fe=b,Xe=S,qt,Ii,Tr,xr,cr,Si;fe<=-C||fe>Rt?(fe=0,qt=0,Tr=0,cr=0):fe<=0?(Tr=-fe,fe=0,qt=Math.min(Rt,C+fe),cr=qt):fe<=Rt&&(Tr=0,qt=Math.min(C,Rt-fe),cr=qt),qt<=0||Xe<=-B||Xe>q?(Xe=0,Ii=0,xr=0,Si=0):Xe<=0?(xr=-Xe,Xe=0,Ii=Math.min(q,B+Xe),Si=Ii):Xe<=q&&(xr=0,Ii=Math.min(B,q-Xe),Si=Ii);var Pt=[fe,Xe,qt,Ii];if(cr>0&&Si>0){var kr=ue/C;Pt.push(Tr*kr,xr*kr,cr*kr,Si*kr)}return Ke.drawImage.apply(Ke,[p].concat(c(Pt.map(function(zo){return Math.floor(Te(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,p=this.dragBox,E=this.face;if(this.ready&&!this.disabled){var b=h===oe,S=m.movable&&h===ce;h=b||S?h:Re,m.dragMode=h,ar(p,ee,h),Ri(p,T,b),Ri(p,J,S),m.cropBoxMovable||(ar(E,ee,h),Ri(E,T,b),Ri(E,J,S))}return this}},Vv=F.Cropper,Td=function(){function g(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n(this,g),!h||!Er.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,p=m.tagName.toLowerCase(),E;if(!m[V]){if(m[V]=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(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(){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=Dv(m),S=0,C=1,B=1;if(b>1){this.url=Iv(m,Oi);var L=Nv(b);S=L.rotate,C=L.scaleX,B=L.scaleY}p.rotatable&&(E.rotate=S),p.scalable&&(E.scaleX=C,E.scaleY=B),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),Le(S,H),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=F.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(F.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"),C=document.body||document.documentElement;this.sizingImage=S,S.onload=function(){b(S.width,S.height),E||C.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;",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,p=this.options,E=this.image,b=m.parentNode,S=document.createElement("div");S.innerHTML=Mo;var C=S.querySelector(".".concat(V,"-container")),B=C.querySelector(".".concat(V,"-canvas")),L=C.querySelector(".".concat(V,"-drag-box")),_=C.querySelector(".".concat(V,"-crop-box")),O=_.querySelector(".".concat(V,"-face"));this.container=b,this.cropper=C,this.canvas=B,this.dragBox=L,this.cropBox=_,this.viewBox=C.querySelector(".".concat(V,"-view-box")),this.face=O,B.appendChild(E),Le(m,A),b.insertBefore(C,m.nextSibling),Ot(E,H),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,Le(_,A),p.guides||Le(_.getElementsByClassName("".concat(V,"-dashed")),A),p.center||Le(_.getElementsByClassName("".concat(V,"-center")),A),p.background&&Le(C,"".concat(V,"-bg")),p.highlight||Le(O,j),p.cropBoxMovable&&(Le(O,J),ar(O,ee,M)),p.cropBoxResizable||(Le(_.getElementsByClassName("".concat(V,"-line")),A),Le(_.getElementsByClassName("".concat(V,"-point")),A)),this.render(),this.ready=!0,this.setDragMode(p.dragMode),p.autoCrop&&this.crop(),this.setData(p.data),Ge(p.ready)&&ft(m,_i,p.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=Vv,g}},{key:"setDefaults",value:function(m){we(gs,sr(m)&&m)}}])}();return we(Td.prototype,Bv,Uv,zv,Hv,$v,qv),Td})});var Bl=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=Jv(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 Jv(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 Ul=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 Bl(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(":")}},eb={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}},tb=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function ib(i){let t=i.trim().match(tb)||[],r=t[2],s=t[3];return s&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${s}`,s=""),{eventTarget:rb(t[4]),eventName:r,eventOptions:t[7]?sb(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||s}}function rb(i){if(i=="window")return window;if(i=="document")return document}function sb(i){return i.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function nb(i){if(i==window)return"window";if(i==document)return"document"}function ac(i){return i.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function zl(i){return ac(i.replace(/--/g,"-").replace(/__/g,"_"))}function nn(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Bd(i){return i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function ob(i){return i.match(/[^\s]+/g)||[]}function Fd(i){return i!=null}function Hl(i,e){return Object.prototype.hasOwnProperty.call(i,e)}var _d=["meta","ctrl","alt","shift"],$l=class{constructor(e,t,r,s){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||ab(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,ib(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=>!_d.includes(s))[0];return r?(Hl(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[ac(o)]=lb(s))}return e}get eventTargetName(){return nb(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[r,s,n,o]=_d.map(a=>t.includes(a));return e.metaKey!==r||e.ctrlKey!==s||e.altKey!==n||e.shiftKey!==o}},Od={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:i=>i.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function ab(i){let e=i.tagName.toLowerCase();if(e in Od)return Od[e](i)}function Ho(i){throw new Error(i)}function lb(i){try{return JSON.parse(i)}catch{return i}}var ql=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 cb(i,e,t){Ud(i,e).add(t)}function ub(i,e,t){Ud(i,e).delete(t),hb(i,e)}function Ud(i,e){let t=i.get(e);return t||(t=new Set,i.set(e,t)),t}function hb(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){cb(this.valuesByKey,e,t)}delete(e,t){ub(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 Vl=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)}},jl=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=pb(t,r).findIndex(([n,o])=>!fb(n,o));return s==-1?[[],[]]:[t.slice(s),r.slice(s)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return db(r,e,t)}};function db(i,e,t){return i.trim().split(/\s+/).filter(r=>r.length).map((r,s)=>({element:e,attributeName:t,content:r,index:s}))}function pb(i,e){let t=Math.max(i.length,e.length);return Array.from({length:t},(r,s)=>[i[s],e[s]])}function fb(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}}}},Wl=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 ql(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=$l.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},Gl=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new jl(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]}},Kl=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=zd(i);return Array.from(t.reduce((r,s)=>(gb(s,e).forEach(n=>r.add(n)),r),new Set))}function mb(i,e){return zd(i).reduce((r,s)=>(r.push(...vb(s,e)),r),[])}function zd(i){let e=[];for(;i;)e.push(i),i=Object.getPrototypeOf(i);return e.reverse()}function gb(i,e){let t=i[e];return Array.isArray(t)?t:[]}function vb(i,e){let t=i[e];return t?Object.keys(t).map(r=>[r,t[r]]):[]}var Xl=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 Vl(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}},Yl=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 Wl(this,this.dispatcher),this.valueObserver=new Gl(this,this.controller),this.targetObserver=new Kl(this,this),this.outletObserver=new Xl(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(`${zl(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${zl(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let r=this.controller;typeof r[e]=="function"&&r[e](...t)}};function bb(i){return yb(i,wb(i))}function yb(i,e){let t=xb(i),r=Sb(i.prototype,e);return Object.defineProperties(t.prototype,r),t}function wb(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 Sb(i,e){return Tb(e).reduce((t,r)=>{let s=Eb(i,e,r);return s&&Object.assign(t,{[r]:s}),t},{})}function Eb(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 Tb=typeof Object.getOwnPropertySymbols=="function"?i=>[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)]:Object.getOwnPropertyNames,xb=(()=>{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 kb(i){return{identifier:i.identifier,controllerConstructor:bb(i.controllerConstructor)}}var Zl=class{constructor(e,t){this.application=e,this.definition=kb(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 Yl(this,e),this.contextsByScope.set(e,t)),t}},Ql=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 ob(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Jl=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}-${Bd(e)}`}},ec=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 tc(i,e){return`[${i}~="${e}"]`}var ic=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 tc(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 tc(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}},rc=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)}},sc=class i{constructor(e,t,r,s){this.targets=new ic(this),this.classes=new Ql(this),this.data=new Jl(this),this.containsElement=n=>n.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new ec(s),this.outlets=new rc(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 tc(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)}},nc=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}},oc=class{constructor(e){this.application=e,this.scopeObserver=new nc(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 Zl(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 sc(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))}},Ab={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"},Rd("abcdefghijklmnopqrstuvwxyz".split("").map(i=>[i,i]))),Rd("0123456789".split("").map(i=>[i,i])))};function Rd(i){return i.reduce((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r}),{})}var Wo=class{constructor(e=document.documentElement,t=Ab){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 Ul(this),this.router=new oc(this),this.actionDescriptorFilters=Object.assign({},eb)}static start(e,t){let r=new this(e,t);return r.start(),r}async start(){await Pb(),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 Kv=Object.create;var Fd=Object.defineProperty;var Xv=Object.getOwnPropertyDescriptor;var Yv=Object.getOwnPropertyNames;var Zv=Object.getPrototypeOf,Qv=Object.prototype.hasOwnProperty;var Me=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Jv=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Yv(e))!Qv.call(i,s)&&s!==t&&Fd(i,s,{get:()=>e[s],enumerable:!(r=Xv(e,s))||r.enumerable});return i};var Fe=(i,e,t)=>(t=i!=null?Kv(Zv(i)):{},Jv(e||!i||!i.__esModule?Fd(t,"default",{value:i,enumerable:!0}):t,i));var bf=Me((aC,vf)=>{vf.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 Ma=Me((cC,yf)=>{function Xw(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}yf.exports=Xw});var Sf=Me((uC,wf)=>{var Yw=typeof global=="object"&&global&&global.Object===Object&&global;wf.exports=Yw});var xu=Me((hC,Tf)=>{var Zw=Sf(),Qw=typeof self=="object"&&self&&self.Object===Object&&self,Jw=Zw||Qw||Function("return this")();Tf.exports=Jw});var kf=Me((dC,Ef)=>{var e1=xu(),t1=function(){return e1.Date.now()};Ef.exports=t1});var Af=Me((pC,xf)=>{var i1=/\s/;function r1(i){for(var e=i.length;e--&&i1.test(i.charAt(e)););return e}xf.exports=r1});var Cf=Me((fC,Pf)=>{var s1=Af(),n1=/^\s+/;function o1(i){return i&&i.slice(0,s1(i)+1).replace(n1,"")}Pf.exports=o1});var Au=Me((mC,Ff)=>{var a1=xu(),l1=a1.Symbol;Ff.exports=l1});var Lf=Me((gC,Rf)=>{var _f=Au(),Of=Object.prototype,c1=Of.hasOwnProperty,u1=Of.toString,Rn=_f?_f.toStringTag:void 0;function h1(i){var e=c1.call(i,Rn),t=i[Rn];try{i[Rn]=void 0;var r=!0}catch{}var s=u1.call(i);return r&&(e?i[Rn]=t:delete i[Rn]),s}Rf.exports=h1});var If=Me((vC,Mf)=>{var d1=Object.prototype,p1=d1.toString;function f1(i){return p1.call(i)}Mf.exports=f1});var Uf=Me((bC,Bf)=>{var Df=Au(),m1=Lf(),g1=If(),v1="[object Null]",b1="[object Undefined]",Nf=Df?Df.toStringTag:void 0;function y1(i){return i==null?i===void 0?b1:v1:Nf&&Nf in Object(i)?m1(i):g1(i)}Bf.exports=y1});var Hf=Me((yC,zf)=>{function w1(i){return i!=null&&typeof i=="object"}zf.exports=w1});var qf=Me((wC,$f)=>{var S1=Uf(),T1=Hf(),E1="[object Symbol]";function k1(i){return typeof i=="symbol"||T1(i)&&S1(i)==E1}$f.exports=k1});var Gf=Me((SC,Wf)=>{var x1=Cf(),Vf=Ma(),A1=qf(),jf=NaN,P1=/^[-+]0x[0-9a-f]+$/i,C1=/^0b[01]+$/i,F1=/^0o[0-7]+$/i,_1=parseInt;function O1(i){if(typeof i=="number")return i;if(A1(i))return jf;if(Vf(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Vf(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=x1(i);var t=C1.test(i);return t||F1.test(i)?_1(i.slice(2),t?2:8):P1.test(i)?jf:+i}Wf.exports=O1});var Cu=Me((TC,Xf)=>{var R1=Ma(),Pu=kf(),Kf=Gf(),L1="Expected a function",M1=Math.max,I1=Math.min;function D1(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(L1);e=Kf(e)||0,R1(t)&&(d=!!t.leading,f="maxWait"in t,n=f?M1(Kf(t.maxWait)||0,e):n,y="trailing"in t?!!t.trailing:y);function v(z){var G=r,K=s;return r=s=void 0,c=z,o=i.apply(K,G),o}function k(z){return c=z,a=setTimeout(R,e),d?v(z):o}function P(z){var G=z-l,K=z-c,Q=e-G;return f?I1(Q,n-K):Q}function F(z){var G=z-l,K=z-c;return l===void 0||G>=e||G<0||f&&K>=n}function R(){var z=Pu();if(F(z))return D(z);a=setTimeout(R,P(z))}function D(z){return a=void 0,y&&r?v(z):(r=s=void 0,o)}function V(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function M(){return a===void 0?o:D(Pu())}function $(){var z=Pu(),G=F(z);if(r=arguments,s=this,l=z,G){if(a===void 0)return k(l);if(f)return clearTimeout(a),a=setTimeout(R,e),v(l)}return a===void 0&&(a=setTimeout(R,e)),o}return $.cancel=V,$.flush=M,$}Xf.exports=D1});var Zf=Me((EC,Yf)=>{var N1=Cu(),B1=Ma(),U1="Expected a function";function z1(i,e,t){var r=!0,s=!0;if(typeof i!="function")throw new TypeError(U1);return B1(t)&&(r="leading"in t?!!t.leading:r,s="trailing"in t?!!t.trailing:s),N1(i,e,{leading:r,maxWait:e,trailing:s})}Yf.exports=z1});var Ba=Me((NC,sm)=>{"use strict";sm.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 am=Me((BC,om)=>{"use strict";function nm(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}nm.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};om.exports=function(i,e,t){var r=new nm(i,t||/[\/\.]/);return typeof e<"u"?r.match(e):r}});var cm=Me((UC,lm)=>{var W1=am(),G1=/[\/\+\.]/;lm.exports=function(i,e){function t(r){var s=W1(r,i,G1);return s&&s.length>=2}return e?t(e.split(";")[0]):t}});var wt=Me((b2,Ka)=>{(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 Ka<"u"&&Ka.exports?(e.default=e,Ka.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var Rg=Me((d_,Lh)=>{"use strict";var ST=Object.prototype.hasOwnProperty,Tt="~";function uo(){}Object.create&&(uo.prototype=Object.create(null),new uo().__proto__||(Tt=!1));function TT(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function Og(i,e,t,r,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new TT(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 pl(i,e){--i._eventsCount===0?i._events=new uo:delete i._events[e]}function pt(){this._events=new uo,this._eventsCount=0}pt.prototype.eventNames=function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)ST.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,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};pt.prototype.on=function(e,t,r){return Og(this,e,t,r,!1)};pt.prototype.once=function(e,t,r){return Og(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 pl(this,n),this;var o=this._events[n];if(o.fn)o.fn===t&&(!s||o.once)&&(!r||o.context===r)&&pl(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:pl(this,n)}return this};pt.prototype.removeAllListeners=function(e){var t;return e?(t=Tt?Tt+e:e,this._events[t]&&pl(this,t)):(this._events=new uo,this._eventsCount=0),this};pt.prototype.off=pt.prototype.removeListener;pt.prototype.addListener=pt.prototype.on;pt.prefixed=Tt;pt.EventEmitter=pt;typeof Lh<"u"&&(Lh.exports=pt)});var vv=Me((ud,hd)=>{(function(i,e){typeof ud=="object"&&typeof hd<"u"?hd.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Cropper=e())})(ud,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(T){return Object.getOwnPropertyDescriptor(g,T).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)||k()}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 k(){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,V="cropper",M="all",$="crop",z="move",G="zoom",K="e",Q="w",ne="s",Y="n",re="ne",le="nw",xe="se",We="sw",E="".concat(V,"-crop"),x="".concat(V,"-disabled"),A="".concat(V,"-hidden"),H="".concat(V,"-hide"),j="".concat(V,"-invisible"),U="".concat(V,"-modal"),J="".concat(V,"-move"),ee="".concat(V,"Action"),Ae="".concat(V,"Preview"),oe="crop",ce="move",Re="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,p){h.call(g,m,p,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,p=new Array(m>1?m-1:0),T=1;T<m;T++)p[T-1]=arguments[T];return ii(h)&&p.length>0&&p.forEach(function(b){ii(b)&&Object.keys(b).forEach(function(S){h[S]=b[S]})}),h},Ml=/\.\d*(?:0|9){12}\d*$/;function Ee(g){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Ml.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(p,T){nr.test(T)&&se(p)&&(p="".concat(p,"px")),m[T]=p})}function Do(g,h){return g.classList?g.classList.contains(h):g.className.indexOf(h)>-1}function Le(g,h){if(h){if(se(g.length)){ye(g,function(p){Le(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 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(p){Ri(p,h,m)});return}m?Le(g,h):Ot(g,h)}}var Il=/([a-z\d])([A-Z])/g;function At(g){return g.replace(Il,"$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(){},p=Object.defineProperty({},"once",{get:function(){return g=!0,h},set:function(b){h=b}});F.addEventListener("test",m,p),F.removeEventListener("test",m,p)}return g}();function Ne(g,h,m){var p=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,p)})}function ft(g,h,m){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},T=m;h.trim().split(ys).forEach(function(b){if(p.once&&!tn){var S=g.listeners,C=S===void 0?{}:S;T=function(){delete C[b][m],g.removeEventListener(b,T,p);for(var L=arguments.length,_=new Array(L),O=0;O<L;O++)_[O]=arguments[O];m.apply(g,_)},C[b]||(C[b]={}),C[b][m]&&g.removeEventListener(b,C[b][m],p),C[b][m]=T,g.listeners=C}g.addEventListener(b,T,p)})}function Li(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 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,Dl=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Z(g){var h=g.match(Dl);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 I(g){var h=g.rotate,m=g.scaleX,p=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(p)&&p!==1&&S.push("scaleY(".concat(p,")"));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(p,T){delete h[T],ye(h,function(b){var S=Math.abs(p.startX-b.startX),C=Math.abs(p.startY-b.startY),B=Math.abs(p.endX-b.endX),L=Math.abs(p.endY-b.endY),_=Math.sqrt(S*S+C*C),O=Math.sqrt(B*B+L*L),N=(O-_)/_;Math.abs(N)>Math.abs(m)&&(m=N)})}),m}function be(g,h){var m=g.pageX,p=g.pageY,T={endX:m,endY:p};return h?T:e({startX:m,startY:p},T)}function Qe(g){var h=0,m=0,p=0;return ye(g,function(T){var b=T.startX,S=T.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,T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",b=Ht(p),S=Ht(m);if(b&&S){var C=m*h;T==="contain"&&C>p||T==="cover"&&C<p?m=p/h:p=m*h}else b?m=p/h:S&&(p=m*h);return{width:p,height:m}}function ht(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 T=p%90*Math.PI/180,b=Math.sin(T),S=Math.cos(T),C=h*S+m*b,B=h*b+m*S;return p>90?{width:B,height:C}:{width:C,height:B}}function $t(g,h,m,p){var T=h.aspectRatio,b=h.naturalWidth,S=h.naturalHeight,C=h.rotate,B=C===void 0?0:C,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,Mi=p.imageSmoothingQuality,Rt=Mi===void 0?"low":Mi,q=p.maxWidth,fe=q===void 0?1/0:q,Xe=p.maxHeight,qt=Xe===void 0?1/0:Xe,Ii=p.minWidth,Er=Ii===void 0?0:Ii,kr=p.minHeight,cr=kr===void 0?0:kr,Si=document.createElement("canvas"),Pt=Si.getContext("2d"),xr=Se({aspectRatio:he,width:fe,height:qt}),zo=Se({aspectRatio:he,width:Er,height:cr},"cover"),Nl=Math.min(xr.width,Math.max(zo.width,ue)),Bl=Math.min(xr.height,Math.max(zo.height,Pe)),xd=Se({aspectRatio:T,width:fe,height:qt}),Ad=Se({aspectRatio:T,width:Er,height:cr},"cover"),Pd=Math.min(xd.width,Math.max(Ad.width,b)),Cd=Math.min(xd.height,Math.max(Ad.height,S)),Wv=[-Pd/2,-Cd/2,Pd,Cd];return Si.width=Ee(Nl),Si.height=Ee(Bl),Pt.fillStyle=Ke,Pt.fillRect(0,0,Nl,Bl),Pt.save(),Pt.translate(Nl/2,Bl/2),Pt.rotate(B*Math.PI/180),Pt.scale(_,N),Pt.imageSmoothingEnabled=$e,Pt.imageSmoothingQuality=Rt,Pt.drawImage.apply(Pt,[g].concat(c(Wv.map(function(Gv){return Math.floor(Ee(Gv))})))),Pt.restore(),Si}var lr=String.fromCharCode;function nt(g,h,m){var p="";m+=h;for(var T=h;T<m;T+=1)p+=lr(g.getUint8(T));return p}var Bo=/^data:.*,/;function Uo(g){var h=g.replace(Bo,""),m=atob(h),p=new ArrayBuffer(m.length),T=new Uint8Array(p);return ye(T,function(b,S){T[S]=m.charCodeAt(S)}),p}function Dv(g,h){for(var m=[],p=8192,T=new Uint8Array(g);T.length>0;)m.push(lr.apply(null,Io(T.subarray(0,p)))),T=T.subarray(p);return"data:".concat(h,";base64,").concat(btoa(m.join("")))}function Nv(g){var h=new DataView(g),m;try{var p,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 B=T+4,L=T+10;if(nt(h,B,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 Bv(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 Uv={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,T=this.cropper,b=Number(m.minContainerWidth),S=Number(m.minContainerHeight);Le(T,A),Ot(h,A);var C={width:Math.max(p.offsetWidth,b>=0?b:rr),height:Math.max(p.offsetHeight,S>=0?S:Js)};this.containerData=C,wi(T,{width:C.width,height:C.height}),Le(h,A),Ot(T,A)},initCanvas:function(){var h=this.containerData,m=this.imageData,p=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,B=h.width,L=h.height;h.height*C>h.width?p===3?B=h.height*C:L=h.width/C:p===3?L=h.width/C:B=h.height*C;var _={aspectRatio:C,naturalWidth:b,naturalHeight:S,width:B,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,T=this.containerData,b=this.canvasData,S=this.cropBoxData,C=p.viewMode,B=b.aspectRatio,L=this.cropped&&S;if(h){var _=Number(p.minCanvasWidth)||0,O=Number(p.minCanvasHeight)||0;C>1?(_=Math.max(_,T.width),O=Math.max(O,T.height),C===3&&(O*B>_?_=O*B:O=_/B)):C>0&&(_?_=Math.max(_,L?S.width:0):O?O=Math.max(O,L?S.height:0):L&&(_=S.width,O=S.height,O*B>_?_=O*B:O=_/B));var N=Se({aspectRatio:B,width:_,height:O});_=N.width,O=N.height,b.minWidth=_,b.minHeight=O,b.maxWidth=1/0,b.maxHeight=1/0}if(m)if(C>(L?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),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,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 p=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,B=p.width*(S/p.naturalWidth),L=p.height*(C/p.naturalHeight);p.left-=(B-p.width)/2,p.top-=(L-p.height)/2,p.width=B,p.height=L,p.aspectRatio=S/C,p.naturalWidth=S,p.naturalHeight=C,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,wi(this.canvas,we({width:p.width,height:p.height},I({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,T=p.naturalWidth*(m.width/m.naturalWidth),b=p.naturalHeight*(m.height/m.naturalHeight);we(p,{width:T,height:b,left:(m.width-T)/2,top:(m.height-b)/2}),wi(this.image,we({width:p.width,height:p.height},I(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,T=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*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 p=this.options,T=this.containerData,b=this.canvasData,S=this.cropBoxData,C=this.limited,B=p.aspectRatio;if(h){var L=Number(p.minCropBoxWidth)||0,_=Number(p.minCropBoxHeight)||0,O=C?Math.min(T.width,b.width,b.width+b.left,T.width-b.left):T.width,N=C?Math.min(T.height,b.height,b.height+b.top,T.height-b.top):T.height;L=Math.min(L,T.width),_=Math.min(_,T.height),B&&(L&&_?_*B>L?_=L/B:L=_*B:L?_=L/B:_&&(L=_*B),N*B>O?N=O/B:O=N*B),S.minWidth=Math.min(L,O),S.minHeight=Math.min(_,N),S.maxWidth=O,S.maxHeight=N}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,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&&ar(this.face,ee,p.width>=m.width&&p.height>=m.height?z:M),wi(this.cropBox,we({width:p.width,height:p.height},I({translateX:p.left,translateY:p.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Li(this.element,De,this.getData())}},zv={initPreview:function(){var h=this.element,m=this.crossOrigin,p=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,!!p){var C=p;typeof p=="string"?C=h.ownerDocument.querySelectorAll(p):p.querySelector&&(C=[p]),this.previews=C,ye(C,function(B){var L=document.createElement("img");ar(B,Ae,{width:B.offsetWidth,height:B.offsetHeight,html:B.innerHTML}),m&&(L.crossOrigin=m),L.src=T,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;"',B.innerHTML="",B.appendChild(L)})}},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,p=this.cropBoxData,T=p.width,b=p.height,S=h.width,C=h.height,B=p.left-m.left-h.left,L=p.top-m.top-h.top;!this.cropped||this.disabled||(wi(this.viewBoxImage,we({width:S,height:C},I(we({translateX:-B,translateY:-L},h)))),ye(this.previews,function(_){var O=or(_,Ae),N=O.width,he=O.height,ue=N,Pe=he,pe=1;T&&(pe=N/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},I(we({translateX:-B*pe,translateY:-L*pe},h))))}))}},Hv={bind:function(){var h=this.element,m=this.options,p=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(p,Ci,this.onCropStart=this.cropStart.bind(this)),m.zoomable&&m.zoomOnWheel&&ft(p,bi,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),m.toggleDragModeOnDblclick&&ft(p,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,p=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(p,Ci,this.onCropStart),m.zoomable&&m.zoomOnWheel&&Ne(p,bi,this.onWheel,{passive:!1,capture:!0}),m.toggleDragModeOnDblclick&&Ne(p,Zt,this.onDblclick),Ne(h.ownerDocument,zt,this.onCropMove),Ne(h.ownerDocument,Fi,this.onCropEnd),m.responsive&&Ne(window,_t,this.onResize)}},$v={resize:function(){if(!this.disabled){var h=this.options,m=this.container,p=this.containerData,T=m.offsetWidth/p.width,b=m.offsetHeight/p.height,S=Math.abs(T-1)>Math.abs(b-1)?T:b;if(S!==1){var C,B;h.restore&&(C=this.getCanvasData(),B=this.getCropBoxData()),this.render(),h.restore&&(this.setCanvasData(ye(C,function(L,_){C[_]=L*S})),this.setCropBoxData(ye(B,function(L,_){B[_]=L*S})))}}},dblclick:function(){this.disabled||this.options.dragMode===Re||this.setDragMode(Do(this.dragBox,E)?ce:oe)},wheel:function(h){var m=this,p=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*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 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=G: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===$&&(this.cropping=!0,Le(this.dragBox,U)))}},cropMove:function(h){var m=this.action;if(!(this.disabled||!m)){var p=this.pointers;h.preventDefault(),Li(this.element,gi,{originalEvent:h,action:m})!==!1&&(h.changedTouches?ye(h.changedTouches,function(T){we(p[T.identifier]||{},be(T,!0))}):we(p[h.pointerId||0]||{},be(h,!0)),this.change(h))}},cropEnd:function(h){if(!this.disabled){var m=this.action,p=this.pointers;h.changedTouches?ye(h.changedTouches,function(T){delete p[T.identifier]}):delete p[h.pointerId||0],m&&(h.preventDefault(),Object.keys(p).length||(this.action=""),this.cropping&&(this.cropping=!1,Ri(this.dragBox,U,this.cropped&&this.options.modal)),Li(this.element,He,{originalEvent:h,action:m}))}}},qv={change:function(h){var m=this.options,p=this.canvasData,T=this.containerData,b=this.cropBoxData,S=this.pointers,C=this.action,B=m.aspectRatio,L=b.left,_=b.top,O=b.width,N=b.height,he=L+O,ue=_+N,Pe=0,pe=0,Ke=T.width,Je=T.height,$e=!0,Mi;!B&&h.shiftKey&&(B=O&&N?O/N:1),this.limited&&(Pe=b.minLeft,pe=b.minTop,Ke=Pe+Math.min(T.width,p.width,p.left+p.width),Je=pe+Math.min(T.height,p.height,p.top+p.height));var Rt=S[Object.keys(S)[0]],q={x:Rt.endX-Rt.startX,y:Rt.endY-Rt.startY},fe=function(qt){switch(qt){case K:he+q.x>Ke&&(q.x=Ke-he);break;case Q:L+q.x<Pe&&(q.x=Pe-L);break;case Y:_+q.y<pe&&(q.y=pe-_);break;case ne:ue+q.y>Je&&(q.y=Je-ue);break}};switch(C){case M:L+=q.x,_+=q.y;break;case K:if(q.x>=0&&(he>=Ke||B&&(_<=pe||ue>=Je))){$e=!1;break}fe(K),O+=q.x,O<0&&(C=Q,O=-O,L-=O),B&&(N=O/B,_+=(b.height-N)/2);break;case Y:if(q.y<=0&&(_<=pe||B&&(L<=Pe||he>=Ke))){$e=!1;break}fe(Y),N-=q.y,_+=q.y,N<0&&(C=ne,N=-N,_-=N),B&&(O=N*B,L+=(b.width-O)/2);break;case Q:if(q.x<=0&&(L<=Pe||B&&(_<=pe||ue>=Je))){$e=!1;break}fe(Q),O-=q.x,L+=q.x,O<0&&(C=K,O=-O,L-=O),B&&(N=O/B,_+=(b.height-N)/2);break;case ne:if(q.y>=0&&(ue>=Je||B&&(L<=Pe||he>=Ke))){$e=!1;break}fe(ne),N+=q.y,N<0&&(C=Y,N=-N,_-=N),B&&(O=N*B,L+=(b.width-O)/2);break;case re:if(B){if(q.y<=0&&(_<=pe||he>=Ke)){$e=!1;break}fe(Y),N-=q.y,_+=q.y,O=N*B}else fe(Y),fe(K),q.x>=0?he<Ke?O+=q.x:q.y<=0&&_<=pe&&($e=!1):O+=q.x,q.y<=0?_>pe&&(N-=q.y,_+=q.y):(N-=q.y,_+=q.y);O<0&&N<0?(C=We,N=-N,O=-O,_-=N,L-=O):O<0?(C=le,O=-O,L-=O):N<0&&(C=xe,N=-N,_-=N);break;case le:if(B){if(q.y<=0&&(_<=pe||L<=Pe)){$e=!1;break}fe(Y),N-=q.y,_+=q.y,O=N*B,L+=b.width-O}else fe(Y),fe(Q),q.x<=0?L>Pe?(O-=q.x,L+=q.x):q.y<=0&&_<=pe&&($e=!1):(O-=q.x,L+=q.x),q.y<=0?_>pe&&(N-=q.y,_+=q.y):(N-=q.y,_+=q.y);O<0&&N<0?(C=xe,N=-N,O=-O,_-=N,L-=O):O<0?(C=re,O=-O,L-=O):N<0&&(C=We,N=-N,_-=N);break;case We:if(B){if(q.x<=0&&(L<=Pe||ue>=Je)){$e=!1;break}fe(Q),O-=q.x,L+=q.x,N=O/B}else fe(ne),fe(Q),q.x<=0?L>Pe?(O-=q.x,L+=q.x):q.y>=0&&ue>=Je&&($e=!1):(O-=q.x,L+=q.x),q.y>=0?ue<Je&&(N+=q.y):N+=q.y;O<0&&N<0?(C=re,N=-N,O=-O,_-=N,L-=O):O<0?(C=xe,O=-O,L-=O):N<0&&(C=le,N=-N,_-=N);break;case xe:if(B){if(q.x>=0&&(he>=Ke||ue>=Je)){$e=!1;break}fe(K),O+=q.x,N=O/B}else fe(ne),fe(K),q.x>=0?he<Ke?O+=q.x:q.y>=0&&ue>=Je&&($e=!1):O+=q.x,q.y>=0?ue<Je&&(N+=q.y):N+=q.y;O<0&&N<0?(C=le,N=-N,O=-O,_-=N,L-=O):O<0?(C=We,O=-O,L-=O):N<0&&(C=re,N=-N,_-=N);break;case z:this.move(q.x,q.y),$e=!1;break;case G:this.zoom(X(S),h),$e=!1;break;case $:if(!q.x||!q.y){$e=!1;break}Mi=rn(this.cropper),L=Rt.startX-Mi.left,_=Rt.startY-Mi.top,O=b.minWidth,N=b.minHeight,q.x>0?C=q.y>0?xe:re:q.x<0&&(L-=O,C=q.y>0?We:le),q.y<0&&(_-=N),this.cropped||(Ot(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=C,this.renderCropBox()),ye(S,function(Xe){Xe.startX=Xe.endX,Xe.startY=Xe.endY})}},Vv={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Le(this.dragBox,U),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,U),Le(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,Ot(this.cropper,x)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Le(this.cropper,x)),this},destroy:function(){var h=this.element;return h[V]?(h[V]=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,T=p.left,b=p.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,p=this.canvasData,T=!1;return h=Number(h),m=Number(m),this.ready&&!this.disabled&&this.options.movable&&(se(h)&&(p.left=h,T=!0),se(m)&&(p.top=m,T=!0),T&&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 T=this.options,b=this.canvasData,S=b.width,C=b.height,B=b.naturalWidth,L=b.naturalHeight;if(h=Number(h),h>=0&&this.ready&&!this.disabled&&T.zoomable){var _=B*h,O=L*h;if(Li(this.element,ir,{ratio:h,oldRatio:S/B,originalEvent:p})===!1)return this;if(p){var N=this.pointers,he=rn(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-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,p=this.imageData,T=!1;return h=Number(h),m=Number(m),this.ready&&!this.disabled&&this.options.scalable&&(se(h)&&(p.scaleX=h,T=!0),se(m)&&(p.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,p=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=p.width/p.naturalWidth;if(ye(S,function(_,O){S[O]=_/C}),h){var B=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=B-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,T=this.canvasData,b={};if(this.ready&&!this.disabled&&sr(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 C=p.width/p.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(p){m[p]=h[p]}),m},setCanvasData:function(h){var m=this.canvasData,p=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/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,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),p&&(T?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=$t(this.image,this.imageData,m,h);if(!this.cropped)return p;var T=this.getData(h.rounded),b=T.x,S=T.y,C=T.width,B=T.height,L=p.width/Math.floor(m.naturalWidth);L!==1&&(b*=L,S*=L,C*=L,B*=L);var _=C/B,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:C),height:h.height||(L!==1?p.height:B)}),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=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=p.width,q=p.height,fe=b,Xe=S,qt,Ii,Er,kr,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<=-B||Xe>q?(Xe=0,Ii=0,kr=0,Si=0):Xe<=0?(kr=-Xe,Xe=0,Ii=Math.min(q,B+Xe),Si=Ii):Xe<=q&&(kr=0,Ii=Math.min(B,q-Xe),Si=Ii);var Pt=[fe,Xe,qt,Ii];if(cr>0&&Si>0){var xr=ue/C;Pt.push(Er*xr,kr*xr,cr*xr,Si*xr)}return Ke.drawImage.apply(Ke,[p].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,p=this.dragBox,T=this.face;if(this.ready&&!this.disabled){var b=h===oe,S=m.movable&&h===ce;h=b||S?h:Re,m.dragMode=h,ar(p,ee,h),Ri(p,E,b),Ri(p,J,S),m.cropBoxMovable||(ar(T,ee,h),Ri(T,E,b),Ri(T,J,S))}return this}},jv=F.Cropper,kd=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,p=m.tagName.toLowerCase(),T;if(!m[V]){if(m[V]=this,p==="img"){if(this.isImg=!0,T=m.getAttribute("src")||"",this.originalUrl=T,!T)return;T=m.src}else p==="canvas"&&window.HTMLCanvasElement&&(T=m.toDataURL());this.load(T)}}},{key:"load",value:function(m){var p=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(){p.read(S.response)},S.onloadend=function(){p.reloading=!1,p.xhr=null},b.checkCrossOrigin&&Z(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 p=this.options,T=this.imageData,b=Nv(m),S=0,C=1,B=1;if(b>1){this.url=Dv(m,Oi);var L=Bv(b);S=L.rotate,C=L.scaleX,B=L.scaleY}p.rotatable&&(T.rotate=S),p.scalable&&(T.scaleX=C,T.scaleY=B),this.clone()}},{key:"clone",value:function(){var m=this.element,p=this.url,T=m.crossOrigin,b=p;this.options.checkCrossOrigin&&Z(p)&&(T||(T="anonymous"),b=w(p)),this.crossOrigin=T,this.crossOriginUrl=b;var S=document.createElement("img");T&&(S.crossOrigin=T),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),Le(S,H),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 T=F.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(F.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&&!T){b(p.naturalWidth,p.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=p.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,p=this.options,T=this.image,b=m.parentNode,S=document.createElement("div");S.innerHTML=Mo;var C=S.querySelector(".".concat(V,"-container")),B=C.querySelector(".".concat(V,"-canvas")),L=C.querySelector(".".concat(V,"-drag-box")),_=C.querySelector(".".concat(V,"-crop-box")),O=_.querySelector(".".concat(V,"-face"));this.container=b,this.cropper=C,this.canvas=B,this.dragBox=L,this.cropBox=_,this.viewBox=C.querySelector(".".concat(V,"-view-box")),this.face=O,B.appendChild(T),Le(m,A),b.insertBefore(C,m.nextSibling),Ot(T,H),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,Le(_,A),p.guides||Le(_.getElementsByClassName("".concat(V,"-dashed")),A),p.center||Le(_.getElementsByClassName("".concat(V,"-center")),A),p.background&&Le(C,"".concat(V,"-bg")),p.highlight||Le(O,j),p.cropBoxMovable&&(Le(O,J),ar(O,ee,M)),p.cropBoxResizable||(Le(_.getElementsByClassName("".concat(V,"-line")),A),Le(_.getElementsByClassName("".concat(V,"-point")),A)),this.render(),this.ready=!0,this.setDragMode(p.dragMode),p.autoCrop&&this.crop(),this.setData(p.data),Ge(p.ready)&&ft(m,_i,p.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=jv,g}},{key:"setDefaults",value:function(m){we(gs,sr(m)&&m)}}])}();return we(kd.prototype,Uv,zv,Hv,$v,qv,Vv),kd})});(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 Nd=new WeakMap;function eb(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 tb(i){let e=eb(i.target);e&&e.form&&Nd.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",tb,!0),Object.defineProperty(i,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return Nd.get(this.target)}})})();var Ts={eager:"eager",lazy:"lazy"},si=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 ib(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 ib(i){switch(i.toLowerCase()){case"lazy":return Ts.lazy;default:return Ts.eager}}var rb={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 nn(i){if(i.getAttribute("data-turbo-eval")=="false")return i;{let e=document.createElement("script"),t=qd();return t&&(e.nonce=t),e.textContent=i.textContent,e.async=!1,sb(e,i),e}}function sb(i,e){for(let{name:t,value:r}of e.attributes)i.setAttribute(t,r)}function nb(i){let e=document.createElement("template");return e.innerHTML=i,e.content}function _e(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 _d(i){i.preventDefault(),i.stopImmediatePropagation()}function sn(){return document.visibilityState==="hidden"?Ud():Bd()}function Bd(){return new Promise(i=>requestAnimationFrame(()=>i()))}function Ud(){return new Promise(i=>setTimeout(()=>i(),0))}function ob(){return Promise.resolve()}function zd(i=""){return new DOMParser().parseFromString(i,"text/html")}function Hd(i,...e){let t=ab(i,e).replace(/^\n/,"").split(`
|
3
|
+
`),r=t[0].match(/^\s+/),s=r?r[0].length:0;return t.map(n=>n.slice(s)).join(`
|
4
|
+
`)}function ab(i,e){return i.reduce((t,r,s)=>{let n=e[s]==null?"":e[s];return t+r+n},"")}function hr(){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 qo(i,...e){for(let t of e.map(r=>r?.getAttribute(i)))if(typeof t=="string")return t;return null}function lb(i,...e){return e.some(t=>t&&t.hasAttribute(i))}function Vo(...i){for(let e of i)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function jo(...i){for(let e of i)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function cb(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 $d(i){switch(i){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function ub(i){return i=="advance"||i=="replace"||i=="restore"}function Cr(...i){let e=qo("data-turbo-action",...i);return ub(e)?e:null}function bc(i){return document.querySelector(`meta[name="${i}"]`)}function Wo(i){let e=bc(i);return e&&e.content}function qd(){let i=bc("csp-nonce");if(i){let{nonce:e,content:t}=i;return e==""?t:e}}function hb(i,e){let t=bc(i);return t||(t=document.createElement("meta"),t.setAttribute("name",i),document.head.appendChild(t)),t.setAttribute("content",e),t}function ks(i,e){if(i instanceof Element)return i.closest(e)||ks(i.assignedSlot||i.getRootNode()?.host,e)}function yc(i){return!!i&&i.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof i.focus=="function"}function Vd(i){return Array.from(i.querySelectorAll("[autofocus]")).find(yc)}async function db(i,e){let t=e();i(),await Bd();let r=e();return[t,r]}function jd(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 Wd(i){return ks(i,"a[href]:not([target^=_]):not([download])")}function Gd(i){return tt(i.getAttribute("href")||"")}function pb(i,e){let t=null;return(...r)=>{let s=()=>i.apply(this,r);clearTimeout(t),t=setTimeout(s,e)}}var fb={"aria-disabled":{beforeSubmit:i=>{i.setAttribute("aria-disabled","true"),i.addEventListener("click",_d)},afterSubmit:i=>{i.removeAttribute("aria-disabled"),i.removeEventListener("click",_d)}},disabled:{beforeSubmit:i=>i.disabled=!0,afterSubmit:i=>i.disabled=!1}},Ul=class{#e=null;constructor(e){Object.assign(this,e)}get submitter(){return this.#e}set submitter(e){this.#e=fb[e]||e}},mb=new Ul({mode:"on",submitter:"disabled"}),et={drive:rb,forms:mb};function tt(i){return new URL(i.toString(),document.baseURI)}function Fr(i){let e;if(i.hash)return i.hash.slice(1);if(e=i.href.match(/#(.*)$/))return e[1]}function wc(i,e){let t=e?.getAttribute("formaction")||i.getAttribute("action")||i.action;return tt(t)}function gb(i){return(wb(i).match(/\.[^.]*$/)||[])[0]||""}function vb(i,e){let t=Sb(e);return i.href===tt(t).href||i.href.startsWith(t)}function ur(i,e){return vb(i,e)&&!et.drive.unvisitableExtensions.has(gb(i))}function zl(i){let e=Fr(i);return e!=null?i.href.slice(0,-(e.length+1)):i.href}function Ho(i){return zl(i)}function bb(i,e){return tt(i).href==tt(e).href}function yb(i){return i.pathname.split("/").slice(1)}function wb(i){return yb(i).slice(-1)[0]}function Sb(i){return Tb(i.origin+i.pathname)}function Tb(i){return i.endsWith("/")?i:i+"/"}var on=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 tt(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)}},Hl=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)}},Kd=new Hl(20),Eb=window.fetch;function Xd(i,e={}){let t=new Headers(e.headers||{}),r=hr();return Kd.add(r),t.append("X-Turbo-Request-Id",r),Eb(i,{...e,headers:t})}function Sc(i){switch(i.toLowerCase()){case"get":return Vt.get;case"post":return Vt.post;case"put":return Vt.put;case"patch":return Vt.patch;case"delete":return Vt.delete}}var Vt={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function kb(i){switch(i.toLowerCase()){case Pr.multipart:return Pr.multipart;case Pr.plain:return Pr.plain;default:return Pr.urlEncoded}}var Pr={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},_r=class{abortController=new AbortController;#e=e=>{};constructor(e,t,r,s=new URLSearchParams,n=null,o=Pr.urlEncoded){let[a,l]=Od(tt(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=Sc(e)||Vt.get;this.url.search="";let[s,n]=Od(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=Xd(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 on(e);return _e("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 Tc(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=_e("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!_e("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function Tc(i){return Sc(i)==Vt.get}function Od(i,e,t,r){let s=Array.from(t).length>0?new URLSearchParams(Yd(t)):i.searchParams;return Tc(e)?[xb(i,s),null]:r==Pr.urlEncoded?[i,s]:[i,t]}function Yd(i){let e=[];for(let[t,r]of i)r instanceof File||e.push([t,r]);return e}function xb(i,e){let t=new URLSearchParams(Yd(e));return i.search=t.toString(),i}var $l=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)}},dr=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(nb(e)):e}constructor(e){this.fragment=Ab(e)}};function Ab(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(nn(r));e.replaceWith(t)}return i}var Pb=100,ql=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},Pb)}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}},Cb=10*1e3,Es=new ql,Ss={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},Go=class i{state=Ss.initialized;static confirmMethod(e){return Promise.resolve(confirm(e))}constructor(e,t,r,s=!1){let n=Mb(t,r),o=Lb(Rb(t,r),n),a=Fb(t,r),l=Ib(t,r);this.delegate=e,this.formElement=t,this.submitter=r,this.fetchRequest=new _r(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=tt(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}=Ss,r=qo("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof r=="string"&&!await(typeof et.forms.confirm=="function"?et.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}=Ss;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=_b(Wo("csrf-param"))||Wo("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(dr.contentType)}requestStarted(e){this.state=Ss.waiting,this.submitter&&et.forms.submitter.beforeSubmit(this.submitter),this.setSubmitsWith(),Vo(this.formElement),_e("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){Es.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(Es.clear(),this.requestMustRedirect(e)&&Ob(t)){let r=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,r)}else this.state=Ss.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=Ss.stopped,this.submitter&&et.forms.submitter.afterSubmit(this.submitter),this.resetSubmitterText(),jo(this.formElement),_e("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||lb("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function Fb(i,e){let t=new FormData(i),r=e?.getAttribute("name"),s=e?.getAttribute("value");return r&&t.append(r,s||""),t}function _b(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 Ob(i){return i.statusCode==200&&!i.redirected}function Rb(i,e){let t=typeof i.action=="string"?i.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":i.getAttribute("action")||t||""}function Lb(i,e){let t=tt(i);return Tc(e)&&(t.search=""),t}function Mb(i,e){let t=e?.getAttribute("formmethod")||i.getAttribute("method")||"";return Sc(t.toLowerCase())||Vt.get}function Ib(i,e){return kb(e?.getAttribute("formenctype")||i.enctype)}var As=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 Vd(this.element)}get permanentElements(){return Qd(this.element)}getPermanentElementById(e){return Zd(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 Zd(i,e){return i.querySelector(`#${e}[data-turbo-permanent]`)}function Qd(i){return i.querySelectorAll("[id][data-turbo-permanent]")}var an=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&&Db(t,r)&&Nb(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}}};function Db(i,e){return(e?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"}function Nb(i,e){let t=e?.getAttribute("formtarget")||i.getAttribute("target");return jd(t)}var Ko=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(Fr(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()}},Vl=class extends Ko{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new As(this.element)}},Xo=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=Wd(t)||t;return r instanceof Element&&r.closest("turbo-frame, html")==this.element}},Yo=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=Wd(t);if(r&&jd(r.target)){let s=Gd(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)}},Zo=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new Yo(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=Cr(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())}},Qo=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=Bb(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 Bb(i){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",i.id),e}var ln=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 Qo.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"}},cn=class extends ln{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 sn(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await sn(),this.focusFirstAutofocusableElement(),await sn(),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=Ub(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=zb(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=nn(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function Ub(i,e){return i=="end"||i=="start"||i=="center"||i=="nearest"?i:e}function zb(i,e){return i=="auto"||i=="smooth"?i:e}var Hb=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,x,A={}){E instanceof Document&&(E=E.documentElement),typeof x=="string"&&(x=M(x));let H=$(x),j=k(E,H,A);return r(E,H,j)}function r(E,x,A){if(A.head.block){let H=E.querySelector("head"),j=x.querySelector("head");if(H&&j){let U=f(j,H,A);Promise.all(U).then(function(){r(E,x,Object.assign(A,{head:{block:!1,ignore:!0}}))});return}}if(A.morphStyle==="innerHTML")return o(x,E,A),E.children;if(A.morphStyle==="outerHTML"||A.morphStyle==null){let H=G(x,E,A),j=H?.previousSibling,U=H?.nextSibling,J=n(E,H,A);return H?z(j,J,U):[]}else throw"Do not understand how to morph style "+A.morphStyle}function s(E,x){return x.ignoreActiveValue&&E===document.activeElement&&E!==document.body}function n(E,x,A){if(!(A.ignoreActive&&E===document.activeElement))return x==null?A.callbacks.beforeNodeRemoved(E)===!1?E:(E.remove(),A.callbacks.afterNodeRemoved(E),null):F(E,x)?(A.callbacks.beforeNodeMorphed(E,x)===!1||(E instanceof HTMLHeadElement&&A.head.ignore||(E instanceof HTMLHeadElement&&A.head.style!=="morph"?f(x,E,A):(l(x,E,A),s(E,A)||o(x,E,A))),A.callbacks.afterNodeMorphed(E,x)),E):A.callbacks.beforeNodeRemoved(E)===!1||A.callbacks.beforeNodeAdded(x)===!1?E:(E.parentElement.replaceChild(x,E),A.callbacks.afterNodeAdded(x),A.callbacks.afterNodeRemoved(E),x)}function o(E,x,A){let H=E.firstChild,j=x.firstChild,U;for(;H;){if(U=H,H=U.nextSibling,j==null){if(A.callbacks.beforeNodeAdded(U)===!1)return;x.appendChild(U),A.callbacks.afterNodeAdded(U),re(A,U);continue}if(P(U,j,A)){n(j,U,A),j=j.nextSibling,re(A,U);continue}let J=D(E,x,U,j,A);if(J){j=R(j,J,A),n(J,U,A),re(A,U);continue}let ee=V(E,x,U,j,A);if(ee){j=R(j,ee,A),n(ee,U,A),re(A,U);continue}if(A.callbacks.beforeNodeAdded(U)===!1)return;x.insertBefore(U,j),A.callbacks.afterNodeAdded(U),re(A,U)}for(;j!==null;){let J=j;j=j.nextSibling,Q(J,A)}}function a(E,x,A,H){return E==="value"&&H.ignoreActiveValue&&x===document.activeElement?!0:H.callbacks.beforeAttributeUpdated(E,x,A)===!1}function l(E,x,A){let H=E.nodeType;if(H===1){let j=E.attributes,U=x.attributes;for(let J of j)a(J.name,x,"update",A)||x.getAttribute(J.name)!==J.value&&x.setAttribute(J.name,J.value);for(let J=U.length-1;0<=J;J--){let ee=U[J];a(ee.name,x,"remove",A)||E.hasAttribute(ee.name)||x.removeAttribute(ee.name)}}(H===8||H===3)&&x.nodeValue!==E.nodeValue&&(x.nodeValue=E.nodeValue),s(x,A)||d(E,x,A)}function c(E,x,A,H){if(E[A]!==x[A]){let j=a(A,x,"update",H);j||(x[A]=E[A]),E[A]?j||x.setAttribute(A,E[A]):a(A,x,"remove",H)||x.removeAttribute(A)}}function d(E,x,A){if(E instanceof HTMLInputElement&&x instanceof HTMLInputElement&&E.type!=="file"){let H=E.value,j=x.value;c(E,x,"checked",A),c(E,x,"disabled",A),E.hasAttribute("value")?H!==j&&(a("value",x,"update",A)||(x.setAttribute("value",H),x.value=H)):a("value",x,"remove",A)||(x.value="",x.removeAttribute("value"))}else if(E instanceof HTMLOptionElement)c(E,x,"selected",A);else if(E instanceof HTMLTextAreaElement&&x instanceof HTMLTextAreaElement){let H=E.value,j=x.value;if(a("value",x,"update",A))return;H!==j&&(x.value=H),x.firstChild&&x.firstChild.nodeValue!==H&&(x.firstChild.nodeValue=H)}}function f(E,x,A){let H=[],j=[],U=[],J=[],ee=A.head.style,Ae=new Map;for(let ce of E.children)Ae.set(ce.outerHTML,ce);for(let ce of x.children){let Re=Ae.has(ce.outerHTML),De=A.head.shouldReAppend(ce),He=A.head.shouldPreserve(ce);Re||He?De?j.push(ce):(Ae.delete(ce.outerHTML),U.push(ce)):ee==="append"?De&&(j.push(ce),J.push(ce)):A.head.shouldRemove(ce)!==!1&&j.push(ce)}J.push(...Ae.values());let oe=[];for(let ce of J){let Re=document.createRange().createContextualFragment(ce.outerHTML).firstChild;if(A.callbacks.beforeNodeAdded(Re)!==!1){if(Re.href||Re.src){let De=null,He=new Promise(function(gi){De=gi});Re.addEventListener("load",function(){De()}),oe.push(He)}x.appendChild(Re),A.callbacks.afterNodeAdded(Re),H.push(Re)}}for(let ce of j)A.callbacks.beforeNodeRemoved(ce)!==!1&&(x.removeChild(ce),A.callbacks.afterNodeRemoved(ce));return A.head.afterHeadMorphed(x,{added:H,kept:U,removed:j}),oe}function y(){}function v(E){let x={};return Object.assign(x,e),Object.assign(x,E),x.callbacks={},Object.assign(x.callbacks,e.callbacks),Object.assign(x.callbacks,E.callbacks),x.head={},Object.assign(x.head,e.head),Object.assign(x.head,E.head),x}function k(E,x,A){return A=v(A),{target:E,newContent:x,config:A,morphStyle:A.morphStyle,ignoreActive:A.ignoreActive,ignoreActiveValue:A.ignoreActiveValue,idMap:We(E,x),deadIds:new Set,callbacks:A.callbacks,head:A.head}}function P(E,x,A){return E==null||x==null?!1:E.nodeType===x.nodeType&&E.tagName===x.tagName?E.id!==""&&E.id===x.id?!0:le(A,E,x)>0:!1}function F(E,x){return E==null||x==null?!1:E.nodeType===x.nodeType&&E.tagName===x.tagName}function R(E,x,A){for(;E!==x;){let H=E;E=E.nextSibling,Q(H,A)}return re(A,x),x.nextSibling}function D(E,x,A,H,j){let U=le(j,A,x),J=null;if(U>0){let ee=H,Ae=0;for(;ee!=null;){if(P(A,ee,j))return ee;if(Ae+=le(j,ee,E),Ae>U)return null;ee=ee.nextSibling}}return J}function V(E,x,A,H,j){let U=H,J=A.nextSibling,ee=0;for(;U!=null;){if(le(j,U,E)>0)return null;if(F(A,U))return U;if(F(J,U)&&(ee++,J=J.nextSibling,ee>=2))return null;U=U.nextSibling}return U}function M(E){let x=new DOMParser,A=E.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(A.match(/<\/html>/)||A.match(/<\/head>/)||A.match(/<\/body>/)){let H=x.parseFromString(E,"text/html");if(A.match(/<\/html>/))return H.generatedByIdiomorph=!0,H;{let j=H.firstChild;return j?(j.generatedByIdiomorph=!0,j):null}}else{let j=x.parseFromString("<body><template>"+E+"</template></body>","text/html").body.querySelector("template").content;return j.generatedByIdiomorph=!0,j}}function $(E){if(E==null)return document.createElement("div");if(E.generatedByIdiomorph)return E;if(E instanceof Node){let x=document.createElement("div");return x.append(E),x}else{let x=document.createElement("div");for(let A of[...E])x.append(A);return x}}function z(E,x,A){let H=[],j=[];for(;E!=null;)H.push(E),E=E.previousSibling;for(;H.length>0;){let U=H.pop();j.push(U),x.parentElement.insertBefore(U,x)}for(j.push(x);A!=null;)H.push(A),j.push(A),A=A.nextSibling;for(;H.length>0;)x.parentElement.insertBefore(H.pop(),x.nextSibling);return j}function G(E,x,A){let H;H=E.firstChild;let j=H,U=0;for(;H;){let J=K(H,x,A);J>U&&(j=H,U=J),H=H.nextSibling}return j}function K(E,x,A){return F(E,x)?.5+le(A,E,x):0}function Q(E,x){re(x,E),x.callbacks.beforeNodeRemoved(E)!==!1&&(E.remove(),x.callbacks.afterNodeRemoved(E))}function ne(E,x){return!E.deadIds.has(x)}function Y(E,x,A){return(E.idMap.get(A)||i).has(x)}function re(E,x){let A=E.idMap.get(x)||i;for(let H of A)E.deadIds.add(H)}function le(E,x,A){let H=E.idMap.get(x)||i,j=0;for(let U of H)ne(E,U)&&Y(E,U,A)&&++j;return j}function xe(E,x){let A=E.parentElement,H=E.querySelectorAll("[id]");for(let j of H){let U=j;for(;U!==A&&U!=null;){let J=x.get(U);J==null&&(J=new Set,x.set(U,J)),J.add(j.id),U=U.parentElement}}}function We(E,x){let A=new Map;return xe(E,A),xe(x,A),A}return{morph:t,defaults:e}}();function Ec(i,e,{callbacks:t,...r}={}){Hb.morph(i,e,{...r,callbacks:new jl(t)})}function Jd(i,e){Ec(i,e.children,{morphStyle:"innerHTML"})}var jl=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)?!_e("turbo:before-morph-element",{cancelable:!0,target:e,detail:{currentElement:e,newElement:t}}).defaultPrevented:!1};beforeAttributeUpdated=(e,t,r)=>!_e("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&&_e("turbo:morph-element",{target:e,detail:{currentElement:e,newElement:t}})}},Wl=class extends cn{static renderElement(e,t){_e("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),Jd(e,t)}async preservingPermanentElements(e){return await e()}},Gl=class i{static animationDuration=300;static get defaultCSS(){return Hd`
|
5
|
+
.turbo-progress-bar {
|
6
|
+
position: fixed;
|
7
|
+
display: block;
|
8
|
+
top: 0;
|
9
|
+
left: 0;
|
10
|
+
height: 3px;
|
11
|
+
background: #0076ff;
|
12
|
+
z-index: 2147483647;
|
13
|
+
transition:
|
14
|
+
width ${i.animationDuration}ms ease-out,
|
15
|
+
opacity ${i.animationDuration/2}ms ${i.animationDuration/2}ms ease-in;
|
16
|
+
transform: translate3d(0, 0, 0);
|
17
|
+
}
|
18
|
+
`}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=qd();return t&&(e.nonce=t),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}},Kl=class extends As{detailsByOuterHTML=this.children.filter(e=>!jb(e)).map(e=>Kb(e)).reduce((e,t)=>{let{outerHTML:r}=t,s=r in e?e[r]:{type:$b(t),tracked:qb(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 Gb(s,e)?s:t},void 0|void 0)}};function $b(i){if(Vb(i))return"script";if(Wb(i))return"stylesheet"}function qb(i){return i.getAttribute("data-turbo-track")=="reload"}function Vb(i){return i.localName=="script"}function jb(i){return i.localName=="noscript"}function Wb(i){let e=i.localName;return e=="style"||e=="link"&&i.getAttribute("rel")=="stylesheet"}function Gb(i,e){return i.localName=="meta"&&i.getAttribute("name")==e}function Kb(i){return i.hasAttribute("nonce")&&i.setAttribute("nonce",""),i}var ri=class i extends As{static fromHTMLString(e=""){return this.fromDocument(zd(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:r}){return new this(e,t,new Kl(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 tt(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}`)}},Xl=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}},Xb={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},$o={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},Di={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},xs={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},Yb={advance:"forward",restore:"back",replace:"none"},Yl=class{identifier=hr();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=Di.initialized;viewTransitioner=new Xl;constructor(e,t,r,s={}){this.delegate=e,this.location=t,this.restorationIdentifier=r||hr();let{action:n,historyChanged:o,referrer:a,snapshot:l,snapshotHTML:c,response:d,visitCachedSnapshot:f,willRender:y,updateHistory:v,shouldCacheSnapshot:k,acceptsStreamResponse:P,direction:F}={...Xb,...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=k,this.acceptsStreamResponse=P,this.direction=F||Yb[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==Di.initialized&&(this.recordTimingMetric($o.visitStart),this.state=Di.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Di.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Di.canceled)}complete(){this.state==Di.started&&(this.recordTimingMetric($o.visitEnd),this.adapter.visitCompleted(this),this.state=Di.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Di.started&&(this.state=Di.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=$d(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new _r(this,Vt.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric($o.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;Rd(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric($o.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,Rd(e)&&t!=null){let r=ri.fromHTMLString(t);await this.renderPageSnapshot(r,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(ri.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!Fr(this.location)||e.hasAnchor(Fr(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return ri.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(dr.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:xs.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:xs.contentTypeMismatch,redirected:s}):this.recordResponse({statusCode:n,responseHTML:r,redirected:s})}requestErrored(e,t){this.recordResponse({statusCode:xs.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=Fr(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 Rd(i){return i>=200&&i<300}var Zl=class{progressBar=new Gl;constructor(e){this.session=e}visitProposedToLocation(e,t){ur(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||hr(),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 xs.networkFailure:case xs.timeoutFailure:case xs.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){_e("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}},Ql=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]}},Jl=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new Xo(this,t),this.formSubmitObserver=new an(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=wc(e,t),s=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),n=tt(s?.content??"/");return this.#t(e,t)&&ur(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 si)return s}}},ec=class{location;restorationIdentifier=hr();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=hr()){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 ob(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},tc=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(Wo("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=Gd(s);if(this.delegate.canPrefetchRequestToLocation(s,n)){this.#e=s;let o=new _r(this,Vt.get,n,new URLSearchParams,t);Es.setLater(n.toString(),o,this.#r)}}};#o=e=>{e.target===this.#e&&this.#s()};#s=()=>{Es.clear(),this.#e=null};#a=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="GET"){let t=Es.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),Es.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(Wo("turbo-prefetch-cache-time"))||Cb}#c(e){return!(!e.getAttribute("href")||Zb(e)||Qb(e)||Jb(e)||ey(e)||iy(e))}},Zb=i=>i.origin!==document.location.origin||!["http:","https:"].includes(i.protocol)||i.hasAttribute("target"),Qb=i=>i.pathname+i.search===document.location.pathname+document.location.search||i.href.startsWith("#"),Jb=i=>{if(i.getAttribute("data-turbo-prefetch")==="false"||i.getAttribute("data-turbo")==="false")return!0;let e=ks(i,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},ey=i=>{let e=i.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||ty(i)||i.hasAttribute("data-turbo-confirm")||i.hasAttribute("data-turbo-stream"))},ty=i=>i.hasAttribute("data-remote")||i.hasAttribute("data-behavior")||i.hasAttribute("data-confirm")||i.hasAttribute("data-method"),iy=i=>_e("turbo:before-prefetch",{target:i,cancelable:!0}).defaultPrevented,ic=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 Yl(this,tt(e),t,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new Go(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=ri.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=Fr(e),s=Fr(this.view.lastRenderedLocation),n=t==="restore"&&typeof r>"u";return t!=="replace"&&zl(e)===zl(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 Cr(r,s)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},Ar={initial:0,loading:1,interactive:2,complete:3},rc=class{stage=Ar.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==Ar.initial&&(this.stage=Ar.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==Ar.loading&&(this.stage=Ar.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==Ar.interactive&&(this.stage=Ar.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},sc=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)}},nc=class{render({fragment:e}){Qo.preservingPermanentElements(this,ry(e),()=>{sy(e,()=>{ny(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function ry(i){let e=Qd(document.documentElement),t={};for(let r of e){let{id:s}=r;for(let n of i.querySelectorAll("turbo-stream")){let o=Zd(n.templateElement.content,s);o&&(t[s]=[r,o])}}return t}async function sy(i,e){let t=`turbo-stream-autofocus-${hr()}`,r=i.querySelectorAll("turbo-stream"),s=oy(r),n=null;if(s&&(s.id?n=s.id:n=t,s.id=n),e(),await sn(),(document.activeElement==null||document.activeElement==document.body)&&n){let a=document.getElementById(n);yc(a)&&a.focus(),a&&a.id==t&&a.removeAttribute("id")}}async function ny(i){let[e,t]=await db(i,()=>document.activeElement),r=e&&e.id;if(r){let s=document.getElementById(r);yc(s)&&s!=t&&s.focus()}}function oy(i){for(let e of i){let t=Vd(e.templateElement.content);if(t)return t}return null}var oc=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=ay(e);t&&ly(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(dr.wrap(e))}};function ay(i){let e=i.detail?.fetchResponse;if(e instanceof on)return e}function ly(i){return(i.contentType??"").startsWith(dr.contentType)}var ac=class extends ln{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=nn(e);t.replaceChild(r,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},un=class extends ln{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(cb(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(nn(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=nn(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")}},lc=class extends un{static renderElement(e,t){Ec(e,t,{callbacks:{beforeNodeMorphed:r=>!Ld(r)}});for(let r of e.querySelectorAll("turbo-frame"))Ld(r)&&r.reload();_e("turbo:morph",{detail:{currentElement:e,newElement:t}})}async preservingPermanentElements(e){return await e()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}};function Ld(i){return i instanceof si&&i.src&&i.refresh==="morph"&&!i.closest("[data-turbo-permanent]")}var cc=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return Ho(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[Ho(e)]}write(e,t){this.snapshots[Ho(e)]=t}touch(e){let t=Ho(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]}},uc=class extends Ko{snapshotCache=new cc(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?lc:un,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 ac(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 Ud();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 ri.fromElement(this.element)}},hc=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 _r(this,Vt.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=ri.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)}},dc=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){hb("turbo-cache-control",e)}},pc=class{navigator=new ic(this);history=new ec(this);view=new uc(this,document.documentElement);adapter=new Zl(this);pageObserver=new rc(this);cacheObserver=new Ql;linkPrefetchObserver=new tc(this,document);linkClickObserver=new Yo(this,window);formSubmitObserver=new an(this,document);scrollObserver=new sc(this);streamObserver=new oc(this);formLinkClickObserver=new Zo(this,document.documentElement);frameRedirector=new Jl(this,document.documentElement);streamMessageRenderer=new nc;cache=new dc(this);enabled=!0;started=!1;#e=150;constructor(e){this.recentRequests=e,this.preloader=new hc(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 si){let s=t.action||Cr(r);r.delegate.proposeVisitIfNavigatedWithAction(r,s),r.src=e.toString()}else this.navigator.proposeVisit(tt(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(dr.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){et.drive.progressBarDelay=e}get progressBarDelay(){return et.drive.progressBarDelay}set drive(e){et.drive.enabled=e}get drive(){return et.drive.enabled}set formMode(e){et.forms.mode=e}get formMode(){return et.forms.mode}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=pb(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)||ks(e,"turbo-frame:not([disabled])");if(t||r||n instanceof si)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&ur(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)&&ur(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&ur(t,this.snapshot.rootLocation)}willFollowLinkToLocation(e,t,r){return this.elementIsNavigatable(e)&&ur(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){Md(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(Vo(document.documentElement),this.view.markVisitDirection(e.direction)),Md(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),jo(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=wc(e,t);return this.submissionIsNavigatable(e,t)&&ur(tt(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 _e("turbo:click",{target:e,detail:{url:t.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return _e("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return _e("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return _e("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return _e("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return _e("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return _e("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 _e("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return _e("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(et.forms.mode=="off")return!1;{let r=t?this.elementIsNavigatable(t):!0;return et.forms.mode=="optin"?r&&e.closest('[data-turbo="true"]')!=null:r&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=ks(e,"[data-turbo]"),r=ks(e,"turbo-frame");return et.drive.enabled||r?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return Cr(e)||"advance"}get snapshot(){return this.view.snapshot}};function Md(i){Object.defineProperties(i,cy)}var cy={absoluteURL:{get(){return this.toString()}}},Be=new pc(Kd),{cache:uy,navigator:hy}=Be;function ep(){Be.start()}function dy(i){Be.registerAdapter(i)}function py(i,e){Be.visit(i,e)}function tp(i){Be.connectStreamSource(i)}function ip(i){Be.disconnectStreamSource(i)}function fy(i){Be.renderStreamMessage(i)}function my(){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.`"),Be.clearCache()}function gy(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.`"),et.drive.progressBarDelay=i}function vy(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.`"),et.forms.confirm=i}function by(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.`"),et.forms.mode=i}var yy=Object.freeze({__proto__:null,navigator:hy,session:Be,cache:uy,PageRenderer:un,PageSnapshot:ri,FrameRenderer:cn,fetch:Xd,config:et,start:ep,registerAdapter:dy,visit:py,connectStreamSource:tp,disconnectStreamSource:ip,renderStreamMessage:fy,clearCache:my,setProgressBarDelay:gy,setConfirmMethod:vy,setFormMode:by}),fc=class extends Error{},mc=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 Vl(this,this.element),this.appearanceObserver=new $l(this,this.element),this.formLinkClickObserver=new Zo(this,this.element),this.linkInterceptor=new Xo(this,this.element),this.restorationIdentifier=hr(),this.formSubmitObserver=new an(this,this.element)}connect(){this.#i||(this.#i=!0,this.loadingStyle==Ts.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==Ts.eager&&this.#r()}sourceURLChanged(){this.#y("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==Ts.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==Ts.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#r())}async#r(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#n(tt(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=zd(t);ri.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,Cr(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 Go(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(dr.contentType)}requestStarted(e){Vo(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){jo(this.element)}formSubmissionStarted({formElement:e}){Vo(e,this.#h(e))}formSubmissionSucceededWithResponse(e,t){let r=this.#h(e.formElement,e.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,Cr(e.submitter,e.formElement,r)),r.delegate.loadResponse(t),e.isSafe||Be.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),Be.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){jo(e,this.#h(e))}allowsImmediateRender({element:e},t){let r=_e("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){Be.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?Wl:cn;if(r){let n=new As(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,Be.frameRendered(e,this.element),Be.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#p(e)&&this.#u(e)}async#n(e){let t=new _r(this,Vt.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,Cr(r,e,s)),this.#m(e,()=>{s.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let r=ri.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),Be.visit(e.src,d)}}}}changeHistory(){if(this.action){let e=$d(this.action);Be.history.update(e,tt(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):Be.visit(n,o)};return!_e("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 fc(t)}async#v(e){let t=new on(e),r=await t.responseHTML,{location:s,redirected:n,statusCode:o}=t;return Be.visit(s,{response:{redirected:n,statusCode:o,responseHTML:r}})}#h(e,t){let r=qo("data-turbo-frame",t,e)||this.element.getAttribute("target");return Id(r)??this.element}async extractForeignFrameElement(e){let t,r=CSS.escape(this.id);try{if(t=Dd(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=Dd(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 si}return null}#b(e,t){let r=wc(e,t);return ur(tt(r),this.rootLocation)}#f(e,t){let r=qo("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=Id(r);if(s)return!s.disabled}return!(!Be.elementIsNavigatable(e)||t&&!Be.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 tt(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 Id(i){if(i!=null){let e=document.getElementById(i);if(e instanceof si)return e}}function Dd(i,e){if(i){let t=i.getAttribute("src");if(t!=null&&e!=null&&bb(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 si)return i.connectedCallback(),i.disconnectedCallback(),i}}var rp={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"?Ec(e,this.templateContent):e.replaceWith(this.templateContent)})},update(){let i=this.getAttribute("method");this.targetElements.forEach(e=>{i==="morph"?Jd(e,this.templateContent):(e.innerHTML="",e.append(this.templateContent))})},refresh(){Be.refresh(this.baseURI,this.requestId)}},gc=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 sn(),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=rp[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):[]}},vc=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),tp(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),ip(this.streamSource))}get src(){return this.getAttribute("src")||""}};si.delegateConstructor=mc;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",si);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",gc);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",vc);(()=>{let i=document.currentScript;if(i&&!i.hasAttribute("data-turbo-suppress-warning"))for(i=i.parentElement;i;){if(i==document.body)return console.warn(Hd`
|
19
|
+
You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
|
20
|
+
|
21
|
+
Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
|
22
|
+
|
23
|
+
For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements
|
24
|
+
|
25
|
+
——
|
26
|
+
Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
|
27
|
+
`,i.outerHTML);i=i.parentElement}})();window.Turbo={...yy,StreamActions:rp};ep();var kc=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=wy(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 wy(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 xc=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 kc(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(":")}},Sy={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}},Ty=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function Ey(i){let t=i.trim().match(Ty)||[],r=t[2],s=t[3];return s&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${s}`,s=""),{eventTarget:ky(t[4]),eventName:r,eventOptions:t[7]?xy(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||s}}function ky(i){if(i=="window")return window;if(i=="document")return document}function xy(i){return i.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function Ay(i){if(i==window)return"window";if(i==document)return"document"}function Gc(i){return i.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function Ac(i){return Gc(i.replace(/--/g,"-").replace(/__/g,"_"))}function dn(i){return i.charAt(0).toUpperCase()+i.slice(1)}function pp(i){return i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function Py(i){return i.match(/[^\s]+/g)||[]}function sp(i){return i!=null}function Pc(i,e){return Object.prototype.hasOwnProperty.call(i,e)}var np=["meta","ctrl","alt","shift"],Cc=class{constructor(e,t,r,s){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||Cy(e)||Jo("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||Jo("missing identifier"),this.methodName=r.methodName||Jo("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=s}static forToken(e,t){return new this(e.element,e.index,Ey(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=>!np.includes(s))[0];return r?(Pc(this.keyMappings,r)||Jo(`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[Gc(o)]=Fy(s))}return e}get eventTargetName(){return Ay(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[r,s,n,o]=np.map(a=>t.includes(a));return e.metaKey!==r||e.ctrlKey!==s||e.altKey!==n||e.shiftKey!==o}},op={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:i=>i.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function Cy(i){let e=i.tagName.toLowerCase();if(e in op)return op[e](i)}function Jo(i){throw new Error(i)}function Fy(i){try{return JSON.parse(i)}catch{return i}}var Fc=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}},ea=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))}},ta=class{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new ea(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 _y(i,e,t){fp(i,e).add(t)}function Oy(i,e,t){fp(i,e).delete(t),Ry(i,e)}function fp(i,e){let t=i.get(e);return t||(t=new Set,i.set(e,t)),t}function Ry(i,e){let t=i.get(e);t!=null&&t.size==0&&i.delete(e)}var Ni=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){_y(this.valuesByKey,e,t)}delete(e,t){Oy(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 _c=class{constructor(e,t,r,s){this._selector=t,this.details=s,this.elementObserver=new ea(e,this),this.delegate=r,this.matchesByElement=new Ni}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)}},Oc=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())}},ia=class{constructor(e,t,r){this.attributeObserver=new ta(e,t,this),this.delegate=r,this.tokensByElement=new Ni}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=My(t,r).findIndex(([n,o])=>!Iy(n,o));return s==-1?[[],[]]:[t.slice(s),r.slice(s)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return Ly(r,e,t)}};function Ly(i,e,t){return i.trim().split(/\s+/).filter(r=>r.length).map((r,s)=>({element:e,attributeName:t,content:r,index:s}))}function My(i,e){let t=Math.max(i.length,e.length);return Array.from({length:t},(r,s)=>[i[s],e[s]])}function Iy(i,e){return i&&e&&i.index==e.index&&i.content==e.content}var ra=class{constructor(e,t,r){this.tokenListObserver=new ia(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}}}},Rc=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new ra(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 Fc(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=Cc.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},Lc=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new Oc(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${dn(t.name)}`;return this.receiver[r]}},Mc=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new Ni}start(){this.tokenListObserver||(this.tokenListObserver=new ia(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 pn(i,e){let t=mp(i);return Array.from(t.reduce((r,s)=>(Ny(s,e).forEach(n=>r.add(n)),r),new Set))}function Dy(i,e){return mp(i).reduce((r,s)=>(r.push(...By(s,e)),r),[])}function mp(i){let e=[];for(;i;)e.push(i),i=Object.getPrototypeOf(i);return e.reverse()}function Ny(i,e){let t=i[e];return Array.isArray(t)?t:[]}function By(i,e){let t=i[e];return t?Object.keys(t).map(r=>[r,t[r]]):[]}var Ic=class{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new Ni,this.outletElementsByName=new Ni,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 _c(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r),r.start()}setupAttributeObserverForOutlet(e){let t=this.attributeNameForOutletName(e),r=new ta(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 Ni;return this.router.modules.forEach(t=>{let r=t.definition.controllerConstructor;pn(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}},Dc=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 Rc(this,this.dispatcher),this.valueObserver=new Lc(this,this.controller),this.targetObserver=new Mc(this,this),this.outletObserver=new Ic(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(`${Ac(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${Ac(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let r=this.controller;typeof r[e]=="function"&&r[e](...t)}};function Uy(i){return zy(i,Hy(i))}function zy(i,e){let t=jy(i),r=$y(i.prototype,e);return Object.defineProperties(t.prototype,r),t}function Hy(i){return pn(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 $y(i,e){return Vy(e).reduce((t,r)=>{let s=qy(i,e,r);return s&&Object.assign(t,{[r]:s}),t},{})}function qy(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 Vy=typeof Object.getOwnPropertySymbols=="function"?i=>[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)]:Object.getOwnPropertyNames,jy=(()=>{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 Wy(i){return{identifier:i.identifier,controllerConstructor:Uy(i.controllerConstructor)}}var Nc=class{constructor(e,t){this.application=e,this.definition=Wy(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 Dc(this,e),this.contextsByScope.set(e,t)),t}},Bc=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 Py(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Uc=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}-${pp(e)}`}},zc=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 Hc(i,e){return`[${i}~="${e}"]`}var $c=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 Hc(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 Hc(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}},qc=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)}},Vc=class i{constructor(e,t,r,s){this.targets=new $c(this),this.classes=new Bc(this),this.data=new Uc(this),this.containsElement=n=>n.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new zc(s),this.outlets=new qc(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 Hc(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)}},jc=class{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new ra(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}},Wc=class{constructor(e){this.application=e,this.scopeObserver=new jc(this.element,this.schema,this),this.scopesByIdentifier=new Ni,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 Nc(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 Vc(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))}},Gy={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"},ap("abcdefghijklmnopqrstuvwxyz".split("").map(i=>[i,i]))),ap("0123456789".split("").map(i=>[i,i])))};function ap(i){return i.reduce((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r}),{})}var sa=class{constructor(e=document.documentElement,t=Gy){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 xc(this),this.router=new Wc(this),this.actionDescriptorFilters=Object.assign({},Sy)}static start(e,t){let r=new this(e,t);return r.start(),r}async start(){await Ky(),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
28
|
|
4
29
|
%o
|
5
30
|
|
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 Pb(){return new Promise(i=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}function Cb(i){return on(i,"classes").reduce((t,r)=>Object.assign(t,Fb(r)),{})}function Fb(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 _b(i){return on(i,"outlets").reduce((t,r)=>Object.assign(t,Ob(r)),{})}function Ld(i,e,t){return i.application.getControllerForElementAndIdentifier(e,t)}function Md(i,e,t){let r=Ld(i,e,t);if(r||(i.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),r=Ld(i,e,t),r))return r}function Ob(i){let e=zl(i);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t){let s=Md(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=Md(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 Rb(i){return on(i,"targets").reduce((t,r)=>Object.assign(t,Lb(r)),{})}function Lb(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 Mb(i){let e=mb(i,"values"),t={valueDescriptorMap:{get(){return e.reduce((r,s)=>{let n=Hd(s,this.identifier),o=this.data.getAttributeNameForKey(n.key);return Object.assign(r,{[o]:n})},{})}}};return e.reduce((r,s)=>Object.assign(r,Ib(s)),t)}function Ib(i,e){let t=Hd(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 Hd([i,e],t){return Ub({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 Db(i){let{controller:e,token:t,typeObject:r}=i,s=Fd(r.type),n=Fd(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 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 Nb(i){let{controller:e,token:t,typeDefinition:r}=i,n=Db({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 Bb(i){let e=Go(i);if(e)return Id[e];let t=Hl(i,"default"),r=Hl(i,"type"),s=i;if(t)return s.default;if(r){let{type:n}=s,o=Go(n);if(o)return Id[o]}return i}function Ub(i){let{token:e,typeDefinition:t}=i,r=`${Bd(e)}-value`,s=Nb(i);return{type:s,key:r,name:ac(r),get defaultValue(){return Bb(t)},get hasCustomDefaultValue(){return sn(t)!==void 0},reader:zb[s],writer:Dd[s]||Dd.default}}var Id={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},zb={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}},Dd={default:Hb,array:Nd,object:Nd};function Nd(i){return JSON.stringify(i)}function Hb(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=[Cb,Rb,Mb,_b];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 Yo=class extends ie{connect(){}preSubmit(){let i=document.createElement("input");i.type="hidden",i.name="pre_submit",i.value="true",this.element.appendChild(i),this.element.setAttribute("novalidate",""),this.submit()}submit(){this.element.requestSubmit()}};var Ie="top",Ye="bottom",qe="right",Be="left",Zo="auto",ur=[Ie,Ye,qe,Be],Ni="start",Ar="end",$d="clippingParents",Qo="viewport",Ss="popper",qd="reference",lc=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])},[]),$b="beforeRead",qb="read",Vb="afterRead",jb="beforeMain",Wb="main",Gb="afterMain",Kb="beforeWrite",Xb="write",Yb="afterWrite",Vd=[$b,qb,Vb,jb,Wb,Gb,Kb,Xb,Yb];function et(i){return i?(i.nodeName||"").toLowerCase():null}function Ce(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=Ce(i).Element;return i instanceof e||i instanceof Element}function Ze(i){var e=Ce(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function Es(i){if(typeof ShadowRoot>"u")return!1;var e=Ce(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function Zb(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 Qb(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 jd={name:"applyStyles",enabled:!0,phase:"write",fn:Zb,effect:Qb,requires:["computeStyles"]};function tt(i){return i.split("-")[0]}var ri=Math.max,Pr=Math.min,Bi=Math.round;function Ts(){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(Ts())}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)?Ce(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,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 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&&Es(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 Ce(i).getComputedStyle(i)}function cc(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||(Es(i)?i.host:null)||ot(i)}function Wd(i){return!Ze(i)||mt(i).position==="fixed"?null:i.offsetParent}function Jb(i){var e=/firefox/i.test(Ts()),t=/Trident/i.test(Ts());if(t&&Ze(i)){var r=mt(i);if(r.position==="fixed")return null}var s=Ui(i);for(Es(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=Ce(i),t=Wd(i);t&&cc(t)&&mt(t).position==="static";)t=Wd(t);return t&&(et(t)==="html"||et(t)==="body"&&mt(t).position==="static")?e:t||Jb(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 Gd(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 ey=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 ty(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 f=ey(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,V=P/2-F/2,M=f[v],$=D-y[d]-f[x],z=D/2-y[d]/2+V,G=_r(M,z,$),K=l;t.modifiersData[r]=(e={},e[K]=G,e.centerOffset=G-z,e)}}function iy(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 Kd={name:"arrow",enabled:!0,phase:"main",fn:ty,effect:iy,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Wt(i){return i.split("-")[1]}var ry={top:"auto",right:"auto",bottom:"auto",left:"auto"};function sy(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 Xd(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,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"),V=Be,M=Ie,$=window;if(c){var z=si(t),G="clientHeight",K="clientWidth";if(z===Ce(t)&&(z=ot(t),mt(z).position!=="static"&&a==="absolute"&&(G="scrollHeight",K="scrollWidth")),z=z,s===Ie||(s===Be||s===qe)&&n===Ar){M=Ye;var Q=f&&z===$&&$.visualViewport?$.visualViewport.height:z[G];P-=Q-r.height,P*=l?1:-1}if(s===Be||(s===Ie||s===Ye)&&n===Ar){V=qe;var ne=f&&z===$&&$.visualViewport?$.visualViewport.width:z[K];v-=ne-r.width,v*=l?1:-1}}var Y=Object.assign({position:a},c&&ry),re=d===!0?sy({x:v,y:P},Ce(t)):{x:v,y:P};if(v=re.x,P=re.y,l){var le;return Object.assign({},Y,(le={},le[M]=D?"0":"",le[V]=R?"0":"",le.transform=($.devicePixelRatio||1)<=1?"translate("+v+"px, "+P+"px)":"translate3d("+v+"px, "+P+"px, 0)",le))}return Object.assign({},Y,(e={},e[M]=D?P+"px":"",e[V]=R?v+"px":"",e.transform="",e))}function ny(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,Xd(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,Xd(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 Yd={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ny,data:{}};var ea={passive:!0};function oy(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=Ce(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 Zd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:oy,data:{}};var ay={left:"right",right:"left",bottom:"top",top:"bottom"};function xs(i){return i.replace(/left|right|bottom|top/g,function(e){return ay[e]})}var ly={start:"end",end:"start"};function ta(i){return i.replace(/start|end/g,function(e){return ly[e]})}function Or(i){var e=Ce(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Rr(i){return jt(ot(i)).left+Or(i).scrollLeft}function uc(i,e){var t=Ce(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 hc(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=Ce(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 cy(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 Qd(i,e,t){return e===Qo?ks(uc(i,t)):Vt(e)?cy(e,t):ks(hc(ot(i)))}function uy(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 dc(i,e,t,r){var s=e==="clippingParents"?uy(i):[].concat(e),n=[].concat(s,[t]),o=n[0],a=n.reduce(function(l,c){var d=Qd(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},Qd(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?$d:a,c=t.rootBoundary,d=c===void 0?Qo:c,f=t.elementContext,y=f===void 0?Ss:f,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?qd:Ss,V=i.rects.popper,M=i.elements[x?D:y],$=dc(Vt(M)?M:M.contextElement||ot(i.elements.popper),l,d,o),z=jt(i.elements.reference),G=dn({reference:z,element:V,strategy:"absolute",placement:s}),K=ks(Object.assign({},V,G)),Q=y===Ss?K:z,ne={top:$.top-Q.top+R.top,bottom:Q.bottom-$.bottom+R.bottom,left:$.left-Q.left+R.left,right:Q.right-$.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 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?Jo:l,d=Wt(r),f=d?a?lc:lc.filter(function(x){return Wt(x)===d}):ur,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]=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 hy(i){if(tt(i)===Zo)return[];var e=xs(i);return[ta(i),e,ta(e)]}function dy(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,F=e.options.placement,R=tt(F),D=R===F,V=l||(D||!x?[xs(F)]:hy(F)),M=[F].concat(V).reduce(function(Ae,oe){return Ae.concat(tt(oe)===Zo?pc(e,{placement:oe,boundary:d,rootBoundary:f,padding:c,flipVariations:x,allowedAutoPlacements:P}):oe)},[]),$=e.rects.reference,z=e.rects.popper,G=new Map,K=!0,Q=M[0],ne=0;ne<M.length;ne++){var Y=M[ne],re=tt(Y),le=Wt(Y)===Ni,ke=[Ie,Ye].indexOf(re)>=0,We=ke?"width":"height",T=ni(e,{placement:Y,boundary:d,rootBoundary:f,altBoundary:y,padding:c}),k=ke?le?qe:Be:le?Ye:Ie;$[We]>z[We]&&(k=xs(k));var A=xs(k),H=[];if(n&&H.push(T[re]<=0),a&&H.push(T[k]<=0,T[A]<=0),H.every(function(Ae){return Ae})){Q=Y,K=!1;break}G.set(Y,H)}if(K)for(var j=x?3:1,U=function(oe){var ce=M.find(function(Re){var De=G.get(Re);if(De)return De.slice(0,oe).every(function(He){return He})});if(ce)return Q=ce,"break"},J=j;J>0;J--){var ee=U(J);if(ee==="break")break}e.placement!==Q&&(e.modifiersData[r]._skip=!0,e.placement=Q,e.reset=!0)}}var Jd={name:"flip",enabled:!0,phase:"main",fn:dy,requiresIfExists:["offset"],data:{_skip:!1}};function ep(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 tp(i){return[Ie,qe,Ye,Be].some(function(e){return i[e]>=0})}function py(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=ep(o,r),c=ep(a,s,n),d=tp(l),f=tp(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 ip={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:py};function fy(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 my(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,f){return d[f]=fy(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 rp={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:my};function gy(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 sp={name:"popperOffsets",enabled:!0,phase:"read",fn:gy,data:{}};function fc(i){return i==="x"?"y":"x"}function vy(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,F=ni(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:d}),R=tt(e.placement),D=Wt(e.placement),V=!D,M=Fr(R),$=fc(M),z=e.modifiersData.popperOffsets,G=e.rects.reference,K=e.rects.popper,Q=typeof P=="function"?P(Object.assign({},e.rects,{placement:e.placement})):P,ne=typeof Q=="number"?{mainAxis:Q,altAxis:Q}:Object.assign({mainAxis:0,altAxis:0},Q),Y=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,re={x:0,y:0};if(z){if(n){var le,ke=M==="y"?Ie:Be,We=M==="y"?Ye:qe,T=M==="y"?"height":"width",k=z[M],A=k+F[ke],H=k-F[We],j=v?-K[T]/2:0,U=D===Ni?G[T]:K[T],J=D===Ni?-K[T]:-G[T],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],Re=oe[We],De=_r(0,G[T],Ae[T]),He=V?G[T]/2-j-De-ce-ne.mainAxis:U-De-ce-ne.mainAxis,gi=V?-G[T]/2+j+De+Re+ne.mainAxis:J+De+Re+ne.mainAxis,vi=e.elements.arrow&&si(e.elements.arrow),Zt=vi?M==="y"?vi.clientTop||0:vi.clientLeft||0:0,tr=(le=Y?.[M])!=null?le:0,Qt=k+He-tr-Zt,Sr=k+gi-tr,Ci=_r(v?Pr(A,Qt):A,k,v?ri(H,Sr):H);z[M]=Ci,re[M]=Ci-k}if(a){var zt,Fi=M==="x"?Ie:Be,_i=M==="x"?Ye:qe,_t=z[$],bi=$==="y"?"height":"width",ir=_t+F[Fi],Oi=_t-F[_i],Jt=[Ie,Be].indexOf(R)!==-1,ei=(zt=Y?.[$])!=null?zt:0,ti=Jt?ir:_t-G[bi]-K[bi]-ei+ne.altAxis,Er=Jt?_t+G[bi]+K[bi]-ei-ne.altAxis:Oi,rr=v&&Jt?Gd(ti,_t,Er):_r(v?ti:ir,_t,v?Er:Oi);z[$]=rr,re[$]=rr-_t}e.modifiersData[r]=re}}var np={name:"preventOverflow",enabled:!0,phase:"main",fn:vy,requiresIfExists:["offset"]};function mc(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function gc(i){return i===Ce(i)||!Ze(i)?Or(i):mc(i)}function by(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 vc(i,e,t){t===void 0&&(t=!1);var r=Ze(e),s=Ze(e)&&by(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=gc(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 yy(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=yy(i);return Vd.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 op={placement:"bottom",modifiers:[],strategy:"absolute"};function ap(){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 lp(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,s=e.defaultOptions,n=s===void 0?op:s;return function(a,l,c){c===void 0&&(c=n);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},op,n),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],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 V=bc(wc([].concat(r,d.options.modifiers)));return d.orderedModifiers=V.filter(function(M){return M.enabled}),x(),v.update()},forceUpdate:function(){if(!y){var R=d.elements,D=R.reference,V=R.popper;if(ap(D,V)){d.rects={reference:vc(D,si(V),d.options.strategy==="fixed"),popper:Cr(V)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(ne){return d.modifiersData[ne.name]=Object.assign({},ne.data)});for(var M=0;M<d.orderedModifiers.length;M++){if(d.reset===!0){d.reset=!1,M=-1;continue}var $=d.orderedModifiers[M],z=$.fn,G=$.options,K=G===void 0?{}:G,Q=$.name;typeof z=="function"&&(d=z({state:d,options:K,name:Q,instance:v})||d)}}}},update:yc(function(){return new Promise(function(F){v.forceUpdate(),F(d)})}),destroy:function(){P(),y=!0}};if(!ap(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,V=D===void 0?{}:D,M=F.effect;if(typeof M=="function"){var $=M({state:d,name:R,instance:v,options:V}),z=function(){};f.push($||z)}})}function P(){f.forEach(function(F){return F()}),f=[]}return v}}var wy=[Zd,sp,Yd,jd,rp,Jd,np,Kd,ip],Sc=lp({defaultModifiers:wy});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=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 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:bp,setPrototypeOf:cp,isFrozen:Sy,getPrototypeOf:Ey,getOwnPropertyDescriptor:Ty}=Object,{freeze:vt,seal:Gt,create:yp}=Object,{apply:Pc,construct:Cc}=typeof Reflect<"u"&&Reflect;vt||(vt=function(e){return e});Gt||(Gt=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 la=bt(Array.prototype.forEach),xy=bt(Array.prototype.lastIndexOf),up=bt(Array.prototype.pop),pn=bt(Array.prototype.push),ky=bt(Array.prototype.splice),ua=bt(String.prototype.toLowerCase),Ec=bt(String.prototype.toString),hp=bt(String.prototype.match),fn=bt(String.prototype.replace),Ay=bt(String.prototype.indexOf),Py=bt(String.prototype.trim),oi=bt(Object.prototype.hasOwnProperty),gt=bt(RegExp.prototype.test),mn=Cy(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 Pc(i,e,r)}}function Cy(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]:ua;cp&&cp(i,null);let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){let n=t(s);n!==s&&(Sy(e)||(e[r]=n),s=n)}i[s]=!0}return i}function Fy(i){for(let e=0;e<i.length;e++)oi(i,e)||(i[e]=null);return i}function Mr(i){let e=yp(null);for(let[t,r]of bp(i))oi(i,t)&&(Array.isArray(r)?e[t]=Fy(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=Ty(i,e);if(r){if(r.get)return bt(r.get);if(typeof r.value=="function")return bt(r.value)}i=Ey(i)}function t(){return null}return t}var dp=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"]),Tc=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"]),xc=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"]),_y=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"]),kc=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"]),Oy=vt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pp=vt(["#text"]),fp=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"]),Ac=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"]),mp=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"]),Ry=Gt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ly=Gt(/<%[\w\W]*|[\w\W]*%>/gm),My=Gt(/\$\{[\w\W]*/gm),Iy=Gt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Dy=Gt(/^aria-[\-\w]+$/),wp=Gt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ny=Gt(/^(?:\w+script|data):/i),By=Gt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Sp=Gt(/^html$/i),Uy=Gt(/^[a-z][.\w]*(-[.\w]+)+$/i),gp=Object.freeze({__proto__:null,ARIA_ATTR:Dy,ATTR_WHITESPACE:By,CUSTOM_ELEMENT:Uy,DATA_ATTR:Iy,DOCTYPE_NAME:Sp,ERB_EXPR:Ly,IS_ALLOWED_URI:wp,IS_SCRIPT_OR_DATA:Ny,MUSTACHE_EXPR:Ry,TMPLIT_EXPR:My}),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},zy=function(){return typeof window>"u"?null:window},Hy=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}},vp=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ep(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zy(),e=Z=>Ep(Z);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:f,DOMParser:y,trustedTypes:v}=i,x=l.prototype,P=gn(x,"cloneNode"),F=gn(x,"remove"),R=gn(x,"nextSibling"),D=gn(x,"childNodes"),V=gn(x,"parentNode");if(typeof o=="function"){let Z=t.createElement("template");Z.content&&Z.content.ownerDocument&&(t=Z.content.ownerDocument)}let M,$="",{implementation:z,createNodeIterator:G,createDocumentFragment:K,getElementsByTagName:Q}=t,{importNode:ne}=r,Y=vp();e.isSupported=typeof bp=="function"&&typeof V=="function"&&z&&z.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:re,ERB_EXPR:le,TMPLIT_EXPR:ke,DATA_ATTR:We,ARIA_ATTR:T,IS_SCRIPT_OR_DATA:k,ATTR_WHITESPACE:A,CUSTOM_ELEMENT:H}=gp,{IS_ALLOWED_URI:j}=gp,U=null,J=ae({},[...dp,...Tc,...xc,...kc,...pp]),ee=null,Ae=ae({},[...fp,...Ac,...mp,...ca]),oe=Object.seal(yp(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,Re=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,Er=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"],Ll="text/html",Te=null,nr=null,wi=t.createElement("form"),Do=function(w){return w instanceof RegExp||w instanceof Function},Le=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?Ll:w.PARSER_MEDIA_TYPE,Te=ye==="application/xhtml+xml"?Ec:ua,U=oi(w,"ALLOWED_TAGS")?ae({},w.ALLOWED_TAGS,Te):J,ee=oi(w,"ALLOWED_ATTR")?ae({},w.ALLOWED_ATTR,Te):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,Te):Mo,rr=oi(w,"ADD_DATA_URI_TAGS")?ae(Mr(Js),w.ADD_DATA_URI_TAGS,Te):Js,ti=oi(w,"FORBID_CONTENTS")?ae({},w.FORBID_CONTENTS,Te):Er,ce=oi(w,"FORBID_TAGS")?ae({},w.FORBID_TAGS,Te):{},Re=oi(w,"FORBID_ATTR")?ae({},w.FORBID_ATTR,Te):{},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,j=w.ALLOWED_URI_REGEXP||wp,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&&(U=ae({},pp),ee=[],ei.html===!0&&(ae(U,dp),ae(ee,fp)),ei.svg===!0&&(ae(U,Tc),ae(ee,Ac),ae(ee,ca)),ei.svgFilters===!0&&(ae(U,xc),ae(ee,Ac),ae(ee,ca)),ei.mathMl===!0&&(ae(U,kc),ae(ee,mp),ae(ee,ca))),w.ADD_TAGS&&(U===J&&(U=Mr(U)),ae(U,w.ADD_TAGS,Te)),w.ADD_ATTR&&(ee===Ae&&(ee=Mr(ee)),ae(ee,w.ADD_ATTR,Te)),w.ADD_URI_SAFE_ATTR&&ae(gs,w.ADD_URI_SAFE_ATTR,Te),w.FORBID_CONTENTS&&(ti===Er&&(ti=Mr(ti)),ae(ti,w.FORBID_CONTENTS,Te)),Oi&&(U["#text"]=!0),Qt&&ae(U,["html","head","body"]),U.table&&(ae(U,["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.');M=w.TRUSTED_TYPES_POLICY,$=M.createHTML("")}else M===void 0&&(M=Hy(v,s)),M!==null&&typeof $=="string"&&($=M.createHTML(""));vt&&vt(w),nr=w}},Ot=ae({},[...Tc,...xc,..._y]),Ri=ae({},[...kc,...Oy]),Ml=function(w){let I=V(w);(!I||!I.tagName)&&(I={namespaceURI:yi,tagName:"template"});let X=ua(w.tagName),be=ua(I.tagName);return en[w.namespaceURI]?w.namespaceURI===se?I.namespaceURI===Ht?X==="svg":I.namespaceURI===vs?X==="svg"&&(be==="annotation-xml"||Ge[be]):!!Ot[X]:w.namespaceURI===vs?I.namespaceURI===Ht?X==="math":I.namespaceURI===se?X==="math"&&bs[be]:!!Ri[X]:w.namespaceURI===Ht?I.namespaceURI===se&&!bs[be]||I.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{V(w).removeChild(w)}catch{F(w)}},or=function(w,I){try{pn(e.removed,{attribute:I.getAttributeNode(w),from:I})}catch{pn(e.removed,{attribute:null,from:I})}if(I.removeAttribute(w),w==="is")if(zt||Fi)try{At(I)}catch{}else try{I.setAttribute(w,"")}catch{}},ar=function(w){let I=null,X=null;if(Ci)w="<remove></remove>"+w;else{let Se=hp(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=M?M.createHTML(w):w;if(yi===Ht)try{I=new y().parseFromString(be,ye)}catch{}if(!I||!I.documentElement){I=z.createDocument(yi,"template",null);try{I.documentElement.innerHTML=ii?$:be}catch{}}let Qe=I.body||I.documentElement;return w&&X&&Qe.insertBefore(t.createTextNode(X),Qe.childNodes[0]||null),yi===Ht?Q.call(I,Qt?"html":"body")[0]:Qt?I.documentElement:Qe},No=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)},ys=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")},tn=function(w){return typeof a=="function"&&w instanceof a};function Ne(Z,w,I){la(Z,X=>{X.call(e,w,I,nr)})}let ft=function(w){let I=null;if(Ne(Y.beforeSanitizeElements,w,null),ys(w))return At(w),!0;let X=Te(w.nodeName);if(Ne(Y.uponSanitizeElement,w,{tagName:X,allowedTags:U}),w.hasChildNodes()&&!tn(w.firstElementChild)&>(/<[/\w]/g,w.innerHTML)&>(/<[/\w]/g,w.textContent)||w.nodeType===vn.progressingInstruction||tr&&w.nodeType===vn.comment&>(/<[/\w]/g,w.data))return At(w),!0;if(!U[X]||ce[X]){if(!ce[X]&&rn(X)&&(oe.tagNameCheck instanceof RegExp&>(oe.tagNameCheck,X)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(X)))return!1;if(Oi&&!ti[X]){let be=V(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&&!Ml(w)||(X==="noscript"||X==="noembed"||X==="noframes")&>(/<\/no(script|embed|frames)/i,w.innerHTML)?(At(w),!0):(Zt&&w.nodeType===vn.text&&(I=w.textContent,la([re,le,ke],be=>{I=fn(I,be," ")}),w.textContent!==I&&(pn(e.removed,{element:w.cloneNode()}),w.textContent=I)),Ne(Y.afterSanitizeElements,w,null),!1)},Li=function(w,I,X){if(_t&&(I==="id"||I==="name")&&(X in t||X in wi))return!1;if(!(He&&!Re[I]&>(We,I))){if(!(De&>(T,I))){if(!ee[I]||Re[I]){if(!(rn(w)&&(oe.tagNameCheck instanceof RegExp&>(oe.tagNameCheck,w)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(w))&&(oe.attributeNameCheck instanceof RegExp&>(oe.attributeNameCheck,I)||oe.attributeNameCheck instanceof Function&&oe.attributeNameCheck(I))||I==="is"&&oe.allowCustomizedBuiltInElements&&(oe.tagNameCheck instanceof RegExp&>(oe.tagNameCheck,X)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(X))))return!1}else if(!gs[I]){if(!gt(j,fn(X,A,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&w!=="script"&&Ay(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"&&hp(w,H)},ws=function(w){Ne(Y.beforeSanitizeAttributes,w,null);let{attributes:I}=w;if(!I||ys(w))return;let X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0},be=I.length;for(;be--;){let Qe=I[be],{name:Se,namespaceURI:ht,value:$t}=Qe,lr=Te(Se),nt=Se==="value"?$t:Py($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&>(/((--!?|])>)|<\/(style|title)/i,nt)){or(Se,w);continue}if(X.forceKeepAttr||(or(Se,w),!X.keepAttr))continue;if(!vi&>(/\/>/i,nt)){or(Se,w);continue}Zt&&la([re,le,ke],Uo=>{nt=fn(nt,Uo," ")});let Bo=Te(w.nodeName);if(Li(Bo,lr,nt)){if(M&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!ht)switch(v.getAttributeType(Bo,lr)){case"TrustedHTML":{nt=M.createHTML(nt);break}case"TrustedScriptURL":{nt=M.createScriptURL(nt);break}}try{ht?w.setAttributeNS(ht,Se,nt):w.setAttribute(Se,nt),ys(w)?At(w):up(e.removed)}catch{}}}Ne(Y.afterSanitizeAttributes,w,null)},Il=function Z(w){let I=null,X=No(w);for(Ne(Y.beforeSanitizeShadowDOM,w,null);I=X.nextNode();)Ne(Y.uponSanitizeShadowNode,I,null),ft(I),ws(I),I.content instanceof n&&Z(I.content);Ne(Y.afterSanitizeShadowDOM,w,null)};return e.sanitize=function(Z){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,X=null,be=null,Qe=null;if(ii=!Z,ii&&(Z="<!-->"),typeof Z!="string"&&!tn(Z))if(typeof Z.toString=="function"){if(Z=Z.toString(),typeof Z!="string")throw mn("dirty is not a string, aborting")}else throw mn("toString is not a function");if(!e.isSupported)return Z;if(Sr||Le(w),e.removed=[],typeof Z=="string"&&(Jt=!1),Jt){if(Z.nodeName){let $t=Te(Z.nodeName);if(!U[$t]||ce[$t])throw mn("root node is forbidden and cannot be sanitized in-place")}}else if(Z instanceof a)I=ar("<!---->"),X=I.ownerDocument.importNode(Z,!0),X.nodeType===vn.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?I=X:I.appendChild(X);else{if(!zt&&!Zt&&!Qt&&Z.indexOf("<")===-1)return M&&_i?M.createHTML(Z):Z;if(I=ar(Z),!I)return zt?null:_i?$:""}I&&Ci&&At(I.firstChild);let Se=No(Jt?Z:I);for(;be=Se.nextNode();)ft(be),ws(be),be.content instanceof n&&Il(be.content);if(Jt)return Z;if(zt){if(Fi)for(Qe=K.call(I.ownerDocument);I.firstChild;)Qe.appendChild(I.firstChild);else Qe=I;return(ee.shadowroot||ee.shadowrootmode)&&(Qe=ne.call(r,Qe,!0)),Qe}let ht=Qt?I.outerHTML:I.innerHTML;return Qt&&U["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&>(Sp,I.ownerDocument.doctype.name)&&(ht="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
|
7
|
-
`+ht),Zt&&
|
8
|
-
]`).replace("lheading",
|
31
|
+
%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 Ky(){return new Promise(i=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}function Xy(i){return pn(i,"classes").reduce((t,r)=>Object.assign(t,Yy(r)),{})}function Yy(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${dn(i)}Class`]:{get(){return this.classes.has(i)}}}}function Zy(i){return pn(i,"outlets").reduce((t,r)=>Object.assign(t,Qy(r)),{})}function lp(i,e,t){return i.application.getControllerForElementAndIdentifier(e,t)}function cp(i,e,t){let r=lp(i,e,t);if(r||(i.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),r=lp(i,e,t),r))return r}function Qy(i){let e=Ac(i);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t){let s=cp(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=cp(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${dn(e)}Outlet`]:{get(){return this.outlets.has(i)}}}}function Jy(i){return pn(i,"targets").reduce((t,r)=>Object.assign(t,e0(r)),{})}function e0(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${dn(i)}Target`]:{get(){return this.targets.has(i)}}}}function t0(i){let e=Dy(i,"values"),t={valueDescriptorMap:{get(){return e.reduce((r,s)=>{let n=gp(s,this.identifier),o=this.data.getAttributeNameForKey(n.key);return Object.assign(r,{[o]:n})},{})}}};return e.reduce((r,s)=>Object.assign(r,i0(s)),t)}function i0(i,e){let t=gp(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${dn(s)}`]:{get(){return this.data.has(r)||t.hasCustomDefaultValue}}}}function gp([i,e],t){return o0({controller:t,token:i,typeDefinition:e})}function na(i){switch(i){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function hn(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 r0(i){let{controller:e,token:t,typeObject:r}=i,s=sp(r.type),n=sp(r.default),o=s&&n,a=s&&!n,l=!s&&n,c=na(r.type),d=hn(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 s0(i){let{controller:e,token:t,typeDefinition:r}=i,n=r0({controller:e,token:t,typeObject:r}),o=hn(r),a=na(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 n0(i){let e=na(i);if(e)return up[e];let t=Pc(i,"default"),r=Pc(i,"type"),s=i;if(t)return s.default;if(r){let{type:n}=s,o=na(n);if(o)return up[o]}return i}function o0(i){let{token:e,typeDefinition:t}=i,r=`${pp(e)}-value`,s=s0(i);return{type:s,key:r,name:Gc(r),get defaultValue(){return n0(t)},get hasCustomDefaultValue(){return hn(t)!==void 0},reader:a0[s],writer:hp[s]||hp.default}}var up={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},a0={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 "${hn(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 "${hn(e)}"`);return e},string(i){return i}},hp={default:l0,array:dp,object:dp};function dp(i){return JSON.stringify(i)}function l0(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=[Xy,Jy,t0,Zy];ie.targets=[];ie.outlets=[];ie.values={};var oa=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 aa=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 la=class extends ie{connect(){}preSubmit(){let i=document.createElement("input");i.type="hidden",i.name="pre_submit",i.value="true",this.element.appendChild(i),this.element.setAttribute("novalidate",""),this.submit()}submit(){this.element.requestSubmit()}};var Ie="top",Ye="bottom",qe="right",Ue="left",ca="auto",pr=[Ie,Ye,qe,Ue],Bi="start",Or="end",vp="clippingParents",ua="viewport",Ps="popper",bp="reference",Kc=pr.reduce(function(i,e){return i.concat([e+"-"+Bi,e+"-"+Or])},[]),ha=[].concat(pr,[ca]).reduce(function(i,e){return i.concat([e,e+"-"+Bi,e+"-"+Or])},[]),c0="beforeRead",u0="read",h0="afterRead",d0="beforeMain",p0="main",f0="afterMain",m0="beforeWrite",g0="write",v0="afterWrite",yp=[c0,u0,h0,d0,p0,f0,m0,g0,v0];function it(i){return i?(i.nodeName||"").toLowerCase():null}function Ce(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function jt(i){var e=Ce(i).Element;return i instanceof e||i instanceof Element}function Ze(i){var e=Ce(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function Cs(i){if(typeof ShadowRoot>"u")return!1;var e=Ce(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function b0(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)||!it(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 y0(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)||!it(s)||(Object.assign(s.style,a),Object.keys(n).forEach(function(l){s.removeAttribute(l)}))})}}var wp={name:"applyStyles",enabled:!0,phase:"write",fn:b0,effect:y0,requires:["computeStyles"]};function rt(i){return i.split("-")[0]}var ni=Math.max,Rr=Math.min,Ui=Math.round;function Fs(){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 fn(){return!/^((?!chrome|android).)*safari/i.test(Fs())}function Wt(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&&Ui(r.width)/i.offsetWidth||1,n=i.offsetHeight>0&&Ui(r.height)/i.offsetHeight||1);var o=jt(i)?Ce(i):window,a=o.visualViewport,l=!fn()&&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 Lr(i){var e=Wt(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 mn(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&Cs(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 Ce(i).getComputedStyle(i)}function Xc(i){return["table","td","th"].indexOf(it(i))>=0}function ot(i){return((jt(i)?i.ownerDocument:i.document)||window.document).documentElement}function zi(i){return it(i)==="html"?i:i.assignedSlot||i.parentNode||(Cs(i)?i.host:null)||ot(i)}function Sp(i){return!Ze(i)||mt(i).position==="fixed"?null:i.offsetParent}function w0(i){var e=/firefox/i.test(Fs()),t=/Trident/i.test(Fs());if(t&&Ze(i)){var r=mt(i);if(r.position==="fixed")return null}var s=zi(i);for(Cs(s)&&(s=s.host);Ze(s)&&["html","body"].indexOf(it(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 oi(i){for(var e=Ce(i),t=Sp(i);t&&Xc(t)&&mt(t).position==="static";)t=Sp(t);return t&&(it(t)==="html"||it(t)==="body"&&mt(t).position==="static")?e:t||w0(i)||e}function Mr(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function Ir(i,e,t){return ni(i,Rr(e,t))}function Tp(i,e,t){var r=Ir(i,e,t);return r>t?t:r}function gn(){return{top:0,right:0,bottom:0,left:0}}function vn(i){return Object.assign({},gn(),i)}function bn(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var S0=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,vn(typeof e!="number"?e:bn(e,pr))};function T0(i){var e,t=i.state,r=i.name,s=i.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=rt(t.placement),l=Mr(a),c=[Ue,qe].indexOf(a)>=0,d=c?"height":"width";if(!(!n||!o)){var f=S0(s.padding,t),y=Lr(n),v=l==="y"?Ie:Ue,k=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=oi(n),D=R?l==="y"?R.clientHeight||0:R.clientWidth||0:0,V=P/2-F/2,M=f[v],$=D-y[d]-f[k],z=D/2-y[d]/2+V,G=Ir(M,z,$),K=l;t.modifiersData[r]=(e={},e[K]=G,e.centerOffset=G-z,e)}}function E0(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)||mn(e.elements.popper,s)&&(e.elements.arrow=s))}var Ep={name:"arrow",enabled:!0,phase:"main",fn:T0,effect:E0,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Gt(i){return i.split("-")[1]}var k0={top:"auto",right:"auto",bottom:"auto",left:"auto"};function x0(i,e){var t=i.x,r=i.y,s=e.devicePixelRatio||1;return{x:Ui(t*s)/s||0,y:Ui(r*s)/s||0}}function kp(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,k=o.y,P=k===void 0?0:k,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"),V=Ue,M=Ie,$=window;if(c){var z=oi(t),G="clientHeight",K="clientWidth";if(z===Ce(t)&&(z=ot(t),mt(z).position!=="static"&&a==="absolute"&&(G="scrollHeight",K="scrollWidth")),z=z,s===Ie||(s===Ue||s===qe)&&n===Or){M=Ye;var Q=f&&z===$&&$.visualViewport?$.visualViewport.height:z[G];P-=Q-r.height,P*=l?1:-1}if(s===Ue||(s===Ie||s===Ye)&&n===Or){V=qe;var ne=f&&z===$&&$.visualViewport?$.visualViewport.width:z[K];v-=ne-r.width,v*=l?1:-1}}var Y=Object.assign({position:a},c&&k0),re=d===!0?x0({x:v,y:P},Ce(t)):{x:v,y:P};if(v=re.x,P=re.y,l){var le;return Object.assign({},Y,(le={},le[M]=D?"0":"",le[V]=R?"0":"",le.transform=($.devicePixelRatio||1)<=1?"translate("+v+"px, "+P+"px)":"translate3d("+v+"px, "+P+"px, 0)",le))}return Object.assign({},Y,(e={},e[M]=D?P+"px":"",e[V]=R?v+"px":"",e.transform="",e))}function A0(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:rt(e.placement),variation:Gt(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,kp(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,kp(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 xp={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:A0,data:{}};var da={passive:!0};function P0(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=Ce(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&c.forEach(function(d){d.addEventListener("scroll",t.update,da)}),a&&l.addEventListener("resize",t.update,da),function(){n&&c.forEach(function(d){d.removeEventListener("scroll",t.update,da)}),a&&l.removeEventListener("resize",t.update,da)}}var Ap={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:P0,data:{}};var C0={left:"right",right:"left",bottom:"top",top:"bottom"};function _s(i){return i.replace(/left|right|bottom|top/g,function(e){return C0[e]})}var F0={start:"end",end:"start"};function pa(i){return i.replace(/start|end/g,function(e){return F0[e]})}function Dr(i){var e=Ce(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Nr(i){return Wt(ot(i)).left+Dr(i).scrollLeft}function Yc(i,e){var t=Ce(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=fn();(c||!c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:n,height:o,x:a+Nr(i),y:l}}function Zc(i){var e,t=ot(i),r=Dr(i),s=(e=i.ownerDocument)==null?void 0:e.body,n=ni(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=ni(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-r.scrollLeft+Nr(i),l=-r.scrollTop;return mt(s||t).direction==="rtl"&&(a+=ni(t.clientWidth,s?s.clientWidth:0)-n),{width:n,height:o,x:a,y:l}}function Br(i){var e=mt(i),t=e.overflow,r=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+r)}function fa(i){return["html","body","#document"].indexOf(it(i))>=0?i.ownerDocument.body:Ze(i)&&Br(i)?i:fa(zi(i))}function fr(i,e){var t;e===void 0&&(e=[]);var r=fa(i),s=r===((t=i.ownerDocument)==null?void 0:t.body),n=Ce(r),o=s?[n].concat(n.visualViewport||[],Br(r)?r:[]):r,a=e.concat(o);return s?a:a.concat(fr(zi(o)))}function Os(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function _0(i,e){var t=Wt(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 Pp(i,e,t){return e===ua?Os(Yc(i,t)):jt(e)?_0(e,t):Os(Zc(ot(i)))}function O0(i){var e=fr(zi(i)),t=["absolute","fixed"].indexOf(mt(i).position)>=0,r=t&&Ze(i)?oi(i):i;return jt(r)?e.filter(function(s){return jt(s)&&mn(s,r)&&it(s)!=="body"}):[]}function Qc(i,e,t,r){var s=e==="clippingParents"?O0(i):[].concat(e),n=[].concat(s,[t]),o=n[0],a=n.reduce(function(l,c){var d=Pp(i,c,r);return l.top=ni(d.top,l.top),l.right=Rr(d.right,l.right),l.bottom=Rr(d.bottom,l.bottom),l.left=ni(d.left,l.left),l},Pp(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 yn(i){var e=i.reference,t=i.element,r=i.placement,s=r?rt(r):null,n=r?Gt(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 Ue:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=s?Mr(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(n){case Bi:l[c]=l[c]-(e[d]/2-t[d]/2);break;case Or:l[c]=l[c]+(e[d]/2-t[d]/2);break;default:}}return l}function ai(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?vp:a,c=t.rootBoundary,d=c===void 0?ua:c,f=t.elementContext,y=f===void 0?Ps:f,v=t.altBoundary,k=v===void 0?!1:v,P=t.padding,F=P===void 0?0:P,R=vn(typeof F!="number"?F:bn(F,pr)),D=y===Ps?bp:Ps,V=i.rects.popper,M=i.elements[k?D:y],$=Qc(jt(M)?M:M.contextElement||ot(i.elements.popper),l,d,o),z=Wt(i.elements.reference),G=yn({reference:z,element:V,strategy:"absolute",placement:s}),K=Os(Object.assign({},V,G)),Q=y===Ps?K:z,ne={top:$.top-Q.top+R.top,bottom:Q.bottom-$.bottom+R.bottom,left:$.left-Q.left+R.left,right:Q.right-$.right+R.right},Y=i.modifiersData.offset;if(y===Ps&&Y){var re=Y[s];Object.keys(ne).forEach(function(le){var xe=[qe,Ye].indexOf(le)>=0?1:-1,We=[Ie,Ye].indexOf(le)>=0?"y":"x";ne[le]+=re[We]*xe})}return ne}function Jc(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?ha:l,d=Gt(r),f=d?a?Kc:Kc.filter(function(k){return Gt(k)===d}):pr,y=f.filter(function(k){return c.indexOf(k)>=0});y.length===0&&(y=f);var v=y.reduce(function(k,P){return k[P]=ai(i,{placement:P,boundary:s,rootBoundary:n,padding:o})[rt(P)],k},{});return Object.keys(v).sort(function(k,P){return v[k]-v[P]})}function R0(i){if(rt(i)===ca)return[];var e=_s(i);return[pa(i),e,pa(e)]}function L0(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,k=v===void 0?!0:v,P=t.allowedAutoPlacements,F=e.options.placement,R=rt(F),D=R===F,V=l||(D||!k?[_s(F)]:R0(F)),M=[F].concat(V).reduce(function(Ae,oe){return Ae.concat(rt(oe)===ca?Jc(e,{placement:oe,boundary:d,rootBoundary:f,padding:c,flipVariations:k,allowedAutoPlacements:P}):oe)},[]),$=e.rects.reference,z=e.rects.popper,G=new Map,K=!0,Q=M[0],ne=0;ne<M.length;ne++){var Y=M[ne],re=rt(Y),le=Gt(Y)===Bi,xe=[Ie,Ye].indexOf(re)>=0,We=xe?"width":"height",E=ai(e,{placement:Y,boundary:d,rootBoundary:f,altBoundary:y,padding:c}),x=xe?le?qe:Ue:le?Ye:Ie;$[We]>z[We]&&(x=_s(x));var A=_s(x),H=[];if(n&&H.push(E[re]<=0),a&&H.push(E[x]<=0,E[A]<=0),H.every(function(Ae){return Ae})){Q=Y,K=!1;break}G.set(Y,H)}if(K)for(var j=k?3:1,U=function(oe){var ce=M.find(function(Re){var De=G.get(Re);if(De)return De.slice(0,oe).every(function(He){return He})});if(ce)return Q=ce,"break"},J=j;J>0;J--){var ee=U(J);if(ee==="break")break}e.placement!==Q&&(e.modifiersData[r]._skip=!0,e.placement=Q,e.reset=!0)}}var Cp={name:"flip",enabled:!0,phase:"main",fn:L0,requiresIfExists:["offset"],data:{_skip:!1}};function Fp(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 _p(i){return[Ie,qe,Ye,Ue].some(function(e){return i[e]>=0})}function M0(i){var e=i.state,t=i.name,r=e.rects.reference,s=e.rects.popper,n=e.modifiersData.preventOverflow,o=ai(e,{elementContext:"reference"}),a=ai(e,{altBoundary:!0}),l=Fp(o,r),c=Fp(a,s,n),d=_p(l),f=_p(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 Op={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:M0};function I0(i,e,t){var r=rt(i),s=[Ue,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,[Ue,qe].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function D0(i){var e=i.state,t=i.options,r=i.name,s=t.offset,n=s===void 0?[0,0]:s,o=ha.reduce(function(d,f){return d[f]=I0(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 Rp={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:D0};function N0(i){var e=i.state,t=i.name;e.modifiersData[t]=yn({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Lp={name:"popperOffsets",enabled:!0,phase:"read",fn:N0,data:{}};function eu(i){return i==="x"?"y":"x"}function B0(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,k=t.tetherOffset,P=k===void 0?0:k,F=ai(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:d}),R=rt(e.placement),D=Gt(e.placement),V=!D,M=Mr(R),$=eu(M),z=e.modifiersData.popperOffsets,G=e.rects.reference,K=e.rects.popper,Q=typeof P=="function"?P(Object.assign({},e.rects,{placement:e.placement})):P,ne=typeof Q=="number"?{mainAxis:Q,altAxis:Q}:Object.assign({mainAxis:0,altAxis:0},Q),Y=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,re={x:0,y:0};if(z){if(n){var le,xe=M==="y"?Ie:Ue,We=M==="y"?Ye:qe,E=M==="y"?"height":"width",x=z[M],A=x+F[xe],H=x-F[We],j=v?-K[E]/2:0,U=D===Bi?G[E]:K[E],J=D===Bi?-K[E]:-G[E],ee=e.elements.arrow,Ae=v&&ee?Lr(ee):{width:0,height:0},oe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:gn(),ce=oe[xe],Re=oe[We],De=Ir(0,G[E],Ae[E]),He=V?G[E]/2-j-De-ce-ne.mainAxis:U-De-ce-ne.mainAxis,gi=V?-G[E]/2+j+De+Re+ne.mainAxis:J+De+Re+ne.mainAxis,vi=e.elements.arrow&&oi(e.elements.arrow),Zt=vi?M==="y"?vi.clientTop||0:vi.clientLeft||0:0,tr=(le=Y?.[M])!=null?le:0,Qt=x+He-tr-Zt,Sr=x+gi-tr,Ci=Ir(v?Rr(A,Qt):A,x,v?ni(H,Sr):H);z[M]=Ci,re[M]=Ci-x}if(a){var zt,Fi=M==="x"?Ie:Ue,_i=M==="x"?Ye:qe,_t=z[$],bi=$==="y"?"height":"width",ir=_t+F[Fi],Oi=_t-F[_i],Jt=[Ie,Ue].indexOf(R)!==-1,ei=(zt=Y?.[$])!=null?zt:0,ti=Jt?ir:_t-G[bi]-K[bi]-ei+ne.altAxis,Tr=Jt?_t+G[bi]+K[bi]-ei-ne.altAxis:Oi,rr=v&&Jt?Tp(ti,_t,Tr):Ir(v?ti:ir,_t,v?Tr:Oi);z[$]=rr,re[$]=rr-_t}e.modifiersData[r]=re}}var Mp={name:"preventOverflow",enabled:!0,phase:"main",fn:B0,requiresIfExists:["offset"]};function tu(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function iu(i){return i===Ce(i)||!Ze(i)?Dr(i):tu(i)}function U0(i){var e=i.getBoundingClientRect(),t=Ui(e.width)/i.offsetWidth||1,r=Ui(e.height)/i.offsetHeight||1;return t!==1||r!==1}function ru(i,e,t){t===void 0&&(t=!1);var r=Ze(e),s=Ze(e)&&U0(e),n=ot(e),o=Wt(i,s,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((it(e)!=="body"||Br(n))&&(a=iu(e)),Ze(e)?(l=Wt(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):n&&(l.x=Nr(n))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function z0(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 su(i){var e=z0(i);return yp.reduce(function(t,r){return t.concat(e.filter(function(s){return s.phase===r}))},[])}function nu(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function ou(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 Ip={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 Np(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,s=e.defaultOptions,n=s===void 0?Ip:s;return function(a,l,c){c===void 0&&(c=n);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ip,n),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],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:jt(a)?fr(a):a.contextElement?fr(a.contextElement):[],popper:fr(l)};var V=su(ou([].concat(r,d.options.modifiers)));return d.orderedModifiers=V.filter(function(M){return M.enabled}),k(),v.update()},forceUpdate:function(){if(!y){var R=d.elements,D=R.reference,V=R.popper;if(Dp(D,V)){d.rects={reference:ru(D,oi(V),d.options.strategy==="fixed"),popper:Lr(V)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(ne){return d.modifiersData[ne.name]=Object.assign({},ne.data)});for(var M=0;M<d.orderedModifiers.length;M++){if(d.reset===!0){d.reset=!1,M=-1;continue}var $=d.orderedModifiers[M],z=$.fn,G=$.options,K=G===void 0?{}:G,Q=$.name;typeof z=="function"&&(d=z({state:d,options:K,name:Q,instance:v})||d)}}}},update:nu(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 k(){d.orderedModifiers.forEach(function(F){var R=F.name,D=F.options,V=D===void 0?{}:D,M=F.effect;if(typeof M=="function"){var $=M({state:d,name:R,instance:v,options:V}),z=function(){};f.push($||z)}})}function P(){f.forEach(function(F){return F()}),f=[]}return v}}var H0=[Ap,Lp,xp,wp,Rp,Cp,Mp,Ep,Op],au=Np({defaultModifiers:H0});var ma=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=au(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 ga=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 va=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 ba=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 ya=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:Gp,setPrototypeOf:Bp,isFrozen:$0,getPrototypeOf:q0,getOwnPropertyDescriptor:V0}=Object,{freeze:vt,seal:Kt,create:Kp}=Object,{apply:pu,construct:fu}=typeof Reflect<"u"&&Reflect;vt||(vt=function(e){return e});Kt||(Kt=function(e){return e});pu||(pu=function(e,t,r){return e.apply(t,r)});fu||(fu=function(e,t){return new e(...t)});var wa=bt(Array.prototype.forEach),j0=bt(Array.prototype.lastIndexOf),Up=bt(Array.prototype.pop),wn=bt(Array.prototype.push),W0=bt(Array.prototype.splice),Ta=bt(String.prototype.toLowerCase),lu=bt(String.prototype.toString),zp=bt(String.prototype.match),Sn=bt(String.prototype.replace),G0=bt(String.prototype.indexOf),K0=bt(String.prototype.trim),li=bt(Object.prototype.hasOwnProperty),gt=bt(RegExp.prototype.test),Tn=X0(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 pu(i,e,r)}}function X0(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return fu(i,t)}}function ae(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ta;Bp&&Bp(i,null);let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){let n=t(s);n!==s&&($0(e)||(e[r]=n),s=n)}i[s]=!0}return i}function Y0(i){for(let e=0;e<i.length;e++)li(i,e)||(i[e]=null);return i}function Ur(i){let e=Kp(null);for(let[t,r]of Gp(i))li(i,t)&&(Array.isArray(r)?e[t]=Y0(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Ur(r):e[t]=r);return e}function En(i,e){for(;i!==null;){let r=V0(i,e);if(r){if(r.get)return bt(r.get);if(typeof r.value=="function")return bt(r.value)}i=q0(i)}function t(){return null}return t}var Hp=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"]),cu=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"]),uu=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"]),Z0=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"]),hu=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"]),Q0=vt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$p=vt(["#text"]),qp=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"]),du=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"]),Vp=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"]),Sa=vt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),J0=Kt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ew=Kt(/<%[\w\W]*|[\w\W]*%>/gm),tw=Kt(/\$\{[\w\W]*/gm),iw=Kt(/^data-[\-\w.\u00B7-\uFFFF]+$/),rw=Kt(/^aria-[\-\w]+$/),Xp=Kt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sw=Kt(/^(?:\w+script|data):/i),nw=Kt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yp=Kt(/^html$/i),ow=Kt(/^[a-z][.\w]*(-[.\w]+)+$/i),jp=Object.freeze({__proto__:null,ARIA_ATTR:rw,ATTR_WHITESPACE:nw,CUSTOM_ELEMENT:ow,DATA_ATTR:iw,DOCTYPE_NAME:Yp,ERB_EXPR:ew,IS_ALLOWED_URI:Xp,IS_SCRIPT_OR_DATA:sw,MUSTACHE_EXPR:J0,TMPLIT_EXPR:tw}),kn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},aw=function(){return typeof window>"u"?null:window},lw=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}},Wp=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Zp(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:aw(),e=Z=>Zp(Z);if(e.version="3.2.4",e.removed=[],!i||!i.document||i.document.nodeType!==kn.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:f,DOMParser:y,trustedTypes:v}=i,k=l.prototype,P=En(k,"cloneNode"),F=En(k,"remove"),R=En(k,"nextSibling"),D=En(k,"childNodes"),V=En(k,"parentNode");if(typeof o=="function"){let Z=t.createElement("template");Z.content&&Z.content.ownerDocument&&(t=Z.content.ownerDocument)}let M,$="",{implementation:z,createNodeIterator:G,createDocumentFragment:K,getElementsByTagName:Q}=t,{importNode:ne}=r,Y=Wp();e.isSupported=typeof Gp=="function"&&typeof V=="function"&&z&&z.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:re,ERB_EXPR:le,TMPLIT_EXPR:xe,DATA_ATTR:We,ARIA_ATTR:E,IS_SCRIPT_OR_DATA:x,ATTR_WHITESPACE:A,CUSTOM_ELEMENT:H}=jp,{IS_ALLOWED_URI:j}=jp,U=null,J=ae({},[...Hp,...cu,...uu,...hu,...$p]),ee=null,Ae=ae({},[...qp,...du,...Vp,...Sa]),oe=Object.seal(Kp(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,Re=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],lu),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"],Ml="text/html",Ee=null,nr=null,wi=t.createElement("form"),Do=function(w){return w instanceof RegExp||w instanceof Function},Le=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(nr&&nr===w)){if((!w||typeof w!="object")&&(w={}),w=Ur(w),ye=we.indexOf(w.PARSER_MEDIA_TYPE)===-1?Ml:w.PARSER_MEDIA_TYPE,Ee=ye==="application/xhtml+xml"?lu:Ta,U=li(w,"ALLOWED_TAGS")?ae({},w.ALLOWED_TAGS,Ee):J,ee=li(w,"ALLOWED_ATTR")?ae({},w.ALLOWED_ATTR,Ee):Ae,en=li(w,"ALLOWED_NAMESPACES")?ae({},w.ALLOWED_NAMESPACES,lu):sr,gs=li(w,"ADD_URI_SAFE_ATTR")?ae(Ur(Mo),w.ADD_URI_SAFE_ATTR,Ee):Mo,rr=li(w,"ADD_DATA_URI_TAGS")?ae(Ur(Js),w.ADD_DATA_URI_TAGS,Ee):Js,ti=li(w,"FORBID_CONTENTS")?ae({},w.FORBID_CONTENTS,Ee):Tr,ce=li(w,"FORBID_TAGS")?ae({},w.FORBID_TAGS,Ee):{},Re=li(w,"FORBID_ATTR")?ae({},w.FORBID_ATTR,Ee):{},ei=li(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,j=w.ALLOWED_URI_REGEXP||Xp,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&&(U=ae({},$p),ee=[],ei.html===!0&&(ae(U,Hp),ae(ee,qp)),ei.svg===!0&&(ae(U,cu),ae(ee,du),ae(ee,Sa)),ei.svgFilters===!0&&(ae(U,uu),ae(ee,du),ae(ee,Sa)),ei.mathMl===!0&&(ae(U,hu),ae(ee,Vp),ae(ee,Sa))),w.ADD_TAGS&&(U===J&&(U=Ur(U)),ae(U,w.ADD_TAGS,Ee)),w.ADD_ATTR&&(ee===Ae&&(ee=Ur(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=Ur(ti)),ae(ti,w.FORBID_CONTENTS,Ee)),Oi&&(U["#text"]=!0),Qt&&ae(U,["html","head","body"]),U.table&&(ae(U,["tbody"]),delete ce.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Tn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Tn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=w.TRUSTED_TYPES_POLICY,$=M.createHTML("")}else M===void 0&&(M=lw(v,s)),M!==null&&typeof $=="string"&&($=M.createHTML(""));vt&&vt(w),nr=w}},Ot=ae({},[...cu,...uu,...Z0]),Ri=ae({},[...hu,...Q0]),Il=function(w){let I=V(w);(!I||!I.tagName)&&(I={namespaceURI:yi,tagName:"template"});let X=Ta(w.tagName),be=Ta(I.tagName);return en[w.namespaceURI]?w.namespaceURI===se?I.namespaceURI===Ht?X==="svg":I.namespaceURI===vs?X==="svg"&&(be==="annotation-xml"||Ge[be]):!!Ot[X]:w.namespaceURI===vs?I.namespaceURI===Ht?X==="math":I.namespaceURI===se?X==="math"&&bs[be]:!!Ri[X]:w.namespaceURI===Ht?I.namespaceURI===se&&!bs[be]||I.namespaceURI===vs&&!Ge[be]?!1:!Ri[X]&&(Io[X]||!Ot[X]):!!(ye==="application/xhtml+xml"&&en[w.namespaceURI]):!1},At=function(w){wn(e.removed,{element:w});try{V(w).removeChild(w)}catch{F(w)}},or=function(w,I){try{wn(e.removed,{attribute:I.getAttributeNode(w),from:I})}catch{wn(e.removed,{attribute:null,from:I})}if(I.removeAttribute(w),w==="is")if(zt||Fi)try{At(I)}catch{}else try{I.setAttribute(w,"")}catch{}},ar=function(w){let I=null,X=null;if(Ci)w="<remove></remove>"+w;else{let Se=zp(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=M?M.createHTML(w):w;if(yi===Ht)try{I=new y().parseFromString(be,ye)}catch{}if(!I||!I.documentElement){I=z.createDocument(yi,"template",null);try{I.documentElement.innerHTML=ii?$:be}catch{}}let Qe=I.body||I.documentElement;return w&&X&&Qe.insertBefore(t.createTextNode(X),Qe.childNodes[0]||null),yi===Ht?Q.call(I,Qt?"html":"body")[0]:Qt?I.documentElement:Qe},No=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)},ys=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")},tn=function(w){return typeof a=="function"&&w instanceof a};function Ne(Z,w,I){wa(Z,X=>{X.call(e,w,I,nr)})}let ft=function(w){let I=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:U}),w.hasChildNodes()&&!tn(w.firstElementChild)&>(/<[/\w]/g,w.innerHTML)&>(/<[/\w]/g,w.textContent)||w.nodeType===kn.progressingInstruction||tr&&w.nodeType===kn.comment&>(/<[/\w]/g,w.data))return At(w),!0;if(!U[X]||ce[X]){if(!ce[X]&&rn(X)&&(oe.tagNameCheck instanceof RegExp&>(oe.tagNameCheck,X)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(X)))return!1;if(Oi&&!ti[X]){let be=V(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&&!Il(w)||(X==="noscript"||X==="noembed"||X==="noframes")&>(/<\/no(script|embed|frames)/i,w.innerHTML)?(At(w),!0):(Zt&&w.nodeType===kn.text&&(I=w.textContent,wa([re,le,xe],be=>{I=Sn(I,be," ")}),w.textContent!==I&&(wn(e.removed,{element:w.cloneNode()}),w.textContent=I)),Ne(Y.afterSanitizeElements,w,null),!1)},Li=function(w,I,X){if(_t&&(I==="id"||I==="name")&&(X in t||X in wi))return!1;if(!(He&&!Re[I]&>(We,I))){if(!(De&>(E,I))){if(!ee[I]||Re[I]){if(!(rn(w)&&(oe.tagNameCheck instanceof RegExp&>(oe.tagNameCheck,w)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(w))&&(oe.attributeNameCheck instanceof RegExp&>(oe.attributeNameCheck,I)||oe.attributeNameCheck instanceof Function&&oe.attributeNameCheck(I))||I==="is"&&oe.allowCustomizedBuiltInElements&&(oe.tagNameCheck instanceof RegExp&>(oe.tagNameCheck,X)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(X))))return!1}else if(!gs[I]){if(!gt(j,Sn(X,A,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&w!=="script"&&G0(X,"data:")===0&&rr[w])){if(!(gi&&!gt(x,Sn(X,A,"")))){if(X)return!1}}}}}}return!0},rn=function(w){return w!=="annotation-xml"&&zp(w,H)},ws=function(w){Ne(Y.beforeSanitizeAttributes,w,null);let{attributes:I}=w;if(!I||ys(w))return;let X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0},be=I.length;for(;be--;){let Qe=I[be],{name:Se,namespaceURI:ht,value:$t}=Qe,lr=Ee(Se),nt=Se==="value"?$t:K0($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&>(/((--!?|])>)|<\/(style|title)/i,nt)){or(Se,w);continue}if(X.forceKeepAttr||(or(Se,w),!X.keepAttr))continue;if(!vi&>(/\/>/i,nt)){or(Se,w);continue}Zt&&wa([re,le,xe],Uo=>{nt=Sn(nt,Uo," ")});let Bo=Ee(w.nodeName);if(Li(Bo,lr,nt)){if(M&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!ht)switch(v.getAttributeType(Bo,lr)){case"TrustedHTML":{nt=M.createHTML(nt);break}case"TrustedScriptURL":{nt=M.createScriptURL(nt);break}}try{ht?w.setAttributeNS(ht,Se,nt):w.setAttribute(Se,nt),ys(w)?At(w):Up(e.removed)}catch{}}}Ne(Y.afterSanitizeAttributes,w,null)},Dl=function Z(w){let I=null,X=No(w);for(Ne(Y.beforeSanitizeShadowDOM,w,null);I=X.nextNode();)Ne(Y.uponSanitizeShadowNode,I,null),ft(I),ws(I),I.content instanceof n&&Z(I.content);Ne(Y.afterSanitizeShadowDOM,w,null)};return e.sanitize=function(Z){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,X=null,be=null,Qe=null;if(ii=!Z,ii&&(Z="<!-->"),typeof Z!="string"&&!tn(Z))if(typeof Z.toString=="function"){if(Z=Z.toString(),typeof Z!="string")throw Tn("dirty is not a string, aborting")}else throw Tn("toString is not a function");if(!e.isSupported)return Z;if(Sr||Le(w),e.removed=[],typeof Z=="string"&&(Jt=!1),Jt){if(Z.nodeName){let $t=Ee(Z.nodeName);if(!U[$t]||ce[$t])throw Tn("root node is forbidden and cannot be sanitized in-place")}}else if(Z instanceof a)I=ar("<!---->"),X=I.ownerDocument.importNode(Z,!0),X.nodeType===kn.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?I=X:I.appendChild(X);else{if(!zt&&!Zt&&!Qt&&Z.indexOf("<")===-1)return M&&_i?M.createHTML(Z):Z;if(I=ar(Z),!I)return zt?null:_i?$:""}I&&Ci&&At(I.firstChild);let Se=No(Jt?Z:I);for(;be=Se.nextNode();)ft(be),ws(be),be.content instanceof n&&Dl(be.content);if(Jt)return Z;if(zt){if(Fi)for(Qe=K.call(I.ownerDocument);I.firstChild;)Qe.appendChild(I.firstChild);else Qe=I;return(ee.shadowroot||ee.shadowrootmode)&&(Qe=ne.call(r,Qe,!0)),Qe}let ht=Qt?I.outerHTML:I.innerHTML;return Qt&&U["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&>(Yp,I.ownerDocument.doctype.name)&&(ht="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
|
32
|
+
`+ht),Zt&&wa([re,le,xe],$t=>{ht=Sn(ht,$t," ")}),M&&_i?M.createHTML(ht):ht},e.setConfig=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Le(Z),Sr=!0},e.clearConfig=function(){nr=null,Sr=!1},e.isValidAttribute=function(Z,w,I){nr||Le({});let X=Ee(Z),be=Ee(w);return Li(X,be,I)},e.addHook=function(Z,w){typeof w=="function"&&wn(Y[Z],w)},e.removeHook=function(Z,w){if(w!==void 0){let I=j0(Y[Z],w);return I===-1?void 0:W0(Y[Z],I,1)[0]}return Up(Y[Z])},e.removeHooks=function(Z){Y[Z]=[]},e.removeAllHooks=function(){Y=Wp()},e}var Rs=Zp();function vu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Hr=vu();function sf(i){Hr=i}var Pn={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")},cw=/^(?:[ \t]*(?:\n|$))+/,uw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Fn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bu=/(?:[*+-]|\d{1,9}[.)])/,nf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,of=ge(nf).replace(/bull/g,bu).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(),pw=ge(nf).replace(/bull/g,bu).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(),yu=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,fw=/^[^\n]+/,wu=/(?!\s*\])(?:\\.|[^\[\]\\])+/,mw=ge(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",wu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gw=ge(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bu).getRegex(),xa="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",Su=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,vw=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",Su).replace("tag",xa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),af=ge(yu).replace("hr",Fn).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",xa).getRegex(),bw=ge(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",af).getRegex(),Tu={blockquote:bw,code:uw,def:mw,fences:hw,heading:dw,hr:Fn,html:vw,lheading:of,list:gw,newline:cw,paragraph:af,table:Pn,text:fw},Qp=ge("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Fn).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",xa).getRegex(),yw={...Tu,lheading:pw,table:Qp,paragraph:ge(yu).replace("hr",Fn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Qp).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",xa).getRegex()},ww={...Tu,html:ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Su).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:Pn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ge(yu).replace("hr",Fn).replace("heading",` *#{1,6} *[^
|
33
|
+
]`).replace("lheading",of).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Sw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Tw=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,lf=/^( {2,}|\\)\n(?!\s*$)/,Ew=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Aa=/[\p{P}\p{S}]/u,Eu=/[\s\p{P}\p{S}]/u,cf=/[^\s\p{P}\p{S}]/u,kw=ge(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Eu).getRegex(),uf=/(?!~)[\p{P}\p{S}]/u,xw=/(?!~)[\s\p{P}\p{S}]/u,Aw=/(?:[^\s\p{P}\p{S}]|~)/u,Pw=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,hf=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Cw=ge(hf,"u").replace(/punct/g,Aa).getRegex(),Fw=ge(hf,"u").replace(/punct/g,uf).getRegex(),df="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_w=ge(df,"gu").replace(/notPunctSpace/g,cf).replace(/punctSpace/g,Eu).replace(/punct/g,Aa).getRegex(),Ow=ge(df,"gu").replace(/notPunctSpace/g,Aw).replace(/punctSpace/g,xw).replace(/punct/g,uf).getRegex(),Rw=ge("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cf).replace(/punctSpace/g,Eu).replace(/punct/g,Aa).getRegex(),Lw=ge(/\\(punct)/,"gu").replace(/punct/g,Aa).getRegex(),Mw=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(),Iw=ge(Su).replace("(?:-->|$)","-->").getRegex(),Dw=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",Iw).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ka=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Nw=ge(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ka).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pf=ge(/^!?\[(label)\]\[(ref)\]/).replace("label",ka).replace("ref",wu).getRegex(),ff=ge(/^!?\[(ref)\](?:\[\])?/).replace("ref",wu).getRegex(),Bw=ge("reflink|nolink(?!\\()","g").replace("reflink",pf).replace("nolink",ff).getRegex(),ku={_backpedal:Pn,anyPunctuation:Lw,autolink:Mw,blockSkip:Pw,br:lf,code:Tw,del:Pn,emStrongLDelim:Cw,emStrongRDelimAst:_w,emStrongRDelimUnd:Rw,escape:Sw,link:Nw,nolink:ff,punctuation:kw,reflink:pf,reflinkSearch:Bw,tag:Dw,text:Ew,url:Pn},Uw={...ku,link:ge(/^!?\[(label)\]\((.*?)\)/).replace("label",ka).getRegex(),reflink:ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ka).getRegex()},mu={...ku,emStrongRDelimAst:Ow,emStrongLDelim:Fw,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.!#$%&'*+\/=?_`{\|}~-]+@)))/},zw={...mu,br:ge(lf).replace("{2,}","*").getRegex(),text:ge(mu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ea={normal:Tu,gfm:yw,pedantic:ww},xn={normal:ku,gfm:mu,breaks:zw,pedantic:Uw},Hw={"&":"&","<":"<",">":">",'"':""","'":"'"},Jp=i=>Hw[i];function Ti(i,e){if(e){if(yt.escapeTest.test(i))return i.replace(yt.escapeReplace,Jp)}else if(yt.escapeTestNoEncode.test(i))return i.replace(yt.escapeReplaceNoEncode,Jp);return i}function ef(i){try{i=encodeURI(i).replace(yt.percentDecode,"%")}catch{return null}return i}function tf(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 An(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 $w(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 rf(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 qw(i,e,t){let r=i.match(t.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
|
9
34
|
`).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
|
11
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],s=
|
12
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=
|
35
|
+
`)}var Ms=class{options;rules;lexer;constructor(e){this.options=e||Hr}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:An(r,`
|
36
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],s=qw(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=An(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:An(t[0],`
|
37
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=An(t[0],`
|
13
38
|
`).split(`
|
14
39
|
`),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
40
|
`),f=d.replace(this.rules.other.blockquoteSetextReplace,`
|
16
41
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
17
42
|
${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
|
43
|
+
${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 k=v,P=k.raw+`
|
19
44
|
`+r.join(`
|
20
|
-
`),F=this.blockquote(P);o[o.length-1]=F,s=s.substring(0,s.length-
|
45
|
+
`),F=this.blockquote(P);o[o.length-1]=F,s=s.substring(0,s.length-k.raw.length)+F.raw,n=n.substring(0,n.length-k.text.length)+F.text;break}else if(v?.type==="list"){let k=v,P=k.raw+`
|
21
46
|
`+r.join(`
|
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-
|
47
|
+
`),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-k.raw.length)+F.raw,r=P.substring(o.at(-1).raw.length).split(`
|
23
48
|
`);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(`
|
24
49
|
`,1)[0].replace(this.rules.other.listReplaceTabs,D=>" ".repeat(3*D.length)),v=e.split(`
|
25
|
-
`,1)[0],
|
50
|
+
`,1)[0],k=!y.trim(),P=0;if(this.options.pedantic?(P=2,f=y.trimStart()):k?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),k&&this.rules.other.blankLine.test(v)&&(d+=v+`
|
26
51
|
`,e=e.substring(v.length+1),c=!0),!c){let D=this.rules.other.nextBulletRegex(P),V=this.rules.other.hrRegex(P),M=this.rules.other.fencesBeginRegex(P),$=this.rules.other.headingBeginRegex(P),z=this.rules.other.htmlBeginRegex(P);for(;e;){let G=e.split(`
|
27
52
|
`,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)||$.test(v)||z.test(v)||D.test(v)||V.test(v))break;if(K.search(this.rules.other.nonSpaceChar)>=P||!v.trim())f+=`
|
28
|
-
`+K.slice(P);else{if(
|
29
|
-
`+v}!
|
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 F=null,R;this.options.gfm&&(F=this.rules.other.listIsTask.exec(f),F&&(R=F[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:d,task:!!F,checked:R,loose:!1,text:f,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"),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=
|
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(
|
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=
|
53
|
+
`+K.slice(P);else{if(k||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||M.test(y)||$.test(y)||V.test(y))break;f+=`
|
54
|
+
`+v}!k&&!v.trim()&&(k=!0),d+=G+`
|
55
|
+
`,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 F=null,R;this.options.gfm&&(F=this.rules.other.listIsTask.exec(f),F&&(R=F[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:d,task:!!F,checked:R,loose:!1,text:f,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"),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=tf(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
56
|
+
`):[],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(tf(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)===`
|
57
|
+
`?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=An(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=$w(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)),rf(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 rf(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 k=v.slice(2,-2);return{type:"strong",raw:v,text:k,tokens:this.lexer.inlineTokens(k)}}}}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}}}},ci=class i{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Hr,this.options.tokenizer=this.options.tokenizer||new Ms,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:Ea.normal,inline:xn.normal};this.options.pedantic?(t.block=Ea.pedantic,t.inline=xn.pedantic):this.options.gfm&&(t.block=Ea.gfm,this.options.breaks?t.inline=xn.breaks:t.inline=xn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ea,inline:xn}}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
58
|
`),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
59
|
`: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
60
|
`+s.raw,o.text+=`
|
@@ -39,16 +64,16 @@ ${f}`:f;let y=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
39
64
|
`+s.raw,o.text+=`
|
40
65
|
`+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
66
|
`+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}},
|
43
|
-
`;return s?'<pre><code class="language-'+
|
44
|
-
`:"<pre><code>"+(r?n:
|
67
|
+
`+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}},Is=class{options;parser;constructor(e){this.options=e||Hr}space(e){return""}code({text:e,lang:t,escaped:r}){let s=(t||"").match(yt.notSpaceStart)?.[0],n=e.replace(yt.endingNewline,"")+`
|
68
|
+
`;return s?'<pre><code class="language-'+Ti(s)+'">'+(r?n:Ti(n,!0))+`</code></pre>
|
69
|
+
`:"<pre><code>"+(r?n:Ti(n,!0))+`</code></pre>
|
45
70
|
`}blockquote({tokens:e}){return`<blockquote>
|
46
71
|
${this.parser.parse(e)}</blockquote>
|
47
72
|
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
48
73
|
`}hr(e){return`<hr>
|
49
74
|
`}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
75
|
`+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+" "+
|
76
|
+
`}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
77
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
53
78
|
`}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
79
|
<thead>
|
@@ -57,19 +82,19 @@ ${this.parser.parse(e)}</blockquote>
|
|
57
82
|
`}tablerow({text:e}){return`<tr>
|
58
83
|
${e}</tr>
|
59
84
|
`}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>${
|
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}},
|
62
|
-
Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+Ei(r.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(r);throw r}}},Ir=new _c;function me(i,e){return Ir.parse(i,e)}me.options=me.setOptions=function(i){return Ir.setOptions(i),me.defaults=Ir.defaults,Cp(me.defaults),me};me.getDefaults=Oc;me.defaults=Dr;me.use=function(...i){return Ir.use(...i),me.defaults=Ir.defaults,Cp(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 _P=me.options,OP=me.setOptions,RP=me.use,LP=me.walkTokens,MP=me.parseInline;var IP=li.parse,DP=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 T0=0;function zp(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 Up(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}`)},Tn=zp("onMissingKey"),xn=zp("apply"),Nr=class{constructor(e,t){let{onMissingKey:r=k0}=t===void 0?{}:t;Object.defineProperty(this,xn,{value:A0}),Object.defineProperty(this,Tn,{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,Tn)[Tn]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&(Sa(this,Tn)[Tn](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){let n=this.locale.pluralize(t.smart_count);return Up(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 Up(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 Bf=Fe($p(),1);var P0="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var dr=(i=21)=>{let e="",t=i|0;for(;t--;)e+=P0[Math.random()*64|0];return e};var Uf=Fe(Ef(),1);function Ta(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var ww=0;function Tf(i){return"__private_"+ww+++"_"+i}var Sw={version:"4.2.0"},Br=Tf("callbacks"),qc=Tf("publish"),xa=class{constructor(){Object.defineProperty(this,qc,{value:Ew}),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,Ta(this,qc)[qc](t,r,e)}subscribe(e){return Ta(this,Br)[Br].add(e),()=>{Ta(this,Br)[Br].delete(e)}}};function Ew(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Ta(this,Br)[Br].forEach(r=>{r(...e)})}xa.VERSION=Sw.version;var xf=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 Vc={__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 Vc?Vc[t]:"application/octet-stream"}function Tw(i){return i.charCodeAt(0).toString(32)}function kf(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${Tw(t)}`,"/"))+e}function Af(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${kf(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${kf(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 ka(i,e){if(xw(i))return i.id;let t=An(i);return Af({...i,type:t},e)}function jc(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 Wc(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function Gc(i){return i<10?`0${i}`:i.toString()}function _s(){let i=new Date,e=Gc(i.getHours()),t=Gc(i.getMinutes()),r=Gc(i.getSeconds());return`${e}:${t}:${r}`}var Pf={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)}},Cf={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=Fe(Aa(),1),If=Fe(Mf(),1),Df={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,If.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 Nf={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.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"),Kc=xe("checkRequiredMetaFields"),Fn=xe("assertNewUploadAllowed"),Zc=xe("transformFile"),_n=xe("startIfAutoProceed"),On=xe("checkAndUpdateFileState"),Qc=xe("handleUploadProgress"),Rn=xe("updateTotalProgress"),Vi=xe("updateTotalProgressThrottled"),Jc=xe("calculateTotalProgress"),Xc=xe("addListeners"),ci=xe("updateOnlineStatus"),Ln=xe("requestClientById"),Hi=xe("createUpload"),Yc=xe("getUpload"),$r=xe("removeUpload"),$i=xe("runUpload"),Fa=class i{constructor(e){Object.defineProperty(this,$i,{value:$w}),Object.defineProperty(this,$r,{value:Hw}),Object.defineProperty(this,Yc,{value:zw}),Object.defineProperty(this,Hi,{value:Uw}),Object.defineProperty(this,Xc,{value:Bw}),Object.defineProperty(this,Jc,{value:Nw}),Object.defineProperty(this,Rn,{value:Dw}),Object.defineProperty(this,On,{value:Iw}),Object.defineProperty(this,_n,{value:Mw}),Object.defineProperty(this,Zc,{value:Lw}),Object.defineProperty(this,Fn,{value:Rw}),Object.defineProperty(this,Kc,{value:Ow}),Object.defineProperty(this,Mn,{value:_w}),Object.defineProperty(this,Lt,{value:Fw}),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,Bf.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,Qc,{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,Vi)[Vi]()}}),Object.defineProperty(this,Vi,{writable:!0,value:(0,Uf.default)(()=>W(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=Nf;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Df,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new xf,logger:Pf,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=Cf),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Ca,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:jc(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),W(this,lt)[lt]=new Pa(()=>this.opts,()=>this.i18n),W(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),W(this,Xc)[Xc]()}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,zi)[zi].emit(e,...r)}on(e,t){return W(this,zi)[zi].on(e,t),this}once(e,t){return W(this,zi)[zi].once(e,t),this}off(e,t){return W(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){W(this,zr)[zr].add(e)}removePreProcessor(e){return W(this,zr)[zr].delete(e)}addPostProcessor(e){W(this,qi)[qi].add(e)}removePostProcessor(e){return W(this,qi)[qi].delete(e)}addUploader(e){W(this,Hr)[Hr].add(e)}removeUploader(e){return W(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=[],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,lt)[lt].validate(t,[e])}catch(r){return r}return null}validateSingleFile(e){try{W(this,lt)[lt].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{W(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){W(this,Fn)[Fn](e);let{nextFilesState:t,validFilesToAdd:r,errors:s}=W(this,On)[On]([e]),n=s.filter(a=>a.isRestriction);if(W(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}`),W(this,_n)[_n](),o.id}addFiles(e){W(this,Fn)[Fn]();let{nextFilesState:t,validFilesToAdd:r,errors:s}=W(this,On)[On](e),n=s.filter(a=>a.isRestriction);W(this,Lt)[Lt](n);let o=s.filter(a=>!a.isRestriction);if(o.length>0){let a=`Multiple errors occurred while adding files:
|
85
|
+
`}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=ef(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=ef(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)}},Cn=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""}},ui=class i{options;renderer;textRenderer;constructor(e){this.options=e||Hr,this.options.renderer=this.options.renderer||new Is,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Cn}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+=`
|
86
|
+
`+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}},Ls=class{options;block;constructor(e){this.options=e||Hr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?ci.lex:ci.lexInline}provideParser(){return this.block?ui.parse:ui.parseInline}},gu=class{defaults=vu();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ui;Renderer=Is;TextRenderer=Cn;Lexer=ci;Tokenizer=Ms;Hooks=Ls;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 Is(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 Ms(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 Ls;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];Ls.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 ci.lex(e,t??this.defaults)}parser(e,t){return ui.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?ci.lex:ci.lexInline,c=o.hooks?o.hooks.provideParser():e?ui.parse:ui.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+=`
|
87
|
+
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}}},zr=new gu;function me(i,e){return zr.parse(i,e)}me.options=me.setOptions=function(i){return zr.setOptions(i),me.defaults=zr.defaults,sf(me.defaults),me};me.getDefaults=vu;me.defaults=Hr;me.use=function(...i){return zr.use(...i),me.defaults=zr.defaults,sf(me.defaults),me};me.walkTokens=function(i,e){return zr.walkTokens(i,e)};me.parseInline=zr.parseInline;me.Parser=ui;me.parser=ui.parse;me.Renderer=Is;me.TextRenderer=Cn;me.Lexer=ci;me.lexer=ci.lex;me.Tokenizer=Ms;me.Hooks=Ls;me.parse=me;var RP=me.options,LP=me.setOptions,MP=me.use,IP=me.walkTokens,DP=me.parseInline;var NP=ui.parse,BP=ci.lex;var Pa=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=Rs.sanitize(e,{ALLOWED_TAGS:["strong","em","sub","sup","details","summary"],ALLOWED_ATTR:[]}),r=me(t);return Rs.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 Ca=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 Fa=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 _a=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 Oa=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 Ra=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 La(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Vw=0;function gf(i){return"__private_"+Vw+++"_"+i}function jw(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 mf(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=jw(s,new RegExp(`%\\{${n}\\}`,"g"),o)}return s}var Ww=i=>{throw new Error(`missing string: ${i}`)},_n=gf("onMissingKey"),On=gf("apply"),$r=class{constructor(e,t){let{onMissingKey:r=Ww}=t===void 0?{}:t;Object.defineProperty(this,On,{value:Gw}),Object.defineProperty(this,_n,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(La(this,On)[On],this):La(this,On)[On](e),La(this,_n)[_n]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&(La(this,_n)[_n](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){let n=this.locale.pluralize(t.smart_count);return mf(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 mf(r,t)}};function Gw(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 pm=Fe(bf(),1);var Kw="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var mr=(i=21)=>{let e="",t=i|0;for(;t--;)e+=Kw[Math.random()*64|0];return e};var fm=Fe(Zf(),1);function Ia(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var H1=0;function Qf(i){return"__private_"+H1+++"_"+i}var $1={version:"4.2.0"},qr=Qf("callbacks"),Fu=Qf("publish"),Da=class{constructor(){Object.defineProperty(this,Fu,{value:q1}),this.state={},Object.defineProperty(this,qr,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t={...this.state},r={...this.state,...e};this.state=r,Ia(this,Fu)[Fu](t,r,e)}subscribe(e){return Ia(this,qr)[qr].add(e),()=>{Ia(this,qr)[qr].delete(e)}}};function q1(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Ia(this,qr)[qr].forEach(r=>{r(...e)})}Da.VERSION=$1.version;var Jf=Da;function Vr(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 _u={__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 Ln(i){var e;if(i.type)return i.type;let t=i.name?(e=Vr(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in _u?_u[t]:"application/octet-stream"}function V1(i){return i.charCodeAt(0).toString(32)}function em(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${V1(t)}`,"/"))+e}function tm(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${em(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${em(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function j1(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function Na(i,e){if(j1(i))return i.id;let t=Ln(i);return tm({...i,type:t},e)}function Ou(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 Ru(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function Lu(i){return i<10?`0${i}`:i.toString()}function Ds(){let i=new Date,e=Lu(i.getHours()),t=Lu(i.getMinutes()),r=Lu(i.getSeconds());return`${e}:${t}:${r}`}var im={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] [${Ds()}]`,...e)}},rm={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${Ds()}]`,...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] [${Ds()}]`,...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] [${Ds()}]`,...e)}};var Mn=Fe(Ba(),1),um=Fe(cm(),1),hm={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)}},Ua=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,Mn.default)(r),size:(0,Mn.default)(n)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(a=>a.includes("/")?e.type?(0,um.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,Mn.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,Mn.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 dm={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 K1=0;function ke(i){return"__private_"+K1+++"_"+i}var X1={version:"4.4.2"},za={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},at=ke("plugins"),lt=ke("restricter"),In=ke("storeUnsubscribe"),Hi=ke("emitter"),jr=ke("preProcessors"),Wr=ke("uploaders"),Vi=ke("postProcessors"),Lt=ke("informAndEmit"),Hn=ke("checkRequiredMetaFieldsOnFile"),Mu=ke("checkRequiredMetaFields"),Dn=ke("assertNewUploadAllowed"),Nu=ke("transformFile"),Nn=ke("startIfAutoProceed"),Bn=ke("checkAndUpdateFileState"),Bu=ke("handleUploadProgress"),Un=ke("updateTotalProgress"),ji=ke("updateTotalProgressThrottled"),Uu=ke("calculateTotalProgress"),Iu=ke("addListeners"),hi=ke("updateOnlineStatus"),zn=ke("requestClientById"),$i=ke("createUpload"),Du=ke("getUpload"),Gr=ke("removeUpload"),qi=ke("runUpload"),Ha=class i{constructor(e){Object.defineProperty(this,qi,{value:cS}),Object.defineProperty(this,Gr,{value:lS}),Object.defineProperty(this,Du,{value:aS}),Object.defineProperty(this,$i,{value:oS}),Object.defineProperty(this,Iu,{value:nS}),Object.defineProperty(this,Uu,{value:sS}),Object.defineProperty(this,Un,{value:rS}),Object.defineProperty(this,Bn,{value:iS}),Object.defineProperty(this,Nn,{value:tS}),Object.defineProperty(this,Nu,{value:eS}),Object.defineProperty(this,Dn,{value:J1}),Object.defineProperty(this,Mu,{value:Q1}),Object.defineProperty(this,Hn,{value:Z1}),Object.defineProperty(this,Lt,{value:Y1}),Object.defineProperty(this,at,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,In,{writable:!0,value:void 0}),Object.defineProperty(this,Hi,{writable:!0,value:(0,pm.default)()}),Object.defineProperty(this,jr,{writable:!0,value:new Set}),Object.defineProperty(this,Wr,{writable:!0,value:new Set}),Object.defineProperty(this,Vi,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,Bu,{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,ji)[ji]()}}),Object.defineProperty(this,ji,{writable:!0,value:(0,fm.default)(()=>W(this,Un)[Un](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,hi,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,zn,{writable:!0,value:new Map}),this.defaultLocale=dm;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:hm,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new Jf,logger:im,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=rm),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...za,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Ou(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),W(this,lt)[lt]=new Ua(()=>this.opts,()=>this.i18n),W(this,In)[In]=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,Iu)[Iu]()}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,Hi)[Hi].emit(e,...r)}on(e,t){return W(this,Hi)[Hi].on(e,t),this}once(e,t){return W(this,Hi)[Hi].once(e,t),this}off(e,t){return W(this,Hi)[Hi].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 $r([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,...za})}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({...za,files:{}})}addPreProcessor(e){W(this,jr)[jr].add(e)}removePreProcessor(e){return W(this,jr)[jr].delete(e)}addPostProcessor(e){W(this,Vi)[Vi].add(e)}removePostProcessor(e){return W(this,Vi)[Vi].delete(e)}addUploader(e){W(this,Wr)[Wr].add(e)}removeUploader(e){return W(this,Wr)[Wr].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 k of s){let{progress:P}=k;!P.uploadComplete&&P.uploadStarted&&(n.push(k),k.isPaused||y.push(k)),P.uploadStarted||o.push(k),(P.uploadStarted||P.preprocess||P.postprocess)&&a.push(k),P.uploadStarted&&l.push(k),k.isPaused&&c.push(k),P.uploadComplete&&d.push(k),k.error&&f.push(k),(P.preprocess||P.postprocess)&&v.push(k)}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(k=>k.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{W(this,lt)[lt].validate(t,[e])}catch(r){return r}return null}validateSingleFile(e){try{W(this,lt)[lt].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{W(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){W(this,Dn)[Dn](e);let{nextFilesState:t,validFilesToAdd:r,errors:s}=W(this,Bn)[Bn]([e]),n=s.filter(a=>a.isRestriction);if(W(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}`),W(this,Nn)[Nn](),o.id}addFiles(e){W(this,Dn)[Dn]();let{nextFilesState:t,validFilesToAdd:r,errors:s}=W(this,Bn)[Bn](e),n=s.filter(a=>a.isRestriction);W(this,Lt)[Lt](n);let o=s.filter(a=>!a.isRestriction);if(o.length>0){let a=`Multiple errors occurred while adding files:
|
63
88
|
`;if(o.forEach(l=>{a+=`
|
64
89
|
* ${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
90
|
id: ${a.id}
|
66
|
-
type: ${a.type}`)}),r.length>0&&W(this,
|
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,at)[at]?W(this,at)[at][n.type].push(n):W(this,at)[at][n.type]=[n],n.install(),this.emit("plugin-added",n),this}getPlugin(e){for(let t of Object.values(W(this,at)[at])){let r=t.find(s=>s.id===e);if(r!=null)return r}}[Symbol.for("uppy test: getPlugins")](e){return W(this,at)[at][e]}iteratePlugins(e){Object.values(W(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=W(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(),W(this,Cn)[Cn](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",W(this,ci)[ci]),window.removeEventListener("offline",W(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){W(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=W(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]?W(this,$i)[$i](e):(W(this,$r)[$r](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return W(this,Hi)[Hi](...arguments)}addResultData(e,t){if(!W(this,Yc)[Yc](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,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(()=>W(this,lt)[lt].validateMinNumberOfFiles(t)).catch(s=>{throw W(this,Lt)[Lt]([s]),s}).then(()=>{if(!W(this,Kc)[Kc](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=W(this,Hi)[Hi](o);return W(this,$i)[$i](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,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 Ow(i){let e=!0;for(let t of Object.values(i))W(this,Mn)[Mn](t)||(e=!1);return e}function Rw(i){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new Ct(this.i18n("noMoreFilesAllowed"),{file:i});throw W(this,Lt)[Lt]([t]),t}}function Lw(i){let e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=An(e),r=Wc(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 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,Zc)[Zc](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),W(this,lt)[lt].validateSingleFile(l),t[l.id]=l,r.push(l)}catch(l){s.push(l)}try{W(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 Dw(){var i,e;let t=W(this,Jc)[Jc](),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,Lt)[Lt]([a])}else W(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",W(this,Qc)[Qc]),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,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}),W(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",()=>{W(this,Vi)[Vi]()}),this.on("dashboard:file-edit-complete",r=>{r&&W(this,Mn)[Mn](r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",W(this,ci)[ci]),window.addEventListener("offline",W(this,ci)[ci]),setTimeout(W(this,ci)[ci],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=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 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,zr)[zr],...W(this,Hr)[Hr],...W(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 W(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),W(this,$r)[$r](i)),s==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),s}Fa.VERSION=Cw.version;var _a=Fa;var Nn,Ee,Vf,qw,qr,zf,jf,Wf,Gf,iu,eu,tu,Vw,Dn={},Kf=[],jw=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Bn=Array.isArray;function Ti(i,e){for(var t in e)i[t]=e[t];return i}function ru(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??++Vf,__i:-1,__u:0};return s==null&&Ee.vnode!=null&&Ee.vnode(n),n}function Xf(){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 Yf(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 Yf(i)}}function Hf(i){(!i.__d&&(i.__d=!0)&&qr.push(i)&&!Ra.__r++||zf!==Ee.debounceRendering)&&((zf=Ee.debounceRendering)||jf)(Ra)}function Ra(){for(var i,e,t,r,s,n,o,a=1;qr.length;)qr.length>a&&qr.sort(Wf),i=qr.shift(),a=qr.length,i.__d&&(t=void 0,s=(r=(e=i).__v).__e,n=[],o=[],e.__P&&((t=Ti({},r)).__v=r.__v+1,Ee.vnode&&Ee.vnode(t),su(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,Jf(n,t,o),t.__e!=s&&Yf(t)));Ra.__r=0}function Zf(i,e,t,r,s,n,o,a,l,c,d){var f,y,v,x,P,F,R=r&&r.__k||Kf,D=e.length;for(l=Ww(t,e,R,l,D),f=0;f<D;f++)(v=t.__k[f])!=null&&(y=v.__i===-1?Dn:R[v.__i]||Dn,v.__i=f,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),4&v.__u||y.__k===v.__k?l=Qf(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 Ww(i,e,t,r,s){var n,o,a,l,c,d=t.length,f=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=Gw(o,t,l,f))!==-1&&(f--,(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(f)for(n=0;n<d;n++)(a=t[n])!=null&&!(2&a.__u)&&(a.__e==r&&(r=Os(a)),tm(a,a));return r}function Qf(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=Qf(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 Gw(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 $f(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||jw.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||$f(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||$f(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(Gf,"$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=iu,i.addEventListener(e,n?tu:eu,n)):i.removeEventListener(e,n?tu:eu,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 qf(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.u==null)e.u=iu++;else if(e.u<t.t)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,F,R,D,V,M,$,z,G,K,Q,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=Ee.__b)&&d(e);e:if(typeof Y=="function")try{if(R=e.props,D="prototype"in Y&&Y.prototype.render,V=(d=Y.contextType)&&r[d.__c],M=d?V?V.props.value:d.__:r,t.__c?F=(f=e.__c=t.__c).__=f.__E:(D?e.__c=f=new Y(R,M):(e.__c=f=new dt(R,M),f.constructor=Y,f.render=Xw),V&&V.sub(f),f.props=R,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&&Y.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Ti({},f.__s)),Ti(f.__s,Y.getDerivedStateFromProps(R,f.__s))),v=f.props,x=f.state,f.__v=e,y)D&&Y.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),D&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(D&&Y.getDerivedStateFromProps==null&&R!==v&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(R,M),!f.__e&&(f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(R,f.__s,M)===!1||e.__v==t.__v)){for(e.__v!=t.__v&&(f.props=R,f.state=f.__s,f.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(re){re&&(re.__=e)}),$=0;$<f._sb.length;$++)f.__h.push(f._sb[$]);f._sb=[],f.__h.length&&o.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(R,f.__s,M),D&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(v,x,P)})}if(f.context=M,f.props=R,f.__P=i,f.__e=!1,z=Ee.__r,G=0,D){for(f.state=f.__s,f.__d=!1,z&&z(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,z&&z(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=Ti(Ti({},r),f.getChildContext())),D&&!y&&f.getSnapshotBeforeUpdate!=null&&(P=f.getSnapshotBeforeUpdate(v,x)),Q=d,d!=null&&d.type===Mt&&d.key==null&&(Q=em(d.props.children)),a=Zf(i,Bn(Q)?Q:[Q],e,t,r,s,n,o,a,l,c),f.base=e.__e,e.__u&=-161,f.__h.length&&o.push(f),F&&(f.__E=f.__=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--;)ru(n[ne]);else e.__e=t.__e,e.__k=t.__k;Ee.__e(re,e,t)}else n==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):a=e.__e=Kw(t.__e,e,t,r,s,n,o,l,c);return(d=Ee.diffed)&&d(e),128&e.__u?void 0:a}function Jf(i,e,t){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 em(i){return typeof i!="object"||i==null?i:Bn(i)?i.map(em):Ti({},i)}function Kw(i,e,t,r,s,n,o,a,l){var c,d,f,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&&(Ee.__m&&Ee.__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")f=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||f&&(d.__html===f.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),e.__k=[];else if(f&&(i.innerHTML=""),Zf(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--;)ru(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 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 tm(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]&&tm(r[s],e,t||typeof i.type!="function");t||ru(i.__e),i.__c=i.__=i.__e=void 0}function Xw(i,e,t){return this.constructor(i,t)}function ou(i,e,t){var r,s,n,o;e==document&&(e=document.documentElement),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(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),Jf(n,i,o)}function La(i,e,t){var r,s,n,o,a=Ti({},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=Kf.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}},Vf=0,qw=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=Ti({},this.state),typeof i=="function"&&(i=i(Ti({},t),this.props)),i&&Ti(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),Hf(this))},dt.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Hf(this))},dt.prototype.render=Mt,qr=[],jf=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Wf=function(i,e){return i.__v.__b-e.__v.__b},Ra.__r=0,Gf=/(PointerCapture)$|Capture$/i,iu=0,eu=qf(!1),tu=qf(!0),Vw=0;function Un(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):Un(i)?i:null}var im=Yw;function Zw(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}var Ma=Zw;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 rm(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 zn=Jw("updateUI"),au=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=im(e);if(s){this.isTargetDOMEl=!0;let a=document.createElement("div");return a.classList.add("uppy-Root"),rm(this,zn)[zn]=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||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=rm(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=au;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 fu=Fe(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 hu=Fe(wt(),1),uu=Fe(Aa(),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",sm=()=>` ${t1} `;function nm(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===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 om(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 am(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 lm(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 cm(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 um(){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 hm(i){let{progress:e}=i,{value:t,mode:r,message:s}=e;return u("div",{className:"uppy-StatusBar-content"},u(um,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&&sm(),s!=null?o("dataUploadedOfTotal",{complete:l,total:(0,uu.default)(s)}):o("dataUploadedOfUnknown",{complete:l}),sm(),n!=null&&o("xTimeLeft",{time:cu(n)})))}function dm(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 pm(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 F=e(a?"paused":"uploading");function R(){return!a&&!P&&s?t?u(i1,{numUploads:c,complete:d,totalUploadedSize:f,totalSize:y,totalETA:v,i18n:e}):u(dm,{i18n:e,complete:d,numUploads:c}):null}return u("div",{className:"uppy-StatusBar-content","aria-label":F,title:F},a?null:u(um,null),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t&&r!==0?`${F}: ${r}%`:F),R(),P?u(r1,{i18n:e,newFiles:l,startUpload:x}):null))}function fm(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 mm(i){let{error:e,i18n:t,complete:r,numUploads:s}=i;function n(){let o=`${t("uploadFailed")}
|
91
|
+
type: ${a.type}`)}),r.length>0&&W(this,Nn)[Nn]()}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,ji)[ji]();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,$i)[$i](t,{forceAllowNewUpload:!0});return W(this,qi)[qi](r)}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(za)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let t=W(this,$i)[$i]([e],{forceAllowNewUpload:!0});return W(this,qi)[qi](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return W(this,Un)[Un]()}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}'.
|
92
|
+
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,at)[at]?W(this,at)[at][n.type].push(n):W(this,at)[at][n.type]=[n],n.install(),this.emit("plugin-added",n),this}getPlugin(e){for(let t of Object.values(W(this,at)[at])){let r=t.find(s=>s.id===e);if(r!=null)return r}}[Symbol.for("uppy test: getPlugins")](e){return W(this,at)[at][e]}iteratePlugins(e){Object.values(W(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=W(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(),W(this,In)[In](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",W(this,hi)[hi]),window.removeEventListener("offline",W(this,hi)[hi]))}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,zn)[zn].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,zn)[zn].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,qi)[qi](e):(W(this,Gr)[Gr](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return W(this,$i)[$i](...arguments)}addResultData(e,t){if(!W(this,Du)[Du](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,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(()=>W(this,lt)[lt].validateMinNumberOfFiles(t)).catch(s=>{throw W(this,Lt)[Lt]([s]),s}).then(()=>{if(!W(this,Mu)[Mu](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=W(this,$i)[$i](o);return W(this,qi)[qi](a)}).catch(s=>{throw this.emit("error",s),this.log(s,"error"),s}))}};function Y1(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 Z1(i){let{missingFields:e,error:t}=W(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 Q1(i){let e=!0;for(let t of Object.values(i))W(this,Hn)[Hn](t)||(e=!1);return e}function J1(i){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new Ct(this.i18n("noMoreFilesAllowed"),{file:i});throw W(this,Lt)[Lt]([t]),t}}function eS(i){let e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=Ln(e),r=Ru(t,e),s=Vr(r).extension,n=Na(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 tS(){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 iS(i){let{files:e}=this.getState(),t={...e},r=[],s=[];for(let a of i)try{var n;let l=W(this,Nu)[Nu](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),W(this,lt)[lt].validateSingleFile(l),t[l.id]=l,r.push(l)}catch(l){s.push(l)}try{W(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 rS(){var i,e;let t=W(this,Uu)[Uu](),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 sS(){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 nS(){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,Lt)[Lt]([a])}else W(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",W(this,Bu)[Bu]),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,Vi)[Vi].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,ji)[ji]()}),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,ji)[ji]()}),this.on("dashboard:file-edit-complete",r=>{r&&W(this,Hn)[Hn](r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",W(this,hi)[hi]),window.addEventListener("offline",W(this,hi)[hi]),setTimeout(W(this,hi)[hi],3e3))}function oS(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=mr();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 aS(i){let{currentUploads:e}=this.getState();return e[i]}function lS(i){let e={...this.getState().currentUploads};delete e[i],this.setState({currentUploads:e})}async function cS(i){let e=()=>{let{currentUploads:n}=this.getState();return n[i]},t=e(),r=[...W(this,jr)[jr],...W(this,Wr)[Wr],...W(this,Vi)[Vi]];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,Gr)[Gr](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,Gr)[Gr](i)),s==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),s}Ha.VERSION=X1.version;var $a=Ha;var Vn,Te,ym,uS,Kr,mm,wm,Sm,Tm,$u,zu,Hu,hS,qn={},Em=[],dS=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,jn=Array.isArray;function Ei(i,e){for(var t in e)i[t]=e[t];return i}function qu(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?Vn.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 $n(i,o,r,s,null)}function $n(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??++ym,__i:-1,__u:0};return s==null&&Te.vnode!=null&&Te.vnode(n),n}function km(){return{current:null}}function Mt(i){return i.children}function dt(i,e){this.props=i,this.context=e}function Ns(i,e){if(e==null)return i.__?Ns(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"?Ns(i):null}function xm(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 xm(i)}}function gm(i){(!i.__d&&(i.__d=!0)&&Kr.push(i)&&!Va.__r++||mm!==Te.debounceRendering)&&((mm=Te.debounceRendering)||wm)(Va)}function Va(){for(var i,e,t,r,s,n,o,a=1;Kr.length;)Kr.length>a&&Kr.sort(Sm),i=Kr.shift(),a=Kr.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),Vu(e.__P,t,r,e.__n,e.__P.namespaceURI,32&r.__u?[s]:null,n,s??Ns(r),!!(32&r.__u),o),t.__v=r.__v,t.__.__k[t.__i]=t,Cm(n,t,o),t.__e!=s&&xm(t)));Va.__r=0}function Am(i,e,t,r,s,n,o,a,l,c,d){var f,y,v,k,P,F,R=r&&r.__k||Em,D=e.length;for(l=pS(t,e,R,l,D),f=0;f<D;f++)(v=t.__k[f])!=null&&(y=v.__i===-1?qn:R[v.__i]||qn,v.__i=f,F=Vu(i,v,y,s,n,o,a,l,c,d),k=v.__e,v.ref&&y.ref!=v.ref&&(y.ref&&ju(y.ref,null,v),d.push(v.ref,v.__c||k,v)),P==null&&k!=null&&(P=k),4&v.__u||y.__k===v.__k?l=Pm(v,l,i):typeof v.type=="function"&&F!==void 0?l=F:k&&(l=k.nextSibling),v.__u&=-7);return t.__e=P,l}function pS(i,e,t,r,s){var n,o,a,l,c,d=t.length,f=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?$n(null,o,null,null,null):jn(o)?$n(Mt,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?$n(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=fS(o,t,l,f))!==-1&&(f--,(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(f)for(n=0;n<d;n++)(a=t[n])!=null&&!(2&a.__u)&&(a.__e==r&&(r=Ns(a)),_m(a,a));return r}function Pm(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=Pm(r[s],e,t));return e}i.__e!=e&&(e&&i.type&&!t.contains(e)&&(e=Ns(i)),t.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ki(i,e){return e=e||[],i==null||typeof i=="boolean"||(jn(i)?i.some(function(t){ki(t,e)}):e.push(i)),e}function fS(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 vm(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||dS.test(e)?t:t+"px"}function qa(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||vm(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||vm(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(Tm,"$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=$u,i.addEventListener(e,n?Hu:zu,n)):i.removeEventListener(e,n?Hu:zu,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 bm(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.u==null)e.u=$u++;else if(e.u<t.t)return;return t(Te.event?Te.event(e):e)}}}function Vu(i,e,t,r,s,n,o,a,l,c){var d,f,y,v,k,P,F,R,D,V,M,$,z,G,K,Q,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,V=(d=Y.contextType)&&r[d.__c],M=d?V?V.props.value:d.__:r,t.__c?F=(f=e.__c=t.__c).__=f.__E:(D?e.__c=f=new Y(R,M):(e.__c=f=new dt(R,M),f.constructor=Y,f.render=gS),V&&V.sub(f),f.props=R,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&&Y.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Ei({},f.__s)),Ei(f.__s,Y.getDerivedStateFromProps(R,f.__s))),v=f.props,k=f.state,f.__v=e,y)D&&Y.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),D&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(D&&Y.getDerivedStateFromProps==null&&R!==v&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(R,M),!f.__e&&(f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(R,f.__s,M)===!1||e.__v==t.__v)){for(e.__v!=t.__v&&(f.props=R,f.state=f.__s,f.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(re){re&&(re.__=e)}),$=0;$<f._sb.length;$++)f.__h.push(f._sb[$]);f._sb=[],f.__h.length&&o.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(R,f.__s,M),D&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(v,k,P)})}if(f.context=M,f.props=R,f.__P=i,f.__e=!1,z=Te.__r,G=0,D){for(f.state=f.__s,f.__d=!1,z&&z(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,z&&z(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=Ei(Ei({},r),f.getChildContext())),D&&!y&&f.getSnapshotBeforeUpdate!=null&&(P=f.getSnapshotBeforeUpdate(v,k)),Q=d,d!=null&&d.type===Mt&&d.key==null&&(Q=Fm(d.props.children)),a=Am(i,jn(Q)?Q:[Q],e,t,r,s,n,o,a,l,c),f.base=e.__e,e.__u&=-161,f.__h.length&&o.push(f),F&&(f.__E=f.__=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--;)qu(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=mS(t.__e,e,t,r,s,n,o,l,c);return(d=Te.diffed)&&d(e),128&e.__u?void 0:a}function Cm(i,e,t){for(var r=0;r<t.length;r++)ju(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 Fm(i){return typeof i!="object"||i==null?i:jn(i)?i.map(Fm):Ei({},i)}function mS(i,e,t,r,s,n,o,a,l){var c,d,f,y,v,k,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&&Vn.call(i.childNodes),F=t.props||qn,!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")f=v;else if(!(c in R)){if(c=="value"&&"defaultValue"in R||c=="checked"&&"defaultChecked"in R)continue;qa(i,c,null,v,s)}}for(c in R)v=R[c],c=="children"?y=v:c=="dangerouslySetInnerHTML"?d=v:c=="value"?k=v:c=="checked"?P=v:a&&typeof v!="function"||F[c]===v||qa(i,c,v,F[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=""),Am(e.type==="template"?i.content:i,jn(y)?y:[y],e,t,r,D=="foreignObject"?"http://www.w3.org/1999/xhtml":s,n,o,n?n[0]:t.__k&&Ns(t,0),a,l),n!=null)for(c=n.length;c--;)qu(n[c]);a||(c="value",D=="progress"&&k==null?i.removeAttribute("value"):k!==void 0&&(k!==i[c]||D=="progress"&&!k||D=="option"&&k!==F[c])&&qa(i,c,k,F[c],s),c="checked",P!==void 0&&P!==i[c]&&qa(i,c,P,F[c],s))}return i}function ju(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 _m(i,e,t){var r,s;if(Te.unmount&&Te.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||ju(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]&&_m(r[s],e,t||typeof i.type!="function");t||qu(i.__e),i.__c=i.__=i.__e=void 0}function gS(i,e,t){return this.constructor(i,t)}function Wu(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=[],Vu(e,i=(!r&&t||e).__k=u(Mt,null,[i]),s||qn,qn,e.namespaceURI,!r&&t?[t]:s?null:e.firstChild?Vn.call(e.childNodes):null,n,!r&&t?t:s?s.__e:e.firstChild,r,o),Cm(n,i,o)}function ja(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?Vn.call(arguments,2):t),$n(i.type,a,r||i.key,s||i.ref,null)}Vn=Em.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}},ym=0,uS=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),gm(this))},dt.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),gm(this))},dt.prototype.render=Mt,Kr=[],wm=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Sm=function(i,e){return i.__v.__b-e.__v.__b},Va.__r=0,Tm=/(PointerCapture)$|Capture$/i,$u=0,zu=bm(!1),Hu=bm(!0),hS=0;function Wn(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function vS(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):Wn(i)?i:null}var Om=vS;function bS(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}var Wa=bS;var gr=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 $r([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 Rm(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var yS=0;function wS(i){return"__private_"+yS+++"_"+i}function SS(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 Gn=wS("updateUI"),Gu=class i extends gr{constructor(){super(...arguments),Object.defineProperty(this,Gn,{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=Om(e);if(s){this.isTargetDOMEl=!0;let a=document.createElement("div");return a.classList.add("uppy-Root"),Rm(this,Gn)[Gn]=SS(l=>{this.uppy.getPlugin(this.id)&&(Wu(this.render(l,a),a),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),Wu(this.render(this.uppy.getState(),a),a),this.el=a,s.appendChild(a),a.dir=this.opts.direction||Wa(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=Rm(this,Gn))[Gn])==null||t.call(r,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},di=Gu;function Ga(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 eh=Fe(wt(),1);function Kn(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 Zu=Fe(wt(),1),Yu=Fe(Ba(),1);function Ku(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 Xu(i){let e=Ku(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 TS="\xB7",Lm=()=>` ${TS} `;function Mm(i){let{newFiles:e,isUploadStarted:t,recoveredState:r,i18n:s,uploadState:n,isSomeGhost:o,startUpload:a}=i,l=(0,Zu.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 Im(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 Nm(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 Bm(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 Um(){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 zm(i){let{progress:e}=i,{value:t,mode:r,message:s}=e;return u("div",{className:"uppy-StatusBar-content"},u(Um,null),r==="determinate"?`${Math.round(t*100)}% \xB7 `:"",s)}function ES(i){let{numUploads:e,complete:t,totalUploadedSize:r,totalSize:s,totalETA:n,i18n:o}=i,a=e>1,l=(0,Yu.default)(r);return u("div",{className:"uppy-StatusBar-statusSecondary"},a&&o("filesUploadedOfTotal",{complete:t,smart_count:e}),u("span",{className:"uppy-StatusBar-additionalInfo"},a&&Lm(),s!=null?o("dataUploadedOfTotal",{complete:l,total:(0,Yu.default)(s)}):o("dataUploadedOfUnknown",{complete:l}),Lm(),n!=null&&o("xTimeLeft",{time:Xu(n)})))}function Hm(i){let{i18n:e,complete:t,numUploads:r}=i;return u("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:r}))}function kS(i){let{i18n:e,newFiles:t,startUpload:r}=i,s=(0,Zu.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 $m(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:k}=i,P=l&&n;if(!n||o)return null;let F=e(a?"paused":"uploading");function R(){return!a&&!P&&s?t?u(ES,{numUploads:c,complete:d,totalUploadedSize:f,totalSize:y,totalETA:v,i18n:e}):u(Hm,{i18n:e,complete:d,numUploads:c}):null}return u("div",{className:"uppy-StatusBar-content","aria-label":F,title:F},a?null:u(Um,null),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t&&r!==0?`${F}: ${r}%`:F),R(),P?u(kS,{i18n:e,newFiles:l,startUpload:k}):null))}function qm(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 Vm(i){let{error:e,i18n:t,complete:r,numUploads:s}=i;function n(){let o=`${t("uploadFailed")}
|
68
93
|
|
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(dm,{i18n:t,complete:r,numUploads:s})))}var{STATE_ERROR:gm,STATE_WAITING:s1,STATE_PREPROCESSING:du,STATE_UPLOADING:Na,STATE_POSTPROCESSING:pu,STATE_COMPLETE:Ba}=It;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:F=!1,isSomeGhost:R,doneButtonHandler:D=void 0,isUploadStarted:V,i18n:M,startUpload:$,uppy:z,isAllComplete:G,showProgressDetails:K=void 0,numUploads:Q,complete:ne,totalSize:Y,totalETA:re,totalUploadedSize:le}=i;function ke(){switch(y){case pu:case du:{let He=Hn(x);return He.mode==="determinate"?He.value*100:v}case gm:return null;case Na:return P?v:null;default:return v}}function We(){switch(y){case pu:case du:{let{mode:He}=Hn(x);return He==="indeterminate"}case Na:return!P;default:return!1}}let T=ke(),k=T??100,A=!o&&e&&(!r&&!s||f)&&t&&!a,H=!c&&y!==s1&&y!==Ba,j=n&&!l&&y===Na,U=o&&!G&&!d,J=D&&y===Ba,ee=(0,fu.default)("uppy-StatusBar-progress",{"is-indeterminate":We()}),Ae=(0,fu.default)("uppy-StatusBar",`is-${y}`,{"has-ghosts":R}),oe=(()=>{switch(y){case du:case pu:return u(hm,{progress:Hn(x)});case Ba:return u(fm,{i18n:M});case gm:return u(mm,{error:o,i18n:M,numUploads:Q,complete:ne});case Na:return u(pm,{i18n:M,supportsUploadProgress:P,totalProgress:v,showProgressDetails:K,isUploadStarted:V,isAllComplete:G,isAllPaused:s,newFiles:e,numUploads:Q,complete:ne,totalUploadedSize:le,totalSize:Y,totalETA:re,startUpload:$});default:return null}})();return!(A||U||j||H||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":T}),oe,u("div",{className:"uppy-StatusBar-actions"},A?u(nm,{newFiles:e,isUploadStarted:V,recoveredState:f,i18n:M,isSomeGhost:R,startUpload:$,uploadState:y}):null,U?u(om,{i18n:M,uppy:z}):null,j?u(lm,{isAllPaused:s,i18n:M,isAllComplete:G,resumableUploads:n,uppy:z}):null,H?u(am,{i18n:M,uppy:z}):null,J?u(cm,{i18n:M,doneButtonHandler:D}):null))}var vm={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 _e(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var n1=0;function Rs(i){return"__private_"+n1+++"_"+i}var o1={version:"4.1.2"},a1=2e3,l1=2e3;function c1(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 u1={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"),gu=Rs("computeSmoothETA"),$n=Rs("onUploadStart"),Vr=class extends ui{constructor(e,t){super(e,{...u1,...t}),Object.defineProperty(this,gu,{value:h1}),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(_e(this,ji)[ji]=null,_e(this,Dt)[Dt]=null,r){_e(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}_e(this,Kt)[Kt]=performance.now(),_e(this,hi)[hi]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=vm,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(),F=a?Object.values(r):l,R=!!t.resumableUploads,D=t.uploadProgress!==!1,V=null,M=0;c.every(z=>z.progress.bytesTotal!=null&&z.progress.bytesTotal!==0)?(V=0,c.forEach(z=>{V+=z.progress.bytesTotal||0,M+=z.progress.bytesUploaded||0})):c.forEach(z=>{M+=z.progress.bytesUploaded||0});let $=_e(this,gu)[gu]({uploaded:M,total:V});return mu({error:o,uploadState:c1(o,y,a,e.files||{}),allowNewUpload:s,totalProgress:n,totalSize:V,totalUploadedSize:M,isAllComplete:!1,isAllPaused:v,isUploadStarted:f,isUploadInProgress:x,isSomeGhost:P,recoveredState:a,complete:d.length,newFiles:F.length,numUploads:c.length,totalETA:$,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",_e(this,$n)[$n]),_e(this,Kt)[Kt]=performance.now(),_e(this,hi)[hi]=this.uppy.getFiles().reduce((t,r)=>t+r.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",_e(this,$n)[$n])}};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=_e(this,Kt))[Kt])!=null||(e[Kt]=performance.now());let s=performance.now()-_e(this,Kt)[Kt];if(s===0){var n;return Math.round(((n=_e(this,Dt)[Dt])!=null?n:0)/100)/10}let o=i.uploaded-_e(this,hi)[hi];if(_e(this,hi)[hi]=i.uploaded,o<=0){var a;return Math.round(((a=_e(this,Dt)[Dt])!=null?a:0)/100)/10}let l=o/s,c=_e(this,ji)[ji]==null?l:Ia(l,_e(this,ji)[ji],a1,s);_e(this,ji)[ji]=c;let d=r/c,f=Math.max(_e(this,Dt)[Dt]-s,0),y=_e(this,Dt)[Dt]==null?d:Ia(d,f,l1,s);return _e(this,Dt)[Dt]=y,_e(this,Kt)[Kt]=performance.now(),Math.round(y/100)/10}Vr.VERSION=o1.version;var bm=300,qn=class extends dt{constructor(){super(...arguments),this.ref=Xf()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,bm)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,bm)}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 Vn(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,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: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=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=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[F,R]=P;if(!R)return;let D=f1(this,F);return La(r(R),{ref:D,key:F})}).filter(Boolean);return u(f,y,x)}};Ua.defaultProps={component:"span",childFactory:g1};var ym=Ua;var v1={version:"4.2.1"},jr=class extends ui{constructor(e,t){super(e,t),this.render=r=>u("div",{className:"uppy uppy-Informer"},u(ym,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}
|
94
|
+
${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(Hm,{i18n:t,complete:r,numUploads:s})))}var{STATE_ERROR:jm,STATE_WAITING:xS,STATE_PREPROCESSING:Qu,STATE_UPLOADING:Xa,STATE_POSTPROCESSING:Ju,STATE_COMPLETE:Ya}=It;function th(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:k,supportsUploadProgress:P,hideAfterFinish:F=!1,isSomeGhost:R,doneButtonHandler:D=void 0,isUploadStarted:V,i18n:M,startUpload:$,uppy:z,isAllComplete:G,showProgressDetails:K=void 0,numUploads:Q,complete:ne,totalSize:Y,totalETA:re,totalUploadedSize:le}=i;function xe(){switch(y){case Ju:case Qu:{let He=Kn(k);return He.mode==="determinate"?He.value*100:v}case jm:return null;case Xa:return P?v:null;default:return v}}function We(){switch(y){case Ju:case Qu:{let{mode:He}=Kn(k);return He==="indeterminate"}case Xa:return!P;default:return!1}}let E=xe(),x=E??100,A=!o&&e&&(!r&&!s||f)&&t&&!a,H=!c&&y!==xS&&y!==Ya,j=n&&!l&&y===Xa,U=o&&!G&&!d,J=D&&y===Ya,ee=(0,eh.default)("uppy-StatusBar-progress",{"is-indeterminate":We()}),Ae=(0,eh.default)("uppy-StatusBar",`is-${y}`,{"has-ghosts":R}),oe=(()=>{switch(y){case Qu:case Ju:return u(zm,{progress:Kn(k)});case Ya:return u(qm,{i18n:M});case jm:return u(Vm,{error:o,i18n:M,numUploads:Q,complete:ne});case Xa:return u($m,{i18n:M,supportsUploadProgress:P,totalProgress:v,showProgressDetails:K,isUploadStarted:V,isAllComplete:G,isAllPaused:s,newFiles:e,numUploads:Q,complete:ne,totalUploadedSize:le,totalSize:Y,totalETA:re,startUpload:$});default:return null}})();return!(A||U||j||H||J)&&!oe||y===Ya&&F?null:u("div",{className:Ae},u("div",{className:ee,style:{width:`${x}%`},role:"progressbar","aria-label":`${x}%`,"aria-valuetext":`${x}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":E}),oe,u("div",{className:"uppy-StatusBar-actions"},A?u(Mm,{newFiles:e,isUploadStarted:V,recoveredState:f,i18n:M,isSomeGhost:R,startUpload:$,uploadState:y}):null,U?u(Im,{i18n:M,uppy:z}):null,j?u(Nm,{isAllPaused:s,i18n:M,isAllComplete:G,resumableUploads:n,uppy:z}):null,H?u(Dm,{i18n:M,uppy:z}):null,J?u(Bm,{i18n:M,doneButtonHandler:D}):null))}var Wm={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 AS=0;function Bs(i){return"__private_"+AS+++"_"+i}var PS={version:"4.1.2"},CS=2e3,FS=2e3;function _S(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 OS={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},Xt=Bs("lastUpdateTime"),pi=Bs("previousUploadedBytes"),Wi=Bs("previousSpeed"),Dt=Bs("previousETA"),ih=Bs("computeSmoothETA"),Xn=Bs("onUploadStart"),Xr=class extends di{constructor(e,t){super(e,{...OS,...t}),Object.defineProperty(this,ih,{value:RS}),Object.defineProperty(this,Xt,{writable:!0,value:void 0}),Object.defineProperty(this,pi,{writable:!0,value:void 0}),Object.defineProperty(this,Wi,{writable:!0,value:void 0}),Object.defineProperty(this,Dt,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,Xn,{writable:!0,value:()=>{let{recoveredState:r}=this.uppy.getState();if(Oe(this,Wi)[Wi]=null,Oe(this,Dt)[Dt]=null,r){Oe(this,pi)[pi]=Object.values(r.files).reduce((s,n)=>{let{progress:o}=n;return s+o.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Oe(this,Xt)[Xt]=performance.now(),Oe(this,pi)[pi]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Wm,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:k,isSomeGhost:P}=this.uppy.getObjectOfFilesPerState(),F=a?Object.values(r):l,R=!!t.resumableUploads,D=t.uploadProgress!==!1,V=null,M=0;c.every(z=>z.progress.bytesTotal!=null&&z.progress.bytesTotal!==0)?(V=0,c.forEach(z=>{V+=z.progress.bytesTotal||0,M+=z.progress.bytesUploaded||0})):c.forEach(z=>{M+=z.progress.bytesUploaded||0});let $=Oe(this,ih)[ih]({uploaded:M,total:V});return th({error:o,uploadState:_S(o,y,a,e.files||{}),allowNewUpload:s,totalProgress:n,totalSize:V,totalUploadedSize:M,isAllComplete:!1,isAllPaused:v,isUploadStarted:f,isUploadInProgress:k,isSomeGhost:P,recoveredState:a,complete:d.length,newFiles:F.length,numUploads:c.length,totalETA:$,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;Wa(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Oe(this,Xn)[Xn]),Oe(this,Xt)[Xt]=performance.now(),Oe(this,pi)[pi]=this.uppy.getFiles().reduce((t,r)=>t+r.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Oe(this,Xn)[Xn])}};function RS(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,Xt))[Xt])!=null||(e[Xt]=performance.now());let s=performance.now()-Oe(this,Xt)[Xt];if(s===0){var n;return Math.round(((n=Oe(this,Dt)[Dt])!=null?n:0)/100)/10}let o=i.uploaded-Oe(this,pi)[pi];if(Oe(this,pi)[pi]=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,Wi)[Wi]==null?l:Ga(l,Oe(this,Wi)[Wi],CS,s);Oe(this,Wi)[Wi]=c;let d=r/c,f=Math.max(Oe(this,Dt)[Dt]-s,0),y=Oe(this,Dt)[Dt]==null?d:Ga(d,f,FS,s);return Oe(this,Dt)[Dt]=y,Oe(this,Xt)[Xt]=performance.now(),Math.round(y/100)/10}Xr.VERSION=PS.version;var Gm=300,Yn=class extends dt{constructor(){super(...arguments),this.ref=km()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,Gm)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,Gm)}render(){let{children:e}=this.props;return u("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function LS(i,e){return Object.assign(i,e)}function MS(i,e){var t;return(t=i?.key)!=null?t:e}function IS(i,e){let t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=r=>{i.refs[e]=r})}function Zn(i){let e={};for(let t=0;t<i.length;t++)if(i[t]!=null){let r=MS(i[t],t.toString(36));e[r]=i[t]}return e}function DS(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 NS=i=>i,Za=class extends dt{constructor(e,t){super(e,t),this.refs={},this.state={children:Zn(ki(ki(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=Zn(ki(e.children)||[]),r=this.state.children;this.setState(n=>({children:DS(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=Zn(ki(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=Zn(ki(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=Zn(ki(this.props.children)||[]);if(s&&s.hasOwnProperty(e))this.performEnter(e);else{let n=LS({},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,k=Object.entries(v).map(P=>{let[F,R]=P;if(!R)return;let D=IS(this,F);return ja(r(R),{ref:D,key:F})}).filter(Boolean);return u(f,y,k)}};Za.defaultProps={component:"span",childFactory:NS};var Km=Za;var BS={version:"4.2.1"},Yr=class extends di{constructor(e,t){super(e,t),this.render=r=>u("div",{className:"uppy uppy-Informer"},u(Km,null,r.info.map(s=>u(Yn,{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
95
|
|
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=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 wm=y1;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 Fm=typeof self<"u"?self:global,Kn=typeof navigator<"u",w1=Kn&&typeof HTMLImageElement>"u",Sm=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),_m=Fm.Buffer,Om=!!_m,S1=i=>i!==void 0;function Rm(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 Em(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),Tm=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),Tm?Tm.decode(s):Om?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 Xn=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())}},Wa=new Xn("file parser"),Nt=new Xn("segment parser"),Qn=new Xn("file reader"),E1=Fm.fetch;function xm(i,e){return(t=i).startsWith("data:")||t.length>1e4?Su(i,e,"base64"):Sm&&i.includes("://")?wu(i,e,"url",$a):Sm?Su(i,e,"fs"):Kn?wu(i,e,"url",$a):void it("Invalid input argument");var t}async function wu(i,e,t,r){return Qn.has(t)?Su(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 Su(i,e,t){let r=new(Qn.get(t))(i,e);return await r.read(),r}var $a=i=>E1(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 Lm(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 Mm(i,e,t){let r,s=i.get(e);for(r of t)s.set(r[0],r[1])}var Jn=new Map,Pu=new Map,Cu=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},km=new Map,Kr=class extends qa{static useCached(e){let t=km.get(e);return t!==void 0||(t=new this(e),km.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]=bu(e[t],St[t]);for(t of Ds)this[t]=bu(e[t],St[t]);for(t of Is)this[t]=bu(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=Am(e,r);for(let[o,a]of n)Va(this[o].pick,a),this[o].enabled=!0}else if(t&&t.length){let n=Am(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)&&yu("segment parser",e)}};function Am(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 bu(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"?xm(t,r):Kn&&!w1&&t instanceof HTMLImageElement?xm(t.src,r):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Gr(t):Kn&&t instanceof Blob?wu(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),Rm(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 Im(i,e){let t=new Ns(e);return await t.read(i),t.parse()}var T1=Object.freeze({__proto__:null,parse:Im,Exifr:Ns,fileParsers:Wa,segmentParsers:Nt,fileReaders:Qn,tagKeys:Jn,tagValues:Pu,tagRevivers:Cu,createDictionary:Lm,extendDictionary:Mm,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=Cu.get(t),s=Pu.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[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}};ve(fr,"headerLength",4),ve(fr,"type",void 0),ve(fr,"multiSegment",!1),ve(fr,"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 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: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=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(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=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 P1=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Tu=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=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}`)}}},Gn=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,Em(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,Em(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",Pm(...e.get(2),e.get(1))),e.set("longitude",Pm(...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],!Rm(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 Pm(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 eF=Object.freeze({__proto__:null,default:T1,Exifr:Ns,fileParsers:Wa,segmentParsers:Nt,fileReaders:Qn,tagKeys:Jn,tagValues:Pu,tagRevivers:Cu,createDictionary:Lm,extendDictionary:Mm,fetchUrlAsArrayBuffer:$a,readBlobAsArrayBuffer:Yn,chunkedProps:Ls,otherSegments:Ga,segments:Zn,tiffBlocks:Ve,segmentsAndBlocks:Ms,tiffExtractables:Is,inheritables:Ka,allFormatters:Ds,Options:Kr,parse:Im}),Fu={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},tF=Object.assign({},Fu,{firstChunkSize:4e4,gps:[1,2,3,4]});var iF=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 Ns(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}}),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 Dm(i){let e=await F1(i);return Object.assign({canvas:jn,css:Wn},_1[e])}var xu=class extends Gr{constructor(...e){super(...e),ve(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=Om?_m.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(){ve(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let s=e+t,n=this.list.filter(o=>Cm(e,o.offset,s)||Cm(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 Cm(i,e,t){return i<=e&&e<=t}var Au=class extends xu{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 Au{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 Nm={strings:{generatingThumbnails:"Generating thumbnails..."}};var O1={version:"4.1.1"};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(()=>wm(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},Bs=class extends ui{constructor(e,t){if(super(e,{...I1,...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=Nm,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=Dm(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 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=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"&&Un(i)?[i]:null}var _u=D1;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 Bm(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=>Bm(o,e)))})})},isSameEntry:void 0}}function Um(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*Um(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=Bm(o(),e)),{fileSystemHandle:n,lastResortFile:r.getAsFile()}}));for(let{lastResortFile:r,fileSystemHandle:s}of t)if(s!=null)try{yield*Um(s,"",r)}catch(n){r!=null?yield r:e(n)}else r!=null&&(yield r)}function Ru(i){let e=mr(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 mg=Fe(wt(),1);function eo(i){return{...i,type:i.mimeType,extension:i.name?Ur(i.name).extension:null}}var to,Ue,Mu,zm,io=0,Km=[],je=Ee,Hm=je.__b,$m=je.__r,qm=je.diffed,Vm=je.__c,jm=je.unmount,Wm=je.__;function Du(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,N1(Ym,i)}function N1(i,e,t){var r=Du(to++,2);if(r.t=i,!r.__c&&(r.__=[t?t(e):Ym(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 f=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]&&(f=!0)}}),n&&n.call(this,a,l,c)||f};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=Du(to++,3);!je.__s&&Xm(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=Du(to++,7);return Xm(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 B1(){for(var i;i=Km.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Ya),i.__H.__h.forEach(Iu),i.__H.__h=[]}catch(e){i.__H.__h=[],je.__e(e,i.__v)}}je.__b=function(i){Ue=null,Hm&&Hm(i)},je.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Wm&&Wm(i,e)},je.__r=function(i){$m&&$m(i),to=0;var e=(Ue=i.__c).__H;e&&(Mu===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(Iu),e.__h=[],to=0)),Mu=Ue},je.diffed=function(i){qm&&qm(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(Km.push(e)!==1&&zm===je.requestAnimationFrame||((zm=je.requestAnimationFrame)||U1)(B1)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),Mu=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.__||Iu(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],je.__e(r,t.__v)}}),Vm&&Vm(i,e)},je.unmount=function(i){jm&&jm(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 Gm=typeof requestAnimationFrame=="function";function U1(i){var e,t=function(){clearTimeout(r),Gm&&cancelAnimationFrame(e),setTimeout(i)},r=setTimeout(t,100);Gm&&(e=requestAnimationFrame(t))}function Ya(i){var e=Ue,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),Ue=e}function Iu(i){var e=Ue;i.__c=i.__(),Ue=e}function Xm(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}function Ym(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=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(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 Za(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 Zm=Fe(wt(),1);function Nu(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 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(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 Uu(i){return u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:(0,Zm.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 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 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))))}},Qa=Hu;var Qm=Fe(wt(),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 Us(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(Us,{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(Us,{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(Us,{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,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,Qm.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($u,d);case"list":return u(qu,d);case"unsplash":return u($u,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 X1(i){let{displayedPartialTree:e,viewType:t,toggleCheckbox:r,handleScroll:s,showTitles:n,i18n:o,isLoading:a,openFolder:l,noResultsLabel:c,virtualList:d,utmSource:f}=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(Vu,{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:f});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=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]},Jm=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]},eg=Z1;var Q1=i=>i.map(e=>({...e})),el=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=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=>{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},tg=J1;var Ku=Fe(rg(),1);var so=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Xu=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},sg=i=>globalThis.DOMException===void 0?new Xu(i):new DOMException(i),ng=i=>{let e=i.reason===void 0?sg("This operation was aborted."):i.reason;return e instanceof Error?e:sg(e)};function Yu(i,e){let{milliseconds:t,fallback:r,message:s,customTimers:n={setTimeout,clearTimeout}}=e,o,a,c=new Promise((d,f)=>{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&&f(ng(v)),a=()=>{f(ng(v))},v.addEventListener("abort",a,{once:!0})}if(t===Number.POSITIVE_INFINITY){i.then(d,f);return}let y=new so;o=n.setTimeout.call(void 0,()=>{if(r){try{d(r())}catch(v){f(v)}return}typeof i.cancel=="function"&&i.cancel(),s===!1?d():s instanceof Error?f(s):(y.message=s??`Promise timed out after ${t} milliseconds`,f(y))},t),(async()=>{try{d(await i)}catch(v){f(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 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 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=Zu(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 Ku.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.#T(),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.#T(),!0):!1}}return!1}#T(){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=Yu(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.#E("empty")}async onSizeLessThan(e){this.#n.size<e||await this.#E("next",()=>this.#n.size<e)}async onIdle(){this.#l===0&&this.#n.size===0||await this.#E("idle")}async#E(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 og=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(()=>og(i,e,f,r,s))})},iS=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(()=>og(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},ag=iS;var Qr={afterOpenFolder:Jm,afterScrollFolder:eg,afterToggleCheckbox:tg,afterFill:ag};var rS=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:r}=i.target;return e-(t+r)<50},il=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)}},Wi=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]},rl=nS;function oS(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=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: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 zs=oS;var cg=Fe(wt(),1);var aS=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,lg=aS;function ao(i){let{cancelSelection:e,donePicking:t,i18n:r,partialTree:s,validateAggregateRestrictions:n}=i,o=Yr(()=>n(s),[s,n]),a=Yr(()=>lg(s),[s]);return a===0?null:u("div",{className:"uppy-ProviderBrowser-footer"},u("div",{className:"uppy-ProviderBrowser-footer-buttons"},u("button",{className:(0,cg.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 lS=(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}}},ug=lS;var cS=(i,e,t)=>{let r=i.map(o=>ug(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=cS;var hg=(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=[...hg(i,s.parentId,t),s];return t[r]=n,n},uS=i=>{let e=Object.create(null);return i.filter(s=>s.type==="file"&&s.status==="checked").map(s=>{let n=hg(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=uS;var hS=(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},dg=hS;function gr(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var dS=0;function fg(i){return"__private_"+dS+++"_"+i}var pS={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 pg=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),Jr=fg("abortController"),pi=fg("withAbort"),Hs=class{constructor(e,t){Object.defineProperty(this,pi,{value:fS}),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(pg(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({...pg(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:f,searchString:y}=this.plugin.getPluginState(),v=dg(c,d);return u("div",{className:(0,mg.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(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 fS(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=pS.version;var gg=Fe(wt(),1);var mS={version:"4.4.2"},gS={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},vS={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={...vS,...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(gS)}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,gg.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=mS.version;var vg=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function bS(i,e){return!!(i===e||vg(i)&&vg(e))}function yS(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!bS(i[t],e[t]))return!1;return!0}function Qu(i,e){e===void 0&&(e=yS);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 bg(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function wS(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function SS(i){return i.contains(document.activeElement)}function Ju(i,e,t){let r=co(t,e),s=mr(r.querySelectorAll(ol)),n=s.indexOf(document.activeElement);SS(r)?i.shiftKey&&n===0?wS(i,s):!i.shiftKey&&n===s.length-1&&bg(i,s):bg(i,s)}function yg(i,e,t){e===null||Ju(i,e,t)}var wg=Fe($c(),1);function eh(){let i=!1;return(0,wg.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 Bg=Fe(wt(),1);function th(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var xg=Fe(wt(),1);function Sg(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 TS(){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 xS(){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 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:"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 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:"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 PS(){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 CS(){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 FS(){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:CS()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:FS()}:t==="image"?{color:"#686de0",icon:TS()}:t==="audio"?{color:"#068dbb",icon:xS()}:t==="video"?{color:"#19af67",icon:kS()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:AS()}: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:PS()}: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 _S=(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=>_S(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)":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 OS(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 Eg(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":Eg(i),title:Eg(i),onClick:()=>OS(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 Tg=Fe(Aa(),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 RS=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()))},LS=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},MS=i=>i.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},(0,Tg.default)(i.file.size)),IS=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"))),DS=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"},RS({file:e,isSingleFile:o,containerHeight:a,containerWidth:l}),u(DS,{file:e,onClick:()=>alert(e.error)})),u("div",{className:"uppy-Dashboard-Item-status"},LS({file:e}),MS({file:e}),IS({file:e,toggleAddFilesPanel:n,i18n:t})),u(ho,{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 NS(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 BS(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 US(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(NS,{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(US,{file:t,uppy:e,i18n:l}):null,a?u(BS,{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!Sg(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,xg.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 zS(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:F,individualCancellation:R,itemsPerRow:D,openFileEditor:V,canEditFile:M,toggleAddFilesPanel:$,containerWidth:z,containerHeight:G}=i,K=D===1?71:200,Q=Yr(()=>{let Y=(le,ke)=>Number(s[ke].isGhost)-Number(s[le].isGhost),re=Object.keys(s);return F&&re.sort(Y),zS(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:f,recoveredState:F,isSingleFile:y,containerWidth:z,containerHeight:G,toggleFileCard:v,handleRequestThumbnail:x,handleCancelThumbnail:P,role:"listitem",openFileEditor:V,canEditFile:M,toggleAddFilesPanel:$,file:s[re]})));return y?u("div",{class:"uppy-Dashboard-files"},ne(Q[0])):u(Qa,{class:"uppy-Dashboard-files",role:"list",data:Q,renderRow:ne,rowHeight:K})}var hh=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:f,elements:y}=d;return u(Mt,{key:f},y)}),u("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:f,elements:y}=d;return u(Mt,{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 kg=Fe(wt(),1);var HS=i=>u("div",{className:(0,kg.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)),Ag=HS;var Pg=Fe(wt(),1);function $S(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ai=$S;function qS(i){let{activePickerPanel:e,className:t,hideAllPanels:r,i18n:s,state:n,uppy:o}=i,a=Xr(null);return u("div",{className:(0,Pg.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 Cg=qS;var Fg=Fe(wt(),1);function VS(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return u("div",{className:(0,Fg.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 _g=VS;var Pi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function jS(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 WS(i){let{files:e,i18n:t,isAllComplete:r,isAllErrored:s,isAllPaused:n,inProgressNotPausedFiles:o,newFiles:a,processingFiles:l}=i;switch(jS(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 GS(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(WS,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 Og=GS;var Rg=Fe(wt(),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:[],F=y(x),R={};P.forEach(K=>{var Q;R[K.id]=(Q=x.meta[K.id])!=null?Q:""});let[D,V]=di(R),M=Zr(K=>{K.preventDefault(),n(D,r)},[n,D,r]),$=(K,Q)=>{V({...D,[Q]:K})},z=()=>{s(!1)},[G]=di(()=>{let K=document.createElement("form");return K.setAttribute("tabindex","-1"),K.id=dr(),K});return ki(()=>(document.body.appendChild(G),G.addEventListener("submit",M),()=>{G.removeEventListener("submit",M),document.body.removeChild(G)}),[G,M]),u("div",{className:(0,Rg.default)("uppy-Dashboard-FileCard",f),"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:G.id,title:c("finishEditingFile"),onClick:z},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=>{M(K),l(x)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(dh,{computedMetaFields:P,requiredMetaFields:a,updateMeta:$,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:z,form:G.id},c("cancel")))))}var Mg=Fe(wt(),1),qs="uppy-transition-slideDownUp",Lg=250;function KS(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("")},Lg)})},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("")},Lg)})};return ki(()=>{let f=xi(e)[0];t!==f&&(f&&!t?c():t&&!f&&!a.current&&d(),r(f))},[e,t]),ki(()=>()=>{clearTimeout(o.current),clearTimeout(a.current),cancelAnimationFrame(l.current)},[]),t?La(t,{className:(0,Mg.default)(s,t.props.className)}):null}var fo=KS;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 Ig=900,Dg=700,fh=576,Ng=330;function mh(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>fh,s=i.containerHeight>Ng,n=(0,Bg.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>Dg,"uppy-size--xl":i.containerWidth>Ig,"uppy-size--height-md":i.containerHeight>Ng,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&s}),o=1;i.containerWidth>Ig?o=5:i.containerWidth>Dg?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(Og,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(fo,null,i.showAddFilesPanel?u(Ag,Vs({key:"AddFiles"},i,{isSizeMD:r})):null),u(fo,null,i.fileCardFor?u(ph,Vs({key:"FileCard"},i)):null),u(fo,null,i.activePickerPanel?u(Cg,Vs({key:"Picker"},i)):null),u(fo,null,i.showFileEditor?u(_g,Vs({key:"Editor"},i)):null),u("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(y=>i.uppy.getPlugin(y.id).render(i.state))))))}var Ug={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 XS=0;function ct(i){return"__private_"+XS+++"_"+i}var YS={version:"4.3.2"},gh=Qu.default||Qu,zg=9,ZS=27;function Hg(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var QS={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"),vh=ct("isTargetSupported"),bh=ct("getAcquirers"),yh=ct("getProgressIndicators"),Ki=ct("getEditors"),wh=ct("addSpecifiedPluginsFromOptions"),Sh=ct("autoDiscoverPlugins"),rs=ct("addSupportedPluginIfNoTarget"),go=ct("getStatusBarOpts"),vo=ct("getThumbnailGeneratorOpts"),Eh=ct("getInformerOpts"),bo=ct("getStatusBarId"),yo=ct("getThumbnailGeneratorId"),Th=ct("getInformerId"),vr=class extends ui{constructor(e,t){var r,s,n;let o=(r=t?.autoOpen)!=null?r:null;super(e,{...QS,...t,autoOpen:o}),Object.defineProperty(this,Th,{value:sE}),Object.defineProperty(this,yo,{value:rE}),Object.defineProperty(this,bo,{value:iE}),Object.defineProperty(this,Eh,{value:tE}),Object.defineProperty(this,vo,{value:eE}),Object.defineProperty(this,go,{value:JS}),Object.defineProperty(this,ts,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${dr()}`,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,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}=Hg();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}=Hg();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(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,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===ZS&&this.requestCloseModal(),a.keyCode===zg&&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=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(),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===zg&&yg(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,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,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=_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,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,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,is)[is]))}),Object.defineProperty(this,yh,{writable:!0,value:gh(a=>a.filter(l=>l.type==="progressindicator").map(de(this,is)[is]))}),Object.defineProperty(this,Ki,{writable:!0,value:gh(a=>a.filter(l=>l.type==="editor").map(de(this,is)[is]))}),this.render=a=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:f}=a,{newFiles:y,uploadStartedFiles:v,completeFiles:x,erroredFiles:P,inProgressFiles:F,inProgressNotPausedFiles:R,processingFiles:D,isUploadStarted:V,isAllComplete:M,isAllPaused:$}=this.uppy.getObjectOfFilesPerState(),z=de(this,bh)[bh](l.targets),G=de(this,yh)[yh](l.targets),K=de(this,Ki)[Ki](l.targets),Q;return this.opts.theme==="auto"?Q=d.darkMode?"dark":"light":Q=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:F,inProgressNotPausedFiles:R,processingFiles:D,isUploadStarted:V,isAllComplete:M,isAllPaused:$,totalFileCount:Object.keys(c).length,totalProgress:a.totalProgress,allowNewUpload:f,acquirers:z,theme:Q,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,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(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(Vr,{id:de(this,bo)[bo](),target:this,...de(this,go)[go]()}),this.opts.disableInformer||this.uppy.use(jr,{id:de(this,Th)[Th](),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,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=Ug,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 JS(){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 eE(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r,lazy:!r}}function tE(){return{}}function iE(){return`${this.id}:StatusBar`}function rE(){return`${this.id}:ThumbnailGenerator`}function sE(){return`${this.id}:Informer`}vr.VERSION=YS.version;var Gg=Fe($g(),1);function nE(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 qg=nE;function oE(i){return i*(Math.PI/180)}function aE(i,e,t){let r=Math.abs(oE(t));return Math.max((Math.sin(r)*i+Math.cos(r)*e)/e,(Math.sin(r)*e+Math.cos(r)*i)/i)}var Vg=aE;function lE(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 jg=lE;function cE(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 Wg=cE;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=qg(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=Vg(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 Gg.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=jg(t,r,s);n&&this.cropper.setCropBoxData(n)}else{let n=Wg(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 Kg={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 uE={version:"3.3.1"},Xg={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},Yg={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},hE={quality:.8,actions:Yg,cropperOptions:Xg},ss=class extends ui{constructor(e,t){super(e,{...hE,...t,actions:{...Yg,...t?.actions},cropperOptions:{...Xg,...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=Kg,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=uE.version;function Xi(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var dE=0;function Zg(i){return"__private_"+dE+++"_"+i}var Tt=Zg("uppy"),So=Zg("events"),Eo=class{constructor(e){Object.defineProperty(this,Tt,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:[]}),Xi(this,Tt)[Tt]=e}on(e,t){return Xi(this,So)[So].push([e,t]),Xi(this,Tt)[Tt].on(e,t)}remove(){for(let[e,t]of Xi(this,So)[So].splice(0))Xi(this,Tt)[Tt].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,Tt)[Tt].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{Xi(this,Tt)[Tt].getFile(e)&&t()})}onCancelAll(e,t){var r=this;this.on("cancel-all",function(){Xi(r,Tt)[Tt].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{Xi(this,Tt)[Tt].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 pE=0;function Ft(i){return"__private_"+pE+++"_"+i}function fE(i){return new Error("Cancelled",{cause:i})}function Qg(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"),To=Ft("call"),Zi=Ft("queueNext"),Ch=Ft("next"),Ah=Ft("queue"),Fh=Ft("dequeue"),Ph=Ft("resume"),as=Ft("increaseLimit"),ul=class{constructor(e){Object.defineProperty(this,Fh,{value:yE}),Object.defineProperty(this,Ah,{value:bE}),Object.defineProperty(this,Ch,{value:vE}),Object.defineProperty(this,Zi,{value:gE}),Object.defineProperty(this,To,{value:mE}),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,Ph,{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,To)[To](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:Qg,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=fE(v)}},t)});return l.abort=c=>{a.abort(c)},l.abortOn=Qg,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,Ph)[Ph],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 mE(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 gE(){queueMicrotask(()=>te(this,Ch)[Ch]())}function vE(){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,To)[To](i.fn);i.abort=e.abort,i.done=e.done}function bE(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,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 yE(i){let e=te(this,kt)[kt].indexOf(i);e!==-1&&te(this,kt)[kt].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}},xo=_h;function wE(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}var Jg=wE;function Xt(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var SE=0;function dl(i){return"__private_"+SE+++"_"+i}var Qi=dl("aliveTimer"),ls=dl("isDone"),ko=dl("onTimedOut"),cs=dl("timeout"),Oh=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)}},ev=Oh;var pl=()=>{};function tv(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,F=new ev(v,c);function R(D){return D===void 0&&(D=0),new Promise(async(V,M)=>{let $=new XMLHttpRequest,z=G=>{a($)&&D<f?setTimeout(()=>{R(D+1).then(V,M)},P(D)):(F.done(),M(G))};$.open(s,i,!0),$.withCredentials=x,d&&($.responseType=d),y?.addEventListener("abort",()=>{$.abort(),M(new DOMException("Aborted","AbortError"))}),$.onload=async()=>{try{await l($,D)}catch(G){G.request=$,z(G);return}$.status>=200&&$.status<300?(F.done(),V($)):a($)&&D<f?setTimeout(()=>{R(D+1).then(V,M)},P(D)):(F.done(),M(new xo($.statusText,$)))},$.onerror=()=>z(new xo($.statusText,$)),$.upload.onprogress=G=>{F.progress(),o(G)},r&&Object.keys(r).forEach(G=>{$.setRequestHeader(G,r[G])}),await n($,D),$.send(t)})}return R()}function iv(i){let e=t=>"error"in t&&!!t.error;return i.filter(t=>!e(t))}function rv(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 sv={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 EE=0;function Ws(i){return"__private_"+EE+++"_"+i}var TE={version:"4.3.3"};function xE(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})),Jg(i)?(t=new xo(t,i),t):(t.request=i,t)}function nv(i){return i.data.slice(0,i.data.size,i.meta.type)}var kE={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""},us=Ws("getFetcher"),Mh=Ws("uploadLocalFile"),Rh=Ws("uploadBundle"),Ih=Ws("getCompanionClientArgs"),Lh=Ws("uploadFiles"),Ao=Ws("handleUpload"),js=class extends pr{constructor(e,t){if(super(e,{...kE,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,Lh,{value:FE}),Object.defineProperty(this,Ih,{value:CE}),Object.defineProperty(this,Rh,{value:PE}),Object.defineProperty(this,Mh,{value:AE}),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=iv(s),o=rv(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,Rh)[Rh](n)}else await Ji(this,Lh)[Lh](n)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=sv,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 f=await tv(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,f));if(f.responseType==="json"){var c;(c=y)!=null||(y=f.response)}else try{var d;(d=y)!=null||(y=JSON.parse(f.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:f.status,body:y,uploadURL:v});return f}catch(f){if(f.name==="AbortError")return;let y=f.request;for(let v of r)this.uppy.emit("upload-error",this.uppy.getFile(v.id),xE(y,f),y);throw f}}}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=nv(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=nv(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 AE(i){let e=new Eo(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 PE(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 CE(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 FE(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,Ih)[Ih](e),{signal:r.signal,getQueue:t});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",s)},{priority:-1})(),n}return Ji(this,Mh)[Mh](e)}))}js.VERSION=TE.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 _E(e)}}};function _E(i){return OE(i),ov(i),i}function OE(i){let e=i.querySelectorAll("script");for(let t of e)t.remove()}function RE(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 LE(i){let e=i.attributes;for(let{name:t,value:r}of e)RE(t,r)&&i.removeAttribute(t)}function ov(i){let e=i.children;for(let t of e)LE(t),ov(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">
|
96
|
+
${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)}};Yr.VERSION=BS.version;var US=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function zS(i,e,t){var r,s;let n=US.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 Xm=zS;function Qa(i){return i.startsWith("blob:")}function Ja(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 sg=typeof self<"u"?self:global,to=typeof navigator<"u",HS=to&&typeof HTMLImageElement>"u",Ym=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),ng=sg.Buffer,og=!!ng,$S=i=>i!==void 0;function ag(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter($S).length===0)}function st(i){let e=new Error(i);throw delete e.stack,e}function Zm(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 rh=i=>String.fromCharCode.apply(null,i),Qm=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,Qr=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&&st("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 st("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||st("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),Qm?Qm.decode(s):og?Buffer.from(s).toString("utf8"):decodeURIComponent(escape(rh(s)));var s}getLatin1String(e=0,t=this.byteLength){let r=this.getUint8Array(e,t);return rh(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 rh(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 nh(i,e){st(`${i} '${e}' was not loaded, try using full build of exifr.`)}var io=class extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||nh(this.kind,e),t&&(e in t||function(r,s){st(`Unknown ${r} '${s}'.`)}(this.kind,e),t[e].enabled||nh(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},sl=new io("file parser"),Nt=new io("segment parser"),no=new io("file reader"),qS=sg.fetch;function Jm(i,e){return(t=i).startsWith("data:")||t.length>1e4?ah(i,e,"base64"):Ym&&i.includes("://")?oh(i,e,"url",el):Ym?ah(i,e,"fs"):to?oh(i,e,"url",el):void st("Invalid input argument");var t}async function oh(i,e,t,r){return no.has(t)?ah(i,e,t):r?async function(s,n){let o=await n(s);return new Qr(o)}(i,r):void st(`Parser ${t} is not loaded`)}async function ah(i,e,t){let r=new(no.get(t))(i,e);return await r.read(),r}var el=i=>qS(i).then(e=>e.arrayBuffer()),ro=i=>new Promise((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result||new ArrayBuffer),r.onerror=t,r.readAsArrayBuffer(i)}),lh=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 lg(i,e,t){let r=new lh;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 cg(i,e,t){let r,s=i.get(e);for(r of t)s.set(r[0],r[1])}var oo=new Map,ph=new Map,fh=new Map,Us=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],nl=["jfif","xmp","icc","iptc","ihdr"],so=["tiff",...nl],Ve=["ifd0","ifd1","exif","gps","interop"],zs=[...so,...Ve],Hs=["makerNote","userComment"],ol=["translateKeys","translateValues","reviveValues","multiSegment"],$s=[...ol,"sanitize","mergeOutput","silentErrors"],tl=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},Zr=class extends tl{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=oo.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:st(`Invalid options argument: ${r}`)}applyInheritables(e){let t,r;for(t of ol)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,il(this.pick,this.deps)):this.enabled&&this.pick.size>0&&il(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},eg=new Map,Jr=class extends tl{static useCached(e){let t=eg.get(e);return t!==void 0||(t=new this(e),eg.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):st(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=to?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Us)this[e]=St[e];for(e of $s)this[e]=St[e];for(e of Hs)this[e]=St[e];for(e of zs)this[e]=new Zr(e,St[e],void 0,this)}setupFromTrue(){let e;for(e of Us)this[e]=St[e];for(e of $s)this[e]=St[e];for(e of Hs)this[e]=!0;for(e of zs)this[e]=new Zr(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Us)this[t]=St[t];for(t of $s)this[t]=St[t];for(t of Hs)this[t]=St[t];for(t of zs)this[t]=new Zr(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),Us))this[t]=sh(e[t],St[t]);for(t of $s)this[t]=sh(e[t],St[t]);for(t of Hs)this[t]=sh(e[t],St[t]);for(t of so)this[t]=new Zr(t,St[t],e[t],this);for(t of Ve)this[t]=new Zr(t,St[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ve,zs),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=tg(e,r);for(let[o,a]of n)il(this[o].pick,a),this[o].enabled=!0}else if(t&&t.length){let n=tg(t,r);for(let[o,a]of n)il(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!nl.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of so)this[e].enabled&&!Nt.has(e)&&nh("segment parser",e)}};function tg(i,e){let t,r,s,n,o=[];for(s of e){for(n of(t=oo.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 sh(i,e){return i!==void 0?i:e!==void 0?e:void 0}function il(i,e){for(let t of e)i.add(t)}ve(Jr,"default",St);var qs=class{constructor(e){ve(this,"parsers",{}),ve(this,"output",{}),ve(this,"errors",[]),ve(this,"pushToErrors",t=>this.errors.push(t)),this.options=Jr.useCached(e)}async read(e){this.file=await function(t,r){return typeof t=="string"?Jm(t,r):to&&!HS&&t instanceof HTMLImageElement?Jm(t.src,r):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Qr(t):to&&t instanceof Blob?oh(t,r,"blob",ro):void st("Invalid input argument")}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[r,s]of sl)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(),st("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),ag(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 ug(i,e){let t=new qs(e);return await t.read(i),t.parse()}var VS=Object.freeze({__proto__:null,parse:ug,Exifr:qs,fileParsers:sl,segmentParsers:Nt,fileReaders:no,tagKeys:oo,tagValues:ph,tagRevivers:fh,createDictionary:lg,extendDictionary:cg,fetchUrlAsArrayBuffer:el,readBlobAsArrayBuffer:ro,chunkedProps:Us,otherSegments:nl,segments:so,tiffBlocks:Ve,segmentsAndBlocks:zs,tiffExtractables:Hs,inheritables:ol,allFormatters:$s,Options:Jr}),vr=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 Jr({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Qr?e:new Qr(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=fh.get(t),s=ph.get(t),n=oo.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}};ve(vr,"headerLength",4),ve(vr,"type",void 0),ve(vr,"multiSegment",!1),ve(vr,"canHandle",()=>!1);function jS(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function WS(i){return i>=224&&i<=239}function GS(i,e,t){for(let[r,s]of Nt)if(s.canHandle(i,e,t))return r}var rl=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){st(`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):st("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:f,remaining:y,options:v}=this;for(;e<t;e++)if(c.getUint8(e)===255){if(r=c.getUint8(e+1),WS(r)){if(s=c.getUint16(e+2),n=GS(c,e,s),n&&f.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=vr.findPosition(c,e),a.marker=r,this.unknownSegments.push(a)),e+=s+1}else if(jS(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(rl,"type","jpeg"),sl.set("jpeg",rl);var KS=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],ch=class extends vr{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=KS[n];if(a*o<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&st(`Invalid TIFF value type. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&st(`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:st(`Invalid tiff type ${e}`)}}},eo=class extends ch{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&&st("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&st(`IFD0 offset points to outside of file.
|
97
|
+
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,Zm(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,Zm(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",ig(...e.get(2),e.get(1))),e.set("longitude",ig(...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],!ag(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 ig(i,e,t,r){var s=i+e/60+t/3600;return r!=="S"&&r!=="W"||(s*=-1),s}ve(eo,"type","tiff"),ve(eo,"headerLength",10),Nt.set("tiff",eo);var iF=Object.freeze({__proto__:null,default:VS,Exifr:qs,fileParsers:sl,segmentParsers:Nt,fileReaders:no,tagKeys:oo,tagValues:ph,tagRevivers:fh,createDictionary:lg,extendDictionary:cg,fetchUrlAsArrayBuffer:el,readBlobAsArrayBuffer:ro,chunkedProps:Us,otherSegments:nl,segments:so,tiffBlocks:Ve,segmentsAndBlocks:zs,tiffExtractables:Hs,inheritables:ol,allFormatters:$s,Options:Jr,parse:ug}),mh={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},rF=Object.assign({},mh,{firstChunkSize:4e4,gps:[1,2,3,4]});var sF=Object.assign({},mh,{tiff:!1,ifd1:!0,mergeOutput:!1});var XS=Object.assign({},mh,{firstChunkSize:4e4,ifd0:[274]});async function YS(i){let e=new qs(XS);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}var ZS=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}}),Qn=!0,Jn=!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;Qn=Number(t)+.1*Number(r)<13.4,Jn=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Qn=Jn=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Qn=Jn=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Qn=Jn=Number(e)<77}}async function hg(i){let e=await YS(i);return Object.assign({canvas:Qn,css:Jn},ZS[e])}var uh=class extends Qr{constructor(...e){super(...e),ve(this,"ranges",new hh),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=og?ng.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)}},hh=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=>rg(e,o.offset,s)||rg(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 rg(i,e,t){return i<=e&&e<=t}var dh=class extends uh{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(){}};no.set("blob",class extends dh{async readWhole(){this.chunked=!1;let i=await ro(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 ro(r);return this.set(s,i,!0)}});var dg={strings:{generatingThumbnails:"Generating thumbnails..."}};var QS={version:"4.1.1"};function JS(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(()=>Xm(i.toDataURL(e,t),{})).then(r=>{if(r===null)throw new Error("could not extract blob, probably an old browser");return r})}function eT(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 tT(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 iT={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},Vs=class extends di{constructor(e,t){if(super(e,{...iT,...t}),this.onFileAdded=r=>{!r.preview&&r.data&&Ja(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&&Qa(r.preview)&&URL.revokeObjectURL(r.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(s=>s.isRestored).forEach(s=>{(!s.preview||Qa(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=dg,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=hg(e.data).catch(()=>1);return Promise.all([n,o]).then(a=>{let[l,c]=a,d=this.getProportionalDimensions(l,t,r,c.deg),f=eT(l,c),y=this.resizeImage(f,d.width,d.height);return JS(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=tT(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 Ja(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)}};Vs.VERSION=QS.version;function rT(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&Wn(i)?[i]:null}var gh=rT;var br=Array.from;function al(i,e,t,r){let{onSuccess:s}=r;i.readEntries(n=>{let o=[...e,...n];n.length?queueMicrotask(()=>{al(i,o,t,{onSuccess:s})}):s(o)},n=>{t(n),s(e)})}function pg(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=>{al(t,[],e,{onSuccess:n=>s(n.map(o=>pg(o,e)))})})},isSameEntry:void 0}}function fg(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*fg(s,e?r():i.name);else t!=null&&(yield t)}()}catch(r){return Promise.reject(r)}}async function*vh(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=pg(o(),e)),{fileSystemHandle:n,lastResortFile:r.getAsFile()}}));for(let{lastResortFile:r,fileSystemHandle:s}of t)if(s!=null)try{yield*fg(s,"",r)}catch(n){r!=null?yield r:e(n)}else r!=null&&(yield r)}function bh(i){let e=br(i.files);return Promise.resolve(e)}async function yh(i,e){var t;let r=(t=e?.logDropError)!=null?t:Function.prototype;try{let s=[];for await(let n of vh(i,r))s.push(n);return s}catch{return bh(i)}}var Vg=Fe(wt(),1);function ao(i){return{...i,type:i.mimeType,extension:i.name?Vr(i.name).extension:null}}var lo,ze,wh,mg,co=0,Eg=[],je=Te,gg=je.__b,vg=je.__r,bg=je.diffed,yg=je.__c,wg=je.unmount,Sg=je.__;function Th(i,e){je.__h&&je.__h(ze,i,co||e),co=0;var t=ze.__H||(ze.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function fi(i){return co=1,sT(xg,i)}function sT(i,e,t){var r=Th(lo++,2);if(r.t=i,!r.__c&&(r.__=[t?t(e):xg(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.__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 f=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]&&(f=!0)}}),n&&n.call(this,a,l,c)||f};ze.__f=!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 xi(i,e){var t=Th(lo++,3);!je.__s&&kg(t.__H,e)&&(t.__=i,t.u=e,ze.__H.__h.push(t))}function es(i){return co=5,ts(function(){return{current:i}},[])}function ts(i,e){var t=Th(lo++,7);return kg(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function is(i,e){return co=8,ts(function(){return i},e)}function nT(){for(var i;i=Eg.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(ll),i.__H.__h.forEach(Sh),i.__H.__h=[]}catch(e){i.__H.__h=[],je.__e(e,i.__v)}}je.__b=function(i){ze=null,gg&&gg(i)},je.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Sg&&Sg(i,e)},je.__r=function(i){vg&&vg(i),lo=0;var e=(ze=i.__c).__H;e&&(wh===ze?(e.__h=[],ze.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(ll),e.__h.forEach(Sh),e.__h=[],lo=0)),wh=ze},je.diffed=function(i){bg&&bg(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(Eg.push(e)!==1&&mg===je.requestAnimationFrame||((mg=je.requestAnimationFrame)||oT)(nT)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),wh=ze=null},je.__c=function(i,e){e.some(function(t){try{t.__h.forEach(ll),t.__h=t.__h.filter(function(r){return!r.__||Sh(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],je.__e(r,t.__v)}}),yg&&yg(i,e)},je.unmount=function(i){wg&&wg(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{ll(r)}catch(s){e=s}}),t.__H=void 0,e&&je.__e(e,t.__v))};var Tg=typeof requestAnimationFrame=="function";function oT(i){var e,t=function(){clearTimeout(r),Tg&&cancelAnimationFrame(e),setTimeout(i)},r=setTimeout(t,100);Tg&&(e=requestAnimationFrame(t))}function ll(i){var e=ze,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),ze=e}function Sh(i){var e=ze;i.__c=i.__(),ze=e}function kg(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}function xg(i,e){return typeof e=="function"?e(i):e}function aT(){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 lT(i){let{pluginName:e,i18n:t,onAuth:r}=i,s=e==="Google Drive",n=is(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(aT,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 cT=i=>{let{pluginName:e,i18n:t,onAuth:r}=i;return u(lT,{pluginName:e,i18n:t,onAuth:r})};function cl(i){let{loading:e,pluginName:t,pluginIcon:r,i18n:s,handleAuth:n,renderForm:o=cT}=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 Ag=Fe(wt(),1);function Eh(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 kh(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 xh(i){return u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:(0,Ag.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&u(kh,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),u(Eh,{logout:i.logout,username:i.username,i18n:i.i18n})))}function Ah(){return Ah=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},Ah.apply(null,arguments)}var uT={position:"relative",width:"100%",minHeight:"100%"},hT={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Ph=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 f=c+d+4,y=t.slice(c,f),v={...uT,height:t.length*r},k={...hT,top:c*r};return u("div",Ah({onScroll:this.handleScroll},o),u("div",{role:"presentation",style:v},u("div",{role:"presentation",style:k},y.map(s))))}},ul=Ph;var Pg=Fe(wt(),1);function dT(){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 pT(){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 fT(){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 js(i){let{itemIconString:e,alt:t=void 0}=i;if(e===null)return null;switch(e){case"file":return u(dT,null);case"folder":return u(pT,null);case"video":return u(fT,null);default:return u("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function mT(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(js,{itemIconString:r.data.thumbnail||r.data.icon}),l&&((t=r.data.name)!=null?t:d("unnamed")),c))}var Ch=mT;function Fh(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(js,{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(js,{itemIconString:s.data.icon})),d&&((r=s.data.name)!=null?r:f("unnamed"))))}function _h(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,Pg.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(Ch,d);case"list":return u(Fh,d);case"unsplash":return u(Ch,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 gT(i){let{displayedPartialTree:e,viewType:t,toggleCheckbox:r,handleScroll:s,showTitles:n,i18n:o,isLoading:a,openFolder:l,noResultsLabel:c,virtualList:d,utmSource:f}=i,[y,v]=fi(!1);if(xi(()=>{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 k=P=>u(_h,{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:f});return d?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(ul,{data:e,renderRow:k,rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:s,role:"listbox",tabIndex:-1},e.map(k)))}var hl=gT;var vT=(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 k=s(v);return{type:"file",id:v.requestPath,restrictionError:k,status:a&&!k?"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]},Cg=vT;var bT=(i,e,t,r,s)=>{let n=i.find(k=>k.id===e),o=t.filter(k=>k.isFolder===!0),a=t.filter(k=>k.isFolder===!1),l={...n,nextPagePath:r},c=i.map(k=>k.id===l.id?l:k),d=l.type==="folder"&&l.status==="checked",f=o.map(k=>({type:"folder",id:k.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:k})),y=a.map(k=>{let P=s(k);return{type:"file",id:k.requestPath,restrictionError:P,status:d&&!P?"checked":"unchecked",parentId:l.id,data:k}});return[...c,...f,...y]},Fg=bT;var yT=i=>i.map(e=>({...e})),dl=yT;var Oh=(i,e,t)=>{i.filter(s=>s.type!=="root"&&s.parentId===e).forEach(s=>{s.status=t&&!(s.type==="file"&&s.restrictionError)?"checked":"unchecked",Oh(i,s.id,t)})},Rh=(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",Rh(i,t.parentId)},wT=(i,e)=>{let t=dl(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=>{Oh(t,s.id,!0)}),Rh(t,r[0].parentId)}else{let r=t.find(s=>s.id===e[0]);r.status=r.status==="checked"?"unchecked":"checked",Oh(t,r.id,r.status==="checked"),Rh(t,r.parentId)}return t},_g=wT;var Mh=Fe(Rg(),1);var ho=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Ih=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Lg=i=>globalThis.DOMException===void 0?new Ih(i):new DOMException(i),Mg=i=>{let e=i.reason===void 0?Lg("This operation was aborted."):i.reason;return e instanceof Error?e:Lg(e)};function Dh(i,e){let{milliseconds:t,fallback:r,message:s,customTimers:n={setTimeout,clearTimeout}}=e,o,a,c=new Promise((d,f)=>{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&&f(Mg(v)),a=()=>{f(Mg(v))},v.addEventListener("abort",a,{once:!0})}if(t===Number.POSITIVE_INFINITY){i.then(d,f);return}let y=new ho;o=n.setTimeout.call(void 0,()=>{if(r){try{d(r())}catch(v){f(v)}return}typeof i.cancel=="function"&&i.cancel(),s===!1?d():s instanceof Error?f(s):(y.message=s??`Promise timed out after ${t} milliseconds`,f(y))},t),(async()=>{try{d(await i)}catch(v){f(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 Nh(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 po=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=Nh(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 fo=class extends Mh.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:po,...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.#k(),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.#k()},this.#s),this.#a=Date.now()+this.#s)}#k(){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#x(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=Dh(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 ho&&!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 Ig=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(()=>Ig(i,e,f,r,s))})},ET=async(i,e,t,r)=>{let s=new fo({concurrency:6}),n=dl(i);return n.filter(a=>a.type==="folder"&&a.status==="checked"&&(a.cached===!1||a.nextPagePath)).forEach(a=>{s.add(()=>Ig(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=ET;var rs={afterOpenFolder:Cg,afterScrollFolder:Fg,afterToggleCheckbox:_g,afterFill:Dg};var kT=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:r}=i.target;return e-(t+r)<50},fl=kT;var xT=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)}},Gi=xT;var AT=(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]},ml=AT;function PT(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=k=>{t(k.target.value)},y=is(k=>{k.preventDefault(),r()},[r]),[v]=fi(()=>{let k=document.createElement("form");return k.setAttribute("tabindex","-1"),k.id=mr(),k});return xi(()=>(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 Ws=PT;var Bg=Fe(wt(),1);var CT=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,Ng=CT;function mo(i){let{cancelSelection:e,donePicking:t,i18n:r,partialTree:s,validateAggregateRestrictions:n}=i,o=ts(()=>n(s),[s,n]),a=ts(()=>Ng(s),[s]);return a===0?null:u("div",{className:"uppy-ProviderBrowser-footer"},u("div",{className:"uppy-ProviderBrowser-footer-buttons"},u("button",{className:(0,Bg.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 FT=(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}}},Ug=FT;var _T=(i,e,t)=>{let r=i.map(o=>Ug(o,e,t)),s=[],n=[];r.forEach(o=>{e.uppy.checkIfFileAlreadyExists(Na(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)},gl=_T;var zg=(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=[...zg(i,s.parentId,t),s];return t[r]=n,n},OT=i=>{let e=Object.create(null);return i.filter(s=>s.type==="file"&&s.status==="checked").map(s=>{let n=zg(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}})},vl=OT;var RT=(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},Hg=RT;function yr(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var LT=0;function qg(i){return"__private_"+LT+++"_"+i}var MT={version:"4.4.2"};function go(){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 $g=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),ss=qg("abortController"),mi=qg("withAbort"),Gs=class{constructor(e,t){Object.defineProperty(this,mi,{value:IT}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,ss,{writable:!0,value:void 0}),this.validateSingleFile=s=>{let n=ao(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($g(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 yr(this,mi)[mi](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=rs.afterOpenFolder(t,o,r,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})}).catch(Gi(this.plugin.uppy)),this.setLoading(!1)}async logout(){await yr(this,mi)[mi](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({...$g(this.plugin.rootFolderId),authenticated:!1})}}).catch(Gi(this.plugin.uppy))}async handleAuth(e){await yr(this,mi)[mi](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(Gi(this.plugin.uppy)),this.setLoading(!1)}async handleScroll(e){let{partialTree:t,currentFolderId:r}=this.plugin.getPluginState(),s=t.find(n=>n.id===r);fl(e)&&!this.isHandlingScroll&&s.nextPagePath&&(this.isHandlingScroll=!0,await yr(this,mi)[mi](async n=>{let{nextPagePath:o,items:a}=await this.provider.list(s.nextPagePath,{signal:n}),l=rs.afterScrollFolder(t,r,a,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})}).catch(Gi(this.plugin.uppy)),this.isHandlingScroll=!1)}async donePicking(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),await yr(this,mi)[mi](async t=>{let r=await rs.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=vl(r);gl(n,this.plugin,this.provider),this.resetPluginState()}).catch(Gi(this.plugin.uppy)),this.setLoading(!1)}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),s=ml(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=rs.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||go;if(o===!1)return u(cl,{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=Hg(c,d);return u("div",{className:(0,Vg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n.viewType}`)},u(xh,{showBreadcrumbs:n.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:v,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:f,i18n:s}),n.showFilter&&u(Ws,{searchString:y,setSearchString:k=>{this.plugin.setPluginState({searchString:k})},submitSearchString:()=>{},inputLabel:s("filter"),clearSearchLabel:s("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(hl,{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(mo,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};async function IT(i){var e;(e=yr(this,ss)[ss])==null||e.abort();let t=new AbortController;yr(this,ss)[ss]=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),yr(this,ss)[ss]=void 0}}Gs.VERSION=MT.version;var jg=Fe(wt(),1);var DT={version:"4.4.2"},NT={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},BT={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},Ks=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=r=>{let s=ao(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={...BT,...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(NT)}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){Gi(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(fl(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){Gi(this.plugin.uppy)(n)}this.isHandlingScroll=!1}}async donePicking(){let{partialTree:e}=this.plugin.getPluginState(),t=vl(e);gl(t,this.plugin,this.provider),this.resetPluginState()}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),s=ml(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=rs.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(Ws,{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,jg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&u(Ws,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(hl,{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(mo,{partialTree:o,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};Ks.VERSION=DT.version;var Wg=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function UT(i,e){return!!(i===e||Wg(i)&&Wg(e))}function zT(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!UT(i[t],e[t]))return!1;return!0}function Bh(i,e){e===void 0&&(e=zT);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 bl=['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 vo(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function Gg(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function HT(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function $T(i){return i.contains(document.activeElement)}function Uh(i,e,t){let r=vo(t,e),s=br(r.querySelectorAll(bl)),n=s.indexOf(document.activeElement);$T(r)?i.shiftKey&&n===0?HT(i,s):!i.shiftKey&&n===s.length-1&&Gg(i,s):Gg(i,s)}function Kg(i,e,t){e===null||Uh(i,e,t)}var Xg=Fe(Cu(),1);function zh(){let i=!1;return(0,Xg.default)((t,r)=>{let s=vo(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(bl);a?.focus({preventScroll:!0}),i=!1}},260)}var pv=Fe(wt(),1);function Hh(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var Jg=Fe(wt(),1);function Yg(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 VT(){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 jT(){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 WT(){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 GT(){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 KT(){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 XT(){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 YT(){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 ns(i){let e={color:"#838999",icon:XT()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:YT()}:t==="image"?{color:"#686de0",icon:VT()}:t==="audio"?{color:"#068dbb",icon:jT()}:t==="video"?{color:"#19af67",icon:WT()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:GT()}: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:KT()}:e}function bo(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}=ns(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 ZT=(i,e)=>(typeof e=="function"?e():e).filter(s=>s.id===i)[0].name;function yo(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=>ZT(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 $h(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,showLinkToFileUploadResult:n}=i,a=e.preview?"rgba(255, 255, 255, 0.5)":ns(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(bo,{file:e}),u(yo,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function QT(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 Zg(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 qh(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":Zg(i),title:Zg(i),onClick:()=>QT(i)},i.children))}function yl(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 Vh(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 jh(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(yl,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(qh,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(qh,i,u(yl,null,u(Vh,{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(qh,i,u(yl,null,u(Vh,{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(yl,null,u(Vh,{progress:i.file.progress.percentage}))))}var Qg=Fe(Ba(),1);var Wh="...";function wl(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=Wh.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-Wh.length,r=Math.ceil(t/2),s=Math.floor(t/2);return i.slice(0,r)+Wh+i.slice(-s)}var JT=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},wl(t,r()))},eE=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"},wl(t.name,13)),r?u(Fragment,null,` ${s} `,r,` ${s} `):null):null},tE=i=>i.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},(0,Qg.default)(i.file.size)),iE=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"))),rE=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 Gh(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"},JT({file:e,isSingleFile:o,containerHeight:a,containerWidth:l}),u(rE,{file:e,onClick:()=>alert(e.error)})),u("div",{className:"uppy-Dashboard-Item-status"},eE({file:e}),tE({file:e}),iE({file:e,toggleAddFilesPanel:n,i18n:t})),u(yo,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function Kh(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 sE(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 nE(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 oE(i){let{file:e,uppy:t,i18n:r}=i,s=n=>{Kh(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 Xh(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(sE,{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(oE,{file:t,uppy:e,i18n:l}):null,a?u(nE,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var wo=class extends dt{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Yg(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,Jg.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($h,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),u(jh,{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(Gh,{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(Xh,{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 aE(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 Yh(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:k,handleCancelThumbnail:P,recoveredState:F,individualCancellation:R,itemsPerRow:D,openFileEditor:V,canEditFile:M,toggleAddFilesPanel:$,containerWidth:z,containerHeight:G}=i,K=D===1?71:200,Q=ts(()=>{let Y=(le,xe)=>Number(s[xe].isGhost)-Number(s[le].isGhost),re=Object.keys(s);return F&&re.sort(Y),aE(re,D)},[s,D,F]),ne=Y=>u("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:Y[0]},Y.map(re=>u(wo,{key:re,uppy:r,id:e,i18n:t,resumableUploads:n,individualCancellation:R,hideRetryButton:o,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:f,recoveredState:F,isSingleFile:y,containerWidth:z,containerHeight:G,toggleFileCard:v,handleRequestThumbnail:k,handleCancelThumbnail:P,role:"listitem",openFileEditor:V,canEditFile:M,toggleAddFilesPanel:$,file:s[re]})));return y?u("div",{class:"uppy-Dashboard-files"},ne(Q[0])):u(ul,{class:"uppy-Dashboard-files",role:"list",data:Q,renderRow:ne,rowHeight:K})}var Zh=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:f,elements:y}=d;return u(Mt,{key:f},y)}),u("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:f,elements:y}=d;return u(Mt,{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()))}},Sl=Zh;var ev=Fe(wt(),1);var lE=i=>u("div",{className:(0,ev.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(Sl,i)),tv=lE;var iv=Fe(wt(),1);function cE(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ai=cE;function uE(i){let{activePickerPanel:e,className:t,hideAllPanels:r,i18n:s,state:n,uppy:o}=i,a=es(null);return u("div",{className:(0,iv.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 rv=uE;var sv=Fe(wt(),1);function hE(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return u("div",{className:(0,sv.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 nv=hE;var Pi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function dE(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 pE(i){let{files:e,i18n:t,isAllComplete:r,isAllErrored:s,isAllPaused:n,inProgressNotPausedFiles:o,newFiles:a,processingFiles:l}=i;switch(dE(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 fE(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(pE,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 ov=fE;var av=Fe(wt(),1);function Qh(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 Jh(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,k=t[r],P=(e=v())!=null?e:[],F=y(k),R={};P.forEach(K=>{var Q;R[K.id]=(Q=k.meta[K.id])!=null?Q:""});let[D,V]=fi(R),M=is(K=>{K.preventDefault(),n(D,r)},[n,D,r]),$=(K,Q)=>{V({...D,[Q]:K})},z=()=>{s(!1)},[G]=fi(()=>{let K=document.createElement("form");return K.setAttribute("tabindex","-1"),K.id=mr(),K});return xi(()=>(document.body.appendChild(G),G.addEventListener("submit",M),()=>{G.removeEventListener("submit",M),document.body.removeChild(G)}),[G,M]),u("div",{className:(0,av.default)("uppy-Dashboard-FileCard",f),"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"},k.meta?k.meta.name:k.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",form:G.id,title:c("finishEditingFile"),onClick:z},c("cancel"))),u("div",{className:"uppy-Dashboard-FileCard-inner"},u("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:ns(k.type).color}},u(bo,{file:k}),F&&u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:K=>{M(K),l(k)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(Qh,{computedMetaFields:P,requiredMetaFields:a,updateMeta:$,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:z,form:G.id},c("cancel")))))}var cv=Fe(wt(),1),Xs="uppy-transition-slideDownUp",lv=250;function mE(i){let{children:e}=i,[t,r]=fi(null),[s,n]=fi(""),o=es(),a=es(),l=es(),c=()=>{n(`${Xs}-enter`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{n(`${Xs}-enter ${Xs}-enter-active`),o.current=setTimeout(()=>{n("")},lv)})},d=()=>{n(`${Xs}-leave`),cancelAnimationFrame(l.current),clearTimeout(o.current),o.current=void 0,l.current=requestAnimationFrame(()=>{n(`${Xs}-leave ${Xs}-leave-active`),a.current=setTimeout(()=>{r(null),n("")},lv)})};return xi(()=>{let f=ki(e)[0];t!==f&&(f&&!t?c():t&&!f&&!a.current&&d(),r(f))},[e,t]),xi(()=>()=>{clearTimeout(o.current),clearTimeout(a.current),cancelAnimationFrame(l.current)},[]),t?ja(t,{className:(0,cv.default)(s,t.props.className)}):null}var So=mE;function Ys(){return Ys=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},Ys.apply(null,arguments)}var uv=900,hv=700,ed=576,dv=330;function td(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>ed,s=i.containerHeight>dv,n=(0,pv.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>ed,"uppy-size--lg":i.containerWidth>hv,"uppy-size--xl":i.containerWidth>uv,"uppy-size--height-md":i.containerHeight>dv,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&s}),o=1;i.containerWidth>uv?o=5:i.containerWidth>hv?o=4:i.containerWidth>ed&&(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&&Hh(),"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(ov,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(Yh,{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(Sl,{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(So,null,i.showAddFilesPanel?u(tv,Ys({key:"AddFiles"},i,{isSizeMD:r})):null),u(So,null,i.fileCardFor?u(Jh,Ys({key:"FileCard"},i)):null),u(So,null,i.activePickerPanel?u(rv,Ys({key:"Picker"},i)):null),u(So,null,i.showFileEditor?u(nv,Ys({key:"Editor"},i)):null),u("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(y=>i.uppy.getPlugin(y.id).render(i.state))))))}var fv={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 gE=0;function ct(i){return"__private_"+gE+++"_"+i}var vE={version:"4.3.2"},id=Bh.default||Bh,mv=9,bE=27;function gv(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var yE={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:go,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},os=ct("disabledNodes"),Ki=ct("generateLargeThumbnailIfSingleFile"),To=ct("openFileEditorWhenFilesAdded"),as=ct("attachRenderFunctionToTarget"),rd=ct("isTargetSupported"),sd=ct("getAcquirers"),nd=ct("getProgressIndicators"),Xi=ct("getEditors"),od=ct("addSpecifiedPluginsFromOptions"),ad=ct("autoDiscoverPlugins"),ls=ct("addSupportedPluginIfNoTarget"),Eo=ct("getStatusBarOpts"),ko=ct("getThumbnailGeneratorOpts"),ld=ct("getInformerOpts"),xo=ct("getStatusBarId"),Ao=ct("getThumbnailGeneratorId"),cd=ct("getInformerId"),wr=class extends di{constructor(e,t){var r,s,n;let o=(r=t?.autoOpen)!=null?r:null;super(e,{...yE,...t,autoOpen:o}),Object.defineProperty(this,cd,{value:xE}),Object.defineProperty(this,Ao,{value:kE}),Object.defineProperty(this,xo,{value:EE}),Object.defineProperty(this,ld,{value:TE}),Object.defineProperty(this,ko,{value:SE}),Object.defineProperty(this,Eo,{value:wE}),Object.defineProperty(this,os,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${mr()}`,this.superFocus=zh(),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,Xi)[Xi](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(a))},this.openFileEditor=a=>{let{targets:l}=this.getPluginState(),c=de(this,Xi)[Xi](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,Xi)[Xi](a).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:a,resolve:l}=gv();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}=gv();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 k;(k=history.state)!=null&&k[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,os)[os])!=null?l:br(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,os)[os]=d:de(this,os)[os]=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===bE&&this.requestCloseModal(),a.keyCode===mv&&Uh(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=br(a.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=a=>{a.preventDefault();let l=br(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 yh(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===mv&&Kg(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,Ki,{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,To,{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=gh(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,ls)[ls]),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,Ki)[Ki]),this.uppy.on("file-removed",de(this,Ki)[Ki]),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,To)[To])},this.removeEvents=()=>{let a=gh(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,ls)[ls]),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,Ki)[Ki]),this.uppy.off("file-removed",de(this,Ki)[Ki]),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,To)[To])},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,as,{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,rd,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,sd,{writable:!0,value:id(a=>a.filter(l=>l.type==="acquirer"&&de(this,rd)[rd](l)).map(de(this,as)[as]))}),Object.defineProperty(this,nd,{writable:!0,value:id(a=>a.filter(l=>l.type==="progressindicator").map(de(this,as)[as]))}),Object.defineProperty(this,Xi,{writable:!0,value:id(a=>a.filter(l=>l.type==="editor").map(de(this,as)[as]))}),this.render=a=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:f}=a,{newFiles:y,uploadStartedFiles:v,completeFiles:k,erroredFiles:P,inProgressFiles:F,inProgressNotPausedFiles:R,processingFiles:D,isUploadStarted:V,isAllComplete:M,isAllPaused:$}=this.uppy.getObjectOfFilesPerState(),z=de(this,sd)[sd](l.targets),G=de(this,nd)[nd](l.targets),K=de(this,Xi)[Xi](l.targets),Q;return this.opts.theme==="auto"?Q=d.darkMode?"dark":"light":Q=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}".`)),td({state:a,isHidden:l.isHidden,files:c,newFiles:y,uploadStartedFiles:v,completeFiles:k,erroredFiles:P,inProgressFiles:F,inProgressNotPausedFiles:R,processingFiles:D,isUploadStarted:V,isAllComplete:M,isAllPaused:$,totalFileCount:Object.keys(c).length,totalProgress:a.totalProgress,allowNewUpload:f,acquirers:z,theme:Q,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,od,{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,ad,{writable:!0,value:()=>{this.uppy.iteratePlugins(de(this,ls)[ls])}}),Object.defineProperty(this,ls,{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(Xr,{id:de(this,xo)[xo](),target:this,...de(this,Eo)[Eo]()}),this.opts.disableInformer||this.uppy.use(Yr,{id:de(this,cd)[cd](),target:this,...de(this,ld)[ld]()}),this.opts.disableThumbnailGenerator||this.uppy.use(Vs,{id:de(this,Ao)[Ao](),...de(this,ko)[ko]()}),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,od)[od](),de(this,ad)[ad](),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=fv,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,xo)[xo]()))==null||t.setOptions(de(this,Eo)[Eo]()),(r=this.uppy.getPlugin(de(this,Ao)[Ao]()))==null||r.setOptions(de(this,ko)[ko]())}};function wE(){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 SE(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r,lazy:!r}}function TE(){return{}}function EE(){return`${this.id}:StatusBar`}function kE(){return`${this.id}:ThumbnailGenerator`}function xE(){return`${this.id}:Informer`}wr.VERSION=vE.version;var Tv=Fe(vv(),1);function AE(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 bv=AE;function PE(i){return i*(Math.PI/180)}function CE(i,e,t){let r=Math.abs(PE(t));return Math.max((Math.sin(r)*i+Math.cos(r)*e)/e,(Math.sin(r)*e+Math.cos(r)*i)/i)}var yv=CE;function FE(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 wv=FE;function _E(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 Sv=_E;var Po=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=bv(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=yv(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 Tv.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=wv(t,r,s);n&&this.cropper.setCropBoxData(n)}else{let n=Sv(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 Ev={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 OE={version:"3.3.1"},kv={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},xv={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},RE={quality:.8,actions:xv,cropperOptions:kv},cs=class extends di{constructor(e,t){super(e,{...RE,...t,actions:{...xv,...t?.actions},cropperOptions:{...kv,...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=Ev,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(Po,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}};cs.VERSION=OE.version;function Yi(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var LE=0;function Av(i){return"__private_"+LE+++"_"+i}var Et=Av("uppy"),Co=Av("events"),Fo=class{constructor(e){Object.defineProperty(this,Et,{writable:!0,value:void 0}),Object.defineProperty(this,Co,{writable:!0,value:[]}),Yi(this,Et)[Et]=e}on(e,t){return Yi(this,Co)[Co].push([e,t]),Yi(this,Et)[Et].on(e,t)}remove(){for(let[e,t]of Yi(this,Co)[Co].splice(0))Yi(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",()=>{Yi(this,Et)[Et].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{Yi(this,Et)[Et].getFile(e)&&t()})}onCancelAll(e,t){var r=this;this.on("cancel-all",function(){Yi(r,Et)[Et].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{Yi(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 ME=0;function Ft(i){return"__private_"+ME+++"_"+i}function IE(i){return new Error("Cancelled",{cause:i})}function Pv(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"),xt=Ft("queuedHandlers"),Bt=Ft("paused"),us=Ft("pauseTimer"),kt=Ft("downLimit"),hs=Ft("upperLimit"),Zi=Ft("rateLimitingTimer"),_o=Ft("call"),Qi=Ft("queueNext"),fd=Ft("next"),dd=Ft("queue"),md=Ft("dequeue"),pd=Ft("resume"),ds=Ft("increaseLimit"),Tl=class{constructor(e){Object.defineProperty(this,md,{value:zE}),Object.defineProperty(this,dd,{value:UE}),Object.defineProperty(this,fd,{value:BE}),Object.defineProperty(this,Qi,{value:NE}),Object.defineProperty(this,_o,{value:DE}),Object.defineProperty(this,Ut,{writable:!0,value:0}),Object.defineProperty(this,xt,{writable:!0,value:[]}),Object.defineProperty(this,Bt,{writable:!0,value:!1}),Object.defineProperty(this,us,{writable:!0,value:void 0}),Object.defineProperty(this,kt,{writable:!0,value:1}),Object.defineProperty(this,hs,{writable:!0,value:void 0}),Object.defineProperty(this,Zi,{writable:!0,value:void 0}),Object.defineProperty(this,pd,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,ds,{writable:!0,value:()=>{if(te(this,Bt)[Bt]){te(this,Zi)[Zi]=setTimeout(te(this,ds)[ds],0);return}te(this,kt)[kt]=this.limit,this.limit=Math.ceil((te(this,hs)[hs]+te(this,kt)[kt])/2);for(let t=te(this,kt)[kt];t<=this.limit;t++)te(this,Qi)[Qi]();te(this,hs)[hs]-te(this,kt)[kt]>3?te(this,Zi)[Zi]=setTimeout(te(this,ds)[ds],2e3):te(this,kt)[kt]=Math.floor(te(this,kt)[kt]/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,_o)[_o](e):te(this,dd)[dd](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:Pv,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=IE(v)}},t)});return l.abort=c=>{a.abort(c)},l.abortOn=Pv,l}}resume(){te(this,Bt)[Bt]=!1,clearTimeout(te(this,us)[us]);for(let e=0;e<this.limit;e++)te(this,Qi)[Qi]()}pause(e){e===void 0&&(e=null),te(this,Bt)[Bt]=!0,clearTimeout(te(this,us)[us]),e!=null&&(te(this,us)[us]=setTimeout(te(this,pd)[pd],e))}rateLimit(e){clearTimeout(te(this,Zi)[Zi]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(te(this,hs)[hs]=this.limit-1,this.limit=te(this,kt)[kt],te(this,Zi)[Zi]=setTimeout(te(this,ds)[ds],e))}get isPaused(){return te(this,Bt)[Bt]}};function DE(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,Qi)[Qi]())},done:()=>{e||(e=!0,te(this,Ut)[Ut]-=1,te(this,Qi)[Qi]())}}}function NE(){queueMicrotask(()=>te(this,fd)[fd]())}function BE(){if(te(this,Bt)[Bt]||te(this,Ut)[Ut]>=this.limit||te(this,xt)[xt].length===0)return;let i=te(this,xt)[xt].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=te(this,_o)[_o](i.fn);i.abort=e.abort,i.done=e.done}function UE(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{te(this,md)[md](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=te(this,xt)[xt].findIndex(s=>t.priority>s.priority);return r===-1?te(this,xt)[xt].push(t):te(this,xt)[xt].splice(r,0,t),t}function zE(i){let e=te(this,xt)[xt].indexOf(i);e!==-1&&te(this,xt)[xt].splice(e,1)}var El=Symbol("__queue");var gd=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}},Oo=gd;function HE(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}var Cv=HE;function Yt(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var $E=0;function kl(i){return"__private_"+$E+++"_"+i}var Ji=kl("aliveTimer"),ps=kl("isDone"),Ro=kl("onTimedOut"),fs=kl("timeout"),vd=class{constructor(e,t){Object.defineProperty(this,Ji,{writable:!0,value:void 0}),Object.defineProperty(this,ps,{writable:!0,value:!1}),Object.defineProperty(this,Ro,{writable:!0,value:void 0}),Object.defineProperty(this,fs,{writable:!0,value:void 0}),Yt(this,fs)[fs]=e,Yt(this,Ro)[Ro]=()=>t(e)}progress(){Yt(this,ps)[ps]||Yt(this,fs)[fs]>0&&(clearTimeout(Yt(this,Ji)[Ji]),Yt(this,Ji)[Ji]=setTimeout(Yt(this,Ro)[Ro],Yt(this,fs)[fs]))}done(){Yt(this,ps)[ps]||(clearTimeout(Yt(this,Ji)[Ji]),Yt(this,Ji)[Ji]=void 0,Yt(this,ps)[ps]=!0)}},Fv=vd;var xl=()=>{};function _v(i,e){e===void 0&&(e={});let{body:t=null,headers:r={},method:s="GET",onBeforeRequest:n=xl,onUploadProgress:o=xl,shouldRetry:a=()=>!0,onAfterResponse:l=xl,onTimeout:c=xl,responseType:d,retries:f=3,signal:y=null,timeout:v=3e4,withCredentials:k=!1}=e,P=D=>.3*2**(D-1)*1e3,F=new Fv(v,c);function R(D){return D===void 0&&(D=0),new Promise(async(V,M)=>{let $=new XMLHttpRequest,z=G=>{a($)&&D<f?setTimeout(()=>{R(D+1).then(V,M)},P(D)):(F.done(),M(G))};$.open(s,i,!0),$.withCredentials=k,d&&($.responseType=d),y?.addEventListener("abort",()=>{$.abort(),M(new DOMException("Aborted","AbortError"))}),$.onload=async()=>{try{await l($,D)}catch(G){G.request=$,z(G);return}$.status>=200&&$.status<300?(F.done(),V($)):a($)&&D<f?setTimeout(()=>{R(D+1).then(V,M)},P(D)):(F.done(),M(new Oo($.statusText,$)))},$.onerror=()=>z(new Oo($.statusText,$)),$.upload.onprogress=G=>{F.progress(),o(G)},r&&Object.keys(r).forEach(G=>{$.setRequestHeader(G,r[G])}),await n($,D),$.send(t)})}return R()}function Ov(i){let e=t=>"error"in t&&!!t.error;return i.filter(t=>!e(t))}function Rv(i){return i.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}function Al(i,e){return i===!0?Object.keys(e):Array.isArray(i)?i:[]}var Lv={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function er(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var qE=0;function Qs(i){return"__private_"+qE+++"_"+i}var VE={version:"4.3.3"};function jE(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})),Cv(i)?(t=new Oo(t,i),t):(t.request=i,t)}function Mv(i){return i.data.slice(0,i.data.size,i.meta.type)}var WE={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""},ms=Qs("getFetcher"),wd=Qs("uploadLocalFile"),bd=Qs("uploadBundle"),Sd=Qs("getCompanionClientArgs"),yd=Qs("uploadFiles"),Lo=Qs("handleUpload"),Zs=class extends gr{constructor(e,t){if(super(e,{...WE,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,yd,{value:YE}),Object.defineProperty(this,Sd,{value:XE}),Object.defineProperty(this,bd,{value:KE}),Object.defineProperty(this,wd,{value:GE}),Object.defineProperty(this,ms,{writable:!0,value:void 0}),Object.defineProperty(this,Lo,{writable:!0,value:async r=>{if(r.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[El]&&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=Ov(s),o=Rv(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 er(this,bd)[bd](n)}else await er(this,yd)[yd](n)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=Lv,this.i18nInit(),El in this.opts?this.requests=this.opts[El]:this.requests=new Tl(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),er(this,ms)[ms]=r=>async(s,n)=>{try{var o,a,l;let f=await _v(s,{...n,onBeforeRequest:(k,P)=>{var F,R;return(F=(R=this.opts).onBeforeRequest)==null?void 0:F.call(R,k,P,r)},shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:k=>{let P=Math.ceil(k/1e3),F=new Error(this.i18n("uploadStalled",{seconds:P}));this.uppy.emit("upload-stalled",F,r)},onUploadProgress:k=>{if(k.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:k.loaded/k.total*R.size,bytesTotal:R.size})}}}),y=await((o=(a=this.opts).getResponseData)==null?void 0:o.call(a,f));if(f.responseType==="json"){var c;(c=y)!=null||(y=f.response)}else try{var d;(d=y)!=null||(y=JSON.parse(f.responseText))}catch(k){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:k})}let v=typeof((l=y)==null?void 0:l.url)=="string"?y.url:void 0;for(let{id:k}of r)this.uppy.emit("upload-success",this.uppy.getFile(k),{status:f.status,body:y,uploadURL:v});return f}catch(f){if(f.name==="AbortError")return;let y=f.request;for(let v of r)this.uppy.emit("upload-error",this.uppy.getFile(v.id),jE(y,f),y);throw f}}}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){Al(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=Mv(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=Mv(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(er(this,Lo)[Lo])}uninstall(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(er(this,Lo)[Lo])}};async function GE(i){let e=new Fo(this.uppy),t=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{let s=this.getOptions(i),n=er(this,ms)[ms]([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 KE(i){let e=new AbortController,t=this.requests.wrapPromiseFunction(async()=>{var s;let n=(s=this.uppy.getState().xhrUpload)!=null?s:{},o=er(this,ms)[ms](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 XE(i){var e;let t=this.getOptions(i),r=Al(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 YE(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,er(this,Sd)[Sd](e),{signal:r.signal,getQueue:t});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",s)},{priority:-1})(),n}return er(this,wd)[wd](e)}))}Zs.VERSION=VE.version;var ut=class{static fromTemplate(i){if(Rs.isSupported)return Rs.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 ZE(e)}}};function ZE(i){return QE(i),Iv(i),i}function QE(i){let e=i.querySelectorAll("script");for(let t of e)t.remove()}function JE(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 ek(i){let e=i.attributes;for(let{name:t,value:r}of e)JE(t,r)&&i.removeAttribute(t)}function Iv(i){let e=i.children;for(let t of e)ek(t),Iv(t)}var Pl=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(wr,{inline:!1,closeAfterFinish:!0}).use(cs,{target:wr}),this.#e(),this.#t()}#e(){this.uppy.use(Zs,{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
98
|
<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
99
|
<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
100
|
</svg>
|
@@ -98,7 +123,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&
|
|
98
123
|
Delete
|
99
124
|
</button>
|
100
125
|
</div>
|
101
|
-
`}get#l(){return this.uppy.getPlugin("Dashboard")}get multiple(){return this.maxFileNumValue!=1}};function
|
126
|
+
`}get#l(){return this.uppy.getPlugin("Dashboard")}get multiple(){return this.maxFileNumValue!=1}};function tk(){return ut.fromTemplate(`
|
102
127
|
<svg aria-hidden="true" focusable="false" width="25" height="25" viewBox="0 0 25 25">
|
103
128
|
<g fill="#686DE0" fillRule="evenodd">
|
104
129
|
<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,61 +131,36 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&
|
|
106
131
|
<circle cx="7.5" cy="9.5" r="1.5" />
|
107
132
|
</g>
|
108
133
|
</svg>
|
109
|
-
`)}function
|
134
|
+
`)}function ik(){return ut.fromTemplate(`
|
110
135
|
<svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
|
111
136
|
<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
137
|
</svg>
|
113
|
-
`)}function
|
138
|
+
`)}function rk(){return ut.fromTemplate(`
|
114
139
|
<svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
|
115
140
|
<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
141
|
</svg>
|
117
|
-
`)}function
|
142
|
+
`)}function sk(){return ut.fromTemplate(`
|
118
143
|
<svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
|
119
144
|
<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
145
|
</svg>
|
121
|
-
`)}function
|
146
|
+
`)}function nk(){return ut.fromTemplate(`
|
122
147
|
<svg aria-hidden="true" focusable="false" width="25" height="25" viewBox="0 0 25 25">
|
123
148
|
<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
149
|
</svg>
|
125
|
-
`)}function
|
150
|
+
`)}function ok(){return ut.fromTemplate(`
|
126
151
|
<svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
|
127
152
|
<g fill="#A7AFB7" fillRule="nonzero">
|
128
153
|
<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
154
|
<path d="M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z" />
|
130
155
|
</g>
|
131
156
|
</svg>
|
132
|
-
`)}function
|
157
|
+
`)}function ak(){return ut.fromTemplate(`
|
133
158
|
<svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
|
134
159
|
<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
160
|
</svg>
|
136
|
-
`)}function
|
161
|
+
`)}function Td(i){let e={color:"#838999",icon:ok()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:ak()}:t==="image"?{color:"#686de0",icon:tk()}:t==="audio"?{color:"#068dbb",icon:ik()}:t==="video"?{color:"#19af67",icon:rk()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:sk()}:t==="application"&&["zip","x-7z-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:nk()}:e}var Cl=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
162
|
<img src="${this.thumbnailUrlValue}" class="w-full h-full object-cover" />
|
138
|
-
`);this.thumbnailLinkTarget.innerHTML=null,this.thumbnailLinkTarget.appendChild(i)}useMimeIconPreview(){let i=
|
139
|
-
`),r=t[0].match(/^\s+/),s=r?r[0].length:0;return t.map(n=>n.slice(s)).join(`
|
140
|
-
`)}function KE(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 XE(i,...e){return e.some(t=>t&&t.hasAttribute(i))}function xl(...i){for(let e of i)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function kl(...i){for(let e of i)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function YE(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 yv(i){switch(i){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function ZE(i){return i=="advance"||i=="replace"||i=="restore"}function ps(...i){let e=Tl("data-turbo-action",...i);return ZE(e)?e:null}function vd(i){return document.querySelector(`meta[name="${i}"]`)}function Al(i){let e=vd(i);return e&&e.content}function wv(){let i=vd("csp-nonce");if(i){let{nonce:e,content:t}=i;return e==""?t:e}}function QE(i,e){let t=vd(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 bd(i){return!!i&&i.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof i.focus=="function"}function Sv(i){return Array.from(i.querySelectorAll("[autofocus]")).find(bd)}async function JE(i,e){let t=e();i(),await mv();let r=e();return[t,r]}function Ev(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 Tv(i){return Ys(i,"a[href]:not([target^=_]):not([download])")}function xv(i){return st(i.getAttribute("href")||"")}function eT(i,e){let t=null;return(...r)=>{let s=()=>i.apply(this,r);clearTimeout(t),t=setTimeout(s,e)}}var tT={"aria-disabled":{beforeSubmit:i=>{i.setAttribute("aria-disabled","true"),i.addEventListener("click",av)},afterSubmit:i=>{i.removeAttribute("aria-disabled"),i.removeEventListener("click",av)}},disabled:{beforeSubmit:i=>i.disabled=!0,afterSubmit:i=>i.disabled=!1}},Bh=class{#e=null;constructor(e){Object.assign(this,e)}get submitter(){return this.#e}set submitter(e){this.#e=tT[e]||e}},iT=new Bh({mode:"on",submitter:"disabled"}),rt={drive:VE,forms:iT};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 yd(i,e){let t=e?.getAttribute("formaction")||i.getAttribute("action")||i.action;return st(t)}function rT(i){return(aT(i).match(/\.[^.]*$/)||[])[0]||""}function sT(i,e){let t=lT(e);return i.href===st(t).href||i.href.startsWith(t)}function br(i,e){return sT(i,e)&&!rt.drive.unvisitableExtensions.has(rT(i))}function Uh(i){let e=fs(i);return e!=null?i.href.slice(0,-(e.length+1)):i.href}function Sl(i){return Uh(i)}function nT(i,e){return st(i).href==st(e).href}function oT(i){return i.pathname.split("/").slice(1)}function aT(i){return oT(i).slice(-1)[0]}function lT(i){return cT(i.origin+i.pathname)}function cT(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)}},zh=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)}},kv=new zh(20),uT=window.fetch;function Av(i,e={}){let t=new Headers(e.headers||{}),r=yr();return kv.add(r),t.append("X-Turbo-Request-Id",r),uT(i,{...e,headers:t})}function wd(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 hT(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]=lv(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=wd(e)||Yt.get;this.url.search="";let[s,n]=lv(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=Av(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 Oe("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 Sd(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=Oe("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!Oe("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function Sd(i){return wd(i)==Yt.get}function lv(i,e,t,r){let s=Array.from(t).length>0?new URLSearchParams(Pv(t)):i.searchParams;return Sd(e)?[dT(i,s),null]:r==ds.urlEncoded?[i,s]:[i,t]}function Pv(i){let e=[];for(let[t,r]of i)r instanceof File||e.push([t,r]);return e}function dT(i,e){let t=new URLSearchParams(Pv(e));return i.search=t.toString(),i}var Hh=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(WE(e)):e}constructor(e){this.fragment=pT(e)}};function pT(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 fT=100,$h=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},fT)}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}},mT=10*1e3,Xs=new $h,Gs={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},Pl=class i{state=Gs.initialized;static confirmMethod(e){return Promise.resolve(confirm(e))}constructor(e,t,r,s=!1){let n=ST(t,r),o=wT(yT(t,r),n),a=gT(t,r),l=ET(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=vT(Al("csrf-param"))||Al("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(),xl(this.formElement),Oe("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)&&bT(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(),kl(this.formElement),Oe("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||XE("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function gT(i,e){let t=new FormData(i),r=e?.getAttribute("name"),s=e?.getAttribute("value");return r&&t.append(r,s||""),t}function vT(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 bT(i){return i.statusCode==200&&!i.redirected}function yT(i,e){let t=typeof i.action=="string"?i.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":i.getAttribute("action")||t||""}function wT(i,e){let t=st(i);return Sd(e)&&(t.search=""),t}function ST(i,e){let t=e?.getAttribute("formmethod")||i.getAttribute("method")||"";return wd(t.toLowerCase())||Yt.get}function ET(i,e){return hT(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 Sv(this.element)}get permanentElements(){return Fv(this.element)}getPermanentElementById(e){return Cv(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 Cv(i,e){return i.querySelector(`#${e}[data-turbo-permanent]`)}function Fv(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&&TT(t,r)&&xT(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}}};function TT(i,e){return(e?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"}function xT(i,e){let t=e?.getAttribute("formtarget")||i.getAttribute("target");return Ev(t)}var Cl=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()}},qh=class extends Cl{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new Qs(this.element)}},Fl=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=Tv(t)||t;return r instanceof Element&&r.closest("turbo-frame, html")==this.element}},_l=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=Tv(t);if(r&&Ev(r.target)){let s=xv(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)}},Ol=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new _l(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=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())}},Rl=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=kT(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 kT(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 Rl.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=AT(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=PT(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 AT(i,e){return i=="end"||i=="start"||i=="center"||i=="nearest"?i:e}function PT(i,e){return i=="auto"||i=="smooth"?i:e}var CT=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,H,A);return r(T,H,j)}function r(T,k,A){if(A.head.block){let H=T.querySelector("head"),j=k.querySelector("head");if(H&&j){let U=f(j,H,A);Promise.all(U).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 H=G(k,T,A),j=H?.previousSibling,U=H?.nextSibling,J=n(T,H,A);return H?z(j,J,U):[]}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):F(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 H=T.firstChild,j=k.firstChild,U;for(;H;){if(U=H,H=U.nextSibling,j==null){if(A.callbacks.beforeNodeAdded(U)===!1)return;k.appendChild(U),A.callbacks.afterNodeAdded(U),re(A,U);continue}if(P(U,j,A)){n(j,U,A),j=j.nextSibling,re(A,U);continue}let J=D(T,k,U,j,A);if(J){j=R(j,J,A),n(J,U,A),re(A,U);continue}let ee=V(T,k,U,j,A);if(ee){j=R(j,ee,A),n(ee,U,A),re(A,U);continue}if(A.callbacks.beforeNodeAdded(U)===!1)return;k.insertBefore(U,j),A.callbacks.afterNodeAdded(U),re(A,U)}for(;j!==null;){let J=j;j=j.nextSibling,Q(J,A)}}function a(T,k,A,H){return T==="value"&&H.ignoreActiveValue&&k===document.activeElement?!0:H.callbacks.beforeAttributeUpdated(T,k,A)===!1}function l(T,k,A){let H=T.nodeType;if(H===1){let j=T.attributes,U=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=U.length-1;0<=J;J--){let ee=U[J];a(ee.name,k,"remove",A)||T.hasAttribute(ee.name)||k.removeAttribute(ee.name)}}(H===8||H===3)&&k.nodeValue!==T.nodeValue&&(k.nodeValue=T.nodeValue),s(k,A)||d(T,k,A)}function c(T,k,A,H){if(T[A]!==k[A]){let j=a(A,k,"update",H);j||(k[A]=T[A]),T[A]?j||k.setAttribute(A,T[A]):a(A,k,"remove",H)||k.removeAttribute(A)}}function d(T,k,A){if(T instanceof HTMLInputElement&&k instanceof HTMLInputElement&&T.type!=="file"){let H=T.value,j=k.value;c(T,k,"checked",A),c(T,k,"disabled",A),T.hasAttribute("value")?H!==j&&(a("value",k,"update",A)||(k.setAttribute("value",H),k.value=H)):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 H=T.value,j=k.value;if(a("value",k,"update",A))return;H!==j&&(k.value=H),k.firstChild&&k.firstChild.nodeValue!==H&&(k.firstChild.nodeValue=H)}}function f(T,k,A){let H=[],j=[],U=[],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 Re=Ae.has(ce.outerHTML),De=A.head.shouldReAppend(ce),He=A.head.shouldPreserve(ce);Re||He?De?j.push(ce):(Ae.delete(ce.outerHTML),U.push(ce)):ee==="append"?De&&(j.push(ce),J.push(ce)):A.head.shouldRemove(ce)!==!1&&j.push(ce)}J.push(...Ae.values());let oe=[];for(let ce of J){let Re=document.createRange().createContextualFragment(ce.outerHTML).firstChild;if(A.callbacks.beforeNodeAdded(Re)!==!1){if(Re.href||Re.src){let De=null,He=new Promise(function(gi){De=gi});Re.addEventListener("load",function(){De()}),oe.push(He)}k.appendChild(Re),A.callbacks.afterNodeAdded(Re),H.push(Re)}}for(let ce of j)A.callbacks.beforeNodeRemoved(ce)!==!1&&(k.removeChild(ce),A.callbacks.afterNodeRemoved(ce));return A.head.afterHeadMorphed(k,{added:H,kept:U,removed:j}),oe}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 F(T,k){return T==null||k==null?!1:T.nodeType===k.nodeType&&T.tagName===k.tagName}function R(T,k,A){for(;T!==k;){let H=T;T=T.nextSibling,Q(H,A)}return re(A,k),k.nextSibling}function D(T,k,A,H,j){let U=le(j,A,k),J=null;if(U>0){let ee=H,Ae=0;for(;ee!=null;){if(P(A,ee,j))return ee;if(Ae+=le(j,ee,T),Ae>U)return null;ee=ee.nextSibling}}return J}function V(T,k,A,H,j){let U=H,J=A.nextSibling,ee=0;for(;U!=null;){if(le(j,U,T)>0)return null;if(F(A,U))return U;if(F(J,U)&&(ee++,J=J.nextSibling,ee>=2))return null;U=U.nextSibling}return U}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 H=k.parseFromString(T,"text/html");if(A.match(/<\/html>/))return H.generatedByIdiomorph=!0,H;{let j=H.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 $(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 z(T,k,A){let H=[],j=[];for(;T!=null;)H.push(T),T=T.previousSibling;for(;H.length>0;){let U=H.pop();j.push(U),k.parentElement.insertBefore(U,k)}for(j.push(k);A!=null;)H.push(A),j.push(A),A=A.nextSibling;for(;H.length>0;)k.parentElement.insertBefore(H.pop(),k.nextSibling);return j}function G(T,k,A){let H;H=T.firstChild;let j=H,U=0;for(;H;){let J=K(H,k,A);J>U&&(j=H,U=J),H=H.nextSibling}return j}function K(T,k,A){return F(T,k)?.5+le(A,T,k):0}function Q(T,k){re(k,T),k.callbacks.beforeNodeRemoved(T)!==!1&&(T.remove(),k.callbacks.afterNodeRemoved(T))}function ne(T,k){return!T.deadIds.has(k)}function Y(T,k,A){return(T.idMap.get(A)||i).has(k)}function re(T,k){let A=T.idMap.get(k)||i;for(let H of A)T.deadIds.add(H)}function le(T,k,A){let H=T.idMap.get(k)||i,j=0;for(let U of H)ne(T,U)&&Y(T,U,A)&&++j;return j}function ke(T,k){let A=T.parentElement,H=T.querySelectorAll("[id]");for(let j of H){let U=j;for(;U!==A&&U!=null;){let J=k.get(U);J==null&&(J=new Set,k.set(U,J)),J.add(j.id),U=U.parentElement}}}function We(T,k){let A=new Map;return ke(T,A),ke(k,A),A}return{morph:t,defaults:e}}();function Ed(i,e,{callbacks:t,...r}={}){CT.morph(i,e,{...r,callbacks:new Vh(t)})}function _v(i,e){Ed(i,e.children,{morphStyle:"innerHTML"})}var Vh=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)?!Oe("turbo:before-morph-element",{cancelable:!0,target:e,detail:{currentElement:e,newElement:t}}).defaultPrevented:!1};beforeAttributeUpdated=(e,t,r)=>!Oe("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&&Oe("turbo:morph-element",{target:e,detail:{currentElement:e,newElement:t}})}},jh=class extends Ro{static renderElement(e,t){Oe("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),_v(e,t)}async preservingPermanentElements(e){return await e()}},Wh=class i{static animationDuration=300;static get defaultCSS(){return bv`
|
141
|
-
.turbo-progress-bar {
|
142
|
-
position: fixed;
|
143
|
-
display: block;
|
144
|
-
top: 0;
|
145
|
-
left: 0;
|
146
|
-
height: 3px;
|
147
|
-
background: #0076ff;
|
148
|
-
z-index: 2147483647;
|
149
|
-
transition:
|
150
|
-
width ${i.animationDuration}ms ease-out,
|
151
|
-
opacity ${i.animationDuration/2}ms ${i.animationDuration/2}ms ease-in;
|
152
|
-
transform: translate3d(0, 0, 0);
|
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");e.type="text/css",e.textContent=i.defaultCSS;let t=wv();return t&&(e.nonce=t),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}},Gh=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 fi=class i extends Qs{static fromHTMLString(e=""){return this.fromDocument(vv(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:r}){return new this(e,t,new Gh(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}`)}},Kh=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},El={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},NT={advance:"forward",restore:"back",replace:"none"},Xh=class{identifier=yr();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=er.initialized;viewTransitioner=new Kh;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:f,willRender:y,updateHistory:v,shouldCacheSnapshot:x,acceptsStreamResponse:P,direction:F}={...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=F||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==er.initialized&&(this.recordTimingMetric(El.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(El.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=yv(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(El.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;cv(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(El.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,cv(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 cv(i){return i>=200&&i<300}var Yh=class{progressBar=new Wh;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){Oe("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}},Zh=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]}},Qh=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new Fl(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=yd(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}}},Jh=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 GE(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},ed=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(Al("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=xv(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(Al("turbo-prefetch-cache-time"))||mT}#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=Ys(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=>Oe("turbo:before-prefetch",{target:i,cancelable:!0}).defaultPrevented,td=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 Xh(this,st(e),t,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new Pl(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"&&Uh(e)===Uh(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},id=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}},rd=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)}},sd=class{render({fragment:e}){Rl.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=Fv(document.documentElement),t={};for(let r of e){let{id:s}=r;for(let n of i.querySelectorAll("turbo-stream")){let o=Cv(n.templateElement.content,s);o&&(t[s]=[r,o])}}return t}async function jT(i,e){let t=`turbo-stream-autofocus-${yr()}`,r=i.querySelectorAll("turbo-stream"),s=GT(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);bd(a)&&a.focus(),a&&a.id==t&&a.removeAttribute("id")}}async function WT(i){let[e,t]=await JE(i,()=>document.activeElement),r=e&&e.id;if(r){let s=document.getElementById(r);bd(s)&&s!=t&&s.focus()}}function GT(i){for(let e of i){let t=Sv(e.templateElement.content);if(t)return t}return null}var nd=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(wr.wrap(e))}};function KT(i){let e=i.detail?.fetchResponse;if(e instanceof Fo)return e}function XT(i){return(i.contentType??"").startsWith(wr.contentType)}var od=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(YE(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")}},ad=class extends Lo{static renderElement(e,t){Ed(e,t,{callbacks:{beforeNodeMorphed:r=>!uv(r)}});for(let r of e.querySelectorAll("turbo-frame"))uv(r)&&r.reload();Oe("turbo:morph",{detail:{currentElement:e,newElement:t}})}async preservingPermanentElements(e){return await e()}get renderMethod(){return"morph"}get shouldAutofocus(){return!1}};function uv(i){return i instanceof mi&&i.src&&i.refresh==="morph"&&!i.closest("[data-turbo-permanent]")}var ld=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return Sl(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[Sl(e)]}write(e,t){this.snapshots[Sl(e)]=t}touch(e){let t=Sl(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]}},cd=class extends Cl{snapshotCache=new ld(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?ad: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 od(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 gv();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)}},ud=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)}},hd=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){QE("turbo-cache-control",e)}},dd=class{navigator=new td(this);history=new Jh(this);view=new cd(this,document.documentElement);adapter=new Yh(this);pageObserver=new id(this);cacheObserver=new Zh;linkPrefetchObserver=new ed(this,document);linkClickObserver=new _l(this,window);formSubmitObserver=new _o(this,document);scrollObserver=new rd(this);streamObserver=new nd(this);formLinkClickObserver=new Ol(this,document.documentElement);frameRedirector=new Qh(this,document.documentElement);streamMessageRenderer=new sd;cache=new hd(this);enabled=!0;started=!1;#e=150;constructor(e){this.recentRequests=e,this.preloader=new ud(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=eT(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){hv(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(xl(document.documentElement),this.view.markVisitDirection(e.direction)),hv(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),kl(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=yd(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 Oe("turbo:click",{target:e,detail:{url:t.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return Oe("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return Oe("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return Oe("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return Oe("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return Oe("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return Oe("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 Oe("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return Oe("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 hv(i){Object.defineProperties(i,YT)}var YT={absoluteURL:{get(){return this.toString()}}},ze=new dd(kv),{cache:ZT,navigator:QT}=ze;function Ov(){ze.start()}function JT(i){ze.registerAdapter(i)}function ex(i,e){ze.visit(i,e)}function Rv(i){ze.connectStreamSource(i)}function Lv(i){ze.disconnectStreamSource(i)}function tx(i){ze.renderStreamMessage(i)}function ix(){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 rx(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 sx(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 nx(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 ox=Object.freeze({__proto__:null,navigator:QT,session:ze,cache:ZT,PageRenderer:Lo,PageSnapshot:fi,FrameRenderer:Ro,fetch:Av,config:rt,start:Ov,registerAdapter:JT,visit:ex,connectStreamSource:Rv,disconnectStreamSource:Lv,renderStreamMessage:tx,clearCache:ix,setProgressBarDelay:rx,setConfirmMethod:sx,setFormMode:nx}),pd=class extends Error{},fd=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 qh(this,this.element),this.appearanceObserver=new Hh(this,this.element),this.formLinkClickObserver=new Ol(this,this.element),this.linkInterceptor=new Fl(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=vv(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 Pl(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){xl(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){kl(this.element)}formSubmissionStarted({formElement:e}){xl(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}){kl(e,this.#h(e))}allowsImmediateRender({element:e},t){let r=Oe("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?jh: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=yv(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!Oe("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 pd(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 dv(r)??this.element}async extractForeignFrameElement(e){let t,r=CSS.escape(this.id);try{if(t=pv(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=pv(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=yd(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=dv(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 dv(i){if(i!=null){let e=document.getElementById(i);if(e instanceof mi)return e}}function pv(i,e){if(i){let t=i.getAttribute("src");if(t!=null&&e!=null&&nT(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 Mv={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"?_v(e,this.templateContent):(e.innerHTML="",e.append(this.templateContent))})},refresh(){ze.refresh(this.baseURI,this.requestId)}},md=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=Mv[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):[]}},gd=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),Rv(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),Lv(this.streamSource))}get src(){return this.getAttribute("src")||""}};mi.delegateConstructor=fd;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",mi);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",md);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",gd);(()=>{let i=document.currentScript;if(i&&!i.hasAttribute("data-turbo-suppress-warning"))for(i=i.parentElement;i;){if(i==document.body)return console.warn(bv`
|
155
|
-
You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
|
156
|
-
|
157
|
-
Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
|
158
|
-
|
159
|
-
For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements
|
160
|
-
|
161
|
-
——
|
162
|
-
Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
|
163
|
-
`,i.outerHTML);i=i.parentElement}})();window.Turbo={...ox,StreamActions:Mv};Ov();["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 ax=Wo.start();Nh(ax);})();
|
163
|
+
`);this.thumbnailLinkTarget.innerHTML=null,this.thumbnailLinkTarget.appendChild(i)}useMimeIconPreview(){let i=Td(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 Fl=class extends ie{connect(){}append(i){this.element.appendChild(i)}clear(){this.element.innerHTML=null}};var _l=class extends ie{};var Ol=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")}};var Rl=class extends ie{connect(){this.originalScrollPosition=window.scrollY,this.element.showModal(),this.element.addEventListener("close",this.handleClose.bind(this))}disconnect(){this.element.removeEventListener("close",this.handleClose)}handleClose(){window.scrollTo(0,this.originalScrollPosition)}};var Ll=class extends ie{static targets=["container","pair","template","addButton","keyInput","valueInput"];static values={limit:Number};connect(){this.updateIndices(),this.updateAddButtonState()}addPair(i){if(i.preventDefault(),this.pairTargets.length>=this.limitValue)return;let t=this.templateTarget.content.cloneNode(!0),r=this.pairTargets.length;this.updatePairIndices(t,r),this.containerTarget.appendChild(t),this.updateAddButtonState();let s=this.containerTarget.lastElementChild.querySelector('[data-key-value-store-target="keyInput"]');s&&s.focus()}removePair(i){i.preventDefault();let e=i.target.closest('[data-key-value-store-target="pair"]');e&&(e.remove(),this.updateIndices(),this.updateAddButtonState())}updateIndices(){this.pairTargets.forEach((i,e)=>{let t=i.querySelector('[data-key-value-store-target="keyInput"]'),r=i.querySelector('[data-key-value-store-target="valueInput"]');t&&(t.name=t.name.replace(/\[\d+\]/,`[${e}]`)),r&&(r.name=r.name.replace(/\[\d+\]/,`[${e}]`))})}updatePairIndices(i,e){i.querySelectorAll("input").forEach(r=>{r.name&&(r.name=r.name.replace("__INDEX__",e))})}updateAddButtonState(){let i=this.addButtonTarget;this.pairTargets.length>=this.limitValue?(i.disabled=!0,i.classList.add("opacity-50","cursor-not-allowed")):(i.disabled=!1,i.classList.remove("opacity-50","cursor-not-allowed"))}toJSON(){let i={};return this.pairTargets.forEach(e=>{let t=e.querySelector('[data-key-value-store-target="keyInput"]'),r=e.querySelector('[data-key-value-store-target="valueInput"]');t&&r&&t.value.trim()&&(i[t.value.trim()]=r.value)}),JSON.stringify(i)}toObject(){let i={};return this.pairTargets.forEach(e=>{let t=e.querySelector('[data-key-value-store-target="keyInput"]'),r=e.querySelector('[data-key-value-store-target="valueInput"]');t&&r&&t.value.trim()&&(i[t.value.trim()]=r.value)}),i}};function Ed(i){i.register("password-visibility",Ol),i.register("sidebar",_l),i.register("resource-header",oa),i.register("nested-resource-form-fields",aa),i.register("form",la),i.register("resource-drop-down",ma),i.register("resource-collapse",ga),i.register("resource-dismiss",va),i.register("frame-navigator",ba),i.register("color-mode",ya),i.register("easymde",Pa),i.register("slim-select",Ca),i.register("flatpickr",Fa),i.register("intl-tel-input",_a),i.register("select-navigator",Oa),i.register("resource-tab-list",Ra),i.register("attachment-input",Pl),i.register("attachment-preview",Cl),i.register("attachment-preview-container",Fl),i.register("remote-modal",Rl),i.register("key-value-store",Ll)}Turbo.StreamActions.redirect=function(){Turbo.clearCache();let i=this.getAttribute("url");Turbo.visit(i)};var lk=sa.start();Ed(lk);})();
|
164
164
|
/*!
|
165
165
|
* Sanitize an HTML node
|
166
166
|
*/
|
@@ -184,6 +184,12 @@ cropperjs/dist/cropper.js:
|
|
184
184
|
* Date: 2024-04-21T07:43:05.335Z
|
185
185
|
*)
|
186
186
|
|
187
|
+
@hotwired/turbo/dist/turbo.es2017-esm.js:
|
188
|
+
(*!
|
189
|
+
Turbo 8.0.12
|
190
|
+
Copyright © 2024 37signals LLC
|
191
|
+
*)
|
192
|
+
|
187
193
|
dompurify/dist/purify.es.mjs:
|
188
194
|
(*! @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
195
|
|
@@ -198,11 +204,5 @@ dompurify/dist/purify.es.mjs:
|
|
198
204
|
* @param phrase that needs interpolation, with placeholders
|
199
205
|
* @param options with values that will be used to replace placeholders
|
200
206
|
*)
|
201
|
-
|
202
|
-
@hotwired/turbo/dist/turbo.es2017-esm.js:
|
203
|
-
(*!
|
204
|
-
Turbo 8.0.12
|
205
|
-
Copyright © 2024 37signals LLC
|
206
|
-
*)
|
207
207
|
*/
|
208
208
|
//# sourceMappingURL=plutonium.min.js.map
|