Sid Gifari File Manager
🏠 Root
/
home1
/
plant149
/
wildlifesupport.net
/
wp-content
/
plugins
/
redirection
/
build
/
Editing: redirection.js
/*! Redirection v5.6.0 - please refer to license.txt for license information */ (()=>{var e,t,n,r={457:e=>{"use strict";e.exports=Math.max},703:(e,t,n)=>{"use strict";var r,o=n(2410),i=n(9183),a=n(1101),s=n(7570),l=n(9898),c=n(7388),u=n(7379),d=n(4585),p=n(9895),f=n(2153),h=n(457),m=n(1179),g=n(5985),v=n(8639),x=n(5738),y=Function,b=function(e){try{return y('"use strict"; return ('+e+").constructor;")()}catch(e){}},_=n(3492),w=n(9173),j=function(){throw new u},S=_?function(){try{return j}catch(e){try{return _(arguments,"callee").get}catch(e){return j}}}():j,k=n(7657)(),E=n(1611),C=n(8819),O=n(2517),T=n(1948),R=n(2878),P={},A="undefined"!=typeof Uint8Array&&E?E(Uint8Array):r,N={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":k&&E?E([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?r:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":P,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&E?E(E([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&k&&E?E((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":s,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&k&&E?E((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&E?E(""[Symbol.iterator]()):r,"%Symbol%":k?Symbol:r,"%SyntaxError%":c,"%ThrowTypeError%":S,"%TypedArray%":A,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":d,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet,"%Function.prototype.call%":R,"%Function.prototype.apply%":T,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":C,"%Math.abs%":p,"%Math.floor%":f,"%Math.max%":h,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":v,"%Math.sign%":x,"%Reflect.getPrototypeOf%":O};if(E)try{null.error}catch(e){var D=E(E(e));N["%Error.prototype%"]=D}var I=function e(t){var n;if("%AsyncFunction%"===t)n=b("async function () {}");else if("%GeneratorFunction%"===t)n=b("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=b("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&E&&(n=E(o.prototype))}return N[t]=n,n},F={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},L=n(3583),M=n(7533),U=L.call(R,Array.prototype.concat),B=L.call(T,Array.prototype.splice),q=L.call(R,String.prototype.replace),W=L.call(R,String.prototype.slice),H=L.call(R,RegExp.prototype.exec),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,V=function(e,t){var n,r=e;if(M(F,r)&&(r="%"+(n=F[r])[0]+"%"),M(N,r)){var o=N[r];if(o===P&&(o=I(r)),void 0===o&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=W(e,0,1),n=W(e,-1);if("%"===t&&"%"!==n)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return q(e,z,function(e,t,n,o){r[r.length]=n?q(o,G,"$1"):t||e}),r}(e),r=n.length>0?n[0]:"",o=V("%"+r+"%",t),i=o.name,a=o.value,s=!1,l=o.alias;l&&(r=l[0],B(n,U([0,1],l)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],h=W(f,0,1),m=W(f,-1);if(('"'===h||"'"===h||"`"===h||'"'===m||"'"===m||"`"===m)&&h!==m)throw new c("property names with quotes must have matching quotes");if("constructor"!==f&&p||(s=!0),M(N,i="%"+(r+="."+f)+"%"))a=N[i];else if(null!=a){if(!(f in a)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(_&&d+1>=n.length){var g=_(a,f);a=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[f]}else p=M(a,f),a=a[f];p&&!s&&(N[i]=a)}}return a}},741:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},1085:(e,t,n)=>{"use strict";var r=n(703),o=n(5298),i=n(4922),a=n(7379),s=r("%Map%",!0),l=o("Map.prototype.get",!0),c=o("Map.prototype.set",!0),u=o("Map.prototype.has",!0),d=o("Map.prototype.delete",!0),p=o("Map.prototype.size",!0);e.exports=!!s&&function(){var e,t={assert:function(e){if(!t.has(e))throw new a("Side channel does not contain "+i(e))},delete:function(t){if(e){var n=d(e,t);return 0===p(e)&&(e=void 0),n}return!1},get:function(t){if(e)return l(e,t)},has:function(t){return!!e&&u(e,t)},set:function(t,n){e||(e=new s),c(e,t,n)}};return t}},1101:e=>{"use strict";e.exports=EvalError},1179:e=>{"use strict";e.exports=Math.min},1449:(e,t,n)=>{"use strict";var r,o=n(5312),i=n(3492);try{r=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!r&&i&&i(Object.prototype,"__proto__"),s=Object,l=s.getPrototypeOf;e.exports=a&&"function"==typeof a.get?o([a.get]):"function"==typeof l&&function(e){return l(null==e?e:s(e))}},1609:e=>{"use strict";e.exports=window.React},1611:(e,t,n)=>{"use strict";var r=n(2517),o=n(8819),i=n(1449);e.exports=r?function(e){return r(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},1777:e=>{"use strict";var t=Object.prototype.toString,n=Math.max,r=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,a=function(e){for(var t=[],n=1,r=0;n<e.length;n+=1,r+=1)t[r]=e[n];return t}(arguments),s=n(0,o.length-a.length),l=[],c=0;c<s;c++)l[c]="$"+c;if(i=Function("binder","return function ("+function(e){for(var t="",n=0;n<e.length;n+=1)t+=e[n],n+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var t=o.apply(this,r(a,arguments));return Object(t)===t?t:this}return o.apply(e,r(a,arguments))}),o.prototype){var u=function(){};u.prototype=o.prototype,i.prototype=new u,u.prototype=null}return i}},1948:e=>{"use strict";e.exports=Function.prototype.apply},2153:e=>{"use strict";e.exports=Math.floor},2168:(e,t,n)=>{"use strict";var r=n(5846);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var i=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),u=["%","/","?",";","#"].concat(c),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=n(5004);function x(e,t,n){if(e&&"object"==typeof e&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o<e.indexOf("#")?"?":"#",l=e.split(a);l[0]=l[0].replace(/\\/g,"/");var x=e=l.join(a);if(x=x.trim(),!n&&1===e.split("#").length){var y=s.exec(x);if(y)return this.path=x,this.href=x,this.pathname=y[1],y[2]?(this.search=y[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var b=i.exec(x);if(b){var _=(b=b[0]).toLowerCase();this.protocol=_,x=x.substr(b.length)}if(n||b||x.match(/^\/\/[^@/]+@[^@/]+/)){var w="//"===x.substr(0,2);!w||b&&m[b]||(x=x.substr(2),this.slashes=!0)}if(!m[b]&&(w||b&&!g[b])){for(var j,S,k=-1,E=0;E<d.length;E++)-1!==(C=x.indexOf(d[E]))&&(-1===k||C<k)&&(k=C);for(-1!==(S=-1===k?x.lastIndexOf("@"):x.lastIndexOf("@",k))&&(j=x.slice(0,S),x=x.slice(S+1),this.auth=decodeURIComponent(j)),k=-1,E=0;E<u.length;E++){var C;-1!==(C=x.indexOf(u[E]))&&(-1===k||C<k)&&(k=C)}-1===k&&(k=x.length),this.host=x.slice(0,k),x=x.slice(k),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var T=this.hostname.split(/\./),R=(E=0,T.length);E<R;E++){var P=T[E];if(P&&!P.match(p)){for(var A="",N=0,D=P.length;N<D;N++)P.charCodeAt(N)>127?A+="x":A+=P[N];if(!A.match(p)){var I=T.slice(0,E),F=T.slice(E+1),L=P.match(f);L&&(I.push(L[1]),F.unshift(L[2])),F.length&&(x="/"+F.join(".")+x),this.hostname=I.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=r.toASCII(this.hostname));var M=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+M,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==x[0]&&(x="/"+x))}if(!h[_])for(E=0,R=c.length;E<R;E++){var B=c[E];if(-1!==x.indexOf(B)){var q=encodeURIComponent(B);q===B&&(q=escape(B)),x=x.split(B).join(q)}}var W=x.indexOf("#");-1!==W&&(this.hash=x.substr(W),x=x.slice(0,W));var H=x.indexOf("?");if(-1!==H?(this.search=x.substr(H),this.query=x.substr(H+1),t&&(this.query=v.parse(this.query)),x=x.slice(0,H)):t&&(this.search="",this.query={}),x&&(this.pathname=x),g[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){M=this.pathname||"";var z=this.search||"";this.path=M+z}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(i=v.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var a=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+o+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(a=a.replace("#","%23"))+r},o.prototype.resolve=function(e){return this.resolveObject(x(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if("string"==typeof e){var t=new o;t.parse(e,!1,!0),e=t}for(var n=new o,r=Object.keys(this),i=0;i<r.length;i++){var a=r[i];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),l=0;l<s.length;l++){var c=s[l];"protocol"!==c&&(n[c]=e[c])}return g[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!g[e.protocol]){for(var u=Object.keys(e),d=0;d<u.length;d++){var p=u[d];n[p]=e[p]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||m[e.protocol])n.pathname=e.pathname;else{for(var f=(e.pathname||"").split("/");f.length&&!(e.host=f.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),n.pathname=f.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var h=n.pathname||"",v=n.search||"";n.path=h+v}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var x=n.pathname&&"/"===n.pathname.charAt(0),y=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=y||x||n.host&&e.pathname,_=b,w=n.pathname&&n.pathname.split("/")||[],j=(f=e.pathname&&e.pathname.split("/")||[],n.protocol&&!g[n.protocol]);if(j&&(n.hostname="",n.port=null,n.host&&(""===w[0]?w[0]=n.host:w.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===f[0]?f[0]=e.host:f.unshift(e.host)),e.host=null),b=b&&(""===f[0]||""===w[0])),y)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,w=f;else if(f.length)w||(w=[]),w.pop(),w=w.concat(f),n.search=e.search,n.query=e.query;else if(null!=e.search)return j&&(n.host=w.shift(),n.hostname=n.host,(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.hostname=O.shift(),n.host=n.hostname)),n.search=e.search,n.query=e.query,null===n.pathname&&null===n.search||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=w.slice(-1)[0],k=(n.host||e.host||w.length>1)&&("."===S||".."===S)||""===S,E=0,C=w.length;C>=0;C--)"."===(S=w[C])?w.splice(C,1):".."===S?(w.splice(C,1),E++):E&&(w.splice(C,1),E--);if(!b&&!_)for(;E--;E)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),k&&"/"!==w.join("/").substr(-1)&&w.push("");var O,T=""===w[0]||w[0]&&"/"===w[0].charAt(0);return j&&(n.hostname=T?"":w.length?w.shift():"",n.host=n.hostname,(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.hostname=O.shift(),n.host=n.hostname)),(b=b||n.host&&w.length)&&!T&&w.unshift(""),w.length>0?n.pathname=w.join("/"):(n.pathname=null,n.path=null),null===n.pathname&&null===n.search||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.qg=x},2179:()=>{},2402:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(0===n.length)return!0;var r=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(function(e){var t=e.trim().toLowerCase();return"."===t.charAt(0)?r.toLowerCase().endsWith(t):t.endsWith("/*")?i===t.replace(/\/.*$/,""):o===t})}return!0}},2410:e=>{"use strict";e.exports=Object},2468:(e,t,n)=>{"use strict";var r=n(703),o=n(5298),i=n(4922),a=n(1085),s=n(7379),l=r("%WeakMap%",!0),c=o("WeakMap.prototype.get",!0),u=o("WeakMap.prototype.set",!0),d=o("WeakMap.prototype.has",!0),p=o("WeakMap.prototype.delete",!0);e.exports=l?function(){var e,t,n={assert:function(e){if(!n.has(e))throw new s("Side channel does not contain "+i(e))},delete:function(n){if(l&&n&&("object"==typeof n||"function"==typeof n)){if(e)return p(e,n)}else if(a&&t)return t.delete(n);return!1},get:function(n){return l&&n&&("object"==typeof n||"function"==typeof n)&&e?c(e,n):t&&t.get(n)},has:function(n){return l&&n&&("object"==typeof n||"function"==typeof n)&&e?d(e,n):!!t&&t.has(n)},set:function(n,r){l&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new l),u(e,n,r)):a&&(t||(t=a()),t.set(n,r))}};return n}:a},2517:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},2694:(e,t,n)=>{"use strict";var r=n(6925);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},2736:(e,t,n)=>{e.exports=n(6186)()},2822:(e,t,n)=>{"use strict";var r=n(9576),o=n(1609),i=n.t(o,2),a=n.n(o),s=n(3721),l=o.version.startsWith("19"),c=Symbol.for(l?"react.transitional.element":"react.element"),u=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),m=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),_=g,w=y;function j(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:a}){let s,l,c,u,d,p=!1;return function(f,h){return p?function(p,f){const h=!i(f,l),m=!o(p,s,f,l);return s=p,l=f,h&&m?(c=e(s,l),t.dependsOnOwnProps&&(u=t(r,l)),d=n(c,u,l),d):h?(e.dependsOnOwnProps&&(c=e(s,l)),t.dependsOnOwnProps&&(u=t(r,l)),d=n(c,u,l),d):m?function(){const t=e(s,l),r=!a(t,c);return c=t,r&&(d=n(c,u,l)),d}():d}(f,h):(s=f,l=h,c=e(s,l),u=t(r,l),d=n(c,u,l),p=!0,d)}}function S(e){return function(t){const n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function k(e){return e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function E(e,t){return function(t,{displayName:n}){const r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e,void 0)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=k(e);let o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=k(o),o=r(t,n)),o},r}}function C(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function O(e,t,n){return{...n,...e,...t}}var T={notify(){},get:()=>[]};function R(e,t){let n,r=T,o=0,i=!1;function a(){c.onStateChange&&c.onStateChange()}function s(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){(()=>{let t=e;for(;t;)t.callback(),t=t.next})()},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){r&&null!==e&&(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}function l(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=T)}const c={addNestedSub:function(e){s();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),l())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,s())},tryUnsubscribe:function(){i&&(i=!1,l())},getListeners:()=>r};return c}var P=(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),A=(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),N=(()=>P||A?o.useLayoutEffect:o.useEffect)();function D(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function I(e,t){if(D(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!D(e[n[r]],t[n[r]]))return!1;return!0}var F={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},L={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},M={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},U={[_]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[w]:M};function B(e){return function(e){if("object"==typeof e&&null!==e){const{$$typeof:t}=e;switch(t){case c:switch(e=e.type){case d:case f:case p:case v:case x:return e;default:switch(e=e&&e.$$typeof){case m:case g:case b:case y:case h:return e;default:return t}}case u:return t}}}(e)===y?M:U[e.$$typeof]||F}var q=Object.defineProperty,W=Object.getOwnPropertyNames,H=Object.getOwnPropertySymbols,z=Object.getOwnPropertyDescriptor,G=Object.getPrototypeOf,V=Object.prototype;function $(e,t){if("string"!=typeof t){if(V){const n=G(t);n&&n!==V&&$(e,n)}let n=W(t);H&&(n=n.concat(H(t)));const r=B(e),o=B(t);for(let i=0;i<n.length;++i){const a=n[i];if(!(L[a]||o&&o[a]||r&&r[a])){const n=z(t,a);try{q(e,a,n)}catch(e){}}}}return e}var K=Symbol.for("react-redux-context"),Y="undefined"!=typeof globalThis?globalThis:{};function X(){if(!o.createContext)return{};const e=Y[K]??=new Map;let t=e.get(o.createContext);return t||(t=o.createContext(null),e.set(o.createContext,t)),t}var Q=X(),J=[null,null];function Z(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function ee(e,t){return e===t}var te=function(e,t,n,{pure:r,areStatesEqual:i=ee,areOwnPropsEqual:a=I,areStatePropsEqual:s=I,areMergedPropsEqual:l=I,forwardRef:c=!1,context:u=Q}={}){const d=u,p=function(e){return e?"function"==typeof e?E(e):C(e,"mapStateToProps"):S(()=>({}))}(e),f=function(e){return e&&"object"==typeof e?S(t=>function(e,t){const n={};for(const r in e){const o=e[r];"function"==typeof o&&(n[r]=(...e)=>t(o(...e)))}return n}(e,t)):e?"function"==typeof e?E(e):C(e,"mapDispatchToProps"):S(e=>({dispatch:e}))}(t),h=function(e){return e?"function"==typeof e?function(e){return function(t,{displayName:n,areMergedPropsEqual:r}){let o,i=!1;return function(t,n,a){const s=e(t,n,a);return i?r(s,o)||(o=s):(i=!0,o=s),o}}}(e):C(e,"mergeProps"):()=>O}(n),m=Boolean(e);return e=>{const t=e.displayName||e.name||"Component",n=`Connect(${t})`,r={shouldHandleStateChanges:m,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:p,initMapDispatchToProps:f,initMergeProps:h,areStatesEqual:i,areStatePropsEqual:s,areOwnPropsEqual:a,areMergedPropsEqual:l};function u(t){const[n,i,a]=o.useMemo(()=>{const{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]},[t]),s=o.useMemo(()=>d,[n,d]),l=o.useContext(s),c=Boolean(t.store)&&Boolean(t.store.getState)&&Boolean(t.store.dispatch),u=Boolean(l)&&Boolean(l.store),p=c?t.store:l.store,f=u?l.getServerState:p.getState,h=o.useMemo(()=>function(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...o}){return j(t(e,o),n(e,o),r(e,o),e,o)}(p.dispatch,r),[p]),[g,v]=o.useMemo(()=>{if(!m)return J;const e=R(p,c?void 0:l.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[p,c,l]),x=o.useMemo(()=>c?l:{...l,subscription:g},[c,l,g]),y=o.useRef(void 0),b=o.useRef(a),_=o.useRef(void 0),w=o.useRef(!1),S=o.useRef(!1),k=o.useRef(void 0);N(()=>(S.current=!0,()=>{S.current=!1}),[]);const E=o.useMemo(()=>()=>_.current&&a===b.current?_.current:h(p.getState(),a),[p,a]),C=o.useMemo(()=>e=>g?function(e,t,n,r,o,i,a,s,l,c,u){if(!e)return()=>{};let d=!1,p=null;const f=()=>{if(d||!s.current)return;const e=t.getState();let n,f;try{n=r(e,o.current)}catch(e){f=e,p=e}f||(p=null),n===i.current?a.current||c():(i.current=n,l.current=n,a.current=!0,u())};return n.onStateChange=f,n.trySubscribe(),f(),()=>{if(d=!0,n.tryUnsubscribe(),n.onStateChange=null,p)throw p}}(m,p,g,h,b,y,w,S,_,v,e):()=>{},[g]);var O,T;let P;O=Z,T=[b,y,w,a,_,v],N(()=>O(...T),undefined);try{P=o.useSyncExternalStore(C,E,f?()=>h(f(),a):E)}catch(e){throw k.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${k.current.stack}\n\n`),e}N(()=>{k.current=void 0,_.current=void 0,y.current=P});const A=o.useMemo(()=>o.createElement(e,{...P,ref:i}),[i,e,P]);return o.useMemo(()=>m?o.createElement(s.Provider,{value:x},A):A,[s,A,x])}const g=o.memo(u);if(g.WrappedComponent=e,g.displayName=u.displayName=n,c){const t=o.forwardRef(function(e,t){return o.createElement(g,{...e,reactReduxForwardedRef:t})});return t.displayName=n,t.WrappedComponent=e,$(t,e)}return $(g,e)}},ne=function(e){const{children:t,context:n,serverState:r,store:i}=e,a=o.useMemo(()=>{const e=R(i);return{store:i,subscription:e,getServerState:r?()=>r:void 0}},[i,r]),s=o.useMemo(()=>i.getState(),[i]);N(()=>{const{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),s!==i.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,s]);const l=n||Q;return o.createElement(l.Provider,{value:a},t)};function re(e=Q){return function(){return o.useContext(e)}}var oe=re();function ie(e=Q){const t=e===Q?oe:re(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var ae=ie();function se(e=Q){const t=e===Q?ae:ie(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var le=se(),ce=(e,t)=>e===t;function ue(e=Q){const t=e===Q?oe:re(e),n=(e,n={})=>{const{equalityFn:r=ce}="function"==typeof n?{equalityFn:n}:n,i=t(),{store:a,subscription:l,getServerState:c}=i,u=(o.useRef(!0),o.useCallback({[e.name]:t=>e(t)}[e.name],[e])),d=(0,s.useSyncExternalStoreWithSelector)(l.addNestedSub,a.getState,c||a.getState,u,r);return o.useDebugValue(d),d};return Object.assign(n,{withTypes:()=>n}),n}var de=ue();function pe(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var fe=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),he=()=>Math.random().toString(36).substring(7).split("").join("."),me={INIT:`@@redux/INIT${he()}`,REPLACE:`@@redux/REPLACE${he()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${he()}`};function ge(e,t,n){if("function"!=typeof e)throw new Error(pe(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(pe(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(pe(1));return n(ge)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,l=!1;function c(){a===i&&(a=new Map,i.forEach((e,t)=>{a.set(t,e)}))}function u(){if(l)throw new Error(pe(3));return o}function d(e){if("function"!=typeof e)throw new Error(pe(4));if(l)throw new Error(pe(5));let t=!0;c();const n=s++;return a.set(n,e),function(){if(t){if(l)throw new Error(pe(6));t=!1,c(),a.delete(n),i=null}}}function p(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw new Error(pe(7));if(void 0===e.type)throw new Error(pe(8));if("string"!=typeof e.type)throw new Error(pe(17));if(l)throw new Error(pe(9));try{l=!0,o=r(o,e)}finally{l=!1}return(i=a).forEach(e=>{e()}),e}return p({type:me.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(pe(10));r=e,p({type:me.REPLACE})},[fe]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(pe(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[fe](){return this}}}}}function ve(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}const xe="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0!==t.length)return"object"==typeof t[0]?ve:ve(...t)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var ye,be=({dispatch:e,getState:t})=>n=>r=>"function"==typeof r?r(e,t,ye):n(r);const _e="SETTING_LOAD_START",we="SETTING_LOAD_SUCCESS",je="SETTING_LOAD_FAILED",Se="SETTING_LOAD_STATUS",ke="SETTING_SAVING",Ee="SETTING_SAVED",Ce="SETTING_SAVE_FAILED",Oe="SETTING_DATABASE_START",Te="SETTING_DATABASE_FAILED",Re="SETTING_DATABASE_SUCCESS",Pe="SETTING_DATABASE_FINISH",Ae="SETTING_DATABASE_SHOW",Ne="SETTING_API_FAILED",De="SETTING_API_SUCCESS",Ie="SETTING_API_TRY",Fe="STATUS_IN_PROGRESS",Le="STATUS_FAILED",Me="STATUS_COMPLETE",Ue="IO_EXPORTED",Be="IO_EXPORTING",qe="IO_IMPORTING",We="IO_IMPORTED",He="IO_FAILED",ze="IO_CLEAR",Ge="IO_ADD_FILE",Ve="IO_IMPORTERS",$e="ok";function Ke(e,t,n,r){const o=e[t]?{...e[t]}:[];return o[n]=r,{[t]:o}}const Ye="LOG_LOADING",Xe="LOG_LOADED",Qe="LOG_FAILED",Je="LOG_SET_SELECTED",Ze="LOG_ITEM_SAVING",et="LOG_ITEM_SAVED",tt="LOG_ITEM_FAILED",nt="LOG_DISPLAY_SET";var rt=n(5004);const ot=["groups","404s","log","io","options","support","site"];function it(e){return rt.parse(e?e.slice(1):document.location.search.slice(1))}function at(e){return Redirectioni10n.pluginRoot+"&sub=rss&module=1&token="+encodeURIComponent(e)}function st(e,t){return e.replace(/\/$/,"")+"/"+t.replace(/^\//,"")}const lt=["orderby","direction","page","per_page","filterBy","groupBy","group","displayType","displaySelected"],ct=(e,t)=>{const n=[];for(let r=0;r<e.length;r++)-1===t.indexOf(e[r])&&n.push(e[r]);return n},ut=e=>parseInt(e,10)>0||"0"===e?parseInt(e,10):e;function dt(e,t){const n={};return Object.keys(e).map(r=>{t[r]&&Array.isArray(t[r])&&-1!==t[r].indexOf(ut(e[r]))?n[r]=ut(e[r]):t[r]&&!Array.isArray(t[r])&&(n[r]=e[r])}),n}const pt=(e=[],t=[],n=[],r="",o=[],i="",a=[])=>{const s=it(),l={orderby:r,direction:"desc",page:0,per_page:parseInt(Redirectioni10n.per_page,10),selected:[],filterBy:{},groupBy:"",displayType:"standard",displaySelected:[],selectAll:!1},c=void 0===s.sub?"":s.sub;let u="standard",d=a.length>0?a[0].grouping:[];return localStorage.getItem(i+"_displayType")&&(u=localStorage.getItem(i+"_displayType")||""),"custom"===u&&localStorage.getItem(i+"_displaySelected")?d=localStorage.getItem(i+"_displaySelected").split(","):a.find(e=>e.value===u)&&(d=a.find(e=>e.value===u).grouping),-1===o.indexOf(c)&&c!==i?{...l,displayType:u,displaySelected:d}:{...l,orderby:s.orderby&&-1!==e.indexOf(s.orderby)?s.orderby:l.orderby,direction:s.direction&&"asc"===s.direction?"asc":l.direction,page:s.offset&&parseInt(s.offset,10)>0?parseInt(s.offset,10):l.page,per_page:Redirectioni10n.per_page?parseInt(Redirectioni10n.per_page,10):l.per_page,filterBy:s.filterby?dt(s.filterby,t):l.filterBy,groupBy:s.groupby&&-1!==n.indexOf(s.groupby)?s.groupby:l.groupBy,displayType:u,displaySelected:d}},ft=(e,t)=>{const n=Object.assign({},e);for(let e=0;e<lt.length;e++)void 0!==t[lt[e]]&&(n[lt[e]]=t[lt[e]]);return n};function ht(e,t){return"desc"===e.direction&&delete e.direction,e.orderby===t&&delete e.orderby,0===e.page&&delete e.page,e.per_page===parseInt(Redirectioni10n.per_page,10)&&delete e.per_page,""===e.filterBy&&""===e.filter&&(delete e.filterBy,delete e.filter),""===e.groupBy&&(delete e.groupBy,delete e.group),25!==parseInt(Redirectioni10n.per_page,10)&&(e.per_page=parseInt(Redirectioni10n.per_page,10)),delete e.selected,delete e.displaySelected,delete e.displayType,delete e.selectAll,e}const mt=e=>Object.assign({},e,{selected:[],selectAll:!1});function gt(e,t,n,r){return!0===t?{...e,selected:r.map(e=>`${e.id}`),selectAll:n}:!1===t?{...e,selected:[],selectAll:n}:{...e,selected:ct(e.selected,t).concat(ct(t,e.selected)),selectAll:n}}const vt=(e,t)=>{const n={};return e.map(({value:e,options:t})=>{n[e]=Array.isArray(t)?t.map(e=>e.value):e}),{...n,...t}},xt=e=>"object"==typeof e&&null!==e,yt=e=>0===e?"Admin AJAX returned 0":"string"==typeof e?e:xt(e)&&e.message?e.message:(console.error(e),"Unknown error "+(xt(e)?Object.keys(e):e));function bt(e,t){return function(e){return e.replace("wp-json/wp-json","wp-json").replace("=/wp-json","=")}((n=function(e){return e.replace(/\/$/,"")}(e),r=function(e,t){return-1!==e.indexOf("?")?t.replace("?","&"):t}(e,function(e){return e.replace(/^\//,"")}(t)),n+"/"+r));var n,r}let _t=[];function wt(e,t,n){return{code:(r=e,"number"==typeof r?`${r}`:xt(r)&&r.error_code?r.error_code:xt(r)&&r.code?r.code:xt(r)&&r.name?r.name:xt(r)&&r.data?.error_code?r.data.error_code:String(r)),message:yt(t),request:n,data:n.apiFetch?.data?n.apiFetch?.data:null,jsonData:e&&e.data?e.data:null};var r}const jt=e=>{if(e.status>=200&&e.status<300)return e;throw e};function St(e){var t;return e.headers.get("x-wp-nonce")&&Et.nonceMiddleware&&(Et.nonceMiddleware.nonce=null!==(t=e.headers.get("x-wp-nonce"))&&void 0!==t?t:Et.nonceMiddleware.nonce),e}const kt=e=>e.text(),Et=e=>{const t=[..._t,e=>(e=>fetch(e.url,e).then(St).then(t=>((e,t)=>(t.apiFetch={action:t.url.replace(/[\?&]_wpnonce=[a-f0-9]*/,"")+" "+t.method.toUpperCase(),body:"object"==typeof t.body?JSON.stringify(t.body):t.body},t.headers=e.headers,e.status&&void 0!==e.statusText&&(t.apiFetch.status=e.status,t.apiFetch.statusText=e.statusText),e))(t,e)).then(kt).then(t=>((e,t)=>(t.apiFetch&&(t.apiFetch.data=e),e))(t,e)).then(t=>((e,t)=>{const n=t.apiFetch?.status;if(""===e&&void 0!==n&&(n<200||n>300))return e;try{const n=JSON.parse(e.replace(/\ufeff/,""));if(0===n)throw wt("json-zero","Failed to get data",t);return n}catch(e){throw wt(e,e?.message,t)}})(t,e)).then(t=>((e,t)=>{if(e?.error||e?.error_code)throw wt(e,e.message,t);if(t.apiFetch){const{status:n,statusText:r}=t.apiFetch;if(e?.code&&e?.message)throw wt(e,e,t);if(void 0!==n&&(n<200||n>=300))throw wt(n,r,t)}return e})(t,e)))(e)],n=e=>r=>{const o=t[e];return o?o(r,e===t.length-1?()=>Promise.resolve():n(e+1)):Promise.reject(new Error("Middleware step is undefined"))};return new Promise((t,r)=>{n(0)(e).then(e=>t(e)).catch(n=>{if("rest_cookie_invalid_nonce"!==n.code)return r(n);window.fetch("admin-ajax.php?action=rest-nonce").then(jt).then(kt).then(n=>{Et.nonceMiddleware.nonce=n,Et(e).then(t).catch(r)}).catch(r)})})};Et.getUrl=e=>Et.rootURLMiddleware({url:e},e=>Et.nonceMiddleware(e,e=>e.url)),Et.use=function(e){_t.unshift(e)},Et.createNonceMiddleware=e=>{const t=(e=>{const t=(e,n)=>{const{headers:r={}}=e;for(const o in r)if("x-wp-nonce"===o.toLowerCase()&&r[o]===t.nonce)return n(e);return n({...e,headers:{...r,"X-WP-Nonce":t.nonce}})};return t.nonce=e,t})(e);return Et.nonceMiddleware=t,t},Et.createRootURLMiddleware=e=>{const t=function(e){const t=(t,n)=>"http"===t.url.substr(0,4)?n(t):n({...t,url:bt(e,t.url)});return t.rootURL=e,t}(e);return Et.rootURLMiddleware=t,t},Et.resetMiddlewares=()=>{_t=[]},Et.replaceRootURLMiddleware=e=>{for(let t=0;t<_t.length;t++)_t[t]===Et.rootURLMiddleware&&(_t[t]=Et.createRootURLMiddleware(e))};const Ct=Et,Ot=window.wp.i18n,Tt=(e,t,n,r,o={})=>(i,a)=>{const{table:s,total:l}=a()[r.store],c={bulk:t};Array.isArray(n)?c.items=n:s.selectAll||(c.items=s.selected),"delete"===t&&s.page>0&&s.per_page*s.page===l-1&&(s.page-=1);const u=function(e,t){return t?(0,Ot.sprintf)((0,Ot._n)("Are you sure you want to delete this item?","Are you sure you want to delete the %d selected items?",e,"redirection"),e):(0,Ot.sprintf)((0,Ot.__)("Are you sure want to delete all %d matching items?","redirection"),e)}(c.items&&!0!==c.items?c.items.length:l,Array.isArray(c.items));if("delete"===t&&!o.deleteConfirm&&!confirm(u))return;const d=ft(s,c),p={items:c.items,...o};delete o.deleteConfirm,s.selectAll&&(p.global=!0);const f=c.items?c.items.map(e=>parseInt(e,10)):[-1];return Ct(e(t,p,ht(s,r.order))).then(e=>{i({type:r.saved,...e,saving:f})}).catch(e=>{i({type:r.failed,error:e,saving:f})}),i({type:r.saving,table:d,saving:f})},Rt=(e,t,n,r,o)=>(Ct(e).then(e=>{o({type:r.saved,item:e.item,items:e.items,total:e.total,saving:[n.id]})}).catch(e=>{o({type:r.failed,error:e,item:n,saving:[n.id]})}),o({type:r.saving,table:t,item:n,saving:[n.id]})),Pt=(e,t,n,r="id")=>(o,i)=>{const{table:a}=i()[n.store];return a.page=0,a.orderby=r,a.direction="desc",a.filterBy={},a.groupBy="",Rt(e(t,{orderby:"id",direction:"desc",per_page:a.per_page}),a,t,n,o)},At=(e,t,n,r)=>(o,i)=>{const{table:a}=i()[r.store];return Rt(e(t,n),a,n,r,o)},Nt=(e,t)=>{const n={};for(const r in t)void 0===e[r]&&(n[r]=t[r]);return n},Dt=(e,t)=>{for(const n in e)if(e[n]!==t[n])return!1;return!0},It=(e,t,n,r={},o={},i=e=>e)=>{const{table:a={},rows:s}=o,l=i(ft(a,r)),c=(u=ht({...a,...r},n.order),Object.keys(u).filter(e=>u[e]).reduce((e,t)=>(e[t]=u[t],e),{}));var u;if(!(Dt(l,a)&&s.length>0&&Dt(r,{})))return Ct(e(c)).then(e=>{t({type:n.saved,...e})}).catch(e=>{t({type:n.failed,error:e})}),t({table:l,type:n.saving,...Nt(l,r)})},Ft=(e,t,n)=>{const r=e.slice(0);for(let o=0;o<e.length;o++)parseInt(e[o].id,10)===t.id&&(r[o]=n(e[o]));return r},Lt=(e,t)=>t.item?Ft(e.rows,t.item,e=>({...e,...t.item,original:e})):e.rows,Mt=(e,t)=>t.item?Ft(e.rows,t.item,e=>e.original):e.rows,Ut=(e,t)=>t.item?Lt(e,t):t.items?t.items:e.rows,Bt=(e,t)=>t.table?{...e.table,...t.table}:e.table,qt=(e,t)=>void 0!==t.total?t.total:e.total,Wt=(e,t)=>[...e.saving,...t.saving],Ht=(e,t)=>e.saving.filter(e=>-1===t.saving.indexOf(e)),zt="ERROR_LOADING",Gt="ERROR_LOADED",Vt="ERROR_FAILED",$t="ERROR_SET_SELECTED",Kt="ERROR_ITEM_SAVING",Yt="ERROR_ITEM_SAVED",Xt="ERROR_ITEM_FAILED",Qt="ERROR_DISPLAY_SET",Jt="GROUP_LOADING",Zt="GROUP_LOADED",en="GROUP_FAILED",tn="GROUP_SET_SELECTED",nn="GROUP_ITEM_SAVING",rn="GROUP_ITEM_FAILED",on="GROUP_ITEM_SAVED",an="GROUP_DISPLAY_SET",sn="REDIRECT_LOADING",ln="REDIRECT_LOADED",cn="REDIRECT_FAILED",un="REDIRECT_SET_SELECTED",dn="REDIRECT_ITEM_SAVING",pn="REDIRECT_ITEM_FAILED",fn="REDIRECT_ITEM_SAVED",hn="REDIRECT_ADD_TOP",mn="REDIRECT_DISPLAY_SET",gn="MESSAGE_CLEAR_ERRORS",vn="MESSAGE_CLEAR_NOTICES",xn=(e,t)=>e.slice(0).concat([t]),yn=e=>Math.max(0,e.inProgress-1),bn={REDIRECT_ITEM_SAVED:(0,Ot.__)("Redirection saved","redirection"),LOG_ITEM_SAVED:(0,Ot.__)("Log deleted","redirection"),SETTING_SAVED:(0,Ot.__)("Settings saved","redirection"),GROUP_ITEM_SAVED:(0,Ot.__)("Group saved","redirection"),ERROR_ITEM_SAVED:(0,Ot.__)("404 deleted","redirection")},wn="INFO_LOADING",jn="INFO_LOADED_AGENT",Sn="INFO_FAILED",kn="INFO_LOADED_HTTP",En="INFO_CLEAR_HTTP";function Cn(e,t,n){return{...e,[t[n]]:t}}const On=function(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o;try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:me.INIT}))throw new Error(pe(12));if(void 0===n(void 0,{type:me.PROBE_UNKNOWN_ACTION()}))throw new Error(pe(13))})}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let i=!1;const a={};for(let o=0;o<r.length;o++){const s=r[o],l=n[s],c=e[s],u=l(c,t);if(void 0===u)throw t&&t.type,new Error(pe(14));a[s]=u,i=i||u!==c}return i=i||r.length!==Object.keys(e).length,i?a:e}}({settings:function(e={},t){switch(t.type){case Ie:return{...e,apiTest:{...e.apiTest,...Ke(e.apiTest,t.id,t.method,{status:"loading"})}};case De:return{...e,apiTest:{...e.apiTest,...Ke(e.apiTest,t.id,t.method,{status:$e})}};case Ne:return{...e,apiTest:{...e.apiTest,...Ke(e.apiTest,t.id,t.method,{status:"fail",error:t.error})}};case Ae:return{...e,showDatabase:!0};case He:case Pe:return{...e,showDatabase:!1,database:{...e.database,status:$e}};case Oe:return{...e,database:{...e.database,inProgress:!0,result:$e,reason:"skip"!==t.arg&&"retry"!==t.arg&&e.database.reason},showDatabase:"stop"!==t.arg};case Re:return{...e,database:{...e.database,...t.database}};case Te:return{...e,database:{...e.database,result:Le,reason:t.error}};case _e:return{...e,loadStatus:Fe};case we:return{...e,loadStatus:Me,values:t.values,groups:t.groups,postTypes:t.postTypes,installed:t.installed,canDelete:t.canDelete};case je:return{...e,loadStatus:Le,error:t.error};case ke:return{...e,saveStatus:Fe,warning:!1};case Ee:return{...e,saveStatus:Me,values:t.values,groups:t.groups,installed:t.installed,warning:!!t.warning&&t.warning};case Ce:return{...e,saveStatus:Le,error:t.error};case Se:return{...e,pluginStatus:t.pluginStatus}}return e},log:function(e={},t){switch(t.type){case Je:return{...e,table:gt(e.table,t.items,t.isEverything,e.rows)};case Ze:return{...e,table:mt(Bt(e,t)),saving:Wt(e,t),rows:Lt(e,t)};case et:return{...e,rows:Ut(e,t),total:qt(e,t),saving:Ht(e,t)};case Ye:return{...e,table:Bt(e,t),status:Fe,saving:[],logType:t.logType,requestCount:e.requestCount+1};case Qe:return{...e,status:Le,saving:[]};case Xe:return{...e,rows:Ut(e,t),status:Me,total:qt(e,t),table:mt(e.table)};case tt:return{...e,saving:Ht(e,t),rows:Mt(e,t)};case nt:return{...e,table:{...e.table,displayType:t.displayType,displaySelected:t.displaySelected}}}return e},error:function(e={},t){switch(t.type){case $t:return{...e,table:gt(e.table,t.items,t.isEverything,e.rows)};case Kt:return{...e,table:mt(Bt(e,t)),saving:Wt(e,t),rows:Lt(e,t)};case Yt:return{...e,rows:Ut(e,t),total:qt(e,t),saving:Ht(e,t)};case zt:return{...e,table:Bt(e,t),status:Fe,saving:[],requestCount:e.requestCount+1,rows:[]};case Vt:return{...e,status:Le,saving:[]};case Gt:return{...e,rows:Ut(e,t),status:Me,total:qt(e,t),table:mt(e.table)};case Xt:return{...e,saving:Ht(e,t),rows:Mt(e,t)};case Qt:return{...e,table:{...e.table,displayType:t.displayType,displaySelected:t.displaySelected}}}return e},io:function(e={},t){switch(t.type){case Be:return{...e,exportStatus:Fe};case Ue:return{...e,exportStatus:Me,exportData:t.data};case Ge:return{...e,file:t.file};case ze:return{...e,file:!1,lastImport:!1,exportData:!1};case He:return{...e,importingStatus:Le,exportStatus:Le,lastImport:!1,file:!1,exportData:!1};case qe:return{...e,importingStatus:Fe,lastImport:!1,file:!!t.file&&t.file};case We:return{...e,lastImport:t.total,importingStatus:Me,file:!1};case Ve:return{...e,importers:t.importers}}return e},group:function(e={},t){switch(t.type){case Jt:return{...e,table:Bt(e,t),status:Fe,saving:[]};case Zt:return{...e,rows:Ut(e,t),status:Me,total:qt(e,t),table:mt(e.table)};case nn:return{...e,table:mt(Bt(e,t)),saving:Wt(e,t),rows:Lt(e,t)};case on:return{...e,rows:Ut(e,t),total:qt(e,t),saving:Ht(e,t)};case tn:return{...e,table:gt(e.table,t.items,t.isEverything,e.rows)};case en:return{...e,status:Le,saving:[]};case rn:return{...e,saving:Ht(e,t),rows:Mt(e,t)};case an:return{...e,table:{...e.table,displayType:t.displayType,displaySelected:t.displaySelected}}}return e},redirect:function(e={},t){switch(t.type){case hn:return{...e,addTop:t.onoff};case sn:return{...e,table:Bt(e,t),status:Fe,saving:[]};case ln:return{...e,rows:Ut(e,t),status:Me,total:qt(e,t),table:mt(e.table)};case dn:return{...e,table:mt(Bt(e,t)),saving:Wt(e,t),rows:Lt(e,t)};case fn:return{...e,rows:Ut(e,t),total:qt(e,t),saving:Ht(e,t)};case un:return{...e,table:gt(e.table,t.items,t.isEverything,e.rows)};case cn:return{...e,status:Le,saving:[]};case pn:return{...e,saving:Ht(e,t),rows:Mt(e,t)};case mn:return{...e,table:{...e.table,displayType:t.displayType,displaySelected:t.displaySelected}}}return e},message:function(e={},t){switch(t.type){case He:case en:case pn:case rn:case Qe:case tt:case je:case Ce:case Xt:case Vt:case Te:case cn:const o=(n=e.errors,r=t.error,n.slice(0).concat([r]));return console.error(t.error.message),{...e,errors:o,inProgress:yn(e)};case Ze:case dn:case ke:case Kt:case nn:return{...e,inProgress:e.inProgress+1};case et:case fn:case Ee:case on:case Yt:return{...e,notices:xn(e.notices,bn[t.type]),inProgress:yn(e)};case vn:return{...e,notices:[]};case gn:return{...e,errors:[]}}var n,r;return e},info:function(e={},t){switch(t.type){case wn:return{...e,status:Fe,http:!1};case"INFO_LOADED_GEO":return{...e,status:Me,maps:Cn(e.maps,t.map,"ip")};case jn:return{...e,status:Me,agents:Cn(e.agents,t.agent,"agent")};case Sn:return{...e,status:Le,error:t.error};case kn:return{...e,status:Me,http:t.http};case En:return{...e,http:!1}}return e}}),Tn=On;function Rn(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Rn(e[n],t[n]))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(!Rn(e[r],t[r]))return!1}return!0}return!1}function Pn(e){return function(e){const t=new URLSearchParams(e),n={},r=new Set;t.forEach((e,t)=>r.add(t));for(const e of r){const r=e.replace(/\[\]$/,""),o=t.getAll(e);o.length>1?n[r]=o:1===o.length&&(n[r]=o[0])}return n}(e?e.slice(1):document.location.search.slice(1))}function An(e,t,n){const r=Pn(n);for(const n in e){const o=Rn(t[n],e[n]);e[n]&&!o||"page"===n?r[n.toLowerCase()]=e[n]:o&&delete r[n.toLowerCase()]}return"?"+function(e){const t=new URLSearchParams;for(const n in e){const r=e[n];if(null!=r)if(Array.isArray(r))for(const e of r)null!=e&&t.append(`${n}[]`,String(e));else t.append(n,String(r))}return t.toString()}(r)}function Nn(e,t){const n=Pn(t);return n.sub&&-1!==e.indexOf(n.sub)?n.sub:e[0]}function Dn(e,t){localStorage.setItem(e+"_displayType",t.displayType),"custom"===t.displayType?localStorage.setItem(e+"_displaySelected",t.displaySelected.join(",")):localStorage.removeItem(e+"_displaySelected")}const In=[be,()=>e=>t=>{switch(t.type){case dn:case nn:case sn:case Jt:case Ye:case zt:((e,t)=>{const n=function(){const e=it(void 0);return-1!==ot.indexOf(e.sub)?e.sub:"redirect"}(),r={redirect:[[sn,dn],"id"],groups:[[Jt,nn],"name"],log:[[Ye],"date"],"404s":[[zt],"date"]};if(r[n]&&e===r[n][0].find(t=>t===e)){const{orderby:e,direction:o,page:i,per_page:a,filterBy:s,groupBy:l}=t,c={page:"redirection.php",sub:n,orderby:e,direction:o,per_page:a,filterBy:s,groupBy:l,offset:i},u={orderby:r[n][1],direction:"desc",offset:0,filterBy:{},per_page:parseInt(Redirectioni10n.per_page,10),groupBy:"",sub:"redirect"};l&&(u.orderby="total"),function(e,t){const n=An(e,t,"?");document.location.search!==n&&history.pushState({},"",n)}(c,u)}})(t.type,t.table?t.table:t);break;case mn:Dn("redirect",t);break;case nt:Dn("log",t);break;case Qt:Dn("404s",t);break;case an:Dn("group",t)}return e(t)}];function Fn(e={}){const t=ge(Tn,e,xe(function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(pe(15))};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map(e=>e(a));return i=ve(...s)(o.dispatch),{...o,dispatch:i}}}(...In)));return t}function Ln(){const e=Redirectioni10n&&Redirectioni10n.preload&&Redirectioni10n.preload.pluginStatus?Redirectioni10n.preload.pluginStatus:[];return{loadStatus:Fe,saveStatus:!1,error:!1,installed:"",postTypes:[],pluginStatus:e,canDelete:!1,showDatabase:!1,apiTest:{},database:Redirectioni10n.database?Redirectioni10n.database:{},values:Redirectioni10n.settings?Redirectioni10n.settings:{},api:Redirectioni10n.api?Redirectioni10n.api:[],warning:!1,groups:[]}}const Mn=e=>"url"===e?[{name:"url",title:(0,Ot.__)("Source URL","redirection"),primary:!0,sortable:!1},{name:"count",title:(0,Ot.__)("Count","redirection"),sortable:!0}]:"ip"===e?[{name:"ip",title:(0,Ot.__)("IP","redirection"),primary:!0,sortable:!1},{name:"count",title:(0,Ot.__)("Count","redirection"),sortable:!0}]:"agent"===e?[{name:"agent",title:(0,Ot.__)("User Agent","redirection"),primary:!0,sortable:!1},{name:"count",title:(0,Ot.__)("Count","redirection"),sortable:!0}]:[{name:"date",title:(0,Ot.__)("Date","redirection")},{name:"method",title:(0,Ot.__)("Method","redirection"),sortable:!1},{name:"domain",title:(0,Ot.__)("Domain","redirection"),sortable:!1},{name:"url",title:(0,Ot.__)("Source URL","redirection"),primary:!0},{name:"target",title:(0,Ot.__)("Target URL","redirection"),sortable:!1},{name:"redirect_by",title:(0,Ot.__)("Redirect By","redirection"),sortable:!1},{name:"code",title:(0,Ot.__)("HTTP code","redirection"),sortable:!1},{name:"referrer",title:(0,Ot.__)("Referrer","redirection"),sortable:!1},{name:"agent",title:(0,Ot.__)("User Agent","redirection"),sortable:!1},{name:"ip",title:(0,Ot.__)("IP","redirection"),sortable:!1}],Un=e=>e?[{value:"group",label:(0,Ot.__)("Group","redirection"),grouping:[e,"count"]}]:[{value:"standard",label:(0,Ot.__)("Standard Display","redirection"),grouping:["date","url","target","agent","ip"]},{value:"minimal",label:(0,Ot.__)("Compact Display","redirection"),grouping:["date","url"]},{value:"all",label:(0,Ot.__)("Display All","redirection"),grouping:Bn(e).map(e=>e.value)}],Bn=e=>"url"===e?[{value:"url",label:(0,Ot.__)("URL","redirection")},{value:"count",label:(0,Ot.__)("Count","redirection")}]:"agent"===e?[{value:"agent",label:(0,Ot.__)("User Agent","redirection")},{value:"count",label:(0,Ot.__)("Count","redirection")}]:"ip"===e?[{value:"ip",label:(0,Ot.__)("IP","redirection")},{value:"count",label:(0,Ot.__)("Count","redirection")}]:[{value:"date",label:(0,Ot.__)("Date","redirection")},{value:"method",label:(0,Ot.__)("Method","redirection")},{value:"domain",label:(0,Ot.__)("Domain","redirection")},{value:"url",label:(0,Ot.__)("URL","redirection")},{value:"redirect_by",label:(0,Ot.__)("Redirect By","redirection")},{value:"code",label:(0,Ot.__)("HTTP code","redirection")},{value:"referrer",label:(0,Ot.__)("Referrer","redirection")},{value:"agent",label:(0,Ot.__)("User Agent","redirection")},{value:"target",label:(0,Ot.__)("Target","redirection")},{value:"ip",label:(0,Ot.__)("IP","redirection")}],qn=e=>{const t=[{value:"",label:(0,Ot.__)("No grouping","redirection")},{value:"url",label:(0,Ot.__)("Group by URL","redirection")},{value:"agent",label:(0,Ot.__)("Group by user agent","redirection")}];return e>0&&t.push({value:"ip",label:(0,Ot.__)("Group by IP","redirection")}),t},Wn=()=>[{label:(0,Ot.__)("Method","redirection"),value:"method",options:[{label:"GET",value:"get"},{label:"POST",value:"post"},{label:"HEAD",value:"head"}]},{label:(0,Ot.__)("Redirect By","redirection"),value:"redirect_by",options:[{label:(0,Ot.__)("WordPress","redirection"),value:"wordpress"},{label:(0,Ot.__)("Redirection","redirection"),value:"redirection"}]}];function Hn(){const e=it();let t="date";return"404s"===e.sub&&e.groupby&&(t="total"),{rows:[],saving:[],total:0,status:Fe,table:pt(["ip","url","total"],vt(Wn(),{url:!0,ip:!0,"url-exact":!0,agent:!0,referrer:!0,target:!0,domain:!0}),["url","ip","agent"],t,["log"],"log",Un()),requestCount:0}}const zn="url",Gn="pass",Vn="error",$n="random",Kn="nothing",Yn="url",Xn="login",Qn="referrer",Jn="agent",Zn="cookie",er="header",tr="custom",nr="role",rr="server",or="ip",ir="page",ar="language";function sr(e,t,n=""){const{url_from:r="",url_notfrom:o=""}=t;return{[e]:t[e]?t[e]:n,url_from:r,url_notfrom:o}}function lr(e,t,n=""){const{regex:r=!1}=t;return{regex:r,...sr(e,t,n)}}function cr(e){const{value:t=""}=e;return{value:t,...lr("name",e)}}const ur={[Yn]:function(e){const{url:t=""}=e;return{url:t}},[Xn]:function(e){const{logged_in:t="",logged_out:n=""}=e;return{logged_in:t,logged_out:n}},[Qn]:function(e){return lr("referrer",e)},[Jn]:function(e){return lr("agent",e)},[Zn]:cr,[er]:cr,[tr]:function(e){return sr("filter",e)},[nr]:function(e){return sr("role",e)},[rr]:function(e){return sr("server",e)},[or]:function(e){return sr("ip",e,[])},[ir]:function(e){const{page:t="404",url:n=""}=e;return{page:t,url:n}},[ar]:function(e){return sr("language",e)}},dr=e=>e===zn||e===Gn,pr=(e,t,n)=>({id:0,url:e,match_type:Yn,action_type:zn,action_data:{url:""},group_id:t,title:"",action_code:301,position:0,match_data:{source:n}});function fr(e,t){return ur[e]&&t?ur[e](t):null}const hr=()=>[{value:Yn,label:(0,Ot.__)("URL only","redirection")},{value:Xn,label:(0,Ot.__)("URL and login status","redirection")},{value:nr,label:(0,Ot.__)("URL and role/capability","redirection")},{value:Qn,label:(0,Ot.__)("URL and referrer","redirection")},{value:Jn,label:(0,Ot.__)("URL and user agent","redirection")},{value:Zn,label:(0,Ot.__)("URL and cookie","redirection")},{value:or,label:(0,Ot.__)("URL and IP","redirection")},{value:rr,label:(0,Ot.__)("URL and server","redirection")},{value:er,label:(0,Ot.__)("URL and HTTP header","redirection")},{value:tr,label:(0,Ot.__)("URL and custom filter","redirection")},{value:ir,label:(0,Ot.__)("URL and WordPress page type","redirection")},{value:ar,label:(0,Ot.__)("URL and language","redirection")}],mr=()=>[{value:zn,label:(0,Ot.__)("Redirect to URL","redirection")},{value:$n,label:(0,Ot.__)("Redirect to random post","redirection")},{value:Gn,label:(0,Ot.__)("Pass-through","redirection")},{value:Vn,label:(0,Ot.__)("Error (404)","redirection")},{value:Kn,label:(0,Ot.__)("Do nothing (ignore)","redirection")}],gr=()=>[{value:"301",label:(0,Ot.__)("301 - Moved Permanently","redirection")},{value:"302",label:(0,Ot.__)("302 - Found","redirection")},{value:"303",label:(0,Ot.__)("303 - See Other","redirection")},{value:"304",label:(0,Ot.__)("304 - Not Modified","redirection")},{value:"307",label:(0,Ot.__)("307 - Temporary Redirect","redirection")},{value:"308",label:(0,Ot.__)("308 - Permanent Redirect","redirection")}],vr=()=>[{value:"400",label:(0,Ot.__)("400 - Bad Request","redirection")},{value:"401",label:(0,Ot.__)("401 - Unauthorized","redirection")},{value:"403",label:(0,Ot.__)("403 - Forbidden","redirection")},{value:"404",label:(0,Ot.__)("404 - Not Found","redirection")},{value:"410",label:(0,Ot.__)("410 - Gone","redirection")},{value:"418",label:(0,Ot.__)("418 - I'm a teapot","redirection")},{value:"451",label:(0,Ot.__)("451 - Unavailable For Legal Reasons","redirection")},{value:"500",label:(0,Ot.__)("500 - Internal Server Error","redirection")},{value:"501",label:(0,Ot.__)("501 - Not implemented","redirection")},{value:"502",label:(0,Ot.__)("502 - Bad Gateway","redirection")},{value:"503",label:(0,Ot.__)("503 - Service Unavailable","redirection")},{value:"504",label:(0,Ot.__)("504 - Gateway Timeout","redirection")}],xr=()=>gr().concat(vr()),yr=()=>[{value:"flag_regex",label:(0,Ot.__)("Regex","redirection")},{value:"flag_trailing",label:(0,Ot.__)("Ignore Slash","redirection")},{value:"flag_case",label:(0,Ot.__)("Ignore Case","redirection")}],br=()=>[{value:"exactorder",label:(0,Ot.__)("Exact match","redirection")},{value:"exact",label:(0,Ot.__)("Exact match in any order","redirection")},{value:"ignore",label:(0,Ot.__)("Ignore all parameters","redirection")},{value:"pass",label:(0,Ot.__)("Ignore & pass parameters to the target","redirection")}],_r=e=>"url"===e?[{name:"url",title:(0,Ot.__)("Source URL","redirection"),primary:!0,sortable:!1},{name:"count",title:(0,Ot.__)("Count","redirection"),sortable:!0}]:"agent"===e?[{name:"agent",title:(0,Ot.__)("User Agent","redirection"),primary:!0,sortable:!1},{name:"count",title:(0,Ot.__)("Count","redirection"),sortable:!0}]:"ip"===e?[{name:"ip",title:(0,Ot.__)("IP","redirection"),primary:!0,sortable:!1},{name:"count",title:(0,Ot.__)("Count","redirection"),sortable:!0}]:[{name:"date",title:(0,Ot.__)("Date","redirection")},{name:"method",title:(0,Ot.__)("Method","redirection")},{name:"domain",title:(0,Ot.__)("Domain","redirection")},{name:"url",title:(0,Ot.__)("Source URL","redirection"),primary:!0},{name:"code",title:(0,Ot.__)("HTTP code","redirection"),sortable:!1},{name:"referrer",title:(0,Ot.__)("Referrer","redirection"),sortable:!1},{name:"agent",title:(0,Ot.__)("User Agent","redirection"),sortable:!1},{name:"ip",title:(0,Ot.__)("IP","redirection"),sortable:!1}],wr=(e,t)=>{const n=[{id:"delete",name:(0,Ot.__)("Delete","redirection")}];return"ip"===e?n.concat([{id:"redirect-ip",name:(0,Ot.__)("Redirect All","redirection")},{id:"block",name:(0,Ot.__)("Block IP","redirection")}]):"agent"===e?n:n.concat([{id:"redirect-url",name:(0,Ot.__)("Redirect All","redirection"),isEverything:!1},{id:"ignore",name:(0,Ot.__)("Ignore URL","redirection"),isEverything:!1}])},jr=e=>{const t=[{value:"",label:(0,Ot.__)("No grouping","redirection")},{value:"url",label:(0,Ot.__)("Group by URL","redirection")},{value:"agent",label:(0,Ot.__)("Group by user agent","redirection")}];return e>0&&t.push({value:"ip",label:(0,Ot.__)("Group by IP","redirection")}),t};function Sr(e){return e?[{value:"group",label:(0,Ot.__)("Group","redirection"),grouping:[e,"count"]}]:[{value:"standard",label:(0,Ot.__)("Standard Display","redirection"),grouping:["date","url","agent","ip"]},{value:"minimal",label:(0,Ot.__)("Compact Display","redirection"),grouping:["date","url"]},{value:"all",label:(0,Ot.__)("Display All","redirection"),grouping:kr(e).map(e=>e.value)}]}function kr(e){return"url"===e?[{value:"url",label:(0,Ot.__)("URL","redirection")},{value:"count",label:(0,Ot.__)("Count","redirection")}]:"agent"===e?[{value:"agent",label:(0,Ot.__)("User Agent","redirection")},{value:"count",label:(0,Ot.__)("Count","redirection")}]:"ip"===e?[{value:"ip",label:(0,Ot.__)("IP","redirection")},{value:"count",label:(0,Ot.__)("Count","redirection")}]:[{value:"date",label:(0,Ot.__)("Date","redirection")},{value:"method",label:(0,Ot.__)("Method","redirection")},{value:"domain",label:(0,Ot.__)("Domain","redirection")},{value:"url",label:(0,Ot.__)("URL","redirection")},{value:"code",label:(0,Ot.__)("HTTP code","redirection")},{value:"referrer",label:(0,Ot.__)("Referrer","redirection")},{value:"agent",label:(0,Ot.__)("User Agent","redirection")},{value:"ip",label:(0,Ot.__)("IP","redirection")}]}const Er=()=>[{label:(0,Ot.__)("Method","redirection"),value:"method",options:[{label:"GET",value:"get"},{label:"POST",value:"post"},{label:"HEAD",value:"head"}]},{label:(0,Ot.__)("HTTP Status Code","redirection"),value:"http",options:xr().filter(e=>e.value>=400&&e.value<500)}];function Cr(){const e=it();let t="date";return"404s"===e.sub&&e.groupby&&(t="total"),{rows:[],saving:[],total:0,status:Fe,table:pt(["ip","url","total"],vt(Er(),{url:!0,ip:!0,referrer:!0,agent:!0,"url-exact":!0,domain:!0}),["url","ip","agent"],t,["404s"],"404s",Sr()),requestCount:0}}const Or=(e,t)=>Redirectioni10n.pluginRoot+"&sub=io&export="+e+"&exporter="+t+"&_wpnonce="+Ct.nonceMiddleware.nonce,Tr=()=>[{value:"name",label:(0,Ot.__)("Name","redirection")},{value:"module",label:(0,Ot.__)("Module","redirection")},{value:"status",label:(0,Ot.__)("Status","redirection")},{value:"redirects",label:(0,Ot.__)("Redirects","redirection")}],Rr=()=>[{value:"standard",label:(0,Ot.__)("Standard Display","redirection"),grouping:["name","module","redirects"]},{value:"minimal",label:(0,Ot.__)("Compact Display","redirection"),grouping:["name"]},{value:"all",label:(0,Ot.__)("Display All","redirection"),grouping:Tr().map(e=>e.value)}],Pr=e=>[{label:(0,Ot.__)("Status","redirection"),value:"status",options:[{label:(0,Ot.__)("Enabled","redirection"),value:"enabled"},{label:(0,Ot.__)("Disabled","redirection"),value:"disabled"}]},{label:(0,Ot.__)("Module","redirection"),value:"module",options:e}];function Ar(){return{rows:[],saving:[],total:0,status:Fe,table:pt(["name"],vt(Pr([{value:1,label:"WordPress"},{value:2,label:"Apache"},{value:3,label:"Nginx"}]),{name:!0}),[],"name",["groups"],"group",Rr())}}const Nr=()=>[{value:"source",label:(0,Ot.__)("Source","redirection")},{value:"flags",label:(0,Ot.__)("URL options","redirection")},{value:"query",label:(0,Ot.__)("Query Parameters","redirection")},{value:"title",label:(0,Ot.__)("Title","redirection")},{value:"target",label:(0,Ot.__)("Target","redirection")},{value:"code",label:(0,Ot.__)("HTTP code","redirection")},{value:"match_type",label:(0,Ot.__)("Match Type","redirection")},{value:"position",label:(0,Ot.__)("Position","redirection")},{value:"last_count",label:(0,Ot.__)("Hits","redirection")},{value:"last_access",label:(0,Ot.__)("Last Access","redirection")},{value:"status",label:(0,Ot.__)("Status","redirection")},{value:"action_type",label:(0,Ot.__)("Action Type","redirection")},{value:"group",label:(0,Ot.__)("Group","redirection")}],Dr=()=>[{value:"standard",label:(0,Ot.__)("Standard Display","redirection"),grouping:["last_count","last_access","source","target","code","title"]},{value:"minimal",label:(0,Ot.__)("Compact Display","redirection"),grouping:["source","last_count","last_access","target"]},{value:"all",label:(0,Ot.__)("Display All","redirection"),grouping:Nr().map(e=>e.value)}],Ir=()=>[{label:(0,Ot.__)("Status","redirection"),value:"status",options:[{label:(0,Ot.__)("Enabled","redirection"),value:"enabled"},{label:(0,Ot.__)("Disabled","redirection"),value:"disabled"}]},{label:(0,Ot.__)("URL match","redirection"),value:"url-match",options:[{label:(0,Ot.__)("Regular Expression","redirection"),value:"regular"},{label:(0,Ot.__)("Plain","redirection"),value:"plain"}]},{label:(0,Ot.__)("Match Type","redirection"),value:"match",options:hr()},{label:(0,Ot.__)("Action Type","redirection"),value:"action",options:mr()},{label:(0,Ot.__)("HTTP Status Code","redirection"),value:"http",options:xr()},{label:(0,Ot.__)("Last Accessed","redirection"),value:"access",options:[{label:(0,Ot.__)("Never accessed","redirection"),value:"never"},{label:(0,Ot.__)("Not accessed in last month","redirection"),value:"month"},{label:(0,Ot.__)("Not accessed in last year","redirection"),value:"year"}]}];function Fr(){return{rows:[],saving:[],total:0,addTop:!1,status:Fe,table:pt(["url","position","last_count","id","last_access"],vt(Ir(),{url:!0,target:!0,title:!0,group:!0,id:!0}),[],"id",[""],"redirect",Dr())}}function Lr(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Lr(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}const Mr=function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Lr(e))&&(r&&(r+=" "),r+=t);return r},Ur=window.ReactJSXRuntime,Br=e=>{const{children:t,className:n,onClick:r,title:o="",onCancel:i,disabled:a=!1,small:s=!1}=e,l={title:o,onClick:r};return(0,Ur.jsxs)("div",{className:Mr("wpl-badge",n,{"wpl-badge__click":r,"wpl-badge__small":s,"wpl-badge__disabled":a}),...l,children:[(0,Ur.jsx)("div",{className:"wpl-badge__content",children:t}),i&&(0,Ur.jsx)("div",{className:"wpl-badge__close dashicons dashicons-no-alt",onClick:e=>{e.preventDefault(),!a&&i&&i(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),!a&&i&&i(e))},role:"button",tabIndex:0})]})};function qr(e,t){if(!t)return!1;const n=e.target;return!(n&&t.contains(n)||"keydown"===e.type||n&&(n.closest(".wpl-dropdowntext__suggestions")||n.closest(".wpl-multioption")))}function Wr(e){const t=(0,o.useRef)(null),{children:n,onOutside:r,className:i}=e,a=(0,o.useCallback)(e=>{(qr(e,t.current)||"key"in e&&"Escape"===e.key)&&r(e)},[r]);return(0,o.useEffect)(()=>(addEventListener("mousedown",a),addEventListener("keydown",a),()=>{removeEventListener("mousedown",a),removeEventListener("keydown",a)}),[a]),(0,Ur.jsx)("div",{className:i,ref:t,children:n})}var Hr=n(5795);function zr(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function Gr(){return Gr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gr.apply(this,arguments)}var Vr="data-focus-lock",$r="data-focus-lock-disabled";function Kr(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Yr="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,Xr=new WeakMap;var Qr={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},Jr=function(){return Jr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Jr.apply(this,arguments)};function Zr(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function eo(e){return e}function to(e,t){void 0===t&&(t=eo);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return o}function no(e,t){return void 0===t&&(t=eo),to(e,t)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var ro=no({},function(e){return{target:e.target,currentTarget:e.currentTarget}}),oo=no(),io=no(),ao=function(e){void 0===e&&(e={});var t=to(null);return t.options=Jr({async:!0,ssr:!1},e),t}({async:!0,ssr:"undefined"!=typeof document}),so=(0,o.createContext)(void 0),lo=[],co=(0,o.forwardRef)(function(e,t){var n,r,i,s,l,c,u,d=(0,o.useState)(),p=d[0],f=d[1],h=(0,o.useRef)(),m=(0,o.useRef)(!1),g=(0,o.useRef)(null),v=(0,o.useState)({})[1],x=e.children,y=e.disabled,b=void 0!==y&&y,_=e.noFocusGuards,w=void 0!==_&&_,j=e.persistentFocus,S=void 0!==j&&j,k=e.crossFrame,E=void 0===k||k,C=e.autoFocus,O=void 0===C||C,T=(e.allowTextSelection,e.group),R=e.className,P=e.whiteList,A=e.hasPositiveIndices,N=e.shards,D=void 0===N?lo:N,I=e.as,F=void 0===I?"div":I,L=e.lockProps,M=void 0===L?{}:L,U=e.sideCar,B=e.returnFocus,q=void 0!==B&&B,W=e.focusOptions,H=e.onActivation,z=e.onDeactivation,G=(0,o.useState)({})[0],V=(0,o.useCallback)(function(e){var t=e.captureFocusRestore;if(!g.current){var n,r=null==(n=document)?void 0:n.activeElement;g.current=r,r!==document.body&&(g.current=t(r))}h.current&&H&&H(h.current),m.current=!0,v()},[H]),$=(0,o.useCallback)(function(){m.current=!1,z&&z(h.current),v()},[z]),K=(0,o.useCallback)(function(e){var t=g.current;if(t){var n=("function"==typeof t?t():t)||document.body,r="function"==typeof q?q(n):q;if(r){var o="object"==typeof r?r:void 0;g.current=null,e?Promise.resolve().then(function(){return n.focus(o)}):n.focus(o)}}},[q]),Y=(0,o.useCallback)(function(e){m.current&&ro.useMedium(e)},[]),X=oo.useMedium,Q=(0,o.useCallback)(function(e){h.current!==e&&(h.current=e,f(e))},[]),J=Gr(((n={})[$r]=b&&"disabled",n[Vr]=T,n),M),Z=!0!==w,ee=Z&&"tail"!==w,te=(r=[t,Q],s=i||null,l=function(e){return r.forEach(function(t){return Kr(t,e)})},(c=(0,o.useState)(function(){return{value:s,callback:l,facade:{get current(){return c.value},set current(e){var t=c.value;t!==e&&(c.value=e,c.callback(e,t))}}}})[0]).callback=l,u=c.facade,Yr(function(){var e=Xr.get(u);if(e){var t=new Set(e),n=new Set(r),o=u.current;t.forEach(function(e){n.has(e)||Kr(e,null)}),n.forEach(function(e){t.has(e)||Kr(e,o)})}Xr.set(u,r)},[r]),u),ne=(0,o.useMemo)(function(){return{observed:h,shards:D,enabled:!b,active:m.current}},[b,m.current,D,p]);return a().createElement(o.Fragment,null,Z&&[a().createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:b?-1:0,style:Qr}),A?a().createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:b?-1:1,style:Qr}):null],!b&&a().createElement(U,{id:G,sideCar:ao,observed:p,disabled:b,persistentFocus:S,crossFrame:E,autoFocus:O,whiteList:P,shards:D,onActivation:V,onDeactivation:$,returnFocus:K,focusOptions:W,noFocusGuards:w}),a().createElement(F,Gr({ref:te},J,{className:R,onBlur:X,onFocus:Y}),a().createElement(so.Provider,{value:ne},x)),ee&&a().createElement("div",{"data-focus-guard":!0,tabIndex:b?-1:0,style:Qr}))});co.propTypes={};const uo=co;function po(e,t){return po=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},po(e,t)}function fo(e){return fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fo(e)}function ho(e,t,n){return r=function(e){if("object"!=fo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=fo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==fo(r)?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e;var r}var mo=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},go=function(e){return Array.isArray(e)?e:[e]},vo=function(e){return Array.isArray(e)?e[0]:e},xo=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},yo=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},bo=function(e,t){var n=e.get(t);if(void 0!==n)return n;var r=function(e,t){return!e||yo(e)||!function(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;var t=window.getComputedStyle(e,null);return!(!t||!t.getPropertyValue||"none"!==t.getPropertyValue("display")&&"hidden"!==t.getPropertyValue("visibility"))}(e)&&!function(e){return e.hasAttribute("inert")}(e)&&t(xo(e))}(t,bo.bind(void 0,e));return e.set(t,r),r},_o=function(e,t){var n=e.get(t);if(void 0!==n)return n;var r=function(e,t){return!(e&&!yo(e))||!!ko(e)&&t(xo(e))}(t,_o.bind(void 0,e));return e.set(t,r),r},wo=function(e){return e.dataset},jo=function(e){return"INPUT"===e.tagName},So=function(e){return jo(e)&&"radio"===e.type},ko=function(e){var t=e.getAttribute("data-no-autofocus");return![!0,"true",""].includes(t)},Eo=function(e){var t;return Boolean(e&&(null===(t=wo(e))||void 0===t?void 0:t.focusGuard))},Co=function(e){return!Eo(e)},Oo=function(e){return Boolean(e)},To=function(e,t){var n=Math.max(0,e.tabIndex),r=Math.max(0,t.tabIndex),o=n-r,i=e.index-t.index;if(o){if(!n)return 1;if(!r)return-1}return o||i},Ro=function(e,t,n){return mo(e).map(function(e,t){var r=function(e){return e.tabIndex<0&&!e.hasAttribute("tabindex")?0:e.tabIndex}(e);return{node:e,index:t,tabIndex:n&&-1===r?(e.dataset||{}).focusGuard?0:-1:r}}).filter(function(e){return!t||e.tabIndex>=0}).sort(To)},Po=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"].join(","),Ao="".concat(Po,", [data-focus-guard]"),No=function(e,t){return mo((e.shadowRoot||e).children).reduce(function(e,n){return e.concat(n.matches(t?Ao:Po)?[n]:[],No(n))},[])},Do=function(e,t){return e.reduce(function(e,n){var r,o=No(n,t),i=(r=[]).concat.apply(r,o.map(function(e){return function(e,t){var n;return e instanceof HTMLIFrameElement&&(null===(n=e.contentDocument)||void 0===n?void 0:n.body)?Do([e.contentDocument.body],t):[e]}(e,t)}));return e.concat(i,n.parentNode?mo(n.parentNode.querySelectorAll(Po)).filter(function(e){return e===n}):[])},[])},Io=function(e,t){return mo(e).filter(function(e){return bo(t,e)}).filter(function(e){return function(e){return!((jo(e)||function(e){return"BUTTON"===e.tagName}(e))&&("hidden"===e.type||e.disabled))}(e)})},Fo=function(e,t){return void 0===t&&(t=new Map),mo(e).filter(function(e){return _o(t,e)})},Lo=function(e,t,n){return Ro(Io(Do(e,n),t),!0,n)},Mo=function(e,t){return Ro(Io(Do(e),t),!1)},Uo=function(e,t){return e.shadowRoot?Uo(e.shadowRoot,t):!(void 0===Object.getPrototypeOf(e).contains||!Object.getPrototypeOf(e).contains.call(e,t))||mo(e.children).some(function(e){var n;if(e instanceof HTMLIFrameElement){var r=null===(n=e.contentDocument)||void 0===n?void 0:n.body;return!!r&&Uo(r,t)}return Uo(e,t)})},Bo=function(e){if(void 0===e&&(e=document),e&&e.activeElement){var t=e.activeElement;return t.shadowRoot?Bo(t.shadowRoot):t instanceof HTMLIFrameElement&&function(){try{return t.contentWindow.document}catch(e){return}}()?Bo(t.contentWindow.document):t}},qo=function(e){return e.parentNode?qo(e.parentNode):e},Wo=function(e){return go(e).filter(Boolean).reduce(function(e,t){var n=t.getAttribute(Vr);return e.push.apply(e,n?function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var o=r+1;o<n;o+=1){var i=e[r].compareDocumentPosition(e[o]);(i&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(e,n){return!t.has(n)})}(mo(qo(t).querySelectorAll("[".concat(Vr,'="').concat(n,'"]:not([').concat($r,'="disabled"])')))):[t]),e},[])},Ho=function(e,t){return void 0===t&&(t=Bo(vo(e).ownerDocument)),!(!t||t.dataset&&t.dataset.focusGuard)&&Wo(e).some(function(e){return Uo(e,t)||function(e,t){return Boolean(mo(e.querySelectorAll("iframe")).some(function(e){return function(e,t){return e===t}(e,t)}))}(e,t)})},zo=function(e,t){e&&("focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus())},Go=function(e,t){return So(e)&&e.name?function(e,t){return t.filter(So).filter(function(t){return t.name===e.name}).filter(function(e){return e.checked})[0]||e}(e,t):e},Vo=function(e){return e[0]&&e.length>1?Go(e[0],e):e[0]},$o=function(e,t){return e.indexOf(Go(t,e))},Ko="NEW_FOCUS",Yo=function(e,t,n){var r,o=e.map(function(e){return e.node}),i=Fo(o.filter((r=n,function(e){var t,n=null===(t=wo(e))||void 0===t?void 0:t.autofocus;return e.autofocus||void 0!==n&&"false"!==n||r.indexOf(e)>=0})));return i&&i.length?Vo(i):Vo(Fo(t))},Xo=function(e,t){return void 0===t&&(t=[]),t.push(e),e.parentNode&&Xo(e.parentNode.host||e.parentNode,t),t},Qo=function(e,t){for(var n=Xo(e),r=Xo(t),o=0;o<n.length;o+=1){var i=n[o];if(r.indexOf(i)>=0)return i}return!1},Jo=function(e,t,n){var r=go(e),o=go(t),i=r[0],a=!1;return o.filter(Boolean).forEach(function(e){a=Qo(a||e,e)||a,n.filter(Boolean).forEach(function(e){var t=Qo(i,e);t&&(a=!a||Uo(t,a)?t:Qo(t,a))})}),a},Zo=function(e,t){return e.reduce(function(e,n){return e.concat(function(e,t){return Io((n=e.querySelectorAll("[".concat("data-autofocus-inside","]")),mo(n).map(function(e){return Do([e])}).reduce(function(e,t){return e.concat(t)},[])),t);var n}(n,t))},[])},ei=function(e,t){var n=Bo(go(e).length>0?document:vo(e).ownerDocument),r=Wo(e).filter(Co),o=Jo(n||e,e,r),i=new Map,a=Mo(r,i),s=a.filter(function(e){var t=e.node;return Co(t)});if(s[0]){var l,c,u,d=Mo([o],i).map(function(e){return e.node}),p=(l=d,c=s,u=new Map,c.forEach(function(e){return u.set(e.node,e)}),l.map(function(e){return u.get(e)}).filter(Oo)),f=p.map(function(e){return e.node}),h=p.filter(function(e){return e.tabIndex>=0}).map(function(e){return e.node}),m=function(e,t,n,r,o){var i=e.length,a=e[0],s=e[i-1],l=Eo(r);if(!(r&&e.indexOf(r)>=0)){var c=void 0!==r?n.indexOf(r):-1,u=o?n.indexOf(o):c,d=o?e.indexOf(o):-1;if(-1===c)return-1!==d?d:Ko;if(-1===d)return Ko;var p,f,h=c-u,m=n.indexOf(a),g=n.indexOf(s),v=(p=n,f=new Set,p.forEach(function(e){return f.add(Go(e,p))}),p.filter(function(e){return f.has(e)})),x=void 0!==r?v.indexOf(r):-1,y=o?v.indexOf(o):x,b=v.filter(function(e){return e.tabIndex>=0}),_=void 0!==r?b.indexOf(r):-1,w=o?b.indexOf(o):_,j=_>=0&&w>=0?w-_:y-x;if(!h&&d>=0)return d;if(0===t.length)return d;var S=$o(e,t[0]),k=$o(e,t[t.length-1]);return c<=m&&l&&Math.abs(h)>1?k:c>=g&&l&&Math.abs(h)>1?S:h&&Math.abs(j)>1?d:c<=m?k:c>g?S:h?Math.abs(h)>1?d:(i+d+h)%i:void 0}}(f,h,d,n,t);if(m===Ko){var g=Yo(a,h,Zo(r,i))||Yo(a,f,Zo(r,i));return g?{node:g}:void console.warn("focus-lock: cannot find any node to move focus into")}return void 0===m?m:p[m]}},ti=0,ni=!1,ri=function(e,t,n){void 0===n&&(n={});var r=ei(e,t);if(!ni&&r){if(ti>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),ni=!0,void setTimeout(function(){ni=!1},1);ti++,zo(r.node,n.focusOptions),ti--}};function oi(e){if(!e)return null;if("undefined"==typeof WeakRef)return function(){return e||null};var t=e?new WeakRef(e):null;return function(){return(null==t?void 0:t.deref())||null}}var ii=function(e){var t=function(e){if(!e)return null;for(var t=[],n=e;n&&n!==document.body;)t.push({current:oi(n),parent:oi(n.parentElement),left:oi(n.previousElementSibling),right:oi(n.nextElementSibling)}),n=n.parentElement;return{element:oi(e),stack:t,ownerDocument:e.ownerDocument}}(e);return function(){return function(e){var t,n,r,o,i;if(e)for(var a=e.stack,s=e.ownerDocument,l=new Map,c=0,u=a;c<u.length;c++){var d=u[c],p=null===(t=d.parent)||void 0===t?void 0:t.call(d);if(p&&s.contains(p)){for(var f=null===(n=d.left)||void 0===n?void 0:n.call(d),h=d.current(),m=p.contains(h)?h:void 0,g=null===(r=d.right)||void 0===r?void 0:r.call(d),v=Lo([p],l),x=null!==(i=null!==(o=null!=m?m:null==f?void 0:f.nextElementSibling)&&void 0!==o?o:g)&&void 0!==i?i:f;x;){for(var y=0,b=v;y<b.length;y++){var _=b[y];if(null==x?void 0:x.contains(_.node))return _.node}x=x.nextElementSibling}if(v.length)return v[0].node}}}(t)}},ai=function(e,t,n){void 0===t&&(t={});var r=function(e){return Object.assign({scope:document.body,cycle:!0,onlyTabbable:!0},e)}(t),o=function(e,t,n){if(!e||!t)return console.error("no element or scope given"),{};var r=go(t);if(r.every(function(t){return!Uo(t,e)}))return console.error("Active element is not contained in the scope"),{};var o=n?Lo(r,new Map):Mo(r,new Map),i=o.findIndex(function(t){return t.node===e});return-1!==i?{prev:o[i-1],next:o[i+1],first:o[0],last:o[o.length-1]}:void 0}(e,r.scope,r.onlyTabbable);if(o){var i=n(o,r.cycle);i&&zo(i.node,r.focusOptions)}},si=function(e,t,n){var r,o,i,a,s=(o=e,i=null===(r=t.onlyTabbable)||void 0===r||r,{first:(a=i?Lo(go(o),new Map):Mo(go(o),new Map))[0],last:a[a.length-1]})[n];s&&zo(s.node,t.focusOptions)};function li(e){setTimeout(e,1)}var ci=function(e){return e&&"current"in e?e.current:e},ui=function(){return document&&document.activeElement===document.body},di=null,pi=null,fi=function(){return null},hi=null,mi=!1,gi=!1,vi=function(){return!0};function xi(e,t,n,r){var o=null,i=e;do{var a=r[i];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else{if(!a.lockItem)break;if(i!==e)return;o=null}}while((i+=n)!==t);o&&(o.node.tabIndex=0)}var yi=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},bi=function(e){return Mo(e,new Map)},_i=function(){var e,t,n,r,o,i,a,s=!1;if(di){var l=di,c=l.observed,u=l.persistentFocus,d=l.autoFocus,p=l.shards,f=l.crossFrame,h=l.focusOptions,m=l.noFocusGuards,g=c||hi&&hi.portaledElement;if(ui()&&pi&&pi!==document.body&&(!document.body.contains(pi)||!bi([(a=pi).parentNode]).some(function(e){return e.node===a}))){var v=fi();v&&v.focus()}var x=document&&document.activeElement;if(g){var y=[g].concat(p.map(ci).filter(Boolean));if(x&&!function(e){return(di.whiteList||vi)(e)}(x)||(u||function(){if(!(f?Boolean(mi):"meanwhile"===mi)||!m||!pi||gi)return!1;var e=bi(y),t=e.findIndex(function(e){return e.node===pi});return 0===t||t===e.length-1}()||!(ui()||function(e){void 0===e&&(e=document);var t=Bo(e);return!!t&&mo(e.querySelectorAll("[".concat("data-no-focus-lock","]"))).some(function(e){return Uo(e,t)})}())||!pi&&d)&&(g&&!(Ho(y)||x&&function(e,t){return t.some(function(t){return yi(e,t,t)})}(x,y)||(i=x,hi&&hi.portaledElement===i))&&(document&&!pi&&x&&!d?(x.blur&&x.blur(),document.body.focus()):(s=ri(y,pi,{focusOptions:h}),hi={})),(pi=document&&document.activeElement)!==document.body&&(fi=ii(pi)),mi=!1),document&&x!==document.activeElement&&document.querySelector("[data-focus-auto-guard]")){var b=document&&document.activeElement,_=(t=Wo(e=y).filter(Co),n=Jo(e,e,t),r=Ro(Do([n],!0),!0,!0),o=Do(t,!1),r.map(function(e){var t=e.node;return{node:t,index:e.index,lockItem:o.indexOf(t)>=0,guard:Eo(t)}})),w=_.map(function(e){return e.node}).indexOf(b);w>-1&&(_.filter(function(e){var t=e.guard,n=e.node;return t&&n.dataset.focusAutoGuard}).forEach(function(e){return e.node.removeAttribute("tabIndex")}),xi(w,_.length,1,_),xi(w,-1,-1,_))}}}return s},wi=function(e){_i()&&e&&(e.stopPropagation(),e.preventDefault())},ji=function(){return li(_i)},Si=function(){gi=!0},ki=function(){gi=!1,mi="just",li(function(){mi="meanwhile"})},Ei={moveFocusInside:ri,focusInside:Ho,focusNextElement:function(e,t){void 0===t&&(t={}),ai(e,t,function(e,t){var n=e.next,r=e.first;return n||t&&r})},focusPrevElement:function(e,t){void 0===t&&(t={}),ai(e,t,function(e,t){var n=e.prev,r=e.last;return n||t&&r})},focusFirstElement:function(e,t){void 0===t&&(t={}),si(e,t,"first")},focusLastElement:function(e,t){void 0===t&&(t={}),si(e,t,"last")},captureFocusRestore:ii};ro.assignSyncMedium(function(e){var t=e.target,n=e.currentTarget;n.contains(t)||(hi={observerNode:n,portaledElement:t})}),oo.assignMedium(ji),io.assignMedium(function(e){return e(Ei)});const Ci=(Oi=function(e){return e.filter(function(e){return!e.disabled})},Ti=function(e){var t=e.slice(-1)[0];t&&!di&&(document.addEventListener("focusin",wi),document.addEventListener("focusout",ji),window.addEventListener("focus",Si),window.addEventListener("blur",ki));var n=di,r=n&&t&&t.id===n.id;di=t,n&&!r&&(n.onDeactivation(),e.filter(function(e){return e.id===n.id}).length||n.returnFocus(!t)),t?(pi=null,r&&n.observed===t.observed||t.onActivation(Ei),_i(),li(_i)):(document.removeEventListener("focusin",wi),document.removeEventListener("focusout",ji),window.removeEventListener("focus",Si),window.removeEventListener("blur",ki),pi=null)},function(e){var t,n=[];function r(){t=Oi(n.map(function(e){return e.props})),Ti(t)}var i=function(o){var i,s;function l(){return o.apply(this,arguments)||this}s=o,(i=l).prototype=Object.create(s.prototype),i.prototype.constructor=i,po(i,s),l.peek=function(){return t};var c=l.prototype;return c.componentDidMount=function(){n.push(this),r()},c.componentDidUpdate=function(){r()},c.componentWillUnmount=function(){var e=n.indexOf(this);n.splice(e,1),r()},c.render=function(){return a().createElement(e,this.props)},l}(o.PureComponent);return ho(i,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(e)+")"),i})(function(){return null});var Oi,Ti,Ri=(0,o.forwardRef)(function(e,t){return a().createElement(uo,Gr({sideCar:Ci,ref:t},e))}),Pi=uo.propTypes||{};Pi.sideCar,zr(Pi,["sideCar"]),Ri.propTypes={};const Ai=Ri;function Ni(e){if(null===e)return null;const{left:t,top:n,height:r}=e;return{left:t,top:n+r}}function Di(e,t){return t?{...e,width:t.getBoundingClientRect().width}:e}function Ii({style:e,align:t}){const n=Mr("wpl-popover__arrows",{"wpl-popover__arrows__left":"left"===t,"wpl-popover__arrows__right":"right"===t,"wpl-popover__arrows__centre":"centre"===t});return(0,Ur.jsx)("div",{className:n,style:e})}const Fi=function(e){const{position:t,children:n,popoverPosition:r,align:i,valign:a,hasArrow:s}=e,[l,c]=(0,o.useState)({arrow:{},content:{visibility:"hidden",...t}}),u=(0,o.useCallback)(e=>{if(e){const n=function(e,t,n,r,o,i){if(null===e||null===t)return{};if(!o)return{...e,visibility:"hidden"};const a=e.width?e.width:o.getBoundingClientRect().width,s=t.parentWidth-a-20,l=function(e,t,n,r){return"right"===r?e+t-n:"centre"===r?e-n/2:e}(t.left,t.width,e.width?e.width:a,n);return{...e,left:Math.min(s,l),top:i?e.top+5:e.top}}(t,r,i,0,e,!!s);c({content:n,arrow:Di(n,e)})}},[t,r,i,a,s]);return(0,Ur.jsxs)(Ur.Fragment,{children:[s&&(0,Ur.jsx)(Ii,{style:l.arrow,align:i}),(0,Ur.jsx)("div",{className:"wpl-popover__content",style:{...l.content,visibility:t&&t.left?"visible":"hidden",...null!==e.style?e.style:{}},ref:u,children:n})]})};function Li(e){let t=document.getElementById(e);if(null===t){const n=document.getElementById("wpbody");t=document.createElement("div"),n&&n.parentNode&&(t.setAttribute("id",e),n.parentNode.appendChild(t))}return t}function Mi(e,t="bottom"){const n=document.getElementById("wpwrap");if(null===e||null===n)return null;const r=n.getBoundingClientRect(),{height:o,width:i,left:a,top:s}=e.getBoundingClientRect();return{left:"bottom"===t?a-r.left:a+i/2-r.left-7,top:s-r.top+1,width:i,height:o,parentWidth:r.width,parentHeight:r.height,ref:e}}const Ui=function(e){const{children:t,className:n,align:r="left",valign:i="bottom",onClose:a,hasArrow:s=!1,popoverPosition:l,style:c=null,focusLock:u=!0}=e;return(0,o.useEffect)(()=>(window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}),[a]),(0,Hr.createPortal)((0,Ur.jsx)(Wr,{className:Mr("wpl-popover",n),onOutside:e=>{l&&!1===qr(e,l.ref)&&"Escape"!==e.key||a()},children:(0,Ur.jsx)(Ai,{returnFocus:!0,disabled:!u,children:(0,Ur.jsx)(Fi,{position:Ni(l),popoverPosition:l,align:r,hasArrow:s,valign:i,style:c,children:t})})}),Li("wpl-dropdown-portal")||document.body)},Bi=function(e){const{renderContent:t,className:n,renderToggle:r,align:i="left",valign:a="bottom",hasArrow:s=!1,matchMinimum:l=!1,disabled:c=!1,onClose:u}=e,[d,p]=(0,o.useState)(!1),[f,h]=(0,o.useState)(null),m=(0,o.useRef)(null);return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("div",{className:Mr("wpl-popover__toggle",n,c&&"wpl-popover__toggle__disabled"),ref:m,children:r(d,e=>{if(!m.current)return;const t=Mi(m.current,a);e?.stopPropagation(),c||(h(t),p(!d))})}),d&&f&&(0,Ur.jsx)(Ui,{align:i,valign:a,hasArrow:s,...void 0!==n?{className:n}:{},onClose:function(){p(!1),u?.()},popoverPosition:f,...l&&f.width?{style:{minWidth:`${f.width}px`}}:{},children:t(()=>p(!1))})]})},qi="undefined"!=typeof document?o.useLayoutEffect:()=>{};function Wi(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Hi(e){let t=(0,o.useRef)({isFocused:!1,observer:null});return qi(()=>{const e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]),(0,o.useCallback)(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=n.target,o=n=>{if(t.current.isFocused=!1,r.disabled){let t=Wi(n);null==e||e(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};r.addEventListener("focusout",o,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&r.disabled){var e;null===(e=t.current.observer)||void 0===e||e.disconnect();let n=r===document.activeElement?null:document.activeElement;r.dispatchEvent(new FocusEvent("blur",{relatedTarget:n})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:n}))}}),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}},[e])}function zi(e){var t;if("undefined"==typeof window||null==window.navigator)return!1;let n=null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands;return Array.isArray(n)&&n.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function Gi(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function Vi(e){let t=null;return()=>(null==t&&(t=e()),t)}const $i=Vi(function(){return Gi(/^Mac/i)}),Ki=Vi(function(){return Gi(/^iPhone/i)}),Yi=Vi(function(){return Gi(/^iPad/i)||$i()&&navigator.maxTouchPoints>1}),Xi=Vi(function(){return Ki()||Yi()}),Qi=(Vi(function(){return $i()||Xi()}),Vi(function(){return zi(/AppleWebKit/i)&&!Ji()})),Ji=Vi(function(){return zi(/Chrome/i)}),Zi=Vi(function(){return zi(/Android/i)}),ea=Vi(function(){return zi(/Firefox/i)});let ta=null;function na(e,t,n=!0){var r,o;let{metaKey:i,ctrlKey:a,altKey:s,shiftKey:l}=t;ea()&&(null===(o=window.event)||void 0===o||null===(r=o.type)||void 0===r?void 0:r.startsWith("key"))&&"_blank"===e.target&&($i()?i=!0:a=!0);let c=Qi()&&$i()&&!Yi()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:i,ctrlKey:a,altKey:s,shiftKey:l}):new MouseEvent("click",{metaKey:i,ctrlKey:a,altKey:s,shiftKey:l,detail:1,bubbles:!0,cancelable:!0});na.isOpening=n,function(e){if(function(){if(null==ta){ta=!1;try{document.createElement("div").focus({get preventScroll(){return ta=!0,!0}})}catch{}}return ta}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}(e);e.focus(),function(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}(e),e.dispatchEvent(c),na.isOpening=!1}na.isOpening=!1;const ra=e=>{var t;return null!==(t=null==e?void 0:e.ownerDocument)&&void 0!==t?t:document},oa=e=>e&&"window"in e&&e.window===e?e:ra(e).defaultView||window;let ia=null,aa="keyboard",sa=new Set,la=new Map,ca=!1,ua=!1;const da={Tab:!0,Escape:!0};function pa(e,t){for(let n of sa)n(e,t)}function fa(e){ca=!0,!na.isOpening&&function(e){return!(e.metaKey||!$i()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(ia="keyboard",aa="keyboard",pa("keyboard",e))}function ha(e){ia="pointer",aa="pointerType"in e?e.pointerType:"mouse","mousedown"!==e.type&&"pointerdown"!==e.type||(ca=!0,pa("pointer",e))}function ma(e){var t;!na.isOpening&&(""===(t=e).pointerType&&t.isTrusted||(Zi()&&t.pointerType?"click"===t.type&&1===t.buttons:0===t.detail&&!t.pointerType))&&(ca=!0,ia="virtual",aa="virtual")}function ga(e){e.target!==window&&e.target!==document&&e.isTrusted&&(ca||ua||(ia="virtual",aa="virtual",pa("virtual",e)),ca=!1,ua=!1)}function va(){ca=!1,ua=!0}function xa(e){if("undefined"==typeof window||"undefined"==typeof document||la.get(oa(e)))return;const t=oa(e),n=ra(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){ca=!0,r.apply(this,arguments)},n.addEventListener("keydown",fa,!0),n.addEventListener("keyup",fa,!0),n.addEventListener("click",ma,!0),t.addEventListener("focus",ga,!0),t.addEventListener("blur",va,!1),"undefined"!=typeof PointerEvent&&(n.addEventListener("pointerdown",ha,!0),n.addEventListener("pointermove",ha,!0),n.addEventListener("pointerup",ha,!0)),t.addEventListener("beforeunload",()=>{ya(e)},{once:!0}),la.set(t,{focus:r})}const ya=(e,t)=>{const n=oa(e),r=ra(e);t&&r.removeEventListener("DOMContentLoaded",t),la.has(n)&&(n.HTMLElement.prototype.focus=la.get(n).focus,r.removeEventListener("keydown",fa,!0),r.removeEventListener("keyup",fa,!0),r.removeEventListener("click",ma,!0),n.removeEventListener("focus",ga,!0),n.removeEventListener("blur",va,!1),"undefined"!=typeof PointerEvent&&(r.removeEventListener("pointerdown",ha,!0),r.removeEventListener("pointermove",ha,!0),r.removeEventListener("pointerup",ha,!0)),la.delete(n))};function ba(){return"pointer"!==ia}"undefined"!=typeof document&&function(e){const t=ra(e);let n;"loading"!==t.readyState?xa(e):(n=()=>{xa(e)},t.addEventListener("DOMContentLoaded",n))}();const _a=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function wa(e,t){return!(!t||!e)&&e.contains(t)}const ja=(e=document)=>e.activeElement;function Sa(e){return e.target}function ka(){let e=(0,o.useRef)(new Map),t=(0,o.useCallback)((t,n,r,o)=>{let i=(null==o?void 0:o.once)?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:i,options:o}),t.addEventListener(n,i,o)},[]),n=(0,o.useCallback)((t,n,r,o)=>{var i;let a=(null===(i=e.current.get(r))||void 0===i?void 0:i.fn)||r;t.removeEventListener(n,a,o),e.current.delete(r)},[]),r=(0,o.useCallback)(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return(0,o.useEffect)(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Ea(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,a=(0,o.useRef)({isFocusWithin:!1}),{addGlobalListener:s,removeAllGlobalListeners:l}=ka(),c=(0,o.useCallback)(e=>{e.currentTarget.contains(e.target)&&a.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(a.current.isFocusWithin=!1,l(),n&&n(e),i&&i(!1))},[n,i,a,l]),u=Hi(c),d=(0,o.useCallback)(e=>{if(!e.currentTarget.contains(e.target))return;const t=ra(e.target),n=ja(t);if(!a.current.isFocusWithin&&n===Sa(e.nativeEvent)){r&&r(e),i&&i(!0),a.current.isFocusWithin=!0,u(e);let n=e.currentTarget;s(t,"focus",e=>{if(a.current.isFocusWithin&&!wa(n,e.target)){let r=new t.defaultView.FocusEvent("blur",{relatedTarget:e.target});!function(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}(r,n);let o=Wi(r);c(o)}},{capture:!0})}},[r,i,u,s,c]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:c}}}function Ca(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=(0,o.useRef)({isFocused:!1,isFocusVisible:t||ba()}),[a,s]=(0,o.useState)(!1),[l,c]=(0,o.useState)(()=>i.current.isFocused&&i.current.isFocusVisible),u=(0,o.useCallback)(()=>c(i.current.isFocused&&i.current.isFocusVisible),[]),d=(0,o.useCallback)(e=>{i.current.isFocused=e,s(e),u()},[u]);var p,f,h;p=e=>{i.current.isFocusVisible=e,u()},f=[],h={isTextInput:n},xa(),(0,o.useEffect)(()=>{let e=(e,t)=>{(function(e,t,n){let r=ra(null==n?void 0:n.target);const o="undefined"!=typeof window?oa(null==n?void 0:n.target).HTMLInputElement:HTMLInputElement,i="undefined"!=typeof window?oa(null==n?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,a="undefined"!=typeof window?oa(null==n?void 0:n.target).HTMLElement:HTMLElement,s="undefined"!=typeof window?oa(null==n?void 0:n.target).KeyboardEvent:KeyboardEvent;return!((e=e||r.activeElement instanceof o&&!_a.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof a&&r.activeElement.isContentEditable)&&"keyboard"===t&&n instanceof s&&!da[n.key])})(!!(null==h?void 0:h.isTextInput),e,t)&&p(ba())};return sa.add(e),()=>{sa.delete(e)}},f);let{focusProps:m}=function(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e;const a=(0,o.useCallback)(e=>{if(e.target===e.currentTarget)return r&&r(e),i&&i(!1),!0},[r,i]),s=Hi(a),l=(0,o.useCallback)(e=>{const t=ra(e.target),r=t?ja(t):ja();e.target===e.currentTarget&&r===Sa(e.nativeEvent)&&(n&&n(e),i&&i(!0),s(e))},[i,n,s]);return{focusProps:{onFocus:!t&&(n||i||r)?l:void 0,onBlur:t||!r&&!i?void 0:a}}}({isDisabled:r,onFocusChange:d}),{focusWithinProps:g}=Ea({isDisabled:!r,onFocusWithinChange:d});return{isFocused:a,isFocusVisible:l,focusProps:r?g:m}}let Oa=!1,Ta=0;function Ra(e){"touch"===e.pointerType&&(Oa=!0,setTimeout(()=>{Oa=!1},50))}function Pa(){if("undefined"!=typeof document)return 0===Ta&&"undefined"!=typeof PointerEvent&&document.addEventListener("pointerup",Ra),Ta++,()=>{Ta--,Ta>0||"undefined"!=typeof PointerEvent&&document.removeEventListener("pointerup",Ra)}}var Aa=Object.defineProperty,Na=(e,t,n)=>(((e,t,n)=>{t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let Da=new class{constructor(){Na(this,"current",this.detect()),Na(this,"handoffState","pending"),Na(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}};function Ia(e){var t;return Da.isServer?null:null==e?document:null!=(t=null==e?void 0:e.ownerDocument)?t:document}function Fa(e){var t,n;return Da.isServer?null:null==e?document:null!=(n=null==(t=null==e?void 0:e.getRootNode)?void 0:t.call(e))?n:document}function La(e){var t,n;return null!=(n=null==(t=Fa(e))?void 0:t.activeElement)?n:null}function Ma(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function Ua(){let e=[],t={addEventListener:(e,n,r,o)=>(e.addEventListener(n,r,o),t.add(()=>e.removeEventListener(n,r,o))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame:(...e)=>t.requestAnimationFrame(()=>t.requestAnimationFrame(...e)),setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return Ma(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=Ua();return e(t),this.add(()=>t.dispose())},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function Ba(){let[e]=(0,o.useState)(Ua);return(0,o.useEffect)(()=>()=>e.dispose(),[e]),e}let qa=(e,t)=>{Da.isServer?(0,o.useEffect)(e,t):(0,o.useLayoutEffect)(e,t)};function Wa(e){let t=(0,o.useRef)(e);return qa(()=>{t.current=e},[e]),t}let Ha=function(e){let t=Wa(e);return o.useCallback((...e)=>t.current(...e),[t])};function za(e){if(null===e)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Ga(e,t,n=!1){let[r,i]=(0,o.useState)(()=>za(t));return qa(()=>{if(!t||!e)return;let n=Ua();return n.requestAnimationFrame(function e(){n.requestAnimationFrame(e),i(e=>{let n=za(t);return n.width===e.width&&n.height===e.height?e:n})}),()=>{n.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}function Va(e){return function(e){return"object"==typeof e&&null!==e&&"nodeType"in e}(e)&&"tagName"in e}function $a(e){return Va(e)&&"accessKey"in e}function Ka(e){return Va(e)&&"tabIndex"in e}function Ya(e){return $a(e)&&"FIELDSET"===e.nodeName}function Xa(e){return $a(e)&&"LEGEND"===e.nodeName}function Qa(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Qa),r}let Ja=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Za=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var es,ts,ns=((ts=ns||{})[ts.First=1]="First",ts[ts.Previous=2]="Previous",ts[ts.Next=4]="Next",ts[ts.Last=8]="Last",ts[ts.WrapAround=16]="WrapAround",ts[ts.NoScroll=32]="NoScroll",ts[ts.AutoFocus=64]="AutoFocus",ts),rs=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(rs||{}),os=((es=os||{})[es.Previous=-1]="Previous",es[es.Next=1]="Next",es);function is(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(Ja)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var as=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(as||{});function ss(e,t=0){var n;return e!==(null==(n=Ia(e))?void 0:n.body)&&Qa(t,{0:()=>e.matches(Ja),1(){let t=e;for(;null!==t;){if(t.matches(Ja))return!0;t=t.parentElement}return!1}})}var ls=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(ls||{});"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let cs=["textarea","input"].join(",");function us(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?Fa(e[0]):document:Fa(e),a=Array.isArray(e)?n?function(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}(e):e:64&t?function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(Za)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e):is(e);o.length>0&&a.length>1&&(a=a.filter(e=>!o.some(t=>null!=t&&"current"in t?(null==t?void 0:t.current)===e:t===e))),r=null!=r?r:null==i?void 0:i.activeElement;let s,l=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,a.indexOf(r))-1;if(4&t)return Math.max(0,a.indexOf(r))+1;if(8&t)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=32&t?{preventScroll:!0}:{},d=0,p=a.length;do{if(d>=p||d+p<=0)return 0;let e=c+d;if(16&t)e=(e+p)%p;else{if(e<0)return 3;if(e>=p)return 1}s=a[e],null==s||s.focus(u),d+=l}while(s!==La(s));return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,cs))&&n}(s)&&s.select(),2}function ds(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function ps(){return ds()||/Android/gi.test(window.navigator.userAgent)}function fs(e,t,n,r){let i=Wa(n);(0,o.useEffect)(()=>{if(e)return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r);function n(e){i.current(e)}},[e,t,r])}function hs(e,t,n,r){let i=Wa(n);(0,o.useEffect)(()=>{if(e)return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r);function n(e){i.current(e)}},[e,t,r])}function ms(e,t,n){let r=Wa(n),i=(0,o.useCallback)(function(e,n){if(e.defaultPrevented)return;let o=n(e);if(null===o||!o.getRootNode().contains(o)||!o.isConnected)return;let i=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of i)if(null!==t&&(t.contains(o)||e.composed&&e.composedPath().includes(t)))return;return!ss(o,as.Loose)&&-1!==o.tabIndex&&e.preventDefault(),r.current(e,o)},[r,t]),a=(0,o.useRef)(null);fs(e,"pointerdown",e=>{var t,n;ps()||(a.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),fs(e,"pointerup",e=>{if(ps()||!a.current)return;let t=a.current;return a.current=null,i(e,()=>t)},!0);let s=(0,o.useRef)({x:0,y:0});fs(e,"touchstart",e=>{s.current.x=e.touches[0].clientX,s.current.y=e.touches[0].clientY},!0),fs(e,"touchend",e=>{let t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY;if(!(Math.abs(t-s.current.x)>=30||Math.abs(n-s.current.y)>=30))return i(e,()=>Ka(e.target)?e.target:null)},!0),hs(e,"blur",e=>i(e,()=>{return $a(e=window.document.activeElement)&&"IFRAME"===e.nodeName?window.document.activeElement:null;var e}),!0)}function gs(...e){return(0,o.useMemo)(()=>Ia(...e),[...e])}function vs(...e){return Array.from(new Set(e.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}var xs,ys=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(ys||{}),bs=((xs=bs||{})[xs.Unmount=0]="Unmount",xs[xs.Hidden=1]="Hidden",xs);function _s(){let e=function(){let e=(0,o.useRef)([]),t=(0,o.useCallback)(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>null==e))return e.current=n,t}}();return(0,o.useCallback)(t=>function({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:a,mergeRefs:s}){s=null!=s?s:js;let l=Ss(t,e);if(i)return ws(l,n,r,a,s);let c=null!=o?o:0;if(2&c){let{static:e=!1,...t}=l;if(e)return ws(t,n,r,a,s)}if(1&c){let{unmount:e=!0,...t}=l;return Qa(e?0:1,{0:()=>null,1:()=>ws({...t,hidden:!0,style:{display:"none"}},n,r,a,s)})}return ws(l,n,r,a,s)}({mergeRefs:e,...t}),[e])}function ws(e,t={},n,r,i){let{as:a=n,children:s,refName:l="ref",...c}=Os(e,["unmount","static"]),u=void 0!==e.ref?{[l]:e.ref}:{},d="function"==typeof s?s(t):s;"className"in c&&c.className&&"function"==typeof c.className&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let p={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){p["data-headlessui-state"]=n.join(" ");for(let e of n)p[`data-${e}`]=""}}if(Rs(a)&&(Object.keys(Cs(c)).length>0||Object.keys(Cs(p)).length>0)){if(!(!(0,o.isValidElement)(d)||Array.isArray(d)&&d.length>1||function(e){return Rs(e.type)}(d))){let e=d.props,t=null==e?void 0:e.className,n="function"==typeof t?(...e)=>vs(t(...e),c.className):vs(t,c.className),r=n?{className:n}:{},a=Ss(d.props,Cs(Os(c,["ref"])));for(let e in p)e in a&&delete p[e];return(0,o.cloneElement)(d,Object.assign({},a,p,u,{ref:i(Ts(d),u.ref)},r))}if(Object.keys(Cs(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Cs(c)).concat(Object.keys(Cs(p))).map(e=>` - ${e}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>` - ${e}`).join("\n")].join("\n"))}return(0,o.createElement)(a,Object.assign({},Os(c,["ref"]),!Rs(a)&&u,!Rs(a)&&p),d)}function js(...e){return e.every(e=>null==e)?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}function Ss(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>{var t;return null==(t=null==e?void 0:e.preventDefault)?void 0:t.call(e)}]);for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function ks(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)null==e||e(...t)}});return t}function Es(e){var t;return Object.assign((0,o.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function Cs(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function Os(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function Ts(e){return o.version.split(".")[0]>="19"?e.props.ref:e.ref}function Rs(e){return e===o.Fragment||e===Symbol.for("react.fragment")}var Ps=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Ps||{});let As=Es(function(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":!(2&~r)||(null!=(n=o["aria-hidden"])?n:void 0),hidden:!(4&~r)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...!(4&~r)&&!!(2&~r)&&{display:"none"}}};return _s()({ourProps:i,theirProps:o,slot:{},defaultTag:"span",name:"Hidden"})}),Ns=(0,o.createContext)(null);function Ds({children:e,node:t}){let[n,r]=(0,o.useState)(null),i=Is(null!=t?t:n);return o.createElement(Ns.Provider,{value:i},e,null===i&&o.createElement(As,{features:Ps.Hidden,ref:e=>{var t,n;if(e)for(let o of null!=(n=null==(t=Ia(e))?void 0:t.querySelectorAll("html > *, body > *"))?n:[])if(o!==document.body&&o!==document.head&&Va(o)&&null!=o&&o.contains(e)){r(o);break}}}))}function Is(e=null){var t;return null!=(t=(0,o.useContext)(Ns))?t:e}function Fs(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=null!=(n=t.defaultView)?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function Ls(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Ms=function(e,t){let n=new Map,r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...o){let i=t[e].call(n,...o);i&&(n=i,r.forEach(e=>e()))}}}(0,{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:Ua(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=Ls(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=Ls(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta:()=>e.computedMeta},n=[ds()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{var n;if("auto"!==window.getComputedStyle(e.documentElement).scrollBehavior){let n=Ua();n.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>n.dispose()))}let o=null!=(n=window.scrollY)?n:window.pageYOffset,i=null;t.addEventListener(e,"click",t=>{if(Ka(t.target))try{let n=t.target.closest("a");if(!n)return;let{hash:o}=new URL(n.href),a=e.querySelector(o);Ka(a)&&!r(a)&&(i=a)}catch{}},!0),t.group(n=>{t.addEventListener(e,"touchstart",e=>{if(n.dispose(),Ka(e.target)&&function(e){return Va(e)&&"style"in e}(e.target))if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,"overscrollBehavior","contain")}else n.style(e.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",e=>{if(Ka(e.target)){if(function(e){return $a(e)&&"INPUT"===e.nodeName}(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{var e;let t=null!=(e=window.scrollY)?e:window.pageYOffset;o!==t&&window.scrollTo(0,o),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{},Fs(),{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];n.forEach(({before:e})=>null==e?void 0:e(t)),n.forEach(({after:e})=>null==e?void 0:e(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});function Us(e,t,n=()=>({containers:[]})){let r=function(e){return(0,o.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}(Ms),i=t?r.get(t):void 0,a=!!i&&i.count>0;return qa(()=>{if(t&&e)return Ms.dispatch("PUSH",t,n),()=>Ms.dispatch("POP",t,n)},[e,t]),a}Ms.subscribe(()=>{let e=Ms.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&Ms.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&Ms.dispatch("TEARDOWN",n)}});class Bs extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}}var qs,Ws,Hs,zs=Object.defineProperty,Gs=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Vs=(e,t,n)=>(Gs(e,t,"read from private field"),n?n.call(e):t.get(e)),$s=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ks=(e,t,n,r)=>(Gs(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class Ys{constructor(e){$s(this,qs,{}),$s(this,Ws,new Bs(()=>new Set)),$s(this,Hs,new Set),((e,t,n)=>{((e,t,n)=>{t in e?zs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n)})(this,"disposables",Ua()),Ks(this,qs,e),Da.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Vs(this,qs)}subscribe(e,t){if(Da.isServer)return()=>{};let n={selector:e,callback:t,current:e(Vs(this,qs))};return Vs(this,Hs).add(n),this.disposables.add(()=>{Vs(this,Hs).delete(n)})}on(e,t){return Da.isServer?()=>{}:(Vs(this,Ws).get(e).add(t),this.disposables.add(()=>{Vs(this,Ws).get(e).delete(t)}))}send(e){let t=this.reduce(Vs(this,qs),e);if(t!==Vs(this,qs)){Ks(this,qs,t);for(let e of Vs(this,Hs)){let t=e.selector(Vs(this,qs));Xs(e.current,t)||(e.current=t,e.callback(t))}for(let t of Vs(this,Ws).get(e.type))t(Vs(this,qs),e)}}}function Xs(e,t){return!!Object.is(e,t)||"object"==typeof e&&null!==e&&"object"==typeof t&&null!==t&&(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&Qs(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&Qs(e.entries(),t.entries()):!(!Js(e)||!Js(t))&&Qs(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()))}function Qs(e,t){for(;;){let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}}function Js(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}qs=new WeakMap,Ws=new WeakMap,Hs=new WeakMap;var Zs=Object.defineProperty,el=(e,t,n)=>(((e,t,n)=>{t in e?Zs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),tl=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(tl||{});let nl={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(-1!==o){let t=e.stack.slice();return t.splice(o,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(-1===r)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}};class rl extends Ys{constructor(){super(...arguments),el(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),el(this,"selectors",{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new rl({stack:[]})}reduce(e,t){return Qa(t.type,nl,e,t)}}const ol=new Bs(()=>rl.new());function il(e,t,n=Xs){return(0,s.useSyncExternalStoreWithSelector)(Ha(t=>e.subscribe(al,t)),Ha(()=>e.state),Ha(()=>e.state),Ha(t),n)}function al(e){return e}function sl(e){return(0,o.useMemo)(()=>e,Object.values(e))}let ll=Symbol();function cl(e,t=!0){return Object.assign(e,{[ll]:t})}function ul(...e){let t=(0,o.useRef)(e);(0,o.useEffect)(()=>{t.current=e},[e]);let n=Ha(e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)});return e.every(e=>null==e||(null==e?void 0:e[ll]))?void 0:n}var dl,pl,fl,hl=((fl=hl||{})[fl.Forwards=0]="Forwards",fl[fl.Backwards=1]="Backwards",fl);function ml(){let e=(0,o.useRef)(0);return hs(!0,"keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}"undefined"!=typeof process&&"undefined"!=typeof globalThis&&"undefined"!=typeof Element&&"test"===(null==(dl=null==process?void 0:{NODE_ENV:"production"})?void 0:dl.NODE_ENV)&&void 0===(null==(pl=null==Element?void 0:Element.prototype)?void 0:pl.getAnimations)&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join("\n")),[]});var gl,vl=((gl=vl||{})[gl.None=0]="None",gl[gl.Closed=1]="Closed",gl[gl.Enter=2]="Enter",gl[gl.Leave=4]="Leave",gl);function xl(e){let t={};for(let n in e)!0===e[n]&&(t[`data-${n}`]="");return t}function yl(e,t,n,r){let[i,a]=(0,o.useState)(n),{hasFlag:s,addFlag:l,removeFlag:c}=function(e=0){let[t,n]=(0,o.useState)(e),r=(0,o.useCallback)(e=>n(e),[]),i=(0,o.useCallback)(e=>n(t=>t|e),[]),a=(0,o.useCallback)(e=>(t&e)===e,[t]),s=(0,o.useCallback)(e=>n(t=>t&~e),[]),l=(0,o.useCallback)(e=>n(t=>t^e),[]);return{flags:t,setFlag:r,addFlag:i,hasFlag:a,removeFlag:s,toggleFlag:l}}(e&&i?3:0),u=(0,o.useRef)(!1),d=(0,o.useRef)(!1),p=Ba();return qa(()=>{var o;if(e)return n&&a(!0),t?(null==(o=null==r?void 0:r.start)||o.call(r,n),function(e,{prepare:t,run:n,done:r,inFlight:o}){let i=Ua();return function(e,{inFlight:t,prepare:n}){if(null!=t&&t.current)return void n();let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(function(e,t){var n,r;let o=Ua();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let a=null!=(r=null==(n=e.getAnimations)?void 0:n.call(e).filter(e=>e instanceof CSSTransition))?r:[];return 0===a.length?(t(),o.dispose):(Promise.allSettled(a.map(e=>e.finished)).then(()=>{i||t()}),o.dispose)}(e,r))})}),i.dispose}(t,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(l(3),c(4)):(l(4),c(2)))},run(){d.current?n?(c(3),l(4)):(c(4),l(3)):n?c(1):l(1)},done(){var e;d.current&&function(e){var t,n;return(null!=(n=null==(t=e.getAnimations)?void 0:t.call(e))?n:[]).some(e=>e instanceof CSSTransition&&"finished"!==e.playState)}(t)||(u.current=!1,c(7),n||a(!1),null==(e=null==r?void 0:r.end)||e.call(r,n))}})):void(n&&l(3))},[e,n,t,p]),e?[i,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}let bl=(0,o.createContext)(()=>{});function _l({value:e,children:t}){return o.createElement(bl.Provider,{value:e},t)}const wl=Math.min,jl=Math.max,Sl=Math.round,kl=Math.floor,El=e=>({x:e,y:e}),Cl={left:"right",right:"left",bottom:"top",top:"bottom"},Ol={start:"end",end:"start"};function Tl(e,t,n){return jl(e,wl(t,n))}function Rl(e,t){return"function"==typeof e?e(t):e}function Pl(e){return e.split("-")[0]}function Al(e){return e.split("-")[1]}function Nl(e){return"x"===e?"y":"x"}function Dl(e){return"y"===e?"height":"width"}const Il=new Set(["top","bottom"]);function Fl(e){return Il.has(Pl(e))?"y":"x"}function Ll(e){return Nl(Fl(e))}function Ml(e){return e.replace(/start|end/g,e=>Ol[e])}const Ul=["left","right"],Bl=["right","left"],ql=["top","bottom"],Wl=["bottom","top"];function Hl(e){return e.replace(/left|right|bottom|top/g,e=>Cl[e])}function zl(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Gl(){return"undefined"!=typeof window}function Vl(e){return Yl(e)?(e.nodeName||"").toLowerCase():"#document"}function $l(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Kl(e){var t;return null==(t=(Yl(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Yl(e){return!!Gl()&&(e instanceof Node||e instanceof $l(e).Node)}function Xl(e){return!!Gl()&&(e instanceof Element||e instanceof $l(e).Element)}function Ql(e){return!!Gl()&&(e instanceof HTMLElement||e instanceof $l(e).HTMLElement)}function Jl(e){return!(!Gl()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof $l(e).ShadowRoot)}const Zl=new Set(["inline","contents"]);function ec(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=pc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Zl.has(o)}const tc=new Set(["table","td","th"]);function nc(e){return tc.has(Vl(e))}const rc=[":popover-open",":modal"];function oc(e){return rc.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const ic=["transform","translate","scale","rotate","perspective"],ac=["transform","translate","scale","rotate","perspective","filter"],sc=["paint","layout","strict","content"];function lc(e){const t=cc(),n=Xl(e)?pc(e):e;return ic.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||ac.some(e=>(n.willChange||"").includes(e))||sc.some(e=>(n.contain||"").includes(e))}function cc(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const uc=new Set(["html","body","#document"]);function dc(e){return uc.has(Vl(e))}function pc(e){return $l(e).getComputedStyle(e)}function fc(e){return Xl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hc(e){if("html"===Vl(e))return e;const t=e.assignedSlot||e.parentNode||Jl(e)&&e.host||Kl(e);return Jl(t)?t.host:t}function mc(e){const t=hc(e);return dc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ql(t)&&ec(t)?t:mc(t)}function gc(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=mc(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=$l(o);if(i){const e=vc(a);return t.concat(a,a.visualViewport||[],ec(o)?o:[],e&&n?gc(e):[])}return t.concat(o,gc(o,[],n))}function vc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xc(e,t,n){let{reference:r,floating:o}=e;const i=Fl(t),a=Ll(t),s=Dl(a),l=Pl(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Al(t)){case"start":f[a]-=p*(n&&c?-1:1);break;case"end":f[a]+=p*(n&&c?-1:1)}return f}async function yc(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Rl(t,e),h=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(f),m=s[p?"floating"===d?"reference":"floating":d],g=zl(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),y=await(null==i.isElement?void 0:i.isElement(x))&&await(null==i.getScale?void 0:i.getScale(x))||{x:1,y:1},b=zl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:x,strategy:l}):v);return{top:(g.top-b.top+h.top)/y.y,bottom:(b.bottom-g.bottom+h.bottom)/y.y,left:(g.left-b.left+h.left)/y.x,right:(b.right-g.right+h.right)/y.x}}const bc=new Set(["left","top"]);function _c(e){const t=pc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ql(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Sl(n)!==i||Sl(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function wc(e){return Xl(e)?e:e.contextElement}function jc(e){const t=wc(e);if(!Ql(t))return El(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=_c(t);let a=(i?Sl(n.width):n.width)/r,s=(i?Sl(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Sc=El(0);function kc(e){const t=$l(e);return cc()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Sc}function Ec(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=wc(e);let a=El(1);t&&(r?Xl(r)&&(a=jc(r)):a=jc(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==$l(e))&&t}(i,n,r)?kc(i):El(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=$l(i),t=r&&Xl(r)?$l(r):r;let n=e,o=vc(n);for(;o&&r&&t!==n;){const e=jc(o),t=o.getBoundingClientRect(),r=pc(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=$l(o),o=vc(n)}}return zl({width:u,height:d,x:l,y:c})}function Cc(e,t){const n=fc(e).scrollLeft;return t?t.left+n:Ec(Kl(e)).left+n}function Oc(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Cc(e,n),y:n.top+t.scrollTop}}const Tc=new Set(["absolute","fixed"]);function Rc(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=$l(e),r=Kl(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=cc();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=Cc(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Kl(e),n=fc(e),r=e.ownerDocument.body,o=jl(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=jl(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Cc(e);const s=-n.scrollTop;return"rtl"===pc(r).direction&&(a+=jl(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(Kl(e));else if(Xl(t))r=function(e,t){const n=Ec(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ql(e)?jc(e):El(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=kc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return zl(r)}function Pc(e,t){const n=hc(e);return!(n===t||!Xl(n)||dc(n))&&("fixed"===pc(n).position||Pc(n,t))}function Ac(e,t,n){const r=Ql(t),o=Kl(t),i="fixed"===n,a=Ec(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=El(0);function c(){l.x=Cc(o)}if(r||!r&&!i)if(("body"!==Vl(t)||ec(o))&&(s=fc(t)),r){const e=Ec(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=!o||r||i?El(0):Oc(o,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function Nc(e){return"static"===pc(e).position}function Dc(e,t){if(!Ql(e)||"fixed"===pc(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Kl(e)===n&&(n=n.ownerDocument.body),n}function Ic(e,t){const n=$l(e);if(oc(e))return n;if(!Ql(e)){let t=hc(e);for(;t&&!dc(t);){if(Xl(t)&&!Nc(t))return t;t=hc(t)}return n}let r=Dc(e,t);for(;r&&nc(r)&&Nc(r);)r=Dc(r,t);return r&&dc(r)&&Nc(r)&&!lc(r)?n:r||function(e){let t=hc(e);for(;Ql(t)&&!dc(t);){if(lc(t))return t;if(oc(t))return null;t=hc(t)}return null}(e)||n}const Fc={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=Kl(r),s=!!t&&oc(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=El(1);const u=El(0),d=Ql(r);if((d||!d&&!i)&&(("body"!==Vl(r)||ec(a))&&(l=fc(r)),Ql(r))){const e=Ec(r);c=jc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?El(0):Oc(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:Kl,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?oc(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=gc(e,[],!1).filter(e=>Xl(e)&&"body"!==Vl(e)),o=null;const i="fixed"===pc(e).position;let a=i?hc(e):e;for(;Xl(a)&&!dc(a);){const t=pc(a),n=lc(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&Tc.has(o.position)||ec(a)&&!n&&Pc(e,a))?r=r.filter(e=>e!==a):o=t,a=hc(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=Rc(t,n,o);return e.top=jl(r.top,e.top),e.right=wl(r.right,e.right),e.bottom=wl(r.bottom,e.bottom),e.left=jl(r.left,e.left),e},Rc(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Ic,getElementRects:async function(e){const t=this.getOffsetParent||Ic,n=this.getDimensions,r=await n(e.floating);return{reference:Ac(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=_c(e);return{width:t,height:n}},getScale:jc,isElement:Xl,isRTL:function(e){return"rtl"===pc(e).direction}};function Lc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mc(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=wc(e),u=o||i?[...c?gc(c):[],...gc(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const o=Kl(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=c;if(s||t(),!p||!f)return;const h={rootMargin:-kl(d)+"px "+-kl(o.clientWidth-(u+p))+"px "+-kl(o.clientHeight-(d+f))+"px "+-kl(u)+"px",threshold:jl(0,wl(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||Lc(c,e.getBoundingClientRect())||a(),m=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m=l?Ec(e):null;return l&&function t(){const r=Ec(e);m&&!Lc(m,r)&&n(),m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const Uc=yc,Bc=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=Pl(n),s=Al(n),l="y"===Fl(n),c=bc.has(a)?-1:1,u=i&&l?-1:1,d=Rl(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},qc=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Rl(e,t),c={x:n,y:r},u=await yc(t,l),d=Fl(Pl(o)),p=Nl(d);let f=c[p],h=c[d];if(i){const e="y"===p?"bottom":"right";f=Tl(f+u["y"===p?"top":"left"],f,f-u[e])}if(a){const e="y"===d?"bottom":"right";h=Tl(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[d]:a}}}}}},Wc=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Rl(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Pl(o),x=Fl(s),y=Pl(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),_=p||(y||!m?[Hl(s)]:function(e){const t=Hl(e);return[Ml(e),t,Ml(t)]}(s)),w="none"!==h;!p&&w&&_.push(...function(e,t,n,r){const o=Al(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Bl:Ul:t?Ul:Bl;case"left":case"right":return t?ql:Wl;default:return[]}}(Pl(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(Ml)))),i}(s,m,h,b));const j=[s,..._],S=await yc(t,g),k=[];let E=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&k.push(S[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Al(e),o=Ll(e),i=Dl(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Hl(a)),[a,Hl(a)]}(o,a,b);k.push(S[e[0]],S[e[1]])}if(E=[...E,{placement:o,overflows:k}],!k.every(e=>e<=0)){var C,O;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=j[e];if(t&&("alignment"!==d||x===Fl(t)||E.every(e=>Fl(e.placement)!==x||e.overflows[0]>0)))return{data:{index:e,overflows:E},reset:{placement:t}};let n=null==(O=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:O.placement;if(!n)switch(f){case"bestFit":{var T;const e=null==(T=E.filter(e=>{if(w){const t=Fl(e.placement);return t===x||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Hc=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=Rl(e,t),u=await yc(t,c),d=Pl(o),p=Al(o),f="y"===Fl(o),{width:h,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,g="end"===p?"top":"bottom");const x=m-u.top-u.bottom,y=h-u.left-u.right,b=wl(m-u[g],x),_=wl(h-u[v],y),w=!t.middlewareData.shift;let j=b,S=_;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=y),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(j=x),w&&!p){const e=jl(u.left,0),t=jl(u.right,0),n=jl(u.top,0),r=jl(u.bottom,0);f?S=h-2*(0!==e||0!==t?e+t:jl(u.left,u.right)):j=m-2*(0!==n||0!==r?n+r:jl(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:j});const k=await a.getDimensions(s.floating);return h!==k.width||m!==k.height?{reset:{rects:!0}}:{}}}},zc=(e,t,n)=>{const r=new Map,o={platform:Fc,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=xc(c,r,l),p=r,f={},h=0;for(let n=0;n<s.length;n++){const{name:i,fn:m}=s[n],{x:g,y:v,data:x,reset:y}=await m({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,f={...f,[i]:{...f[i],...x}},y&&h<=50&&(h++,"object"==typeof y&&(y.placement&&(p=y.placement),y.rects&&(c=!0===y.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:u,y:d}=xc(c,p,l))),n=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...o,platform:i})};var Gc="undefined"!=typeof document?o.useLayoutEffect:function(){};function Vc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!Vc(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||Vc(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function $c(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Kc(e,t){const n=$c(e);return Math.round(t*n)/n}function Yc(e){const t=o.useRef(e);return Gc(()=>{t.current=e}),t}const Xc=(e,t)=>({...Bc(e),options:[e,t]}),Qc=(e,t)=>({...qc(e),options:[e,t]}),Jc=(e,t)=>({...Wc(e),options:[e,t]}),Zc=(e,t)=>({...Hc(e),options:[e,t]}),eu={...i},tu=eu.useInsertionEffect||(e=>e());function nu(e){const t=o.useRef(()=>{});return tu(()=>{t.current=e}),o.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}var ru="undefined"!=typeof document?o.useLayoutEffect:o.useEffect;let ou=!1,iu=0;const au=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+iu++,su=eu.useId||function(){const[e,t]=o.useState(()=>ou?au():void 0);return ru(()=>{null==e&&t(au())},[]),o.useEffect(()=>{ou=!0},[]),e};const lu=o.createContext(null),cu=o.createContext(null),uu="data-floating-ui-focusable";function du(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=su(),a=o.useRef({}),[s]=o.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}()),l=null!=((null==(h=o.useContext(lu))?void 0:h.id)||null),[c,u]=o.useState(r.reference),d=nu((e,t,r)=>{a.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)}),p=o.useMemo(()=>({setPositionReference:u}),[]),f=o.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);var h;return o.useMemo(()=>({dataRef:a,open:t,onOpenChange:d,elements:f,events:s,floatingId:i,refs:p}),[t,d,f,s,i,p])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,s]=o.useState(null),[l,c]=o.useState(null),u=(null==i?void 0:i.domReference)||a,d=o.useRef(null),p=o.useContext(cu);ru(()=>{u&&(d.current=u)},[u]);const f=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,p]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=o.useState(r);Vc(f,r)||h(r);const[m,g]=o.useState(null),[v,x]=o.useState(null),y=o.useCallback(e=>{e!==j.current&&(j.current=e,g(e))},[]),b=o.useCallback(e=>{e!==S.current&&(S.current=e,x(e))},[]),_=a||m,w=s||v,j=o.useRef(null),S=o.useRef(null),k=o.useRef(d),E=null!=c,C=Yc(c),O=Yc(i),T=Yc(u),R=o.useCallback(()=>{if(!j.current||!S.current)return;const e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),zc(j.current,S.current,e).then(e=>{const t={...e,isPositioned:!1!==T.current};P.current&&!Vc(k.current,t)&&(k.current=t,Hr.flushSync(()=>{p(t)}))})},[f,t,n,O,T]);Gc(()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);const P=o.useRef(!1);Gc(()=>(P.current=!0,()=>{P.current=!1}),[]),Gc(()=>{if(_&&(j.current=_),w&&(S.current=w),_&&w){if(C.current)return C.current(_,w,R);R()}},[_,w,R,C,E]);const A=o.useMemo(()=>({reference:j,floating:S,setReference:y,setFloating:b}),[y,b]),N=o.useMemo(()=>({reference:_,floating:w}),[_,w]),D=o.useMemo(()=>{const e={position:n,left:0,top:0};if(!N.floating)return e;const t=Kc(N.floating,d.x),r=Kc(N.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...$c(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,N.floating,d.x,d.y]);return o.useMemo(()=>({...d,update:R,refs:A,elements:N,floatingStyles:D}),[d,R,A,N,D])}({...e,elements:{...i,...l&&{reference:l}}}),h=o.useCallback(e=>{const t=Xl(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),m=o.useCallback(e=>{(Xl(e)||null===e)&&(d.current=e,s(e)),(Xl(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!Xl(e))&&f.refs.setReference(e)},[f.refs]),g=o.useMemo(()=>({...f.refs,setReference:m,setPositionReference:h,domReference:d}),[f.refs,m,h]),v=o.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),x=o.useMemo(()=>({...f,...r,refs:g,elements:v,nodeId:t}),[f,g,v,t,r]);return ru(()=>{r.dataRef.current.floatingContext=x;const e=null==p?void 0:p.nodesRef.current.find(e=>e.id===t);e&&(e.context=x)}),o.useMemo(()=>({...f,context:x,refs:g,elements:v}),[f,g,v,x])}const pu="active",fu="selected";function hu(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[pu]:t,[fu]:__,...n}=e;i=n}return{..."floating"===n&&{tabIndex:-1,[uu]:""},...i,...t.map(t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,i]=t;var a;o&&[pu,fu].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(a=r.get(n))||a.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)})):e[n]=i)}),e):e,{})}}function mu(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}let gu=(0,o.createContext)({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});gu.displayName="FloatingContext";let vu=(0,o.createContext)(null);function xu({children:e,enabled:t=!0}){let[n,r]=(0,o.useState)(null),[i,a]=(0,o.useState)(0),s=(0,o.useRef)(null),[l,c]=(0,o.useState)(null);!function(e){qa(()=>{if(!e)return;let t=new MutationObserver(()=>{let t=window.getComputedStyle(e).maxHeight,n=parseFloat(t);if(isNaN(n))return;let r=parseInt(t);isNaN(r)||n!==r&&(e.style.maxHeight=`${Math.ceil(n)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}(l);let u=t&&null!==n&&null!==l,{to:d="bottom",gap:p=0,offset:f=0,padding:h=0,inner:m}=function(e,t){var n,r,o;let i=yu(null!=(n=null==e?void 0:e.gap)?n:"var(--anchor-gap, 0)",t),a=yu(null!=(r=null==e?void 0:e.offset)?r:"var(--anchor-offset, 0)",t),s=yu(null!=(o=null==e?void 0:e.padding)?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:a,padding:s}}(n,l),[g,v="center"]=d.split(" ");qa(()=>{u&&a(0)},[u]);let{refs:x,floatingStyles:y,context:b}=du({open:u,placement:"selection"===g?"center"===v?"bottom":`bottom-${v}`:"center"===v?`${g}`:`${g}-${v}`,strategy:"absolute",transform:!1,middleware:[Xc({mainAxis:"selection"===g?0:p,crossAxis:f}),Qc({padding:h}),"selection"!==g&&Jc({padding:h}),"selection"===g&&m?(j={...m,padding:h,overflowRef:s,offset:i,minItemsVisible:4,referenceOverflowThreshold:h,onFallbackChange(e){var t,n;if(!e)return;let r=b.elements.floating;if(!r)return;let o=parseFloat(getComputedStyle(r).scrollPaddingBottom)||0,i=Math.min(4,r.childElementCount),s=0,l=0;for(let e of null!=(n=null==(t=b.elements.floating)?void 0:t.childNodes)?n:[])if($a(e)){let t=e.offsetTop,n=t+e.clientHeight+o,a=r.scrollTop,c=a+r.clientHeight;if(!(t>=a&&n<=c)){l=Math.max(0,Math.min(n,c)-Math.max(t,a)),s=e.clientHeight;break}i--}i>=1&&a(e=>{let t=s*i-l+o;return e>=t?e:t})}},{name:"inner",options:j,async fn(e){const{listRef:t,overflowRef:n,onFallbackChange:r,offset:o=0,index:i=0,minItemsVisible:a=4,referenceOverflowThreshold:s=0,scrollRef:l,...c}=Rl(j,e),{rects:u,elements:{floating:d}}=e,p=t.current[i],f=(null==l?void 0:l.current)||d,h=d.clientTop||f.clientTop,m=0!==d.clientTop,g=0!==f.clientTop,v=d===f;if(!p)return{};const x={...e,...await Xc(-p.offsetTop-d.clientTop-u.reference.height/2-p.offsetHeight/2-o).fn(e)},y=await Uc(mu(x,f.scrollHeight+h+d.clientTop),c),b=await Uc(x,{...c,elementContext:"reference"}),_=jl(0,y.top),w=x.y+_,S=f.scrollHeight>f.clientHeight?e=>e:Sl,k=S(jl(0,f.scrollHeight+(m&&v||g?2*h:0)-_-jl(0,y.bottom)));if(f.style.maxHeight=k+"px",f.scrollTop=_,r){const e=f.offsetHeight<p.offsetHeight*wl(a,t.current.length)-1||b.top>=-s||b.bottom>=-s;Hr.flushSync(()=>r(e))}return n&&(n.current=await Uc(mu({...x,y:w},f.offsetHeight+h+d.clientTop),c)),{y:w}}}):null,Zc({padding:h,apply({availableWidth:e,availableHeight:t,elements:n}){Object.assign(n.floating.style,{overflow:"auto",maxWidth:`${e}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${t}px)`})}})].filter(Boolean),whileElementsMounted:Mc}),[_=g,w=v]=b.placement.split("-");var j;"selection"===g&&(_="selection");let S=(0,o.useMemo)(()=>({anchor:[_,w].filter(Boolean).join(" ")}),[_,w]),k=function(e,t){const{open:n,elements:r}=e,{enabled:i=!0,overflowRef:a,scrollRef:s,onChange:l}=t,c=nu(l),u=o.useRef(!1),d=o.useRef(null),p=o.useRef(null);o.useEffect(()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==a.current)return;const n=e.deltaY,r=a.current.top>=-.5,o=a.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,s=n<0?-1:1,l=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),Hr.flushSync(()=>{c(e=>e+Math[l](n,i*s))})):/firefox/i.test(function(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}())&&(t.scrollTop+=n))}const t=(null==s?void 0:s.current)||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame(()=>{d.current=t.scrollTop,null!=a.current&&(p.current={...a.current})}),()=>{d.current=null,p.current=null,t.removeEventListener("wheel",e)}):void 0},[i,n,r.floating,a,s,c]);const f=o.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const e=(null==s?void 0:s.current)||r.floating;if(a.current&&e&&u.current){if(null!==d.current){const t=e.scrollTop-d.current;(a.current.bottom<-.5&&t<-1||a.current.top<-.5&&t>1)&&Hr.flushSync(()=>c(e=>e+t))}requestAnimationFrame(()=>{d.current=e.scrollTop})}}}),[r.floating,c,a,s]);return o.useMemo(()=>i?{floating:f}:{},[i,f])}(b,{overflowRef:s,onChange:a}),{getReferenceProps:E,getFloatingProps:C}=function(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),i=o.useCallback(t=>hu(t,e,"reference"),t),a=o.useCallback(t=>hu(t,e,"floating"),n),s=o.useCallback(t=>hu(t,e,"item"),r);return o.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:s}),[i,a,s])}([k]),O=Ha(e=>{c(e),x.setFloating(e)});return o.createElement(vu.Provider,{value:r},o.createElement(gu.Provider,{value:{setFloating:O,setReference:x.setReference,styles:y,getReferenceProps:E,getFloatingProps:C,slot:S}},e))}function yu(e,t,n=void 0){let r=Ba(),i=Ha((e,t)=>{if(null==e)return[n,null];if("number"==typeof e)return[e,null];if("string"==typeof e){if(!t)return[n,null];let o=_u(e,t);return[o,n=>{let i=bu(e);{let a=i.map(e=>window.getComputedStyle(t).getPropertyValue(e));r.requestAnimationFrame(function s(){r.nextFrame(s);let l=!1;for(let[e,n]of i.entries()){let r=window.getComputedStyle(t).getPropertyValue(n);if(a[e]!==r){a[e]=r,l=!0;break}}if(!l)return;let c=_u(e,t);o!==c&&(n(c),o=c)})}return r.dispose}]}return[n,null]}),a=(0,o.useMemo)(()=>i(e,t)[0],[e,t]),[s=a,l]=(0,o.useState)();return qa(()=>{let[n,r]=i(e,t);if(l(n),r)return r(l)},[e,t]),s}function bu(e){let t=/var\((.*)\)/.exec(e);if(t){let e=t[1].indexOf(",");if(-1===e)return[t[1]];let n=t[1].slice(0,e).trim(),r=t[1].slice(e+1).trim();return r?[n,...bu(r)]:[n]}return[]}function _u(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}vu.displayName="PlacementContext";let wu=(0,o.createContext)(null);wu.displayName="OpenClosedContext";var ju=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ju||{});function Su(){return(0,o.useContext)(wu)}function ku({value:e,children:t}){return o.createElement(wu.Provider,{value:e},t)}function Eu({children:e}){return o.createElement(wu.Provider,{value:null},e)}function Cu(e){let t=e.parentElement,n=null;for(;t&&!Ya(t);)Xa(t)&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(Xa(t))return!1;t=t.previousElementSibling}return!0}(n))&&r}var Ou=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ou||{});function Tu(e){let t=Ha(e),n=(0,o.useRef)(!1);(0,o.useEffect)(()=>(n.current=!1,()=>{n.current=!0,Ma(()=>{n.current&&t()})}),[t])}let Ru=(0,o.createContext)(!1);let Pu=o.Fragment,Au=Es(function(e,t){let{ownerDocument:n=null,...r}=e,i=(0,o.useRef)(null),a=ul(cl(e=>{i.current=e}),t),s=gs(i.current),l=function(e){let t=(0,o.useContext)(Ru),n=(0,o.useContext)(Du),[r,i]=(0,o.useState)(()=>{var r;if(!t&&null!==n)return null!=(r=n.current)?r:null;if(Da.isServer)return null;let o=null==e?void 0:e.getElementById("headlessui-portal-root");if(o)return o;if(null===e)return null;let i=e.createElement("div");return i.setAttribute("id","headlessui-portal-root"),e.body.appendChild(i)});return(0,o.useEffect)(()=>{null!==r&&(null!=e&&e.body.contains(r)||null==e||e.body.appendChild(r))},[r,e]),(0,o.useEffect)(()=>{t||null!==n&&i(n.current)},[n,i,t]),r}(null!=n?n:s),c=(0,o.useContext)(Iu),u=Ba(),d=_s();return Tu(()=>{var e;l&&l.childNodes.length<=0&&(null==(e=l.parentElement)||e.removeChild(l))}),l?(0,Hr.createPortal)(o.createElement("div",{"data-headlessui-portal":"",ref:e=>{u.dispose(),c&&e&&u.add(c.register(e))}},d({ourProps:{ref:a},theirProps:r,slot:{},defaultTag:Pu,name:"Portal"})),l):null}),Nu=o.Fragment,Du=(0,o.createContext)(null),Iu=(0,o.createContext)(null),Fu=Es(function(e,t){let n=ul(t),{enabled:r=!0,ownerDocument:i,...a}=e,s=_s();return r?o.createElement(Au,{...a,ownerDocument:i,ref:n}):s({ourProps:{ref:n},theirProps:a,slot:{},defaultTag:Pu,name:"Portal"})}),Lu=Es(function(e,t){let{target:n,...r}=e,i={ref:ul(t)},a=_s();return o.createElement(Du.Provider,{value:n},a({ourProps:i,theirProps:r,defaultTag:Nu,name:"Popover.Group"}))}),Mu=Object.assign(Fu,{Group:Lu});var Uu=Object.defineProperty,Bu=(e,t,n)=>(((e,t,n)=>{t in e?Uu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),qu=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(qu||{}),Wu=(e=>(e[e.OpenPopover=0]="OpenPopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(Wu||{});let Hu={0:e=>0===e.popoverState?e:{...e,popoverState:0,__demoMode:!1},1:e=>1===e.popoverState?e:{...e,popoverState:1,__demoMode:!1},2:(e,t)=>e.button===t.button?e:{...e,button:t.button},3:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},4:(e,t)=>e.panel===t.panel?e:{...e,panel:t.panel},5:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId}};class zu extends Ys{constructor(e){super(e),Bu(this,"actions",{close:()=>this.send({type:1}),refocusableClose:e=>{this.actions.close();let t=(()=>e?$a(e)?e:"current"in e&&$a(e.current)?e.current:this.state.button:this.state.button)();null==t||t.focus()},open:()=>this.send({type:0}),setButtonId:e=>this.send({type:3,buttonId:e}),setButton:e=>this.send({type:2,button:e}),setPanelId:e=>this.send({type:5,panelId:e}),setPanel:e=>this.send({type:4,panel:e})}),Bu(this,"selectors",{isPortalled:e=>{var t;if(!e.button||!e.panel)return!1;let n=null!=(t=Ia(e.button))?t:document;for(let t of n.querySelectorAll("body > *"))if(Number(null==t?void 0:t.contains(e.button))^Number(null==t?void 0:t.contains(e.panel)))return!0;let r=is(n),o=r.indexOf(e.button),i=(o+r.length-1)%r.length,a=(o+1)%r.length,s=r[i],l=r[a];return!e.panel.contains(s)&&!e.panel.contains(l)}});{let e=this.state.id,t=ol.get(null);this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}}static new({id:e,__demoMode:t=!1}){return new zu({id:e,__demoMode:t,popoverState:t?0:1,buttons:{current:[]},button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:{current:null},afterPanelSentinel:{current:null},afterButtonSentinel:{current:null}})}reduce(e,t){return Qa(t.type,Hu,e,t)}}const Gu=(0,o.createContext)(null);function Vu(e){let t=(0,o.useContext)(Gu);if(null===t){let t=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Vu),t}return t}let $u=(0,o.createContext)(null);function Ku(){return(0,o.useContext)($u)}$u.displayName="PopoverGroupContext";let Yu=(0,o.createContext)(null);Yu.displayName="PopoverPanelContext";let Xu=ys.RenderStrategy|ys.Static;function Qu(e,t){let n=(0,o.useId)(),{id:r=`headlessui-popover-backdrop-${n}`,transition:i=!1,...a}=e,s=Vu("Popover.Backdrop"),l=il(s,(0,o.useCallback)(e=>e.popoverState,[])),[c,u]=(0,o.useState)(null),d=ul(t,u),p=Su(),[f,h]=yl(i,c,null!==p?(p&ju.Open)===ju.Open:l===qu.Open),m=Ha(e=>{if(Cu(e.currentTarget))return e.preventDefault();s.actions.close()}),g=sl({open:l===qu.Open}),v={ref:d,id:r,"aria-hidden":!0,onClick:m,...xl(h)};return _s()({ourProps:v,theirProps:a,slot:g,defaultTag:"div",features:Xu,visible:f,name:"Popover.Backdrop"})}let Ju=ys.RenderStrategy|ys.Static,Zu=Es(function(e,t){var n;let r=(0,o.useId)(),{__demoMode:i=!1,...a}=e,s=function({id:e,__demoMode:t=!1}){let n=(0,o.useMemo)(()=>zu.new({id:e,__demoMode:t}),[]);return Tu(()=>n.dispose()),n}({id:r,__demoMode:i}),l=(0,o.useRef)(null),c=ul(t,cl(e=>{l.current=e})),[u,d,p,f,h]=il(s,(0,o.useCallback)(e=>[e.popoverState,e.button,e.panel,e.buttonId,e.panelId],[])),m=function(...e){return(0,o.useMemo)(()=>Fa(...e),[...e])}(null!=(n=l.current)?n:d),g=Wa(f),v=Wa(h),x=(0,o.useMemo)(()=>({buttonId:g,panelId:v,close:s.actions.close}),[g,v,s]),y=Ku(),b=null==y?void 0:y.registerPopover,_=Ha(()=>{var e,t;let n=La(null!=(e=l.current)?e:d);return null!=(t=null==y?void 0:y.isFocusWithinPopoverGroup())?t:n&&((null==d?void 0:d.contains(n))||(null==p?void 0:p.contains(n)))});(0,o.useEffect)(()=>null==b?void 0:b(x),[b,x]);let[w,j]=function(){let e=(0,o.useContext)(Iu),t=(0,o.useRef)([]),n=Ha(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=Ha(n=>{let r=t.current.indexOf(n);-1!==r&&t.current.splice(r,1),e&&e.unregister(n)}),i=(0,o.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,o.useMemo)(()=>function({children:e}){return o.createElement(Iu.Provider,{value:i},e)},[i])]}(),S=Is(d),k=function({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=Ha(()=>{var r,o;let i=Ia(n),a=[];for(let t of e)null!==t&&(Va(t)?a.push(t):"current"in t&&Va(t.current)&&a.push(t.current));if(null!=t&&t.current)for(let e of t.current)a.push(e);for(let e of null!=(r=null==i?void 0:i.querySelectorAll("html > *, body > *"))?r:[])e!==document.body&&e!==document.head&&Va(e)&&"headlessui-portal-root"!==e.id&&(n&&(e.contains(n)||e.contains(null==(o=null==n?void 0:n.getRootNode())?void 0:o.host))||a.some(t=>e.contains(t))||a.push(e));return a});return{resolveContainers:r,contains:Ha(e=>r().some(t=>t.contains(e)))}}({mainTreeNode:S,portals:w,defaultContainers:[{get current(){return s.state.button}},{get current(){return s.state.panel}}]});!function(e,t,n,r){let i=Wa(n);(0,o.useEffect)(()=>{function n(e){i.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}(m,"focus",e=>{var t,n,r,o,i,a;e.target!==window&&Ka(e.target)&&s.state.popoverState===qu.Open&&(_()||s.state.button&&s.state.panel&&(k.contains(e.target)||null!=(n=null==(t=s.state.beforePanelSentinel.current)?void 0:t.contains)&&n.call(t,e.target)||null!=(o=null==(r=s.state.afterPanelSentinel.current)?void 0:r.contains)&&o.call(r,e.target)||null!=(a=null==(i=s.state.afterButtonSentinel.current)?void 0:i.contains)&&a.call(i,e.target)||s.actions.close()))},!0),ms(u===qu.Open,k.resolveContainers,(e,t)=>{s.actions.close(),ss(t,as.Loose)||(e.preventDefault(),null==d||d.focus())});let E=sl({open:u===qu.Open,close:s.actions.refocusableClose}),C=il(s,(0,o.useCallback)(e=>Qa(e.popoverState,{[qu.Open]:ju.Open,[qu.Closed]:ju.Closed}),[])),O={ref:c},T=_s();return o.createElement(Ds,{node:S},o.createElement(xu,null,o.createElement(Yu.Provider,{value:null},o.createElement(Gu.Provider,{value:s},o.createElement(_l,{value:s.actions.refocusableClose},o.createElement(ku,{value:C},o.createElement(j,null,T({ourProps:O,theirProps:a,slot:E,defaultTag:"div",name:"Popover"}))))))))}),ed=Es(function(e,t){let n=(0,o.useId)(),{id:r=`headlessui-popover-button-${n}`,disabled:i=!1,autoFocus:a=!1,...s}=e,l=Vu("Popover.Button"),[c,u,d,p,f,h,m]=il(l,(0,o.useCallback)(e=>[e.popoverState,l.selectors.isPortalled(e),e.button,e.buttonId,e.panel,e.panelId,e.afterButtonSentinel],[])),g=(0,o.useRef)(null),v=`headlessui-focus-sentinel-${(0,o.useId)()}`,x=Ku(),y=null==x?void 0:x.closeOthers,b=null!==(0,o.useContext)(Yu);(0,o.useEffect)(()=>{if(!b)return l.actions.setButtonId(r),()=>l.actions.setButtonId(null)},[b,r,l]);let[_]=(0,o.useState)(()=>Symbol()),w=ul(g,t,(0,o.useContext)(gu).setReference,Ha(e=>{if(!b){if(e)l.state.buttons.current.push(_);else{let e=l.state.buttons.current.indexOf(_);-1!==e&&l.state.buttons.current.splice(e,1)}l.state.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),e&&l.actions.setButton(e)}})),j=ul(g,t),S=Ha(e=>{var t,n,r;if(b){if(l.state.popoverState===qu.Closed)return;switch(e.key){case Ou.Space:case Ou.Enter:e.preventDefault(),null==(n=(t=e.target).click)||n.call(t),l.actions.close(),null==(r=l.state.button)||r.focus()}}else switch(e.key){case Ou.Space:case Ou.Enter:e.preventDefault(),e.stopPropagation(),l.state.popoverState===qu.Closed?(null==y||y(l.state.buttonId),l.actions.open()):l.actions.close();break;case Ou.Escape:if(l.state.popoverState!==qu.Open)return null==y?void 0:y(l.state.buttonId);if(!g.current)return;let t=La(g.current);if(t&&!g.current.contains(t))return;e.preventDefault(),e.stopPropagation(),l.actions.close()}}),k=Ha(e=>{b||e.key===Ou.Space&&e.preventDefault()}),E=Ha(e=>{var t,n;Cu(e.currentTarget)||i||(b?(l.actions.close(),null==(t=l.state.button)||t.focus()):(e.preventDefault(),e.stopPropagation(),l.state.popoverState===qu.Closed?(null==y||y(l.state.buttonId),l.actions.open()):l.actions.close(),null==(n=l.state.button)||n.focus()))}),C=Ha(e=>{e.preventDefault(),e.stopPropagation()}),{isFocusVisible:O,focusProps:T}=Ca({autoFocus:a}),{isHovered:R,hoverProps:P}=function(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[a,s]=(0,o.useState)(!1),l=(0,o.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;(0,o.useEffect)(Pa,[]);let{addGlobalListener:c,removeAllGlobalListeners:u}=ka(),{hoverProps:d,triggerHoverEnd:p}=(0,o.useMemo)(()=>{let e=(e,t)=>{let o=l.target;l.pointerType="",l.target=null,"touch"!==t&&l.isHovered&&o&&(l.isHovered=!1,u(),r&&r({type:"hoverend",target:o,pointerType:t}),n&&n(!1),s(!1))},o={};return"undefined"!=typeof PointerEvent&&(o.onPointerEnter=r=>{Oa&&"mouse"===r.pointerType||((r,o)=>{if(l.pointerType=o,i||"touch"===o||l.isHovered||!r.currentTarget.contains(r.target))return;l.isHovered=!0;let a=r.currentTarget;l.target=a,c(ra(r.target),"pointerover",t=>{l.isHovered&&l.target&&!wa(l.target,t.target)&&e(0,t.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:a,pointerType:o}),n&&n(!0),s(!0)})(r,r.pointerType)},o.onPointerLeave=t=>{!i&&t.currentTarget.contains(t.target)&&e(0,t.pointerType)}),{hoverProps:o,triggerHoverEnd:e}},[t,n,r,i,l,c,u]);return(0,o.useEffect)(()=>{i&&p({currentTarget:l.target},l.pointerType)},[i]),{hoverProps:d,isHovered:a}}({isDisabled:i}),{pressed:A,pressProps:N}=function({disabled:e=!1}={}){let t=(0,o.useRef)(null),[n,r]=(0,o.useState)(!1),i=Ba(),a=Ha(()=>{t.current=null,r(!1),i.dispose()}),s=Ha(e=>{if(i.dispose(),null===t.current){t.current=e.currentTarget,r(!0);{let n=Ia(e.currentTarget);i.addEventListener(n,"pointerup",a,!1),i.addEventListener(n,"pointermove",e=>{if(t.current){let n=function(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}(e);r(function(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}(n,t.current.getBoundingClientRect()))}},!1),i.addEventListener(n,"pointercancel",a,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:a,onClick:a}}}({disabled:i}),D=c===qu.Open,I=sl({open:D,active:A||D,disabled:i,hover:R,focus:O,autofocus:a}),F=function(e,t){return(0,o.useMemo)(()=>{var n;if(e.type)return e.type;let r=null!=(n=e.as)?n:"button";return"string"==typeof r&&"button"===r.toLowerCase()||"BUTTON"===(null==t?void 0:t.tagName)&&!t.hasAttribute("type")?"button":void 0},[e.type,e.as,t])}(e,d),L=ks(b?{ref:j,type:F,onKeyDown:S,onClick:E,disabled:i||void 0,autoFocus:a}:{ref:w,id:p,type:F,"aria-expanded":c===qu.Open,"aria-controls":f?h:void 0,disabled:i||void 0,autoFocus:a,onKeyDown:S,onKeyUp:k,onClick:E,onMouseDown:C},T,P,N),M=ml(),U=Ha(()=>{if(!$a(l.state.panel))return;let e=l.state.panel;Qa(M.current,{[hl.Forwards]:()=>us(e,ns.First),[hl.Backwards]:()=>us(e,ns.Last)})===rs.Error&&us(is(Fa(l.state.button)).filter(e=>"true"!==e.dataset.headlessuiFocusGuard),Qa(M.current,{[hl.Forwards]:ns.Next,[hl.Backwards]:ns.Previous}),{relativeTo:l.state.button})}),B=_s();return o.createElement(o.Fragment,null,B({ourProps:L,theirProps:s,slot:I,defaultTag:"button",name:"Popover.Button"}),D&&!b&&u&&o.createElement(As,{id:v,ref:m,features:Ps.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:U}))}),td=Es(Qu),nd=Es(Qu),rd=Es(function(e,t){let n=(0,o.useId)(),{id:r=`headlessui-popover-panel-${n}`,focus:i=!1,anchor:a,portal:s=!1,modal:l=!1,transition:c=!1,...u}=e,d=Vu("Popover.Panel"),p=il(d,d.selectors.isPortalled),[f,h,m,g,v]=il(d,(0,o.useCallback)(e=>[e.popoverState,e.button,e.__demoMode,e.beforePanelSentinel,e.afterPanelSentinel],[])),x=`headlessui-focus-sentinel-before-${n}`,y=`headlessui-focus-sentinel-after-${n}`,b=(0,o.useRef)(null),_=function(e){return(0,o.useMemo)(()=>e?"string"==typeof e?{to:e}:e:null,[e])}(a),[w,j]=function(e=null){!1===e&&(e=null),"string"==typeof e&&(e={to:e});let t=(0,o.useContext)(vu),n=(0,o.useMemo)(()=>e,[JSON.stringify(e,(e,t)=>{var n;return null!=(n=null==t?void 0:t.outerHTML)?n:t})]);qa(()=>{null==t||t(null!=n?n:null)},[t,n]);let r=(0,o.useContext)(gu);return(0,o.useMemo)(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}(_),S=function(){let{getFloatingProps:e,slot:t}=(0,o.useContext)(gu);return(0,o.useCallback)((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}();_&&(s=!0);let[k,E]=(0,o.useState)(null),C=ul(b,t,_?w:null,d.actions.setPanel,E),O=gs(h),T=gs(b.current);qa(()=>(d.actions.setPanelId(r),()=>d.actions.setPanelId(null)),[r,d]);let R=Su(),[P,A]=yl(c,k,null!==R?(R&ju.Open)===ju.Open:f===qu.Open);(function(e,t,n){let r=Wa(e=>{let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&n()});(0,o.useEffect)(()=>{if(!e)return;let n=null===t?null:$a(t)?t:t.current;if(!n)return;let o=Ua();if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver(()=>r.current(n));e.observe(n),o.add(()=>e.disconnect())}if("undefined"!=typeof IntersectionObserver){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),o.add(()=>e.disconnect())}return()=>o.dispose()},[t,r,e])})(P,h,d.actions.close),function(e,t,n=()=>[document.body]){let r=function(e){let t=(0,o.useId)(),n=ol.get("scroll-lock"),[r,i]=il(n,(0,o.useCallback)(e=>[n.selectors.isTop(e,t),n.selectors.inStack(e,t)],[n,t]));return qa(()=>{if(e)return n.actions.push(t),()=>n.actions.pop(t)},[n,e,t]),!!e&&(!i||r)}(e);Us(r,t,e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}})}(!m&&l&&P,T);let N=Ha(e=>{var t;if(e.key===Ou.Escape){if(d.state.popoverState!==qu.Open||!b.current)return;let n=La(b.current);if(n&&!b.current.contains(n))return;e.preventDefault(),e.stopPropagation(),d.actions.close(),null==(t=d.state.button)||t.focus()}});(0,o.useEffect)(()=>{var t;e.static||f===qu.Closed&&(null==(t=e.unmount)||t)&&d.actions.setPanel(null)},[f,e.unmount,e.static,d]),(0,o.useEffect)(()=>{if(m||!i||f!==qu.Open||!b.current)return;let e=La(b.current);b.current.contains(e)||us(b.current,ns.First)},[m,i,b.current,f]);let D=sl({open:f===qu.Open,close:d.actions.refocusableClose}),I=ks(_?S():{},{ref:C,id:r,onKeyDown:N,onBlur:i&&f===qu.Open?e=>{var t,n,r,o,i;let a=e.relatedTarget;a&&b.current&&(null!=(t=b.current)&&t.contains(a)||(d.actions.close(),(null!=(r=null==(n=g.current)?void 0:n.contains)&&r.call(n,a)||null!=(i=null==(o=v.current)?void 0:o.contains)&&i.call(o,a))&&a.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...u.style,...j,"--button-width":Ga(P,h,!0).width},...xl(A)}),F=ml(),L=Ha(()=>{let e=b.current;e&&Qa(F.current,{[hl.Forwards]:()=>{var t;us(e,ns.First)===rs.Error&&(null==(t=d.state.afterPanelSentinel.current)||t.focus())},[hl.Backwards]:()=>{var e;null==(e=d.state.button)||e.focus({preventScroll:!0})}})}),M=Ha(()=>{let e=b.current;e&&Qa(F.current,{[hl.Forwards]:()=>{var e;if(!d.state.button)return;let t=is(null!=(e=Fa(d.state.button))?e:document.body),n=t.indexOf(d.state.button),r=t.slice(0,n+1),o=[...t.slice(n+1),...r];for(let e of o.slice())if("true"===e.dataset.headlessuiFocusGuard||null!=k&&k.contains(e)){let t=o.indexOf(e);-1!==t&&o.splice(t,1)}us(o,ns.First,{sorted:!1})},[hl.Backwards]:()=>{var t;us(e,ns.Previous)===rs.Error&&(null==(t=d.state.button)||t.focus())}})}),U=_s();return o.createElement(Eu,null,o.createElement(Yu.Provider,{value:r},o.createElement(_l,{value:d.actions.refocusableClose},o.createElement(Mu,{enabled:!!s&&(e.static||P),ownerDocument:O},P&&p&&o.createElement(As,{id:x,ref:g,features:Ps.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:L}),U({ourProps:I,theirProps:u,slot:D,defaultTag:"div",features:Ju,visible:P,name:"Popover.Panel"}),P&&p&&o.createElement(As,{id:y,ref:v,features:Ps.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:M})))))}),od=Es(function(e,t){let n=(0,o.useRef)(null),r=ul(n,t),[i,a]=(0,o.useState)([]),s=Ha(e=>{a(t=>{let n=t.indexOf(e);if(-1!==n){let e=t.slice();return e.splice(n,1),e}return t})}),l=Ha(e=>(a(t=>[...t,e]),()=>s(e))),c=Ha(()=>{var e;let t=Fa(n.current);if(!t)return!1;let r=La(n.current);return!(null==(e=n.current)||!e.contains(r))||i.some(e=>{var n,o;return(null==(n=t.getElementById(e.buttonId.current))?void 0:n.contains(r))||(null==(o=t.getElementById(e.panelId.current))?void 0:o.contains(r))})}),u=Ha(e=>{for(let t of i)t.buttonId.current!==e&&t.close()}),d=(0,o.useMemo)(()=>({registerPopover:l,unregisterPopover:s,isFocusWithinPopoverGroup:c,closeOthers:u}),[l,s,c,u]),p=sl({}),f=e,h={ref:r},m=_s();return o.createElement(Ds,null,o.createElement($u.Provider,{value:d},m({ourProps:h,theirProps:f,slot:p,defaultTag:"div",name:"Popover.Group"})))}),id=Object.assign(Zu,{Button:ed,Backdrop:nd,Overlay:td,Panel:rd,Group:od});function ad(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function sd(e){return e instanceof ad(e).Element||e instanceof Element}function ld(e){return e instanceof ad(e).HTMLElement||e instanceof HTMLElement}function cd(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ad(e).ShadowRoot||e instanceof ShadowRoot)}var ud=Math.max,dd=Math.min,pd=Math.round;function fd(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function hd(){return!/^((?!chrome|android).)*safari/i.test(fd())}function md(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&ld(e)&&(o=e.offsetWidth>0&&pd(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&pd(r.height)/e.offsetHeight||1);var a=(sd(e)?ad(e):window).visualViewport,s=!hd()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/o,c=(r.top+(s&&a?a.offsetTop:0))/i,u=r.width/o,d=r.height/i;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function gd(e){var t=ad(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function vd(e){return e?(e.nodeName||"").toLowerCase():null}function xd(e){return((sd(e)?e.ownerDocument:e.document)||window.document).documentElement}function yd(e){return md(xd(e)).left+gd(e).scrollLeft}function bd(e){return ad(e).getComputedStyle(e)}function _d(e){var t=bd(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function wd(e,t,n){void 0===n&&(n=!1);var r,o,i=ld(t),a=ld(t)&&function(e){var t=e.getBoundingClientRect(),n=pd(t.width)/e.offsetWidth||1,r=pd(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=xd(t),l=md(e,a,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&(("body"!==vd(t)||_d(s))&&(c=(r=t)!==ad(r)&&ld(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:gd(r)),ld(t)?((u=md(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=yd(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function jd(e){var t=md(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Sd(e){return"html"===vd(e)?e:e.assignedSlot||e.parentNode||(cd(e)?e.host:null)||xd(e)}function kd(e){return["html","body","#document"].indexOf(vd(e))>=0?e.ownerDocument.body:ld(e)&&_d(e)?e:kd(Sd(e))}function Ed(e,t){var n;void 0===t&&(t=[]);var r=kd(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=ad(r),a=o?[i].concat(i.visualViewport||[],_d(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Ed(Sd(a)))}function Cd(e){return["table","td","th"].indexOf(vd(e))>=0}function Od(e){return ld(e)&&"fixed"!==bd(e).position?e.offsetParent:null}function Td(e){for(var t=ad(e),n=Od(e);n&&Cd(n)&&"static"===bd(n).position;)n=Od(n);return n&&("html"===vd(n)||"body"===vd(n)&&"static"===bd(n).position)?t:n||function(e){var t=/firefox/i.test(fd());if(/Trident/i.test(fd())&&ld(e)&&"fixed"===bd(e).position)return null;var n=Sd(e);for(cd(n)&&(n=n.host);ld(n)&&["html","body"].indexOf(vd(n))<0;){var r=bd(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var Rd="top",Pd="bottom",Ad="right",Nd="left",Dd="auto",Id=[Rd,Pd,Ad,Nd],Fd="start",Ld="end",Md="viewport",Ud="popper",Bd=Id.reduce(function(e,t){return e.concat([t+"-"+Fd,t+"-"+Ld])},[]),qd=[].concat(Id,[Dd]).reduce(function(e,t){return e.concat([t,t+"-"+Fd,t+"-"+Ld])},[]),Wd=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Hd(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}}),r.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||o(e)}),r}var zd={placement:"bottom",modifiers:[],strategy:"absolute"};function Gd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function Vd(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?zd:o;return function(e,t,n){void 0===n&&(n=i);var o,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},zd,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,u={state:s,setOptions:function(n){var o="function"==typeof n?n(s.options):n;d(),s.options=Object.assign({},i,s.options,o),s.scrollParents={reference:sd(e)?Ed(e):e.contextElement?Ed(e.contextElement):[],popper:Ed(t)};var a,c,p=function(e){var t=Hd(e);return Wd.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}((a=[].concat(r,s.options.modifiers),c=a.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{}),Object.keys(c).map(function(e){return c[e]})));return s.orderedModifiers=p.filter(function(e){return e.enabled}),s.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,o=e.effect;if("function"==typeof o){var i=o({state:s,name:t,instance:u,options:r});l.push(i||function(){})}}),u.update()},forceUpdate:function(){if(!c){var e=s.elements,t=e.reference,n=e.popper;if(Gd(t,n)){s.rects={reference:wd(t,Td(n),"fixed"===s.options.strategy),popper:jd(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach(function(e){return s.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<s.orderedModifiers.length;r++)if(!0!==s.reset){var o=s.orderedModifiers[r],i=o.fn,a=o.options,l=void 0===a?{}:a,d=o.name;"function"==typeof i&&(s=i({state:s,options:l,name:d,instance:u})||s)}else s.reset=!1,r=-1}}},update:(o=function(){return new Promise(function(e){u.forceUpdate(),e(s)})},function(){return a||(a=new Promise(function(e){Promise.resolve().then(function(){a=void 0,e(o())})})),a}),destroy:function(){d(),c=!0}};if(!Gd(e,t))return u;function d(){l.forEach(function(e){return e()}),l=[]}return u.setOptions(n).then(function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)}),u}}var $d={passive:!0};const Kd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,l=ad(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(e){e.addEventListener("scroll",n.update,$d)}),s&&l.addEventListener("resize",n.update,$d),function(){i&&c.forEach(function(e){e.removeEventListener("scroll",n.update,$d)}),s&&l.removeEventListener("resize",n.update,$d)}},data:{}};function Yd(e){return e.split("-")[0]}function Xd(e){return e.split("-")[1]}function Qd(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Jd(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?Yd(o):null,a=o?Xd(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case Rd:t={x:s,y:n.y-r.height};break;case Pd:t={x:s,y:n.y+n.height};break;case Ad:t={x:n.x+n.width,y:l};break;case Nd:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?Qd(i):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case Fd:t[c]=t[c]-(n[u]/2-r[u]/2);break;case Ld:t[c]=t[c]+(n[u]/2-r[u]/2)}}return t}const Zd={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=Jd({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var ep={top:"auto",right:"auto",bottom:"auto",left:"auto"};function tp(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=a.x,f=void 0===p?0:p,h=a.y,m=void 0===h?0:h,g="function"==typeof u?u({x:f,y:m}):{x:f,y:m};f=g.x,m=g.y;var v=a.hasOwnProperty("x"),x=a.hasOwnProperty("y"),y=Nd,b=Rd,_=window;if(c){var w=Td(n),j="clientHeight",S="clientWidth";w===ad(n)&&"static"!==bd(w=xd(n)).position&&"absolute"===s&&(j="scrollHeight",S="scrollWidth"),(o===Rd||(o===Nd||o===Ad)&&i===Ld)&&(b=Pd,m-=(d&&w===_&&_.visualViewport?_.visualViewport.height:w[j])-r.height,m*=l?1:-1),o!==Nd&&(o!==Rd&&o!==Pd||i!==Ld)||(y=Ad,f-=(d&&w===_&&_.visualViewport?_.visualViewport.width:w[S])-r.width,f*=l?1:-1)}var k,E=Object.assign({position:s},c&&ep),C=!0===u?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:pd(n*o)/o||0,y:pd(r*o)/o||0}}({x:f,y:m},ad(n)):{x:f,y:m};return f=C.x,m=C.y,l?Object.assign({},E,((k={})[b]=x?"0":"",k[y]=v?"0":"",k.transform=(_.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",k)):Object.assign({},E,((t={})[b]=x?m+"px":"",t[y]=v?f+"px":"",t.transform="",t))}const np={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,c={placement:Yd(t.placement),variation:Xd(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,tp(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,tp(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},rp={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];ld(o)&&vd(o)&&(Object.assign(o.style,n),Object.keys(r).forEach(function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});ld(r)&&vd(r)&&(Object.assign(r.style,i),Object.keys(o).forEach(function(e){r.removeAttribute(e)}))})}},requires:["computeStyles"]},op={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=qd.reduce(function(e,n){return e[n]=function(e,t,n){var r=Yd(e),o=[Nd,Rd].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[Nd,Ad].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e},{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}};var ip={left:"right",right:"left",bottom:"top",top:"bottom"};function ap(e){return e.replace(/left|right|bottom|top/g,function(e){return ip[e]})}var sp={start:"end",end:"start"};function lp(e){return e.replace(/start|end/g,function(e){return sp[e]})}function cp(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&cd(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function up(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function dp(e,t,n){return t===Md?up(function(e,t){var n=ad(e),r=xd(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var c=hd();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+yd(e),y:l}}(e,n)):sd(t)?function(e,t){var n=md(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):up(function(e){var t,n=xd(e),r=gd(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=ud(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=ud(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+yd(e),l=-r.scrollTop;return"rtl"===bd(o||n).direction&&(s+=ud(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(xd(e)))}function pp(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function fp(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function hp(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,l=void 0===s?"clippingParents":s,c=n.rootBoundary,u=void 0===c?Md:c,d=n.elementContext,p=void 0===d?Ud:d,f=n.altBoundary,h=void 0!==f&&f,m=n.padding,g=void 0===m?0:m,v=pp("number"!=typeof g?g:fp(g,Id)),x=p===Ud?"reference":Ud,y=e.rects.popper,b=e.elements[h?x:p],_=function(e,t,n,r){var o="clippingParents"===t?function(e){var t=Ed(Sd(e)),n=["absolute","fixed"].indexOf(bd(e).position)>=0&&ld(e)?Td(e):e;return sd(n)?t.filter(function(e){return sd(e)&&cp(e,n)&&"body"!==vd(e)}):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce(function(t,n){var o=dp(e,n,r);return t.top=ud(o.top,t.top),t.right=dd(o.right,t.right),t.bottom=dd(o.bottom,t.bottom),t.left=ud(o.left,t.left),t},dp(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}(sd(b)?b:b.contextElement||xd(e.elements.popper),l,u,a),w=md(e.elements.reference),j=Jd({reference:w,element:y,strategy:"absolute",placement:o}),S=up(Object.assign({},y,j)),k=p===Ud?S:w,E={top:_.top-k.top+v.top,bottom:k.bottom-_.bottom+v.bottom,left:_.left-k.left+v.left,right:k.right-_.right+v.right},C=e.modifiersData.offset;if(p===Ud&&C){var O=C[o];Object.keys(E).forEach(function(e){var t=[Ad,Pd].indexOf(e)>=0?1:-1,n=[Rd,Pd].indexOf(e)>=0?"y":"x";E[e]+=O[n]*t})}return E}const mp={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,f=n.flipVariations,h=void 0===f||f,m=n.allowedAutoPlacements,g=t.options.placement,v=Yd(g),x=l||(v!==g&&h?function(e){if(Yd(e)===Dd)return[];var t=ap(e);return[lp(e),t,lp(t)]}(g):[ap(g)]),y=[g].concat(x).reduce(function(e,n){return e.concat(Yd(n)===Dd?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?qd:l,u=Xd(r),d=u?s?Bd:Bd.filter(function(e){return Xd(e)===u}):Id,p=d.filter(function(e){return c.indexOf(e)>=0});0===p.length&&(p=d);var f=p.reduce(function(t,n){return t[n]=hp(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[Yd(n)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):n)},[]),b=t.rects.reference,_=t.rects.popper,w=new Map,j=!0,S=y[0],k=0;k<y.length;k++){var E=y[k],C=Yd(E),O=Xd(E)===Fd,T=[Rd,Pd].indexOf(C)>=0,R=T?"width":"height",P=hp(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),A=T?O?Ad:Nd:O?Pd:Rd;b[R]>_[R]&&(A=ap(A));var N=ap(A),D=[];if(i&&D.push(P[C]<=0),s&&D.push(P[A]<=0,P[N]<=0),D.every(function(e){return e})){S=E,j=!1;break}w.set(E,D)}if(j)for(var I=function(e){var t=y.find(function(t){var n=w.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return S=t,"break"},F=h?3:1;F>0&&"break"!==I(F);F--);t.placement!==S&&(t.modifiersData[r]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function gp(e,t,n){return ud(e,dd(t,n))}const vp={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,f=void 0===p||p,h=n.tetherOffset,m=void 0===h?0:h,g=hp(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Yd(t.placement),x=Xd(t.placement),y=!x,b=Qd(v),_="x"===b?"y":"x",w=t.modifiersData.popperOffsets,j=t.rects.reference,S=t.rects.popper,k="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,E="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),C=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(w){if(i){var T,R="y"===b?Rd:Nd,P="y"===b?Pd:Ad,A="y"===b?"height":"width",N=w[b],D=N+g[R],I=N-g[P],F=f?-S[A]/2:0,L=x===Fd?j[A]:S[A],M=x===Fd?-S[A]:-j[A],U=t.elements.arrow,B=f&&U?jd(U):{width:0,height:0},q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=q[R],H=q[P],z=gp(0,j[A],B[A]),G=y?j[A]/2-F-z-W-E.mainAxis:L-z-W-E.mainAxis,V=y?-j[A]/2+F+z+H+E.mainAxis:M+z+H+E.mainAxis,$=t.elements.arrow&&Td(t.elements.arrow),K=$?"y"===b?$.clientTop||0:$.clientLeft||0:0,Y=null!=(T=null==C?void 0:C[b])?T:0,X=N+V-Y,Q=gp(f?dd(D,N+G-Y-K):D,N,f?ud(I,X):I);w[b]=Q,O[b]=Q-N}if(s){var J,Z="x"===b?Rd:Nd,ee="x"===b?Pd:Ad,te=w[_],ne="y"===_?"height":"width",re=te+g[Z],oe=te-g[ee],ie=-1!==[Rd,Nd].indexOf(v),ae=null!=(J=null==C?void 0:C[_])?J:0,se=ie?re:te-j[ne]-S[ne]-ae+E.altAxis,le=ie?te+j[ne]+S[ne]-ae-E.altAxis:oe,ce=f&&ie?function(e,t,n){var r=gp(e,t,n);return r>n?n:r}(se,te,le):gp(f?se:re,te,f?le:oe);w[_]=ce,O[_]=ce-te}t.modifiersData[r]=O}},requiresIfExists:["offset"]},xp={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Yd(n.placement),l=Qd(s),c=[Nd,Ad].indexOf(s)>=0?"height":"width";if(i&&a){var u=function(e,t){return pp("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:fp(e,Id))}(o.padding,n),d=jd(i),p="y"===l?Rd:Nd,f="y"===l?Pd:Ad,h=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],m=a[l]-n.rects.reference[l],g=Td(i),v=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,x=h/2-m/2,y=u[p],b=v-d[c]-u[f],_=v/2-d[c]/2+x,w=gp(y,_,b),j=l;n.modifiersData[r]=((t={})[j]=w,t.centerOffset=w-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&cp(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function yp(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function bp(e){return[Rd,Ad,Pd,Nd].some(function(t){return e[t]>=0})}const _p={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=hp(t,{elementContext:"reference"}),s=hp(t,{altBoundary:!0}),l=yp(a,r),c=yp(s,o,i),u=bp(l),d=bp(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};var wp=Vd({defaultModifiers:[Kd,Zd,np,rp,op,mp,vp,xp,_p]}),jp=n(4072),Sp=n.n(jp),kp=function(e){return e.reduce(function(e,t){var n=t[0],r=t[1];return e[n]=r,e},{})},Ep="undefined"!=typeof window&&window.document&&window.document.createElement?o.useLayoutEffect:o.useEffect,Cp=[];const Op=function({onClick:e}){return(0,Ur.jsx)("svg",{height:"20",width:"20",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",onClick:e,children:(0,Ur.jsx)("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"})})},Tp=function(e){const{isPrimary:t=!1,isSecondary:n=!0,isSubmit:r=!1,isSaving:o=!1,className:i,children:a,disabled:s=!1,isDestructive:l=!1,...c}=e,u=Mr("button",i,{"button-primary":t,"button-secondary":n,"button-delete":l,"wpl-spinner":o});return(0,Ur.jsxs)("button",{className:u,disabled:s,type:r?"submit":"button",...c,children:[o&&(0,Ur.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,Ur.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"})}),a]})};function Rp(e){const[t,n]=(0,o.useState)(null),[r,i]=(0,o.useState)(null),{options:a,disabled:s=!1,title:l,align:c="bottom-start",selected:u}=e,{styles:d,attributes:p}=function(e,t,n){void 0===n&&(n={});var r=o.useRef(null),i={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||Cp},a=o.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=a[0],l=a[1],c=o.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(e){var t=e.state,n=Object.keys(t.elements);Hr.flushSync(function(){l({styles:kp(n.map(function(e){return[e,t.styles[e]||{}]})),attributes:kp(n.map(function(e){return[e,t.attributes[e]]}))})})},requires:["computeStyles"]}},[]),u=o.useMemo(function(){var e={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[c,{name:"applyStyles",enabled:!1}])};return Sp()(r.current,e)?r.current||e:(r.current=e,e)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,c]),d=o.useRef();return Ep(function(){d.current&&d.current.setOptions(u)},[u]),Ep(function(){if(null!=e&&null!=t){var r=(n.createPopper||wp)(e,t,u);return d.current=r,function(){r.destroy(),d.current=null}}},[e,t,n.createPopper]),{state:d.current?d.current.state:null,styles:s.styles,attributes:s.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}}(t,r,{placement:c,modifiers:[{name:"offset",options:{offset:[0,2]}}]});return(0,Ur.jsxs)(id,{className:Mr("wpl-dropdownbutton",a.length<=1?"wpl-dropdownbutton__single":null),children:[(0,Ur.jsx)("button",{onClick:()=>e.onSelect(a[0].value),type:"button",className:Mr("wpl-dropdownbutton","wpl-dropdownbutton__single",s&&"wpl-dropdownbutton__disabled"),children:(0,Ur.jsx)("h5",{children:l})}),a.length>1&&(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(id.Button,{ref:n,disabled:s,className:Mr("wpl-popover__toggle",s&&"wpl-dropdownbutton__disabled"),children:(0,Ur.jsx)(Op,{})}),(0,Ur.jsx)(id.Panel,{ref:i,style:d.popper,...p.popper,className:"wpl-popover wpl-popover__content",children:({close:t})=>(0,Ur.jsx)("ul",{children:a.map(({label:n,value:r,description:o})=>(0,Ur.jsxs)("li",{className:Mr({["wpl-dropdownbutton__"+r]:!0,"wpl-dropdownbutton__selected":u===r}),children:[u===r?(0,Ur.jsx)("span",{className:"wpl-dropdownbutton__selected-icon",children:"✓"}):(0,Ur.jsx)("span",{className:"wpl-dropdownbutton__selected-icon"}),(0,Ur.jsxs)(Tp,{onClick:n=>function(t,n,r){t.preventDefault(),t.stopPropagation(),r(),e.onSelect(n)}(n,r,t),children:[n,o&&(0,Ur.jsx)("span",{children:o})]})]},r))})})]})]})}const Pp=function(){return(0,Ur.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:[(0,Ur.jsx)("circle",{transform:"translate(8 0)",cx:"0",cy:"16",r:"0",children:(0,Ur.jsx)("animate",{attributeName:"r",values:"0; 4; 0; 0",dur:"1.2s",repeatCount:"indefinite",begin:"0",keyTimes:"0;0.2;0.7;1",keySplines:"0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.6 0.4 0.8",calcMode:"spline"})}),(0,Ur.jsx)("circle",{transform:"translate(16 0)",cx:"0",cy:"16",r:"0",children:(0,Ur.jsx)("animate",{attributeName:"r",values:"0; 4; 0; 0",dur:"1.2s",repeatCount:"indefinite",begin:"0.3",keyTimes:"0;0.2;0.7;1",keySplines:"0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.6 0.4 0.8",calcMode:"spline"})}),(0,Ur.jsx)("circle",{transform:"translate(24 0)",cx:"0",cy:"16",r:"0",children:(0,Ur.jsx)("animate",{attributeName:"r",values:"0; 4; 0; 0",dur:"1.2s",repeatCount:"indefinite",begin:"0.6",keyTimes:"0;0.2;0.7;1",keySplines:"0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.6 0.4 0.8",calcMode:"spline"})})]})};var Ap=n(4465),Np=n.n(Ap);const Dp=function({options:e,value:t,onSelect:n,onClose:r}){return(0,Ur.jsx)("ul",{children:e.map((e,o)=>(0,Ur.jsx)("li",{children:(0,Ur.jsx)("button",{type:"button",onClick:t=>function(e,t){e.preventDefault(),n(t),r()}(t,e),onKeyDown:t=>function(e,t){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n(t),r())}(t,e),children:(0,Ur.jsx)(Np(),{searchWords:[t],textToHighlight:e.title,autoEscape:!0})})},o))})},Ip=function(e){const{placeholder:t="",onChange:n,value:r,fetchData:i,name:a="text",disabled:s=!1,className:l,maxChoices:c=-1,maxLength:u=0,canMakeRequest:d=e=>e.length>0,onBlur:p,getLabel:f,setLabel:h=()=>{},loadOnFocus:m=!1,onlyChoices:g=!1}=e,[v,x]=(0,o.useState)(!1),[y,b]=(0,o.useState)([]),[_,w]=(0,o.useState)(Array.isArray(r)?"":r),j=(0,o.useRef)(null),S={"wpl-dropdowntext__suggestion__hide":c>0&&Array.isArray(r)&&r.length>=c,"wpl-dropdowntext__suggestion":c>1},k=function(e,t,n,r){var i=this,a=(0,o.useRef)(null),s=(0,o.useRef)(0),l=(0,o.useRef)(0),c=(0,o.useRef)(null),u=(0,o.useRef)([]),d=(0,o.useRef)(),p=(0,o.useRef)(),f=(0,o.useRef)(e),h=(0,o.useRef)(!0);f.current=e;var m="undefined"!=typeof window,g=!t&&0!==t&&m;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var v=!!(n=n||{}).leading,x=!("trailing"in n)||!!n.trailing,y="maxWait"in n,b="debounceOnServer"in n&&!!n.debounceOnServer,_=y?Math.max(+n.maxWait||0,t):null;(0,o.useEffect)(function(){return h.current=!0,function(){h.current=!1}},[]);var w=(0,o.useMemo)(function(){var e=function(e){var t=u.current,n=d.current;return u.current=d.current=null,s.current=e,l.current=l.current||e,p.current=f.current.apply(n,t)},n=function(e,t){g&&cancelAnimationFrame(c.current),c.current=g?requestAnimationFrame(e):setTimeout(e,t)},o=function(e){if(!h.current)return!1;var n=e-a.current;return!a.current||n>=t||n<0||y&&e-s.current>=_},w=function(t){return c.current=null,x&&u.current?e(t):(u.current=d.current=null,p.current)},j=function e(){var r=Date.now();if(v&&l.current===s.current&&S(),o(r))return w(r);if(h.current){var i=t-(r-a.current),c=y?Math.min(i,_-(r-s.current)):i;n(e,c)}},S=function(){r&&r({})},k=function(){if(m||b){var r=Date.now(),l=o(r);if(u.current=[].slice.call(arguments),d.current=i,a.current=r,l){if(!c.current&&h.current)return s.current=a.current,n(j,t),v?e(a.current):p.current;if(y)return n(j,t),e(a.current)}return c.current||n(j,t),p.current}};return k.cancel=function(){var e=c.current;e&&(g?cancelAnimationFrame(c.current):clearTimeout(c.current)),s.current=0,u.current=a.current=d.current=c.current=null,e&&r&&r({})},k.isPending=function(){return!!c.current},k.flush=function(){return c.current?w(Date.now()):p.current},k},[v,y,t,_,x,g,m,b,r]);return w}(E,450);function E(e){i&&(x(!0),i(e).then(e=>{j.current&&j.current.ownerDocument.activeElement===j.current&&b(e),x(!1)}).catch(()=>{b([]),x(!1)}))}function C(e){if(f)return T(e).map(t=>f(t,e))}function O(e){if(c>0){if(!T(r).find(t=>t===`${e.value}`)){const t=[`${e.value}`].concat(T(r).filter(t=>t!==`${e.value}`)).slice(0,c);n(1!==c||g?t:t[0],[e.title].concat(C(t)?.slice(1)||[])),h(e.value,e.title)}w("")}else w(e.value),n(e.value,C(r));b([])}function T(e){return Array.isArray(e)?e:e?[e]:[]}return(0,o.useEffect)(()=>{r!==_&&w(Array.isArray(r)?"":r)},[r,_]),(0,Ur.jsxs)("div",{className:Mr("wpl-dropdowntext",l,S),children:[c>0&&T(r).map(e=>(0,Ur.jsx)(Br,{title:e,onCancel:()=>function(e){const t=T(r).filter(t=>t!==e);h(e,null),Array.isArray(r)?n(1===c?t[0]:t,C(t)):n(""),j.current?.focus()}(e),disabled:s,children:f?f(e,r):e},e)),(0,Ur.jsx)("input",{type:"text",className:Mr("regular-text",{"wpl-dropdowntext__max":c>=0&&T(r).length>=c}),name:a,value:_,disabled:s,onChange:function(e){w(e.target.value),c<1&&n(e.target.value),i&&k&&(d(e.target.value.trim())?k(e.target.value):b([]))},maxLength:u>0?u:void 0,placeholder:t,ref:j,onFocus:function(){const e=(Array.isArray(r),r.length>0);m&&!e&&E("")},onBlur:function(e){if(e.relatedTarget&&e.relatedTarget.closest(".wpl-dropdowntext__suggestions"))return;const t=p?p(_):_,r=`${null!=t?t:""}`;0===y.length?g?w(""):c>0&&i?O({value:r,label:r,title:r}):n(r):r!==_&&w(r),x(!1)},onKeyDown:function(e){"Enter"===e.code&&(x(!1),b([]))}}),v&&(0,Ur.jsx)("div",{className:"wpl-dropdowntext__loading",children:(0,Ur.jsx)(Pp,{})}),y.length>0&&j.current&&(0,Ur.jsx)(Ui,{align:"left",onClose:()=>b([]),popoverPosition:Mi(j.current),className:"wpl-dropdowntext__suggestions",focusLock:!1,children:(0,Ur.jsx)(Dp,{options:y,value:_,onSelect:O,onClose:()=>b([])})})]})};function Fp({option:e,onChange:t,isSelected:n,optionsType:r="checkbox",name:o}){const{value:i,disabled:a=!1,label:s}=e,l="radio"===r?`multi_${i}`:`multi_${o}_${i}`;return(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("input",{id:l,type:r,name:o||i,value:i,onChange:e=>t(o,i,"checkbox"!==r||e.target.checked),checked:n(o,i),disabled:a,tabIndex:0}),(0,Ur.jsx)("label",{"aria-label":e.label,htmlFor:l,children:s})]})}const Lp=function(e){const{option:t,optionsType:n,onChange:r,isSelected:o}=e,{options:i=[],label:a,value:s}=t;return(0,Ur.jsxs)("div",{className:"wpl-multioption__group",children:[(0,Ur.jsx)("h5",{children:a}),i.map((e,t)=>(0,Ur.jsx)(Fp,{option:e,isSelected:o,onChange:r,name:s||e.value,optionsType:n},t))]})},Mp=function(e){const{option:t,isSelected:n,onChange:r}=e;if(t.options){const{optionsType:e="checkbox"}=t;return(0,Ur.jsx)(Lp,{option:t,optionsType:e,isSelected:n,onChange:r})}return(0,Ur.jsx)(Fp,{option:t,isSelected:n,onChange:r,optionsType:"checkbox",name:t?.value||""})};function Up(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r){if(r.value===t)return r;if(r.options){const e=Up(r.options,t);if(e)return e}}}return null}function Bp(e,t){var n;return e&&t?{title:e.badge||e.label,default:null!==(n=e?.default)&&void 0!==n&&n,onRemove:n=>{if(e.value===t.value)return n(e.value||"",e.value||"",!1);const r=(t.options||[]).find(e=>e.default);n(t.value||"",t.value||"",r?r.value:"")}}:null}function qp(e){const t=Up(e,""),n=Bp(t,t);return n?[n]:[]}function Wp({selected:e,title:t,options:n,showBadges:r,onChange:o,disabled:i}){const a=function(e){return Array.isArray(e)?-1!==e.indexOf(""):Boolean(e?.[""])}(e)&&n.length>0?qp(n):Array.isArray(e)?function(e,t){return-1!==e.indexOf("")?qp(t):e.map(e=>{const n=Up(t,e);return Bp(n,n)}).filter(e=>null!==e)}(e,n):function(e,t){return Object.keys(e).map(n=>{const r=Up(t,n);return"string"==typeof e[n]?Bp(Up(t,e[n]),r):e[n]?Bp(r,r):null}).filter(e=>null!==e).filter(e=>e&&!0!==e.default)}(e,n);if(a.length>0&&r){const e=a.slice(0,3).map((e,t)=>e?(0,Ur.jsx)(Br,{small:!0,onCancel:t=>function(e,t){e.preventDefault(),e.stopPropagation(),t.onRemove(o)}(t,e),disabled:i,children:e.title},t):null);return a.length>3?e.concat([(0,Ur.jsx)("span",{children:"..."},"end")]):e}return t.length>0&&(!r||0===a.length)?(0,Ur.jsx)("h5",{children:t}):null}const Hp=function(e){const{options:t,selected:n,onChange:r,title:o="",badges:i=!1,disabled:a=!1,className:s,asObject:l=!1}=e;function c(e,t){if(l){const r=n;return e===t?Boolean(r[t]):r[e]===t}return-1!==n.indexOf(t)}function u(e,t,o){if(l)r({...n,[e]:e===t?o:t});else{const i=n,a=e===t?e:t;r(o?[...i,a]:i.filter(e=>e!==a))}}return(0,Ur.jsx)(Bi,{renderToggle:(e,r)=>(0,Ur.jsxs)("div",{className:Mr("action","wpl-multioption__button",a&&"wpl-multioption__disabled",e?"wpl-multioption__button_enabled":null),onClick:r,tabIndex:0,"aria-label":o||"",children:[(0,Ur.jsx)(Wp,{selected:n,title:o,showBadges:i,options:t,disabled:a,onChange:u}),(0,Ur.jsx)(Op,{})]}),disabled:a,align:"right",matchMinimum:!0,renderContent:()=>(0,Ur.jsx)("div",{className:Mr("wpl-multioption",s),children:t.map((e,t)=>(0,Ur.jsx)(Mp,{option:e,isSelected:c,onChange:u},t))})})},zp=({url:e,children:t,title:n,className:r})=>(0,Ur.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:n,className:r,children:t}),Gp=({item:e,isCurrent:t,onClick:n,isLast:r,urlBase:o})=>{const i=o+(""===e.value?"":"&sub="+e.value);return(0,Ur.jsxs)("li",{children:[(0,Ur.jsx)("a",{className:t?"current":"",href:i,onClick:t=>{t.preventDefault(),n(e.value,i)},children:e.name})," ",!r&&"|"," "]})},Vp=(e,t,n)=>e===t.value||e===n&&""===t.value,$p=({onChangePage:e,menu:t,home:n,urlBase:r,currentPage:o})=>t.length<2?null:(0,Ur.jsx)("div",{className:"subsubsub-container",children:(0,Ur.jsx)("ul",{className:"subsubsub",children:t.map((i,a)=>(0,Ur.jsx)(Gp,{item:i,isCurrent:Vp(o,i,n),isLast:a===t.length-1,onClick:e,urlBase:r},a))})}),Kp=function({onClose:e,children:t,className:n}){return(0,Ur.jsx)(Wr,{className:"wpl-click-outside",onOutside:t=>{t.target instanceof HTMLElement&&t.target.classList.contains("wpl-modal_main")&&e()},children:(0,Ur.jsxs)("div",{className:Mr("wpl-modal_content",n),children:[(0,Ur.jsx)("div",{className:"wpl-modal_close",children:(0,Ur.jsx)("button",{type:"button",onClick:e,children:"✖"})}),t]})})},Yp="wpl-modal_shown",Xp=function({padding:e=!0,...t}){(0,o.useEffect)(()=>(document.body.classList.add(Yp),()=>{document.body.classList.remove(Yp)}),[]);const n=Mr({"wpl-modal_wrapper":!0,"wpl-modal_wrapper-padding":e});return(0,Ur.jsxs)("div",{className:n,children:[(0,Ur.jsx)("div",{className:"wpl-modal_backdrop"}),(0,Ur.jsx)("div",{className:"wpl-modal_main",children:(0,Ur.jsx)(Kp,{...t})})]})},Qp=e=>(0,Hr.createPortal)((0,Ur.jsx)(Xp,{...e}),Li("wpl-modal")||document.body);let Jp=!1;function Zp({notices:e}){return(0,Ur.jsx)(Ur.Fragment,{children:e[e.length-1]+(e.length>1?" ("+e.length+")":"")})}const ef=function({notices:e,onClear:t,snackBarViewText:n}){const[r,i]=(0,o.useState)(!1);if((0,o.useEffect)(()=>(e.length>0&&(Jp&&clearTimeout(Jp),r?i(!1):Jp=setTimeout(()=>i(!0),5e3)),()=>{Jp&&clearTimeout(Jp)}),[e,r]),0===e.length)return null;function a(){r?i(!1):t()}const s=Mr("notice","notice-info","wpl-notice",r&&"wpl-notice_shrunk");return(0,Ur.jsxs)("div",{className:s,onClick:a,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a())},role:"button",tabIndex:0,children:[(0,Ur.jsx)("div",{className:"closer",children:(0,Ur.jsx)("span",{className:"dashicons dashicons-yes"})}),(0,Ur.jsx)("p",{children:r?(0,Ur.jsx)("span",{className:"dashicons dashicons-warning",title:n}):(0,Ur.jsx)(Zp,{notices:e})})]})},tf=()=>(0,Ur.jsx)("div",{className:"wpl-placeholder__container",children:(0,Ur.jsx)("div",{className:"wpl-placeholder__loading"})}),nf=({value:e,label:t,disabled:n=!1})=>Array.isArray(e)?(0,Ur.jsx)("optgroup",{label:String(t),disabled:n,children:e.map((e,t)=>(0,Ur.jsx)(nf,{label:e.label,value:e.value,disabled:e.disabled||!1},t))}):(0,Ur.jsx)("option",{value:e,disabled:n,children:t}),rf=nf,of=({items:e,value:t,name:n,onChange:r,disabled:o=!1,className:i})=>(0,Ur.jsx)("select",{name:n,value:t,onChange:r,disabled:o,className:i,children:e.map((e,t)=>(0,Ur.jsx)(rf,{value:e.value,label:e.label,disabled:e.disabled||!1},t))}),af=({size:e=""})=>{const t=Mr("wpl-spinner__container",e&&" spinner-"+e);return(0,Ur.jsx)("div",{className:t,children:(0,Ur.jsx)("span",{className:"wpl-spinner__item"})})},sf=o.useLayoutEffect;var lf=function(e,t){"function"!=typeof e?e.current=t:e(t)};var cf={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},uf=function(e){Object.keys(cf).forEach(function(t){e.style.setProperty(t,cf[t],"important")})},df=null,pf=function(e,t){var n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize},ff=function(){},hf=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],mf=!!document.documentElement.currentStyle;function gf(e,t,n){var r,i,a=(r=n,i=o.useRef(r),sf(function(){i.current=r}),i);o.useLayoutEffect(function(){var n=function(e){return a.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var vf=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],xf=function(e,t){var n,r=e.cacheMeasurements,i=e.maxRows,a=e.minRows,s=e.onChange,l=void 0===s?ff:s,c=e.onHeightChange,u=void 0===c?ff:c,d=zr(e,vf),p=void 0!==d.value,f=o.useRef(null),h=function(e,t){var n=(0,o.useRef)();return(0,o.useCallback)(function(r){e.current=r,n.current&&lf(n.current,null),n.current=t,t&&lf(t,r)},[t])}(f,t),m=o.useRef(0),g=o.useRef(),v=function(){var e=f.current,t=r&&g.current?g.current:function(e){var t=window.getComputedStyle(e);if(null===t)return null;var n,r=(n=t,hf.reduce(function(e,t){return e[t]=n[t],e},{})),o=r.boxSizing;return""===o?null:(mf&&"border-box"===o&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px"),{sizingStyle:r,paddingSize:parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),borderSize:parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth)})}(e);if(t){g.current=t;var n=function(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1/0),df||((df=document.createElement("textarea")).setAttribute("tabindex","-1"),df.setAttribute("aria-hidden","true"),uf(df)),null===df.parentNode&&document.body.appendChild(df);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,s=a.boxSizing;Object.keys(a).forEach(function(e){var t=e;df.style[t]=a[t]}),uf(df),df.value=t;var l=pf(df,e);df.value=t,l=pf(df,e),df.value="x";var c=df.scrollHeight-o,u=c*n;"border-box"===s&&(u=u+o+i),l=Math.max(u,l);var d=c*r;return"border-box"===s&&(d=d+o+i),[l=Math.min(d,l),c]}(t,e.value||e.placeholder||"x",a,i),o=n[0],s=n[1];m.current!==o&&(m.current=o,e.style.setProperty("height",o+"px","important"),u(o,{rowHeight:s}))}};return o.useLayoutEffect(v),function(e,t){gf(document.body,"reset",function(n){e.current.form===n.target&&t()})}(f,function(){if(!p){var e=f.current.value;requestAnimationFrame(function(){var t=f.current;t&&e!==t.value&&v()})}}),gf(window,"resize",v),n=v,gf(document.fonts,"loadingdone",n),o.createElement("textarea",Gr({},d,{onChange:function(e){p||v(),l(e)},ref:h}))},yf=o.forwardRef(xf);const bf=function(e){const{error:t,mini:n,context:r,renderDebug:i,versions:a,noParse:s=!1,details:l=[],locale:c}=e,[u,d]=(0,o.useState)(!n);if(!u)return(0,Ur.jsx)("p",{children:(0,Ur.jsx)("button",{className:"button button-secondary",type:"button",onClick:()=>d(!0),children:(0,Ot.__)("Show debug",c)})});const p=s?[t]:function(e,t,n){const r=t?[t]:[],{request:o=!1,data:i}=e;r.push("");const{apiFetch:a}=o||{};return a&&a.status&&a.statusText&&(r.push("Action: "+a.action),a.body&&"{}"!==a.body&&r.push("Params: "+a.body),r.push("Code: "+a.status+" "+a.statusText),r.push("")),r.push("Error: "+function(e){if("string"==typeof e)return e;const t=e;return 0===t.code?t.message:t.data&&t.data.wpdb?`${t.message} (${t.code}): ${t.data.wpdb}`:t.code?`${t.message} (${t.code})`:t.message}(e)),i&&r.push("Raw: "+i),n&&(r.push(""),r.push("Context:"),r.push(n)),r}(t,a,r);return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Debug Information",c)}),i&&i(l.concat(p).join("\n")),(0,Ur.jsx)("p",{children:(0,Ur.jsx)(yf,{readOnly:!0,cols:120,value:l.concat(p).join("\n"),maxRows:40,spellCheck:!1})})]})},_f=function(e){const{locale:t}=e;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("You are using an old or cached session",t)}),(0,Ur.jsx)("p",{children:(0,Ot.__)("This is usually fixed by doing one of the following:",t)}),(0,Ur.jsxs)("ul",{children:[(0,Ur.jsx)("li",{children:(0,Ot.__)("Reload the page - your current session is old.",t)}),(0,Ur.jsx)("li",{children:(0,Ot.__)("Log out, clear your browser cache, and log in again - your browser has cached an old session.",t)}),(0,Ur.jsx)("li",{children:(0,Ot.__)("Your admin pages are being cached. Clear this cache and try again. There may be multiple caches involved.",t)})]}),(0,Ur.jsx)(bf,{...e,error:e.error||{},mini:!0})]})};function wf(e){return 404===e?.request?.apiFetch?.status}function jf(e){const t=e.code;return"disabled"===t||"rest_disabled"===t}function Sf(e){return"rest_api_redirected"===e?.code}function kf(e){const t=e;return 0===t.code?t.message:t.data&&t.data.wpdb?(0,Ur.jsxs)("span",{children:[`${t.message} (${t.code})`,": ",(0,Ur.jsx)("code",{children:t.data.wpdb})]}):t.code?(0,Ur.jsxs)(Ur.Fragment,{children:[t.message," (",(0,Ur.jsx)("code",{children:t.code}),")"]}):t.message}const Ef=window.wp.element;function Cf(e,t){try{return(0,Ef.createInterpolateElement)(e.replace(/\{\{/g,"<").replace(/\}\}/g,">"),t)}catch(t){return e}}const Of=({error:e,links:t,locale:n})=>{if("string"==typeof e)return(0,Ur.jsx)("p",{children:e});if(function(e){return void 0!==e.code&&0===e.code}(e))return(0,Ur.jsx)("p",{children:(0,Ot.__)("WordPress did not return a response. This could mean an error occurred or that the request was blocked. Please check your server error_log.",n)});if(function(e){const t=e,{request:n,code:r}=t;return!!(n&&n.status&&r)&&(-1!==[400,401,403,405].indexOf(n.status)||"rest_no_route"===r)&&0===parseInt(String(r),10)}(e))return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:kf(e)}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Your REST API is probably being blocked by a security plugin. Please disable this, or configure it to allow REST API requests.",n)}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)(zp,{url:t.api,children:(0,Ot.__)("Read this REST API guide for more information.",n)})})]});if(wf(e))return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:(0,Ot.__)("Your WordPress REST API is returning a 404 page. This is almost certainly an external plugin or server configuration issue.",n)}),(0,Ur.jsx)("p",{className:"wpl-error__highlight",children:(0,Ur.jsx)("strong",{children:(0,Ot.__)("You will will need to fix this on your site. Redirection is not causing the error.",n)})}),(0,Ur.jsxs)("ul",{children:[(0,Ur.jsx)("li",{children:Cf((0,Ot.__)("Can you access your {{api}}REST API{{/api}} without it redirecting?",n),{api:(0,Ur.jsx)(zp,{url:t.rootUrl,children:t.rootUrl})})}),(0,Ur.jsx)("li",{children:Cf((0,Ot.__)("Check your {{link}}Site Health{{/link}} and fix any issues.",n),{link:(0,Ur.jsx)(zp,{url:t.siteHealth,children:t.siteHealth})})}),(0,Ur.jsx)("li",{children:(0,Ot.__)("Your server configuration is blocking access to the REST API.",n)}),(0,Ur.jsx)("li",{children:(0,Ot.__)("A security plugin or firewall is blocking access. You will need to whitelist the REST API.",n)})]}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)(zp,{url:t.api,children:(0,Ot.__)("Read this REST API guide for more information.",n)})})]});if(Sf(e))return(0,Ur.jsx)("p",{children:(0,Ot.__)("Your REST API is being redirected. Please remove the redirection for the API.",n)});if(function(e){return 413===e?.request?.apiFetch?.status}(e))return(0,Ur.jsx)("p",{children:(0,Ot.__)("Your server has rejected the request for being too big. You will need to reconfigure it to continue.",n)});if(function(e){return void 0===e.message}(e))return(0,Ur.jsx)("p",{children:(0,Ot.__)("An unknown error occurred.",n)});if(function(e){const t=e.data;return"string"==typeof t&&-1!==t.indexOf("<b>Deprecated</b>: Directive")}(e))return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:kf(e)}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Your REST API is showing a deprecated PHP error. Please fix this error.",n)})]});if(function(e){var t;return-1!==[500,502,503].indexOf(null!==(t=e?.request?.apiFetch?.status)&&void 0!==t?t:0)}(e))return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:kf(e)}),(0,Ur.jsx)("p",{children:(0,Ot.__)("This could be a security plugin, or your server is out of memory or has an external error. Please check your server error log",n)}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)(zp,{url:t.http,children:(0,Ot.__)("Read this REST API guide for more information.",n)})})]});if(jf(e))return(0,Ur.jsx)("p",{children:(0,Ot.__)("Your WordPress REST API has been disabled. You will need to enable it to continue.",n)});if(function(e){return"SyntaxError"===e.code}(e)){const t=function(e){const t=e.lastIndexOf("}");if(t!==e.length)return e.substring(t+1).trim();const n=e.split("<br />").filter(e=>e);return n.slice(0,n.length-1).join(" ").trim()}(e?.request?.apiFetch?.body||"");return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:kf(e)}),(0,Ur.jsx)("p",{children:(0,Ot.__)("WordPress returned an unexpected message. This could be a PHP error from another plugin, or data inserted by your theme.",n)}),t.length>1&&(0,Ur.jsxs)("p",{children:[(0,Ur.jsxs)("strong",{children:[(0,Ot.__)("Possible cause",n),":"]})," ",(0,Ur.jsx)("code",{children:t.substr(0,1e3)})]})]})}return function(e){const t=e?.message?.toString().toLowerCase();return!!t&&("failed to fetch"===t||"not allowed to request resource"===t||-1!==t.indexOf("networkerror"))}(e)?(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:kf(e)}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Unable to make request due to browser security. This is typically because your WordPress and Site URL settings are inconsistent, or the request was blocked by your site CORS policy.",n)}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)(zp,{url:t.url,children:(0,Ot.__)("Read this REST API guide for more information.",n)})})]}):function(e){var t;const{headers:n}=null!==(t=e.request)&&void 0!==t?t:{};if(n&&Symbol.iterator in Object(n))for(const[e]of n)if(-1!==e.toLowerCase().indexOf("cf-"))return!0;return!1}(e)?(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:kf(e)}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Your REST API appears to be cached and this will cause problems. Please exclude your REST API from your caching system.",n)})]}):(0,Ur.jsx)("p",{children:kf(e)})};function Tf(e,t,n){return wf(e)?(0,Ot.__)("REST API 404"):t||(0,Ot.__)("Something went wrong 🙁",n)}const Rf=function(e){const{title:t,children:n,error:r,links:o,locale:i}=e,a=function(e){return!wf(e)&&!Sf(e)&&!jf(e)}(r),s=function(e){return!!wf(e)||!!Sf(e)||!!jf(e)}(r),l=!wf(r);return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h2",{children:Tf(r,t,i)}),(0,Ur.jsx)("div",{className:"wpl-error__title",children:(0,Ur.jsx)(Of,{error:r,links:o,locale:i})}),a&&n,(0,Ur.jsx)(bf,{error:r,locale:i,...s?{mini:!0}:{},...!l&&e.renderDebug?{renderDebug:e.renderDebug}:{},...e.details?{details:e.details}:{},...e.versions?{versions:e.versions}:{},...e.context?{context:e.context}:{}})]})},Pf=function(e){const{title:t,children:n,error:r,links:o,locale:i}=e;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h2",{children:t||(0,Ot.__)("Something went wrong 🙁",i)}),(0,Ur.jsx)("div",{className:"wpl-error__detail",children:(0,Ur.jsx)(Of,{error:r,links:o,locale:i})}),n,(0,Ur.jsx)(bf,{...e})]})},Af=function(e){const{title:t,children:n,error:r,links:o,locale:i}=e;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h2",{children:t||(0,Ot.__)("Something went wrong 🙁",i)}),(0,Ur.jsx)("div",{className:"wpl-error__detail",children:(0,Ur.jsx)(Of,{error:r,links:o,locale:i})}),n,(0,Ur.jsx)(bf,{...e})]})},Nf=function(e){const{locale:t}=e;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Bad data",t)}),(0,Ur.jsx)("p",{children:(0,Ot.__)("There was a problem making a request to your site. This could indicate you provided data that did not match requirements, or that the plugin sent a bad request.",t)}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Please review your data and try again.",t)}),(0,Ur.jsx)(bf,{...e,error:e.error||{},mini:!0})]})};function Df({current:e,change:t,total:n}){return(0,Ur.jsxs)("div",{className:"wpl-error__page",children:[e>0&&(0,Ur.jsx)("span",{onClick:()=>t(e-1),onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),t(e-1))},role:"button",tabIndex:0,children:"←"}),`${e+1}/${n}`,e+1<n&&(0,Ur.jsx)("span",{onClick:()=>t(e+1),onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),t(e+1))},role:"button",tabIndex:0,children:"→"})]})}const If=function(e){const{onClear:t,mini:n=!1,type:r=""}=e,i=(0,o.useMemo)(()=>Array.isArray(e.errors)?e.errors:[e.errors],[e.errors]),[a,s]=(0,o.useState)(0);(0,o.useEffect)(()=>{!n&&i.length>0&&window.scrollTo(0,0)},[i,n]);const l=e=>{"click"!==e.type&&("keydown"!==e.type||"Enter"!==e.key&&" "!==e.key)||("keydown"===e.type&&e.preventDefault(),t&&t())};if(0===i.length)return null;const c=function(e,t){const n=e[0];return"rest_cookie_invalid_nonce"===n?.code?_f:400===n?.jsonData?.status?Nf:"error"===t?Pf:"fixed"===t?Af:Rf}(i,r);return(0,Ur.jsxs)("div",{className:Mr("wpl-error",{"wpl-error__mini":n}),children:[t&&(0,Ur.jsx)("div",{className:"closer",onClick:l,onKeyDown:l,role:"button",tabIndex:0,children:(0,Ur.jsx)("span",{className:"dashicons dashicons-no-alt"})}),i.length>1&&(0,Ur.jsx)(Df,{current:a,change:s,total:i.length}),(0,Ur.jsx)(c,{error:i[a],...e})]})};class Ff extends o.Component{constructor(e){super(e),this.state={error:!1,stack:null,errorInfo:null}}static getDerivedStateFromError(e){return{error:!0,stack:e}}componentDidCatch(e,t){this.setState({error:!0,stack:e,errorInfo:t}),console.error(e,t)}render(){const{error:e,stack:t,errorInfo:n}=this.state,{renderCrash:r,children:o,extra:i}=this.props;return e?r(t,n,i):o}}const Lf=Ff,Mf=function({level:e="notice",children:t,className:n}){return(0,Ur.jsx)("div",{className:Mr(`inline-notice inline-${e}`,n),children:t})};function Uf(){return{url:"https://redirection.me/support/problems/rest-api/#url",http:"https://redirection.me/support/problems/rest-api/#http",api:"https://redirection.me/support/problems/rest-api/",rootUrl:Redirectioni10n.api.WP_API_root,siteHealth:Redirectioni10n.api.site_health}}function Bf(){return Redirectioni10n.versions.split("\n").concat(["Query: "+document.location.search])}const qf=function(e){const t="mailto:john@redirection.me?subject=Redirection%20Error&body="+encodeURIComponent(e),n="https://github.com/johngodley/redirection/issues/new?title=Redirection%20Error&body="+encodeURIComponent("```\n"+e.trim()+"\n```\n\n");return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{className:"wpl-error__highlight",children:Cf((0,Ot.__)("Please check the {{link}}support site{{/link}} before proceeding further.","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/"})})}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("If that did not help then {{strong}}create an issue{{/strong}} or send it in an {{strong}}email{{/strong}}.","redirection"),{strong:(0,Ur.jsx)("strong",{})})}),(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("a",{href:n,className:"button-primary",children:(0,Ot.__)("Create An Issue","redirection")})," ",(0,Ur.jsx)("a",{href:t,className:"button-secondary",children:(0,Ot.__)("Email","redirection")})]}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Include these details in your report along with a description of what you were doing and a screenshot.","redirection")})]})};function Wf({setStep:e,setOptions:t}){return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Welcome to Redirection 🚀🎉","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.sprintf)((0,Ot.__)("Thank you for installing and using Redirection v%(version)s. This plugin will allow you to manage 301 redirections, keep track of 404 errors, and improve your site, with no knowledge of Apache or Nginx needed.","redirection"),{version:window.Redirectioni10n.version})}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Redirection is designed to be used on sites with a few redirects to sites with thousands of redirects.","redirection")}),(0,Ur.jsx)("h3",{children:(0,Ot.__)("How do I use this plugin?","redirection")}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("A simple redirect involves setting a {{strong}}source URL{{/strong}} (the old URL) and a {{strong}}target URL{{/strong}} (the new URL). Here's an example:","redirection"),{strong:(0,Ur.jsx)("strong",{})})}),(0,Ur.jsx)("table",{className:"redirect-edit",children:(0,Ur.jsxs)("tbody",{children:[(0,Ur.jsxs)("tr",{children:[(0,Ur.jsxs)("th",{children:[(0,Ot.__)("Source URL","redirection"),":"]}),(0,Ur.jsx)("td",{children:(0,Ur.jsx)("input",{type:"text",className:"regular-text",readOnly:!0,value:(0,Ot.__)("(Example) The source URL is your old or original URL","redirection")})})]}),(0,Ur.jsxs)("tr",{children:[(0,Ur.jsxs)("th",{children:[(0,Ot.__)("Target URL","redirection"),":"]}),(0,Ur.jsx)("td",{children:(0,Ur.jsx)("input",{type:"text",className:"regular-text",readOnly:!0,value:(0,Ot.__)("(Example) The target URL is the new URL","redirection")})})]})]})}),(0,Ur.jsx)("p",{children:(0,Ot.__)("That's all there is to it - you are now redirecting! Note that the above is just an example.","redirection")}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("Full documentation can be found on the {{link}}Redirection website.{{/link}}","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/"})})}),(0,Ur.jsxs)("h3",{children:[(0,Ot.__)("Some features you may find useful are","redirection"),":"]}),(0,Ur.jsxs)("ul",{children:[(0,Ur.jsx)("li",{children:Cf((0,Ot.__)("{{link}}Monitor 404 errors{{/link}}, get detailed information about the visitor, and fix any problems","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/tracking-404-errors/"})})}),(0,Ur.jsx)("li",{children:Cf((0,Ot.__)("{{link}}Import{{/link}} from .htaccess, CSV, and a variety of other plugins","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/import-export-redirects/"})})}),(0,Ur.jsx)("li",{children:Cf((0,Ot.__)("More powerful URL matching, including {{regular}}regular expressions{{/regular}}, and {{other}}other conditions{{/other}}","redirection"),{regular:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/redirect-regular-expressions/"}),other:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/matching-redirects/"})})}),(0,Ur.jsx)("li",{children:(0,Ot.__)("Check a URL is being redirected","redirection")})]}),(0,Ur.jsx)("h3",{children:(0,Ot.__)("What's next?","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("First you will be asked a few questions, and then Redirection will set up your database.","redirection")}),(0,Ur.jsxs)("div",{className:"wizard-buttons",children:[(0,Ur.jsx)("button",{className:"button-primary button",onClick:function(){t({manual:!1}),e(1)},children:(0,Ot.__)("Start Setup","redirection")})," ",(0,Ur.jsx)("button",{className:"button-secondary button",onClick:function(){t({manual:!0}),e(4)},children:(0,Ot.__)("Manual Setup","redirection")})]})]})}function Hf({setStep:e,step:t,options:n,setOptions:r}){var o;const{log:i=!1,ip:a=!1,monitor:s=!1}=null!==(o=n?.settings)&&void 0!==o?o:{},{importers:l}=de(e=>e.io),c=0===l.length?t+2:t+1;function u(e){r({settings:{...n.settings,[e.target.name]:e.target.checked}})}return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Basic Setup","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("These are some options you may want to enable now. They can be changed at any time.","redirection")}),(0,Ur.jsxs)("div",{className:"wizard-option",children:[(0,Ur.jsx)("p",{children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{name:"monitor",type:"checkbox",checked:s,onChange:u}),(0,Ot.__)("Monitor permalink changes in WordPress posts and pages","redirection"),"."]})}),(0,Ur.jsxs)("p",{children:[(0,Ot.__)("If you change the permalink in a post or page then Redirection can automatically create a redirect for you.","redirection")," ",Cf((0,Ot.__)("{{link}}Read more about this.{{/link}}","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/options/#monitor"})})]})]}),(0,Ur.jsxs)("div",{className:"wizard-option",children:[(0,Ur.jsx)("p",{children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{name:"log",type:"checkbox",checked:i,onChange:function(e){r({settings:{...n.settings,[e.target.name]:e.target.checked,ip:!!e.target.checked&&a}})}}),(0,Ot.__)("Keep a log of all redirects and 404 errors.","redirection")]})}),(0,Ur.jsxs)("p",{children:[(0,Ot.__)("Storing logs for redirects and 404s will allow you to see what is happening on your site. This will increase your database storage requirements.","redirection")," ",Cf((0,Ot.__)("{{link}}Read more about this.{{/link}}","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/logs/"})})]})]}),(0,Ur.jsxs)("div",{className:i?"wizard-option":"wizard-option wizard-option_disabled",children:[(0,Ur.jsx)("p",{children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{name:"ip",type:"checkbox",disabled:!i,checked:a,onChange:u}),(0,Ot.__)("Store IP information for redirects and 404 errors.","redirection")]})}),(0,Ur.jsxs)("p",{children:[(0,Ot.__)("Storing the IP address allows you to perform additional log actions. Note that you will need to adhere to local laws regarding the collection of data (for example GDPR).","redirection")," ",Cf((0,Ot.__)("{{link}}Read more about this.{{/link}}","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/privacy-gdpr/"})})]})]}),(0,Ur.jsxs)("div",{className:"wizard-buttons",children:[(0,Ur.jsx)("button",{className:"button-primary button",onClick:()=>e(c),children:(0,Ot.__)("Continue","redirection")})," ",(0,Ur.jsx)("button",{className:"button",onClick:()=>e(t-1),children:(0,Ot.__)("Go back","redirection")})]})]})}var zf=n(2168),Gf=n(5556),Vf=n.n(Gf),$f=n(7500),Kf=n.n($f);class Yf extends a().Component{constructor(e){super(e);const{request:t}=this.props.error;this.state={hide:this.doesNeedHiding(t)}}doesNeedHiding(e){return e&&e.raw&&e.raw.length>500}onShow=e=>{e.preventDefault(),this.setState({hide:!1})};onHide=e=>{e.preventDefault(),this.setState({hide:!0})};render(){const{request:e}=this.props.error,{hide:t}=this.state,n=this.doesNeedHiding(e);return e&&e.raw?(0,Ur.jsxs)(Ur.Fragment,{children:[n&&t&&(0,Ur.jsx)("a",{className:"api-result-hide",onClick:this.onShow,href:"#",children:(0,Ot.__)("Show Full","redirection")}),n&&!t&&(0,Ur.jsx)("a",{className:"api-result-hide",onClick:this.onHide,href:"#",children:(0,Ot.__)("Hide","redirection")}),(0,Ur.jsx)("pre",{children:t?e.raw.substr(0,500)+" ...":e.raw})]}):null}}const Xf=Yf,Qf=(e,t)=>{const n=(e=>e.code?e.code:e.name?e.name:null)(e);return(0,Ur.jsxs)("div",{className:"api-result-log_details",children:[(0,Ur.jsx)("p",{children:(0,Ur.jsx)("span",{className:"dashicons dashicons-no"})}),(0,Ur.jsxs)("div",{children:[(0,Ur.jsxs)("p",{children:[t.map((t,n)=>(0,Ur.jsxs)("span",{className:"api-result-method_fail",children:[t," ",e.data&&e.data.status]},n)),n&&(0,Ur.jsxs)("strong",{children:[n,": "]}),e.message]}),(0,Ur.jsx)(Of,{error:e,links:Uf(),locale:"redirection"}),(0,Ur.jsx)(Xf,{error:e})]})]},t)},Jf=e=>(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("span",{className:"dashicons dashicons-yes"}),e.map((e,t)=>(0,Ur.jsx)("span",{className:"api-result-method_pass",children:e},t)),(0,Ot.__)("Working!","redirection")]},e),Zf=e=>e.code?e.code:0,eh=({result:e})=>{const t=[],{GET:n,POST:r}=e;return n.status===r.status&&Zf(n)===Zf(r)?("fail"===n.status?t.push(Qf(n.error,["GET","POST"])):t.push(Jf(["GET","POST"])),t):("fail"===n.status?t.push(Qf(n.error,["GET"])):t.push(Jf(["GET"])),"fail"===r.status?t.push(Qf(r.error,["POST"])):t.push(Jf(["POST"])),t)},th=({item:e,result:t,routes:n,isCurrent:r,allowChange:o})=>(e=>0===Object.keys(e).length||"loading"===e.GET.status||"loading"===e.POST.status)(t)?null:(0,Ur.jsxs)("div",{className:"api-result-log",children:[(0,Ur.jsxs)("form",{className:"api-result-select",action:window.Redirectioni10n.pluginRoot+"&sub=support",method:"POST",children:[o&&!r&&(0,Ur.jsx)("input",{type:"submit",className:"button button-secondary",value:(0,Ot.__)("Switch to this API","redirection")}),o&&r&&(0,Ur.jsx)("span",{children:(0,Ot.__)("Current API","redirection")}),(0,Ur.jsx)("input",{type:"hidden",name:"rest_api",value:e.value}),(0,Ur.jsx)("input",{type:"hidden",name:"_wpnonce",value:Ct.nonceMiddleware.nonce}),(0,Ur.jsx)("input",{type:"hidden",name:"action",value:"rest_api"})]}),(0,Ur.jsx)("h4",{children:e.text}),(0,Ur.jsxs)("p",{children:["URL:"," ",(0,Ur.jsx)("code",{children:(0,Ur.jsx)(zp,{url:n[e.value],children:n[e.value]})})]}),(0,Ur.jsx)(eh,{result:t})]}),nh=e=>{const{title:t,url:n=!1}=e;return(0,Ur.jsxs)("tr",{children:[(0,Ur.jsxs)("th",{children:[!n&&t,n&&(0,Ur.jsx)("a",{href:n,target:"_blank",children:t})]}),(0,Ur.jsx)("td",{children:e.children})]})},rh=e=>(0,Ur.jsx)("table",{className:"form-table",children:(0,Ur.jsx)("tbody",{children:e.children})}),oh=()=>[{value:0,label:(0,Ot.__)("Default REST API","redirection")},{value:1,label:(0,Ot.__)("Raw REST API","redirection")},{value:3,label:(0,Ot.__)("Relative REST API","redirection")}],ih=function(e){const{settings:t,onChange:n,getLink:r,installed:o,warning:i}=e,{location:a,token:s,rest_api:l,plugin_update:c}=t;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("tr",{className:"redirect-option__row",children:(0,Ur.jsx)("th",{colSpan:2,children:(0,Ur.jsx)("h2",{className:"title",children:(0,Ot.__)("Advanced","redirection")})})}),(0,Ur.jsxs)(nh,{title:(0,Ot.__)("RSS Token","redirection")+":",url:r("options","rsstoken"),children:[(0,Ur.jsx)("input",{className:"regular-text",type:"text",value:s,name:"token",onChange:n}),(0,Ur.jsx)("br",{}),(0,Ur.jsx)("span",{className:"sub",children:(0,Ot.__)("A unique token allowing feed readers access to Redirection log RSS (leave blank to auto-generate)","redirection")})]}),(0,Ur.jsx)(nh,{title:(0,Ot.__)("Apache .htaccess","redirection"),url:r("options","apache"),children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("p",{children:(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"location",value:a,onChange:n})}),(0,Ur.jsx)("p",{className:"sub",children:Cf((0,Ot.sprintf)((0,Ot.__)("Redirects added to an Apache group can be saved to an {{code}}.htaccess{{/code}} file by adding the full path here. For reference, your WordPress is installed to {{code}}%(installed)s{{/code}}.","redirection"),{installed:o}),{code:(0,Ur.jsx)("code",{})})}),i&&(0,Ur.jsxs)("p",{className:"inline-notice",children:[(0,Ot.__)("Unable to save .htaccess file","redirection")," ",(0,Ur.jsx)("code",{children:i})]})]})}),(0,Ur.jsxs)(nh,{title:(0,Ot.__)("REST API","redirection"),url:r("options","restapi"),children:[(0,Ur.jsx)(of,{items:oh(),name:"rest_api",value:parseInt(l,10),onChange:n})," "," ",(0,Ur.jsx)("span",{className:"sub",children:(0,Ot.__)("How Redirection uses the REST API - don't change unless necessary","redirection")})]}),(0,Ur.jsxs)(nh,{title:(0,Ot.__)("Data Upgrade","redirection"),children:[(0,Ur.jsx)(of,{items:[{value:"prompt",label:(0,Ot.__)("Upgrade manually when prompted","redirection")},{value:"admin",label:(0,Ot.__)("Automatically upgrade on admin pages","redirection")}],name:"plugin_update",value:c,onChange:n})," "," ",(0,Ur.jsx)("span",{className:"sub",children:(0,Ot.__)("Decide how Redirection updates itself, if needed.","redirection")})]})]})},ah=(e,t={})=>{const n=e+"/";if(Object.keys(t).length>0){const e=function(e){const t=new URLSearchParams;function n(e,r){for(const o in r){const i=r[o];if(null!=i)if(Array.isArray(i))for(const n of i)null!=n&&t.append(`${e}[${o}][]`,String(n));else"object"==typeof i?n(`${e}[${o}]`,i):t.append(`${e}[${o}]`,String(i))}}for(const r in e){const o=e[r];if(null!=o)if(Array.isArray(o))for(const e of o)null!=e&&t.append(`${r}[]`,String(e));else"object"==typeof o?n(r,o):t.append(r,String(o))}return t.toString()}(t);if(e.length>0)return n+(-1===n.indexOf("?")?"?":"&")+e}return n},sh=(e,t={})=>({headers:{Accept:"application/json, */*;q=0.1"},url:ah(e,t),credentials:"include",method:"get",redirect:"error"}),lh=(e,t={},n={})=>{const r={headers:{"Content-Type":"application/json; charset=utf-8",Accept:"application/json, */*;q=0.1"},url:ah(e,n),credentials:"include",method:"post",body:"{}"};return Object.keys(t).length>0&&(r.body=JSON.stringify(t)),r},ch=(e,t={},n={})=>lh(e,t,n),uh=()=>sh("redirection/v1/setting"),dh=e=>lh("redirection/v1/setting",e),ph=e=>sh("redirection/v1/redirect",e),fh=(e,t)=>lh("redirection/v1/redirect/"+e,t),hh=(e,t)=>lh("redirection/v1/redirect",e,t),mh=e=>sh("redirection/v1/redirect/post",{text:e}),gh=e=>sh("redirection/v1/group",e),vh=(e,t)=>lh("redirection/v1/group/"+e,t),xh=(e,t)=>lh("redirection/v1/group",e,t),yh=e=>sh("redirection/v1/log",e),bh=e=>sh("redirection/v1/404",e),_h=(e,t)=>((e,t,n)=>{const r=lh(e,{});delete r.headers["Content-Type"];const o=new FormData;return o.append("file",n),r.body=o,r})("redirection/v1/import/file/"+e,0,t),wh=()=>sh("redirection/v1/import/plugin"),jh=e=>lh("redirection/v1/import/plugin",{plugin:e}),Sh=(e,t)=>sh("redirection/v1/export/"+e+"/"+t),kh=()=>sh("redirection/v1/plugin"),Eh=(e,t)=>lh("redirection/v1/plugin",{name:e,value:t}),Ch=()=>ch("redirection/v1/plugin/delete"),Oh=e=>lh("redirection/v1/plugin/data",e?{upgrade:e}:{}),Th=(e,t=!1)=>{const n=t?lh("redirection/v1/plugin/test",{test:"ping"}):sh("redirection/v1/plugin/test");return n.url="http"===e.substr(0,4)?e+n.url:n.url,n},Rh=(e,t,n)=>lh("redirection/v1/bulk/redirect/"+e,t,n),Ph=(e,t,n)=>lh("redirection/v1/bulk/group/"+e,t,n),Ah=(e,t,n)=>lh("redirection/v1/bulk/log/"+e,t,n),Nh=(e,t,n)=>lh("redirection/v1/bulk/404/"+e,t,n),Dh=(e,t=1)=>`https://api.redirect.li/v${t}/`+e,Ih=e=>({url:Dh("useragent/"+encodeURIComponent(e)),method:"get"}),Fh=e=>({url:Dh("http?url="+encodeURIComponent(e),2),method:"get"}),Lh=()=>(e,t)=>t().settings.loadStatus===Me?null:(Ct(uh()).then(t=>{e({type:we,values:t.settings,groups:t.groups,postTypes:t.post_types,installed:t.installed,canDelete:t.canDelete})}).catch(t=>{e({type:je,error:t})}),e({type:_e})),Mh=e=>t=>(Ct(dh(e)).then(e=>{t({type:Ee,values:e.settings,groups:e.groups,installed:e.installed,warning:e.warning})}).catch(e=>{t({type:Ce,error:e})}),t({type:ke})),Uh=(e,t)=>n=>(Ct(Eh(e,t)).then(e=>{e.status.filter(e=>"error"===e.status).length>0?n({type:je,error:"failed"}):(n({type:Se,pluginStatus:e}),document.location.reload())}).catch(e=>{n({type:je,error:e})}),n({type:_e})),Bh=e=>t=>(Ct(Oh(e)).then(e=>{t({type:Re,database:e})}).catch(e=>{t({type:Te,error:e})}),t({type:Oe,arg:e})),qh=()=>({type:Pe}),Wh="ok",Hh="fail",zh="loading",Gh="warning-current",Vh="warning-not-selected";class $h extends a().Component{static propTypes={allowChange:Vf().bool};static defaultProps={allowChange:!0};constructor(e){super(e),this.state={showing:!1}}componentDidMount(){this.onTry()}onTry(){const{routes:e}=this.props,t=Object.keys(e).map(t=>({id:t,url:e[t]}));this.props.onCheckApi(t.filter(e=>e))}onRetry=e=>{e.preventDefault,this.setState({showing:!1}),this.onTry()};getPercent(e,t){if(0===Object.keys(e).length)return 0;const n=2*t.length;let r=0;for(let t=0;t<Object.keys(e).length;t++){const n=Object.keys(e)[t];e[n]&&e[n].GET&&e[n].GET.status!==zh&&r++,e[n]&&e[n].POST&&e[n].POST.status!==zh&&r++}return Math.round(r/n*100)}getApiStatus(e,t,n){const r=Object.keys(e).filter(t=>{return(n=e[t]).GET&&n.POST&&(n.GET.status===Hh||n.POST.status===Hh);var n}).length;return 0===r?"ok":r<t.length?(o=e[n]).GET&&o.POST&&o.GET.status===Wh&&o.POST.status===Wh?Gh:Vh:"fail";var o}getApiStatusText(e){return e===Wh?(0,Ot.__)("Good","redirection"):e===Vh||e===Gh?(0,Ot.__)("Working but some issues","redirection"):(0,Ot.__)("Unavailable","redirection")}onShow=()=>{this.setState({showing:!0})};canShowProblem(e){const{showing:t}=this.state;return t||e===Hh}renderError(e){const t=this.canShowProblem(e);let n=(0,Ot.__)("There are some problems connecting to your REST API. It is not necessary to fix these problems and the plugin is able to work.","redirection");return e===Hh&&(n=(0,Ot.__)("Your REST API is not working and the plugin will not be able to continue until this is fixed.","redirection")),(0,Ur.jsxs)("div",{className:"api-result-log",children:[(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("strong",{children:(0,Ot.__)("Summary","redirection")}),": ",n]}),!t&&(0,Ur.jsx)("p",{children:(0,Ur.jsx)("button",{className:"button-secondary",onClick:this.onShow,children:(0,Ot.__)("Show Problems","redirection")})})]})}render(){const e=oh(),{apiTest:t,routes:n,current:r,allowChange:o}=this.props,{showing:i}=this.state,a=this.getPercent(t,e),s=this.getApiStatus(t,e,r),l=a>=100&&this.canShowProblem(s)||i,c=Kf()({"api-result-status":!0,"api-result-status_good":s===Wh&&a>=100,"api-result-status_problem":s===Gh&&Vh&&a>=100,"api-result-status_failed":s===Hh&&a>=100});return(0,Ur.jsxs)("div",{className:"api-result-wrapper",children:[(0,Ur.jsxs)("div",{className:"api-result-header",children:[(0,Ur.jsx)("strong",{children:"REST API:"}),(0,Ur.jsxs)("div",{className:"api-result-progress",children:[(0,Ur.jsxs)("span",{className:c,children:[a<100&&(0,Ot.sprintf)((0,Ot.__)("Testing - %s%%","redirection"),a),a>=100&&this.getApiStatusText(s)]}),a<100&&(0,Ur.jsx)(af,{})]}),a>=100&&s!==Wh&&(0,Ur.jsx)("button",{className:"button button-secondary api-result-retry",onClick:this.onRetry,children:(0,Ot.__)("Check Again","redirection")})]}),a>=100&&s!==Wh&&this.renderError(s),l&&e.map((e,i)=>{return(0,Ur.jsx)(th,{item:e,result:(a=t,s=e.value,a&&a[s]?a[s]:{}),routes:n,isCurrent:r===e.value,allowChange:o},i);var a,s})]})}}const Kh=te(function(e){const{api:{routes:t,current:n},apiTest:r}=e.settings;return{apiTest:r,routes:t,current:n}},function(e){return{onCheckApi:t=>{e((e=>t=>{for(let n=0;n<e.length;n++){const{id:r,url:o}=e[n];t({type:Ie,id:r,method:"GET"}),t({type:Ie,id:r,method:"POST"}),setTimeout(()=>{Ct(Th(o)).then(()=>{t({type:De,id:r,method:"GET"})}).catch(e=>{t({type:Ne,id:r,method:"GET",error:e})}),Ct(Th(o,!0)).then(()=>{t({type:De,id:r,method:"POST"})}).catch(e=>{t({type:Ne,id:r,method:"POST",error:e})})},1e3)}})(t))}}})($h);function Yh(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];if(e[r]&&"ok"===e[r].GET.status&&"ok"===e[r].POST.status)return r}return 0}function Xh({setStep:e,step:t}){const n=zf.qg(window.Redirectioni10n.api.WP_API_root),r=zf.qg(window.Redirectioni10n.pluginBaseUrl),i=n.protocol!==r.protocol||n.host!==r.host,{apiTest:a,api:s}=de(e=>e.settings);return(0,o.useEffect)(()=>()=>{const e=Yh(a);window.Redirectioni10n.api.routes[e]&&Ct.replaceRootURLMiddleware(window.Redirectioni10n.api.routes[e])},[]),(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("REST API","redirection")}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("Redirection uses the {{link}}WordPress REST API{{/link}} to communicate with WordPress. This is enabled and working by default. Sometimes the REST API is blocked by:","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://developer.wordpress.org/rest-api/"})})}),(0,Ur.jsxs)("ul",{children:[(0,Ur.jsx)("li",{children:(0,Ot.__)("A security plugin (e.g Wordfence)","redirection")}),(0,Ur.jsx)("li",{children:(0,Ot.__)("A server firewall or other server configuration (e.g OVH)","redirection")}),(0,Ur.jsx)("li",{children:(0,Ot.__)("Caching software (e.g Cloudflare)","redirection")}),(0,Ur.jsx)("li",{children:(0,Ot.__)("Some other plugin that blocks the REST API","redirection")})]}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("If you do experience a problem then please consult your plugin documentation, or try contacting your host support. This is generally {{link}}not a problem caused by Redirection{{/link}}.","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/problems/rest-api/"})})}),i&&(0,Ur.jsxs)("div",{className:"wpl-error",children:[(0,Ot.__)("You have different URLs configured on your WordPress Settings > General page, which is usually an indication of a misconfiguration, and it can cause problems with the REST API. Please review your settings.","redirection"),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("code",{children:n.protocol+"//"+n.host})}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("code",{children:r.protocol+"//"+r.host})})]}),(0,Ur.jsx)(Kh,{allowChange:!1}),(0,Ur.jsx)("p",{children:(0,Ot.__)("You will need at least one working REST API to continue.","redirection")}),(0,Ur.jsx)("div",{className:"wizard-buttons",children:(0,Ur.jsx)("button",{className:"button-primary button",onClick:()=>e(t+1),children:(0,Ot.__)("Finish Setup","redirection")})})]})}function Qh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qh(Object(n),!0).forEach(function(t){ho(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Zh={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},em=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"];const tm=function(e){var t=Jh(Jh({},Zh),e),n=t.className,r=t.percent,i=t.prefixCls,a=t.strokeColor,s=t.strokeLinecap,l=t.strokeWidth,c=t.style,u=t.trailColor,d=t.trailWidth,p=t.transition,f=function(e,t){if(null==e)return{};var n,r,o=zr(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,em);delete f.gapPosition;var h,m,g=Array.isArray(r)?r:[r],v=Array.isArray(a)?a:[a],x=(h=(0,o.useRef)([]),m=(0,o.useRef)(null),(0,o.useEffect)(function(){var e=Date.now(),t=!1;h.current.forEach(function(n){if(n){t=!0;var r=n.style;r.transitionDuration=".3s, .3s, .3s, .06s",m.current&&e-m.current<100&&(r.transitionDuration="0s, 0s")}}),t&&(m.current=Date.now())}),h.current),y=l/2,b=100-l/2,_="M ".concat("round"===s?y:0,",").concat(y,"\n L ").concat("round"===s?b:100,",").concat(y),w="0 0 100 ".concat(l),j=0;return o.createElement("svg",Gr({className:Kf()("".concat(i,"-line"),n),viewBox:w,preserveAspectRatio:"none",style:c},f),o.createElement("path",{className:"".concat(i,"-line-trail"),d:_,strokeLinecap:s,stroke:u,strokeWidth:d||l,fillOpacity:"0"}),g.map(function(e,t){var n=1;switch(s){case"round":n=1-l/100;break;case"square":n=1-l/2/100;break;default:n=1}var r={strokeDasharray:"".concat(e*n,"px, 100px"),strokeDashoffset:"-".concat(j,"px"),transition:p||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},a=v[t]||v[v.length-1];return j+=e,o.createElement("path",{key:t,className:"".concat(i,"-line-path"),d:_,strokeLinecap:s,stroke:a,strokeWidth:l,fillOpacity:"0",ref:function(e){x[t]=e},style:r})}))};"undefined"==typeof window||!window.document||window.document.createElement;class nm extends a().Component{static propTypes={message:Vf().string.isRequired,prevent:Vf().bool};static defaultProps={prevent:!0};componentDidMount(){this.props.prevent&&this.enable()}componentWillUnmount(){this.props.prevent&&this.disable()}componentDidUpdate(e){e.prevent!==this.props.prevent&&(this.props.prevent?this.enable():this.disable())}enable(){window.addEventListener("beforeunload",this.onWarning)}disable(){window.removeEventListener("beforeunload",this.onWarning)}onWarning=e=>(e.returnValue=this.props.message,e.returnValue);render(){return null}}const rm=nm;function om({onRetry:e}){return(0,Ur.jsxs)("div",{className:"redirection-database_error wpl-error",children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Database problem","redirection")}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("button",{className:"button button-primary",onClick:e,children:(0,Ot.__)("Try again","redirection")})})]})}function im({onRetry:e,error:t}){const{current:n,next:r,debug:o,reason:i}=de(e=>e.settings.database),a=le(),s=function(e,t,n,r){return[e?"Message: "+e:null,"Installed: "+t,"Next: "+n,r.length>0?"Debug: "+r.join("\n"):null].filter(e=>e).join("\n")}(i,n,r,o),l="mailto:john@redirection.me?subject=Redirection%20Database&body="+encodeURIComponent("Redirection: "+window.Redirectioni10n.versions);return(0,Ur.jsxs)("div",{className:"redirection-database_error wpl-error",children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Database problem","redirection")}),(0,Ur.jsx)("p",{children:t}),(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("button",{className:"button button-primary",onClick:e,children:(0,Ot.__)("Try again","redirection")})," ","-"!==n&&(0,Ur.jsx)("button",{className:"button button-secondary",onClick:function(){a(Bh("skip"))},children:(0,Ot.__)("Skip this stage","redirection")})," ","-"!==n&&(0,Ur.jsx)("button",{className:"button button-secondary",onClick:function(){a(Bh("stop"))},children:(0,Ot.__)("Stop upgrade","redirection")})]}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("If you want to {{support}}ask for support{{/support}} please include these details:","redirection"),{support:(0,Ur.jsx)("a",{href:l})})}),(0,Ur.jsx)(yf,{readOnly:!0,value:s,rows:15})]})}function am(e){return"need-update"===e?(0,Ot.__)("Upgrading Redirection","redirection"):(0,Ot.__)("Setting up Redirection","redirection")}function sm(e){return"finish-install"===e||"finish-update"===e}function lm({children:e}){const{status:t,complete:n=0,reason:r,result:i}=de(e=>e.settings.database),a="ok"===i&&!sm(t),s=le();function l(){s(Bh("retry"))}return(0,o.useEffect)(()=>{(function(e,t){return"error"!==t&&("need-install"===e||"need-update"===e)})(t,i)&&setTimeout(()=>{s(Bh())},1e3)},[n]),(0,Ur.jsxs)("div",{className:"redirection-database",children:[(0,Ur.jsx)(rm,{message:(0,Ot.__)("Leaving before the process has completed may cause problems.","redirection"),prevent:"error"!==i&&i!==Le}),(0,Ur.jsx)("h1",{children:am(t)}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Please remain on this page until complete.","redirection")}),(0,Ur.jsxs)("div",{className:"redirection-database_progress",children:[(0,Ur.jsx)("h3",{children:(0,Ot.sprintf)((0,Ot.__)("Progress: %(complete)d%%","redirection"),{complete:n})}),(0,Ur.jsx)(tm,{percent:n,strokeWidth:4,trailWidth:4,strokeLinecap:"square"}),r&&"ok"===i&&(0,Ur.jsx)("p",{children:r}),a&&(0,Ur.jsx)("div",{className:"redirection-database_spinner",children:(0,Ur.jsx)(af,{})}),"error"===i&&(0,Ur.jsx)(im,{error:r,onRetry:l}),i===Le&&(0,Ur.jsx)(om,{error:r,onRetry:l}),sm(t)&&e]})]})}function cm({onCancel:e}){const t=le(),{loadStatus:n}=de(e=>e.settings);return(0,Ur.jsxs)("div",{className:"redirection-database",children:[(0,Ur.jsx)("h1",{children:(0,Ot.__)("Manual Install","redirection")}),(0,Ur.jsxs)("p",{children:[(0,Ot.__)("If your site needs special database permissions, or you would rather do it yourself, you can manually run the following SQL.","redirection")," ",(0,Ot.__)('Click "Finished! 🎉" when finished.',"redirection")]}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)(yf,{readOnly:!0,cols:120,value:Redirectioni10n.database.manual.join(";\n\n")+";",spellCheck:!1})}),n===Le&&(0,Ur.jsxs)("div",{className:"redirection-database_error wpl-error",children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Database problem","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("The Redirection database does not appear to exist. Have you run the above SQL?","redirection")})]}),(0,Ur.jsx)("button",{className:"button button-primary",onClick:function(){t(Uh("database",Redirectioni10n.database.next))},type:"button",children:(0,Ot.__)("Finished! 🎉","redirection")})," ",(0,Ur.jsx)("button",{className:"button button-secondary",onClick:e,type:"button",children:(0,Ot.__)("Go back","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("If you do not complete the manual install you will be returned here.","redirection")})]})}function um({step:e,setStep:t,options:n,setOptions:r}){const{manual:o}=n;return o?(0,Ur.jsx)(cm,{onCancel:function(){t(0),r({manual:!1})}}):(0,Ur.jsx)(lm,{children:(0,Ur.jsx)("div",{className:"wizard-buttons",children:(0,Ur.jsx)("button",{className:"button-primary button",onClick:()=>t(e+1),children:(0,Ot.__)("Continue","redirection")})})})}const dm="wordpress-old-slugs";function pm({setOptions:e,options:t,setStep:n,step:r}){const{importers:o=[dm]}=t,{wpImport:i,otherImporters:a}=de(e=>{const{importers:t}=e.io;return{wpImport:t.find(e=>e.id===dm),otherImporters:t.filter(e=>e.id!==dm)}});function s(t){const n=o.filter(e=>e!==t.target.name);t.target.checked?e({importers:n.concat(t.target.name)}):e({importers:n})}return(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Import Existing Redirects","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Importing existing redirects from WordPress or other plugins is a good way to get started with Redirection. Check each set of redirects you wish to import.","redirection")}),i&&(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:(0,Ot.__)("WordPress automatically creates redirects when you change a post URL. Importing these into Redirection will allow you to manage and monitor them.","redirection")}),(0,Ur.jsx)("ul",{children:(0,Ur.jsx)("li",{children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{type:"checkbox",name:dm,onChange:s,checked:-1!==o.indexOf(dm)})," ",i.name," (",i.total,")"]})})})]}),a.length>0&&(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:(0,Ot.__)("The following plugins have been detected.","redirection")}),(0,Ur.jsx)("ul",{children:a.map(e=>(0,Ur.jsx)("li",{children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{type:"checkbox",name:e.id,onChange:s,checked:-1!==o.indexOf(e.id)})," ",e.name," (",e.total,")"]})},e.id))})]}),(0,Ur.jsxs)("div",{className:"wizard-buttons",children:[(0,Ur.jsx)("button",{className:"button-primary button",onClick:()=>n(r+1),children:(0,Ot.__)("Continue","redirection")})," ",(0,Ur.jsx)("button",{className:"button",onClick:()=>n(r-1),children:(0,Ot.__)("Go back","redirection")})]})]})}const fm=e=>t=>(Ct(jh(e)).then(e=>{t({type:We,total:e.imported})}).catch(e=>{t({type:He,error:e})}),t({type:qe}));function hm({step:e,setStep:t,options:n}){const r=le(),{importingStatus:i}=de(e=>{const{importingStatus:t}=e.io;return{importingStatus:t}});function a(){r(fm(n.importers))}return(0,o.useEffect)(()=>{a()},[]),(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Import Existing Redirects","redirection")}),i===Fe&&(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:(0,Ot.__)("Please wait, importing.","redirection")}),(0,Ur.jsx)("div",{className:"loader-wrapper loader-textarea",children:(0,Ur.jsx)("div",{className:"wpl-placeholder__loading"})})]}),(i===Me||i==Le)&&(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:i===Me?(0,Ot.__)("Import finished.","redirection"):(0,Ot.__)("Importing failed.","redirection")}),(0,Ur.jsxs)("div",{className:"wizard-buttons",children:[i===Le&&(0,Ur.jsx)("button",{className:"button-secondary button",onClick:a,children:(0,Ot.__)("Retry","redirection")}),(0,Ur.jsx)("button",{className:"button-primary button",onClick:()=>t(e+1),children:(0,Ot.__)("Continue","redirection")})]})]})]})}function mm({step:e,setStep:t,options:n,setOptions:r}){const o=le(),{apiTest:i}=de(e=>e.settings);return(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Installation Complete","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Redirection is now installed!","redirection")}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("Please take a moment to consult the {{support}}support site{{/support}} for information about how to use Redirection.","redirection"),{support:(0,Ur.jsx)(zp,{url:"https://redirection.me"})})}),(0,Ur.jsx)("button",{className:"button button-primary",onClick:function(){const{ip:e,log:t,monitor:r}=n.settings;o(Mh({expire_redirect:t?7:-1,expire_404:t?7:-1,ip_logging:e?1:0,rest_api:Yh(i),monitor_types:r?["post","page"]:void 0,monitor_post:r?1:0})),o(qh())},type:"button",children:(0,Ot.__)("Ready to begin! 🎉","redirection")})]})}const gm=function(){const[e,t]=(0,o.useState)(0),[n,r]=(0,o.useState)({settings:{log:!1,ip:!1,monitor:!1},importers:[]}),{result:i,reason:a}=de(e=>{const{database:t}=e.settings,{result:n}=e.settings.database;return{result:n,reason:t.reason}}),s=function(e){return 2===e?pm:4===e?um:3===e?Xh:1===e?Hf:5===e?hm:6===e?mm:Wf}(e);return(0,Ur.jsxs)(Ur.Fragment,{children:[i===Le&&(0,Ur.jsx)(If,{details:Bf(),errors:a,renderDebug:qf,links:Uf(),locale:"redirection",children:(0,Ot.__)("Something went wrong when installing Redirection.","redirection")}),(0,Ur.jsxs)("div",{className:"wizard-wrapper",children:[0!==e&&3!==e&&(0,Ur.jsx)("h1",{children:(0,Ot.__)("Redirection","redirection")}),(0,Ur.jsx)("div",{className:"wizard",children:(0,Ur.jsx)(s,{options:n,step:e,setStep:function(e){5===e&&0===n.importers.length&&e++,t(e)},setOptions:e=>r({...n,...e})})})]}),(0,Ur.jsx)("div",{className:"wizard-support",children:(0,Ur.jsx)(zp,{url:"https://redirection.me/contact/",children:(0,Ot.__)("I need support!","redirection")})})]})};function vm(e){return"finish-install"===e||"finish-update"===e}function xm(){const{current:e,next:t}=window.Redirectioni10n.database;return e===t?(0,Ur.jsx)("p",{children:(0,Ot.__)("A database upgrade is in progress. Please continue to finish.","redirection")}):(0,Ur.jsx)(Ur.Fragment,{children:(0,Ur.jsx)("p",{children:Cf((0,Ot.sprintf)((0,Ot.__)("Redirection stores data in your database and sometimes this needs upgrading. Your database is at version {{strong}}%(current)s{{/strong}} and the latest is {{strong}}%(latest)s{{/strong}}.","redirection"),{current:window.Redirectioni10n.database.current,latest:window.Redirectioni10n.database.next}),{strong:(0,Ur.jsx)("strong",{})})})})}function ym(){const e=le();function t(){e(Uh("database",window.Redirectioni10n.database.next))}return 0===window.Redirectioni10n.database.manual.length?(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:(0,Ot.__)("Your site already has the latest SQL.","redirection")+" "+(0,Ot.__)('Click "Complete Upgrade" when finished.',"redirection")}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("button",{className:"button-primary",onClick:t,children:(0,Ot.__)("Complete Upgrade","redirection")})})]}):(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsxs)("p",{children:[(0,Ot.__)("If your site needs special database permissions, or you would rather do it yourself, you can manually run the following SQL.")," ",(0,Ot.__)('Click "Complete Upgrade" when finished.',"redirection")]}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)(yf,{readOnly:!0,cols:120,value:window.Redirectioni10n.database.manual.join(";\n")+";",spellCheck:!1})}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("button",{className:"button-primary",onClick:t,children:(0,Ot.__)("Complete Upgrade","redirection")})})]})}function bm({onShowUpgrade:e}){return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("p",{children:(0,Ot.__)('Click the "Upgrade Database" button to automatically upgrade the database.',"redirection")}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("input",{className:"button-primary",type:"submit",value:(0,Ot.__)("Upgrade Database","redirection"),onClick:e})})]})}function _m(){const e=le(),{reason:t,status:n,result:r}=de(e=>e.settings.database);return(0,Ur.jsxs)(Ur.Fragment,{children:[r===Le&&(0,Ur.jsx)(If,{details:Bf(),errors:t,renderDebug:qf,links:Uf(),locale:"redirection",children:(0,Ot.__)("Something went wrong when upgrading Redirection.","redirection")}),(0,Ur.jsx)("div",{className:"wizard-wrapper",children:(0,Ur.jsxs)("div",{className:"wizard",children:[(0,Ur.jsx)(lm,{}),vm(n)&&(0,Ur.jsx)("button",{className:"button button-primary",onClick:function(){e(qh())},children:(0,Ot.__)("Finished! 🎉","redirection")})]})})]})}function wm({onShowUpgrade:e}){const[t,n]=(0,o.useState)(!1);function r(e){e.preventDefault(),n(!t)}return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h1",{className:"wp-heading-inline",children:(0,Ot.__)("Upgrade Required","redirection")}),(0,Ur.jsxs)("div",{className:"wpl-error",children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Redirection database needs upgrading","redirection")}),xm(),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("Please make a backup of your Redirection data: {{download}}downloading a backup{{/download}}. If you experience any issues you can import this back into Redirection.","redirection"),{download:(0,Ur.jsx)(zp,{url:Or("all","json")}),import:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/import-export-redirects/"})})}),t?(0,Ur.jsx)(ym,{}):(0,Ur.jsx)(bm,{onShowUpgrade:e})]}),(0,Ur.jsxs)("div",{className:"database-switch",children:[!t&&(0,Ur.jsx)("a",{href:"#",onClick:r,children:(0,Ot.__)("Manual Upgrade","redirection")}),t&&(0,Ur.jsx)("a",{href:"#",onClick:r,children:(0,Ot.__)("Automatic Upgrade","redirection")})]})]})}function jm({showDatabase:e,onShowUpgrade:t}){return e?(0,Ur.jsx)(_m,{}):(0,Ur.jsx)(wm,{onShowUpgrade:t})}const Sm=function(e){const{page:t,setPage:n,children:r,onPageChange:i,defaultPage:a,baseUrl:s,allowedPages:l}=e,c=(0,o.useRef)(void 0),u=(0,o.useCallback)(()=>{const e=Nn(window.Redirectioni10n?.caps?.pages||l);n(e)},[l,n]);return(0,o.useEffect)(()=>(window.addEventListener("popstate",u),()=>{window.removeEventListener("popstate",u)}),[u]),(0,o.useEffect)(()=>{i(),c.current&&c.current!==t&&history.pushState({},"",An({sub:t},{sub:a},s)),c.current=t},[s,a,i,t]),(0,Ur.jsx)(Ur.Fragment,{children:r})},km=function(){return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(Kh,{}),(0,Ur.jsx)("h3",{children:(0,Ot.__)("What do I do next?","redirection")}),(0,Ur.jsxs)("ol",{children:[(0,Ur.jsx)("li",{children:Cf((0,Ot.__)('Take a look at the {{link}}plugin status{{/link}}. It may be able to identify and "magic fix" the problem.',"redirection"),{link:(0,Ur.jsx)("a",{href:"?page=redirection.php&sub=support"})})}),(0,Ur.jsx)("li",{children:Cf((0,Ot.__)("{{link}}Caching software{{/link}}, in particular Cloudflare, can cache the wrong thing. Try clearing all your caches.","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/problems/cloudflare/"})})}),(0,Ur.jsx)("li",{children:Cf((0,Ot.__)("{{link}}Please temporarily disable other plugins!{{/link}} This fixes so many problems.","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/problems/plugins/"})})}),(0,Ur.jsx)("li",{children:Cf((0,Ot.__)("If you are using WordPress 5.2 or newer then look at your {{link}}Site Health{{/link}} and resolve any issues.","redirection"),{link:(0,Ur.jsx)(zp,{url:Uf().siteHealth})})})]})]})},Em=function(e,t,n){return(0,Ur.jsxs)(If,{errors:"",renderDebug:qf,type:"fixed",links:Uf(),details:Bf().concat([e,t?t.componentStack:""]),locale:"redirection",children:[(0,Ur.jsxs)("p",{children:[(0,Ot.__)("Redirection is not working. Try clearing your browser cache and reloading this page.","redirection")," "," ",(0,Ot.__)("If you are using a page caching plugin or service (CloudFlare, OVH, etc) then you can also try clearing that cache.","redirection")]}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("If that doesn't help, open your browser's error console and create a {{link}}new issue{{/link}} with the details.","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://github.com/johngodley/redirection/issues"})})})]})},Cm=()=>[{value:-1,label:(0,Ot.__)("No logs","redirection")},{value:1,label:(0,Ot.__)("A day","redirection")},{value:7,label:(0,Ot.__)("A week","redirection")},{value:30,label:(0,Ot.__)("A month","redirection")},{value:60,label:(0,Ot.__)("Two months","redirection")},{value:0,label:(0,Ot.__)("Forever","redirection")}],Om=function(e){const{settings:t,onChange:n,getLink:r}=e,{expire_redirect:o,expire_404:i,ip_logging:a,log_external:s,track_hits:l,log_header:c,ip_proxy:u,ip_headers:d}=t;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("tr",{className:"redirect-option__row",children:(0,Ur.jsx)("th",{colSpan:2,children:(0,Ur.jsx)("h2",{className:"title",children:(0,Ot.__)("Logs","redirection")})})}),(0,Ur.jsxs)(nh,{title:(0,Ot.__)("Redirect Logs","redirection")+":",url:r("logs"),children:[(0,Ur.jsx)(of,{items:Cm(),name:"expire_redirect",value:parseInt(o,10),onChange:n})," ",(0,Ot.__)("(time to keep logs for)","redirection")]}),(0,Ur.jsxs)(nh,{title:(0,Ot.__)("404 Logs","redirection")+":",url:r("tracking-404-errors"),children:[(0,Ur.jsx)(of,{items:Cm(),name:"expire_404",value:parseInt(i,10),onChange:n})," ",(0,Ot.__)("(time to keep logs for)","redirection")]}),(0,Ur.jsxs)(nh,{title:(0,Ot.__)("IP Logging","redirection")+":",url:r("options","iplogging"),children:[(0,Ur.jsx)(of,{items:[{value:0,label:(0,Ot.__)("No IP logging","redirection")},{value:1,label:(0,Ot.__)("Full IP logging","redirection")},{value:2,label:(0,Ot.__)("Anonymize IP (mask last part)","redirection")}],name:"ip_logging",value:parseInt(a,10),onChange:n})," ",(0,Ot.__)("(IP logging level)","redirection")]}),(0,Ur.jsxs)(nh,{title:(0,Ot.__)("IP Address","redirection")+":",url:r("options","ipaddress"),children:[(0,Ur.jsx)(Hp,{options:[{value:"HTTP_CF_CONNECTING_IP",label:"HTTP_CF_CONNECTING_IP"},{value:"HTTP_CLIENT_IP",label:"HTTP_CLIENT_IP"},{value:"HTTP_X_FORWARDED_FOR",label:"HTTP_X_FORWARDED_FOR"},{value:"HTTP_X_FORWARDED",label:"HTTP_X_FORWARDED"},{value:"HTTP_X_CLUSTER_CLIENT_IP",label:"HTTP_X_CLUSTER_CLIENT_IP"},{value:"HTTP_FORWARDED_FOR",label:"HTTP_FORWARDED_FOR"},{value:"HTTP_FORWARDED",label:"HTTP_FORWARDED"},{value:"HTTP_VIA",label:"HTTP_VIA"}],selected:d,multiple:!0,badges:d.length>0,hideTitle:d.length>0,onChange:e=>n({ip_headers:e}),title:0===d.length?(0,Ot.__)("REMOTE_ADDR","redirection"):""}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("Only set custom IP headers if your server does not use <code>REMOTE_ADDR</code> to store the client IP address.","redirection"),{code:(0,Ur.jsx)("code",{})})}),d.length>0&&(0,Ur.jsx)(Mf,{status:"warning",children:(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("Please ensure you trust the data in these headers. If using a proxy then set its address below.","redirection"),{code:(0,Ur.jsx)("code",{})})})})]}),d.length>0&&(0,Ur.jsxs)(nh,{title:(0,Ot.__)("Proxy Address","redirection")+":",url:r("options","proxy"),children:[(0,Ur.jsx)(yf,{minRows:3,value:u.join("\n"),onChange:e=>n({ip_proxy:e.target.value.split("\n")}),rows:5}),(0,Ur.jsx)("p",{children:(0,Ot.__)("If using a proxy then add any IP addresses here to only trust IP headers from those addresses.","redirection")})]}),(0,Ur.jsxs)(nh,{title:(0,Ot.__)("Logging","redirection")+":",url:r("options","iplogging"),children:[(0,Ur.jsx)("p",{children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{type:"checkbox",disabled:-1===parseInt(o,10),name:"log_external",onChange:n,checked:-1!==parseInt(o,10)&&s})," ",(0,Ot.__)('Log "external" redirects - those not from Redirection. This can increase your log size and contains no user information.',"redirection")]})}),(0,Ur.jsx)("p",{children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{type:"checkbox",name:"track_hits",onChange:n,checked:l})," ",(0,Ot.__)("Track redirect hits and date of last access. Contains no user information.","redirection")]})}),(0,Ur.jsx)("p",{children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{type:"checkbox",name:"log_header",onChange:n,checked:c})," ",(0,Ot.__)("Capture HTTP header information with logs (except cookies). It may include user information, and could increase your log size.","redirection")]})})]}),(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{}),(0,Ur.jsx)("td",{children:Cf((0,Ot.__)("Redirection stores no user identifiable information other than what is configured above. It is your responsibility to ensure your site meets any applicable {{link}}privacy requirements{{/link}}.","redirection"),{link:(0,Ur.jsx)(zp,{url:r("privacy-gdpr")})})})]})]})};function Tm(e,t,n){const r=[];for(const o in e){const i=e[o],a=!!t.find(e=>e===o);i&&r.push((0,Ur.jsx)("p",{children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{type:"checkbox",name:"monitor_type_"+o,onChange:n,checked:a}),(0,Ot.sprintf)((0,Ot.__)("Monitor changes to %(type)s","redirection"),{type:i.toLowerCase()})]})},o))}return r}function Rm(e,t){return 0===parseInt(e,10)&&t.length>0?t.length>0?void 0!==t[0].value.length?t[0].value[0].value:t[0].value:0:e}const Pm=function(e){const{onChange:t,settings:n,groups:r,getLink:o,postTypes:i}=e,{associated_redirect:a,monitor_post:s,monitor_types:l}=n,c=l.length>0;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(nh,{title:(0,Ot.__)("URL Monitor","redirection")+":",url:o("options","monitor"),children:Tm(i,l,function(e){const n=e.target.name.replace("monitor_type_",""),o=l.filter(e=>e!==n);e.target.checked&&o.push(n),t({monitor_types:o,monitor_post:o.length>0?Rm(s,r):0,associated_redirect:o.length>0?a:""})})}),c&&(0,Ur.jsxs)(nh,{title:(0,Ot.__)("URL Monitor Changes","redirection")+":",url:o("options","monitor"),children:[(0,Ur.jsx)(of,{items:r,name:"monitor_post",value:s,onChange:t})," ",(0,Ot.__)("Save changes to this group","redirection"),(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"associated_redirect",onChange:t,placeholder:(0,Ot.__)('For example "/amp"',"redirection"),value:a})," ",(0,Ot.__)("Create associated redirect (added to end of URL)","redirection")]})]})]})},Am=function(e){const{settings:t,onChange:n,getLink:r,groups:o,postTypes:i}=e,{flag_case:a,flag_trailing:s,flag_query:l,auto_target:c,redirect_cache:u,cache_key:d}=t;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("tr",{className:"redirect-option__row",children:(0,Ur.jsx)("th",{colSpan:2,children:(0,Ur.jsx)("h2",{className:"title",children:(0,Ot.__)("URL","redirection")})})}),(0,Ur.jsx)(Pm,{settings:t,onChange:n,groups:o,getLink:r,postTypes:i}),(0,Ur.jsxs)(nh,{title:(0,Ot.__)("Default URL settings","redirection")+":",url:r("options","urlsettings"),children:[(0,Ur.jsx)("p",{children:(0,Ot.__)("Applies to all redirections unless you configure them otherwise.","redirection")}),(0,Ur.jsx)("label",{children:(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("input",{type:"checkbox",name:"flag_case",onChange:n,checked:a}),Cf((0,Ot.__)("Case insensitive matches (i.e. {{code}}/Exciting-Post{{/code}} will match {{code}}/exciting-post{{/code}})","redirection"),{code:(0,Ur.jsx)("code",{})})]})}),(0,Ur.jsx)("label",{children:(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("input",{type:"checkbox",name:"flag_trailing",onChange:n,checked:s}),Cf((0,Ot.__)("Ignore trailing slashes (i.e. {{code}}/exciting-post/{{/code}} will match {{code}}/exciting-post{{/code}})","redirection"),{code:(0,Ur.jsx)("code",{})})]})})]}),(0,Ur.jsxs)(nh,{title:(0,Ot.__)("Default query matching","redirection")+":",url:r("options","querysettings"),children:[(0,Ur.jsx)("p",{children:(0,Ot.__)("Applies to all redirections unless you configure them otherwise.","redirection")}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)(of,{items:[{value:"exact",label:(0,Ot.__)("Exact match in any order","redirection")},{value:"ignore",label:(0,Ot.__)("Ignore all query parameters","redirection")},{value:"pass",label:(0,Ot.__)("Ignore and pass all query parameters","redirection")}],name:"flag_query",value:l,onChange:n})}),(0,Ur.jsxs)("ul",{children:[(0,Ur.jsx)("li",{children:(0,Ot.__)("Exact - matches the query parameters exactly defined in your source, in any order","redirection")}),(0,Ur.jsx)("li",{children:(0,Ot.__)("Ignore - as exact, but ignores any query parameters not in your source","redirection")}),(0,Ur.jsx)("li",{children:(0,Ot.__)("Pass - as ignore, but also copies the query parameters to the target","redirection")})]})]}),(0,Ur.jsxs)(nh,{title:(0,Ot.__)("Auto-generate URL","redirection")+":",url:r("options","autogenerate"),children:[(0,Ur.jsx)("input",{className:"regular-text",type:"text",value:c,name:"auto_target",onChange:n}),(0,Ur.jsx)("br",{}),(0,Ur.jsx)("span",{className:"sub",children:Cf((0,Ot.__)("Used to auto-generate a URL if no URL is given. Use the special tags {{code}}$dec${{/code}} or {{code}}$hex${{/code}} to insert a unique ID instead","redirection"),{code:(0,Ur.jsx)("code",{})})})]}),(0,Ur.jsxs)(nh,{title:(0,Ot.__)("HTTP Cache Header","redirection"),url:r("options","cache"),children:[(0,Ur.jsx)(of,{items:[{value:-1,label:(0,Ot.__)("Never cache","redirection")},{value:1,label:(0,Ot.__)("An hour","redirection")},{value:24,label:(0,Ot.__)("A day","redirection")},{value:168,label:(0,Ot.__)("A week","redirection")},{value:0,label:(0,Ot.__)("Forever","redirection")}],name:"redirect_cache",value:parseInt(u,10),onChange:n})," "," ",(0,Ur.jsx)("span",{className:"sub",children:(0,Ot.__)('How long to cache redirected 301 URLs (via "Expires" HTTP header)',"redirection")})]}),(0,Ur.jsx)(nh,{title:(0,Ot.__)("Redirect Caching","redirection"),url:r("options","cache"),children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{type:"checkbox",name:"cache_key",onChange:n,checked:0!==d&&!1!==d})," ",(0,Ur.jsx)("span",{className:"sub",children:(0,Ot.__)("(beta) Enable caching of redirects via WordPress object cache. Can improve performance. Requires an object cache.","redirection")})]})})]})};function Nm(e,t){return"https://redirection.me/support/"+e+(t?"/#"+t:"")}const Dm=te(function(e){const{groups:t,values:n,saveStatus:r,installed:o,postTypes:i,warning:a}=e.settings;return{groups:t,values:n,saveStatus:r,installed:o,postTypes:i,warning:a}},function(e){return{onSaveSettings:t=>{e(Mh(t))}}})(function(e){const{onSaveSettings:t,installed:n,warning:r,saveStatus:i,values:a,groups:s,postTypes:l}=e,[c,u]=(0,o.useState)(a),{support:d}=c;function p(e){if(e.target){const{target:t}=e,n="checkbox"===t.type?t.checked:t.value;u({...c,[t.name]:n})}else u({...c,...e})}return(0,o.useEffect)(()=>{u(a)},[a]),(0,Ur.jsxs)("form",{onSubmit:function(e){e.preventDefault(),t(c)},children:[(0,Ur.jsxs)(rh,{children:[(0,Ur.jsx)(Om,{settings:c,onChange:p,getLink:Nm}),(0,Ur.jsx)(Am,{settings:c,onChange:p,getLink:Nm,groups:s,postTypes:l}),(0,Ur.jsx)(ih,{settings:c,onChange:p,getLink:Nm,installed:n,warning:r})]}),(0,Ur.jsx)(Tp,{isPrimary:!0,isSubmit:!0,disabled:i===Fe,children:(0,Ot.__)("Update","redirection")})]})});class Im extends a().Component{constructor(e){super(e),this.state={isModal:!1},this.onSubmit=this.handleSubmit.bind(this),this.onClose=this.closeModal.bind(this),this.onDelete=this.handleDelete.bind(this)}handleSubmit(e){this.setState({isModal:!0}),e.preventDefault()}closeModal(){this.setState({isModal:!1})}handleDelete(){this.props.onDelete(),this.closeModal()}showModal(){return(0,Ur.jsx)(Qp,{onClose:this.onClose,children:(0,Ur.jsxs)("div",{style:{padding:"15px 10px 5px 15px"},children:[(0,Ur.jsx)("h1",{children:(0,Ot.__)("Delete the plugin - are you sure?","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Deleting the plugin will remove all your redirections, logs, and settings. Do this if you want to remove the plugin for good, or if you want to reset the plugin.","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Once deleted your redirections will stop working. If they appear to continue working then please clear your browser cache.","redirection")}),(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("button",{className:"button-primary button-delete",onClick:this.onDelete,children:(0,Ot.__)("Yes! Delete the plugin","redirection")})," ",(0,Ur.jsx)("button",{className:"button-secondary",onClick:this.onClose,children:(0,Ot.__)("No! Don't delete the plugin")})]})]})})}render(){return(0,Ur.jsxs)("div",{className:"wrap",children:[(0,Ur.jsxs)("form",{action:"",method:"post",onSubmit:this.onSubmit,children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Delete Redirection","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Selecting this option will delete all redirections, all logs, and any options associated with the Redirection plugin. Make sure this is what you want to do.","redirection")}),(0,Ur.jsx)("input",{className:"button-secondary button-delete",type:"submit",name:"delete",value:(0,Ot.__)("Delete","redirection")})]}),this.state.isModal&&this.showModal()]})}}const Fm=Im;class Lm extends a().Component{componentDidMount(){this.props.onLoadSettings()}render(){const{loadStatus:e,values:t,canDelete:n=!1}=this.props;return e!==Fe&&t?(0,Ur.jsxs)("div",{children:[e===Me&&(0,Ur.jsx)(Dm,{}),(0,Ur.jsx)("hr",{}),n&&(0,Ur.jsx)(Fm,{onDelete:this.props.onDeletePlugin})]}):(0,Ur.jsx)(tf,{})}}const Mm=te(function(e){const{loadStatus:t,values:n,canDelete:r}=e.settings;return{loadStatus:t,values:n,canDelete:r}},function(e){return{onLoadSettings:()=>{e(Lh())},onDeletePlugin:()=>{e(e=>(Ct(Ch()).then(e=>{document.location.href=e.location}).catch(t=>{e({type:Ce,error:t})}),e({type:ke})))}}})(Lm),Um=()=>(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Need help?","redirection")}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("Full documentation for Redirection can be found at {{site}}https://redirection.me{{/site}}. If you have a problem please check the {{faq}}FAQ{{/faq}} first.","redirection"),{site:(0,Ur.jsx)(zp,{url:"https://redirection.me"}),faq:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/faq/"})})}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("strong",{children:Cf((0,Ot.__)("If you want to report a bug please read the {{report}}Reporting Bugs{{/report}} guide.","redirection"),{report:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/reporting-bugs/"})})})}),(0,Ur.jsx)("div",{className:"inline-notice inline-general",children:(0,Ur.jsxs)("p",{className:"github",children:[(0,Ur.jsx)(zp,{url:"https://github.com/johngodley/redirection/issues",children:(0,Ur.jsx)("img",{src:window.Redirectioni10n.pluginBaseUrl+"/images/GitHub-Mark-64px.png",width:"32",height:"32"})}),(0,Ur.jsx)(zp,{url:"https://github.com/johngodley/redirection/issues",children:"https://github.com/johngodley/redirection/"})]})}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Please note that any support is provide on as-time-is-available basis and is not guaranteed. I do not provide paid support.","redirection")}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("If you want to submit information that you don't want in a public repository then send it directly via {{email}}email{{/email}} - include as much information as you can!","redirection"),{email:(0,Ur.jsx)("a",{href:"mailto:john@redirection.me?subject=Redirection%20Issue&body="+encodeURIComponent("Redirection: "+window.Redirectioni10n.versions)})})}),(0,Ur.jsx)("h2",{children:(0,Ot.__)("Need to search and replace?","redirection")}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("The companion plugin <link>Search Regex</link> allows you to search and replace data on your site and is handy if you want to bulk update a lot of URLs in your posts and pages.","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://searchregex.com/"})})})]}),Bm=e=>t=>(Ct(Fh(e)).then(e=>{t({type:kn,http:e})}).catch(e=>{t({type:Sn,error:e})}),t({type:wn})),qm=()=>({type:En});function Wm(e,t){return"http"===e.substr(0,4)?e:st(t||document.location.origin,e)}function Hm(e){return void 0!==e.url_from?e.url_from:e}function zm({status:e,headers:t,statusMessage:n,isFirst:r,isMatch:o}){if(0===e)return n.length>0?n:(0,Ot.__)("An unknown error","redirection");if(e>=500)return(0,Ot.__)("Something is wrong with the server. This is not a problem with Redirection and you will need to resolve the error yourself.","redirection");if(e>=400&&e<500)return Cf((0,Ot.__)("An error page was returned. This is unlikely to be a problem with Redirection. {{support}}What does this mean?{{/support}}.","redirection"),{support:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/problems/redirect-returning-404/"})});if(e>=300&&e<400){if(o)return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ot.__)("Redirected by Redirection.","redirection")," ",(0,Ur.jsxs)("span",{className:"redirection-httpstep__match",children:[(0,Ot.__)("Matches your redirect","redirection")," ",(0,Ur.jsx)("span",{className:"dashicons dashicons-yes"})]})]});const e=t.find(e=>"x-redirect-agent"===e.name||"x-redirect-by"===e.name)||"";return e?"redirection"===e.value.toLowerCase()?(0,Ot.__)("Redirected by Redirection.","redirection"):Cf(/* translators: %1s: who performed the redirect */ /* translators: %1s: who performed the redirect */ (0,Ot.sprintf)((0,Ot.__)("Redirected by %1s. {{support}}What does this mean?{{/support}}.","redirection"),e.value),{support:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/problems/redirected-by-another-agent/"})}):Cf((0,Ot.__)("Redirected by an unknown agent. {{support}}What does this mean?{{/support}}.","redirection"),{support:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/problems/redirected-by-another-agent/"})})}return e>=200&&e<300?(0,Ot.__)("Page was loaded.","redirection"):null}function Gm({step:e,isFirst:t,isLast:n,isMatch:r}){const{request:o,status:i,statusMessage:a,headers:s}=e,l=100*Math.floor(i/100);return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsxs)("div",{className:"redirection-httpstep",children:[(0,Ur.jsx)("div",{className:`redirection-httpstep__status redirection-httpstep__${l>0?l:"500"}`,children:parseInt(i,10)>0?(0,Ur.jsx)(zp,{url:`https://redirect.li/http/status/code/${i}/`,title:a,children:i}):"Fail"}),(0,Ur.jsxs)("div",{className:"redirection-httpstep__details",children:[(0,Ur.jsx)("p",{children:(0,Ur.jsx)("code",{children:o.url})}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)(zm,{status:parseInt(i,10),statusMessage:a,headers:s,isFirst:t,isMatch:r})})]})]}),!n&&(0,Ur.jsx)("div",{children:(0,Ur.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,Ur.jsx)("path",{fillRule:"evenodd",d:"M16.707 10.293a1 1 0 010 1.414l-6 6a1 1 0 01-1.414 0l-6-6a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l4.293-4.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]})}function Vm(e,t,n,r){if(!Array.isArray(e)||!n||!r)return!1;const o=e.find(e=>"x-redirect-agent"===e.name||"x-redirect-by"===e.name),i=e.find(e=>"location"===e.name);return!(!o||!i)&&(void 0===n.url_from?"redirection"===o.value.toLowerCase()&&r===t&&Wm(i.value)===Hm(n):"redirection"===o.value.toLowerCase()&&r===t&&Wm(i.value,n.server)===Hm(n))}const $m=function({desiredTarget:e,desiredCode:t,http:n,url:r}){const{steps:o}=n;return!n||"error"!==n.status&&"fail"!==n.status||0!==o.length?(0,Ur.jsxs)("div",{children:[o.map((n,r)=>(0,Ur.jsx)(Gm,{step:n,isFirst:0===r,isLast:r===o.length-1,isMatch:Vm(n.headers,n.status,e,t)},r)),(0,Ur.jsxs)("p",{children:[e&&t&&(0,Ur.jsxs)(Ur.Fragment,{children:[Cf((0,Ot.__)("If this is not expected then this {{support}}support page{{/support}} may help.","redirection"),{support:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/problems/url-not-redirecting/"})})," "]}),(0,Ot.__)("If your browser is behaving differently then you should clear your browser cache.","redirection")]}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)(zp,{url:`https://redirect.li/http/?url=${encodeURIComponent(r)}`,className:"button",children:(0,Ot.__)("View full redirect.li results.","redirection")})})]}):(0,Ur.jsx)("div",{children:(0,Ot.__)("Unable to check that URL. It may not be valid or accessible.","redirection")})};function Km({error:e}){return(0,Ur.jsxs)("div",{className:"wpl-modal_error",children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Error","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Something went wrong obtaining this information. It may work in the future.","redirection")}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("code",{children:e.message})})]})}function Ym({url:e,desiredCode:t=0,desiredTarget:n=null}){const{status:r,error:o,http:i}=de(e=>e.info),a=Kf()({"redirection-httpcheck":!0,"wpl-modal_loading":r===Fe,"redirection-httpcheck_small":r===Le});return r!==Me||i?(0,Ur.jsxs)("div",{className:a,children:[r===Fe&&(0,Ur.jsx)(af,{}),r===Le&&(0,Ur.jsx)(Km,{error:o}),r===Me&&i&&(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h2",{children:Cf((0,Ot.sprintf)(/* translators: %s: URL being checked */ /* translators: %s: URL being checked */ (0,Ot.__)("Check redirect for: {{code}}%s{{/code}}","redirection"),e),{code:(0,Ur.jsx)("code",{})})}),(0,Ur.jsx)($m,{http:i,url:e,desiredCode:t,desiredTarget:n})]})]}):null}const Xm=function(e){const t=le(),[n,r]=(0,o.useState)(""),{status:i,http:a}=de(e=>e.info),s=!(i===Me&&!a);return(0,o.useEffect)(()=>{t(qm())},[n]),(0,Ur.jsxs)("form",{className:"http-tester",onSubmit:function(e){e.preventDefault(),n.length>0&&t(Bm(n))},children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Redirect Tester","redirection")}),(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("Sometimes your browser can cache a URL, making it hard to know if it's working as expected. Use this service from {{link}}redirect.li{{/link}} to get accurate results.","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirect.li"})})}),(0,Ur.jsxs)("div",{className:"redirection-httptest__input",children:[(0,Ur.jsxs)("span",{children:[(0,Ot.__)("URL","redirection"),":"]}),(0,Ur.jsx)("input",{className:"regular-text",type:"text",value:n,onChange:e=>r(e.target.value),disabled:i===Fe,placeholder:(0,Ot.__)("Enter full URL, including http:// or https://","redirection")}),(0,Ur.jsx)("input",{type:"submit",className:"button-secondary",disabled:i===Fe||0===n.length,value:(0,Ot.__)("Check","redirection")})]}),s&&(0,Ur.jsx)("div",{className:"redirection-httptest",children:(0,Ur.jsx)(Ym,{url:n})})]})},Qm=()=>(0,Ur.jsxs)("form",{action:Redirectioni10n.pluginRoot+"&sub=support",method:"POST",children:[(0,Ur.jsx)("input",{type:"hidden",name:"_wpnonce",value:Ct.nonceMiddleware.nonce}),(0,Ur.jsx)("input",{type:"hidden",name:"action",value:"fixit"}),(0,Ur.jsx)("p",{children:(0,Ot.__)("If the magic button doesn't work then you should read the error and see if you can fix it manually, otherwise follow the 'Need help' section below.","redirection")}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("input",{type:"submit",className:"button-primary",value:(0,Ot.__)("⚡️ Magic fix ⚡️","redirection")})})]}),Jm=e=>{const{item:t}=e;return(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:t.name}),(0,Ur.jsxs)("td",{children:[(0,Ur.jsx)("span",{className:"plugin-status-"+t.status,children:"good"===t.status?(0,Ot.__)("Good","redirection"):(0,Ot.__)("Problem","redirection")})," ",t.message]})]})},Zm=e=>{const{status:t}=e,n=t.filter(e=>"good"!==e.status);return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("table",{className:"plugin-status",children:(0,Ur.jsx)("tbody",{children:t.map((e,t)=>(0,Ur.jsx)(Jm,{item:e},t))})}),n.length>0&&(0,Ur.jsx)(Qm,{})]})};class eg extends a().Component{constructor(e){super(e),this.state={version:e.debug.database.current}}onChange=e=>{this.setState({version:e.target.value})};onSave=e=>{e.preventDefault(),this.props.onSave("database",this.state.version)};render(){const{ip_header:e,database:t}=this.props.debug,{version:n}=this.state;return(0,Ur.jsx)("table",{className:"plugin-status",children:(0,Ur.jsxs)("tbody",{children:[(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:(0,Ot.__)("Database version","redirection")}),(0,Ur.jsxs)("td",{children:[(0,Ur.jsx)(of,{items:[{value:"2.3.1",label:"2.3.1"},{value:"2.3.2",label:"2.3.2"},{value:"2.4",label:"2.4"},{value:"4.0",label:"4.0"},{value:"4.1",label:"4.1"},{value:"4.2",label:"4.2"}],value:n,name:"database_version",onChange:this.onChange})," "," ",n!==t.current&&(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("strong",{children:(0,Ot.__)("Do not change unless advised to do so!","redirection")})," ",(0,Ur.jsx)("button",{className:"button-secondary button",onClick:this.onSave,children:(0,Ot.__)("Save","redirection")})]})]})]}),(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:(0,Ot.__)("IP Headers","redirection")}),(0,Ur.jsx)("td",{children:Object.keys(e).filter(t=>e[t]).map((t,n)=>(0,Ur.jsxs)("code",{children:[t," = ",e[t]?e[t]:"-"," "]},n))})]})]})})}}const tg=te(null,function(e){return{onSave:(t,n)=>{e(Uh(t,n))}}})(eg);class ng extends a().Component{componentDidMount(){this.props.onLoadStatus()}render(){const{status:e=[],debug:t=!1}=this.props;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("WordPress REST API","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Redirection communicates with WordPress through the WordPress REST API. This is a standard part of WordPress, and you will experience problems if you cannot use it.","redirection")}),(0,Ur.jsx)(Kh,{}),(0,Ur.jsx)("h2",{children:(0,Ot.__)("Plugin Status","redirection")}),e.length>0&&(0,Ur.jsx)(Zm,{status:e}),0===e.length&&(0,Ur.jsx)("div",{className:"placeholder-inline",children:(0,Ur.jsx)("div",{className:"wpl-placeholder__loading"})}),(0,Ur.jsx)("h2",{children:(0,Ot.__)("Plugin Debug","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("This information is provided for debugging purposes. Be careful making any changes.","redirection")}),t&&(0,Ur.jsx)(tg,{debug:t}),0===!t&&(0,Ur.jsx)("div",{className:"placeholder-inline",children:(0,Ur.jsx)("div",{className:"wpl-placeholder__loading"})})]})}}const rg=te(function(e){const{debug:t,status:n}=e.settings.pluginStatus;return{debug:t,status:n}},function(e){return{onLoadStatus:()=>{e(e=>(Ct(kh()).then(t=>{e({type:Se,pluginStatus:t})}).catch(t=>{e({type:je,error:t})}),e({type:_e})))}}})(ng),og=()=>(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(rg,{}),(0,Ur.jsx)(Xm,{}),(0,Ur.jsx)(Um,{})]});function ig(e,t){if(!1===e)return!1;const n=function(e){return"http:"!==e.substr(0,5)&&"https:"!==e.substr(0,6)?zf.qg(document.location.protocol+"//"+e):zf.qg(e)}(e);return n.host&&n.host.length>0?t(n):""}function ag(e){return ig(e,e=>e.protocol+"//"+(e.host||"")+(e.pathname||""))}function sg(e){return ig(e,e=>e.protocol+"//"+(e.host||""))}const lg=({domain:e,asDomain:t,onChange:n,onDelete:r,site:i})=>(0,Ur.jsxs)("tr",{className:"redirect-alias__item",children:[(0,Ur.jsx)("td",{children:(0,Ur.jsx)("input",{className:"regular-text",type:"text",name:"domain",value:e,onChange:n})}),(0,Ur.jsx)("td",{className:"redirect-alias__item__asdomain",children:e.length>0&&(0,Ur.jsxs)(o.Fragment,{children:[(0,Ur.jsx)("code",{children:t})," ⇒ ",(0,Ur.jsx)("code",{children:i})]})}),(0,Ur.jsx)("td",{className:"redirect-alias__delete",children:(0,Ur.jsx)("button",{onClick:e=>{e.preventDefault(),r()},children:(0,Ur.jsx)("span",{className:"dashicons dashicons-trash"})})})]}),cg=({aliases:e,siteDomain:t,onChange:n})=>(0,Ur.jsxs)(o.Fragment,{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Site Aliases","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("A site alias is another domain that you want to be redirected to this site. For example, an old domain, or a subdomain. This will redirect all URLs, including WordPress login and admin.","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("You will need to configure your system (DNS and server) to pass requests for these domains to this WordPress install.","redirection")}),(0,Ur.jsxs)("table",{className:"wp-list-table widefat fixed striped items redirect-aliases table-auto",children:[(0,Ur.jsx)("thead",{children:(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:(0,Ot.__)("Aliased Domain","redirection")}),(0,Ur.jsx)("th",{className:"redirect-alias__item__asdomain",children:(0,Ot.__)("Alias","redirection")}),(0,Ur.jsx)("th",{className:"redirect-alias__delete"})]})}),(0,Ur.jsxs)("tbody",{children:[e.map((r,o)=>(0,Ur.jsx)(lg,{domain:r,asDomain:sg(r).replace(/https?:\/\//,""),onChange:t=>((e,t,n,r)=>{const o=t.slice();o[e]=r.target.value,n({aliases:o})})(o,e,n,t),onDelete:()=>((e,t,n)=>{n({aliases:[...t.slice(0,e),...t.slice(e+1)]})})(o,e,n),site:t},o)),0===e.length&&(0,Ur.jsx)("tr",{children:(0,Ur.jsx)("td",{colSpan:"3",children:(0,Ot.__)("No aliases","redirection")})})]})]}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("button",{className:"button-secondary",onClick:t=>((e,t,n)=>{n.preventDefault(),t({aliases:e.concat("").slice(0,20)})})(e,n,t),children:(0,Ot.__)("Add Alias","redirection")})})]});cg.propTypes={aliases:Vf().array.isRequired,siteDomain:Vf().string.isRequired,onChange:Vf().func.isRequired};const ug=cg,dg=({relocate:e,siteDomain:t,onChange:n})=>{const r=((e,t)=>{if(t){const n=ag(t);if(n.length>0)return(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("code",{children:e})," ⇒ ",(0,Ur.jsx)("code",{children:n})]})}return null})(t,e);return(0,Ur.jsxs)(o.Fragment,{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Relocate Site","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Want to redirect the entire site? Enter a domain to redirect everything, except WordPress login and admin. Enabling this option will disable any site aliases or canonical settings.","redirection")}),(0,Ur.jsxs)("p",{children:[(0,Ur.jsxs)("strong",{children:[(0,Ot.__)("Relocate to domain","redirection"),":"]})," ",(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"relocate",value:e||"",onChange:e=>n({relocate:e.target.value})})]}),r]})};dg.propTypes={relocate:Vf().string.isRequired,siteDomain:Vf().string.isRequired,onChange:Vf().func.isRequired};const pg=dg,fg=e=>[{label:Cf((0,Ot.sprintf)((0,Ot.__)("Don't set a preferred domain - {{code}}%(site)s{{/code}}","redirection"),{site:e}),{code:(0,Ur.jsx)("code",{})}),value:""},{label:Cf((0,Ot.sprintf)((0,Ot.__)("Remove www from domain - {{code}}%(siteWWW)s{{/code}} ⇒ {{code}}%(site)s{{/code}}","redirection"),{site:e.replace("www.",""),siteWWW:e.replace("www.","").replace("://","://www.")}),{code:(0,Ur.jsx)("code",{})}),value:"nowww"},{label:Cf((0,Ot.sprintf)((0,Ot.__)("Add www to domain - {{code}}%(site)s{{/code}} ⇒ {{code}}%(siteWWW)s{{/code}}","redirection"),{site:e.replace("www.",""),siteWWW:e.replace("www.","").replace("://","://www.")}),{code:(0,Ur.jsx)("code",{})}),value:"www"}];function hg(e,t,n){return e=e.replace(/https?:\/\//,""),"www"===n?e="www."+e.replace("www.",""):"nowww"===n&&(e=e.replace("www.","")),(t?"https://":"http://")+e}const mg=function({https:e,preferredDomain:t,siteDomain:n,onChange:r}){const o=function(e,t,n){return!(!t||-1!=e.indexOf("https:"))||"www"===n&&-1==e.indexOf("www.")||"nowww"===n&&-1!==e.indexOf("www.")}(n,e,t),i=e=>{r({[e.target.name]:e.target.value})};return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Canonical Settings","redirection")}),(0,Ur.jsx)("p",{children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{type:"checkbox",name:"https",onChange:e=>{r({[e.target.name]:e.target.checked})},checked:e})," ",Cf((0,Ot.sprintf)((0,Ot.__)("Force a redirect from HTTP to HTTPS - {{code}}%(site)s{{/code}} ⇒ {{code}}%(siteHTTPS)s{{/code}}","redirection"),{site:n.replace("https","http"),siteHTTPS:n.replace("http:","https:")}),{code:(0,Ur.jsx)("code",{})})]})}),e&&(0,Ur.jsx)("div",{className:"inline-notice inline-warning",children:(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("{{strong}}Warning{{/strong}}: ensure your HTTPS is working before forcing a redirect.","redirection"),{strong:(0,Ur.jsx)("strong",{})})})}),(0,Ur.jsxs)("p",{children:[(0,Ot.__)("Preferred domain","redirection"),":"]}),fg(n).map(e=>(0,Ur.jsx)("p",{children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{type:"radio",name:"preferred_domain",value:e.value,onChange:i,checked:e.value===t})," ",e.label]})},e.value)),o&&(0,Ur.jsx)("div",{className:"inline-notice inline-error",children:(0,Ur.jsx)("p",{children:Cf((0,Ot.sprintf)((0,Ot.__)("You should update your site URL to match your canonical settings: {{code}}%(current)s{{/code}} ⇒ {{code}}%(site)s{{/code}}","redirection"),{current:n,site:hg(n,e,t)}),{code:(0,Ur.jsx)("code",{})})})})]})},gg=({headerValue:e,onChange:t})=>(0,Ur.jsxs)("label",{children:[(0,Ot.__)("Value","redirection"),": ",(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"headerValue",value:e,onChange:e=>t({[e.target.name]:e.target.value})})]}),vg=({headerValue:e,options:t,onChange:n})=>(0,Ur.jsx)(of,{items:t,name:"headerValue",value:e,onChange:e=>n({[e.target.name]:e.target.value})}),xg=e=>"<"+e+">",yg=(e,t)=>-1!==e.indexOf(xg(t));function bg(e,t){return"uri"===t?e.replace(/[^A-Za-z0-9-._~:/?#\[\]@!$&'()*+,;=]/g,""):"integer"===t?parseInt(e,10):e}const _g=({headerValue:e,headerSettings:t,options:n,onChange:r})=>{const{choices:o,replace:i,replaceType:a}=n,s=t.selected?t.selected:e,l=t.replaceValue?t.replaceValue:"";return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(of,{items:o,name:"headerValue",value:s,onChange:e=>{r({headerValue:e.target.value,headerSettings:{selected:e.target.value,replaceValue:""}})}}),yg(s,i)&&(0,Ur.jsxs)("label",{children:[xg(i).replace(/</g,"").replace(/>/g,""),(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"replaceValue",value:l,onChange:e=>{r({headerValue:s.replace(xg(i),e.target.value),headerSettings:{selected:s,replaceValue:bg(e.target.value,a)}})}})]})]})},wg=({headerValue:e,options:t,onChange:n})=>{const{choices:r,implode:o,wildCard:i}=t,a=e.split(o);return(0,Ur.jsx)(Hp,{options:i?r.concat([{value:i,label:(0,Ot.__)("All","redirection")}]):r,selected:a,onChange:(e,t)=>{n(t===i?{headerValue:1===a.length&&a[0]===i?"":i}:{headerValue:e.filter(e=>e!==i).filter(e=>e).join(o)})},title:(0,Ot.__)("Values","redirection"),hideTitle:!0,multiple:!0,badges:!0})},jg=e=>e.map(e=>({label:e,value:e})),Sg={"X-UA-Compatible":{component:vg,info:"https://frankcode.net/2013/10/17/a-guide-to-ie-compatibility-view-and-x-ua-compatible/",default:"Chrome=1",options:jg(["IE=EmulateIE7","IE=edge","Chrome=1"])},"X-Frame-Options":{component:_g,info:"",default:"deny",options:{choices:jg(["deny","sameorigin","allow-from <URI>"]),replace:"URI",replaceType:"uri"}},"Strict-Transport-Security":{component:_g,default:"max-age=<expire-time>",info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security",options:{choices:jg(["max-age=<expire-time>","max-age=<expire-time>; includeSubDomains","max-age=<expire-time>; preload","max-age=<expire-time>; includeSubDomains; preload"]),replace:"expire-time",replaceType:"integer"}},"X-XSS-Protection":{component:_g,default:"1; mode=block",info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection",options:{choices:jg(["0","1","1; mode=block","1; report=<URI>"]),replace:"URI",replaceType:"uri"}},"X-Content-Type-Options":{component:vg,default:"nosniff",info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options",options:jg(["nosniff"])},"Feature-Policy":{component:gg,info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy"},"Clear-Site-Data":{component:wg,info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data",default:"cache",options:{choices:jg(["cache","cookies","storage","executionContexts"]),implode:",",wildCard:"*"}},"Referrer-Policy":{component:vg,default:"no-referrer-when-downgrade",info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy",options:jg(["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"])},"Content-Security-Policy-Report-Only":{component:gg,info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only"},Custom:{component:({headerValue:e,headerName:t,onChange:n})=>(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"headerName",value:t,onChange:e=>n({[e.target.name]:e.target.value})}),"Value: ",(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"headerValue",value:e,onChange:e=>n({[e.target.name]:e.target.value})})]})},"Access-Control-Allow-Methods":{component:wg,info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods",default:"GET",options:{choices:jg(["GET","POST","PUT","HEAD","DELETE","OPTIONS"]),implode:",",wildCard:"*"}},"Access-Control-Allow-Credentials":{component:vg,default:"true",info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials",options:jg(["true"])},"Access-Control-Allow-Origin":{component:_g,default:"<origin>",info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin",options:{choices:jg(["<origin>","*"]),replace:"origin",replaceType:"uri"}},"X-Robots-Tag":{component:wg,default:"noindex",info:"https://developers.google.com/search/reference/robots_meta_tag#xrobotstag",options:{choices:jg(["noindex","nofollow","none","noarchive","nosnippet","notranslate","noimageindex"]),implode:",",wildCard:"all"}},"Access-Control-Allow-Headers":{component:gg,info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers"},"Access-Control-Max-Age":{component:gg,info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age"},"Access-Control-Expose-Headers":{component:gg,info:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers"}},kg=e=>Sg[e]&&Sg[e].options?Sg[e].options:null,Eg=e=>Sg[e]&&Sg[e].default?Sg[e].default:"",Cg=({header:e,onChange:t,onDelete:n})=>{const{location:r,headerName:o,headerValue:i,headerSettings:a,type:s}=e,l=n=>{t({...e,...n})},c=t=>{const{name:n,value:r}=t.target;let i=o;"type"===n&&"Custom"===r?i="":"type"===n&&(i=r),l({headerValue:"type"===n?Eg(r):e.headerValue,headerSettings:"type"===n?kg(i):e.headerSettings,headerName:i,[n]:r})},u=((e,t,n,r,o)=>{const i=Sg[a=e]?Sg[a].component:gg;var a;return(0,Ur.jsx)(i,{headerName:t,headerValue:""===n?Eg(e):n,headerSettings:r,options:kg(e),onChange:o})})(s,o,i,a,l),d=Sg[p=o]&&Sg[p].info?Sg[p].info:null;var p;return(0,Ur.jsxs)("tr",{className:"redirect-headers__item",children:[(0,Ur.jsx)("td",{className:"redirect-headers__type",children:(0,Ur.jsx)(of,{items:[{label:(0,Ot.__)("Site","redirection"),value:"site"},{label:(0,Ot.__)("Redirect","redirection"),value:"redirect"}],name:"location",value:r,onChange:c})}),(0,Ur.jsxs)("td",{className:"redirect-headers__name",children:[(0,Ur.jsxs)("div",{className:"redirect-headers__name__content",children:[(0,Ur.jsx)(of,{items:[{label:(0,Ot.__)("General","redirection"),value:jg(["X-UA-Compatible","X-Robots-Tag"])},{label:"CORS",value:jg(["Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Max-Age","Access-Control-Allow-Credentials","Access-Control-Allow-Origin","Access-Control-Expose-Headers"])},{label:"Security",value:jg(["X-Frame-Options","X-XSS-Protection","X-Content-Type-Options","Strict-Transport-Security","Feature-Policy","Clear-Site-Data","Referrer-Policy","Content-Security-Policy","Content-Security-Policy-Report-Only","P3P"])},{label:(0,Ot.__)("Custom Header","redirection"),value:"Custom"}],name:"type",value:s,onChange:c}),u]}),d&&(0,Ur.jsx)(zp,{url:d,children:(0,Ur.jsx)("span",{className:"dashicons dashicons-editor-help"})})]}),(0,Ur.jsx)("td",{className:"redirect-headers__delete",children:(0,Ur.jsx)("button",{onClick:e=>{e.preventDefault(),n()},children:(0,Ur.jsx)("span",{className:"dashicons dashicons-trash"})})})]})},Og=(e="X-Robots-Tag",t="nofollow",n={})=>({location:"site",type:e,headerName:e,headerValue:t,headerSettings:n}),Tg=({headers:e,onChange:t})=>{const[n,r]=(0,o.useState)("header"),i=[{label:(0,Ot.__)("Add Header","redirection"),value:"header"},{label:(0,Ot.__)("Add Security Presets","redirection"),value:"security"},{label:(0,Ot.__)("Add CORS Presets","redirection"),value:"cors"}],a=i.find(e=>e.value===n);return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("HTTP Headers","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Site headers are added across your site, including redirects. Redirect headers are only added to redirects.","redirection")}),(0,Ur.jsxs)("table",{className:"wp-list-table widefat fixed striped items redirect-headers table-auto",children:[(0,Ur.jsx)("thead",{children:(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:(0,Ot.__)("Location","redirection")}),(0,Ur.jsx)("th",{children:(0,Ot.__)("Header","redirection")}),(0,Ur.jsx)("th",{})]})}),(0,Ur.jsxs)("tbody",{children:[e.map((n,r)=>(0,Ur.jsx)(Cg,{header:n,onChange:n=>((e,t,n,r)=>{const o=n.slice();o[e]=t,r({headers:o})})(r,n,e,t),onDelete:()=>((e,t,n)=>{n({headers:[...t.slice(0,e),...t.slice(e+1)]})})(r,e,t)},r)),0===e.length&&(0,Ur.jsx)("tr",{children:(0,Ur.jsx)("td",{colSpan:"3",children:(0,Ot.__)("No headers","redirection")})})]})]}),(0,Ur.jsx)(Rp,{options:i,selected:n,title:a?a.label:i[0].label,onSelect:n=>{r(n),((e,t,n)=>{"header"===e?n({headers:t.concat([Og()])}):"security"===e?n({headers:t.concat([Og("X-Frame-Options","deny"),Og("X-XSS-Protection","1; mode=block"),Og("X-Content-Type-Options","nosniff"),Og("Content-Security-Policy","default-src 'none'; script-src 'self'; connect-src 'self'; img-src 'self'; style-src 'self';base-uri 'self';form-action 'self'"),"https"===document.location.protocol?Og("Strict-Transport-Security","max-age: 31536000; includeSubDomains"):null,Og("Referrer-Policy","no-referrer-when-downgrade")].filter(e=>e))}):"cors"===e&&n({headers:t.concat([Og("Access-Control-Allow-Origin","*"),Og("Access-Control-Allow-Credentials","true"),Og("Access-Control-Allow-Methods","POST,GET,OPTIONS"),Og("Access-Control-Allow-Headers","origin"),Og("Referrer-Policy","no-referrer-when-downgrade"),Og("P3P",'CP="CAO PSA OUR"')])})})(n,e,t)}}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Note that some HTTP headers are set by your server and cannot be changed.","redirection")})]})};Tg.propTypes={headers:Vf().array.isRequired,onChange:Vf().func.isRequired};const Rg=Tg,Pg=function({link:e,onChange:t,onDelete:n}){return(0,Ur.jsxs)("tr",{className:"redirect-alias__item",children:[(0,Ur.jsx)("td",{children:(0,Ur.jsx)("input",{className:"regular-text",type:"text",name:"link",value:e,onChange:t})}),(0,Ur.jsx)("td",{className:"redirect-alias__delete",children:(0,Ur.jsx)("button",{onClick:e=>{e.preventDefault(),n()},children:(0,Ur.jsx)("span",{className:"dashicons dashicons-trash"})})})]})},Ag=function(e){const{permalinks:t,onChange:n}=e;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Permalink Migration","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Enter old permalinks structures to automatically migrate them to your current one.","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Note: this is in beta and will only migrate posts. Certain permalinks will not work. If yours does not work then you will need to wait until it is out of beta.","redirection")}),(0,Ur.jsxs)("table",{className:"wp-list-table widefat fixed striped items redirect-aliases table-auto",children:[(0,Ur.jsx)("thead",{children:(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:(0,Ot.__)("Permalinks","redirection")}),(0,Ur.jsx)("th",{className:"redirect-alias__delete"})]})}),(0,Ur.jsxs)("tbody",{children:[t.map((e,r)=>(0,Ur.jsx)(Pg,{link:e,onChange:e=>((e,t,n,r)=>{const o=t.slice();o[e]=r.target.value,n({permalinks:o})})(r,t,n,e),onDelete:()=>((e,t,n)=>{n({permalinks:[...t.slice(0,e),...t.slice(e+1)]})})(r,t,n)},r)),0===t.length&&(0,Ur.jsx)("tr",{children:(0,Ur.jsx)("td",{colSpan:2,children:(0,Ot.__)("No migrated permalinks","redirection")})})]})]}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("button",{className:"button-secondary",onClick:e=>((e,t,n)=>{n.preventDefault(),t({permalinks:e.concat("").slice(0,10)})})(t,n,e),children:(0,Ot.__)("Add Permalink","redirection")})})]})};class Ng extends a().Component{constructor(e){super(e),e.onLoadSettings();const{headers:t=[],relocate:n="",preferred_domain:r="",https:o=!1,aliases:i=[],permalinks:a=[]}=e.values?e.values:{};this.state={https:o,preferred_domain:r,headers:t,relocate:n,aliases:i,permalinks:a}}onSubmit=e=>{const{https:t,headers:n,preferred_domain:r,aliases:o,relocate:i,permalinks:a}=this.state;e.preventDefault(),this.props.onSaveSettings({https:t,headers:n,preferred_domain:r,aliases:o.filter(e=>e).map(sg),relocate:ag(i),permalinks:a})};onChange=e=>{this.setState({...this.state,...e})};render(){const{loadStatus:e,values:t,saveStatus:n,siteDomain:r}=this.props,{headers:o,relocate:i,aliases:a,https:s,preferred_domain:l,permalinks:c}=this.state;return e!==Fe&&t?(0,Ur.jsxs)("form",{onSubmit:this.onSubmit,children:[(0,Ur.jsx)("div",{className:"inline-notice inline-warning",children:(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("Options on this page can cause problems if used incorrectly. You can {{link}}temporarily disable them{{/link}} to make changes.","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/disable-redirection/"})})})}),(0,Ur.jsx)(pg,{relocate:i,siteDomain:r,onChange:this.onChange}),0===i.length&&(0,Ur.jsx)(ug,{aliases:a,siteDomain:r,onChange:this.onChange}),0===i.length&&(0,Ur.jsx)(mg,{https:s,siteDomain:r,preferredDomain:l,onChange:this.onChange}),0===i.length&&(0,Ur.jsx)(Ag,{permalinks:c,onChange:this.onChange}),(0,Ur.jsx)(Rg,{headers:o,onChange:this.onChange}),(0,Ur.jsx)("input",{className:"button-primary",type:"submit",name:"update",value:(0,Ot.__)("Update","redirection"),disabled:n===Fe})]}):(0,Ur.jsx)(tf,{})}}const Dg=te(function(e){const{loadStatus:t,saveStatus:n,values:r}=e.settings;return{loadStatus:t,saveStatus:n,values:r,siteDomain:sg(Redirectioni10n.pluginRoot)}},function(e){return{onLoadSettings:()=>{e(Lh())},onSaveSettings:t=>{e(Mh(t))}}})(Ng),Ig=e=>{const{name:t,title:n,table:r,primary:o,onSetOrderBy:i}=e,{direction:a,orderby:s}=r,l=Kf()({"manage-column":!0,sortable:!0,asc:s===t&&"asc"===a,desc:s===t&&"desc"===a||s!==t,"column-primary":o,["column-"+t]:!0});return(0,Ur.jsx)("th",{scope:"col",className:l,onClick:e=>{e.preventDefault(),i(t,s===t&&"desc"===a?"asc":"desc")},children:(0,Ur.jsxs)("a",{href:"#",children:[(0,Ur.jsx)("span",{children:n}),(0,Ur.jsx)("span",{className:"sorting-indicator"})]})})},Fg=e=>{const{name:t,title:n,primary:r}=e,o=Kf()({"manage-column":!0,"column-primary":r,["column-"+t]:!0});return(0,Ur.jsx)("th",{scope:"col",className:o,children:(0,Ur.jsx)("span",{children:n})})},Lg=e=>{const{onSelect:t,disabled:n,selected:r}=e;return(0,Ur.jsxs)("td",{className:"manage-column column-cb check-column-red",children:[(0,Ur.jsx)("label",{className:"screen-reader-text",children:(0,Ot.__)("Select All","redirection")}),(0,Ur.jsx)("input",{type:"checkbox",disabled:n,checked:r,onChange:e=>t(e.target.checked)})]})},Mg=e=>{const{disabled:t,onSelect:n,onSetOrderBy:r,headers:o,table:i,hasBulk:a,allSelected:s,isSaving:l}=e;return(0,Ur.jsxs)("tr",{children:[a&&(0,Ur.jsx)(Lg,{onSelect:n,disabled:t||l,selected:s}),o.map(e=>{const{primary:t=!1,sortable:n=!0}=e;return n?(0,Ur.jsx)(Ig,{table:i,name:e.name,title:e.title,onSetOrderBy:r,primary:t},e.name):(0,Ur.jsx)(Fg,{name:e.name,title:e.title,primary:t},e.name)})]})},Ug=e=>{const{columns:t}=e;return(0,Ur.jsxs)("tr",{className:"is-placeholder",children:[t.map((e,t)=>(0,Ur.jsx)("td",{children:(0,Ur.jsx)("div",{className:"wpl-placeholder__loading"})},t)),(0,Ur.jsx)("td",{children:(0,Ur.jsx)("div",{className:"wpl-placeholder__loading"})})]})},Bg=e=>{const{headers:t,rows:n}=e;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(Ug,{columns:t}),n.slice(0,-1).map((e,n)=>(0,Ur.jsx)(Ug,{columns:t},n))]})},qg=e=>{const{headers:t}=e;return(0,Ur.jsx)("tr",{children:(0,Ur.jsx)("td",{colSpan:t.length+1,children:(0,Ot.__)("Nothing to display.","redirection")})})},Wg=e=>{const{headers:t}=e;return(0,Ur.jsx)("tr",{children:(0,Ur.jsx)("td",{colSpan:t.length+1,children:(0,Ur.jsx)("p",{children:(0,Ot.__)("Sorry, something went wrong loading the data - please try again","redirection")})})})};function Hg(e,t,n){return{isLoading:e===Fe,isSelected:-1!==n.selected.indexOf(t.id),table:n}}function zg(e){const{isSaving:t,disabled:n,id:r,onSelect:o,selected:i}=e;return(0,Ur.jsx)("th",{scope:"row",className:"check-column",children:t?(0,Ur.jsx)(af,{size:"small"}):(0,Ur.jsx)("input",{type:"checkbox",name:"item[]",value:r,disabled:n,checked:-1!==i.indexOf(`${r}`)||-1!==i.indexOf(r),onChange:e=>o([e.target.value])})})}function Gg(e){const{row:t,rowData:n,displaySelected:r,getRow:i,getRowActions:a,primary:s,total:l}=e,[c,u]=(0,o.useState)(!1),d={...n,rowMode:c,setRowMode:u},p=i(t,d),f=a(t,d);return Array.isArray(p)?p.filter(e=>-1!==r.indexOf(e.name)||!0===e.alwaysDisplay).map(e=>(0,Ur.jsxs)("td",{className:`column-${e.name}`,children:[e.content,e.name===(s?s.name:p[0].name)&&f]},e.name)):(0,Ur.jsx)("td",{colSpan:l,children:p})}const Vg=function(e){const{rows:t,headers:n,status:r,table:o,getRow:i,getRowActions:a,onSelect:s,saving:l}=e,{selected:c,displaySelected:u}=o,d=n.find(e=>e.primary);return r===Fe&&0===t.length?(0,Ur.jsx)(Bg,{headers:n,rows:t}):r===Me&&0===t.length?(0,Ur.jsx)(qg,{headers:n}):r===Le?(0,Ur.jsx)(Wg,{headers:n}):t.map(e=>(0,Ur.jsxs)("tr",{className:Kf()({disabled:r===Fe||"STATUS_SAVING"===r,saving:-1!==l.indexOf(e.id)||-1!==l.indexOf(-1)}),children:[!!s&&(0,Ur.jsx)(zg,{id:e.id,onSelect:s,disabled:r===Fe,selected:c,isSaving:-1!==l.indexOf(e.id)||-1!==l.indexOf(-1)}),(0,Ur.jsx)(Gg,{row:e,rowData:Hg(r,e,o),displaySelected:u,getRow:i,getRowActions:a,primary:d,total:n.length})]},e.id))},$g=e=>{const{headers:t,getRow:n,getRowActions:r,rows:o,table:i,status:a,saving:s,onSelect:l,onSetOrderBy:c}=e,u=(0,Ur.jsx)(Mg,{table:i,disabled:a!==Me||0===o.length,headers:t,onSetOrderBy:c,onSelect:l,hasBulk:!!l,allSelected:i.selected.length===o.length&&0!==o.length,isSaving:s.length>0}),d=Kf()("wp-list-table","widefat","fixed","striped","items",{["redirect-log__display__"+i.displayType]:!0,["redirect-log__group__"+i.groupBy]:i.groupBy});return(0,Ur.jsxs)("table",{className:d,children:[(0,Ur.jsx)("thead",{children:u}),(0,Ur.jsx)("tbody",{children:(0,Ur.jsx)(Vg,{rows:o,table:i,headers:t,status:a,getRow:n,getRowActions:r,onSelect:l,saving:s})}),(0,Ur.jsx)("tfoot",{children:u})]})},Kg=e=>{const{enabled:t=!0,children:n}=e;return t?(0,Ur.jsx)("div",{className:"table-buttons",children:n}):null},Yg=({settings:e},t)=>void 0===t?e.values:void 0!==e.values[t]?e.values[t]:null,Xg=e=>({flag_regex:Yg(e,"flag_regex"),flag_case:Yg(e,"flag_case"),flag_trailing:Yg(e,"flag_trailing"),flag_query:Yg(e,"flag_query")}),Qg={saving:Ze,saved:et,failed:tt,order:"date",store:"log"},Jg={saving:Ye,saved:Xe,failed:Qe,order:"date",store:"log"},Zg=e=>(t,n)=>It(yh,t,Jg,e,n().log),ev=(e,t=!1)=>({type:Je,items:e,isEverything:t}),tv=function(e){const{title:t,button:n,className:r,disabled:o,onClick:i}=e;return o?(0,Ur.jsx)("span",{className:"tablenav-pages-navspan button disabled","aria-hidden":"true",children:n}):(0,Ur.jsxs)("a",{className:r+" button",href:"#",onClick:function(e){e.preventDefault(),i()},children:[(0,Ur.jsx)("span",{className:"screen-reader-text",children:t}),(0,Ur.jsx)("span",{"aria-hidden":"true",children:n})]})},nv=function(e){const{page:t,total:n,perPage:r,onChangePage:i}=e,[a,s]=(0,o.useState)(t+1),l=function(e,t){return Math.ceil(e/t)}(n,r),c=n<=r;return(0,o.useEffect)(()=>{s(t+1)},[t]),c?null:(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(tv,{title:(0,Ot.__)("First page","redirection"),button:"«",className:"first-page",disabled:t<=0,onClick:()=>i(0)}),(0,Ur.jsx)(tv,{title:(0,Ot.__)("Prev page","redirection"),button:"‹",className:"prev-page",disabled:t<=0,onClick:()=>i(t-1)}),(0,Ur.jsxs)("span",{className:"paging-input",children:[(0,Ur.jsx)("label",{htmlFor:"current-page-selector",className:"screen-reader-text",children:(0,Ot.__)("Current Page","redirection")}),(0,Ur.jsx)("input",{className:"current-page",type:"number",min:"1",max:l,name:"paged",value:a,size:2,"aria-describedby":"table-paging",onBlur:()=>i(Math.min(l-1,Math.max(0,a-1))),onChange:e=>s(e.target.value)}),(0,Ur.jsx)("span",{className:"tablenav-paging-text",children:(0,Ot.sprintf)((0,Ot.__)("of %s","redirection"),new Intl.NumberFormat(window.Redirectioni10n.locale).format(l))})]}),(0,Ur.jsx)(tv,{title:(0,Ot.__)("Next page","redirection"),button:"›",className:"next-page",disabled:t>=l-1,onClick:()=>i(t+1)}),(0,Ur.jsx)(tv,{title:(0,Ot.__)("Last page","redirection"),button:"»",className:"last-page",disabled:t>=l-1,onClick:()=>i(l-1)})]})},rv=function(e){const{total:t,perPage:n,page:r,onChangePage:o,disabled:i,selected:a,onSelectAll:s,isEverything:l}=e,c=Kf()({"tablenav-pages":!0});return(0,Ur.jsxs)("div",{className:c,children:[(0,Ur.jsxs)("span",{className:Kf()("displaying-num",l?"displaying-num-all":null),children:[0===a&&(0,Ot.sprintf)((0,Ot._n)("%s item","%s items",t,"redirection"),new Intl.NumberFormat(window.Redirectioni10n.locale).format(t)),a>0&&!l&&Cf((0,Ot.sprintf)((0,Ot.__)("%1d of %1d selected. {{all}}Select All.{{/all}}"),a,t),{all:(0,Ur.jsx)("a",{href:"#",onClick:function(e){e.preventDefault(),s(!0)}})}),l&&Cf((0,Ot.sprintf)((0,Ot.__)("%1d of %1d selected. {{all}}Clear All.{{/all}}"),a,t),{all:(0,Ur.jsx)("a",{href:"#",onClick:function(e){e.preventDefault(),s(!1)}})})]}),(0,Ur.jsx)("span",{className:"pagination-links",children:(0,Ur.jsx)(nv,{onChangePage:o,total:t,perPage:n,page:r,disabled:i},r)})]})},ov=function(e){const{total:t,table:n,children:r=null,onChangePage:o,disabled:i,className:a,onSelectAll:s}=e;return(0,Ur.jsxs)("div",{className:Kf()("tablenav",a),children:[(0,Ur.jsx)("div",{className:"redirect-table__actions",children:r}),t>0&&(0,Ur.jsx)(rv,{perPage:n.per_page,page:n.page,total:t,onChangePage:o,onSelectAll:s,disabled:i,selected:n.selectAll?t:n.selected.length,isEverything:n.selectAll})]})},iv=({children:e})=>(0,Ur.jsx)("div",{className:"alignleft actions",children:e});class av extends a().Component{constructor(e){super(e),this.state={selected:e.selected}}onChange=e=>{this.setState({selected:e.target.value})};onSubmit=()=>{this.props.onGroup(this.state.selected)};render(){const{options:e,isEnabled:t}=this.props;return(0,Ur.jsxs)("div",{className:"alignleft actions",children:[(0,Ur.jsx)(of,{items:e,value:this.state.selected,name:"filter",onChange:this.onChange,disabled:!t}),(0,Ur.jsx)("button",{className:"button",onClick:this.onSubmit,disabled:!t,children:(0,Ot.__)("Apply","redirection")})]})}}const sv=av;function lv(e,t){return e.options.find(e=>e.value===t)}function cv(e,t){const n=[];return Object.keys(e).forEach(r=>{const o=t.find(e=>e.value===r);o&&o.options.find(t=>t.value===e[r])&&n.push(e[r])}),n}const uv=function(e){const{table:t,disabled:n,groupOptions:r,filterOptions:o,onGroup:i,onFilter:a}=e;return(0,Ur.jsxs)(Ur.Fragment,{children:[r.length>0&&(0,Ur.jsx)(sv,{selected:t.groupBy?t.groupBy:"",options:r,isEnabled:!n,onGroup:i},t.groupBy),o.length>0&&(0,Ur.jsx)(iv,{children:(0,Ur.jsx)(Hp,{options:o,selected:cv(t.filterBy,o),onChange:function(e){const t={};for(let n=0;n<e.length;n++){const r=o.find(t=>lv(t,e[n]));r&&(t[r.value]=e[n])}a(t)},title:(0,Ot.__)("Filters","redirection"),isEnabled:!n,multiple:!0,badges:!0})})]})},dv=function(e){const{bulk:t,disabled:n,onBulk:r}=e,[i,a]=(0,o.useState)(-1);return(0,Ur.jsxs)("div",{className:"alignleft actions bulkactions",children:[(0,Ur.jsxs)("select",{name:"action",value:i,disabled:n,onChange:e=>a(e.target.value),children:[(0,Ur.jsx)("option",{value:"-1",children:(0,Ot.__)("Bulk Actions","redirection")}),t.map(e=>(0,Ur.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,Ur.jsx)("button",{type:"button",className:"button action",disabled:n||-1===parseInt(i,10),onClick:function(e){-1!==parseInt(i,10)&&(r(i),a(-1))},children:(0,Ot.__)("Apply","redirection")})]})};function pv(e,t){if("custom"===e)return(0,Ot.__)("Custom Display","redirection");for(let n=0;n<t.length;n++){const r=t[n].options.find(t=>t.value===e);if(r)return r.label}return t[0].label}const fv=function(e){const{disabled:t,predefinedGroups:n,customOptions:r,table:o,setDisplay:i,validation:a}=e,{displayType:s,displaySelected:l}=o,c=[{label:(0,Ot.__)("Pre-defined","redirection"),value:"pre",options:n},{label:(0,Ot.__)("Custom","redirection"),value:"custom",options:r}];return(0,Ur.jsx)(Hp,{className:"redirect-table-display__filter",options:c,selected:l.concat([s]),onChange:function(e){if(!Array.isArray(e))return;const t=l.concat([s]),n=e.filter(e=>!t.includes(e));if(n.length>0){const e=c[0].options.find(e=>e.value===n[0]);if(e)return void i(e.value,e.grouping)}const o=e.filter(e=>e!==s&&(!c[0].options.find(t=>t.value===e)&&r.find(t=>t.value===e)));i("custom",a?a(o):o)},title:pv(s,c),disabled:t})};class hv extends a().Component{static propTypes={table:Vf().object.isRequired,onSearch:Vf().func.isRequired,searchType:Vf().array};constructor(e){super(e);const t=e.searchTypes.find(t=>e.selected[t.name]),n=this.getInitialValue(e.searchTypes,e.selected);this.state={search:n,initial:n,selected:t?t.name:e.searchTypes[0].name}}getInitialValue(e,t){if(e){const n=e.find(e=>t[e.name]);return n?t[n.name]:""}return t||""}componentDidUpdate(e){const t=this.getInitialValue(e.searchTypes,e.selected);if(t!==this.state.initial){const e=this.props.searchTypes.find(e=>this.props.selected[e.name]);this.setState({initial:t,search:t,selected:e?e.name:this.props.searchTypes[0].name})}}onSearch=e=>{this.setState({search:e.target.value})};onSubmit=e=>{e&&e.preventDefault(),this.props.onSearch(this.state.search,this.state.selected)};onChange=e=>{this.setState({selected:e}),this.state.search.length>0&&this.props.onSearch(this.state.search,e)};render(){const{searchTypes:e,name:t=""}=this.props,n=this.props.disabled||""===this.state.search&&""===this.props.table.filter,r=e?e.map(e=>({value:e.name,label:e.title})):[],o=e?e.find(e=>e.name===this.state.selected):null,i=o?o.title:"";return(0,Ur.jsxs)("form",{onSubmit:this.onSubmit,className:"redirect-searchbox",children:[(0,Ur.jsx)("input",{type:"search",name:"s",value:this.state.search,onChange:this.onSearch}),e&&(0,Ur.jsx)(Rp,{options:r,disabled:n,title:i,onSelect:this.onChange,selected:this.state.selected}),!e&&(0,Ur.jsx)("input",{type:"submit",className:"button",value:t,disabled:n})]})}}const mv=hv,gv=function(e){const{disabled:t,filterOptions:n,searchOptions:r,predefinedGroups:o,table:i,onSetDisplay:a,onFilter:s,validateDisplay:l}=e;return(0,Ur.jsxs)("div",{className:"redirect-table-display",children:[(0,Ur.jsx)(fv,{disabled:t,customOptions:n,predefinedGroups:o,table:i,setDisplay:a,validation:l}),(0,Ur.jsx)(mv,{disabled:t,table:i,onSearch:function(e,t){const n={...i.filterBy};r.map(e=>delete n[e.name]),e&&(n[t]=e),s(n)},selected:i.filterBy,searchTypes:r})]})},vv=function(e){const{logOptions:t,logActions:n,table:r,total:o,rows:i,getRow:a,getRowActions:s,renderTableActions:l,status:c,saving:u}=e,{displayFilters:d,displayGroups:p,searchOptions:f,groupBy:h,rowFilters:m,bulk:g,headers:v,validateDisplay:x}=t,{onChangePage:y,onFilter:b,onSetDisplay:_,onBulk:w,onGroup:j,onSetOrder:S,onSetAll:k,onSelect:E}=n,C=c===Fe;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(gv,{filterOptions:d,predefinedGroups:p,searchOptions:f,disabled:C,table:r,onFilter:b,onSetDisplay:_,validateDisplay:x}),(0,Ur.jsxs)(ov,{total:o,table:r,disabled:C,onChangePage:y,className:"top",onSelectAll:k,children:[(0,Ur.jsx)(dv,{bulk:g,disabled:C||0===r.selected.length,onBulk:w}),(0,Ur.jsx)(uv,{disabled:C,table:r,groupOptions:h,filterOptions:m,onGroup:j,onFilter:b})]}),(0,Ur.jsx)($g,{headers:v,rows:i,getRow:a,getRowActions:s,table:r,status:c,onSelect:E,onSetOrderBy:S,saving:u}),(0,Ur.jsxs)(ov,{total:o,table:r,disabled:C,onChangePage:y,className:"bottom",onSelectAll:k,children:[(0,Ur.jsx)(dv,{bulk:g,disabled:C||0===r.selected.length,onBulk:w}),l&&l()]})]})};function xv(e){return-1!==Redirectioni10n?.caps?.capabilities.indexOf(e)}function yv(e){return-1!==Redirectioni10n?.caps?.pages.indexOf(e)}const bv="redirection_cap_redirect_manage",_v="redirection_cap_redirect_add",wv="redirection_cap_group_add",jv="redirection_cap_404_delete";function Sv(e){const{actions:t,disabled:n=!1}=e;return(0,Ur.jsx)("div",{className:"row-actions",children:n?(0,Ur.jsx)("span",{children:" "}):t.length>0&&t.filter(e=>e).reduce((e,t)=>[e," | ",t])})}function kv(e){const{onClick:t,children:n,href:r="",capability:o=""}=e;return o&&!xv(o)?null:(0,Ur.jsx)("a",{href:r||"#",onClick:function(e){t&&(e.preventDefault(),t())},children:n})}function Ev(e){const{row:t,table:n,onFilter:r,isSaving:o}=e,{ip:i}=t;return i?(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("a",{href:"https://redirect.li/map/?ip="+encodeURIComponent(i),onClick:e=>{e.preventDefault(),setShowMap(!0)},children:(0,Ur.jsx)(Np(),{searchWords:[n.filterBy.ip],textToHighlight:i,autoEscape:!0})}),""===n.groupBy&&(0,Ur.jsx)(Sv,{disabled:o,actions:[(0,Ur.jsx)(kv,{onClick:()=>r({ip:i}),children:(0,Ot.__)("Filter by IP","redirection")})]})]}):null}const Cv=function(e){const{row:t,table:n}=e,{url:r}=t;return r?(0,Ur.jsx)(zp,{url:r,children:(0,Ur.jsx)(Np(),{searchWords:[n.filterBy.url||n.filterBy["url-exact"]],textToHighlight:r.substring(0,100),autoEscape:!0})}):null};function Ov(e){const{created:t,createdTime:n}=e;return(0,Ur.jsxs)(Ur.Fragment,{children:[t,(0,Ur.jsx)("br",{}),n]})}const Tv=function(e){const{filters:t,row:n}=e,{sent_to:r}=n;return r?(0,Ur.jsx)(zp,{url:r,children:(0,Ur.jsx)(Np(),{searchWords:[t.target],textToHighlight:r.substring(0,100),autoEscape:!0})}):null},Rv=e=>{const{url:t,search:n}=e;return t?(0,Ur.jsx)(zp,{url:t,children:(0,Ur.jsx)(Np(),{searchWords:[n],textToHighlight:t||"",autoEscape:!0})}):null},Pv=function(e,t,n,r){const{created:o,created_time:i,referrer:a,agent:s,request_method:l,http_code:c,domain:u="",redirect_by:d}=e,{table:p}=t,{onCreate:f,onDelete:h,onFilter:m}=n;return[{name:"date",content:(0,Ur.jsx)(Ov,{created:o,createdTime:i})},{name:"method",content:l},{name:"domain",content:(0,Ur.jsx)(Np(),{searchWords:[p.filterBy.domain],textToHighlight:u||"",autoEscape:!0})},{name:"url",content:(0,Ur.jsx)(Cv,{row:e,table:p,onDelete:h,onCreate:f})},{name:"target",content:(0,Ur.jsx)(Tv,{row:e,filters:p.filterBy})},{name:"redirect_by",content:d||(0,Ot.__)("Redirection","redirection")},{name:"code",content:c>0?c.toString():""},{name:"referrer",content:(0,Ur.jsx)(Rv,{url:a,search:p.filterBy.referrer?p.filterBy.referrer:""})},{name:"agent",content:(0,Ur.jsx)(Np(),{searchWords:[p.filterBy.agent],textToHighlight:s||"",autoEscape:!0})},{name:"ip",content:(0,Ur.jsx)(Ev,{row:e,table:p,onFilter:m,isSaving:r})},{name:"count",content:new Intl.NumberFormat(window.Redirectioni10n.locale).format(e.count)}]},Av=()=>(0,Ur.jsx)("div",{className:"redirection-poweredby",children:Cf((0,Ot.__)("Powered by {{link}}redirect.li{{/link}}","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirect.li"})})});class Nv extends a().Component{componentDidMount(){this.props.onGet(this.props.agent)}renderError(){const{error:e}=this.props;return(0,Ur.jsxs)("div",{className:"wpl-modal_error",children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Useragent Error","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Something went wrong obtaining this information","redirection")}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("code",{children:e.message})})]})}renderUnknown(){const{agent:e}=this.props;return(0,Ur.jsxs)("div",{className:"redirection-useragent_unknown",children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Unknown Useragent","redirection")}),(0,Ur.jsx)("br",{}),(0,Ur.jsx)("p",{children:e})]})}getDetail(e){return!!(e&&e.name&&e.version)&&e.name+" "+e.version}getDevice(e){const t=[];return e.vendor&&t.push(e.vendor),e.name&&t.push(e.name),t.join(" ")}getType(e,t){if(!e)return null;const n=e.slice(0,1).toUpperCase()+e.slice(1);return t?(0,Ur.jsx)(zp,{url:t,children:n}):n}renderDetails(){const{agents:e,agent:t}=this.props,n=!!e[t]&&e[t];if(!n)return this.renderUnknown();const r=this.getType(n.device.type,n.url),o=this.getDevice(n.device),i=this.getDetail(n.os),a=this.getDetail(n.browser),s=this.getDetail(n.engine),l=[];return o&&l.push([(0,Ot.__)("Device","redirection"),o]),i&&l.push([(0,Ot.__)("Operating System","redirection"),i]),a&&l.push([(0,Ot.__)("Browser","redirection"),a]),s&&l.push([(0,Ot.__)("Engine","redirection"),s]),(0,Ur.jsxs)("div",{children:[(0,Ur.jsxs)("h2",{children:[(0,Ot.__)("Useragent","redirection"),": ",r]}),(0,Ur.jsx)("table",{children:(0,Ur.jsxs)("tbody",{children:[(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:(0,Ot.__)("Agent","redirection")}),(0,Ur.jsx)("td",{className:"redirection-useragent_agent",children:t})]}),l.map((e,t)=>(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:e[0]}),(0,Ur.jsx)("td",{children:e[1]})]},t))]})}),(0,Ur.jsx)(Av,{})]})}render(){const{status:e}=this.props,t=Kf()({"redirection-useragent":!0,"wpl-modal_loading":e===Fe});return(0,Ur.jsxs)("div",{className:t,children:[e===Fe&&(0,Ur.jsx)(af,{}),e===Le&&this.renderError(),e===Me&&this.renderDetails()]})}}const Dv=te(function(e){const{status:t,error:n,agents:r}=e.info;return{status:t,error:n,agents:r}},function(e){return{onGet:t=>{var n;e((n=t,(e,t)=>{const{agents:r}=t().info;if(!r[n])return Ct(Ih(n)).then(t=>{e({type:jn,agent:t})}).catch(t=>{e({type:Sn,error:t})}),e({type:wn})}))}}})(Nv),Iv=function(e){const{agent:t}=e,[n,r]=(0,o.useState)(!1);return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(kv,{href:"https://redirect.li/agent/?agent="+encodeURIComponent(t),onClick:()=>r(!0),children:(0,Ot.__)("Agent Info","redirection")}),n&&(0,Ur.jsx)(Qp,{onClose:()=>r(!1),children:(0,Ur.jsx)(Dv,{agent:t})})]})},Fv=({headers:e})=>e&&0!==e.length?(0,Ur.jsxs)(o.Fragment,{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Request Headers","redirection")}),(0,Ur.jsx)("table",{children:(0,Ur.jsx)("tbody",{children:Object.keys(e).map(t=>(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:t}),(0,Ur.jsx)("td",{children:e[t]})]},t))})})]}):null,Lv=({source:e})=>e&&0!==e.length?(0,Ur.jsxs)(o.Fragment,{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Redirect Source","redirection")}),(0,Ur.jsx)("ul",{children:e.map((e,t)=>(0,Ur.jsx)("li",{children:e},t))})]}):null,Mv=({data:e})=>{const{headers:t,source:n}=e;return(0,Ur.jsxs)("div",{className:"redirect-requestdata",children:[(0,Ur.jsx)(Fv,{headers:t}),(0,Ur.jsx)(Lv,{source:n})]})},Uv=function(e){const{data:t}=e,[n,r]=(0,o.useState)(!1);return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(kv,{onClick:()=>r(!0),children:(0,Ot.__)("View Data","redirection")}),n&&(0,Ur.jsx)(Qp,{onClose:()=>r(!1),children:(0,Ur.jsx)(Mv,{data:t})})]})},Bv=function(e){const{row:t,onDelete:n,disabled:r}=e,{ip:o,agent:i,id:a,request_data:s,redirection_id:l}=t,c=[];return c.push((0,Ur.jsx)(kv,{onClick:()=>n(a),capability:"redirection_cap_log_delete",children:(0,Ot.__)("Delete","redirection")},"0")),i&&c.unshift((0,Ur.jsx)(Iv,{agent:i},"3")),s&&c.push((0,Ur.jsx)(Uv,{data:s},"4")),l>0&&c.push((0,Ur.jsx)(kv,{href:Redirectioni10n.pluginRoot+"&"+encodeURIComponent("filterby[id]")+"="+l,children:(0,Ot.__)("View Redirect","redirection")},"5")),(0,Ur.jsx)(Sv,{disabled:r,actions:c})};function qv(e){return-1===e.indexOf("url")?e.concat(["url"]):e}const Wv=te(function(e){const{log:t,settings:n}=e;return{log:t,settings:n,token:Yg(e,"token")}},function(e){return{onLoad:t=>{e(((e={})=>Zg(e))(t))},onChangePage:t=>{e((e=>Zg({page:e}))(t))},onBulk:(t,n)=>{e(((e,t)=>Tt(Ah,e,t,Qg,void 0))(t,n))},onGroup:t=>{e((e=>Zg({groupBy:e,page:0,orderby:"total",direction:"desc"}))(t))},onSetOrder:(t,n)=>{e(((e,t)=>Zg({orderby:e,direction:t}))(t,n))},onFilter:t=>{e((e=>Zg({filterBy:e,groupBy:"",page:0}))(t))},onSetDisplay:(t,n)=>{e(((e,t)=>({type:nt,displayType:e,displaySelected:t}))(t,n))},onSelect:t=>{e(ev(t))},onSetAll:t=>{e(ev(t,t))}}})(function(e){const{onBulk:t,token:n}=e,{status:r,total:i,table:a,rows:s,saving:l}=e.log;(0,o.useEffect)(()=>{e.onLoad()},[]);const c={...a,...(u=a.groupBy,u?{displayOptions:Bn(u),displaySelected:Un(u)[0].grouping}:{})};var u;const d={displayFilters:Bn(c.groupBy),displayGroups:Un(c.groupBy),searchOptions:[{name:"url",title:(0,Ot.__)("Search URL","redirection")},{name:"url-exact",title:(0,Ot.__)("Search exact URL","redirection")},{name:"referrer",title:(0,Ot.__)("Search referrer","redirection")},{name:"agent",title:(0,Ot.__)("Search user agent","redirection")},{name:"ip",title:(0,Ot.__)("Search IP","redirection")},{name:"target",title:(0,Ot.__)("Search target URL","redirection")},{name:"domain",title:(0,Ot.__)("Search domain","redirection")}],groupBy:qn(e.settings.values.ip_logging),bulk:[{id:"delete",name:(0,Ot.__)("Delete","redirection")}],rowFilters:c.groupBy?[]:Wn(),headers:Mn(c.groupBy).filter(e=>function(e,t){return-1!==t.displaySelected.indexOf(e)}(e.name,c)),validateDisplay:qv};return(0,Ur.jsx)(vv,{logOptions:d,logActions:e,table:c,status:r,total:i,rows:s,saving:l,getRow:(t,n)=>Pv(t,n,e,-1!==l.indexOf(t.id)),getRowActions:(e,n)=>(0,Ur.jsx)(Bv,{disabled:-1!==l.indexOf(e.id),row:e,onDelete:e=>t("delete",[e]),table:n.table}),renderTableActions:()=>(0,Ur.jsx)(Ur.Fragment,{children:(0,Ur.jsx)(Kg,{enabled:s.length>0,children:n&&(0,Ur.jsx)("div",{className:"table-button-item",children:(0,Ur.jsx)("a",{href:at(n),className:"button-secondary",children:(0,Ot.__)("RSS","redirection")})})})})})}),Hv=({title:e=null,children:t,className:n=""})=>(0,Ur.jsxs)("tr",{className:n,children:[(0,Ur.jsx)("th",{children:e}),(0,Ur.jsx)("td",{children:t})]});Hv.propTypes={title:Vf().string};const zv=Hv,Gv=({flag_case:e,flag_regex:t,flag_trailing:n})=>[e?"flag_case":null,t?"flag_regex":null,n?"flag_trailing":null].filter(e=>e),Vv=({url:e,flags:t,defaultFlags:n,onFlagChange:r,onChange:o,autoFocus:i=!1})=>{const a=yr();return Array.isArray(e)?(0,Ur.jsx)(zv,{title:(0,Ot.__)("Source URL","redirection"),className:"top",children:(0,Ur.jsx)("textarea",{value:e.join("\n"),readOnly:!0})}):(0,Ur.jsxs)(zv,{title:(0,Ot.__)("Source URL","redirection"),className:"redirect-edit__source",children:[(0,Ur.jsx)("input",{type:"text",name:"url",value:e,onChange:o,autoFocus:i,className:"regular-text",placeholder:(0,Ot.__)("The relative URL you want to redirect from","redirection")}),(0,Ur.jsx)(Hp,{options:a,selected:Gv(t),onChange:function(e){r({flag_case:-1!==e.indexOf("flag_case"),flag_trailing:-1!==e.indexOf("flag_trailing"),flag_regex:-1!==e.indexOf("flag_regex")})},title:(0,Ot.__)("URL options / Regex","redirection"),badges:!0,multiple:!0,hideTitle:!0})]})},$v=({query:e,regex:t,onChange:n,url:r})=>{if(t)return null;const o=-1===r.indexOf("?")?br().filter(e=>"exactorder"!==e.value):br();return(0,Ur.jsx)(zv,{title:(0,Ot.__)("Query Parameters","redirection"),className:"redirect-edit__sourcequery",children:(0,Ur.jsx)(of,{name:"flag_query",items:o,value:e,onChange:n})})},Kv=e=>{const t={};for(let n=0;n<e.length;n++){const r=e[n];t[r.moduleName]||(t[r.moduleName]=[]),t[r.moduleName].push({value:r.id,label:r.name})}return Object.keys(t).map(e=>({label:e,value:t[e]}))},Yv=({groups:e,currentGroup:t,onChange:n})=>(0,Ur.jsx)(of,{name:"group",value:t,items:Kv(e),onChange:n});Yv.propTypes={groups:Vf().array.isRequired,currentGroup:Vf().number.isRequired,onChange:Vf().func.isRequired};const Xv=Yv,Qv=({position:e,onChange:t})=>(0,Ur.jsxs)("span",{className:"redirect-edit-position",children:[(0,Ur.jsx)("strong",{children:(0,Ot.__)("Position","redirection")})," ",(0,Ur.jsx)("input",{type:"number",value:e,name:"position",min:"0",size:"3",onChange:t})]});Qv.propTypes={position:Vf().oneOfType([Vf().number,Vf().string]).isRequired,onChange:Vf().func.isRequired};const Jv=Qv,Zv=function({title:e,onChange:t}){return(0,Ur.jsx)(zv,{title:(0,Ot.__)("Title","redirection"),className:"redirect-edit__title",children:(0,Ur.jsx)("input",{type:"text",name:"title",value:e,onChange:e=>t({title:e.target.value}),placeholder:(0,Ot.__)("Describe the purpose of this redirect (optional)","redirection")})})},ex=({actionType:e,actionCode:t,onChange:n})=>{const r=function(e){return e===Vn?vr():e===zn||e===$n?gr():null}(e);return r?(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("strong",{className:"small-flex",children:(0,Ot.__)("with HTTP code","redirection")}),(0,Ur.jsx)(of,{name:"action_code",value:t,items:r,onChange:n})]}):null};ex.propTypes={actionType:Vf().string.isRequired,actionCode:Vf().oneOfType([Vf().string,Vf().number]).isRequired,onChange:Vf().func.isRequired};const tx=ex,nx=({actionType:e,matchType:t,onChange:n})=>(0,Ur.jsx)(of,{name:"action_type",value:e,items:mr().filter(e=>!(t===Xn&&!dr(e.value))),onChange:n});nx.propTypes={actionType:Vf().string.isRequired,matchType:Vf().string.isRequired,onChange:Vf().func.isRequired};const rx=nx,ox=({matchType:e,onChange:t})=>(0,Ur.jsx)(zv,{title:(0,Ot.__)("Match","redirection"),children:(0,Ur.jsx)(of,{name:"match_type",value:e,items:hr(),onChange:t})});ox.propTypes={matchType:Vf().string.isRequired,onChange:Vf().func.isRequired};const ix=ox;class ax extends a().Component{static propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};constructor(e){super(e),this.state={dropdown:0}}onDropdown=e=>{""!==e.target.value&&this.props.onChange({target:{name:"agent",value:{mobile:"iPad|iPod|iPhone|Android|BlackBerry|SymbianOS|SCH-Md+|Opera Mini|Windows CE|Nokia|SonyEricsson|webOS|PalmOS",feed:"Bloglines|feed|rss",lib:"cURL|Java|libwww-perl|PHP|urllib"}[e.target.value]}}),this.setState({dropdown:""})};render(){const{onChange:e,data:t}=this.props,{agent:n,regex:r}=t;return(0,Ur.jsxs)(zv,{title:(0,Ot.__)("User Agent","redirection"),className:"redirect-edit__match",children:[(0,Ur.jsx)("input",{type:"text",name:"agent",value:n,onChange:e,className:"regular-text",placeholder:(0,Ot.__)("Match against this browser user agent","redirection")}),(0,Ur.jsxs)("select",{name:"agent_dropdown",onChange:this.onDropdown,value:this.state.dropdown,className:"medium",children:[(0,Ur.jsx)("option",{value:"",children:(0,Ot.__)("Custom","redirection")}),(0,Ur.jsx)("option",{value:"mobile",children:(0,Ot.__)("Mobile","redirection")}),(0,Ur.jsxs)("option",{value:"feed",children:[(0,Ot.__)("Feed Readers","redirection")," "]}),(0,Ur.jsx)("option",{value:"lib",children:(0,Ot.__)("Libraries","redirection")})]}),(0,Ur.jsxs)("label",{className:"redirect-edit-regex",children:[(0,Ot.__)("Regex","redirection")," ",(0,Ur.jsx)("sup",{children:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/redirect-regular-expressions/",children:"?"})})," ",(0,Ur.jsx)("input",{type:"checkbox",name:"regex",checked:r,onChange:e})]})]})}}const sx=ax,lx=({data:e,onChange:t})=>{const{referrer:n,regex:r}=e;return(0,Ur.jsxs)(zv,{title:(0,Ot.__)("Referrer","redirection"),className:"redirect-edit__match",children:[(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"referrer",value:n,onChange:t,placeholder:(0,Ot.__)("Match against this browser referrer text","redirection")}),(0,Ur.jsxs)("label",{className:"redirect-edit-regex",children:[(0,Ot.__)("Regex","redirection")," ",(0,Ur.jsx)("sup",{children:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/redirect-regular-expressions/",children:"?"})})," ",(0,Ur.jsx)("input",{type:"checkbox",name:"regex",checked:r,onChange:t})]})]})};lx.propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};const cx=lx;class ux extends a().Component{static propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};constructor(e){super(e),this.state={dropdown:0}}onDropdown=e=>{""!==e.target.value&&this.props.onChange({target:{name:"name",value:{accept:"Accept-Language"}[e.target.value]}}),this.setState({dropdown:""})};render(){const{onChange:e,data:t}=this.props,{name:n,value:r,regex:o}=t;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsxs)(zv,{title:(0,Ot.__)("HTTP Header","redirection"),className:"redirect-edit__match",children:[(0,Ur.jsx)("input",{type:"text",name:"name",value:n,onChange:e,className:"regular-text",placeholder:(0,Ot.__)("Header name","redirection")}),(0,Ur.jsx)("input",{type:"text",name:"value",value:r,onChange:e,className:"regular-text",placeholder:(0,Ot.__)("Header value","redirection")}),(0,Ur.jsxs)("select",{name:"agent_dropdown",onChange:this.onDropdown,value:this.state.dropdown,className:"medium",children:[(0,Ur.jsx)("option",{value:"",children:(0,Ot.__)("Custom","redirection")}),(0,Ur.jsx)("option",{value:"accept",children:(0,Ot.__)("Accept Language","redirection")})]}),(0,Ur.jsxs)("label",{className:"redirect-edit-regex",children:[(0,Ot.__)("Regex","redirection")," ",(0,Ur.jsx)("sup",{children:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/redirect-regular-expressions/",children:"?"})})," ",(0,Ur.jsx)("input",{type:"checkbox",name:"regex",checked:o,onChange:e})]})]}),(0,Ur.jsx)(zv,{children:(0,Ot.__)("Note it is your responsibility to pass HTTP headers to PHP. Please contact your hosting provider for support about this.","redirection")})]})}}const dx=ux,px=({data:e,onChange:t})=>{const{filter:n}=e;return(0,Ur.jsx)(zv,{title:(0,Ot.__)("Filter Name","redirection"),className:"redirect-edit__match",children:(0,Ur.jsx)("input",{type:"text",name:"filter",value:n,onChange:t,className:"regular-text",placeholder:(0,Ot.__)("WordPress filter name","redirection")})})};px.propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};const fx=px,hx=({data:e,onChange:t})=>{const{name:n,value:r,regex:o}=e;return(0,Ur.jsxs)(zv,{title:(0,Ot.__)("Cookie","redirection"),className:"redirect-edit__match",children:[(0,Ur.jsx)("input",{type:"text",name:"name",value:n,onChange:t,className:"regular-text",placeholder:(0,Ot.__)("Cookie name","redirection")}),(0,Ur.jsx)("input",{type:"text",name:"value",value:r,onChange:t,className:"regular-text",placeholder:(0,Ot.__)("Cookie value","redirection")}),(0,Ur.jsxs)("label",{className:"redirect-edit-regex",children:[(0,Ot.__)("Regex","redirection")," ",(0,Ur.jsx)("sup",{children:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/redirect-regular-expressions/",children:"?"})})," ",(0,Ur.jsx)("input",{type:"checkbox",name:"regex",checked:o,onChange:t})]})]})};hx.propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};const mx=hx,gx=({data:e,onChange:t})=>{const{role:n}=e;return(0,Ur.jsx)(zv,{title:(0,Ot.__)("Role","redirection"),className:"redirect-edit__match",children:(0,Ur.jsx)("input",{type:"text",className:"regular-text",value:n,name:"role",placeholder:(0,Ot.__)("Enter role or capability value","redirection"),onChange:t})})};gx.propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};const vx=gx,xx=({data:e,onChange:t})=>{const{server:n}=e;return(0,Ur.jsx)(zv,{title:(0,Ot.__)("Server","redirection"),className:"redirect-edit__match",children:(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"server",value:n,placeholder:(0,Ot.__)("Enter server URL to match against","redirection"),onChange:t})})};xx.propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};const yx=xx,bx=({data:e,onChange:t})=>{const{ip:n}=e;return(0,Ur.jsx)(zv,{title:(0,Ot.__)("IP","redirection"),className:"redirect-edit__match",children:(0,Ur.jsx)("textarea",{value:n.join("\n"),name:"ip",placeholder:(0,Ot.__)("Enter IP addresses (one per line)","redirection"),onChange:e=>{t({target:{name:e.target.name,value:e.target.value.split("\n")}})}})})};bx.propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};const wx=bx,jx=()=>(0,Ur.jsx)(zv,{title:(0,Ot.__)("Page Type","redirection"),className:"redirect-edit__match",children:(0,Ur.jsxs)("p",{children:[(0,Ot.__)("Only the 404 page type is currently supported.","redirection")," ",(0,Ot.__)("Please do not try and redirect all your 404s - this is not a good thing to do.","redirection")]})});jx.propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};const Sx=jx,kx=({data:e,onChange:t})=>{const{language:n}=e;return(0,Ur.jsx)(zv,{title:(0,Ot.__)("Language","redirection"),className:"redirect-edit__match",children:(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"language",value:n,onChange:t,placeholder:(0,Ot.__)("Comma separated list of languages to match against (i.e. da, en-GB)","redirection")})})};kx.propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};const Ex=kx,Cx=({matchType:e,actionData:t,onChange:n})=>{const r={[Qn]:cx,[Jn]:sx,[Zn]:mx,[er]:dx,[tr]:fx,[nr]:vx,[rr]:yx,[or]:wx,[ir]:Sx,[ar]:Ex};if(r[e]){const o=r[e];return(0,Ur.jsx)(o,{data:null===t?{}:t,onChange:n})}return null},Ox=({onChange:e,data:t})=>{const{logged_in:n,logged_out:r}=t;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(zv,{title:(0,Ot.__)("Logged In","redirection"),className:"redirect-edit__target__matched",children:(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"logged_in",value:n,onChange:e,placeholder:(0,Ot.__)("Target URL when matched (empty to ignore)","redirection")})}),(0,Ur.jsx)(zv,{title:(0,Ot.__)("Logged Out","redirection"),className:"redirect-edit__target__unmatched",children:(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"logged_out",value:r,onChange:e,placeholder:(0,Ot.__)("Target URL when not matched (empty to ignore)","redirection")})})]})};Ox.propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};const Tx=Ox,Rx=function(e){const{onChange:t,url:n}=e;return(0,Ur.jsx)(Ip,{placeholder:(0,Ot.__)("The target URL you want to redirect, or auto-complete on post name or permalink.","redirection"),onChange:t,fetchData:function(e){return Ct(mh(e))},value:n})},Px=({onChange:e,data:t})=>{const{url:n}=t;return(0,Ur.jsx)(zv,{title:(0,Ot.__)("Target URL","redirection"),className:"redirect-edit__target",children:(0,Ur.jsx)(Rx,{url:n,onChange:t=>e({target:{name:"url",value:t,type:"input"}})})})};Px.propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};const Ax=Px,Nx=({onChange:e,data:t})=>{const{url_from:n,url_notfrom:r}=t;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(zv,{title:(0,Ot.__)("Matched Target","redirection"),className:"redirect-edit__target__matched",children:(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"url_from",value:n,onChange:e,placeholder:(0,Ot.__)("Target URL when matched (empty to ignore)","redirection")})}),(0,Ur.jsx)(zv,{title:(0,Ot.__)("Unmatched Target","redirection"),className:"redirect-edit__target__unmatched",children:(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"url_notfrom",value:r,onChange:e,placeholder:(0,Ot.__)("Target URL when not matched (empty to ignore)","redirection")})})]})};Nx.propTypes={data:Vf().object.isRequired,onChange:Vf().func.isRequired};const Dx=Nx,Ix=({actionType:e,matchType:t,actionData:n,onChange:r})=>{if(dr(e)){const e=(o=t)===Xn?Tx:o===Yn||o===ir?Ax:Dx,i=fr(t,n);return(0,Ur.jsx)(e,{data:null===i?{}:i,onChange:r})}var o;return null},Fx=(e,t)=>0===t.indexOf(e)||e.substr(0,t.length)===t,Lx=e=>{const{url:t,flag_regex:n,action_data:r={}}=e;if(null===r||!t||!e||"string"!=typeof t)return[];const o=[],{url:i="",logged_in:a="",logged_out:s="",url_from:l="",url_notfrom:c=""}=r;if(Array.isArray(t)||0===t.length||void 0===t)return o;var u;-1!==t.indexOf("#")&&o.push((0,Ur.jsx)(zp,{url:"https://redirection.me/support/faq/#anchor",children:(0,Ot.__)("Anchor values are not sent to the server and cannot be redirected.","redirection")})),"http"===t.substr(0,4)&&-1===t.indexOf(document.location.origin)&&(console.log(zf.qg(t).hostname),o.push((0,Ur.jsx)(zp,{url:"https://redirection.me/support/matching-redirects/#server",children:Cf((0,Ot.sprintf)((0,Ot.__)("This will be converted to a server redirect for the domain {{code}}%(server)s{{/code}}.","redirection"),{server:zf.qg(t).hostname}),{code:(0,Ur.jsx)("code",{})})}))),"http"!==t.substr(0,4)&&"/"!==t.substr(0,1)&&t.length>0&&!1===n&&-1===t.indexOf("[source]")&&o.push(Cf((0,Ot.__)("The source URL should probably start with a {{code}}/{{/code}}","redirection"),{code:(0,Ur.jsx)("code",{})})),null===(u=t).match(/[\*\\\(\)\^\$]/)&&-1===u.indexOf(".?")||!1!==n||o.push((0,Ur.jsx)(zp,{url:"https://redirection.me/support/redirect-regular-expressions/",children:(0,Ot.__)('Remember to enable the "regex" option if this is a regular expression.',"redirection")})),t.match(/%\w+%/)&&o.push((0,Ur.jsx)(zp,{url:"tools.php?page=redirection.php&sub=site",children:(0,Ot.__)('Please add migrated permalinks to the Site page under the "Permalink Migration" section.',"redirection")})),-1===t.indexOf("^")&&-1===t.indexOf("$")&&n&&o.push(Cf((0,Ot.sprintf)((0,Ot.__)("To prevent a greedy regular expression you can use {{code}}^{{/code}} to anchor it to the start of the URL. For example: {{code}}%(example)s{{/code}}","redirection"),{example:"^"+t}),{code:(0,Ur.jsx)("code",{})})),n&&t.indexOf("^")>0&&o.push(Cf((0,Ot.sprintf)((0,Ot.__)("The caret {{code}}^{{/code}} should be at the start. For example: {{code}}%(example)s{{/code}}","redirection"),{example:"^"+t.replace("^","")}),{code:(0,Ur.jsx)("code",{})})),n&&t.match(/[a-zA-Z0-9\/]\?/)&&o.push(Cf((0,Ot.__)("To match {{code}}?{{/code}} you need to escape it with {{code}}\\?{{/code}}","redirection"),{code:(0,Ur.jsx)("code",{})})),n&&t.match(/[a-zA-Z0-9 ]\*/)&&o.push(Cf((0,Ot.__)("Wildcards are not supported. You need to use a {{link}}regular expression{{/link}}.","redirection"),{link:(0,Ur.jsx)(zp,{url:"https://redirection.me/support/redirect-regular-expressions/"})})),"/(.*)"!==t&&"^/(.*)"!==t||o.push((0,Ot.__)("If you want to redirect everything please use a site relocation or alias from the Site page.","redirection")),t.length>0&&(l===t||c===t||a===t||s===t||i===t)&&o.push((0,Ot.__)("Your source is the same as a target and this will create a loop. Leave a target blank if you do not want to take action.","redirection"));const d=[r.url,r.url_from,r.url_notfrom,r.logged_in,r.logged_out].filter(e=>e);return!i||Fx(i,"https://")||Fx(i,"http://")||"/"===i.substr(0,1)||o.push(Cf((0,Ot.sprintf)((0,Ot.__)("Your target URL should be an absolute URL like {{code}}https://domain.com/%(url)s{{/code}} or start with a slash {{code}}/%(url)s{{/code}}.","redirection"),{url:r.url}),{code:(0,Ur.jsx)("code",{})})),!1===n&&d.forEach(e=>{const t=e.match(/[|\\\$]/g);null!==t&&o.push(Cf((0,Ot.sprintf)((0,Ot.__)("Your target URL contains the invalid character {{code}}%(invalid)s{{/code}}","redirection"),{invalid:t}),{code:(0,Ur.jsx)("code",{})}))}),[t,...d].forEach(e=>{const t=(e=>{const t=e.match(/^\/([a-zA-Z0-9_\-%]*\..*)\//);return t&&-1===e.indexOf("index.php")?t[0]:null})(e);t&&o.push(Cf((0,Ot.sprintf)((0,Ot.__)("Your URL appears to contain a domain inside the path: {{code}}%(relative)s{{/code}}. Did you mean to use {{code}}%(absolute)s{{/code}} instead?","redirection"),{relative:t,absolute:"https://"+t}),{code:(0,Ur.jsx)("code",{})}))}),null!==t.match(/(\.html|\.htm|\.php|\.pdf|\.jpg)$/)&&o.push((0,Ur.jsx)(zp,{url:"https://redirection.me/support/problems/url-not-redirecting/",children:(0,Ot.__)("Some servers may be configured to serve file resources directly, preventing a redirect occurring.","redirection")})),o},Mx=({warnings:e})=>0===e.length?null:(0,Ur.jsx)(zv,{children:(0,Ur.jsx)("div",{className:"redirect-edit_warning notice notice-warning",children:e.map((e,t)=>(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("span",{className:"dashicons dashicons-info"}),e]},t))})}),Ux={store:"redirect",saving:dn,saved:fn,failed:pn,order:"name"},Bx={store:"redirect",saving:sn,saved:ln,failed:cn,order:"name"},qx=(e,t)=>Tt(Rh,e,t,Ux),Wx=e=>(t,n)=>It(ph,t,Bx,e,n().redirect),Hx=(e,t=!1)=>({type:un,items:e,isEverything:t}),zx=e=>({type:hn,onoff:e});class Gx extends a().Component{static propTypes={item:Vf().object.isRequired,onCancel:Vf().func,saveButton:Vf().string,childSave:Vf().func,callback:Vf().func};constructor(e){super(e);const{url:t,match_data:n,match_type:r,action_type:o,action_data:i,group_id:s=0,title:l,action_code:c,position:u=0}=e.item,{flag_regex:d,flag_trailing:p,flag_case:f,flag_query:h}=n.source;this.state={url:t,title:l,flag_regex:d,flag_trailing:p,flag_case:f,flag_query:h,match_type:r,action_type:o,action_code:c,action_data:fr(r,i),options:n.options||{},group_id:this.getValidGroup(s),position:u},this.state.warning=Lx(this.state),this.state.advanced=!this.canShowAdvanced(),this.ref=a().createRef()}getWarning(e){return Lx({...this.state,...e})}getValidGroup(e){const t=this.props.group.rows,{table:n}=this.props;if(((e,t)=>e.find(e=>e.id===t))(t,e))return e;if("group"===n.filterBy&&parseInt(n.filter,10)>0)return parseInt(n.filter,10);if(t.length>0){const e=t.find(e=>e.default);return e?e.id:t[0].id}return 0}reset(){const e=this.props.flags;this.setState({...pr("",this.state.group_id,e),warning:[],id:this.state.id})}canShowAdvanced(){const{match_type:e,action_type:t,title:n,action_code:r}=this.state;return e===Yn&&t===zn&&""===n&&301===r}onSave=e=>{e.preventDefault();const{url:t,title:n,flag_regex:r,flag_trailing:o,flag_case:i,flag_query:a,match_type:s,action_type:l,group_id:c,action_code:u,position:d,action_data:p,options:f}=this.state,h=this.props.group.rows,m=c>0||!h?c:h[0].id,g={id:parseInt(this.props.item.id,10),url:t,title:n,match_data:{source:{flag_regex:r,flag_trailing:o,flag_case:i,flag_query:a},options:f},match_type:s,action_type:l,position:d,group_id:m,action_code:parseInt(u,10),action_data:fr(s,p)};this.props.canSave&&!this.props.canSave(Array.isArray(t))||(g.id?this.props.onSave(g.id,g):this.props.onCreate(g),this.props.onCancel?this.props.onCancel(e):this.reset(),this.props.childSave&&this.props.childSave())};onToggleAdvanced=e=>{e.preventDefault(),this.onUpdateState({advanced:!this.state.advanced})};onSetGroup=e=>{this.setState({group_id:parseInt(e.target.value,10)})};onFlagChange=e=>{const t={};Object.keys(this.props.flags).filter(e=>"flag_query"!==e).forEach(e=>{t[e]=!1}),this.onUpdateState({...t,...e})};getInputState(e){const{target:t}=e,n="checkbox"===t.type?t.checked:t.value;return{[t.name]:n}}onChangeMatch=e=>{const t=this.getInputState(e);t.action_data=fr(t.match_type,this.state.action_data),t.match_type===Xn&&(t.action_type=zn),this.onUpdateState(t)};onChange=e=>{this.onUpdateState(this.getInputState(e))};onChangeOption=e=>{void 0!==e.target.checked?this.setState({options:{...this.state.options,[e.target.name]:e.target.checked}}):this.setState({options:{...this.state.options,[e.target.name]:e.target.value}})};onChangeActionType=e=>{const t=this.getInputState(e).action_type;var n;this.onUpdateState({action_type:t,action_code:(n=t,n===zn||n===Gn?301:n===Vn?404:0),action_data:fr(this.state.match_type,this.state.action_data||{})})};onChangeActionData=e=>{const t={action_data:{...this.state.action_data,...this.getInputState(e)}};this.onUpdateState(t)};onUpdateState(e){e.warning=this.getWarning(e),this.setState(e,()=>{this.props.callback&&this.props.callback(this.ref.current.clientHeight)})}canSave(){const{match_type:e,action_type:t,action_data:n,url:r}=this.state,{autoTarget:o}=this.props;return!(0===r.length&&!o||dr(t)&&(i=e,(!(a=n)||(i===Yn||i===ir?""===a.url:i===Xn?""===a.logged_in&&""===a.logged_out:""===a.url_from&&""===a.url_notfrom))&&""===o));var i,a}renderOptions(){const{options:e,action_type:t,advanced:n}=this.state;return n&&-1!==["url","random"].indexOf(t)?(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{type:"checkbox",name:"log_exclude",checked:e.log_exclude||!1,onChange:this.onChangeOption})," ",(0,Ot.__)("Exclude from logs","redirection")]}):null}renderItem(){const{url:e,advanced:t,flag_regex:n,action_type:r,match_type:o,action_data:i,flag_query:a,group_id:s,position:l,title:c,action_code:u}=this.state,{autoFocus:d,group:p,flags:f}=this.props;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(Vv,{url:e,flags:this.state,defaultFlags:f,autoFocus:d,onFlagChange:this.onFlagChange,onChange:this.onChange}),(0,Ur.jsx)($v,{query:a,regex:n,onChange:this.onChange,url:e}),t&&(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(Zv,{title:c,onChange:e=>this.onUpdateState(e)}),(0,Ur.jsx)(ix,{matchType:o,onChange:this.onChangeMatch}),(0,Ur.jsx)(Cx,{matchType:o,actionData:i,onChange:this.onChangeActionData}),(0,Ur.jsxs)(zv,{title:(0,Ot.__)("When matched","redirection"),className:"redirect-edit__action",children:[(0,Ur.jsx)(rx,{actionType:r,matchType:o,onChange:this.onChangeActionType}),(0,Ur.jsx)(tx,{actionType:r,actionCode:u,onChange:this.onChange}),this.renderOptions()]})]}),(0,Ur.jsx)(Ix,{actionType:r,matchType:o,actionData:i,onChange:this.onChangeActionData}),(0,Ur.jsxs)(zv,{title:(0,Ot.__)("Group","redirection"),className:"redirect-edit__group",children:[(0,Ur.jsx)(Xv,{groups:p.rows,currentGroup:s,onChange:this.onSetGroup}),t&&(0,Ur.jsx)(Jv,{position:l,onChange:this.onChange})]})]})}render(){const{warning:e}=this.state,{saveButton:t=(0,Ot.__)("Save","redirection"),onCancel:n,addTop:r,onClose:o}=this.props;return(0,Ur.jsx)("form",{onSubmit:this.onSave,ref:this.ref,children:(0,Ur.jsx)("table",{className:"redirect-edit",children:(0,Ur.jsxs)("tbody",{children:[this.renderItem(),this.props.children&&this.props.children,(0,Ur.jsx)(zv,{children:(0,Ur.jsxs)("div",{className:"table-actions",children:[(0,Ur.jsx)("input",{className:"button-primary",type:"submit",name:"save",value:t,disabled:!this.canSave()})," "," ",n&&(0,Ur.jsx)("button",{type:"button",className:"button-secondary",onClick:n,children:(0,Ot.__)("Cancel","redirection")}),r&&!n&&(0,Ur.jsx)("button",{className:"button-secondary",type:"button",onClick:o,children:(0,Ot.__)("Close","redirection")})," ",this.canShowAdvanced()&&(0,Ur.jsx)("a",{href:"#",onClick:this.onToggleAdvanced,className:"redirection-edit_advanced",title:(0,Ot.__)("Show advanced options","redirection"),children:(0,Ur.jsx)("svg",{"aria-hidden":"true",role:"img",focusable:"false",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",children:(0,Ur.jsx)("path",{d:"M18 12h-2.18c-.17.7-.44 1.35-.81 1.93l1.54 1.54-2.1 2.1-1.54-1.54c-.58.36-1.23.63-1.91.79V19H8v-2.18c-.68-.16-1.33-.43-1.91-.79l-1.54 1.54-2.12-2.12 1.54-1.54c-.36-.58-.63-1.23-.79-1.91H1V9.03h2.17c.16-.7.44-1.35.8-1.94L2.43 5.55l2.1-2.1 1.54 1.54c.58-.37 1.24-.64 1.93-.81V2h3v2.18c.68.16 1.33.43 1.91.79l1.54-1.54 2.12 2.12-1.54 1.54c.36.59.64 1.24.8 1.94H18V12zm-8.5 1.5c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3z"})})})]})}),(0,Ur.jsx)(Mx,{warnings:e})]})})})}}const Vx=te(function(e){const{group:t,redirect:{addTop:n,table:r}}=e;return{group:t,addTop:n,table:r,autoTarget:Yg(e,"auto_target"),flags:Xg(e)}},function(e){return{onSave:(t,n)=>{e(((e,t)=>At(fh,e,t,Ux))(t,n))},onCreate:t=>{e(Pt(hh,t,Ux))},onClose:t=>{t.preventDefault(),e(zx(!1))}}})(Gx),$x={saving:Kt,saved:Yt,failed:Xt,order:"date",store:"error"},Kx={saving:zt,saved:Gt,failed:Vt,order:"date",store:"error"},Yx=(e,t,n)=>Tt(Nh,e,t,$x,n),Xx=e=>(t,n)=>It(bh,t,Kx,e,n().error),Qx=e=>Xx({filterBy:e,groupBy:"",page:0}),Jx=(e,t=!1)=>({type:$t,items:e,isEverything:t});const Zx=te(function(e){const{rows:t}=e.error;return{defaultFlags:Xg(e),rows:t}},function(e){return{onDelete:t=>{e(Yx("delete",t,{groupBy:"url",deleteConfirm:!0}))}}})(function(e){const{onClose:t,redirect:n,defaultFlags:r,onDelete:i,rows:a}=e,s=function(e,t){return e?Array.isArray(e)?[...new Set(e.map(e=>function(e,t){const n=t.find(t=>t.id===e||t.id===parseInt(e,10));return n?n.url:e}(e,t)))]:e:""}(n.url,a),[l,c]=(0,o.useState)(!1),u={...pr(s,0,r),...n,url:s};return(0,Ur.jsx)(Qp,{onClose:t,padding:!0,children:(0,Ur.jsx)("div",{className:"add-new",children:(0,Ur.jsx)(Vx,{item:u,saveButton:(0,Ot.__)("Add Redirect","redirection"),onCancel:t,childSave:()=>l&&i(Array.isArray(s)?s:[s]),canSave:e=>l&&confirm(e?(0,Ot.__)("Are you sure you want to delete the selected items?","redirection"):(0,Ot.__)("Are you sure you want to delete this item?","redirection"))||!l,autoFocus:!0,children:xv(jv)&&(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:(0,Ot.__)("Delete Log Entries","redirection")}),(0,Ur.jsx)("td",{className:"edit-left",style:{padding:"7px 0px"},children:(0,Ur.jsxs)("label",{children:[(0,Ur.jsx)("input",{type:"checkbox",checked:l,onChange:e=>c(e.target.checked)}),s.length<=1?(0,Ot.__)("Delete logs for this entry","redirection"):(0,Ot.__)("Delete logs for these entries","redirection")]})})]})})})})}),ey={store:"group",saving:nn,saved:on,failed:rn,order:"name"},ty={store:"group",saving:Jt,saved:Zt,failed:en,order:"name"},ny=(e,t)=>Tt(Ph,e,t,ey),ry=e=>(t,n)=>It(gh,t,ty,e,n().group),oy=e=>ry({filterBy:e,groupBy:"",page:0}),iy=(e,t=!1)=>({type:tn,items:e,isEverything:t}),ay="^/.*$";function sy(e){return{url:ay,match_type:or,action_data:{ip:e},match_data:{source:{flag_regex:!0}}}}function ly(e,t){return"redirect-ip"===e||"ip"===e?{...sy(t),action_type:zn}:"block"===e?{...sy(t),action_type:Vn,action_code:403}:"agent"===e?{url:ay,match_type:Jn,action_data:{agent:t},match_data:{source:{flag_regex:!0}}}:{url:t,match_type:Yn,action_type:"ignore"===e?Kn:zn}}const cy=te(null,function(e){return{onFilter:t=>{e(Qx(t))}}})(function(e){const{row:t,onDelete:n,onCreate:r,table:o,disabled:i,onFilter:a}=e,{url:s,ip:l,agent:c,id:u}=t,{groupBy:d}=o,p=[];return p.push((0,Ur.jsx)(kv,{onClick:()=>n(u),capability:jv,children:(0,Ot.__)("Delete","redirection")},"0")),p.push((0,Ur.jsx)(kv,{onClick:()=>r(ly(d,"ip"===d?[u]:""===d?s:u)),capability:_v,children:(0,Ot.__)("Add Redirect","redirection")},"1")),c&&p.unshift((0,Ur.jsx)(Iv,{agent:c},"3")),p.push((0,Ur.jsx)(kv,{onClick:()=>a(function(e,t){const{ip:n,agent:r,url:o}=t;return"ip"===e?{ip:n}:"agent"===e?{agent:r}:{"url-exact":o}}(d,t)),capability:bv,children:(0,Ot.__)("Show All","redirection")},"4")),"ip"===d?p.push((0,Ur.jsx)(kv,{onClick:()=>r(ly("block",[l])),capability:_v,children:(0,Ot.__)("Block IP","redirection")},"5")):"agent"!==d&&p.push((0,Ur.jsx)(kv,{onClick:()=>r(ly("ignore",s)),capability:_v,children:(0,Ot.__)("Ignore URL","redirection")},"6")),(0,Ur.jsx)(Sv,{disabled:i,actions:p})});function uy(e){return-1===e.indexOf("url")?e.concat(["url"]):e}const dy=te(function(e){const{error:t,settings:n}=e;return{error:t,settings:n}},function(e){return{onLoad:()=>{e(((e={})=>Xx(e))())},onLoadGroups:()=>{e(ry())},onChangePage:t=>{e((e=>Xx({page:e}))(t))},onBulk:(t,n)=>{e(Yx(t,n))},onSetOrder:(t,n)=>{e(((e,t)=>Xx({orderby:e,direction:t}))(t,n))},onGroup:t=>{e((e=>Xx({groupBy:e,page:0,orderby:"total",direction:"desc"}))(t))},onSelect:t=>{e(Jx(t))},onFilter:t=>{e(Qx(t))},onSetDisplay:(t,n)=>{e(((e,t)=>({type:Qt,displayType:e,displaySelected:t}))(t,n))},onSetAll:t=>{e(Jx(t,t))}}})(function(e){const{onSelect:t,error:n}=e,{status:r,total:i,table:a,rows:s,saving:l}=n,[c,u]=(0,o.useState)(null);function d(e){t(!1),u(e)}function p(t,n){"delete"===t?e.onBulk(t,n):u(ly(t,a.selected))}(0,o.useEffect)(()=>{e.onLoad(),e.onLoadGroups()},[]);const f={...a,...(h=a.groupBy,h?{displayOptions:kr(h),displaySelected:Sr(h)[0].grouping}:{})};var h;const m={displayFilters:kr(f.groupBy),displayGroups:Sr(f.groupBy),searchOptions:[{name:"url",title:(0,Ot.__)("Search URL","redirection")},{name:"url-exact",title:(0,Ot.__)("Search exact URL","redirection")},{name:"referrer",title:(0,Ot.__)("Search referrer","redirection")},{name:"agent",title:(0,Ot.__)("Search user agent","redirection")},{name:"ip",title:(0,Ot.__)("Search IP","redirection")},{name:"domain",title:(0,Ot.__)("Search domain","redirection")}],groupBy:jr(e.settings.values.ip_logging),bulk:wr(f.groupBy,Object.keys(f.filterBy).length),rowFilters:f.groupBy?[]:Er(),headers:_r(f.groupBy).filter(e=>function(e,t){return-1!==t.displaySelected.indexOf(e)}(e.name,f)),validateDisplay:uy};return(0,Ur.jsxs)(Ur.Fragment,{children:[c&&(0,Ur.jsx)(Zx,{onClose:()=>u(null),redirect:c}),(0,Ur.jsx)(vv,{logOptions:m,logActions:{...e,onBulk:p},table:f,status:r,total:i,rows:s,saving:l,getRow:(t,n)=>Pv(t,n,e,-1!==l.indexOf(t.id)),getRowActions:(e,t)=>(0,Ur.jsx)(cy,{disabled:-1!==l.indexOf(e.id),row:e,onCreate:d,onDelete:e=>p("delete",[e]),table:t.table}),renderTableActions:()=>xv(jv)&&function(e){const{filterBy:t,groupBy:n}=e;return void 0!==t.url||!n&&0===Object.keys(t).length}(f)&&(0,Ur.jsx)(Kg,{enabled:s.length>0})})]})});var py=n(2736);const fy=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.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"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/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"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function hy(e,t,n){const r=function(e){const{name:t}=e;if(t&&-1!==t.lastIndexOf(".")&&!e.type){const n=t.split(".").pop().toLowerCase(),r=fy.get(n);r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}(e),{webkitRelativePath:o}=e,i="string"==typeof t?t:"string"==typeof o&&o.length>0?o:`./${e.name}`;return"string"!=typeof r.path&&my(r,"path",i),void 0!==n&&Object.defineProperty(r,"handle",{value:n,writable:!1,configurable:!1,enumerable:!0}),my(r,"relativePath",i),r}function my(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const gy=[".DS_Store","Thumbs.db"];function vy(e){return"object"==typeof e&&null!==e}function xy(e){return e.filter(e=>-1===gy.indexOf(e.name))}function yy(e){if(null===e)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function by(e){if("function"!=typeof e.webkitGetAsEntry)return wy(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?Sy(t):wy(e,t)}function _y(e){return e.reduce((e,t)=>[...e,...Array.isArray(t)?_y(t):[t]],[])}function wy(e,t){var n;if("function"==typeof e.getAsFileSystemHandle)return e.getAsFileSystemHandle().then(e=>Zr(this,void 0,void 0,function*(){const t=yield e.getFile();return t.handle=e,hy(t)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const o=hy(r,null!==(n=null==t?void 0:t.fullPath)&&void 0!==n?n:void 0);return Promise.resolve(o)}function jy(e){return Zr(this,void 0,void 0,function*(){return e.isDirectory?Sy(e):function(e){return Zr(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(n=>{const r=hy(n,e.fullPath);t(r)},e=>{n(e)})})})}(e)})}function Sy(e){const t=e.createReader();return new Promise((e,n)=>{const r=[];!function o(){t.readEntries(t=>Zr(this,void 0,void 0,function*(){if(t.length){const e=Promise.all(t.map(jy));r.push(e),o()}else try{const t=yield Promise.all(r);e(t)}catch(e){n(e)}}),e=>{n(e)})}()})}var ky=n(2402);function Ey(e){return function(e){if(Array.isArray(e))return Ay(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Py(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Oy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cy(Object(n),!0).forEach(function(t){Ty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ry(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||Py(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Py(e,t){if(e){if("string"==typeof e)return Ay(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ay(e,t):void 0}}function Ay(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ny="function"==typeof ky?ky:ky.default,Dy=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(","),t=e.length>1?"one of ".concat(e.join(", ")):e[0];return{code:"file-invalid-type",message:"File type must be ".concat(t)}},Iy=function(e){return{code:"file-too-large",message:"File is larger than ".concat(e," ").concat(1===e?"byte":"bytes")}},Fy=function(e){return{code:"file-too-small",message:"File is smaller than ".concat(e," ").concat(1===e?"byte":"bytes")}},Ly={code:"too-many-files",message:"Too many files"};function My(e,t){var n="application/x-moz-file"===e.type||Ny(e,t);return[n,n?null:Dy(t)]}function Uy(e,t,n){if(By(e.size))if(By(t)&&By(n)){if(e.size>n)return[!1,Iy(n)];if(e.size<t)return[!1,Fy(t)]}else{if(By(t)&&e.size<t)return[!1,Fy(t)];if(By(n)&&e.size>n)return[!1,Iy(n)]}return[!0,null]}function By(e){return null!=e}function qy(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function Wy(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(e){return"Files"===e||"application/x-moz-file"===e}):!!e.target&&!!e.target.files}function Hy(e){e.preventDefault()}function zy(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return t.some(function(t){return!qy(e)&&t&&t.apply(void 0,[e].concat(r)),qy(e)})}}function Gy(e){return"audio/*"===e||"video/*"===e||"image/*"===e||"text/*"===e||"application/*"===e||/\w+\/[-+.\w]+/g.test(e)}function Vy(e){return/^.*\.[\w]+$/.test(e)}var $y=["children"],Ky=["open"],Yy=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Xy=["refKey","onChange","onClick"];function Qy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,a=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){a=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||Jy(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jy(e,t){if(e){if("string"==typeof e)return Zy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zy(e,t):void 0}}function Zy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eb(Object(n),!0).forEach(function(t){nb(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eb(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rb(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var ob=(0,o.forwardRef)(function(e,t){var n=e.children,r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=tb(tb({},ib),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,a=t.maxSize,s=t.minSize,l=t.multiple,c=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,p=t.onDragOver,f=t.onDrop,h=t.onDropAccepted,m=t.onDropRejected,g=t.onFileDialogCancel,v=t.onFileDialogOpen,x=t.useFsAccessApi,y=t.autoFocus,b=t.preventDropOnDocument,_=t.noClick,w=t.noKeyboard,j=t.noDrag,S=t.noDragEventsBubbling,k=t.onError,E=t.validator,C=(0,o.useMemo)(function(){return function(e){if(By(e))return Object.entries(e).reduce(function(e,t){var n=Ry(t,2),r=n[0],o=n[1];return[].concat(Ey(e),[r],Ey(o))},[]).filter(function(e){return Gy(e)||Vy(e)}).join(",")}(n)},[n]),O=(0,o.useMemo)(function(){return function(e){return By(e)?[{description:"Files",accept:Object.entries(e).filter(function(e){var t=Ry(e,2),n=t[0],r=t[1],o=!0;return Gy(n)||(console.warn('Skipped "'.concat(n,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),Array.isArray(r)&&r.every(Vy)||(console.warn('Skipped "'.concat(n,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(e,t){var n=Ry(t,2),r=n[0],o=n[1];return Oy(Oy({},e),{},Ty({},r,o))},{})}]:e}(n)},[n]),T=(0,o.useMemo)(function(){return"function"==typeof v?v:cb},[v]),R=(0,o.useMemo)(function(){return"function"==typeof g?g:cb},[g]),P=(0,o.useRef)(null),A=(0,o.useRef)(null),N=Qy((0,o.useReducer)(lb,sb),2),D=N[0],I=N[1],F=D.isFocused,L=D.isFileDialogActive,M=(0,o.useRef)("undefined"!=typeof window&&window.isSecureContext&&x&&"showOpenFilePicker"in window),U=function(){!M.current&&L&&setTimeout(function(){A.current&&(A.current.files.length||(I({type:"closeDialog"}),R()))},300)};(0,o.useEffect)(function(){return window.addEventListener("focus",U,!1),function(){window.removeEventListener("focus",U,!1)}},[A,L,R,M]);var B=(0,o.useRef)([]),q=function(e){P.current&&P.current.contains(e.target)||(e.preventDefault(),B.current=[])};(0,o.useEffect)(function(){return b&&(document.addEventListener("dragover",Hy,!1),document.addEventListener("drop",q,!1)),function(){b&&(document.removeEventListener("dragover",Hy),document.removeEventListener("drop",q))}},[P,b]),(0,o.useEffect)(function(){return!r&&y&&P.current&&P.current.focus(),function(){}},[P,y,r]);var W=(0,o.useCallback)(function(e){k?k(e):console.error(e)},[k]),H=(0,o.useCallback)(function(e){var t;e.preventDefault(),e.persist(),ne(e),B.current=[].concat(function(e){if(Array.isArray(e))return Zy(e)}(t=B.current)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||Jy(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[e.target]),Wy(e)&&Promise.resolve(i(e)).then(function(t){if(!qy(e)||S){var n=t.length,r=n>0&&function(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,s=e.validator;return!(!i&&t.length>1||i&&a>=1&&t.length>a)&&t.every(function(e){var t=Ry(My(e,n),1)[0],i=Ry(Uy(e,r,o),1)[0],a=s?s(e):null;return t&&i&&!a})}({files:t,accept:C,minSize:s,maxSize:a,multiple:l,maxFiles:c,validator:E});I({isDragAccept:r,isDragReject:n>0&&!r,isDragActive:!0,type:"setDraggedFiles"}),u&&u(e)}}).catch(function(e){return W(e)})},[i,u,W,S,C,s,a,l,c,E]),z=(0,o.useCallback)(function(e){e.preventDefault(),e.persist(),ne(e);var t=Wy(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(e){}return t&&p&&p(e),!1},[p,S]),G=(0,o.useCallback)(function(e){e.preventDefault(),e.persist(),ne(e);var t=B.current.filter(function(e){return P.current&&P.current.contains(e)}),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),B.current=t,t.length>0||(I({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Wy(e)&&d&&d(e))},[P,d,S]),V=(0,o.useCallback)(function(e,t){var n=[],r=[];e.forEach(function(e){var t=Qy(My(e,C),2),o=t[0],i=t[1],l=Qy(Uy(e,s,a),2),c=l[0],u=l[1],d=E?E(e):null;if(o&&c&&!d)n.push(e);else{var p=[i,u];d&&(p=p.concat(d)),r.push({file:e,errors:p.filter(function(e){return e})})}}),(!l&&n.length>1||l&&c>=1&&n.length>c)&&(n.forEach(function(e){r.push({file:e,errors:[Ly]})}),n.splice(0)),I({acceptedFiles:n,fileRejections:r,isDragReject:r.length>0,type:"setFiles"}),f&&f(n,r,t),r.length>0&&m&&m(r,t),n.length>0&&h&&h(n,t)},[I,l,C,s,a,c,f,h,m,E]),$=(0,o.useCallback)(function(e){e.preventDefault(),e.persist(),ne(e),B.current=[],Wy(e)&&Promise.resolve(i(e)).then(function(t){qy(e)&&!S||V(t,e)}).catch(function(e){return W(e)}),I({type:"reset"})},[i,V,W,S]),K=(0,o.useCallback)(function(){if(M.current){I({type:"openDialog"}),T();var e={multiple:l,types:O};window.showOpenFilePicker(e).then(function(e){return i(e)}).then(function(e){V(e,null),I({type:"closeDialog"})}).catch(function(e){!function(e){return e instanceof DOMException&&("AbortError"===e.name||e.code===e.ABORT_ERR)}(e)?function(e){return e instanceof DOMException&&("SecurityError"===e.name||e.code===e.SECURITY_ERR)}(e)?(M.current=!1,A.current?(A.current.value=null,A.current.click()):W(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):W(e):(R(e),I({type:"closeDialog"}))})}else A.current&&(I({type:"openDialog"}),T(),A.current.value=null,A.current.click())},[I,T,R,x,V,W,O,l]),Y=(0,o.useCallback)(function(e){P.current&&P.current.isEqualNode(e.target)&&(" "!==e.key&&"Enter"!==e.key&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),K()))},[P,K]),X=(0,o.useCallback)(function(){I({type:"focus"})},[]),Q=(0,o.useCallback)(function(){I({type:"blur"})},[]),J=(0,o.useCallback)(function(){_||(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return function(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}(e)||function(e){return-1!==e.indexOf("Edge/")}(e)}()?setTimeout(K,0):K())},[_,K]),Z=function(e){return r?null:e},ee=function(e){return w?null:Z(e)},te=function(e){return j?null:Z(e)},ne=function(e){S&&e.stopPropagation()},re=(0,o.useMemo)(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,o=e.role,i=e.onKeyDown,a=e.onFocus,s=e.onBlur,l=e.onClick,c=e.onDragEnter,u=e.onDragOver,d=e.onDragLeave,p=e.onDrop,f=rb(e,Yy);return tb(tb(nb({onKeyDown:ee(zy(i,Y)),onFocus:ee(zy(a,X)),onBlur:ee(zy(s,Q)),onClick:Z(zy(l,J)),onDragEnter:te(zy(c,H)),onDragOver:te(zy(u,z)),onDragLeave:te(zy(d,G)),onDrop:te(zy(p,$)),role:"string"==typeof o&&""!==o?o:"presentation"},n,P),r||w?{}:{tabIndex:0}),f)}},[P,Y,X,Q,J,H,z,G,$,w,j,r]),oe=(0,o.useCallback)(function(e){e.stopPropagation()},[]),ie=(0,o.useMemo)(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,r=e.onChange,o=e.onClick,i=rb(e,Xy);return tb(tb({},nb({accept:C,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:Z(zy(r,$)),onClick:Z(zy(o,oe)),tabIndex:-1},n,A)),i)}},[A,n,l,$,r]);return tb(tb({},D),{},{isFocused:F&&!r,getRootProps:re,getInputProps:ie,rootRef:P,inputRef:A,open:Z(K)})}(rb(e,$y)),i=r.open,a=rb(r,Ky);return(0,o.useImperativeHandle)(t,function(){return{open:i}},[i]),o.createElement(o.Fragment,null,n(tb(tb({},a),{},{open:i})))});ob.displayName="Dropzone";var ib={disabled:!1,getFilesFromEvent:function(e){return Zr(this,void 0,void 0,function*(){return vy(e)&&vy(e.dataTransfer)?function(e,t){return Zr(this,void 0,void 0,function*(){if(e.items){const n=yy(e.items).filter(e=>"file"===e.kind);return"drop"!==t?n:xy(_y(yield Promise.all(n.map(by))))}return xy(yy(e.files).map(e=>hy(e)))})}(e.dataTransfer,e.type):vy(t=e)&&vy(t.target)?function(e){return yy(e.target.files).map(e=>hy(e))}(e):Array.isArray(e)&&e.every(e=>"getFile"in e&&"function"==typeof e.getFile)?function(e){return Zr(this,void 0,void 0,function*(){const t=yield Promise.all(e.map(e=>e.getFile()));return t.map(e=>hy(e))})}(e):[];var t})},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};ob.defaultProps=ib,ob.propTypes={children:py.func,accept:py.objectOf(py.arrayOf(py.string)),multiple:py.bool,preventDropOnDocument:py.bool,noClick:py.bool,noKeyboard:py.bool,noDrag:py.bool,noDragEventsBubbling:py.bool,minSize:py.number,maxSize:py.number,maxFiles:py.number,disabled:py.bool,getFilesFromEvent:py.func,onFileDialogCancel:py.func,onFileDialogOpen:py.func,useFsAccessApi:py.bool,autoFocus:py.bool,onDragEnter:py.func,onDragLeave:py.func,onDragOver:py.func,onDrop:py.func,onDropAccepted:py.func,onDropRejected:py.func,onError:py.func,validator:py.func};const ab=ob;var sb={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function lb(e,t){switch(t.type){case"focus":return tb(tb({},e),{},{isFocused:!0});case"blur":return tb(tb({},e),{},{isFocused:!1});case"openDialog":return tb(tb({},sb),{},{isFileDialogActive:!0});case"closeDialog":return tb(tb({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return tb(tb({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return tb(tb({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return tb({},sb);default:return e}}function cb(){}const ub=function(e){const{plugin:t,doImport:n}=e,{name:r,total:o}=t;return(0,Ur.jsxs)("div",{className:"plugin-importer",children:[(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("strong",{children:r})," (",(0,Ot.sprintf)((0,Ot.__)("total = %d","redirection"),o),")"]}),(0,Ur.jsx)("button",{onClick:()=>{n(t)},className:"button-secondary",children:(0,Ot.sprintf)((0,Ot.__)("Import from %s","redirection"),r)})]})},db=({logType:e,title:t})=>(0,Ur.jsxs)("form",{method:"post",action:Redirectioni10n.pluginRoot+"&sub="+e,children:[(0,Ur.jsx)("input",{type:"hidden",name:"_wpnonce",value:Ct.nonceMiddleware.nonce}),(0,Ur.jsx)("input",{type:"hidden",name:"export-csv",value:""}),(0,Ur.jsx)("input",{className:"button",type:"submit",name:"",value:t})]});class pb extends a().Component{constructor(e){super(e),this.state={group:0,hover:!1,module:"all",format:"json"}}componentDidMount(){this.props.onLoadGroups(),this.props.onLoadImport()}componentWillUnmount(){this.props.onClearFile()}onView=()=>{this.props.onExport(this.state.module,this.state.format)};onDownload=()=>{this.props.onDownloadFile(Or(this.state.module,this.state.format))};onEnter=()=>{const{importingStatus:e}=this.props.io;e!==Fe&&this.setState({hover:!0})};onLeave=()=>{this.setState({hover:!1})};onImport=()=>{this.props.onImport(this.props.io.file,this.state.group)};onCancel=()=>{this.setState({hover:!1}),this.props.onClearFile()};onInput=e=>{const{target:t}=e;this.setState({[t.name]:t.value}),"module"===t.name&&"everything"===t.value&&this.setState({format:"json"})};onDrop=e=>{const{importingStatus:t}=this.props.io;e.length>0&&t!==Fe&&this.props.onAddFile(e[0]),this.setState({hover:!1,group:this.props.group.rows[0].id})};renderGroupSelect(){const{rows:e}=this.props.group;return(0,Ur.jsxs)("div",{className:"groups",children:[(0,Ot.__)("Import to group","redirection")," ",(0,Ur.jsx)(of,{items:Kv(e),name:"group",value:this.state.group,onChange:this.onInput})]})}renderInitialDrop(e){return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Import a CSV, .htaccess, or JSON file.","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Click 'Add File' or drag and drop here.","redirection")}),(0,Ur.jsx)("button",{type:"button",className:"button-secondary",onClick:e,children:(0,Ot.__)("Add File","redirection")})]})}renderDropBeforeUpload(){const{file:e}=this.props.io,t="application/json"===e.type;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("File selected","redirection")}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("code",{children:e.name})}),!t&&this.renderGroupSelect(),(0,Ur.jsx)("button",{className:"button-primary",onClick:this.onImport,children:(0,Ot.__)("Upload","redirection")})," ",(0,Ur.jsx)("button",{className:"button-secondary",onClick:this.onCancel,children:(0,Ot.__)("Cancel","redirection")})]})}renderUploading(){const{file:e}=this.props.io;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Importing","redirection")}),(0,Ur.jsx)("p",{children:(0,Ur.jsx)("code",{children:e.name})}),(0,Ur.jsx)("div",{className:"is-placeholder",children:(0,Ur.jsx)("div",{className:"wpl-placeholder__loading"})})]})}renderUploaded(){const{lastImport:e}=this.props.io;return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Finished importing","redirection")}),(0,Ur.jsxs)("p",{children:[(0,Ot.__)("Total redirects imported:","redirection")," ",e]}),0===e&&(0,Ur.jsx)("p",{children:(0,Ot.__)("Double-check the file is the correct format!","redirection")}),(0,Ur.jsx)("button",{className:"button-secondary",onClick:this.onCancel,children:(0,Ot.__)("OK","redirection")})]})}renderDropzoneContent(e){const{getInputProps:t,getRootProps:n}=e,{hover:r}=this.state,{importingStatus:o,file:i,lastImport:a}=this.props.io,s=Kf()({dropzone:!0,"dropzone-dropped":!1!==i,"dropzone-importing":o===Fe,"dropzone-hover":r}),l=n({onClick:e=>e.stopPropagation(),onKeyDown:e=>{32!==e.keyCode&&13!==e.keyCode||e.stopPropagation()}});let c;return c=o===Fe?this.renderUploading():o===Me&&!1!==a&&!1===i?this.renderUploaded():!1===i?this.renderInitialDrop(e.open):this.renderDropBeforeUpload(),(0,Ur.jsxs)("div",{className:s,...l,children:[(0,Ur.jsx)("input",{...t()}),c]})}renderExport(e){return(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)("textarea",{className:"module-export",rows:14,readOnly:!0,value:e}),(0,Ur.jsx)("input",{className:"button-secondary",type:"submit",value:(0,Ot.__)("Close","redirection"),onClick:this.onCancel})]})}renderExporting(){return(0,Ur.jsx)("div",{className:"loader-wrapper loader-textarea",children:(0,Ur.jsx)("div",{className:"wpl-placeholder__loading"})})}doImport=e=>{confirm((0,Ot.sprintf)((0,Ot.__)("Are you sure you want to import from %s?","redirection"),e.name))&&this.props.pluginImport(e.id)};renderImporters(e){return(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)("h3",{children:(0,Ot.__)("Plugin Importers","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("The following redirect plugins were detected on your site and can be imported from.","redirection")}),e.map((e,t)=>(0,Ur.jsx)(ub,{plugin:e,doImport:this.doImport},t))]})}render(){const{exportData:e,exportStatus:t,importers:n}=this.props.io;return(0,Ur.jsxs)("div",{className:"import",children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Import","redirection")}),(0,Ur.jsx)(ab,{multiple:!1,onDrop:this.onDrop,onDragLeave:this.onLeave,onDragEnter:this.onEnter,children:e=>this.renderDropzoneContent(e)}),(0,Ur.jsx)("p",{children:(0,Ot.__)("All imports will be appended to the current database - nothing is merged.","redirection")}),(0,Ur.jsxs)("div",{className:"inline-notice notice-warning",children:[(0,Ur.jsx)("p",{children:Cf((0,Ot.__)("{{strong}}CSV file format{{/strong}}: {{code}}source URL, target URL{{/code}} - and can be optionally followed with {{code}}regex, http code{{/code}} ({{code}}regex{{/code}} - 0 for no, 1 for yes).","redirection"),{code:(0,Ur.jsx)("code",{}),strong:(0,Ur.jsx)("strong",{})})}),(0,Ur.jsx)("p",{children:(0,Ot.__)('CSV does not include all information, and everything is imported/exported as "URL only" matches. Use the JSON format for a full set of data.',"redirection")})]}),(0,Ur.jsx)("h2",{children:(0,Ot.__)("Export","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Export to CSV, Apache .htaccess, Nginx, or Redirection JSON. The JSON format contains full information, and other formats contain partial information appropriate to the format.","redirection")}),(0,Ur.jsxs)("p",{className:"redirect-export_buttons",children:[(0,Ur.jsxs)("select",{name:"module",onChange:this.onInput,value:this.state.module,children:[(0,Ur.jsx)("option",{value:"0",children:(0,Ot.__)("Everything","redirection")}),(0,Ur.jsx)("option",{value:"1",children:(0,Ot.__)("WordPress redirects","redirection")}),(0,Ur.jsx)("option",{value:"2",children:(0,Ot.__)("Apache redirects","redirection")}),(0,Ur.jsx)("option",{value:"3",children:(0,Ot.__)("Nginx redirects","redirection")})]}),(0,Ur.jsxs)("select",{name:"format",onChange:this.onInput,value:this.state.format,children:[(0,Ur.jsx)("option",{value:"json",children:(0,Ot.__)("Complete data (JSON)","redirection")}),(0,Ur.jsx)("option",{value:"csv",children:(0,Ot.__)("CSV","redirection")}),(0,Ur.jsx)("option",{value:"apache",children:(0,Ot.__)("Apache .htaccess","redirection")}),(0,Ur.jsx)("option",{value:"nginx",children:(0,Ot.__)("Nginx rewrite rules","redirection")})]}),(0,Ur.jsx)("button",{className:"button-primary",onClick:this.onView,children:(0,Ot.__)("View","redirection")}),(0,Ur.jsx)("button",{className:"button-secondary",onClick:this.onDownload,children:(0,Ot.__)("Download","redirection")})]}),t===Fe&&this.renderExporting(),e&&t!==Fe&&this.renderExport(e),(0,Ur.jsx)("h2",{children:(0,Ot.__)("Export Logs","redirection")}),(0,Ur.jsx)(db,{logType:"log",title:(0,Ot.__)("Export redirect","redirection")}),(0,Ur.jsx)("br",{}),(0,Ur.jsx)(db,{logType:"404s",title:(0,Ot.__)("Export 404","redirection")}),n.length>0&&this.renderImporters(n)]})}}const fb=te(function(e){const{group:t,io:n}=e;return{group:t,io:n}},function(e){return{onLoadGroups:()=>{e(ry())},onImport:(t,n)=>{e(((e,t)=>n=>(Ct(_h(t,e)).then(e=>{n({type:We,total:e.imported})}).catch(e=>{n({type:He,error:e})}),n({type:qe,file:e})))(t,n))},onAddFile:t=>{e((e=>({type:Ge,file:e}))(t))},onClearFile:()=>{e({type:ze})},onExport:(t,n)=>{var r,o;e((r=t,o=n,e=>(Ct(Sh(r,o)).then(t=>{e({type:Ue,data:t.data})}).catch(t=>{e({type:He,error:t})}),e({type:Be}))))},onDownloadFile:t=>{e((e=>(document.location.href=e,{type:"NOTHING"}))(t))},onLoadImport:()=>{e(e=>{Ct(wh()).then(t=>{e({type:Ve,importers:t.importers})}).catch(t=>{e({type:He,error:t})})})},pluginImport:t=>{e(fm(t))}}})(pb),hb=te(null,function(e){return{onCreate:t=>{e((e=>Pt(xh,e,ey,"name"))(t))}}})(function(e){const{disabled:t,onCreate:n}=e,[r,i]=(0,o.useState)(""),[a,s]=(0,o.useState)(1);return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)("h2",{children:(0,Ot.__)("Add Group","redirection")}),(0,Ur.jsx)("p",{children:(0,Ot.__)("Use groups to organise your redirects. Groups are assigned to a module, which affects how the redirects in that group work. If you are unsure then stick to the WordPress module.","redirection")}),(0,Ur.jsxs)("form",{onSubmit:function(e){e.preventDefault(),n({id:0,name:r,moduleId:a}),i("")},children:[(0,Ur.jsx)("table",{className:"form-table redirect-groups",children:(0,Ur.jsx)("tbody",{children:(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:(0,Ot.__)("Name","redirection")}),(0,Ur.jsxs)("td",{children:[(0,Ur.jsx)("input",{size:30,className:"regular-text",type:"text",name:"name",value:r,onChange:e=>i(e.target.value),disabled:t}),(0,Ur.jsx)(of,{name:"group",value:a,onChange:e=>s(parseInt(e.target.value,10)),items:[{value:1,label:"WordPress"},{value:2,label:"Apache"},{value:3,label:"Nginx"}],disabled:t})," ",(0,Ur.jsx)("input",{className:"button-primary",type:"submit",name:"add",value:"Add",disabled:t||""===r})]})]})})}),2===a&&(0,Ur.jsx)("p",{children:(0,Ot.__)("Note that you will need to set the Apache module path in your Redirection options.","redirection")})]})]})}),mb=te(null,function(e){return{onDelete:t=>{e(ny("delete",[t]))},onEnable:t=>{e(ny("enable",[t]))},onDisable:t=>{e(ny("disable",[t]))}}})(function(e){const{disabled:t,rowParams:n,onDelete:r,onEnable:o,onDisable:i,row:a}=e,{setRowMode:s,rowMode:l}=n,{id:c,enabled:u}=a,d=[];return"edit"===l?null:(xv(wv)&&d.push((0,Ur.jsx)(kv,{onClick:()=>s("edit"!==l&&"edit"),children:(0,Ot.__)("Edit","redirection")},"0")),xv("redirection_cap_group_delete")&&d.push((0,Ur.jsx)(kv,{onClick:()=>r(c),children:(0,Ot.__)("Delete","redirection")},"1")),xv(bv)&&d.push((0,Ur.jsx)(kv,{href:Redirectioni10n.pluginRoot+"&"+encodeURIComponent("filterby[group]")+"="+c,children:(0,Ot.__)("View Redirects","redirection")},"2")),xv(wv)&&(u?d.push((0,Ur.jsx)(kv,{onClick:()=>i(c),children:(0,Ot.__)("Disable","redirection")},"3")):d.push((0,Ur.jsx)(kv,{onClick:()=>o(c),children:(0,Ot.__)("Enable","redirection")},"3"))),(0,Ur.jsx)(Sv,{disabled:t,actions:d}))}),gb=function({row:e}){const{enabled:t}=e;return t?(0,Ur.jsx)("div",{className:"redirect-status redirect-status__enabled",children:"✓"}):(0,Ur.jsx)("div",{className:"redirect-status redirect-status__disabled",children:"×"})},vb=function({row:e,filters:t}){const{enabled:n,name:r}=e;return n?(0,Ur.jsx)(Np(),{searchWords:[t.name],textToHighlight:r,autoEscape:!0}):(0,Ur.jsx)("strike",{children:r})},xb=te(null,function(e){return{onEnableModule:t=>{e(oy({module:t}))}}})(function({row:e,onEnableModule:t}){const{module_id:n}=e,r=(e=>{const t=[{value:1,label:"WordPress"},{value:2,label:"Apache"},{value:3,label:"Nginx"}].find(t=>t.value===parseInt(e,10));return t?t.label:""})(n);return(0,Ur.jsx)(Br,{onClick:()=>t(n),title:(0,Ot.sprintf)((0,Ot.__)("Filter on: %(type)s","redirection"),{type:r}),children:r})}),yb=te(null,function(e){return{onSaveGroup:(t,n)=>{e(((e,t)=>At(vh,e,t,ey))(t,n))}}})(function(e){const{group:t,onCancel:n,onSaveGroup:r}=e,[i,a]=(0,o.useState)(t.name),[s,l]=(0,o.useState)(t.module_id);return(0,Ur.jsx)("form",{onSubmit:function(e){e.preventDefault(),e.stopPropagation(),n(),r(t.id,{id:t.id,name:i,moduleId:s})},children:(0,Ur.jsx)("table",{className:"edit-groups",children:(0,Ur.jsxs)("tbody",{children:[(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:(0,Ot.__)("Name","redirection")}),(0,Ur.jsx)("td",{children:(0,Ur.jsx)("input",{type:"text",className:"regular-text",name:"name",value:i,onChange:e=>a(e.target.value)})})]}),(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{children:(0,Ot.__)("Module","redirection")}),(0,Ur.jsx)("td",{children:(0,Ur.jsx)(of,{name:"module_id",value:s,onChange:e=>l(parseInt(e.target.value,10)),items:[{value:1,label:"WordPress"},{value:2,label:"Apache"},{value:3,label:"Nginx"}]})})]}),(0,Ur.jsxs)("tr",{children:[(0,Ur.jsx)("th",{}),(0,Ur.jsxs)("td",{children:[(0,Ur.jsxs)("div",{className:"table-actions",children:[(0,Ur.jsx)("input",{className:"button-primary",type:"submit",name:"save",value:(0,Ot.__)("Save","redirection")})," ",(0,Ur.jsx)("input",{className:"button-secondary",type:"button",name:"cancel",value:(0,Ot.__)("Cancel","redirection"),onClick:n})]}),2===s&&(0,Ur.jsxs)("p",{children:[(0,Ur.jsx)("br",{}),(0,Ot.__)("Note that you will need to set the Apache module path in your Redirection options.","redirection")]})]})]})]})})})});function bb(e){return-1===e.indexOf("name")?e.concat(["name"]):e}const _b=te(function(e){const{group:t}=e;return{group:t}},function(e){return{onLoadGroups:()=>{e(ry())},onChangePage:t=>{e((e=>ry({page:e}))(t))},onBulk:(t,n)=>{e(ny(t,n))},onSelect:t=>{e(iy(t))},onSetOrder:(t,n)=>{e(((e,t)=>ry({orderby:e,direction:t}))(t,n))},onFilter:t=>{e(oy(t))},onSetDisplay:(t,n)=>{e(((e,t)=>({type:an,displayType:e,displaySelected:t}))(t,n))},onSetAll:t=>{e(iy(t,t))}}})(function(e){const{onDelete:t,group:n}=e,{status:r,total:i,table:a,rows:s,saving:l}=n;(0,o.useEffect)(()=>{e.onLoadGroups()},[]);const c={displayFilters:Tr(),displayGroups:Rr(),searchOptions:[{name:"name",title:(0,Ot.__)("Search","redirection")}],groupBy:[],bulk:[{id:"delete",name:(0,Ot.__)("Delete","redirection")},{id:"enable",name:(0,Ot.__)("Enable","redirection")},{id:"disable",name:(0,Ot.__)("Disable","redirection")}],rowFilters:Pr([{value:1,label:"WordPress"},{value:2,label:"Apache"},{value:3,label:"Nginx"}].map(e=>({label:e.label,value:`${e.value}`}))),headers:[{name:"status",title:(0,Ot.__)("Status","redirection"),sortable:!1},{name:"name",title:(0,Ot.__)("Name","redirection"),primary:!0},{name:"redirects",title:(0,Ot.__)("Redirects","redirection"),sortable:!1},{name:"module",title:(0,Ot.__)("Module","redirection"),sortable:!1}].filter(e=>function(e,t){return-1!==t.displaySelected.indexOf(e)}(e.name,a)),validateDisplay:bb};return(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(vv,{logOptions:c,logActions:e,table:a,status:r,total:i,rows:s,saving:l,getRow:(e,t)=>function(e,t){const{redirects:n}=e,{rowMode:r,setRowMode:o}=t;return[{name:"status",content:(0,Ur.jsx)(gb,{row:e})},{name:"name",content:"edit"===r?(0,Ur.jsx)(yb,{group:e,onCancel:()=>o(!1)}):(0,Ur.jsx)(vb,{row:e,filters:t.table.filterBy})},{name:"redirects",content:new Intl.NumberFormat(window.Redirectioni10n.locale).format(n)},{name:"module",content:(0,Ur.jsx)(xb,{row:e})}]}(e,t,l.indexOf(e.id)),getRowActions:(e,n)=>(0,Ur.jsx)(mb,{disabled:-1!==l.indexOf(e.id),row:e,onDelete:t,rowParams:n})}),xv(wv)&&(0,Ur.jsx)(hb,{})]})}),wb=function(e){const{addTop:t}=e,n=Kf()({"add-new":!0,edit:!0,addTop:t});return(0,Ur.jsxs)(Ur.Fragment,{children:[!t&&xv(_v)&&(0,Ur.jsx)("h2",{children:(0,Ot.__)("Add new redirection","redirection")}),(0,Ur.jsx)("div",{className:n,children:(0,Ur.jsx)(Vx,{item:pr("",0,e.defaultFlags),saveButton:(0,Ot.__)("Add Redirect","redirection"),autoFocus:t})})]})},jb=te(null,function(e){return{onDelete:t=>{e(qx("delete",[t]))},onEnable:t=>{e(qx("enable",[t]))},onDisable:t=>{e(qx("disable",[t]))}}})(function(e){const{disabled:t,rowParams:n,onDelete:r,onEnable:o,onDisable:i,row:a}=e,{setRowMode:s,rowMode:l}=n,{id:c,enabled:u,regex:d,action_type:p,match_type:f}=a,h=[];return"edit"===l?null:(u&&xv(_v)&&h.push((0,Ur.jsx)(kv,{onClick:()=>s("edit"),children:(0,Ot.__)("Edit","redirection")},"1")),xv("redirection_cap_redirect_delete")&&h.push((0,Ur.jsx)(kv,{onClick:()=>r(c),children:(0,Ot.__)("Delete","redirection")},"2")),xv(_v)&&(u?h.push((0,Ur.jsx)(kv,{onClick:()=>i(c),children:(0,Ot.__)("Disable","redirection")},"3")):h.push((0,Ur.jsx)(kv,{onClick:()=>o(c),children:(0,Ot.__)("Enable","redirection")},"4"))),!u||d||"url"!==p||"url"!==f&&"server"!==f||h.push((0,Ur.jsx)(kv,{onClick:()=>s("check"),children:(0,Ot.__)("Check Redirect","redirection")},"5")),(0,Ur.jsx)(Sv,{disabled:t,actions:h}))}),Sb=function({row:e}){const{enabled:t}=e;return t?(0,Ur.jsx)("div",{className:"redirect-status redirect-status__enabled",children:"✓"}):(0,Ur.jsx)("div",{className:"redirect-status redirect-status__disabled",children:"×"})},kb=(e,t)=>-1!==e.indexOf(t);function Eb(e,t,n){return n===rr?e.server+t:t}function Cb(e,t){const{match_type:n,regex:r,action_data:o,url:i}=e;return r?t:(0,Ur.jsx)(zp,{url:Eb(o,i,n),children:t})}function Ob(e,t){return t?e:(0,Ur.jsx)("strike",{children:e})}const Tb=function(e){const{displaySelected:t,row:n,filters:r}=e,{match_type:o,url:i,title:a,action_data:s,enabled:l}=n,c=(0,Ur.jsx)(Np(),{searchWords:[r.url],textToHighlight:Eb(s,i,o),autoEscape:!0}),u=(0,Ur.jsx)(Np(),{searchWords:[r.title],textToHighlight:a,autoEscape:!0});return kb(t,"title")&&!kb(t,"source")?(0,Ur.jsx)("p",{children:Cb(n,Ob(a?u:c,l))}):(0,Ur.jsxs)(Ur.Fragment,{children:[kb(t,"title")&&a&&(0,Ur.jsx)("p",{children:Cb(n,Ob(u,l))}),kb(t,"source")&&c&&(0,Ur.jsx)("p",{children:Cb(n,Ob(c,l))})]})},Rb=function(e){const{row:t,filters:n}=e,{match_type:r,action_data:o}=t;return r===Yn&&o?(0,Ur.jsx)("span",{className:"target",children:(0,Ur.jsx)(Np(),{searchWords:[n.target],textToHighlight:o.url||"",autoEscape:!0})}):null},Pb=function({name:e,className:t}){return(0,Ur.jsx)(Br,{className:Kf()("redirect-source__flag",t),children:e})},Ab=function(e){const{row:t,defaultFlags:n}=e,{match_data:{source:r}}=t;return Object.keys(r).filter(e=>n[e]!==r[e]&&"flag_query"!==e).map(e=>{const t=yr().find(t=>t.value===e);return(0,Ur.jsx)(Pb,{name:t.label,className:"redirect-source__"+e},e)})},Nb=function(e){const{defaultFlags:t,row:n}=e,{match_data:{source:r}}=n;if(t.flag_query!==r.flag_query){let e=(0,Ot.__)("Exact Query","redirection");return"ignore"===r.flag_query?e=(0,Ot.__)("Ignore Query","redirection"):"pass"===r.flag_query&&(e=(0,Ot.__)("Ignore & Pass Query","redirection")),(0,Ur.jsx)(Pb,{name:e})}return null},Db=function(e){const{row:t,table:n,defaultFlags:r}=e,{displaySelected:o}=n;return(0,Ur.jsxs)("div",{className:"redirect-column-wrap",children:[(0,Ur.jsxs)("div",{className:"redirect-source__details",children:[(0,Ur.jsx)(Tb,{row:t,displaySelected:o,filters:n.filterBy}),kb(o,"target")&&(0,Ur.jsx)(Rb,{row:t,filters:n.filterBy})]}),(0,Ur.jsxs)("div",{className:"redirect-source__flags",children:[kb(o,"flags")&&(0,Ur.jsx)(Ab,{row:t,defaultFlags:r}),kb(o,"query")&&(0,Ur.jsx)(Nb,{row:t,defaultFlags:r})]})]})},Ib=function(e){const{action_code:t,action_type:n}=e;return"pass"===n?(0,Ot.__)("pass","redirection"):"nothing"===n?"-":t},Fb=function(e){const{row:t,group:n}=e,r=n.rows.find(e=>e.id===t.group_id);return r?(0,Ur.jsxs)("div",{className:"redirect-column-wrap",children:[r.name," ",(0,Ur.jsx)(Br,{children:r.moduleName})]}):null};function Lb(e,t){const n=t.find(t=>t.value===e);return n?n.label:"-"}function Mb({url:e,desiredCode:t=0,desiredTarget:n=null}){const r=le();return(0,o.useEffect)(()=>(r(Bm(e)),()=>{r(qm())}),[]),(0,Ur.jsx)(Ym,{url:e,desiredCode:t,desiredTarget:n})}function Ub(e){let t=encodeURIComponent(e).replace(/%2F/gi,"/");return t=t.replace(/%3F/gi,"?"),t=t.replace(/%3D/gi,"="),t=t.replace(/%26/gi,"&"),t}function Bb(e){return-1===e.indexOf("source")?e.concat(["source"]):e}function qb(e){return-1===e.indexOf("title")&&-1===e.indexOf("source")?Bb(e.concat(["title"])):Bb(e)}function Wb(e){return[{value:"0",label:(0,Ot.__)("All groups","redirection")}].concat(Kv(e))}const Hb=te(function(e){const{redirect:t,group:n}=e;return{redirect:t,group:n,defaultFlags:Xg(e)}},function(e){return{onLoadGroups:()=>{e(ry())},onLoadRedirects:t=>{e(Wx(t))},onChangePage:t=>{e((e=>Wx({page:e}))(t))},onBulk:(t,n)=>{e(qx(t))},onSelect:t=>{e(Hx(t))},onSetOrder:(t,n)=>{e(((e,t)=>Wx({orderby:e,direction:t}))(t,n))},onFilter:t=>{e((e=>Wx({filterBy:e,groupBy:"",page:0}))(t))},onSetDisplay:(t,n)=>{e(((e,t)=>({type:mn,displayType:e,displaySelected:t}))(t,n))},onSetAll:t=>{e(Hx(t,t))}}})(function(e){const{onDelete:t,group:n,redirect:r,defaultFlags:i}=e,{status:a,total:s,table:l,rows:c,addTop:u,saving:d}=r,p=a===Me&&n.status===Me&&xv(_v);(0,o.useEffect)(()=>{e.onLoadRedirects(),e.onLoadGroups()},[]);const f={displayFilters:Nr(l.groupBy),displayGroups:Dr(l.groupBy),searchOptions:[{name:"url",title:(0,Ot.__)("Search URL","redirection")},{name:"target",title:(0,Ot.__)("Search target URL","redirection")},{name:"title",title:(0,Ot.__)("Search title","redirection")}],groupBy:Wb(n.rows),bulk:[{id:"delete",name:(0,Ot.__)("Delete","redirection")},{id:"enable",name:(0,Ot.__)("Enable","redirection")},{id:"disable",name:(0,Ot.__)("Disable","redirection")},{id:"reset",name:(0,Ot.__)("Reset hits","redirection")}],rowFilters:Ir(),headers:[{name:"status",title:(0,Ot.__)("Status","redirection"),sortable:!1},{name:"source",title:(0,Ot.__)("URL","redirection"),primary:!0},{name:"match_type",title:(0,Ot.__)("Match Type","redirection"),sortable:!1},{name:"action_type",title:(0,Ot.__)("Action Type","redirection"),sortable:!1},{name:"code",title:(0,Ot.__)("Code","redirection"),sortable:!1},{name:"group",title:(0,Ot.__)("Group","redirection"),sortable:!1},{name:"position",title:(0,Ot.__)("Pos","redirection")},{name:"last_count",title:(0,Ot.__)("Hits","redirection")},{name:"last_access",title:(0,Ot.__)("Last Access","redirection")}].filter(e=>function(e,t){return-1!==t.displaySelected.indexOf(e)}(e.name,l)),validateDisplay:qb};return(0,Ur.jsxs)("div",{className:"redirects",children:[u&&xv(_v)&&(0,Ur.jsx)(wb,{defaultFlags:i,addTop:!0}),(0,Ur.jsx)(vv,{logOptions:f,logActions:{...e,onGroup:t=>{e.onFilter(parseInt(t,10)>0?{...l.filterBy,group:t}:{})},onFilter:t=>{e.onFilter({...t,...l.filterBy.group?{group:l.filterBy.group}:{}})}},table:{...l,groupBy:l.filterBy.group?l.filterBy.group:0},status:a,total:s,rows:c,saving:d,getRow:(e,t)=>function(e,t,n,r,o){const{last_access:i,hits:a,position:s,match_type:l,action_type:c,action_code:u,action_data:d}=e,{rowMode:p,setRowMode:f}=t;return"edit"===p?(0,Ur.jsx)(Vx,{item:e,onCancel:()=>f(!1)}):[{name:"status",content:(0,Ur.jsx)(Sb,{row:e})},{name:"source",content:(0,Ur.jsxs)(Ur.Fragment,{children:[(0,Ur.jsx)(Db,{row:e,table:t.table,filters:t.table.filterBy,defaultFlags:r}),"check"===p&&(0,Ur.jsx)(Qp,{onClose:()=>f(null),children:(0,Ur.jsx)(Mb,{url:st((h=e,"server"===h.match_type?h.action_data.server:document.location.origin),Ub(e.url)),desiredCode:u,desiredTarget:d})})]}),alwaysDisplay:!0},{name:"match_type",content:Lb(l,hr())},{name:"action_type",content:Lb(c,mr())},{name:"code",content:Ib(e)},{name:"group",content:(0,Ur.jsx)(Fb,{row:e,group:o})},{name:"position",content:new Intl.NumberFormat(window.Redirectioni10n.locale).format(s)},{name:"last_count",content:new Intl.NumberFormat(window.Redirectioni10n.locale).format(a)},{name:"last_access",content:i}];var h}(e,t,d.indexOf(e.id),i,n),getRowActions:(e,n)=>(0,Ur.jsx)(jb,{disabled:-1!==d.indexOf(e.id),row:e,onDelete:t,rowParams:n})}),p&&!u&&(0,Ur.jsx)(wb,{defaultFlags:i,addTop:!1})]})}),zb=function({page:e}){switch(e){case"support":return(0,Ur.jsx)(og,{});case"404s":return(0,Ur.jsx)(dy,{});case"log":return(0,Ur.jsx)(Wv,{});case"io":return(0,Ur.jsx)(fb,{});case"groups":return(0,Ur.jsx)(_b,{});case"options":return(0,Ur.jsx)(Mm,{});case"site":return(0,Ur.jsx)(Dg,{})}return(0,Ur.jsx)(Hb,{})},Gb=function(){return(0,Ur.jsxs)(If,{errors:"",details:Bf().concat(["Buster: 5.6.0 === "+Redirectioni10n.version]),type:"fixed",title:(0,Ot.__)("Cached Redirection detected","redirection"),links:Uf(),locale:"redirection",children:[(0,Ur.jsx)("p",{children:(0,Ot.__)("Please clear your browser cache and reload this page.","redirection")}),(0,Ur.jsxs)("p",{children:[(0,Ot.__)("If you are using a caching system such as Cloudflare then please read this: ","redirection"),(0,Ur.jsx)(zp,{url:"https://redirection.me/support/problems/cloudflare/",children:(0,Ot.__)("clearing your cache.","redirection")})]})]})},Vb=function(){const{update_notice:e=!1}=window.Redirectioni10n,t=le();return e&&xv("redirection_cap_option_manage")?(0,Ur.jsx)(Mf,{children:(0,Ur.jsxs)("p",{children:[Cf((0,Ot.sprintf)((0,Ot.__)("Version %s installed! Please read the {{url}}release notes{{/url}} for details.","redirection"),e),{url:(0,Ur.jsx)(zp,{url:"https://redirection.me/blog/redirection-version-"+e.replace(".","-")+"/"})})," ",(0,Ur.jsx)(Tp,{onClick:function(){t(Mh({update_notice:window.Redirectioni10n.update_notice})),window.Redirectioni10n.update_notice=!1},children:(0,Ot.__)("OK","redirection")})]})}):null},$b=()=>({type:gn}),Kb=Redirectioni10n?.caps?.pages||[];function Yb(){const e=le(),{errors:t,notices:n,databaseStatus:r,showDatabase:i,inProgress:a,pluginUpdate:s}=de(e=>({errors:e.message.errors,notices:e.message.notices,databaseStatus:e.settings.database.status,inProgress:e.settings.database.inProgress,showDatabase:e.settings.showDatabase,pluginUpdate:e.settings.values.plugin_update})),l=(0,o.useCallback)(()=>{e($b())},[e]),[c,u]=(0,o.useState)(Nn(Kb));if("5.6.0"!==Redirectioni10n.version)return(0,Ur.jsx)(Gb,{});if("need-install"===r||"finish-install"===r)return(0,Ur.jsx)(gm,{});const d="prompt"===s&&("need-update"===r||"finish-update"===r);return(0,Ur.jsx)(Lf,{renderCrash:Em,extra:{page:c},children:(0,Ur.jsxs)("div",{className:"wrap redirection",children:[d&&(0,Ur.jsx)(jm,{onShowUpgrade:()=>e({type:Ae}),showDatabase:i}),!a&&"finish-update"!==r&&!i&&(0,Ur.jsxs)(Sm,{page:c,setPage:u,onPageChange:l,allowedPages:Kb,baseUrl:"?page=redirection.php",defaultPage:"redirect",children:[(0,Ur.jsx)("h1",{className:"wp-heading-inline",children:{redirect:(0,Ot.__)("Redirections","redirection"),site:(0,Ot.__)("Site","redirection"),groups:(0,Ot.__)("Groups","redirection"),io:(0,Ot.__)("Import/Export","redirection"),log:(0,Ot.__)("Logs","redirection"),"404s":(0,Ot.__)("404 errors","redirection"),options:(0,Ot.__)("Options","redirection"),support:(0,Ot.__)("Support","redirection")}[c]}),"redirect"===c&&xv(_v)&&(0,Ur.jsx)("button",{type:"button",onClick:()=>e(zx(!0)),className:"page-title-action",children:(0,Ot.__)("Add New","redirection")}),(0,Ur.jsx)(Vb,{}),(0,Ur.jsx)($p,{onChangePage:function(t){var n;u(""===t?"redirect":t),"404s"===t?e((n=Cr().table,Xx(n))):"log"===t?e((e=>Zg(e))(Hn().table)):""===t?e((e=>Wx(e))(Fr().table)):"groups"===t&&e((e=>ry(e))(Ar().table))},currentPage:c,menu:[{name:(0,Ot.__)("Redirects","redirection"),value:""},{name:(0,Ot.__)("Groups","redirection"),value:"groups"},{name:(0,Ot.__)("Site","redirection"),value:"site"},{name:(0,Ot.__)("Log","redirection"),value:"log"},{name:(0,Ot.__)("404s","redirection"),value:"404s"},{name:(0,Ot.__)("Import/Export","redirection"),value:"io"},{name:(0,Ot.__)("Options","redirection"),value:"options"},{name:(0,Ot.__)("Support","redirection"),value:"support"}].filter(e=>yv(e.value)||""===e.value&&yv("redirect")),home:"redirect",urlBase:Redirectioni10n.pluginRoot}),(0,Ur.jsx)(If,{errors:t,onClear:()=>e($b()),renderDebug:qf,details:Bf(),links:Uf(),locale:"redirection",children:(0,Ur.jsx)(km,{})}),(0,Ur.jsx)(zb,{page:c}),(0,Ur.jsx)(ef,{notices:n,onClear:()=>e({type:vn}),snackBarViewText:(0,Ot.__)("View notice","redirection")})]})]})})}var Xb,Qb;try{new Intl.NumberFormat(window.Redirectioni10n.locale)}catch{window.Redirectioni10n.locale="en-US"}function Jb(){return(0,Ur.jsx)(ne,{store:Fn({settings:Ln(),log:Hn(),error:Cr(),io:{status:Fe,file:!1,lastImport:!1,exportData:!1,importingStatus:!1,exportStatus:!1,importers:Redirectioni10n&&Redirectioni10n.preload&&Redirectioni10n.preload.importers?Redirectioni10n.preload.importers:[]},group:Ar(),redirect:Fr(),message:{errors:[],notices:[],inProgress:0,saving:[]},info:{status:Me,maps:{},agents:{},http:!1,error:""}}),children:(0,Ur.jsx)(Yb,{})})}Ct.resetMiddlewares(),Ct.use(Ct.createRootURLMiddleware(null!==(Xb=window.Redirectioni10n?.api?.WP_API_root)&&void 0!==Xb?Xb:"/wp-json/")),Ct.use(Ct.createNonceMiddleware(null!==(Qb=window.Redirectioni10n?.api?.WP_API_nonce)&&void 0!==Qb?Qb:"")),document.querySelector("#react-ui")&&window.Redirectioni10n&&(function(){const e=document.getElementById("react-ui");e&&(0,r.H)(e).render((0,Ur.jsx)(Jb,{}))}(),window.redirection=window.Redirectioni10n.version)},2878:e=>{"use strict";e.exports=Function.prototype.call},2985:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},3492:(e,t,n)=>{"use strict";var r=n(4656);if(r)try{r([],"length")}catch(e){r=null}e.exports=r},3583:(e,t,n)=>{"use strict";var r=n(1777);e.exports=Function.prototype.bind||r},3721:(e,t,n)=>{"use strict";e.exports=n(8049)},4072:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,a){if(e===a)return!0;if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var s,l,c,u;if(Array.isArray(e)){if((s=e.length)!=a.length)return!1;for(l=s;0!==l--;)if(!i(e[l],a[l]))return!1;return!0}if(n&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!a.has(l.value[0]))return!1;for(u=e.entries();!(l=u.next()).done;)if(!i(l.value[1],a.get(l.value[0])))return!1;return!0}if(r&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!a.has(l.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((s=e.length)!=a.length)return!1;for(l=s;0!==l--;)if(e[l]!==a[l])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof a.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof a.toString)return e.toString()===a.toString();if((s=(c=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(l=s;0!==l--;)if(!Object.prototype.hasOwnProperty.call(a,c[l]))return!1;if(t&&e instanceof Element)return!1;for(l=s;0!==l--;)if(("_owner"!==c[l]&&"__v"!==c[l]&&"__o"!==c[l]||!e.$$typeof)&&!i(e[c[l]],a[c[l]]))return!1;return!0}return e!=e&&a!=a}e.exports=function(e,t){try{return i(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},4465:(e,t,n)=>{e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(2))&&r.__esModule?r:{default:r};t.default=o.default,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(e){var t=e.activeClassName,n=void 0===t?"":t,o=e.activeIndex,l=void 0===o?-1:o,c=e.activeStyle,u=e.autoEscape,d=e.caseSensitive,p=void 0!==d&&d,f=e.className,h=e.findChunks,m=e.highlightClassName,g=void 0===m?"":m,v=e.highlightStyle,x=void 0===v?{}:v,y=e.highlightTag,b=void 0===y?"mark":y,_=e.sanitize,w=e.searchWords,j=e.textToHighlight,S=e.unhighlightTag,k=void 0===S?"span":S,E=e.unhighlightClassName,C=void 0===E?"":E,O=e.unhighlightStyle,T=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["activeClassName","activeIndex","activeStyle","autoEscape","caseSensitive","className","findChunks","highlightClassName","highlightStyle","highlightTag","sanitize","searchWords","textToHighlight","unhighlightTag","unhighlightClassName","unhighlightStyle"]),R=(0,i.findAll)({autoEscape:u,caseSensitive:p,findChunks:h,sanitize:_,searchWords:w,textToHighlight:j}),P=b,A=-1,N="",D=void 0,I=(0,s.default)(function(e){var t={};for(var n in e)t[n.toLowerCase()]=e[n];return t});return(0,a.createElement)("span",r({className:f},T,{children:R.map(function(e,t){var r=j.substr(e.start,e.end-e.start);if(e.highlight){A++;var o;o="object"==typeof g?p?g[r]:(g=I(g))[r.toLowerCase()]:g;var i=A===+l;N=o+" "+(i?n:""),D=!0===i&&null!=c?Object.assign({},x,c):x;var s={children:r,className:N,key:t,style:D};return"string"!=typeof P&&(s.highlightIndex=A),(0,a.createElement)(P,s)}return(0,a.createElement)(k,{children:r,className:C,key:t,style:O})})}))};var o,i=n(3),a=n(4),s=(o=n(5))&&o.__esModule?o:{default:o};e.exports=t.default},function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"combineChunks",{enumerable:!0,get:function(){return r.combineChunks}}),Object.defineProperty(t,"fillInChunks",{enumerable:!0,get:function(){return r.fillInChunks}}),Object.defineProperty(t,"findAll",{enumerable:!0,get:function(){return r.findAll}}),Object.defineProperty(t,"findChunks",{enumerable:!0,get:function(){return r.findChunks}})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAll=function(e){var t=e.autoEscape,i=e.caseSensitive,a=void 0!==i&&i,s=e.findChunks,l=void 0===s?r:s,c=e.sanitize,u=e.searchWords,d=e.textToHighlight;return o({chunksToHighlight:n({chunks:l({autoEscape:t,caseSensitive:a,sanitize:c,searchWords:u,textToHighlight:d})}),totalLength:d?d.length:0})};var n=t.combineChunks=function(e){var t=e.chunks;return t.sort(function(e,t){return e.start-t.start}).reduce(function(e,t){if(0===e.length)return[t];var n=e.pop();if(t.start<=n.end){var r=Math.max(n.end,t.end);e.push({start:n.start,end:r})}else e.push(n,t);return e},[])},r=function(e){var t=e.autoEscape,n=e.caseSensitive,r=e.sanitize,o=void 0===r?i:r,a=e.searchWords,s=e.textToHighlight;return s=o(s),a.filter(function(e){return e}).reduce(function(e,r){r=o(r),t&&(r=r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"));for(var i=new RegExp(r,n?"g":"gi"),a=void 0;a=i.exec(s);){var l=a.index,c=i.lastIndex;c>l&&e.push({start:l,end:c}),a.index==i.lastIndex&&i.lastIndex++}return e},[])};t.findChunks=r;var o=t.fillInChunks=function(e){var t=e.chunksToHighlight,n=e.totalLength,r=[],o=function(e,t,n){t-e>0&&r.push({start:e,end:t,highlight:n})};if(0===t.length)o(0,n,!1);else{var i=0;t.forEach(function(e){o(i,e.start,!1),o(e.start,e.end,!0),i=e.end}),o(i,n,!1)}return r};function i(e){return e}}])},function(e,t){e.exports=n(1609)},function(e,t){"use strict";var n=function(e,t){return e===t};e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n,r=void 0,o=[],i=void 0,a=!1,s=function(e,n){return t(e,o[n])};return function(){for(var t=arguments.length,n=Array(t),l=0;l<t;l++)n[l]=arguments[l];return a&&r===this&&n.length===o.length&&n.every(s)?i:(a=!0,r=this,o=n,i=e.apply(this,n))}}}])},4585:e=>{"use strict";e.exports=URIError},4656:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},4922:(e,t,n)=>{var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,a=r&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&l&&"function"==typeof l.get?l.get:null,u=s&&Set.prototype.forEach,d="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,f="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,v=String.prototype.match,x=String.prototype.slice,y=String.prototype.replace,b=String.prototype.toUpperCase,_=String.prototype.toLowerCase,w=RegExp.prototype.test,j=Array.prototype.concat,S=Array.prototype.join,k=Array.prototype.slice,E=Math.floor,C="function"==typeof BigInt?BigInt.prototype.valueOf:null,O=Object.getOwnPropertySymbols,T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,R="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,A=Object.prototype.propertyIsEnumerable,N=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function D(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||w.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-E(-e):E(e);if(r!==e){var o=String(r),i=x.call(t,o.length+1);return y.call(o,n,"$&_")+"."+y.call(y.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(t,n,"$&_")}var I=n(2179),F=I.custom,L=G(F)?F:null,M={__proto__:null,double:'"',single:"'"},U={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function B(e,t,n){var r=n.quoteStyle||t,o=M[r];return o+e+o}function q(e){return y.call(String(e),/"/g,""")}function W(e){return!P||!("object"==typeof e&&(P in e||void 0!==e[P]))}function H(e){return"[object Array]"===K(e)&&W(e)}function z(e){return"[object RegExp]"===K(e)&&W(e)}function G(e){if(R)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!T)return!1;try{return T.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,o,s){var l=r||{};if($(l,"quoteStyle")&&!$(M,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if($(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!$(l,"customInspect")||l.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if($(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if($(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var b=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return X(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return b?D(t,w):w}if("bigint"==typeof t){var E=String(t)+"n";return b?D(t,E):E}var O=void 0===l.depth?5:l.depth;if(void 0===o&&(o=0),o>=O&&O>0&&"object"==typeof t)return H(t)?"[Array]":"[Object]";var F,U=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=S.call(Array(e.indent+1)," ")}return{base:n,prev:S.call(Array(t+1),n)}}(l,o);if(void 0===s)s=[];else if(Y(s,t)>=0)return"[Circular]";function V(t,n,r){if(n&&(s=k.call(s)).push(n),r){var i={depth:l.depth};return $(l,"quoteStyle")&&(i.quoteStyle=l.quoteStyle),e(t,i,o+1,s)}return e(t,l,o+1,s)}if("function"==typeof t&&!z(t)){var Q=function(e){if(e.name)return e.name;var t=v.call(g.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),re=ne(t,V);return"[Function"+(Q?": "+Q:" (anonymous)")+"]"+(re.length>0?" { "+S.call(re,", ")+" }":"")}if(G(t)){var oe=R?y.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):T.call(t);return"object"!=typeof t||R?oe:J(oe)}if((F=t)&&"object"==typeof F&&("undefined"!=typeof HTMLElement&&F instanceof HTMLElement||"string"==typeof F.nodeName&&"function"==typeof F.getAttribute)){for(var ie="<"+_.call(String(t.nodeName)),ae=t.attributes||[],se=0;se<ae.length;se++)ie+=" "+ae[se].name+"="+B(q(ae[se].value),"double",l);return ie+=">",t.childNodes&&t.childNodes.length&&(ie+="..."),ie+"</"+_.call(String(t.nodeName))+">"}if(H(t)){if(0===t.length)return"[]";var le=ne(t,V);return U&&!function(e){for(var t=0;t<e.length;t++)if(Y(e[t],"\n")>=0)return!1;return!0}(le)?"["+te(le,U)+"]":"[ "+S.call(le,", ")+" ]"}if(function(e){return"[object Error]"===K(e)&&W(e)}(t)){var ce=ne(t,V);return"cause"in Error.prototype||!("cause"in t)||A.call(t,"cause")?0===ce.length?"["+String(t)+"]":"{ ["+String(t)+"] "+S.call(ce,", ")+" }":"{ ["+String(t)+"] "+S.call(j.call("[cause]: "+V(t.cause),ce),", ")+" }"}if("object"==typeof t&&m){if(L&&"function"==typeof t[L]&&I)return I(t,{depth:O-o});if("symbol"!==m&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ue=[];return a&&a.call(t,function(e,n){ue.push(V(n,t,!0)+" => "+V(e,t))}),ee("Map",i.call(t),ue,U)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var de=[];return u&&u.call(t,function(e){de.push(V(e,t))}),ee("Set",c.call(t),de,U)}if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Z("WeakMap");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Z("WeakSet");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{return f.call(e),!0}catch(e){}return!1}(t))return Z("WeakRef");if(function(e){return"[object Number]"===K(e)&&W(e)}(t))return J(V(Number(t)));if(function(e){if(!e||"object"!=typeof e||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}(t))return J(V(C.call(t)));if(function(e){return"[object Boolean]"===K(e)&&W(e)}(t))return J(h.call(t));if(function(e){return"[object String]"===K(e)&&W(e)}(t))return J(V(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==n.g&&t===n.g)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===K(e)&&W(e)}(t)&&!z(t)){var pe=ne(t,V),fe=N?N(t)===Object.prototype:t instanceof Object||t.constructor===Object,he=t instanceof Object?"":"null prototype",me=!fe&&P&&Object(t)===t&&P in t?x.call(K(t),8,-1):he?"Object":"",ge=(fe||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(me||he?"["+S.call(j.call([],me||[],he||[]),": ")+"] ":"");return 0===pe.length?ge+"{}":U?ge+"{"+te(pe,U)+"}":ge+"{ "+S.call(pe,", ")+" }"}return String(t)};var V=Object.prototype.hasOwnProperty||function(e){return e in this};function $(e,t){return V.call(e,t)}function K(e){return m.call(e)}function Y(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function X(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return X(x.call(e,0,t.maxStringLength),t)+r}var o=U[t.quoteStyle||"single"];return o.lastIndex=0,B(y.call(y.call(e,o,"\\$1"),/[\x00-\x1f]/g,Q),"single",t)}function Q(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+b.call(t.toString(16))}function J(e){return"Object("+e+")"}function Z(e){return e+" { ? }"}function ee(e,t,n,r){return e+" ("+t+") {"+(r?te(n,r):S.call(n,", "))+"}"}function te(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+S.call(e,","+n)+"\n"+t.prev}function ne(e,t){var n=H(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=$(e,o)?t(e[o],e):""}var i,a="function"==typeof O?O(e):[];if(R){i={};for(var s=0;s<a.length;s++)i["$"+a[s]]=a[s]}for(var l in e)$(e,l)&&(n&&String(Number(l))===l&&l<e.length||R&&i["$"+l]instanceof Symbol||(w.call(/[^\w$]/,l)?r.push(t(l,e)+": "+t(e[l],e)):r.push(l+": "+t(e[l],e))));if("function"==typeof O)for(var c=0;c<a.length;c++)A.call(e,a[c])&&r.push("["+t(a[c])+"]: "+t(e[a[c]],e));return r}},5004:(e,t,n)=>{"use strict";var r=n(6833),o=n(5167),i=n(6260);e.exports={formats:i,parse:o,stringify:r}},5167:(e,t,n)=>{"use strict";var r=n(6693),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},s=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},l=function(e,t,n){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},c=function(e,t,n,i){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,c=n.depth>0&&/(\[[^[\]]*])/.exec(a),u=c?a.slice(0,c.index):a,d=[];if(u){if(!n.plainObjects&&o.call(Object.prototype,u)&&!n.allowPrototypes)return;d.push(u)}for(var p=0;n.depth>0&&null!==(c=s.exec(a))&&p<n.depth;){if(p+=1,!n.plainObjects&&o.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;d.push(c[1])}if(c){if(!0===n.strictDepth)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");d.push("["+a.slice(c.index)+"]")}return function(e,t,n,o){var i=0;if(e.length>0&&"[]"===e[e.length-1]){var a=e.slice(0,-1).join("");i=Array.isArray(t)&&t[a]?t[a].length:0}for(var s=o?t:l(t,n,i),c=e.length-1;c>=0;--c){var u,d=e[c];if("[]"===d&&n.parseArrays)u=n.allowEmptyArrays&&(""===s||n.strictNullHandling&&null===s)?[]:r.combine([],s);else{u=n.plainObjects?{__proto__:null}:{};var p="["===d.charAt(0)&&"]"===d.charAt(d.length-1)?d.slice(1,-1):d,f=n.decodeDotInKeys?p.replace(/%2E/g,"."):p,h=parseInt(f,10);n.parseArrays||""!==f?!isNaN(h)&&d!==f&&String(h)===f&&h>=0&&n.parseArrays&&h<=n.arrayLimit?(u=[])[h]=s:"__proto__"!==f&&(u[f]=s):u={0:s}}s=u}return s}(d,t,n,i)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?a.charset:e.charset,n=void 0===e.duplicates?a.duplicates:e.duplicates;if("combine"!==n&&"first"!==n&&"last"!==n)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||a.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:a.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,duplicates:n,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:a.strictDepth,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}}(t);if(""===e||null==e)return n.plainObjects?{__proto__:null}:{};for(var u="string"==typeof e?function(e,t){var n={__proto__:null},c=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;c=c.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u=t.parameterLimit===1/0?void 0:t.parameterLimit,d=c.split(t.delimiter,t.throwOnLimitExceeded?u+1:u);if(t.throwOnLimitExceeded&&d.length>u)throw new RangeError("Parameter limit exceeded. Only "+u+" parameter"+(1===u?"":"s")+" allowed.");var p,f=-1,h=t.charset;if(t.charsetSentinel)for(p=0;p<d.length;++p)0===d[p].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[p]?h="utf-8":"utf8=%26%2310003%3B"===d[p]&&(h="iso-8859-1"),f=p,p=d.length);for(p=0;p<d.length;++p)if(p!==f){var m,g,v=d[p],x=v.indexOf("]="),y=-1===x?v.indexOf("="):x+1;-1===y?(m=t.decoder(v,a.decoder,h,"key"),g=t.strictNullHandling?null:""):(m=t.decoder(v.slice(0,y),a.decoder,h,"key"),g=r.maybeMap(l(v.slice(y+1),t,i(n[m])?n[m].length:0),function(e){return t.decoder(e,a.decoder,h,"value")})),g&&t.interpretNumericEntities&&"iso-8859-1"===h&&(g=s(String(g))),v.indexOf("[]=")>-1&&(g=i(g)?[g]:g);var b=o.call(n,m);b&&"combine"===t.duplicates?n[m]=r.combine(n[m],g):b&&"last"!==t.duplicates||(n[m]=g)}return n}(e,n):e,d=n.plainObjects?{__proto__:null}:{},p=Object.keys(u),f=0;f<p.length;++f){var h=p[f],m=c(h,u[h],n,"string"==typeof e);d=r.merge(d,m,n)}return!0===n.allowSparse?d:r.compact(d)}},5298:(e,t,n)=>{"use strict";var r=n(703),o=n(5312),i=o([r("%String.prototype.indexOf%")]);e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?o([n]):n}},5312:(e,t,n)=>{"use strict";var r=n(3583),o=n(7379),i=n(2878),a=n(5674);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return a(r,i,e)}},5518:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},5556:(e,t,n)=>{e.exports=n(2694)()},5674:(e,t,n)=>{"use strict";var r=n(3583),o=n(1948),i=n(2878),a=n(741);e.exports=a||r.call(i,o)},5717:(e,t,n)=>{"use strict";var r=n(7379),o=n(4922),i=n(9552),a=n(1085),s=n(2468)||a||i;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new r("Side channel does not contain "+o(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||(e=s()),e.set(t,n)}};return t}},5738:(e,t,n)=>{"use strict";var r=n(5518);e.exports=function(e){return r(e)||0===e?e:e<0?-1:1}},5795:e=>{"use strict";e.exports=window.ReactDOM},5846:function(e,t,n){var r;e=n.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof n.g&&n.g;o.global!==o&&o.window!==o&&o.self;var i,a=2147483647,s=36,l=/^xn--/,c=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,f=String.fromCharCode;function h(e){throw new RangeError(d[e])}function m(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function g(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+m((e=e.replace(u,".")).split("."),t).join(".")}function v(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function x(e){return m(e,function(e){var t="";return e>65535&&(t+=f((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+f(e)}).join("")}function y(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:s}function b(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,n){var r=0;for(e=n?p(e/700):e>>1,e+=p(e/t);e>455;r+=s)e=p(e/35);return p(r+36*e/(e+38))}function w(e){var t,n,r,o,i,l,c,u,d,f,m=[],g=e.length,v=0,b=128,w=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&h("not-basic"),m.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<g;){for(i=v,l=1,c=s;o>=g&&h("invalid-input"),((u=y(e.charCodeAt(o++)))>=s||u>p((a-v)/l))&&h("overflow"),v+=u*l,!(u<(d=c<=w?1:c>=w+26?26:c-w));c+=s)l>p(a/(f=s-d))&&h("overflow"),l*=f;w=_(v-i,t=m.length+1,0==i),p(v/t)>a-b&&h("overflow"),b+=p(v/t),v%=t,m.splice(v++,0,b)}return x(m)}function j(e){var t,n,r,o,i,l,c,u,d,m,g,x,y,w,j,S=[];for(x=(e=v(e)).length,t=128,n=0,i=72,l=0;l<x;++l)(g=e[l])<128&&S.push(f(g));for(r=o=S.length,o&&S.push("-");r<x;){for(c=a,l=0;l<x;++l)(g=e[l])>=t&&g<c&&(c=g);for(c-t>p((a-n)/(y=r+1))&&h("overflow"),n+=(c-t)*y,t=c,l=0;l<x;++l)if((g=e[l])<t&&++n>a&&h("overflow"),g==t){for(u=n,d=s;!(u<(m=d<=i?1:d>=i+26?26:d-i));d+=s)j=u-m,w=s-m,S.push(f(b(m+j%w,0))),u=p(j/w);S.push(f(b(u,0))),i=_(n,y,r==o),n=0,++r}++n,++t}return S.join("")}i={version:"1.4.1",ucs2:{decode:v,encode:x},decode:w,encode:j,toASCII:function(e){return g(e,function(e){return c.test(e)?"xn--"+j(e):e})},toUnicode:function(e){return g(e,function(e){return l.test(e)?w(e.slice(4).toLowerCase()):e})}},void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},5985:e=>{"use strict";e.exports=Math.pow},6186:(e,t,n)=>{"use strict";var r=n(2985);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},6260:e=>{"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC3986";e.exports={default:r,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:r}},6693:(e,t,n)=>{"use strict";var r=n(6260),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},l=1024;e.exports={arrayToObject:s,assign:function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],a=o.obj[o.prop],s=Object.keys(a),l=0;l<s.length;++l){var c=s[l],u=a[c];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:a,prop:c}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,o,i){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(e)),"iso-8859-1"===n)return escape(s).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var c="",u=0;u<s.length;u+=l){for(var d=s.length>=l?s.slice(u,u+l):s,p=[],f=0;f<d.length;++f){var h=d.charCodeAt(f);45===h||46===h||95===h||126===h||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||i===r.RFC1738&&(40===h||41===h)?p[p.length]=d.charAt(f):h<128?p[p.length]=a[h]:h<2048?p[p.length]=a[192|h>>6]+a[128|63&h]:h<55296||h>=57344?p[p.length]=a[224|h>>12]+a[128|h>>6&63]+a[128|63&h]:(f+=1,h=65536+((1023&h)<<10|1023&d.charCodeAt(f)),p[p.length]=a[240|h>>18]+a[128|h>>12&63]+a[128|h>>6&63]+a[128|63&h])}c+=p.join("")}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n&&"function"!=typeof n){if(i(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var a=t;return i(t)&&!i(n)&&(a=s(t,r)),i(t)&&i(n)?(n.forEach(function(n,i){if(o.call(t,i)){var a=t[i];a&&"object"==typeof a&&n&&"object"==typeof n?t[i]=e(a,n,r):t.push(n)}else t[i]=n}),t):Object.keys(n).reduce(function(t,i){var a=n[i];return o.call(t,i)?t[i]=e(t[i],a,r):t[i]=a,t},a)}}},6833:(e,t,n)=>{"use strict";var r=n(5717),o=n(6693),i=n(6260),a=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,l(t)?t:[t])},d=Date.prototype.toISOString,p=i.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:p,formatter:i.formatters[p],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},h={},m=function e(t,n,i,a,s,c,d,p,m,g,v,x,y,b,_,w,j,S){for(var k,E=t,C=S,O=0,T=!1;void 0!==(C=C.get(h))&&!T;){var R=C.get(t);if(O+=1,void 0!==R){if(R===O)throw new RangeError("Cyclic object value");T=!0}void 0===C.get(h)&&(O=0)}if("function"==typeof g?E=g(n,E):E instanceof Date?E=y(E):"comma"===i&&l(E)&&(E=o.maybeMap(E,function(e){return e instanceof Date?y(e):e})),null===E){if(c)return m&&!w?m(n,f.encoder,j,"key",b):n;E=""}if("string"==typeof(k=E)||"number"==typeof k||"boolean"==typeof k||"symbol"==typeof k||"bigint"==typeof k||o.isBuffer(E))return m?[_(w?n:m(n,f.encoder,j,"key",b))+"="+_(m(E,f.encoder,j,"value",b))]:[_(n)+"="+_(String(E))];var P,A=[];if(void 0===E)return A;if("comma"===i&&l(E))w&&m&&(E=o.maybeMap(E,m)),P=[{value:E.length>0?E.join(",")||null:void 0}];else if(l(g))P=g;else{var N=Object.keys(E);P=v?N.sort(v):N}var D=p?String(n).replace(/\./g,"%2E"):String(n),I=a&&l(E)&&1===E.length?D+"[]":D;if(s&&l(E)&&0===E.length)return I+"[]";for(var F=0;F<P.length;++F){var L=P[F],M="object"==typeof L&&L&&void 0!==L.value?L.value:E[L];if(!d||null!==M){var U=x&&p?String(L).replace(/\./g,"%2E"):String(L),B=l(E)?"function"==typeof i?i(I,U):I:I+(x?"."+U:"["+U+"]");S.set(t,O);var q=r();q.set(h,S),u(A,e(M,B,i,a,s,c,d,p,"comma"===i&&w&&l(E)?null:m,g,v,x,y,b,_,w,j,q))}}return A};e.exports=function(e,t){var n,o=e,c=function(e){if(!e)return f;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||f.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==e.format){if(!a.call(i.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r,o=i.formatters[n],c=f.filter;if(("function"==typeof e.filter||l(e.filter))&&(c=e.filter),r=e.arrayFormat in s?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":f.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===e.allowDots?!0===e.encodeDotInKeys||f.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:f.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:r,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:f.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?f.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:f.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:f.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:f.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:f.encodeValuesOnly,filter:c,format:n,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:f.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:f.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:f.strictNullHandling}}(t);"function"==typeof c.filter?o=(0,c.filter)("",o):l(c.filter)&&(n=c.filter);var d=[];if("object"!=typeof o||null===o)return"";var p=s[c.arrayFormat],h="comma"===p&&c.commaRoundTrip;n||(n=Object.keys(o)),c.sort&&n.sort(c.sort);for(var g=r(),v=0;v<n.length;++v){var x=n[v],y=o[x];c.skipNulls&&null===y||u(d,m(y,x,p,h,c.allowEmptyArrays,c.strictNullHandling,c.skipNulls,c.encodeDotInKeys,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,g))}var b=d.join(c.delimiter),_=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),b.length>0?_+b:""}},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},7379:e=>{"use strict";e.exports=TypeError},7388:e=>{"use strict";e.exports=SyntaxError},7500:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=a(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=a(t,n));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},7533:(e,t,n)=>{"use strict";var r=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=n(3583);e.exports=i.call(r,o)},7570:e=>{"use strict";e.exports=RangeError},7657:(e,t,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(8123);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},8049:(e,t,n)=>{"use strict";var r=n(1609),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useSyncExternalStore,a=r.useRef,s=r.useEffect,l=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=a(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=l(function(){function e(e){if(!s){if(s=!0,i=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return a=t}return a=e}if(t=a,o(i,e))return t;var n=r(e);return void 0!==u&&u(t,n)?(i=e,t):(i=e,a=n)}var i,a,s=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,n,r,u]);var f=i(e,d[0],d[1]);return s(function(){p.hasValue=!0,p.value=f},[f]),c(f),f}},8123:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var r in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},8639:e=>{"use strict";e.exports=Math.round},8819:(e,t,n)=>{"use strict";var r=n(2410);e.exports=r.getPrototypeOf||null},9173:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},9183:e=>{"use strict";e.exports=Error},9552:(e,t,n)=>{"use strict";var r=n(4922),o=n(7379),i=function(e,t,n){for(var r,o=e;null!=(r=o.next);o=r)if(r.key===t)return o.next=r.next,n||(r.next=e.next,e.next=r),r};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new o("Side channel does not contain "+r(e))},delete:function(t){var n=e&&e.next,r=function(e,t){if(e)return i(e,t,!0)}(e,t);return r&&n&&n===r&&(e=void 0),!!r},get:function(t){return function(e,t){if(e){var n=i(e,t);return n&&n.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!i(e,t)}(e,t)},set:function(t,n){e||(e={next:void 0}),function(e,t,n){var r=i(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(e,t,n)}};return t}},9576:(e,t,n)=>{"use strict";var r=n(5795);t.H=r.createRoot,r.hydrateRoot},9895:e=>{"use strict";e.exports=Math.abs},9898:e=>{"use strict";e.exports=ReferenceError}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return r[e].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}i.m=r,e=[],i.O=(t,n,r,o)=>{if(!n){var a=1/0;for(u=0;u<e.length;u++){for(var[n,r,o]=e[u],s=!0,l=0;l<n.length;l++)(!1&o||a>=o)&&Object.keys(i.O).every(e=>i.O[e](n[l]))?n.splice(l--,1):(s=!1,o<a&&(a=o));if(s){e.splice(u--,1);var c=r();void 0!==c&&(t=c)}}return t}o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,r,o]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);i.r(o);var a={};t=t||[null,n({}),n([]),n(n)];for(var s=2&r&&e;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=n(s))Object.getOwnPropertyNames(s).forEach(t=>a[t]=()=>e[t]);return a.default=()=>e,i.d(o,a),o},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e={57:0,350:0};i.O.j=t=>0===e[t];var t=(t,n)=>{var r,o,[a,s,l]=n,c=0;if(a.some(t=>0!==e[t])){for(r in s)i.o(s,r)&&(i.m[r]=s[r]);if(l)var u=l(i)}for(t&&t(n);c<a.length;c++)o=a[c],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return i.O(u)},n=globalThis.webpackChunkredirection=globalThis.webpackChunkredirection||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var a=i.O(void 0,[350],()=>i(2822));a=i.O(a)})();
Save
Cancel