From b4a0790aa4cc84216907076182b50dd7bdfc000b Mon Sep 17 00:00:00 2001 From: Debatty-Tom <145542891+Debatty-Tom@users.noreply.github.com> Date: Wed, 8 Oct 2025 09:27:09 +0200 Subject: [PATCH 1/6] Added csp option on default script tag --- config/cookieconsent.php | 13 +++++++++++++ src/CookiesManager.php | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/config/cookieconsent.php b/config/cookieconsent.php index d22ea2a..56d644d 100644 --- a/config/cookieconsent.php +++ b/config/cookieconsent.php @@ -55,6 +55,19 @@ 'policy' => null, + /* + |-------------------------------------------------------------------------- + | CSP configuration + |-------------------------------------------------------------------------- + | + | Most cookie notices display a link to a dedicated page explaining + | the extended cookies usage policy. If your application has such a page + | you can add its route name here. + | + */ + + 'csp_enable' => env('CSP_ENABLE', false), + /* Google Analytics configuration |-------------------------------------------------------------------------- | diff --git a/src/CookiesManager.php b/src/CookiesManager.php index 58b387c..940f275 100644 --- a/src/CookiesManager.php +++ b/src/CookiesManager.php @@ -4,6 +4,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Cookie as CookieFacade; +use Illuminate\Support\Str; use Symfony\Component\HttpFoundation\Cookie as CookieComponent; class CookiesManager @@ -198,11 +199,28 @@ protected function getConsentedScripts(bool $withDefault): string protected function getDefaultScriptTag(): string { + $csp_enable = config('cookieconsent.csp_enable', false); + + if ($csp_enable) { + return ''; + } + return ''; + + } + + protected function generateCspNonce(): string + { + return Str::random(32); } /** From 6efe10dc4788901383775f71cd37b3be65f66d74 Mon Sep 17 00:00:00 2001 From: Debatty-Tom <145542891+Debatty-Tom@users.noreply.github.com> Date: Wed, 8 Oct 2025 16:33:29 +0200 Subject: [PATCH 2/6] Refactor return script and add some complexity to the nonce --- src/CookiesManager.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/CookiesManager.php b/src/CookiesManager.php index 940f275..73e1e71 100644 --- a/src/CookiesManager.php +++ b/src/CookiesManager.php @@ -201,26 +201,17 @@ protected function getDefaultScriptTag(): string { $csp_enable = config('cookieconsent.csp_enable', false); - if ($csp_enable) { - return ''; - } - return ''; - } protected function generateCspNonce(): string { - return Str::random(32); + return bin2hex(random_bytes(16)); } /** From c902ac4d3de469307b815c58336116c66936f65e Mon Sep 17 00:00:00 2001 From: Debatty-Tom <145542891+Debatty-Tom@users.noreply.github.com> Date: Mon, 20 Oct 2025 16:30:29 +0200 Subject: [PATCH 3/6] fix using csp nonce by passing it from the view to the default script tag and added explanations in the readme --- README.md | 23 +++++++++++++++++++++++ config/cookieconsent.php | 13 ------------- src/CookiesManager.php | 27 ++++++++++----------------- src/ServiceProvider.php | 3 +-- 4 files changed, 34 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 76d1423..3774d80 100644 --- a/README.md +++ b/README.md @@ -439,6 +439,29 @@ $factors['years'] = [365, 'dayz']; More information on CarbonInterval's gotchas in [Constantin's blog post on chasingcode.dev](https://chasingcode.dev/blog/carbon-php-practical-examples/). +### Content Security Policy + +This package supports CSP nonces for secure script loading. Pass your nonce to the @cookieconsentscripts directive: + +```blade +{{-- Basic usage with nonce --}} +@cookieconsentscripts($yourNonce) + +{{-- Example with Spatie Laravel CSP --}} +@cookieconsentscripts(app('csp-nonce')) + +{{-- Without CSP --}} +@cookieconsentscripts +``` + +How It Works + +When you provide a nonce, it's added to the script tag: + +```html + +``` + ### Let your users change their mind Users should be able to change their consent settings at any time. No worries, with this package it is quite simple to achieve: generate a button that will reset the user's cookies and show the consent modal again. diff --git a/config/cookieconsent.php b/config/cookieconsent.php index 56d644d..d22ea2a 100644 --- a/config/cookieconsent.php +++ b/config/cookieconsent.php @@ -55,19 +55,6 @@ 'policy' => null, - /* - |-------------------------------------------------------------------------- - | CSP configuration - |-------------------------------------------------------------------------- - | - | Most cookie notices display a link to a dedicated page explaining - | the extended cookies usage policy. If your application has such a page - | you can add its route name here. - | - */ - - 'csp_enable' => env('CSP_ENABLE', false), - /* Google Analytics configuration |-------------------------------------------------------------------------- | diff --git a/src/CookiesManager.php b/src/CookiesManager.php index 73e1e71..e38ca6f 100644 --- a/src/CookiesManager.php +++ b/src/CookiesManager.php @@ -168,11 +168,11 @@ protected function makeConsentCookie(): CookieComponent /** * Output all the scripts for current consent state. */ - public function renderScripts(bool $withDefault = true): string + public function renderScripts(bool $withDefault = true, ?string $nonce = null): string { $output = $this->shouldDisplayNotice() - ? $this->getNoticeScripts($withDefault) - : $this->getConsentedScripts($withDefault); + ? $this->getNoticeScripts($withDefault, $nonce) + : $this->getConsentedScripts($withDefault, $nonce); if(strlen($output)) { $output = '' . $output; @@ -181,14 +181,14 @@ public function renderScripts(bool $withDefault = true): string return $output; } - public function getNoticeScripts(bool $withDefault): string + public function getNoticeScripts(bool $withDefault, ?string $nonce = null): string { - return $withDefault ? $this->getDefaultScriptTag() : ''; + return $withDefault ? $this->getDefaultScriptTag($nonce) : ''; } - protected function getConsentedScripts(bool $withDefault): string + protected function getConsentedScripts(bool $withDefault, ?string $nonce = null): string { - $output = $this->getNoticeScripts($withDefault); + $output = $this->getNoticeScripts($withDefault, $nonce); foreach ($this->getConsentResponse()->getResponseScripts() ?? [] as $tag) { $output .= $tag; @@ -197,23 +197,16 @@ protected function getConsentedScripts(bool $withDefault): string return $output; } - protected function getDefaultScriptTag(): string + protected function getDefaultScriptTag(?string $nonce = null): string { - $csp_enable = config('cookieconsent.csp_enable', false); - return ''; } - protected function generateCspNonce(): string - { - return bin2hex(random_bytes(16)); - } - /** * Output the consent alert/modal for current consent state. */ diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index c8fd666..5c68730 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -64,9 +64,8 @@ public function boot() protected function registerBladeDirectives() { Blade::directive('cookieconsentscripts', function (string $expression) { - return ''; + return ''; }); - Blade::directive('cookieconsentview', function (string $expression) { return ''; }); From 2fbc9dfd31b99a2ea13c0ae3bcdf6578e514edc5 Mon Sep 17 00:00:00 2001 From: Debatty-Tom <145542891+Debatty-Tom@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:08:26 +0200 Subject: [PATCH 4/6] Removed unused import --- src/CookiesManager.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CookiesManager.php b/src/CookiesManager.php index e38ca6f..c0b3c0f 100644 --- a/src/CookiesManager.php +++ b/src/CookiesManager.php @@ -4,7 +4,6 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Cookie as CookieFacade; -use Illuminate\Support\Str; use Symfony\Component\HttpFoundation\Cookie as CookieComponent; class CookiesManager From 0def8727cf54f2c3f47a81c56c4750ae3d447d8d Mon Sep 17 00:00:00 2001 From: Debatty-Tom <145542891+Debatty-Tom@users.noreply.github.com> Date: Fri, 14 Nov 2025 11:53:33 +0100 Subject: [PATCH 5/6] fix parameters for blade directive --- dist/cookies.js | 4 ++-- dist/mix-manifest.json | 2 +- dist/script.js | 2 +- src/CookiesManager.php | 16 ++++++++-------- src/ServiceProvider.php | 4 +++- webpack.mix.js | 2 +- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/dist/cookies.js b/dist/cookies.js index 1815cd6..cc2e469 100644 --- a/dist/cookies.js +++ b/dist/cookies.js @@ -1,2 +1,2 @@ -/*! For license information please see cookies.js.LICENSE.txt */ -(()=>{var t={251:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<>1,f=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=c}return(p?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,u,c=8*i-o-1,f=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&a,p+=d,a/=256,o-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},287:(t,e,r)=>{"use strict";var n=r(526),o=r(251),i=r(634);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return q(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return _(this,e,r);case"latin1":case"binary":return U(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:w(t,e,r,n,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):w(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,o){var i,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var f=-1;for(i=r;ia&&(r=a-u),i=r;i>=0;i--){for(var l=!0,h=0;ho&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:c>223?3:c>191?2:1;if(o+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(f=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=l}return function(t){var e=t.length;if(e<=P)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(i,s),c=this.slice(n,o),f=t.slice(e,r),l=0;lo)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":return E(this,t,e,r);case"latin1":case"binary":return R(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;on)&&(r=n);for(var o="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function j(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o>>8*(n?o:1-o)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o>>8*(n?o:3-o)&255}function k(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return i||k(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,i){return i||k(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUInt8=function(t,e){return e||x(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||x(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||x(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||x(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||x(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||x(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||x(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);L(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function Y(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}},526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=a(t),s=i[0],u=i[1],c=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,u)),f=0,l=u>0?s-4:s;for(r=0;r>16&255,c[f++]=e>>8&255,c[f++]=255&e;2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e);1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,a=0,c=n-o;ac?c:a+s));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var o,i,s=[],a=e;a>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},606:t=>{var e,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(t){r=i}}();var a,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&h())}function h(){if(!c){var t=s(l);c=!0;for(var e=u.length;e;){for(a=u,u=[];++f1)for(var r=1;r{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t={};function e(t,e){return function(){return t.apply(e,arguments)}}r.r(t),r.d(t,{hasBrowserEnv:()=>ft,hasStandardBrowserEnv:()=>ht,hasStandardBrowserWebWorkerEnv:()=>pt,navigator:()=>lt,origin:()=>dt});var n=r(606);const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,s=(a=Object.create(null),t=>{const e=o.call(t);return a[e]||(a[e]=e.slice(8,-1).toLowerCase())});var a;const u=t=>(t=t.toLowerCase(),e=>s(e)===t),c=t=>e=>typeof e===t,{isArray:f}=Array,l=c("undefined");const h=u("ArrayBuffer");const p=c("string"),d=c("function"),y=c("number"),g=t=>null!==t&&"object"==typeof t,m=t=>{if("object"!==s(t))return!1;const e=i(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},w=u("Date"),b=u("File"),v=u("Blob"),E=u("FileList"),R=u("URLSearchParams"),[A,S,T,O]=["ReadableStream","Request","Response","Headers"].map(u);function P(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),f(t))for(n=0,o=t.length;n0;)if(n=r[o],e===n.toLowerCase())return n;return null}const U="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,C=t=>!l(t)&&t!==U;const B=(x="undefined"!=typeof Uint8Array&&i(Uint8Array),t=>x&&t instanceof x);var x;const L=u("HTMLFormElement"),j=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),N=u("RegExp"),k=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};P(r,((r,o)=>{let i;!1!==(i=e(r,o,t))&&(n[o]=i||r)})),Object.defineProperties(t,n)};const D=u("AsyncFunction"),F=(I="function"==typeof setImmediate,M=d(U.postMessage),I?setImmediate:M?(q=`axios@${Math.random()}`,Y=[],U.addEventListener("message",(({source:t,data:e})=>{t===U&&e===q&&Y.length&&Y.shift()()}),!1),t=>{Y.push(t),U.postMessage(q,"*")}):t=>setTimeout(t));var I,M,q,Y;const z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(U):void 0!==n&&n.nextTick||F,H={isArray:f,isArrayBuffer:h,isBuffer:function(t){return null!==t&&!l(t)&&null!==t.constructor&&!l(t.constructor)&&d(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||d(t.append)&&("formdata"===(e=s(t))||"object"===e&&d(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&h(t.buffer),e},isString:p,isNumber:y,isBoolean:t=>!0===t||!1===t,isObject:g,isPlainObject:m,isReadableStream:A,isRequest:S,isResponse:T,isHeaders:O,isUndefined:l,isDate:w,isFile:b,isBlob:v,isRegExp:N,isFunction:d,isStream:t=>g(t)&&d(t.pipe),isURLSearchParams:R,isTypedArray:B,isFileList:E,forEach:P,merge:function t(){const{caseless:e}=C(this)&&this||{},r={},n=(n,o)=>{const i=e&&_(r,o)||o;m(r[i])&&m(n)?r[i]=t(r[i],n):m(n)?r[i]=t({},n):f(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t(P(r,((r,o)=>{n&&d(r)?t[o]=e(r,n):t[o]=r}),{allOwnKeys:o}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,s,a;const u={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)a=o[s],n&&!n(a,t,e)||u[a]||(e[a]=t[a],u[a]=!0);t=!1!==r&&i(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:s,kindOfTest:u,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(f(t))return t;let e=t.length;if(!y(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:L,hasOwnProperty:j,hasOwnProp:j,reduceDescriptors:k,freezeMethods:t=>{k(t,((e,r)=>{if(d(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];d(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach((t=>{r[t]=!0}))};return f(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:_,global:U,isContextDefined:C,isSpecCompliantForm:function(t){return!!(t&&d(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(g(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=f(t)?[]:{};return P(t,((t,e)=>{const i=r(t,n+1);!l(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)},isAsyncFn:D,isThenable:t=>t&&(g(t)||d(t))&&d(t.then)&&d(t.catch),setImmediate:F,asap:z};function J(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}H.inherits(J,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:H.toJSONObject(this.config),code:this.code,status:this.status}}});const W=J.prototype,V={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{V[t]={value:t}})),Object.defineProperties(J,V),Object.defineProperty(W,"isAxiosError",{value:!0}),J.from=(t,e,r,n,o,i)=>{const s=Object.create(W);return H.toFlatObject(t,s,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),J.call(s,t.message,e,r,n,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const K=J;var $=r(287).hp;function X(t){return H.isPlainObject(t)||H.isArray(t)}function G(t){return H.endsWith(t,"[]")?t.slice(0,-2):t}function Q(t,e,r){return t?t.concat(e).map((function(t,e){return t=G(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const Z=H.toFlatObject(H,{},null,(function(t){return/^is[A-Z]/.test(t)}));const tt=function(t,e,r){if(!H.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=H.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!H.isUndefined(e[t])}))).metaTokens,o=r.visitor||c,i=r.dots,s=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&H.isSpecCompliantForm(e);if(!H.isFunction(o))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(H.isDate(t))return t.toISOString();if(!a&&H.isBlob(t))throw new K("Blob is not supported. Use a Buffer instead.");return H.isArrayBuffer(t)||H.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):$.from(t):t}function c(t,r,o){let a=t;if(t&&!o&&"object"==typeof t)if(H.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(H.isArray(t)&&function(t){return H.isArray(t)&&!t.some(X)}(t)||(H.isFileList(t)||H.endsWith(r,"[]"))&&(a=H.toArray(t)))return r=G(r),a.forEach((function(t,n){!H.isUndefined(t)&&null!==t&&e.append(!0===s?Q([r],n,i):null===s?r:r+"[]",u(t))})),!1;return!!X(t)||(e.append(Q(o,r,i),u(t)),!1)}const f=[],l=Object.assign(Z,{defaultVisitor:c,convertValue:u,isVisitable:X});if(!H.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!H.isUndefined(r)){if(-1!==f.indexOf(r))throw Error("Circular reference detected in "+n.join("."));f.push(r),H.forEach(r,(function(r,i){!0===(!(H.isUndefined(r)||null===r)&&o.call(e,r,H.isString(i)?i.trim():i,n,l))&&t(r,n?n.concat(i):[i])})),f.pop()}}(t),e};function et(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function rt(t,e){this._pairs=[],t&&tt(t,this,e)}const nt=rt.prototype;nt.append=function(t,e){this._pairs.push([t,e])},nt.toString=function(t){const e=t?function(e){return t.call(this,e,et)}:et;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const ot=rt;function it(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function st(t,e,r){if(!e)return t;const n=r&&r.encode||it;H.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(i=o?o(e,r):H.isURLSearchParams(e)?e.toString():new ot(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const at=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){H.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},ut={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ct={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ot,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ft="undefined"!=typeof window&&"undefined"!=typeof document,lt="object"==typeof navigator&&navigator||void 0,ht=ft&&(!lt||["ReactNative","NativeScript","NS"].indexOf(lt.product)<0),pt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,dt=ft&&window.location.href||"http://localhost",yt={...t,...ct};const gt=function(t){function e(t,r,n,o){let i=t[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=t.length;if(i=!i&&H.isArray(n)?n.length:i,a)return H.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!s;n[i]&&H.isObject(n[i])||(n[i]=[]);return e(t,r,n[i],o)&&H.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n{e(function(t){return H.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null};const mt={transitional:ut,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=H.isObject(t);o&&H.isHTMLForm(t)&&(t=new FormData(t));if(H.isFormData(t))return n?JSON.stringify(gt(t)):t;if(H.isArrayBuffer(t)||H.isBuffer(t)||H.isStream(t)||H.isFile(t)||H.isBlob(t)||H.isReadableStream(t))return t;if(H.isArrayBufferView(t))return t.buffer;if(H.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return tt(t,new yt.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return yt.isNode&&H.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=H.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return tt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(H.isString(t))try{return(e||JSON.parse)(t),H.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||mt.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(H.isResponse(t)||H.isReadableStream(t))return t;if(t&&H.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw K.from(t,K.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};H.forEach(["delete","get","head","post","put","patch"],(t=>{mt.headers[t]={}}));const wt=mt,bt=H.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),vt=Symbol("internals");function Et(t){return t&&String(t).trim().toLowerCase()}function Rt(t){return!1===t||null==t?t:H.isArray(t)?t.map(Rt):String(t)}function At(t,e,r,n,o){return H.isFunction(n)?n.call(this,e,r):(o&&(e=r),H.isString(e)?H.isString(n)?-1!==e.indexOf(n):H.isRegExp(n)?n.test(e):void 0:void 0)}class St{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=Et(e);if(!o)throw new Error("header name must be a non-empty string");const i=H.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=Rt(t))}const i=(t,e)=>H.forEach(t,((t,r)=>o(t,r,e)));if(H.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(H.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&bt[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)})),e})(t),e);else if(H.isHeaders(t))for(const[e,n]of t.entries())o(n,e,r);else null!=t&&o(e,t,r);return this}get(t,e){if(t=Et(t)){const r=H.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(H.isFunction(e))return e.call(this,t,r);if(H.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Et(t)){const r=H.findKey(this,t);return!(!r||void 0===this[r]||e&&!At(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=Et(t)){const o=H.findKey(r,t);!o||e&&!At(0,r[o],o,e)||(delete r[o],n=!0)}}return H.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const o=e[r];t&&!At(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return H.forEach(this,((n,o)=>{const i=H.findKey(r,o);if(i)return e[i]=Rt(n),void delete e[o];const s=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(o):String(o).trim();s!==o&&delete e[o],e[s]=Rt(n),r[s]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return H.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&H.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[vt]=this[vt]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=Et(t);e[n]||(!function(t,e){const r=H.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})}))}(r,t),e[n]=!0)}return H.isArray(t)?t.forEach(n):n(t),this}}St.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),H.reduceDescriptors(St.prototype,(({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}})),H.freezeMethods(St);const Tt=St;function Ot(t,e){const r=this||wt,n=e||r,o=Tt.from(n.headers);let i=n.data;return H.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Pt(t){return!(!t||!t.__CANCEL__)}function _t(t,e,r){K.call(this,null==t?"canceled":t,K.ERR_CANCELED,e,r),this.name="CanceledError"}H.inherits(_t,K,{__CANCEL__:!0});const Ut=_t;function Ct(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new K("Request failed with status code "+r.status,[K.ERR_BAD_REQUEST,K.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}const Bt=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,s=0;return e=void 0!==e?e:1e3,function(a){const u=Date.now(),c=n[s];o||(o=u),r[i]=a,n[i]=u;let f=s,l=0;for(;f!==i;)l+=r[f++],f%=t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),u-o{o=i,r=null,n&&(clearTimeout(n),n=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),a=e-o;a>=i?s(t,e):(r=t,n||(n=setTimeout((()=>{n=null,s(r)}),i-a)))},()=>r&&s(r)]},Lt=(t,e,r=3)=>{let n=0;const o=Bt(50,250);return xt((r=>{const i=r.loaded,s=r.lengthComputable?r.total:void 0,a=i-n,u=o(a);n=i;t({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&i<=s?(s-i)/u:void 0,event:r,lengthComputable:null!=s,[e?"download":"upload"]:!0})}),r)},jt=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},Nt=t=>(...e)=>H.asap((()=>t(...e))),kt=yt.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,yt.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0,Dt=yt.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const s=[t+"="+encodeURIComponent(e)];H.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),H.isString(n)&&s.push("path="+n),H.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ft(t,e,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(n||0==r)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const It=t=>t instanceof Tt?{...t}:t;function Mt(t,e){e=e||{};const r={};function n(t,e,r,n){return H.isPlainObject(t)&&H.isPlainObject(e)?H.merge.call({caseless:n},t,e):H.isPlainObject(e)?H.merge({},e):H.isArray(e)?e.slice():e}function o(t,e,r,o){return H.isUndefined(e)?H.isUndefined(t)?void 0:n(void 0,t,0,o):n(t,e,0,o)}function i(t,e){if(!H.isUndefined(e))return n(void 0,e)}function s(t,e){return H.isUndefined(e)?H.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function a(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(t,e,r)=>o(It(t),It(e),0,!0)};return H.forEach(Object.keys(Object.assign({},t,e)),(function(n){const i=u[n]||o,s=i(t[n],e[n],n);H.isUndefined(s)&&i!==a||(r[n]=s)})),r}const qt=t=>{const e=Mt({},t);let r,{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:u}=e;if(e.headers=a=Tt.from(a),e.url=st(Ft(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),u&&a.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),H.isFormData(n))if(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(r=a.getContentType())){const[t,...e]=r?r.split(";").map((t=>t.trim())).filter(Boolean):[];a.setContentType([t||"multipart/form-data",...e].join("; "))}if(yt.hasStandardBrowserEnv&&(o&&H.isFunction(o)&&(o=o(e)),o||!1!==o&&kt(e.url))){const t=i&&s&&Dt.read(s);t&&a.set(i,t)}return e},Yt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){const n=qt(t);let o=n.data;const i=Tt.from(n.headers).normalize();let s,a,u,c,f,{responseType:l,onUploadProgress:h,onDownloadProgress:p}=n;function d(){c&&c(),f&&f(),n.cancelToken&&n.cancelToken.unsubscribe(s),n.signal&&n.signal.removeEventListener("abort",s)}let y=new XMLHttpRequest;function g(){if(!y)return;const n=Tt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Ct((function(t){e(t),d()}),(function(t){r(t),d()}),{data:l&&"text"!==l&&"json"!==l?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:t,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(g)},y.onabort=function(){y&&(r(new K("Request aborted",K.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new K("Network Error",K.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||ut;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new K(e,o.clarifyTimeoutError?K.ETIMEDOUT:K.ECONNABORTED,t,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&H.forEach(i.toJSON(),(function(t,e){y.setRequestHeader(e,t)})),H.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),l&&"json"!==l&&(y.responseType=n.responseType),p&&([u,f]=Lt(p,!0),y.addEventListener("progress",u)),h&&y.upload&&([a,c]=Lt(h),y.upload.addEventListener("progress",a),y.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(s=e=>{y&&(r(!e||e.type?new Ut(null,t,y):e),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(s),n.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s)));const m=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);m&&-1===yt.protocols.indexOf(m)?r(new K("Unsupported protocol "+m+":",K.ERR_BAD_REQUEST,t)):y.send(o||null)}))},zt=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const o=function(t){if(!r){r=!0,s();const e=t instanceof Error?t:this.reason;n.abort(e instanceof K?e:new Ut(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new K(`timeout ${e} of ms exceeded`,K.ETIMEDOUT))}),e);const s=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((t=>t.addEventListener("abort",o)));const{signal:a}=n;return a.unsubscribe=()=>H.asap(s),a}},Ht=function*(t,e){let r=t.byteLength;if(!e||r{const o=async function*(t,e){for await(const r of Jt(t))yield*Ht(r,e)}(t,e);let i,s=0,a=t=>{i||(i=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await o.next();if(e)return a(),void t.close();let i=n.byteLength;if(r){let t=s+=i;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw a(t),t}},cancel:t=>(a(t),o.return())},{highWaterMark:2})},Vt="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Kt=Vt&&"function"==typeof ReadableStream,$t=Vt&&("function"==typeof TextEncoder?(Xt=new TextEncoder,t=>Xt.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var Xt;const Gt=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Qt=Kt&&Gt((()=>{let t=!1;const e=new Request(yt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),Zt=Kt&&Gt((()=>H.isReadableStream(new Response("").body))),te={stream:Zt&&(t=>t.body)};var ee;Vt&&(ee=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!te[t]&&(te[t]=H.isFunction(ee[t])?e=>e[t]():(e,r)=>{throw new K(`Response type '${t}' is not supported`,K.ERR_NOT_SUPPORT,r)})})));const re=async(t,e)=>{const r=H.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(H.isBlob(t))return t.size;if(H.isSpecCompliantForm(t)){const e=new Request(yt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return H.isArrayBufferView(t)||H.isArrayBuffer(t)?t.byteLength:(H.isURLSearchParams(t)&&(t+=""),H.isString(t)?(await $t(t)).byteLength:void 0)})(e):r},ne={http:null,xhr:Yt,fetch:Vt&&(async t=>{let{url:e,method:r,data:n,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:u,responseType:c,headers:f,withCredentials:l="same-origin",fetchOptions:h}=qt(t);c=c?(c+"").toLowerCase():"text";let p,d=zt([o,i&&i.toAbortSignal()],s);const y=d&&d.unsubscribe&&(()=>{d.unsubscribe()});let g;try{if(u&&Qt&&"get"!==r&&"head"!==r&&0!==(g=await re(f,n))){let t,r=new Request(e,{method:"POST",body:n,duplex:"half"});if(H.isFormData(n)&&(t=r.headers.get("content-type"))&&f.setContentType(t),r.body){const[t,e]=jt(g,Lt(Nt(u)));n=Wt(r.body,65536,t,e)}}H.isString(l)||(l=l?"include":"omit");const o="credentials"in Request.prototype;p=new Request(e,{...h,signal:d,method:r.toUpperCase(),headers:f.normalize().toJSON(),body:n,duplex:"half",credentials:o?l:void 0});let i=await fetch(p);const s=Zt&&("stream"===c||"response"===c);if(Zt&&(a||s&&y)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=i[e]}));const e=H.toFiniteNumber(i.headers.get("content-length")),[r,n]=a&&jt(e,Lt(Nt(a),!0))||[];i=new Response(Wt(i.body,65536,r,(()=>{n&&n(),y&&y()})),t)}c=c||"text";let m=await te[H.findKey(te,c)||"text"](i,t);return!s&&y&&y(),await new Promise(((e,r)=>{Ct(e,r,{data:m,headers:Tt.from(i.headers),status:i.status,statusText:i.statusText,config:t,request:p})}))}catch(e){if(y&&y(),e&&"TypeError"===e.name&&/fetch/i.test(e.message))throw Object.assign(new K("Network Error",K.ERR_NETWORK,t,p),{cause:e.cause||e});throw K.from(e,e&&e.code,t,p)}})};H.forEach(ne,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const oe=t=>`- ${t}`,ie=t=>H.isFunction(t)||null===t||!1===t,se=t=>{t=H.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let i=0;i`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let r=e?t.length>1?"since :\n"+t.map(oe).join("\n"):" "+oe(t[0]):"as no adapter specified";throw new K("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function ae(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ut(null,t)}function ue(t){ae(t),t.headers=Tt.from(t.headers),t.data=Ot.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return se(t.adapter||wt.adapter)(t).then((function(e){return ae(t),e.data=Ot.call(t,t.transformResponse,e),e.headers=Tt.from(e.headers),e}),(function(e){return Pt(e)||(ae(t),e&&e.response&&(e.response.data=Ot.call(t,t.transformResponse,e.response),e.response.headers=Tt.from(e.response.headers))),Promise.reject(e)}))}const ce="1.8.4",fe={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{fe[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const le={};fe.transitional=function(t,e,r){function n(t,e){return"[Axios v1.8.4] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,o,i)=>{if(!1===t)throw new K(n(o," has been removed"+(e?" in "+e:"")),K.ERR_DEPRECATED);return e&&!le[o]&&(le[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,i)}},fe.spelling=function(t){return(e,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};const he={assertOptions:function(t,e,r){if("object"!=typeof t)throw new K("options must be an object",K.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],s=e[i];if(s){const e=t[i],r=void 0===e||s(e,i,t);if(!0!==r)throw new K("option "+i+" must be "+r,K.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new K("Unknown option "+i,K.ERR_BAD_OPTION)}},validators:fe},pe=he.validators;class de{constructor(t){this.defaults=t,this.interceptors={request:new at,response:new at}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Mt(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;void 0!==r&&he.assertOptions(r,{silentJSONParsing:pe.transitional(pe.boolean),forcedJSONParsing:pe.transitional(pe.boolean),clarifyTimeoutError:pe.transitional(pe.boolean)},!1),null!=n&&(H.isFunction(n)?e.paramsSerializer={serialize:n}:he.assertOptions(n,{encode:pe.function,serialize:pe.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),he.assertOptions(e,{baseUrl:pe.spelling("baseURL"),withXsrfToken:pe.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&H.merge(o.common,o[e.method]);o&&H.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Tt.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)}));let f,l=0;if(!a){const t=[ue.bind(this),void 0];for(t.unshift.apply(t,s),t.push.apply(t,u),f=t.length,c=Promise.resolve(e);l{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,o){r.reason||(r.reason=new Ut(t,n,o),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new ge((function(e){t=e})),cancel:t}}}const me=ge;const we={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(we).forEach((([t,e])=>{we[e]=t}));const be=we;const ve=function t(r){const n=new ye(r),o=e(ye.prototype.request,n);return H.extend(o,ye.prototype,n,{allOwnKeys:!0}),H.extend(o,n,null,{allOwnKeys:!0}),o.create=function(e){return t(Mt(r,e))},o}(wt);ve.Axios=ye,ve.CanceledError=Ut,ve.CancelToken=me,ve.isCancel=Pt,ve.VERSION=ce,ve.toFormData=tt,ve.AxiosError=K,ve.Cancel=ve.CanceledError,ve.all=function(t){return Promise.all(t)},ve.spread=function(t){return function(e){return t.apply(null,e)}},ve.isAxiosError=function(t){return H.isObject(t)&&!0===t.isAxiosError},ve.mergeConfig=Mt,ve.AxiosHeaders=Tt,ve.formToJSON=t=>gt(H.isHTMLForm(t)?new FormData(t):t),ve.getAdapter=se,ve.HttpStatusCode=be,ve.default=ve;const Ee=ve;function Re(t){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Re(t)}function Ae(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Se(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Se(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function Se(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r1&&void 0!==arguments[1]?arguments[1]:null;return Ee.post(t,e)}},{key:"addScripts",value:function(t){t.scripts&&t.scripts.forEach((function(t){//.test(t)||console.error("Invalid script tag: "+t);var e=document.createElement("div");e.innerHTML=t;var r=document.createElement("script");r.textContent=e.querySelector("script").textContent;var n,o=Ae(e.querySelector("script").attributes);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.setAttribute(i.name,i.value)}}catch(t){o.e(t)}finally{o.f()}r.setAttribute("data-cookie-consent",!0),document.head.appendChild(r)}))}},{key:"addNotice",value:function(t){if(t.notice){var e=document.createElement("div");e.innerHTML=t.notice;var r=e.querySelector("#cookies-policy");document.body.appendChild(r);var n=e.querySelectorAll("[data-cookie-consent]");n.length&&n.forEach((function(t){if("SCRIPT"===t.nodeName){var e=document.createElement("script");e.textContent=t.textContent,document.body.appendChild(e)}else document.body.appendChild(t)}))}}}],e&&Te(t.prototype,e),r&&Te(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();window.addEventListener("load",(function(){window.LaravelCookieConsent=new Pe({config:1})}))})()})(); \ No newline at end of file +/*! For license information please see Cookies.js.LICENSE.txt */ +(()=>{var t={251:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<>1,f=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=c}return(p?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,u,c=8*i-o-1,f=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&a,p+=d,a/=256,o-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},287:(t,e,r)=>{"use strict";var n=r(526),o=r(251),i=r(634);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return q(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return _(this,e,r);case"latin1":case"binary":return U(this,e,r);case"base64":return T(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){var i,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var f=-1;for(i=r;ia&&(r=a-u),i=r;i>=0;i--){for(var l=!0,h=0;ho&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function T(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:c>223?3:c>191?2:1;if(o+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(f=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=l}return function(t){var e=t.length;if(e<=P)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,o){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(i,s),c=this.slice(n,o),f=t.slice(e,r),l=0;lo)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":return E(this,t,e,r);case"latin1":case"binary":return R(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var P=4096;function _(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;on)&&(r=n);for(var o="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function j(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o>>8*(n?o:1-o)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o>>8*(n?o:3-o)&255}function k(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return i||k(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,i){return i||k(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUInt8=function(t,e){return e||x(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||x(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||x(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||x(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||x(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||x(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||x(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);L(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function Y(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}},526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=a(t),s=i[0],u=i[1],c=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,u)),f=0,l=u>0?s-4:s;for(r=0;r>16&255,c[f++]=e>>8&255,c[f++]=255&e;2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e);1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,a=0,u=n-o;au?u:a+s));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function c(t,e,r){for(var n,o=[],i=e;i{var e,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(t){r=i}}();var a,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&h())}function h(){if(!c){var t=s(l);c=!0;for(var e=u.length;e;){for(a=u,u=[];++f1)for(var r=1;r{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t={};function e(t,e){return function(){return t.apply(e,arguments)}}r.r(t),r.d(t,{hasBrowserEnv:()=>pt,hasStandardBrowserEnv:()=>yt,hasStandardBrowserWebWorkerEnv:()=>gt,navigator:()=>dt,origin:()=>mt});var n=r(606);const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:s,toStringTag:a}=Symbol,u=(c=Object.create(null),t=>{const e=o.call(t);return c[e]||(c[e]=e.slice(8,-1).toLowerCase())});var c;const f=t=>(t=t.toLowerCase(),e=>u(e)===t),l=t=>e=>typeof e===t,{isArray:h}=Array,p=l("undefined");function d(t){return null!==t&&!p(t)&&null!==t.constructor&&!p(t.constructor)&&m(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const y=f("ArrayBuffer");const g=l("string"),m=l("function"),b=l("number"),w=t=>null!==t&&"object"==typeof t,v=t=>{if("object"!==u(t))return!1;const e=i(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||a in t||s in t)},E=f("Date"),R=f("File"),A=f("Blob"),S=f("FileList"),T=f("URLSearchParams"),[O,P,_,U]=["ReadableStream","Request","Response","Headers"].map(f);function C(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),h(t))for(n=0,o=t.length;n0;)if(n=r[o],e===n.toLowerCase())return n;return null}const x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,L=t=>!p(t)&&t!==x;const j=(N="undefined"!=typeof Uint8Array&&i(Uint8Array),t=>N&&t instanceof N);var N;const k=f("HTMLFormElement"),D=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),F=f("RegExp"),I=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};C(r,(r,o)=>{let i;!1!==(i=e(r,o,t))&&(n[o]=i||r)}),Object.defineProperties(t,n)};const M=f("AsyncFunction"),q=(Y="function"==typeof setImmediate,z=m(x.postMessage),Y?setImmediate:z?(H=`axios@${Math.random()}`,J=[],x.addEventListener("message",({source:t,data:e})=>{t===x&&e===H&&J.length&&J.shift()()},!1),t=>{J.push(t),x.postMessage(H,"*")}):t=>setTimeout(t));var Y,z,H,J;const W="undefined"!=typeof queueMicrotask?queueMicrotask.bind(x):void 0!==n&&n.nextTick||q,V={isArray:h,isArrayBuffer:y,isBuffer:d,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||m(t.append)&&("formdata"===(e=u(t))||"object"===e&&m(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&y(t.buffer),e},isString:g,isNumber:b,isBoolean:t=>!0===t||!1===t,isObject:w,isPlainObject:v,isEmptyObject:t=>{if(!w(t)||d(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:O,isRequest:P,isResponse:_,isHeaders:U,isUndefined:p,isDate:E,isFile:R,isBlob:A,isRegExp:F,isFunction:m,isStream:t=>w(t)&&m(t.pipe),isURLSearchParams:T,isTypedArray:j,isFileList:S,forEach:C,merge:function t(){const{caseless:e,skipUndefined:r}=L(this)&&this||{},n={},o=(o,i)=>{const s=e&&B(n,i)||i;v(n[s])&&v(o)?n[s]=t(n[s],o):v(o)?n[s]=t({},o):h(o)?n[s]=o.slice():r&&p(o)||(n[s]=o)};for(let t=0,e=arguments.length;t(C(r,(r,o)=>{n&&m(r)?t[o]=e(r,n):t[o]=r},{allOwnKeys:o}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,s,a;const u={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)a=o[s],n&&!n(a,t,e)||u[a]||(e[a]=t[a],u[a]=!0);t=!1!==r&&i(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:u,kindOfTest:f,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(h(t))return t;let e=t.length;if(!b(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[s]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:k,hasOwnProperty:D,hasOwnProp:D,reduceDescriptors:I,freezeMethods:t=>{I(t,(e,r)=>{if(m(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];m(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach(t=>{r[t]=!0})};return h(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,r){return e.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:B,global:x,isContextDefined:L,isSpecCompliantForm:function(t){return!!(t&&m(t.append)&&"FormData"===t[a]&&t[s])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(w(t)){if(e.indexOf(t)>=0)return;if(d(t))return t;if(!("toJSON"in t)){e[n]=t;const o=h(t)?[]:{};return C(t,(t,e)=>{const i=r(t,n+1);!p(i)&&(o[e]=i)}),e[n]=void 0,o}}return t};return r(t,0)},isAsyncFn:M,isThenable:t=>t&&(w(t)||m(t))&&m(t.then)&&m(t.catch),setImmediate:q,asap:W,isIterable:t=>null!=t&&m(t[s])};function K(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}V.inherits(K,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:V.toJSONObject(this.config),code:this.code,status:this.status}}});const $=K.prototype,X={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{X[t]={value:t}}),Object.defineProperties(K,X),Object.defineProperty($,"isAxiosError",{value:!0}),K.from=(t,e,r,n,o,i)=>{const s=Object.create($);V.toFlatObject(t,s,function(t){return t!==Error.prototype},t=>"isAxiosError"!==t);const a=t&&t.message?t.message:"Error",u=null==e&&t?t.code:e;return K.call(s,a,u,r,n,o),t&&null==s.cause&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",i&&Object.assign(s,i),s};const G=K;var Q=r(287).hp;function Z(t){return V.isPlainObject(t)||V.isArray(t)}function tt(t){return V.endsWith(t,"[]")?t.slice(0,-2):t}function et(t,e,r){return t?t.concat(e).map(function(t,e){return t=tt(t),!r&&e?"["+t+"]":t}).join(r?".":""):e}const rt=V.toFlatObject(V,{},null,function(t){return/^is[A-Z]/.test(t)});const nt=function(t,e,r){if(!V.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=V.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!V.isUndefined(e[t])})).metaTokens,o=r.visitor||c,i=r.dots,s=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&V.isSpecCompliantForm(e);if(!V.isFunction(o))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(V.isDate(t))return t.toISOString();if(V.isBoolean(t))return t.toString();if(!a&&V.isBlob(t))throw new G("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(t)||V.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Q.from(t):t}function c(t,r,o){let a=t;if(t&&!o&&"object"==typeof t)if(V.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(V.isArray(t)&&function(t){return V.isArray(t)&&!t.some(Z)}(t)||(V.isFileList(t)||V.endsWith(r,"[]"))&&(a=V.toArray(t)))return r=tt(r),a.forEach(function(t,n){!V.isUndefined(t)&&null!==t&&e.append(!0===s?et([r],n,i):null===s?r:r+"[]",u(t))}),!1;return!!Z(t)||(e.append(et(o,r,i),u(t)),!1)}const f=[],l=Object.assign(rt,{defaultVisitor:c,convertValue:u,isVisitable:Z});if(!V.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!V.isUndefined(r)){if(-1!==f.indexOf(r))throw Error("Circular reference detected in "+n.join("."));f.push(r),V.forEach(r,function(r,i){!0===(!(V.isUndefined(r)||null===r)&&o.call(e,r,V.isString(i)?i.trim():i,n,l))&&t(r,n?n.concat(i):[i])}),f.pop()}}(t),e};function ot(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function it(t,e){this._pairs=[],t&&nt(t,this,e)}const st=it.prototype;st.append=function(t,e){this._pairs.push([t,e])},st.toString=function(t){const e=t?function(e){return t.call(this,e,ot)}:ot;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};const at=it;function ut(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ct(t,e,r){if(!e)return t;const n=r&&r.encode||ut;V.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(i=o?o(e,r):V.isURLSearchParams(e)?e.toString():new at(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const ft=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){V.forEach(this.handlers,function(e){null!==e&&t(e)})}},lt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ht={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:at,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},pt="undefined"!=typeof window&&"undefined"!=typeof document,dt="object"==typeof navigator&&navigator||void 0,yt=pt&&(!dt||["ReactNative","NativeScript","NS"].indexOf(dt.product)<0),gt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,mt=pt&&window.location.href||"http://localhost",bt={...t,...ht};const wt=function(t){function e(t,r,n,o){let i=t[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=t.length;if(i=!i&&V.isArray(n)?n.length:i,a)return V.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!s;n[i]&&V.isObject(n[i])||(n[i]=[]);return e(t,r,n[i],o)&&V.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n{e(function(t){return V.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0])}(t),n,r,0)}),r}return null};const vt={transitional:lt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=V.isObject(t);o&&V.isHTMLForm(t)&&(t=new FormData(t));if(V.isFormData(t))return n?JSON.stringify(wt(t)):t;if(V.isArrayBuffer(t)||V.isBuffer(t)||V.isStream(t)||V.isFile(t)||V.isBlob(t)||V.isReadableStream(t))return t;if(V.isArrayBufferView(t))return t.buffer;if(V.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return nt(t,new bt.classes.URLSearchParams,{visitor:function(t,e,r,n){return bt.isNode&&V.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((i=V.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return nt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(V.isString(t))try{return(e||JSON.parse)(t),V.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||vt.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(V.isResponse(t)||V.isReadableStream(t))return t;if(t&&V.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t,this.parseReviver)}catch(t){if(r){if("SyntaxError"===t.name)throw G.from(t,G.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],t=>{vt.headers[t]={}});const Et=vt,Rt=V.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),At=Symbol("internals");function St(t){return t&&String(t).trim().toLowerCase()}function Tt(t){return!1===t||null==t?t:V.isArray(t)?t.map(Tt):String(t)}function Ot(t,e,r,n,o){return V.isFunction(n)?n.call(this,e,r):(o&&(e=r),V.isString(e)?V.isString(n)?-1!==e.indexOf(n):V.isRegExp(n)?n.test(e):void 0:void 0)}class Pt{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=St(e);if(!o)throw new Error("header name must be a non-empty string");const i=V.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=Tt(t))}const i=(t,e)=>V.forEach(t,(t,r)=>o(t,r,e));if(V.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(V.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach(function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&Rt[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e})(t),e);else if(V.isObject(t)&&V.isIterable(t)){let r,n,o={};for(const e of t){if(!V.isArray(e))throw TypeError("Object iterator must return a key-value pair");o[n=e[0]]=(r=o[n])?V.isArray(r)?[...r,e[1]]:[r,e[1]]:e[1]}i(o,e)}else null!=t&&o(e,t,r);return this}get(t,e){if(t=St(t)){const r=V.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(V.isFunction(e))return e.call(this,t,r);if(V.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=St(t)){const r=V.findKey(this,t);return!(!r||void 0===this[r]||e&&!Ot(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=St(t)){const o=V.findKey(r,t);!o||e&&!Ot(0,r[o],o,e)||(delete r[o],n=!0)}}return V.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const o=e[r];t&&!Ot(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return V.forEach(this,(n,o)=>{const i=V.findKey(r,o);if(i)return e[i]=Tt(n),void delete e[o];const s=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,r)=>e.toUpperCase()+r)}(o):String(o).trim();s!==o&&delete e[o],e[s]=Tt(n),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return V.forEach(this,(r,n)=>{null!=r&&!1!==r&&(e[n]=t&&V.isArray(r)?r.join(", "):r)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach(t=>r.set(t)),r}static accessor(t){const e=(this[At]=this[At]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=St(t);e[n]||(!function(t,e){const r=V.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})})}(r,t),e[n]=!0)}return V.isArray(t)?t.forEach(n):n(t),this}}Pt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(Pt.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}}),V.freezeMethods(Pt);const _t=Pt;function Ut(t,e){const r=this||Et,n=e||r,o=_t.from(n.headers);let i=n.data;return V.forEach(t,function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function Ct(t){return!(!t||!t.__CANCEL__)}function Bt(t,e,r){G.call(this,null==t?"canceled":t,G.ERR_CANCELED,e,r),this.name="CanceledError"}V.inherits(Bt,G,{__CANCEL__:!0});const xt=Bt;function Lt(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new G("Request failed with status code "+r.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}const jt=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,s=0;return e=void 0!==e?e:1e3,function(a){const u=Date.now(),c=n[s];o||(o=u),r[i]=a,n[i]=u;let f=s,l=0;for(;f!==i;)l+=r[f++],f%=t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),u-o{o=i,r=null,n&&(clearTimeout(n),n=null),t(...e)};return[(...t)=>{const e=Date.now(),a=e-o;a>=i?s(t,e):(r=t,n||(n=setTimeout(()=>{n=null,s(r)},i-a)))},()=>r&&s(r)]},kt=(t,e,r=3)=>{let n=0;const o=jt(50,250);return Nt(r=>{const i=r.loaded,s=r.lengthComputable?r.total:void 0,a=i-n,u=o(a);n=i;t({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&i<=s?(s-i)/u:void 0,event:r,lengthComputable:null!=s,[e?"download":"upload"]:!0})},r)},Dt=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},Ft=t=>(...e)=>V.asap(()=>t(...e)),It=bt.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,bt.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(bt.origin),bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent)):()=>!0,Mt=bt.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const s=[t+"="+encodeURIComponent(e)];V.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),V.isString(n)&&s.push("path="+n),V.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function qt(t,e,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(n||0==r)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Yt=t=>t instanceof _t?{...t}:t;function zt(t,e){e=e||{};const r={};function n(t,e,r,n){return V.isPlainObject(t)&&V.isPlainObject(e)?V.merge.call({caseless:n},t,e):V.isPlainObject(e)?V.merge({},e):V.isArray(e)?e.slice():e}function o(t,e,r,o){return V.isUndefined(e)?V.isUndefined(t)?void 0:n(void 0,t,0,o):n(t,e,0,o)}function i(t,e){if(!V.isUndefined(e))return n(void 0,e)}function s(t,e){return V.isUndefined(e)?V.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function a(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(t,e,r)=>o(Yt(t),Yt(e),0,!0)};return V.forEach(Object.keys({...t,...e}),function(n){const i=u[n]||o,s=i(t[n],e[n],n);V.isUndefined(s)&&i!==a||(r[n]=s)}),r}const Ht=t=>{const e=zt({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=e;if(e.headers=s=_t.from(s),e.url=ct(qt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),V.isFormData(r))if(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(V.isFunction(r.getHeaders)){const t=r.getHeaders(),e=["content-type","content-length"];Object.entries(t).forEach(([t,r])=>{e.includes(t.toLowerCase())&&s.set(t,r)})}if(bt.hasStandardBrowserEnv&&(n&&V.isFunction(n)&&(n=n(e)),n||!1!==n&&It(e.url))){const t=o&&i&&Mt.read(i);t&&s.set(o,t)}return e},Jt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise(function(e,r){const n=Ht(t);let o=n.data;const i=_t.from(n.headers).normalize();let s,a,u,c,f,{responseType:l,onUploadProgress:h,onDownloadProgress:p}=n;function d(){c&&c(),f&&f(),n.cancelToken&&n.cancelToken.unsubscribe(s),n.signal&&n.signal.removeEventListener("abort",s)}let y=new XMLHttpRequest;function g(){if(!y)return;const n=_t.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Lt(function(t){e(t),d()},function(t){r(t),d()},{data:l&&"text"!==l&&"json"!==l?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:t,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(g)},y.onabort=function(){y&&(r(new G("Request aborted",G.ECONNABORTED,t,y)),y=null)},y.onerror=function(e){const n=e&&e.message?e.message:"Network Error",o=new G(n,G.ERR_NETWORK,t,y);o.event=e||null,r(o),y=null},y.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||lt;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new G(e,o.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,t,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&V.forEach(i.toJSON(),function(t,e){y.setRequestHeader(e,t)}),V.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),l&&"json"!==l&&(y.responseType=n.responseType),p&&([u,f]=kt(p,!0),y.addEventListener("progress",u)),h&&y.upload&&([a,c]=kt(h),y.upload.addEventListener("progress",a),y.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(s=e=>{y&&(r(!e||e.type?new xt(null,t,y):e),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(s),n.signal&&(n.signal.aborted?s():n.signal.addEventListener("abort",s)));const m=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);m&&-1===bt.protocols.indexOf(m)?r(new G("Unsupported protocol "+m+":",G.ERR_BAD_REQUEST,t)):y.send(o||null)})},Wt=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const o=function(t){if(!r){r=!0,s();const e=t instanceof Error?t:this.reason;n.abort(e instanceof G?e:new xt(e instanceof Error?e.message:e))}};let i=e&&setTimeout(()=>{i=null,o(new G(`timeout ${e} of ms exceeded`,G.ETIMEDOUT))},e);const s=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}),t=null)};t.forEach(t=>t.addEventListener("abort",o));const{signal:a}=n;return a.unsubscribe=()=>V.asap(s),a}},Vt=function*(t,e){let r=t.byteLength;if(!e||r{const o=async function*(t,e){for await(const r of Kt(t))yield*Vt(r,e)}(t,e);let i,s=0,a=t=>{i||(i=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await o.next();if(e)return a(),void t.close();let i=n.byteLength;if(r){let t=s+=i;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw a(t),t}},cancel:t=>(a(t),o.return())},{highWaterMark:2})},{isFunction:Xt}=V,Gt=(({Request:t,Response:e})=>({Request:t,Response:e}))(V.global),{ReadableStream:Qt,TextEncoder:Zt}=V.global,te=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},ee=t=>{t=V.merge.call({skipUndefined:!0},Gt,t);const{fetch:e,Request:r,Response:n}=t,o=e?Xt(e):"function"==typeof fetch,i=Xt(r),s=Xt(n);if(!o)return!1;const a=o&&Xt(Qt),u=o&&("function"==typeof Zt?(c=new Zt,t=>c.encode(t)):async t=>new Uint8Array(await new r(t).arrayBuffer()));var c;const f=i&&a&&te(()=>{let t=!1;const e=new r(bt.origin,{body:new Qt,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),l=s&&a&&te(()=>V.isReadableStream(new n("").body)),h={stream:l&&(t=>t.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!h[t]&&(h[t]=(e,r)=>{let n=e&&e[t];if(n)return n.call(e);throw new G(`Response type '${t}' is not supported`,G.ERR_NOT_SUPPORT,r)})});const p=async(t,e)=>{const n=V.toFiniteNumber(t.getContentLength());return null==n?(async t=>{if(null==t)return 0;if(V.isBlob(t))return t.size;if(V.isSpecCompliantForm(t)){const e=new r(bt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return V.isArrayBufferView(t)||V.isArrayBuffer(t)?t.byteLength:(V.isURLSearchParams(t)&&(t+=""),V.isString(t)?(await u(t)).byteLength:void 0)})(e):n};return async t=>{let{url:o,method:s,data:a,signal:u,cancelToken:c,timeout:d,onDownloadProgress:y,onUploadProgress:g,responseType:m,headers:b,withCredentials:w="same-origin",fetchOptions:v}=Ht(t),E=e||fetch;m=m?(m+"").toLowerCase():"text";let R=Wt([u,c&&c.toAbortSignal()],d),A=null;const S=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let T;try{if(g&&f&&"get"!==s&&"head"!==s&&0!==(T=await p(b,a))){let t,e=new r(o,{method:"POST",body:a,duplex:"half"});if(V.isFormData(a)&&(t=e.headers.get("content-type"))&&b.setContentType(t),e.body){const[t,r]=Dt(T,kt(Ft(g)));a=$t(e.body,65536,t,r)}}V.isString(w)||(w=w?"include":"omit");const e=i&&"credentials"in r.prototype,u={...v,signal:R,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:e?w:void 0};A=i&&new r(o,u);let c=await(i?E(A,v):E(o,u));const d=l&&("stream"===m||"response"===m);if(l&&(y||d&&S)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=c[e]});const e=V.toFiniteNumber(c.headers.get("content-length")),[r,o]=y&&Dt(e,kt(Ft(y),!0))||[];c=new n($t(c.body,65536,r,()=>{o&&o(),S&&S()}),t)}m=m||"text";let O=await h[V.findKey(h,m)||"text"](c,t);return!d&&S&&S(),await new Promise((e,r)=>{Lt(e,r,{data:O,headers:_t.from(c.headers),status:c.status,statusText:c.statusText,config:t,request:A})})}catch(e){if(S&&S(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new G("Network Error",G.ERR_NETWORK,t,A),{cause:e.cause||e});throw G.from(e,e&&e.code,t,A)}}},re=new Map,ne=t=>{let e=t?t.env:{};const{fetch:r,Request:n,Response:o}=e,i=[n,o,r];let s,a,u=i.length,c=re;for(;u--;)s=i[u],a=c.get(s),void 0===a&&c.set(s,a=u?new Map:ee(e)),c=a;return a},oe=(ne(),{http:null,xhr:Jt,fetch:{get:ne}});V.forEach(oe,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}});const ie=t=>`- ${t}`,se=t=>V.isFunction(t)||null===t||!1===t,ae=(t,e)=>{t=V.isArray(t)?t:[t];const{length:r}=t;let n,o;const i={};for(let s=0;s`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build"));let e=r?t.length>1?"since :\n"+t.map(ie).join("\n"):" "+ie(t[0]):"as no adapter specified";throw new G("There is no suitable adapter to dispatch the request "+e,"ERR_NOT_SUPPORT")}return o};function ue(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new xt(null,t)}function ce(t){ue(t),t.headers=_t.from(t.headers),t.data=Ut.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return ae(t.adapter||Et.adapter,t)(t).then(function(e){return ue(t),e.data=Ut.call(t,t.transformResponse,e),e.headers=_t.from(e.headers),e},function(e){return Ct(e)||(ue(t),e&&e.response&&(e.response.data=Ut.call(t,t.transformResponse,e.response),e.response.headers=_t.from(e.response.headers))),Promise.reject(e)})}const fe="1.12.2",le={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{le[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const he={};le.transitional=function(t,e,r){function n(t,e){return"[Axios v"+fe+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,o,i)=>{if(!1===t)throw new G(n(o," has been removed"+(e?" in "+e:"")),G.ERR_DEPRECATED);return e&&!he[o]&&(he[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,i)}},le.spelling=function(t){return(e,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};const pe={assertOptions:function(t,e,r){if("object"!=typeof t)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],s=e[i];if(s){const e=t[i],r=void 0===e||s(e,i,t);if(!0!==r)throw new G("option "+i+" must be "+r,G.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new G("Unknown option "+i,G.ERR_BAD_OPTION)}},validators:le},de=pe.validators;class ye{constructor(t){this.defaults=t||{},this.interceptors={request:new ft,response:new ft}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=zt(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;void 0!==r&&pe.assertOptions(r,{silentJSONParsing:de.transitional(de.boolean),forcedJSONParsing:de.transitional(de.boolean),clarifyTimeoutError:de.transitional(de.boolean)},!1),null!=n&&(V.isFunction(n)?e.paramsSerializer={serialize:n}:pe.assertOptions(n,{encode:de.function,serialize:de.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),pe.assertOptions(e,{baseUrl:de.spelling("baseURL"),withXsrfToken:de.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&V.merge(o.common,o[e.method]);o&&V.forEach(["delete","get","head","post","put","patch","common"],t=>{delete o[t]}),e.headers=_t.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,s.unshift(t.fulfilled,t.rejected))});const u=[];let c;this.interceptors.response.forEach(function(t){u.push(t.fulfilled,t.rejected)});let f,l=0;if(!a){const t=[ce.bind(this),void 0];for(t.unshift(...s),t.push(...u),f=t.length,c=Promise.resolve(e);l{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null}),this.promise.then=t=>{let e;const n=new Promise(t=>{r.subscribe(t),e=t}).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t(function(t,n,o){r.reason||(r.reason=new xt(t,n,o),e(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new me(function(e){t=e}),cancel:t}}}const be=me;const we={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(we).forEach(([t,e])=>{we[e]=t});const ve=we;const Ee=function t(r){const n=new ge(r),o=e(ge.prototype.request,n);return V.extend(o,ge.prototype,n,{allOwnKeys:!0}),V.extend(o,n,null,{allOwnKeys:!0}),o.create=function(e){return t(zt(r,e))},o}(Et);Ee.Axios=ge,Ee.CanceledError=xt,Ee.CancelToken=be,Ee.isCancel=Ct,Ee.VERSION=fe,Ee.toFormData=nt,Ee.AxiosError=G,Ee.Cancel=Ee.CanceledError,Ee.all=function(t){return Promise.all(t)},Ee.spread=function(t){return function(e){return t.apply(null,e)}},Ee.isAxiosError=function(t){return V.isObject(t)&&!0===t.isAxiosError},Ee.mergeConfig=zt,Ee.AxiosHeaders=_t,Ee.formToJSON=t=>wt(V.isHTMLForm(t)?new FormData(t):t),Ee.getAdapter=ae,Ee.HttpStatusCode=ve,Ee.default=Ee;const Re=Ee;function Ae(t){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ae(t)}function Se(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Te(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Te(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function Te(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r1&&void 0!==arguments[1]?arguments[1]:null;return Re.post(t,e)}},{key:"addScripts",value:function(t){t.scripts&&t.scripts.forEach(function(t){//.test(t)||console.error("Invalid script tag: "+t);var e=document.createElement("div");e.innerHTML=t;var r=document.createElement("script");r.textContent=e.querySelector("script").textContent;var n,o=Se(e.querySelector("script").attributes);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.setAttribute(i.name,i.value)}}catch(t){o.e(t)}finally{o.f()}r.setAttribute("data-cookie-consent",!0),document.head.appendChild(r)})}},{key:"addNotice",value:function(t){if(t.notice){var e=document.createElement("div");e.innerHTML=t.notice;var r=e.querySelector("#cookies-policy");document.body.appendChild(r);var n=e.querySelectorAll("[data-cookie-consent]");n.length&&n.forEach(function(t){if("SCRIPT"===t.nodeName){var e=document.createElement("script");e.textContent=t.textContent,document.body.appendChild(e)}else document.body.appendChild(t)})}}}],e&&Oe(t.prototype,e),r&&Oe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();window.addEventListener("DOMContentLoaded",function(){window.LaravelCookieConsent=new _e({config:1})})})()})(); \ No newline at end of file diff --git a/dist/mix-manifest.json b/dist/mix-manifest.json index 90f6e1f..9df1cf2 100644 --- a/dist/mix-manifest.json +++ b/dist/mix-manifest.json @@ -1,5 +1,5 @@ { "/script.js": "/script.js", - "/cookies.js": "/cookies.js", + "/Cookies.js": "/Cookies.js", "/style.css": "/style.css" } diff --git a/dist/script.js b/dist/script.js index adefe0d..f36466f 100644 --- a/dist/script.js +++ b/dist/script.js @@ -1 +1 @@ -(()=>{var e,t={148:()=>{var e=document.querySelector("#cookies-policy"),t=document.querySelector(".cookiereset");if(t&&t.addEventListener("submit",(function(e){return function(e){if(e.preventDefault(),document.querySelector("#cookies-policy"))return;window.LaravelCookieConsent.reset()}(e)})),e){var o=e.querySelector(".cookies__btn--customize"),n=e.querySelectorAll(".cookies__details"),i=e.querySelector(".cookiesBtn--accept"),r=e.querySelector(".cookiesBtn--essentials"),s=e.querySelector(".cookies__customize"),c=JSON.parse(e.getAttribute("data-text"));e.removeAttribute("data-text"),e.classList.remove("cookies--no-js"),e.classList.add("cookies--closing"),setTimeout((function(){e.classList.remove("cookies--closing")}),310);for(var u=0;u2&&void 0!==arguments[2])||arguments[2];t.preventDefault(),t.target.blur();var i=e.querySelector(o.getAttribute("href")),r=i.firstElementChild.offsetHeight,s=i.classList.contains("cookies__expandable--open");i.setAttribute("style","height:"+(s?r:0)+"px"),function(e,t,o){if(e)return;o.target.textContent=t?c.more:c.less}(n,s,t),setTimeout((function(){i.classList.toggle("cookies__expandable--open"),i.setAttribute("style","height:"+(s?0:r)+"px"),setTimeout((function(){i.removeAttribute("style")}),310)}),10),function(t,o){if(!t)return;var n=e.querySelector(".cookies__container"),i=n.firstElementChild.offsetHeight;n.setAttribute("style","height:"+(o?0:i)+"px"),setTimeout(function(e){return function(){e.classList.toggle("cookies--show"),n.classList.toggle("cookies__container--hide"),n.setAttribute("style","height:"+(o?i:0)+"px"),setTimeout((function(){n.removeAttribute("style")}),320)}}(e),10)}(n,s)}function l(){e.classList.add("cookies--closing"),setTimeout(function(e){return function(){e.parentNode.querySelectorAll("[data-cookie-consent]").forEach((function(e){e.parentNode.removeChild(e)})),e.parentNode.removeChild(e)}}(e),210)}},985:()=>{}},o={};function n(e){var i=o[e];if(void 0!==i)return i.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,e=[],n.O=(t,o,i,r)=>{if(!o){var s=1/0;for(l=0;l=r)&&Object.keys(n.O).every((e=>n.O[e](o[u])))?o.splice(u--,1):(c=!1,r0&&e[l-1][2]>r;l--)e[l]=e[l-1];e[l]=[o,i,r]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={879:0,314:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var i,r,[s,c,u]=o,a=0;if(s.some((t=>0!==e[t]))){for(i in c)n.o(c,i)&&(n.m[i]=c[i]);if(u)var l=u(n)}for(t&&t(o);an(148)));var i=n.O(void 0,[314],(()=>n(985)));i=n.O(i)})(); \ No newline at end of file +(()=>{var e,t={148:()=>{var e=document.querySelector("#cookies-policy"),t=document.querySelector(".cookiereset");if(t&&t.addEventListener("submit",function(e){return function(e){if(e.preventDefault(),document.querySelector("#cookies-policy"))return;window.LaravelCookieConsent.reset()}(e)}),e){var o=e.querySelector(".cookies__btn--customize"),n=e.querySelectorAll(".cookies__details"),i=e.querySelector(".cookiesBtn--accept"),r=e.querySelector(".cookiesBtn--essentials"),s=e.querySelector(".cookies__customize"),c=JSON.parse(e.getAttribute("data-text"));e.removeAttribute("data-text"),e.classList.remove("cookies--no-js"),e.classList.add("cookies--closing"),setTimeout(function(){e.classList.remove("cookies--closing")},310);for(var u=0;u2&&void 0!==arguments[2])||arguments[2];t.preventDefault(),t.target.blur();var i=e.querySelector(o.getAttribute("href")),r=i.firstElementChild.offsetHeight,s=i.classList.contains("cookies__expandable--open");i.setAttribute("style","height:"+(s?r:0)+"px"),function(e,t,o){if(e)return;o.target.textContent=t?c.more:c.less}(n,s,t),setTimeout(function(){i.classList.toggle("cookies__expandable--open"),i.setAttribute("style","height:"+(s?0:r)+"px"),setTimeout(function(){i.removeAttribute("style")},310)},10),function(t,o){if(!t)return;var n=e.querySelector(".cookies__container"),i=n.firstElementChild.offsetHeight;n.setAttribute("style","height:"+(o?0:i)+"px"),setTimeout(function(e){return function(){e.classList.toggle("cookies--show"),n.classList.toggle("cookies__container--hide"),n.setAttribute("style","height:"+(o?i:0)+"px"),setTimeout(function(){n.removeAttribute("style")},320)}}(e),10)}(n,s)}function l(){e.classList.add("cookies--closing"),setTimeout(function(e){return function(){e.parentNode&&(e.parentNode.querySelectorAll("[data-cookie-consent]").forEach(function(e){e.parentNode.removeChild(e)}),e.parentNode.removeChild(e))}}(e),210)}},985:()=>{}},o={};function n(e){var i=o[e];if(void 0!==i)return i.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,e=[],n.O=(t,o,i,r)=>{if(!o){var s=1/0;for(l=0;l=r)&&Object.keys(n.O).every(e=>n.O[e](o[u]))?o.splice(u--,1):(c=!1,r0&&e[l-1][2]>r;l--)e[l]=e[l-1];e[l]=[o,i,r]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={879:0,314:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var i,r,[s,c,u]=o,a=0;if(s.some(t=>0!==e[t])){for(i in c)n.o(c,i)&&(n.m[i]=c[i]);if(u)var l=u(n)}for(t&&t(o);an(148));var i=n.O(void 0,[314],()=>n(985));i=n.O(i)})(); \ No newline at end of file diff --git a/src/CookiesManager.php b/src/CookiesManager.php index c0b3c0f..f3d0e6c 100644 --- a/src/CookiesManager.php +++ b/src/CookiesManager.php @@ -167,11 +167,11 @@ protected function makeConsentCookie(): CookieComponent /** * Output all the scripts for current consent state. */ - public function renderScripts(bool $withDefault = true, ?string $nonce = null): string + public function renderScripts(string|null $nonce, bool $withDefault = true): string { $output = $this->shouldDisplayNotice() - ? $this->getNoticeScripts($withDefault, $nonce) - : $this->getConsentedScripts($withDefault, $nonce); + ? $this->getNoticeScripts($nonce, $withDefault) + : $this->getConsentedScripts($nonce, $withDefault); if(strlen($output)) { $output = '' . $output; @@ -180,23 +180,23 @@ public function renderScripts(bool $withDefault = true, ?string $nonce = null): return $output; } - public function getNoticeScripts(bool $withDefault, ?string $nonce = null): string + public function getNoticeScripts(string|null $nonce, bool $withDefault): string { return $withDefault ? $this->getDefaultScriptTag($nonce) : ''; } - protected function getConsentedScripts(bool $withDefault, ?string $nonce = null): string + protected function getConsentedScripts(string|null $nonce, bool $withDefault): string { - $output = $this->getNoticeScripts($withDefault, $nonce); + $output = $this->getNoticeScripts($nonce, $withDefault); - foreach ($this->getConsentResponse()->getResponseScripts() ?? [] as $tag) { + foreach ($this->getConsentResponse($nonce)->getResponseScripts() ?? [] as $tag) { $output .= $tag; } return $output; } - protected function getDefaultScriptTag(?string $nonce = null): string + protected function getDefaultScriptTag(string|null $nonce): string { return '') + ->script('') ->script( - '' + '' ) ); }); diff --git a/src/ConsentResponse.php b/src/ConsentResponse.php index c3a06b6..776bf7d 100644 --- a/src/ConsentResponse.php +++ b/src/ConsentResponse.php @@ -26,7 +26,7 @@ class ConsentResponse /** * Transform the collected data into a JSON response-object. */ - public function handleConsent(Cookie|CookiesGroup $instance): static + public function handleConsent(Cookie|CookiesGroup $instance, string|null $nonce): static { if(! $instance->hasConsentCallback()) { return $this; @@ -35,7 +35,7 @@ public function handleConsent(Cookie|CookiesGroup $instance): static $consent = $instance->getConsentResult(); $this->attachCookies($consent->getCookies()); - $this->attachScripts($consent->getScripts()); + $this->attachScripts($consent->getScripts(), $nonce); return $this; } @@ -65,20 +65,24 @@ public function attachCookie(CookieComponent $cookie): static /** * Add multiple script tags to the consent response. */ - public function attachScripts(array $tags): static + public function attachScripts(array $tags, string|null $nonce): static { foreach ($tags as $tag) { - $this->attachScript($tag); + $this->attachScript($tag, $nonce); } - + return $this; } /** * Add a single script tag to the consent response. */ - public function attachScript(string $tag): static + public function attachScript(string $tag, ?string $nonce = null): static { + if ($nonce && str_contains($tag, 'nonce=""')) { + $tag = str_replace('nonce=""', 'nonce="' . $nonce . '"', $tag); + } + $this->scripts[] = $tag; return $this; diff --git a/src/CookiesManager.php b/src/CookiesManager.php index f3d0e6c..83a68a0 100644 --- a/src/CookiesManager.php +++ b/src/CookiesManager.php @@ -8,6 +8,7 @@ class CookiesManager { + protected string|null $nonce = null; /** * The cookies registrar. */ @@ -141,13 +142,22 @@ public function accept(string|array $categories = '*'): ConsentResponse */ protected function getConsentResponse(): ConsentResponse { - return array_reduce($this->registrar->getCategories(), function($response, $category) { - return array_reduce($category->getDefined(), function(ConsentResponse $response, Cookie|CookiesGroup $instance) { - return $this->hasConsentFor($instance->name) - ? $response->handleConsent($instance) - : $response; - }, $response); - }, new ConsentResponse()); + $nonce = $this->nonce; + return array_reduce( + $this->registrar->getCategories(), + function($response, $category) use ($nonce) { + return array_reduce( + $category->getDefined(), + function(ConsentResponse $response, Cookie|CookiesGroup $instance) use ($nonce) { + return $this->hasConsentFor($instance->name) + ? $response->handleConsent($instance, $nonce) + : $response; + }, + $response + ); + }, + new ConsentResponse() + ); } /** @@ -169,6 +179,7 @@ protected function makeConsentCookie(): CookieComponent */ public function renderScripts(string|null $nonce, bool $withDefault = true): string { + $this->nonce = $nonce; $output = $this->shouldDisplayNotice() ? $this->getNoticeScripts($nonce, $withDefault) : $this->getConsentedScripts($nonce, $withDefault); @@ -283,8 +294,8 @@ public function replaceInfoTag(string $wysiwyg): string $cookieConsentInfo = view('cookie-consent::info', [ 'cookies' => $this->registrar, ])->render(); - - $formattedString = preg_replace( + + return preg_replace( [ '/\<(\w)[^\>]+\>\@cookieconsentinfo\<\/\1\>/', '/\@cookieconsentinfo/', @@ -292,7 +303,5 @@ public function replaceInfoTag(string $wysiwyg): string $cookieConsentInfo, $wysiwyg, ); - - return $formattedString; } }