diff --git a/.env.example b/.env.example index 898fd326..2002df16 100644 --- a/.env.example +++ b/.env.example @@ -56,3 +56,29 @@ VITE_PUSHER_HOST="${PUSHER_HOST}" VITE_PUSHER_PORT="${PUSHER_PORT}" VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +TORCHLIGHT_TOKEN= + +STRIPE_KEY= +STRIPE_SECRET= +STRIPE_WEBHOOK_SECRET= +STRIPE_MINI_PRICE_ID= +STRIPE_PRO_PRICE_ID= +STRIPE_MAX_PRICE_ID= +STRIPE_FOREVER_PRICE_ID= +STRIPE_TRIAL_PRICE_ID= +STRIPE_MINI_PAYMENT_LINK= +STRIPE_PRO_PAYMENT_LINK= +STRIPE_MAX_PAYMENT_LINK= +STRIPE_FOREVER_PAYMENT_LINK= +STRIPE_TRIAL_PAYMENT_LINK= + +ANYSTACK_API_KEY= +ANYSTACK_PRODUCT_ID= +ANYSTACK_MINI_POLICY_ID= +ANYSTACK_PRO_POLICY_ID= +ANYSTACK_MAX_POLICY_ID= +ANYSTACK_FOREVER_POLICY_ID= +ANYSTACK_TRIAL_POLICY_ID= + +FILAMENT_USERS= diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 00000000..d48d7ae9 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,64 @@ +# Unit and features tests +# also useful for testing new php versions +name: Tests +on: + workflow_dispatch: + push: + branches-ignore: + - 'dependabot/npm_and_yarn/*' + +jobs: + tests: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + php: [ 8.3 ] +# services: +# redis: +# image: redis +# ports: +# - 6379:6379 +# options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + steps: + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v2 + coverage: xdebug + + - name: Copy .env + run: cp .env.example .env + + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer- + + - name: Install Dependencies + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + + - name: Generate Application Key + run: php artisan key:generate + + - name: Compile Assets + run: npm install && npm run build + + - name: Run tests + env: + DB_CONNECTION: sqlite + DB_DATABASE: ":memory:" + QUEUE_CONNECTION: sync + run: ./vendor/bin/phpunit --testdox diff --git a/.gitignore b/.gitignore index 7fe978f8..9713846c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,55 @@ +# php unit /.phpunit.cache +.phpunit.result.cache + +# auth +auth.json + +# node_modules /node_modules -/public/build + +# public /public/hot /public/storage +/public/build +/public/sitemap.xml + +# storage /storage/*.key + +# vendor /vendor -.env -.env.backup -.env.production -.phpunit.result.cache + +# ide +/.fleet +/.idea +/.vscode +_ide_helper* +.phpstorm.meta.php + +# .env +.env* + +# cache +*.cache + +# homestead Homestead.json Homestead.yaml -auth.json + +# docker +docker-compose.override.yml + +# package managers npm-debug.log yarn-error.log -/.fleet -/.idea -/.vscode + +# logs +worker.log + +# windows +*:Zone.Identifier +Thumbs.db + +# mac +.DS_Store \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..705d41a7 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +**/dist +**/package-lock.json +public/build \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..2ea9bc71 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,16 @@ +{ + "plugins": ["prettier-plugin-blade", "prettier-plugin-tailwindcss"], + "overrides": [ + { + "files": ["*.blade.php"], + "options": { + "parser": "blade" + } + } + ], + "tailwindConfig": "./tailwind.config.js", + "singleQuote": true, + "semi": false, + "trailingComma": "all", + "singleAttributePerLine": true +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..cc8a1a84 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,22 @@ +Thank you for contributing! + +## Getting Started + +Be sure to fork and clone the repo: `gh repo clone NativePHP/nativephp.com` + +Make a branch for what change you want to contribute and open a pull request to the upstream main branch. + +## Torchlight + +The documentation uses [torchlight.dev](torchlight.dev) for syntax highlighting. + +Without a token, you will run into an error on pages like "/docs/desktop/1/getting-started/introduction". + +To get set up: + +1. Create an account and then make a new API token [here](https://torchlight.dev/account/api-tokens). +2. Then set the API token in the .env. + +``` +TORCHLIGHT_TOKEN= +``` diff --git a/README.md b/README.md index a8e3fadc..8808870c 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ This repo contains the content of the nativephp.com website. We welcome any contributions to improve the documentation. Please feel free to open a PR. +Also, be sure to read our [contributing guidelines](CONTRIBUTING.md) for help getting set up. + ## Issues Please raise any issues on the [NativePHP/laravel](https://github.com/NativePHP/laravel/issues) repo. diff --git a/app/Actions/Licenses/SuspendLicense.php b/app/Actions/Licenses/SuspendLicense.php new file mode 100644 index 00000000..4241712a --- /dev/null +++ b/app/Actions/Licenses/SuspendLicense.php @@ -0,0 +1,27 @@ +anystack->suspendLicense($license->anystack_product_id, $license->anystack_id); + + $license->update([ + 'is_suspended' => true, + ]); + + return $license; + } +} diff --git a/app/Console/Commands/ImportAnystackContactsCommand.php b/app/Console/Commands/ImportAnystackContactsCommand.php new file mode 100644 index 00000000..f6a96e81 --- /dev/null +++ b/app/Console/Commands/ImportAnystackContactsCommand.php @@ -0,0 +1,23 @@ +name('import-anystack-contacts') + ->dispatch(); + } +} diff --git a/app/Console/Commands/ImportAnystackLicensesCommand.php b/app/Console/Commands/ImportAnystackLicensesCommand.php new file mode 100644 index 00000000..5793e6d8 --- /dev/null +++ b/app/Console/Commands/ImportAnystackLicensesCommand.php @@ -0,0 +1,23 @@ +name('import-anystack-licenses') + ->dispatch(); + } +} diff --git a/app/Console/Commands/SendTestEmail.php b/app/Console/Commands/SendTestEmail.php new file mode 100644 index 00000000..86300a86 --- /dev/null +++ b/app/Console/Commands/SendTestEmail.php @@ -0,0 +1,23 @@ +info('Sending test email via '.Mail::getDefaultDriver().'...'); + + Notification::route('mail', $this->argument('email')) + ->notify(new TestNotification); + } +} diff --git a/app/Enums/Subscription.php b/app/Enums/Subscription.php new file mode 100644 index 00000000..d767f438 --- /dev/null +++ b/app/Enums/Subscription.php @@ -0,0 +1,72 @@ +items->first()?->price->id; + + if (! $priceId) { + throw new RuntimeException('Could not resolve Stripe price id from subscription object.'); + } + + return self::fromStripePriceId($priceId); + } + + public static function fromStripePriceId(string $priceId): self + { + return match ($priceId) { + config('subscriptions.plans.mini.stripe_price_id') => self::Mini, + config('subscriptions.plans.pro.stripe_price_id') => self::Pro, + config('subscriptions.plans.max.stripe_price_id') => self::Max, + default => throw new RuntimeException("Unknown Stripe price id: {$priceId}"), + }; + } + + public static function fromAnystackPolicy(string $policyId): self + { + return match ($policyId) { + config('subscriptions.plans.mini.anystack_policy_id') => self::Mini, + config('subscriptions.plans.pro.anystack_policy_id') => self::Pro, + config('subscriptions.plans.max.anystack_policy_id') => self::Max, + config('subscriptions.plans.forever.anystack_policy_id') => self::Forever, + config('subscriptions.plans.trial.anystack_policy_id') => self::Trial, + default => throw new RuntimeException("Unknown Anystack policy id: {$policyId}"), + }; + } + + public function name(): string + { + return config("subscriptions.plans.{$this->value}.name"); + } + + public function stripePriceId(): string + { + return config("subscriptions.plans.{$this->value}.stripe_price_id"); + } + + public function stripePaymentLink(): string + { + return config("subscriptions.plans.{$this->value}.stripe_payment_link"); + } + + public function anystackProductId(): string + { + return config("subscriptions.plans.{$this->value}.anystack_product_id"); + } + + public function anystackPolicyId(): string + { + return config("subscriptions.plans.{$this->value}.anystack_policy_id"); + } +} diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 56af2640..48ba8834 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -3,6 +3,7 @@ namespace App\Exceptions; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; +use Sentry\Laravel\Integration; use Throwable; class Handler extends ExceptionHandler @@ -18,13 +19,10 @@ class Handler extends ExceptionHandler 'password_confirmation', ]; - /** - * Register the exception handling callbacks for the application. - */ public function register(): void { $this->reportable(function (Throwable $e) { - // + Integration::captureUnhandledException($e); }); } } diff --git a/app/Extensions/TorchlightWithCopyExtension.php b/app/Extensions/TorchlightWithCopyExtension.php index 7dc82a50..07a35ddb 100644 --- a/app/Extensions/TorchlightWithCopyExtension.php +++ b/app/Extensions/TorchlightWithCopyExtension.php @@ -15,7 +15,7 @@ public function defaultBlockRenderer() return <<
-
Copied!
+
Copied!
',Dp=Number.isNaN||De.isNaN;function j(e){return typeof e=="number"&&!Dp(e)}var Tl=function(t){return t>0&&t<1/0};function oa(e){return typeof e>"u"}function lt(e){return sa(e)==="object"&&e!==null}var Cp=Object.prototype.hasOwnProperty;function It(e){if(!lt(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&Cp.call(i,"isPrototypeOf")}catch{return!1}}function be(e){return typeof e=="function"}var Bp=Array.prototype.slice;function zl(e){return Array.from?Array.from(e):Bp.call(e)}function le(e,t){return e&&be(t)&&(Array.isArray(e)||j(e.length)?zl(e).forEach(function(i,a){t.call(e,i,a,e)}):lt(e)&&Object.keys(e).forEach(function(i){t.call(e,e[i],i,e)})),e}var J=Object.assign||function(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n0&&a.forEach(function(l){lt(l)&&Object.keys(l).forEach(function(o){t[o]=l[o]})}),t},Np=/\.\d*(?:0|9){12}\d*$/;function xt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Np.test(e)?Math.round(e*t)/t:e}var kp=/^width|height|left|top|marginLeft|marginTop$/;function je(e,t){var i=e.style;le(t,function(a,n){kp.test(n)&&j(a)&&(a="".concat(a,"px")),i[n]=a})}function Vp(e,t){return e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function pe(e,t){if(t){if(j(e.length)){le(e,function(a){pe(a,t)});return}if(e.classList){e.classList.add(t);return}var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function Fe(e,t){if(t){if(j(e.length)){le(e,function(i){Fe(i,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,""))}}function vt(e,t,i){if(t){if(j(e.length)){le(e,function(a){vt(a,t,i)});return}i?pe(e,t):Fe(e,t)}}var Gp=/([a-z\d])([A-Z])/g;function xa(e){return e.replace(Gp,"$1-$2").toLowerCase()}function ba(e,t){return lt(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(xa(t)))}function Wt(e,t,i){lt(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(xa(t)),i)}function Up(e,t){if(lt(e[t]))try{delete e[t]}catch{e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch{e.dataset[t]=void 0}else e.removeAttribute("data-".concat(xa(t)))}var Ol=/\s\s*/,Fl=function(){var e=!1;if(Ti){var t=!1,i=function(){},a=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(l){t=l}});De.addEventListener("test",i,a),De.removeEventListener("test",i,a)}return e}();function Oe(e,t,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=i;t.trim().split(Ol).forEach(function(l){if(!Fl){var o=e.listeners;o&&o[l]&&o[l][i]&&(n=o[l][i],delete o[l][i],Object.keys(o[l]).length===0&&delete o[l],Object.keys(o).length===0&&delete e.listeners)}e.removeEventListener(l,n,a)})}function Se(e,t,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=i;t.trim().split(Ol).forEach(function(l){if(a.once&&!Fl){var o=e.listeners,r=o===void 0?{}:o;n=function(){delete r[l][i],e.removeEventListener(l,n,a);for(var p=arguments.length,c=new Array(p),d=0;dMath.abs(i)&&(i=m)})}),i}function bi(e,t){var i=e.pageX,a=e.pageY,n={endX:i,endY:a};return t?n:xl({startX:i,startY:a},n)}function jp(e){var t=0,i=0,a=0;return le(e,function(n){var l=n.startX,o=n.startY;t+=l,i+=o,a+=1}),t/=a,i/=a,{pageX:t,pageY:i}}function Ye(e){var t=e.aspectRatio,i=e.height,a=e.width,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",l=Tl(a),o=Tl(i);if(l&&o){var r=i*t;n==="contain"&&r>a||n==="cover"&&r90?{width:s,height:r}:{width:r,height:s}}function qp(e,t,i,a){var n=t.aspectRatio,l=t.naturalWidth,o=t.naturalHeight,r=t.rotate,s=r===void 0?0:r,p=t.scaleX,c=p===void 0?1:p,d=t.scaleY,m=d===void 0?1:d,u=i.aspectRatio,g=i.naturalWidth,f=i.naturalHeight,h=a.fillColor,I=h===void 0?"transparent":h,b=a.imageSmoothingEnabled,T=b===void 0?!0:b,v=a.imageSmoothingQuality,y=v===void 0?"low":v,E=a.maxWidth,_=E===void 0?1/0:E,x=a.maxHeight,R=x===void 0?1/0:x,z=a.minWidth,P=z===void 0?0:z,A=a.minHeight,B=A===void 0?0:A,w=document.createElement("canvas"),O=w.getContext("2d"),S=Ye({aspectRatio:u,width:_,height:R}),L=Ye({aspectRatio:u,width:P,height:B},"cover"),D=Math.min(S.width,Math.max(L.width,g)),F=Math.min(S.height,Math.max(L.height,f)),G=Ye({aspectRatio:n,width:_,height:R}),C=Ye({aspectRatio:n,width:P,height:B},"cover"),q=Math.min(G.width,Math.max(C.width,l)),X=Math.min(G.height,Math.max(C.height,o)),K=[-q/2,-X/2,q,X];return w.width=xt(D),w.height=xt(F),O.fillStyle=I,O.fillRect(0,0,D,F),O.save(),O.translate(D/2,F/2),O.rotate(s*Math.PI/180),O.scale(c,m),O.imageSmoothingEnabled=T,O.imageSmoothingQuality=y,O.drawImage.apply(O,[e].concat(Rl(K.map(function(oe){return Math.floor(xt(oe))})))),O.restore(),w}var Cl=String.fromCharCode;function $p(e,t,i){var a="";i+=t;for(var n=t;n0;)i.push(Cl.apply(null,zl(n.subarray(0,a)))),n=n.subarray(a);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}function Zp(e){var t=new DataView(e),i;try{var a,n,l;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var o=t.byteLength,r=2;r+1=8&&(l=p+d)}}}if(l){var m=t.getUint16(l,a),u,g;for(g=0;g=0?l:Al),height:Math.max(a.offsetHeight,o>=0?o:Pl)};this.containerData=r,je(n,{width:r.width,height:r.height}),pe(t,Ee),Fe(n,Ee)},initCanvas:function(){var t=this.containerData,i=this.imageData,a=this.options.viewMode,n=Math.abs(i.rotate)%180===90,l=n?i.naturalHeight:i.naturalWidth,o=n?i.naturalWidth:i.naturalHeight,r=l/o,s=t.width,p=t.height;t.height*r>t.width?a===3?s=t.height*r:p=t.width/r:a===3?p=t.width/r:s=t.height*r;var c={aspectRatio:r,naturalWidth:l,naturalHeight:o,width:s,height:p};this.canvasData=c,this.limited=a===1||a===2,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(t.width-c.width)/2,c.top=(t.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=J({},c)},limitCanvas:function(t,i){var a=this.options,n=this.containerData,l=this.canvasData,o=this.cropBoxData,r=a.viewMode,s=l.aspectRatio,p=this.cropped&&o;if(t){var c=Number(a.minCanvasWidth)||0,d=Number(a.minCanvasHeight)||0;r>1?(c=Math.max(c,n.width),d=Math.max(d,n.height),r===3&&(d*s>c?c=d*s:d=c/s)):r>0&&(c?c=Math.max(c,p?o.width:0):d?d=Math.max(d,p?o.height:0):p&&(c=o.width,d=o.height,d*s>c?c=d*s:d=c/s));var m=Ye({aspectRatio:s,width:c,height:d});c=m.width,d=m.height,l.minWidth=c,l.minHeight=d,l.maxWidth=1/0,l.maxHeight=1/0}if(i)if(r>(p?0:1)){var u=n.width-l.width,g=n.height-l.height;l.minLeft=Math.min(0,u),l.minTop=Math.min(0,g),l.maxLeft=Math.max(0,u),l.maxTop=Math.max(0,g),p&&this.limited&&(l.minLeft=Math.min(o.left,o.left+(o.width-l.width)),l.minTop=Math.min(o.top,o.top+(o.height-l.height)),l.maxLeft=o.left,l.maxTop=o.top,r===2&&(l.width>=n.width&&(l.minLeft=Math.min(0,u),l.maxLeft=Math.max(0,u)),l.height>=n.height&&(l.minTop=Math.min(0,g),l.maxTop=Math.max(0,g))))}else l.minLeft=-l.width,l.minTop=-l.height,l.maxLeft=n.width,l.maxTop=n.height},renderCanvas:function(t,i){var a=this.canvasData,n=this.imageData;if(i){var l=Yp({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),o=l.width,r=l.height,s=a.width*(o/a.naturalWidth),p=a.height*(r/a.naturalHeight);a.left-=(s-a.width)/2,a.top-=(p-a.height)/2,a.width=s,a.height=p,a.aspectRatio=o/r,a.naturalWidth=o,a.naturalHeight=r,this.limitCanvas(!0,!1)}(a.width>a.maxWidth||a.widtha.maxHeight||a.heighti.width?l.height=l.width/a:l.width=l.height*a),this.cropBoxData=l,this.limitCropBox(!0,!0),l.width=Math.min(Math.max(l.width,l.minWidth),l.maxWidth),l.height=Math.min(Math.max(l.height,l.minHeight),l.maxHeight),l.width=Math.max(l.minWidth,l.width*n),l.height=Math.max(l.minHeight,l.height*n),l.left=i.left+(i.width-l.width)/2,l.top=i.top+(i.height-l.height)/2,l.oldLeft=l.left,l.oldTop=l.top,this.initialCropBoxData=J({},l)},limitCropBox:function(t,i){var a=this.options,n=this.containerData,l=this.canvasData,o=this.cropBoxData,r=this.limited,s=a.aspectRatio;if(t){var p=Number(a.minCropBoxWidth)||0,c=Number(a.minCropBoxHeight)||0,d=r?Math.min(n.width,l.width,l.width+l.left,n.width-l.left):n.width,m=r?Math.min(n.height,l.height,l.height+l.top,n.height-l.top):n.height;p=Math.min(p,n.width),c=Math.min(c,n.height),s&&(p&&c?c*s>p?c=p/s:p=c*s:p?c=p/s:c&&(p=c*s),m*s>d?m=d/s:d=m*s),o.minWidth=Math.min(p,d),o.minHeight=Math.min(c,m),o.maxWidth=d,o.maxHeight=m}i&&(r?(o.minLeft=Math.max(0,l.left),o.minTop=Math.max(0,l.top),o.maxLeft=Math.min(n.width,l.left+l.width)-o.width,o.maxTop=Math.min(n.height,l.top+l.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=n.width-o.width,o.maxTop=n.height-o.height))},renderCropBox:function(){var t=this.options,i=this.containerData,a=this.cropBoxData;(a.width>a.maxWidth||a.widtha.maxHeight||a.height=i.width&&a.height>=i.height?_l:Ia),je(this.cropBox,J({width:a.width,height:a.height},Gt({translateX:a.left,translateY:a.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),yt(this.element,ma,this.getData())}},tm={initPreview:function(){var t=this.element,i=this.crossOrigin,a=this.options.preview,n=i?this.crossOriginUrl:this.url,l=t.alt||"The image to preview",o=document.createElement("img");if(i&&(o.crossOrigin=i),o.src=n,o.alt=l,this.viewBox.appendChild(o),this.viewBoxImage=o,!!a){var r=a;typeof a=="string"?r=t.ownerDocument.querySelectorAll(a):a.querySelector&&(r=[a]),this.previews=r,le(r,function(s){var p=document.createElement("img");Wt(s,hi,{width:s.offsetWidth,height:s.offsetHeight,html:s.innerHTML}),i&&(p.crossOrigin=i),p.src=n,p.alt=l,p.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',s.innerHTML="",s.appendChild(p)})}},resetPreview:function(){le(this.previews,function(t){var i=ba(t,hi);je(t,{width:i.width,height:i.height}),t.innerHTML=i.html,Up(t,hi)})},preview:function(){var t=this.imageData,i=this.canvasData,a=this.cropBoxData,n=a.width,l=a.height,o=t.width,r=t.height,s=a.left-i.left-t.left,p=a.top-i.top-t.top;!this.cropped||this.disabled||(je(this.viewBoxImage,J({width:o,height:r},Gt(J({translateX:-s,translateY:-p},t)))),le(this.previews,function(c){var d=ba(c,hi),m=d.width,u=d.height,g=m,f=u,h=1;n&&(h=m/n,f=l*h),l&&f>u&&(h=u/l,g=n*h,f=u),je(c,{width:g,height:f}),je(c.getElementsByTagName("img")[0],J({width:o*h,height:r*h},Gt(J({translateX:-s*h,translateY:-p*h},t))))}))}},im={bind:function(){var t=this.element,i=this.options,a=this.cropper;be(i.cropstart)&&Se(t,fa,i.cropstart),be(i.cropmove)&&Se(t,ga,i.cropmove),be(i.cropend)&&Se(t,ua,i.cropend),be(i.crop)&&Se(t,ma,i.crop),be(i.zoom)&&Se(t,ha,i.zoom),Se(a,pl,this.onCropStart=this.cropStart.bind(this)),i.zoomable&&i.zoomOnWheel&&Se(a,hl,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&Se(a,dl,this.onDblclick=this.dblclick.bind(this)),Se(t.ownerDocument,ml,this.onCropMove=this.cropMove.bind(this)),Se(t.ownerDocument,ul,this.onCropEnd=this.cropEnd.bind(this)),i.responsive&&Se(window,fl,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,i=this.options,a=this.cropper;be(i.cropstart)&&Oe(t,fa,i.cropstart),be(i.cropmove)&&Oe(t,ga,i.cropmove),be(i.cropend)&&Oe(t,ua,i.cropend),be(i.crop)&&Oe(t,ma,i.crop),be(i.zoom)&&Oe(t,ha,i.zoom),Oe(a,pl,this.onCropStart),i.zoomable&&i.zoomOnWheel&&Oe(a,hl,this.onWheel,{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&Oe(a,dl,this.onDblclick),Oe(t.ownerDocument,ml,this.onCropMove),Oe(t.ownerDocument,ul,this.onCropEnd),i.responsive&&Oe(window,fl,this.onResize)}},am={resize:function(){if(!this.disabled){var t=this.options,i=this.container,a=this.containerData,n=i.offsetWidth/a.width,l=i.offsetHeight/a.height,o=Math.abs(n-1)>Math.abs(l-1)?n:l;if(o!==1){var r,s;t.restore&&(r=this.getCanvasData(),s=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(le(r,function(p,c){r[c]=p*o})),this.setCropBoxData(le(s,function(p,c){s[c]=p*o})))}}},dblclick:function(){this.disabled||this.options.dragMode===Ml||this.setDragMode(Vp(this.dragBox,da)?Ll:va)},wheel:function(t){var i=this,a=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*a,t)))},cropStart:function(t){var i=t.buttons,a=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(j(i)&&i!==1||j(a)&&a!==0||t.ctrlKey))){var n=this.options,l=this.pointers,o;t.changedTouches?le(t.changedTouches,function(r){l[r.identifier]=bi(r)}):l[t.pointerId||0]=bi(t),Object.keys(l).length>1&&n.zoomable&&n.zoomOnTouch?o=wl:o=ba(t.target,Ut),Ap.test(o)&&yt(this.element,fa,{originalEvent:t,action:o})!==!1&&(t.preventDefault(),this.action=o,this.cropping=!1,o===Sl&&(this.cropping=!0,pe(this.dragBox,Ei)))}},cropMove:function(t){var i=this.action;if(!(this.disabled||!i)){var a=this.pointers;t.preventDefault(),yt(this.element,ga,{originalEvent:t,action:i})!==!1&&(t.changedTouches?le(t.changedTouches,function(n){J(a[n.identifier]||{},bi(n,!0))}):J(a[t.pointerId||0]||{},bi(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,a=this.pointers;t.changedTouches?le(t.changedTouches,function(n){delete a[n.identifier]}):delete a[t.pointerId||0],i&&(t.preventDefault(),Object.keys(a).length||(this.action=""),this.cropping&&(this.cropping=!1,vt(this.dragBox,Ei,this.cropped&&this.options.modal)),yt(this.element,ua,{originalEvent:t,action:i}))}}},nm={change:function(t){var i=this.options,a=this.canvasData,n=this.containerData,l=this.cropBoxData,o=this.pointers,r=this.action,s=i.aspectRatio,p=l.left,c=l.top,d=l.width,m=l.height,u=p+d,g=c+m,f=0,h=0,I=n.width,b=n.height,T=!0,v;!s&&t.shiftKey&&(s=d&&m?d/m:1),this.limited&&(f=l.minLeft,h=l.minTop,I=f+Math.min(n.width,a.width,a.left+a.width),b=h+Math.min(n.height,a.height,a.top+a.height));var y=o[Object.keys(o)[0]],E={x:y.endX-y.startX,y:y.endY-y.startY},_=function(R){switch(R){case at:u+E.x>I&&(E.x=I-u);break;case nt:p+E.xb&&(E.y=b-g);break}};switch(r){case Ia:p+=E.x,c+=E.y;break;case at:if(E.x>=0&&(u>=I||s&&(c<=h||g>=b))){T=!1;break}_(at),d+=E.x,d<0&&(r=nt,d=-d,p-=d),s&&(m=d/s,c+=(l.height-m)/2);break;case He:if(E.y<=0&&(c<=h||s&&(p<=f||u>=I))){T=!1;break}_(He),m-=E.y,c+=E.y,m<0&&(r=Tt,m=-m,c-=m),s&&(d=m*s,p+=(l.width-d)/2);break;case nt:if(E.x<=0&&(p<=f||s&&(c<=h||g>=b))){T=!1;break}_(nt),d-=E.x,p+=E.x,d<0&&(r=at,d=-d,p-=d),s&&(m=d/s,c+=(l.height-m)/2);break;case Tt:if(E.y>=0&&(g>=b||s&&(p<=f||u>=I))){T=!1;break}_(Tt),m+=E.y,m<0&&(r=He,m=-m,c-=m),s&&(d=m*s,p+=(l.width-d)/2);break;case Bt:if(s){if(E.y<=0&&(c<=h||u>=I)){T=!1;break}_(He),m-=E.y,c+=E.y,d=m*s}else _(He),_(at),E.x>=0?uh&&(m-=E.y,c+=E.y):(m-=E.y,c+=E.y);d<0&&m<0?(r=Vt,m=-m,d=-d,c-=m,p-=d):d<0?(r=Nt,d=-d,p-=d):m<0&&(r=kt,m=-m,c-=m);break;case Nt:if(s){if(E.y<=0&&(c<=h||p<=f)){T=!1;break}_(He),m-=E.y,c+=E.y,d=m*s,p+=l.width-d}else _(He),_(nt),E.x<=0?p>f?(d-=E.x,p+=E.x):E.y<=0&&c<=h&&(T=!1):(d-=E.x,p+=E.x),E.y<=0?c>h&&(m-=E.y,c+=E.y):(m-=E.y,c+=E.y);d<0&&m<0?(r=kt,m=-m,d=-d,c-=m,p-=d):d<0?(r=Bt,d=-d,p-=d):m<0&&(r=Vt,m=-m,c-=m);break;case Vt:if(s){if(E.x<=0&&(p<=f||g>=b)){T=!1;break}_(nt),d-=E.x,p+=E.x,m=d/s}else _(Tt),_(nt),E.x<=0?p>f?(d-=E.x,p+=E.x):E.y>=0&&g>=b&&(T=!1):(d-=E.x,p+=E.x),E.y>=0?g=0&&(u>=I||g>=b)){T=!1;break}_(at),d+=E.x,m=d/s}else _(Tt),_(at),E.x>=0?u=0&&g>=b&&(T=!1):d+=E.x,E.y>=0?g0?r=E.y>0?kt:Bt:E.x<0&&(p-=d,r=E.y>0?Vt:Nt),E.y<0&&(c-=m),this.cropped||(Fe(this.cropBox,Ee),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}T&&(l.width=d,l.height=m,l.left=p,l.top=c,this.action=r,this.renderCropBox()),le(o,function(x){x.startX=x.endX,x.startY=x.endY})}},lm={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&pe(this.dragBox,Ei),Fe(this.cropBox,Ee),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=J({},this.initialImageData),this.canvasData=J({},this.initialCanvasData),this.cropBoxData=J({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(J(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Fe(this.dragBox,Ei),pe(this.cropBox,Ee)),this},replace:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),i?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,le(this.previews,function(a){a.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Fe(this.cropper,sl)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,pe(this.cropper,sl)),this},destroy:function(){var t=this.element;return t[Z]?(t[Z]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.canvasData,n=a.left,l=a.top;return this.moveTo(oa(t)?t:n+Number(t),oa(i)?i:l+Number(i))},moveTo:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.canvasData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(j(t)&&(a.left=t,n=!0),j(i)&&(a.top=i,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,i){var a=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(a.width*t/a.naturalWidth,null,i)},zoomTo:function(t,i,a){var n=this.options,l=this.canvasData,o=l.width,r=l.height,s=l.naturalWidth,p=l.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&n.zoomable){var c=s*t,d=p*t;if(yt(this.element,ha,{ratio:t,oldRatio:o/s,originalEvent:a})===!1)return this;if(a){var m=this.pointers,u=Dl(this.cropper),g=m&&Object.keys(m).length?jp(m):{pageX:a.pageX,pageY:a.pageY};l.left-=(c-o)*((g.pageX-u.left-l.left)/o),l.top-=(d-r)*((g.pageY-u.top-l.top)/r)}else It(i)&&j(i.x)&&j(i.y)?(l.left-=(c-o)*((i.x-l.left)/o),l.top-=(d-r)*((i.y-l.top)/r)):(l.left-=(c-o)/2,l.top-=(d-r)/2);l.width=c,l.height=d,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),j(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var i=this.imageData.scaleY;return this.scale(t,j(i)?i:1)},scaleY:function(t){var i=this.imageData.scaleX;return this.scale(j(i)?i:1,t)},scale:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,a=this.imageData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(j(t)&&(a.scaleX=t,n=!0),j(i)&&(a.scaleY=i,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.options,a=this.imageData,n=this.canvasData,l=this.cropBoxData,o;if(this.ready&&this.cropped){o={x:l.left-n.left,y:l.top-n.top,width:l.width,height:l.height};var r=a.width/a.naturalWidth;if(le(o,function(c,d){o[d]=c/r}),t){var s=Math.round(o.y+o.height),p=Math.round(o.x+o.width);o.x=Math.round(o.x),o.y=Math.round(o.y),o.width=p-o.x,o.height=s-o.y}}else o={x:0,y:0,width:0,height:0};return i.rotatable&&(o.rotate=a.rotate||0),i.scalable&&(o.scaleX=a.scaleX||1,o.scaleY=a.scaleY||1),o},setData:function(t){var i=this.options,a=this.imageData,n=this.canvasData,l={};if(this.ready&&!this.disabled&&It(t)){var o=!1;i.rotatable&&j(t.rotate)&&t.rotate!==a.rotate&&(a.rotate=t.rotate,o=!0),i.scalable&&(j(t.scaleX)&&t.scaleX!==a.scaleX&&(a.scaleX=t.scaleX,o=!0),j(t.scaleY)&&t.scaleY!==a.scaleY&&(a.scaleY=t.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var r=a.width/a.naturalWidth;j(t.x)&&(l.left=t.x*r+n.left),j(t.y)&&(l.top=t.y*r+n.top),j(t.width)&&(l.width=t.width*r),j(t.height)&&(l.height=t.height*r),this.setCropBoxData(l)}return this},getContainerData:function(){return this.ready?J({},this.containerData):{}},getImageData:function(){return this.sized?J({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,i={};return this.ready&&le(["left","top","width","height","naturalWidth","naturalHeight"],function(a){i[a]=t[a]}),i},setCanvasData:function(t){var i=this.canvasData,a=i.aspectRatio;return this.ready&&!this.disabled&&It(t)&&(j(t.left)&&(i.left=t.left),j(t.top)&&(i.top=t.top),j(t.width)?(i.width=t.width,i.height=t.width/a):j(t.height)&&(i.height=t.height,i.width=t.height*a),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,i;return this.ready&&this.cropped&&(i={left:t.left,top:t.top,width:t.width,height:t.height}),i||{}},setCropBoxData:function(t){var i=this.cropBoxData,a=this.options.aspectRatio,n,l;return this.ready&&this.cropped&&!this.disabled&&It(t)&&(j(t.left)&&(i.left=t.left),j(t.top)&&(i.top=t.top),j(t.width)&&t.width!==i.width&&(n=!0,i.width=t.width),j(t.height)&&t.height!==i.height&&(l=!0,i.height=t.height),a&&(n?i.height=i.width/a:l&&(i.width=i.height*a)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var i=this.canvasData,a=qp(this.image,this.imageData,i,t);if(!this.cropped)return a;var n=this.getData(t.rounded),l=n.x,o=n.y,r=n.width,s=n.height,p=a.width/Math.floor(i.naturalWidth);p!==1&&(l*=p,o*=p,r*=p,s*=p);var c=r/s,d=Ye({aspectRatio:c,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),m=Ye({aspectRatio:c,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=Ye({aspectRatio:c,width:t.width||(p!==1?a.width:r),height:t.height||(p!==1?a.height:s)}),g=u.width,f=u.height;g=Math.min(d.width,Math.max(m.width,g)),f=Math.min(d.height,Math.max(m.height,f));var h=document.createElement("canvas"),I=h.getContext("2d");h.width=xt(g),h.height=xt(f),I.fillStyle=t.fillColor||"transparent",I.fillRect(0,0,g,f);var b=t.imageSmoothingEnabled,T=b===void 0?!0:b,v=t.imageSmoothingQuality;I.imageSmoothingEnabled=T,v&&(I.imageSmoothingQuality=v);var y=a.width,E=a.height,_=l,x=o,R,z,P,A,B,w;_<=-r||_>y?(_=0,R=0,P=0,B=0):_<=0?(P=-_,_=0,R=Math.min(y,r+_),B=R):_<=y&&(P=0,R=Math.min(r,y-_),B=R),R<=0||x<=-s||x>E?(x=0,z=0,A=0,w=0):x<=0?(A=-x,x=0,z=Math.min(E,s+x),w=z):x<=E&&(A=0,z=Math.min(s,E-x),w=z);var O=[_,x,R,z];if(B>0&&w>0){var S=g/r;O.push(P*S,A*S,B*S,w*S)}return I.drawImage.apply(I,[a].concat(Rl(O.map(function(L){return Math.floor(xt(L))})))),h},setAspectRatio:function(t){var i=this.options;return!this.disabled&&!oa(t)&&(i.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var i=this.options,a=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var l=t===va,o=i.movable&&t===Ll;t=l||o?t:Ml,i.dragMode=t,Wt(a,Ut,t),vt(a,da,l),vt(a,pa,o),i.cropBoxMovable||(Wt(n,Ut,t),vt(n,da,l),vt(n,pa,o))}return this}},om=De.Cropper,ya=function(){function e(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Tp(this,e),!t||!Op.test(t.tagName))throw new Error("The first argument is required and must be an or element.");this.element=t,this.options=J({},El,It(i)&&i),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Ip(e,[{key:"init",value:function(){var i=this.element,a=i.tagName.toLowerCase(),n;if(!i[Z]){if(i[Z]=this,a==="img"){if(this.isImg=!0,n=i.getAttribute("src")||"",this.originalUrl=n,!n)return;n=i.src}else a==="canvas"&&window.HTMLCanvasElement&&(n=i.toDataURL());this.load(n)}}},{key:"load",value:function(i){var a=this;if(i){this.url=i,this.imageData={};var n=this.element,l=this.options;if(!l.rotatable&&!l.scalable&&(l.checkOrientation=!1),!l.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Pp.test(i)){zp.test(i)?this.read(Kp(i)):this.clone();return}var o=new XMLHttpRequest,r=this.clone.bind(this);this.reloading=!0,this.xhr=o,o.onabort=r,o.onerror=r,o.ontimeout=r,o.onprogress=function(){o.getResponseHeader("content-type")!==bl&&o.abort()},o.onload=function(){a.read(o.response)},o.onloadend=function(){a.reloading=!1,a.xhr=null},l.checkCrossOrigin&&Il(i)&&n.crossOrigin&&(i=vl(i)),o.open("GET",i,!0),o.responseType="arraybuffer",o.withCredentials=n.crossOrigin==="use-credentials",o.send()}}},{key:"read",value:function(i){var a=this.options,n=this.imageData,l=Zp(i),o=0,r=1,s=1;if(l>1){this.url=Qp(i,bl);var p=Jp(l);o=p.rotate,r=p.scaleX,s=p.scaleY}a.rotatable&&(n.rotate=o),a.scalable&&(n.scaleX=r,n.scaleY=s),this.clone()}},{key:"clone",value:function(){var i=this.element,a=this.url,n=i.crossOrigin,l=a;this.options.checkCrossOrigin&&Il(a)&&(n||(n="anonymous"),l=vl(a)),this.crossOrigin=n,this.crossOriginUrl=l;var o=document.createElement("img");n&&(o.crossOrigin=n),o.src=l||a,o.alt=i.alt||"The image to crop",this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),pe(o,cl),i.parentNode.insertBefore(o,i.nextSibling)}},{key:"start",value:function(){var i=this,a=this.image;a.onload=null,a.onerror=null,this.sizing=!0;var n=De.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(De.navigator.userAgent),l=function(p,c){J(i.imageData,{naturalWidth:p,naturalHeight:c,aspectRatio:p/c}),i.initialImageData=J({},i.imageData),i.sizing=!1,i.sized=!0,i.build()};if(a.naturalWidth&&!n){l(a.naturalWidth,a.naturalHeight);return}var o=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){l(o.width,o.height),n||r.removeChild(o)},o.src=a.src,n||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",r.appendChild(o))}},{key:"stop",value:function(){var i=this.image;i.onload=null,i.onerror=null,i.parentNode.removeChild(i),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var i=this.element,a=this.options,n=this.image,l=i.parentNode,o=document.createElement("div");o.innerHTML=Fp;var r=o.querySelector(".".concat(Z,"-container")),s=r.querySelector(".".concat(Z,"-canvas")),p=r.querySelector(".".concat(Z,"-drag-box")),c=r.querySelector(".".concat(Z,"-crop-box")),d=c.querySelector(".".concat(Z,"-face"));this.container=l,this.cropper=r,this.canvas=s,this.dragBox=p,this.cropBox=c,this.viewBox=r.querySelector(".".concat(Z,"-view-box")),this.face=d,s.appendChild(n),pe(i,Ee),l.insertBefore(r,i.nextSibling),Fe(n,cl),this.initPreview(),this.bind(),a.initialAspectRatio=Math.max(0,a.initialAspectRatio)||NaN,a.aspectRatio=Math.max(0,a.aspectRatio)||NaN,a.viewMode=Math.max(0,Math.min(3,Math.round(a.viewMode)))||0,pe(c,Ee),a.guides||pe(c.getElementsByClassName("".concat(Z,"-dashed")),Ee),a.center||pe(c.getElementsByClassName("".concat(Z,"-center")),Ee),a.background&&pe(r,"".concat(Z,"-bg")),a.highlight||pe(d,_p),a.cropBoxMovable&&(pe(d,pa),Wt(d,Ut,Ia)),a.cropBoxResizable||(pe(c.getElementsByClassName("".concat(Z,"-line")),Ee),pe(c.getElementsByClassName("".concat(Z,"-point")),Ee)),this.render(),this.ready=!0,this.setDragMode(a.dragMode),a.autoCrop&&this.crop(),this.setData(a.data),be(a.ready)&&Se(i,gl,a.ready,{once:!0}),yt(i,gl)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var i=this.cropper.parentNode;i&&i.removeChild(this.cropper),Fe(this.element,Ee)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=om,e}},{key:"setDefaults",value:function(i){J(El,It(i)&&i)}}])}();J(ya.prototype,em,tm,im,am,nm,lm);var Bl={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.slides":["ggs"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.gov.sk.xmldatacontainer+xml":["xdcf"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.nato.bindingdataobject+xml":["bdo"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.bary":["bary"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["*mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(Bl);var Nl=Bl;var kl={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(kl);var Vl=kl;var _e=function(e,t,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(e):a?a.value:t.get(e)},Rt,Ht,ot,Ra=class{constructor(...t){Rt.set(this,new Map),Ht.set(this,new Map),ot.set(this,new Map);for(let i of t)this.define(i)}define(t,i=!1){for(let[a,n]of Object.entries(t)){a=a.toLowerCase(),n=n.map(r=>r.toLowerCase()),_e(this,ot,"f").has(a)||_e(this,ot,"f").set(a,new Set);let l=_e(this,ot,"f").get(a),o=!0;for(let r of n){let s=r.startsWith("*");if(r=s?r.slice(1):r,l?.add(r),o&&_e(this,Ht,"f").set(a,r),o=!1,s)continue;let p=_e(this,Rt,"f").get(r);if(p&&p!=a&&!i)throw new Error(`"${a} -> ${r}" conflicts with "${p} -> ${r}". Pass \`force=true\` to override this definition.`);_e(this,Rt,"f").set(r,a)}}return this}getType(t){if(typeof t!="string")return null;let i=t.replace(/^.*[/\\]/,"").toLowerCase(),a=i.replace(/^.*\./,"").toLowerCase(),n=i.length{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(let t of _e(this,ot,"f").values())Object.freeze(t);return this}_getTestState(){return{types:_e(this,Rt,"f"),extensions:_e(this,Ht,"f")}}};Rt=new WeakMap,Ht=new WeakMap,ot=new WeakMap;var Sa=Ra;var Gl=new Sa(Vl,Nl)._freeze();var Ul=({addFilter:e,utils:t})=>{let{Type:i,replaceInString:a,toNaturalFileSize:n}=t;return e("ALLOW_HOPPER_ITEM",(l,{query:o})=>{if(!o("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;let r=o("GET_MAX_FILE_SIZE");if(r!==null&&l.size>r)return!1;let s=o("GET_MIN_FILE_SIZE");return!(s!==null&&l.sizenew Promise((r,s)=>{if(!o("GET_ALLOW_FILE_SIZE_VALIDATION"))return r(l);let p=o("GET_FILE_VALIDATE_SIZE_FILTER");if(p&&!p(l))return r(l);let c=o("GET_MAX_FILE_SIZE");if(c!==null&&l.size>c){s({status:{main:o("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:a(o("GET_LABEL_MAX_FILE_SIZE"),{filesize:n(c,".",o("GET_FILE_SIZE_BASE"),o("GET_FILE_SIZE_LABELS",o))})}});return}let d=o("GET_MIN_FILE_SIZE");if(d!==null&&l.sizeg+f.fileSize,0)>m){s({status:{main:o("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:a(o("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:n(m,".",o("GET_FILE_SIZE_BASE"),o("GET_FILE_SIZE_LABELS",o))})}});return}r(l)})),{options:{allowFileSizeValidation:[!0,i.BOOLEAN],maxFileSize:[null,i.INT],minFileSize:[null,i.INT],maxTotalFileSize:[null,i.INT],fileValidateSizeFilter:[null,i.FUNCTION],labelMinFileSizeExceeded:["File is too small",i.STRING],labelMinFileSize:["Minimum file size is {filesize}",i.STRING],labelMaxFileSizeExceeded:["File is too large",i.STRING],labelMaxFileSize:["Maximum file size is {filesize}",i.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",i.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",i.STRING]}}},rm=typeof window<"u"&&typeof window.document<"u";rm&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Ul}));var Wl=Ul;var Hl=({addFilter:e,utils:t})=>{let{Type:i,isString:a,replaceInString:n,guesstimateMimeType:l,getExtensionFromFilename:o,getFilenameFromURL:r}=t,s=(u,g)=>{let f=(/^[^/]+/.exec(u)||[]).pop(),h=g.slice(0,-2);return f===h},p=(u,g)=>u.some(f=>/\*$/.test(f)?s(g,f):f===g),c=u=>{let g="";if(a(u)){let f=r(u),h=o(f);h&&(g=l(h))}else g=u.type;return g},d=(u,g,f)=>{if(g.length===0)return!0;let h=c(u);return f?new Promise((I,b)=>{f(u,h).then(T=>{p(g,T)?I():b()}).catch(b)}):p(g,h)},m=u=>g=>u[g]===null?!1:u[g]||g;return e("SET_ATTRIBUTE_TO_OPTION_MAP",u=>Object.assign(u,{accept:"acceptedFileTypes"})),e("ALLOW_HOPPER_ITEM",(u,{query:g})=>g("GET_ALLOW_FILE_TYPE_VALIDATION")?d(u,g("GET_ACCEPTED_FILE_TYPES")):!0),e("LOAD_FILE",(u,{query:g})=>new Promise((f,h)=>{if(!g("GET_ALLOW_FILE_TYPE_VALIDATION")){f(u);return}let I=g("GET_ACCEPTED_FILE_TYPES"),b=g("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),T=d(u,I,b),v=()=>{let y=I.map(m(g("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"))).filter(_=>_!==!1),E=y.filter((_,x)=>y.indexOf(_)===x);h({status:{main:g("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:n(g("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:E.join(", "),allButLastType:E.slice(0,-1).join(", "),lastType:E[E.length-1]})}})};if(typeof T=="boolean")return T?f(u):v();T.then(()=>{f(u)}).catch(v)})),{options:{allowFileTypeValidation:[!0,i.BOOLEAN],acceptedFileTypes:[[],i.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",i.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",i.STRING],fileValidateTypeLabelExpectedTypesMap:[{},i.OBJECT],fileValidateTypeDetectType:[null,i.FUNCTION]}}},sm=typeof window<"u"&&typeof window.document<"u";sm&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Hl}));var jl=Hl;var Yl=e=>/^image/.test(e.type),ql=({addFilter:e,utils:t})=>{let{Type:i,isFile:a,getNumericAspectRatioFromString:n}=t,l=(p,c)=>!(!Yl(p.file)||!c("GET_ALLOW_IMAGE_CROP")),o=p=>typeof p=="object",r=p=>typeof p=="number",s=(p,c)=>p.setMetadata("crop",Object.assign({},p.getMetadata("crop"),c));return e("DID_CREATE_ITEM",(p,{query:c})=>{p.extend("setImageCrop",d=>{if(!(!l(p,c)||!o(center)))return p.setMetadata("crop",d),d}),p.extend("setImageCropCenter",d=>{if(!(!l(p,c)||!o(d)))return s(p,{center:d})}),p.extend("setImageCropZoom",d=>{if(!(!l(p,c)||!r(d)))return s(p,{zoom:Math.max(1,d)})}),p.extend("setImageCropRotation",d=>{if(!(!l(p,c)||!r(d)))return s(p,{rotation:d})}),p.extend("setImageCropFlip",d=>{if(!(!l(p,c)||!o(d)))return s(p,{flip:d})}),p.extend("setImageCropAspectRatio",d=>{if(!l(p,c)||typeof d>"u")return;let m=p.getMetadata("crop"),u=n(d),g={center:{x:.5,y:.5},flip:m?Object.assign({},m.flip):{horizontal:!1,vertical:!1},rotation:0,zoom:1,aspectRatio:u};return p.setMetadata("crop",g),g})}),e("DID_LOAD_ITEM",(p,{query:c})=>new Promise((d,m)=>{let u=p.file;if(!a(u)||!Yl(u)||!c("GET_ALLOW_IMAGE_CROP")||p.getMetadata("crop"))return d(p);let f=c("GET_IMAGE_CROP_ASPECT_RATIO");p.setMetadata("crop",{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},rotation:0,zoom:1,aspectRatio:f?n(f):null}),d(p)})),{options:{allowImageCrop:[!0,i.BOOLEAN],imageCropAspectRatio:[null,i.STRING]}}},cm=typeof window<"u"&&typeof window.document<"u";cm&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:ql}));var $l=ql;var _a=e=>/^image/.test(e.type),Xl=e=>{let{addFilter:t,utils:i,views:a}=e,{Type:n,createRoute:l,createItemAPI:o=c=>c}=i,{fileActionButton:r}=a;t("SHOULD_REMOVE_ON_REVERT",(c,{item:d,query:m})=>new Promise(u=>{let{file:g}=d,f=m("GET_ALLOW_IMAGE_EDIT")&&m("GET_IMAGE_EDIT_ALLOW_EDIT")&&_a(g);u(!f)})),t("DID_LOAD_ITEM",(c,{query:d,dispatch:m})=>new Promise((u,g)=>{if(c.origin>1){u(c);return}let{file:f}=c;if(!d("GET_ALLOW_IMAGE_EDIT")||!d("GET_IMAGE_EDIT_INSTANT_EDIT")){u(c);return}if(!_a(f)){u(c);return}let h=(b,T,v)=>y=>{s.shift(),y?T(b):v(b),m("KICK"),I()},I=()=>{if(!s.length)return;let{item:b,resolve:T,reject:v}=s[0];m("EDIT_ITEM",{id:b.id,handleEditorResponse:h(b,T,v)})};p({item:c,resolve:u,reject:g}),s.length===1&&I()})),t("DID_CREATE_ITEM",(c,{query:d,dispatch:m})=>{c.extend("edit",()=>{m("EDIT_ITEM",{id:c.id})})});let s=[],p=c=>(s.push(c),c);return t("CREATE_VIEW",c=>{let{is:d,view:m,query:u}=c;if(!u("GET_ALLOW_IMAGE_EDIT"))return;let g=u("GET_ALLOW_IMAGE_PREVIEW");if(!(d("file-info")&&!g||d("file")&&g))return;let h=u("GET_IMAGE_EDIT_EDITOR");if(!h)return;h.filepondCallbackBridge||(h.outputData=!0,h.outputFile=!1,h.filepondCallbackBridge={onconfirm:h.onconfirm||(()=>{}),oncancel:h.oncancel||(()=>{})});let I=({root:v,props:y,action:E})=>{let{id:_}=y,{handleEditorResponse:x}=E;h.cropAspectRatio=v.query("GET_IMAGE_CROP_ASPECT_RATIO")||h.cropAspectRatio,h.outputCanvasBackgroundColor=v.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||h.outputCanvasBackgroundColor;let R=v.query("GET_ITEM",_);if(!R)return;let z=R.file,P=R.getMetadata("crop"),A={center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},B=R.getMetadata("resize"),w=R.getMetadata("filter")||null,O=R.getMetadata("filters")||null,S=R.getMetadata("colors")||null,L=R.getMetadata("markup")||null,D={crop:P||A,size:B?{upscale:B.upscale,mode:B.mode,width:B.size.width,height:B.size.height}:null,filter:O?O.id||O.matrix:v.query("GET_ALLOW_IMAGE_FILTER")&&v.query("GET_IMAGE_FILTER_COLOR_MATRIX")&&!S?w:null,color:S,markup:L};h.onconfirm=({data:F})=>{let{crop:G,size:C,filter:q,color:X,colorMatrix:K,markup:oe}=F,k={};if(G&&(k.crop=G),C){let H=(R.getMetadata("resize")||{}).size,Y={width:C.width,height:C.height};!(Y.width&&Y.height)&&H&&(Y.width=H.width,Y.height=H.height),(Y.width||Y.height)&&(k.resize={upscale:C.upscale,mode:C.mode,size:Y})}oe&&(k.markup=oe),k.colors=X,k.filters=q,k.filter=K,R.setMetadata(k),h.filepondCallbackBridge.onconfirm(F,o(R)),x&&(h.onclose=()=>{x(!0),h.onclose=null})},h.oncancel=()=>{h.filepondCallbackBridge.oncancel(o(R)),x&&(h.onclose=()=>{x(!1),h.onclose=null})},h.open(z,D)},b=({root:v,props:y})=>{if(!u("GET_IMAGE_EDIT_ALLOW_EDIT"))return;let{id:E}=y,_=u("GET_ITEM",E);if(!_)return;let x=_.file;if(_a(x))if(v.ref.handleEdit=R=>{R.stopPropagation(),v.dispatch("EDIT_ITEM",{id:E})},g){let R=m.createChildView(r,{label:"edit",icon:u("GET_IMAGE_EDIT_ICON_EDIT"),opacity:0});R.element.classList.add("filepond--action-edit-item"),R.element.dataset.align=u("GET_STYLE_IMAGE_EDIT_BUTTON_EDIT_ITEM_POSITION"),R.on("click",v.ref.handleEdit),v.ref.buttonEditItem=m.appendChildView(R)}else{let R=m.element.querySelector(".filepond--file-info-main"),z=document.createElement("button");z.className="filepond--action-edit-item-alt",z.innerHTML=u("GET_IMAGE_EDIT_ICON_EDIT")+"edit",z.addEventListener("click",v.ref.handleEdit),R.appendChild(z),v.ref.editButton=z}};m.registerDestroyer(({root:v})=>{v.ref.buttonEditItem&&v.ref.buttonEditItem.off("click",v.ref.handleEdit),v.ref.editButton&&v.ref.editButton.removeEventListener("click",v.ref.handleEdit)});let T={EDIT_ITEM:I,DID_LOAD_ITEM:b};if(g){let v=({root:y})=>{y.ref.buttonEditItem&&(y.ref.buttonEditItem.opacity=1)};T.DID_IMAGE_PREVIEW_SHOW=v}m.registerWriter(l(T))}),{options:{allowImageEdit:[!0,n.BOOLEAN],styleImageEditButtonEditItemPosition:["bottom center",n.STRING],imageEditInstantEdit:[!1,n.BOOLEAN],imageEditAllowEdit:[!0,n.BOOLEAN],imageEditIconEdit:['',n.STRING],imageEditEditor:[null,n.OBJECT]}}},dm=typeof window<"u"&&typeof window.document<"u";dm&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Xl}));var Kl=Xl;var pm=e=>/^image\/jpeg/.test(e.type),rt={JPEG:65496,APP1:65505,EXIF:1165519206,TIFF:18761,Orientation:274,Unknown:65280},st=(e,t,i=!1)=>e.getUint16(t,i),Ql=(e,t,i=!1)=>e.getUint32(t,i),mm=e=>new Promise((t,i)=>{let a=new FileReader;a.onload=function(n){let l=new DataView(n.target.result);if(st(l,0)!==rt.JPEG){t(-1);return}let o=l.byteLength,r=2;for(;rum,fm="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=",Zl,Ii=gm()?new Image:{};Ii.onload=()=>Zl=Ii.naturalWidth>Ii.naturalHeight;Ii.src=fm;var hm=()=>Zl,Jl=({addFilter:e,utils:t})=>{let{Type:i,isFile:a}=t;return e("DID_LOAD_ITEM",(n,{query:l})=>new Promise((o,r)=>{let s=n.file;if(!a(s)||!pm(s)||!l("GET_ALLOW_IMAGE_EXIF_ORIENTATION")||!hm())return o(n);mm(s).then(p=>{n.setMetadata("exif",{orientation:p}),o(n)})})),{options:{allowImageExifOrientation:[!0,i.BOOLEAN]}}},bm=typeof window<"u"&&typeof window.document<"u";bm&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Jl}));var eo=Jl;var Em=e=>/^image/.test(e.type),to=(e,t)=>Yt(e.x*t,e.y*t),io=(e,t)=>Yt(e.x+t.x,e.y+t.y),Tm=e=>{let t=Math.sqrt(e.x*e.x+e.y*e.y);return t===0?{x:0,y:0}:Yt(e.x/t,e.y/t)},vi=(e,t,i)=>{let a=Math.cos(t),n=Math.sin(t),l=Yt(e.x-i.x,e.y-i.y);return Yt(i.x+a*l.x-n*l.y,i.y+n*l.x+a*l.y)},Yt=(e=0,t=0)=>({x:e,y:t}),Te=(e,t,i=1,a)=>{if(typeof e=="string")return parseFloat(e)*i;if(typeof e=="number")return e*(a?t[a]:Math.min(t.width,t.height))},Im=(e,t,i)=>{let a=e.borderStyle||e.lineStyle||"solid",n=e.backgroundColor||e.fontColor||"transparent",l=e.borderColor||e.lineColor||"transparent",o=Te(e.borderWidth||e.lineWidth,t,i),r=e.lineCap||"round",s=e.lineJoin||"round",p=typeof a=="string"?"":a.map(d=>Te(d,t,i)).join(","),c=e.opacity||1;return{"stroke-linecap":r,"stroke-linejoin":s,"stroke-width":o||0,"stroke-dasharray":p,stroke:l,fill:n,opacity:c}},we=e=>e!=null,vm=(e,t,i=1)=>{let a=Te(e.x,t,i,"width")||Te(e.left,t,i,"width"),n=Te(e.y,t,i,"height")||Te(e.top,t,i,"height"),l=Te(e.width,t,i,"width"),o=Te(e.height,t,i,"height"),r=Te(e.right,t,i,"width"),s=Te(e.bottom,t,i,"height");return we(n)||(we(o)&&we(s)?n=t.height-o-s:n=s),we(a)||(we(l)&&we(r)?a=t.width-l-r:a=r),we(l)||(we(a)&&we(r)?l=t.width-a-r:l=0),we(o)||(we(n)&&we(s)?o=t.height-n-s:o=0),{x:a||0,y:n||0,width:l||0,height:o||0}},xm=e=>e.map((t,i)=>`${i===0?"M":"L"} ${t.x} ${t.y}`).join(" "),Be=(e,t)=>Object.keys(t).forEach(i=>e.setAttribute(i,t[i])),ym="http://www.w3.org/2000/svg",St=(e,t)=>{let i=document.createElementNS(ym,e);return t&&Be(i,t),i},Rm=e=>Be(e,{...e.rect,...e.styles}),Sm=e=>{let t=e.rect.x+e.rect.width*.5,i=e.rect.y+e.rect.height*.5,a=e.rect.width*.5,n=e.rect.height*.5;return Be(e,{cx:t,cy:i,rx:a,ry:n,...e.styles})},_m={contain:"xMidYMid meet",cover:"xMidYMid slice"},wm=(e,t)=>{Be(e,{...e.rect,...e.styles,preserveAspectRatio:_m[t.fit]||"none"})},Lm={left:"start",center:"middle",right:"end"},Mm=(e,t,i,a)=>{let n=Te(t.fontSize,i,a),l=t.fontFamily||"sans-serif",o=t.fontWeight||"normal",r=Lm[t.textAlign]||"start";Be(e,{...e.rect,...e.styles,"stroke-width":0,"font-weight":o,"font-size":n,"font-family":l,"text-anchor":r}),e.text!==t.text&&(e.text=t.text,e.textContent=t.text.length?t.text:" ")},Am=(e,t,i,a)=>{Be(e,{...e.rect,...e.styles,fill:"none"});let n=e.childNodes[0],l=e.childNodes[1],o=e.childNodes[2],r=e.rect,s={x:e.rect.x+e.rect.width,y:e.rect.y+e.rect.height};if(Be(n,{x1:r.x,y1:r.y,x2:s.x,y2:s.y}),!t.lineDecoration)return;l.style.display="none",o.style.display="none";let p=Tm({x:s.x-r.x,y:s.y-r.y}),c=Te(.05,i,a);if(t.lineDecoration.indexOf("arrow-begin")!==-1){let d=to(p,c),m=io(r,d),u=vi(r,2,m),g=vi(r,-2,m);Be(l,{style:"display:block;",d:`M${u.x},${u.y} L${r.x},${r.y} L${g.x},${g.y}`})}if(t.lineDecoration.indexOf("arrow-end")!==-1){let d=to(p,-c),m=io(s,d),u=vi(s,2,m),g=vi(s,-2,m);Be(o,{style:"display:block;",d:`M${u.x},${u.y} L${s.x},${s.y} L${g.x},${g.y}`})}},Pm=(e,t,i,a)=>{Be(e,{...e.styles,fill:"none",d:xm(t.points.map(n=>({x:Te(n.x,i,a,"width"),y:Te(n.y,i,a,"height")})))})},xi=e=>t=>St(e,{id:t.id}),zm=e=>{let t=St("image",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return t.onload=()=>{t.setAttribute("opacity",e.opacity||1)},t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.src),t},Om=e=>{let t=St("g",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round"}),i=St("line");t.appendChild(i);let a=St("path");t.appendChild(a);let n=St("path");return t.appendChild(n),t},Fm={image:zm,rect:xi("rect"),ellipse:xi("ellipse"),text:xi("text"),path:xi("path"),line:Om},Dm={rect:Rm,ellipse:Sm,image:wm,text:Mm,path:Pm,line:Am},Cm=(e,t)=>Fm[e](t),Bm=(e,t,i,a,n)=>{t!=="path"&&(e.rect=vm(i,a,n)),e.styles=Im(i,a,n),Dm[t](e,i,a,n)},Nm=["x","y","left","top","right","bottom","width","height"],km=e=>typeof e=="string"&&/%/.test(e)?parseFloat(e)/100:e,Vm=e=>{let[t,i]=e,a=i.points?{}:Nm.reduce((n,l)=>(n[l]=km(i[l]),n),{});return[t,{zIndex:0,...i,...a}]},Gm=(e,t)=>e[1].zIndex>t[1].zIndex?1:e[1].zIndexe.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:!0,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:({root:t,props:i})=>{if(!i.dirty)return;let{crop:a,resize:n,markup:l}=i,o=i.width,r=i.height,s=a.width,p=a.height;if(n){let{size:u}=n,g=u&&u.width,f=u&&u.height,h=n.mode,I=n.upscale;g&&!f&&(f=g),f&&!g&&(g=f);let b=s{let[g,f]=u,h=Cm(g,f);Bm(h,g,f,c,d),t.element.appendChild(h)})}}),jt=(e,t)=>({x:e,y:t}),Wm=(e,t)=>e.x*t.x+e.y*t.y,ao=(e,t)=>jt(e.x-t.x,e.y-t.y),Hm=(e,t)=>Wm(ao(e,t),ao(e,t)),no=(e,t)=>Math.sqrt(Hm(e,t)),lo=(e,t)=>{let i=e,a=1.5707963267948966,n=t,l=1.5707963267948966-t,o=Math.sin(a),r=Math.sin(n),s=Math.sin(l),p=Math.cos(l),c=i/o,d=c*r,m=c*s;return jt(p*d,p*m)},jm=(e,t)=>{let i=e.width,a=e.height,n=lo(i,t),l=lo(a,t),o=jt(e.x+Math.abs(n.x),e.y-Math.abs(n.y)),r=jt(e.x+e.width+Math.abs(l.y),e.y+Math.abs(l.x)),s=jt(e.x-Math.abs(l.y),e.y+e.height-Math.abs(l.x));return{width:no(o,r),height:no(o,s)}},Ym=(e,t,i=1)=>{let a=e.height/e.width,n=1,l=t,o=1,r=a;r>l&&(r=l,o=r/a);let s=Math.max(n/o,l/r),p=e.width/(i*s*o),c=p*t;return{width:p,height:c}},ro=(e,t,i,a)=>{let n=a.x>.5?1-a.x:a.x,l=a.y>.5?1-a.y:a.y,o=n*2*e.width,r=l*2*e.height,s=jm(t,i);return Math.max(s.width/o,s.height/r)},so=(e,t)=>{let i=e.width,a=i*t;a>e.height&&(a=e.height,i=a/t);let n=(e.width-i)*.5,l=(e.height-a)*.5;return{x:n,y:l,width:i,height:a}},qm=(e,t={})=>{let{zoom:i,rotation:a,center:n,aspectRatio:l}=t;l||(l=e.height/e.width);let o=Ym(e,l,i),r={x:o.width*.5,y:o.height*.5},s={x:0,y:0,width:o.width,height:o.height,center:r},p=typeof t.scaleToFit>"u"||t.scaleToFit,c=ro(e,so(s,l),a,p?n:{x:.5,y:.5}),d=i*c;return{widthFloat:o.width/d,heightFloat:o.height/d,width:Math.round(o.width/d),height:Math.round(o.height/d)}},Ce={type:"spring",stiffness:.5,damping:.45,mass:10},$m=e=>e.utils.createView({name:"image-bitmap",ignoreRect:!0,mixins:{styles:["scaleX","scaleY"]},create:({root:t,props:i})=>{t.appendChild(i.image)}}),Xm=e=>e.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:!0,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:Ce,originY:Ce,scaleX:Ce,scaleY:Ce,translateX:Ce,translateY:Ce,rotateZ:Ce}},create:({root:t,props:i})=>{i.width=i.image.width,i.height=i.image.height,t.ref.bitmap=t.appendChildView(t.createChildView($m(e),{image:i.image}))},write:({root:t,props:i})=>{let{flip:a}=i.crop,{bitmap:n}=t.ref;n.scaleX=a.horizontal?-1:1,n.scaleY=a.vertical?-1:1}}),Km=e=>e.utils.createView({name:"image-clip",tag:"div",ignoreRect:!0,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function({root:t,props:i}){i.background&&(t.element.style.backgroundColor=i.background)},create:({root:t,props:i})=>{t.ref.image=t.appendChildView(t.createChildView(Xm(e),Object.assign({},i))),t.ref.createMarkup=()=>{t.ref.markup||(t.ref.markup=t.appendChildView(t.createChildView(Um(e),Object.assign({},i))))},t.ref.destroyMarkup=()=>{t.ref.markup&&(t.removeChildView(t.ref.markup),t.ref.markup=null)};let a=t.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");a!==null&&(a==="grid"?t.element.dataset.transparencyIndicator=a:t.element.dataset.transparencyIndicator="color")},write:({root:t,props:i,shouldOptimize:a})=>{let{crop:n,markup:l,resize:o,dirty:r,width:s,height:p}=i;t.ref.image.crop=n;let c={x:0,y:0,width:s,height:p,center:{x:s*.5,y:p*.5}},d={width:t.ref.image.width,height:t.ref.image.height},m={x:n.center.x*d.width,y:n.center.y*d.height},u={x:c.center.x-d.width*n.center.x,y:c.center.y-d.height*n.center.y},g=Math.PI*2+n.rotation%(Math.PI*2),f=n.aspectRatio||d.height/d.width,h=typeof n.scaleToFit>"u"||n.scaleToFit,I=ro(d,so(c,f),g,h?n.center:{x:.5,y:.5}),b=n.zoom*I;l&&l.length?(t.ref.createMarkup(),t.ref.markup.width=s,t.ref.markup.height=p,t.ref.markup.resize=o,t.ref.markup.dirty=r,t.ref.markup.markup=l,t.ref.markup.crop=qm(d,n)):t.ref.markup&&t.ref.destroyMarkup();let T=t.ref.image;if(a){T.originX=null,T.originY=null,T.translateX=null,T.translateY=null,T.rotateZ=null,T.scaleX=null,T.scaleY=null;return}T.originX=m.x,T.originY=m.y,T.translateX=u.x,T.translateY=u.y,T.rotateZ=g,T.scaleX=b,T.scaleY=b}}),Qm=e=>e.utils.createView({name:"image-preview",tag:"div",ignoreRect:!0,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:Ce,scaleY:Ce,translateY:Ce,opacity:{type:"tween",duration:400}}},create:({root:t,props:i})=>{t.ref.clip=t.appendChildView(t.createChildView(Km(e),{id:i.id,image:i.image,crop:i.crop,markup:i.markup,resize:i.resize,dirty:i.dirty,background:i.background}))},write:({root:t,props:i,shouldOptimize:a})=>{let{clip:n}=t.ref,{image:l,crop:o,markup:r,resize:s,dirty:p}=i;if(n.crop=o,n.markup=r,n.resize=s,n.dirty=p,n.opacity=a?0:1,a||t.rect.element.hidden)return;let c=l.height/l.width,d=o.aspectRatio||c,m=t.rect.inner.width,u=t.rect.inner.height,g=t.query("GET_IMAGE_PREVIEW_HEIGHT"),f=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),h=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),I=t.query("GET_PANEL_ASPECT_RATIO"),b=t.query("GET_ALLOW_MULTIPLE");I&&!b&&(g=m*I,d=I);let T=g!==null?g:Math.max(f,Math.min(m*d,h)),v=T/d;v>m&&(v=m,T=v*d),T>u&&(T=u,v=u/d),n.width=v,n.height=T}}),Zm=` + + + + + + + + + + + + + + + + + +`,oo=0,Jm=e=>e.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let a=Zm;if(document.querySelector("base")){let n=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+n+"#")}oo++,t.element.classList.add(`filepond--image-preview-overlay-${i.status}`),t.element.innerHTML=a.replace(/__UID__/g,oo)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),eu=function(){self.onmessage=e=>{createImageBitmap(e.data.message.file).then(t=>{self.postMessage({id:e.data.id,message:t},[t])})}},tu=function(){self.onmessage=e=>{let t=e.data.message.imageData,i=e.data.message.colorMatrix,a=t.data,n=a.length,l=i[0],o=i[1],r=i[2],s=i[3],p=i[4],c=i[5],d=i[6],m=i[7],u=i[8],g=i[9],f=i[10],h=i[11],I=i[12],b=i[13],T=i[14],v=i[15],y=i[16],E=i[17],_=i[18],x=i[19],R=0,z=0,P=0,A=0,B=0;for(;R{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t(a,n)},i.src=e},au={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]},nu=(e,t,i,a)=>{a!==-1&&e.transform.apply(e,au[a](t,i))},lu=(e,t,i,a)=>{t=Math.round(t),i=Math.round(i);let n=document.createElement("canvas");n.width=t,n.height=i;let l=n.getContext("2d");return a>=5&&a<=8&&([t,i]=[i,t]),nu(l,t,i,a),l.drawImage(e,0,0,t,i),n},co=e=>/^image/.test(e.type)&&!/svg/.test(e.type),ou=10,ru=10,su=e=>{let t=Math.min(ou/e.width,ru/e.height),i=document.createElement("canvas"),a=i.getContext("2d"),n=i.width=Math.ceil(e.width*t),l=i.height=Math.ceil(e.height*t);a.drawImage(e,0,0,n,l);let o=null;try{o=a.getImageData(0,0,n,l).data}catch{return null}let r=o.length,s=0,p=0,c=0,d=0;for(;dMath.floor(Math.sqrt(e/(t/4))),cu=(e,t)=>(t=t||document.createElement("canvas"),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t),du=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(new Uint8ClampedArray(e.data)),t},pu=e=>new Promise((t,i)=>{let a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),mu=e=>{let t=Jm(e),i=Qm(e),{createWorker:a}=e.utils,n=(b,T,v)=>new Promise(y=>{b.ref.imageData||(b.ref.imageData=v.getContext("2d").getImageData(0,0,v.width,v.height));let E=du(b.ref.imageData);if(!T||T.length!==20)return v.getContext("2d").putImageData(E,0,0),y();let _=a(tu);_.post({imageData:E,colorMatrix:T},x=>{v.getContext("2d").putImageData(x,0,0),_.terminate(),y()},[E.data.buffer])}),l=(b,T)=>{b.removeChildView(T),T.image.width=1,T.image.height=1,T._destroy()},o=({root:b})=>{let T=b.ref.images.shift();return T.opacity=0,T.translateY=-15,b.ref.imageViewBin.push(T),T},r=({root:b,props:T,image:v})=>{let y=T.id,E=b.query("GET_ITEM",{id:y});if(!E)return;let _=E.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},x=b.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),R,z,P=!1;b.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(R=E.getMetadata("markup")||[],z=E.getMetadata("resize"),P=!0);let A=b.appendChildView(b.createChildView(i,{id:y,image:v,crop:_,resize:z,markup:R,dirty:P,background:x,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),b.childViews.length);b.ref.images.push(A),A.opacity=1,A.scaleX=1,A.scaleY=1,A.translateY=0,setTimeout(()=>{b.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:y})},250)},s=({root:b,props:T})=>{let v=b.query("GET_ITEM",{id:T.id});if(!v)return;let y=b.ref.images[b.ref.images.length-1];y.crop=v.getMetadata("crop"),y.background=b.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),b.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(y.dirty=!0,y.resize=v.getMetadata("resize"),y.markup=v.getMetadata("markup"))},p=({root:b,props:T,action:v})=>{if(!/crop|filter|markup|resize/.test(v.change.key)||!b.ref.images.length)return;let y=b.query("GET_ITEM",{id:T.id});if(y){if(/filter/.test(v.change.key)){let E=b.ref.images[b.ref.images.length-1];n(b,v.change.value,E.image);return}if(/crop|markup|resize/.test(v.change.key)){let E=y.getMetadata("crop"),_=b.ref.images[b.ref.images.length-1];if(E&&E.aspectRatio&&_.crop&&_.crop.aspectRatio&&Math.abs(E.aspectRatio-_.crop.aspectRatio)>1e-5){let x=o({root:b});r({root:b,props:T,image:cu(x.image)})}else s({root:b,props:T})}}},c=b=>{let v=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./),y=v?parseInt(v[1]):null;return y!==null&&y<=58?!1:"createImageBitmap"in window&&co(b)},d=({root:b,props:T})=>{let{id:v}=T,y=b.query("GET_ITEM",v);if(!y)return;let E=URL.createObjectURL(y.file);iu(E,(_,x)=>{b.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:v,width:_,height:x})})},m=({root:b,props:T})=>{let{id:v}=T,y=b.query("GET_ITEM",v);if(!y)return;let E=URL.createObjectURL(y.file),_=()=>{pu(E).then(x)},x=R=>{URL.revokeObjectURL(E);let P=(y.getMetadata("exif")||{}).orientation||-1,{width:A,height:B}=R;if(!A||!B)return;P>=5&&P<=8&&([A,B]=[B,A]);let w=Math.max(1,window.devicePixelRatio*.75),S=b.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR")*w,L=B/A,D=b.rect.element.width,F=b.rect.element.height,G=D,C=G*L;L>1?(G=Math.min(A,D*S),C=G*L):(C=Math.min(B,F*S),G=C/L);let q=lu(R,G,C,P),X=()=>{let oe=b.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?su(data):null;y.setMetadata("color",oe,!0),"close"in R&&R.close(),b.ref.overlayShadow.opacity=1,r({root:b,props:T,image:q})},K=y.getMetadata("filter");K?n(b,K,q).then(X):X()};if(c(y.file)){let R=a(eu);R.post({file:y.file},z=>{if(R.terminate(),!z){_();return}x(z)})}else _()},u=({root:b})=>{let T=b.ref.images[b.ref.images.length-1];T.translateY=0,T.scaleX=1,T.scaleY=1,T.opacity=1},g=({root:b})=>{b.ref.overlayShadow.opacity=1,b.ref.overlayError.opacity=0,b.ref.overlaySuccess.opacity=0},f=({root:b})=>{b.ref.overlayShadow.opacity=.25,b.ref.overlayError.opacity=1},h=({root:b})=>{b.ref.overlayShadow.opacity=.25,b.ref.overlaySuccess.opacity=1},I=({root:b})=>{b.ref.images=[],b.ref.imageData=null,b.ref.imageViewBin=[],b.ref.overlayShadow=b.appendChildView(b.createChildView(t,{opacity:0,status:"idle"})),b.ref.overlaySuccess=b.appendChildView(b.createChildView(t,{opacity:0,status:"success"})),b.ref.overlayError=b.appendChildView(b.createChildView(t,{opacity:0,status:"failure"}))};return e.utils.createView({name:"image-preview-wrapper",create:I,styles:["height"],apis:["height"],destroy:({root:b})=>{b.ref.images.forEach(T=>{T.image.width=1,T.image.height=1})},didWriteView:({root:b})=>{b.ref.images.forEach(T=>{T.dirty=!1})},write:e.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:u,DID_IMAGE_PREVIEW_CONTAINER_CREATE:d,DID_FINISH_CALCULATE_PREVIEWSIZE:m,DID_UPDATE_ITEM_METADATA:p,DID_THROW_ITEM_LOAD_ERROR:f,DID_THROW_ITEM_PROCESSING_ERROR:f,DID_THROW_ITEM_INVALID:f,DID_COMPLETE_ITEM_PROCESSING:h,DID_START_ITEM_PROCESSING:g,DID_REVERT_ITEM_PROCESSING:g},({root:b})=>{let T=b.ref.imageViewBin.filter(v=>v.opacity===0);b.ref.imageViewBin=b.ref.imageViewBin.filter(v=>v.opacity>0),T.forEach(v=>l(b,v)),T.length=0})})},po=e=>{let{addFilter:t,utils:i}=e,{Type:a,createRoute:n,isFile:l}=i,o=mu(e);return t("CREATE_VIEW",r=>{let{is:s,view:p,query:c}=r;if(!s("file")||!c("GET_ALLOW_IMAGE_PREVIEW"))return;let d=({root:h,props:I})=>{let{id:b}=I,T=c("GET_ITEM",b);if(!T||!l(T.file)||T.archived)return;let v=T.file;if(!Em(v)||!c("GET_IMAGE_PREVIEW_FILTER_ITEM")(T))return;let y="createImageBitmap"in(window||{}),E=c("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!y&&E&&v.size>E)return;h.ref.imagePreview=p.appendChildView(p.createChildView(o,{id:b}));let _=h.query("GET_IMAGE_PREVIEW_HEIGHT");_&&h.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:T.id,height:_});let x=!y&&v.size>c("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");h.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:b},x)},m=(h,I)=>{if(!h.ref.imagePreview)return;let{id:b}=I,T=h.query("GET_ITEM",{id:b});if(!T)return;let v=h.query("GET_PANEL_ASPECT_RATIO"),y=h.query("GET_ITEM_PANEL_ASPECT_RATIO"),E=h.query("GET_IMAGE_PREVIEW_HEIGHT");if(v||y||E)return;let{imageWidth:_,imageHeight:x}=h.ref;if(!_||!x)return;let R=h.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),z=h.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),A=(T.getMetadata("exif")||{}).orientation||-1;if(A>=5&&A<=8&&([_,x]=[x,_]),!co(T.file)||h.query("GET_IMAGE_PREVIEW_UPSCALE")){let D=2048/_;_*=D,x*=D}let B=x/_,w=(T.getMetadata("crop")||{}).aspectRatio||B,O=Math.max(R,Math.min(x,z)),S=h.rect.element.width,L=Math.min(S*w,O);h.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:T.id,height:L})},u=({root:h})=>{h.ref.shouldRescale=!0},g=({root:h,action:I})=>{I.change.key==="crop"&&(h.ref.shouldRescale=!0)},f=({root:h,action:I})=>{h.ref.imageWidth=I.width,h.ref.imageHeight=I.height,h.ref.shouldRescale=!0,h.ref.shouldDrawPreview=!0,h.dispatch("KICK")};p.registerWriter(n({DID_RESIZE_ROOT:u,DID_STOP_RESIZE:u,DID_LOAD_ITEM:d,DID_IMAGE_PREVIEW_CALCULATE_SIZE:f,DID_UPDATE_ITEM_METADATA:g},({root:h,props:I})=>{h.ref.imagePreview&&(h.rect.element.hidden||(h.ref.shouldRescale&&(m(h,I),h.ref.shouldRescale=!1),h.ref.shouldDrawPreview&&(requestAnimationFrame(()=>{requestAnimationFrame(()=>{h.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:I.id})})}),h.ref.shouldDrawPreview=!1)))}))}),{options:{allowImagePreview:[!0,a.BOOLEAN],imagePreviewFilterItem:[()=>!0,a.FUNCTION],imagePreviewHeight:[null,a.INT],imagePreviewMinHeight:[44,a.INT],imagePreviewMaxHeight:[256,a.INT],imagePreviewMaxFileSize:[null,a.INT],imagePreviewZoomFactor:[2,a.INT],imagePreviewUpscale:[!1,a.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,a.INT],imagePreviewTransparencyIndicator:[null,a.STRING],imagePreviewCalculateAverageImageColor:[!1,a.BOOLEAN],imagePreviewMarkupShow:[!0,a.BOOLEAN],imagePreviewMarkupFilter:[()=>!0,a.FUNCTION]}}},uu=typeof window<"u"&&typeof window.document<"u";uu&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:po}));var mo=po;var gu=e=>/^image/.test(e.type),fu=(e,t)=>{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t({width:a,height:n})},i.onerror=()=>t(null),i.src=e},uo=({addFilter:e,utils:t})=>{let{Type:i}=t;return e("DID_LOAD_ITEM",(a,{query:n})=>new Promise((l,o)=>{let r=a.file;if(!gu(r)||!n("GET_ALLOW_IMAGE_RESIZE"))return l(a);let s=n("GET_IMAGE_RESIZE_MODE"),p=n("GET_IMAGE_RESIZE_TARGET_WIDTH"),c=n("GET_IMAGE_RESIZE_TARGET_HEIGHT"),d=n("GET_IMAGE_RESIZE_UPSCALE");if(p===null&&c===null)return l(a);let m=p===null?c:p,u=c===null?m:c,g=URL.createObjectURL(r);fu(g,f=>{if(URL.revokeObjectURL(g),!f)return l(a);let{width:h,height:I}=f,b=(a.getMetadata("exif")||{}).orientation||-1;if(b>=5&&b<=8&&([h,I]=[I,h]),h===m&&I===u)return l(a);if(!d){if(s==="cover"){if(h<=m||I<=u)return l(a)}else if(h<=m&&I<=m)return l(a)}a.setMetadata("resize",{mode:s,upscale:d,size:{width:m,height:u}}),l(a)})})),{options:{allowImageResize:[!0,i.BOOLEAN],imageResizeMode:["cover",i.STRING],imageResizeUpscale:[!0,i.BOOLEAN],imageResizeTargetWidth:[null,i.INT],imageResizeTargetHeight:[null,i.INT]}}},hu=typeof window<"u"&&typeof window.document<"u";hu&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:uo}));var go=uo;var bu=e=>/^image/.test(e.type),Eu=e=>e.substr(0,e.lastIndexOf("."))||e,Tu={jpeg:"jpg","svg+xml":"svg"},Iu=(e,t)=>{let i=Eu(e),a=t.split("/")[1],n=Tu[a]||a;return`${i}.${n}`},vu=e=>/jpeg|png|svg\+xml/.test(e)?e:"image/jpeg",xu=e=>/^image/.test(e.type),yu={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]},Ru=(e,t,i)=>(i===-1&&(i=1),yu[i](e,t)),qt=(e,t)=>({x:e,y:t}),Su=(e,t)=>e.x*t.x+e.y*t.y,fo=(e,t)=>qt(e.x-t.x,e.y-t.y),_u=(e,t)=>Su(fo(e,t),fo(e,t)),ho=(e,t)=>Math.sqrt(_u(e,t)),bo=(e,t)=>{let i=e,a=1.5707963267948966,n=t,l=1.5707963267948966-t,o=Math.sin(a),r=Math.sin(n),s=Math.sin(l),p=Math.cos(l),c=i/o,d=c*r,m=c*s;return qt(p*d,p*m)},wu=(e,t)=>{let i=e.width,a=e.height,n=bo(i,t),l=bo(a,t),o=qt(e.x+Math.abs(n.x),e.y-Math.abs(n.y)),r=qt(e.x+e.width+Math.abs(l.y),e.y+Math.abs(l.x)),s=qt(e.x-Math.abs(l.y),e.y+e.height-Math.abs(l.x));return{width:ho(o,r),height:ho(o,s)}},Io=(e,t,i=0,a={x:.5,y:.5})=>{let n=a.x>.5?1-a.x:a.x,l=a.y>.5?1-a.y:a.y,o=n*2*e.width,r=l*2*e.height,s=wu(t,i);return Math.max(s.width/o,s.height/r)},vo=(e,t)=>{let i=e.width,a=i*t;a>e.height&&(a=e.height,i=a/t);let n=(e.width-i)*.5,l=(e.height-a)*.5;return{x:n,y:l,width:i,height:a}},Eo=(e,t,i=1)=>{let a=e.height/e.width,n=1,l=t,o=1,r=a;r>l&&(r=l,o=r/a);let s=Math.max(n/o,l/r),p=e.width/(i*s*o),c=p*t;return{width:p,height:c}},xo=e=>{e.width=1,e.height=1,e.getContext("2d").clearRect(0,0,1,1)},To=e=>e&&(e.horizontal||e.vertical),Lu=(e,t,i)=>{if(t<=1&&!To(i))return e.width=e.naturalWidth,e.height=e.naturalHeight,e;let a=document.createElement("canvas"),n=e.naturalWidth,l=e.naturalHeight,o=t>=5&&t<=8;o?(a.width=l,a.height=n):(a.width=n,a.height=l);let r=a.getContext("2d");if(t&&r.transform.apply(r,Ru(n,l,t)),To(i)){let s=[1,0,0,1,0,0];(!o&&i.horizontal||o&i.vertical)&&(s[0]=-1,s[4]=n),(!o&&i.vertical||o&&i.horizontal)&&(s[3]=-1,s[5]=l),r.transform(...s)}return r.drawImage(e,0,0,n,l),a},Mu=(e,t,i={},a={})=>{let{canvasMemoryLimit:n,background:l=null}=a,o=i.zoom||1,r=Lu(e,t,i.flip),s={width:r.width,height:r.height},p=i.aspectRatio||s.height/s.width,c=Eo(s,p,o);if(n){let T=c.width*c.height;if(T>n){let v=Math.sqrt(n)/Math.sqrt(T);s.width=Math.floor(s.width*v),s.height=Math.floor(s.height*v),c=Eo(s,p,o)}}let d=document.createElement("canvas"),m={x:c.width*.5,y:c.height*.5},u={x:0,y:0,width:c.width,height:c.height,center:m},g=typeof i.scaleToFit>"u"||i.scaleToFit,f=o*Io(s,vo(u,p),i.rotation,g?i.center:{x:.5,y:.5});d.width=Math.round(c.width/f),d.height=Math.round(c.height/f),m.x/=f,m.y/=f;let h={x:m.x-s.width*(i.center?i.center.x:.5),y:m.y-s.height*(i.center?i.center.y:.5)},I=d.getContext("2d");l&&(I.fillStyle=l,I.fillRect(0,0,d.width,d.height)),I.translate(m.x,m.y),I.rotate(i.rotation||0),I.drawImage(r,h.x-m.x,h.y-m.y,s.width,s.height);let b=I.getImageData(0,0,d.width,d.height);return xo(d),b},Au=typeof window<"u"&&typeof window.document<"u";Au&&(HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(e,t,i){var a=this.toDataURL(t,i).split(",")[1];setTimeout(function(){for(var n=atob(a),l=n.length,o=new Uint8Array(l),r=0;rnew Promise(a=>{let n=i?i(e):e;Promise.resolve(n).then(l=>{l.toBlob(a,t.type,t.quality)})}),Ri=(e,t)=>$t(e.x*t,e.y*t),Si=(e,t)=>$t(e.x+t.x,e.y+t.y),yo=e=>{let t=Math.sqrt(e.x*e.x+e.y*e.y);return t===0?{x:0,y:0}:$t(e.x/t,e.y/t)},qe=(e,t,i)=>{let a=Math.cos(t),n=Math.sin(t),l=$t(e.x-i.x,e.y-i.y);return $t(i.x+a*l.x-n*l.y,i.y+n*l.x+a*l.y)},$t=(e=0,t=0)=>({x:e,y:t}),me=(e,t,i=1,a)=>{if(typeof e=="string")return parseFloat(e)*i;if(typeof e=="number")return e*(a?t[a]:Math.min(t.width,t.height))},ct=(e,t,i)=>{let a=e.borderStyle||e.lineStyle||"solid",n=e.backgroundColor||e.fontColor||"transparent",l=e.borderColor||e.lineColor||"transparent",o=me(e.borderWidth||e.lineWidth,t,i),r=e.lineCap||"round",s=e.lineJoin||"round",p=typeof a=="string"?"":a.map(d=>me(d,t,i)).join(","),c=e.opacity||1;return{"stroke-linecap":r,"stroke-linejoin":s,"stroke-width":o||0,"stroke-dasharray":p,stroke:l,fill:n,opacity:c}},Le=e=>e!=null,wt=(e,t,i=1)=>{let a=me(e.x,t,i,"width")||me(e.left,t,i,"width"),n=me(e.y,t,i,"height")||me(e.top,t,i,"height"),l=me(e.width,t,i,"width"),o=me(e.height,t,i,"height"),r=me(e.right,t,i,"width"),s=me(e.bottom,t,i,"height");return Le(n)||(Le(o)&&Le(s)?n=t.height-o-s:n=s),Le(a)||(Le(l)&&Le(r)?a=t.width-l-r:a=r),Le(l)||(Le(a)&&Le(r)?l=t.width-a-r:l=0),Le(o)||(Le(n)&&Le(s)?o=t.height-n-s:o=0),{x:a||0,y:n||0,width:l||0,height:o||0}},zu=e=>e.map((t,i)=>`${i===0?"M":"L"} ${t.x} ${t.y}`).join(" "),Ne=(e,t)=>Object.keys(t).forEach(i=>e.setAttribute(i,t[i])),Ou="http://www.w3.org/2000/svg",_t=(e,t)=>{let i=document.createElementNS(Ou,e);return t&&Ne(i,t),i},Fu=e=>Ne(e,{...e.rect,...e.styles}),Du=e=>{let t=e.rect.x+e.rect.width*.5,i=e.rect.y+e.rect.height*.5,a=e.rect.width*.5,n=e.rect.height*.5;return Ne(e,{cx:t,cy:i,rx:a,ry:n,...e.styles})},Cu={contain:"xMidYMid meet",cover:"xMidYMid slice"},Bu=(e,t)=>{Ne(e,{...e.rect,...e.styles,preserveAspectRatio:Cu[t.fit]||"none"})},Nu={left:"start",center:"middle",right:"end"},ku=(e,t,i,a)=>{let n=me(t.fontSize,i,a),l=t.fontFamily||"sans-serif",o=t.fontWeight||"normal",r=Nu[t.textAlign]||"start";Ne(e,{...e.rect,...e.styles,"stroke-width":0,"font-weight":o,"font-size":n,"font-family":l,"text-anchor":r}),e.text!==t.text&&(e.text=t.text,e.textContent=t.text.length?t.text:" ")},Vu=(e,t,i,a)=>{Ne(e,{...e.rect,...e.styles,fill:"none"});let n=e.childNodes[0],l=e.childNodes[1],o=e.childNodes[2],r=e.rect,s={x:e.rect.x+e.rect.width,y:e.rect.y+e.rect.height};if(Ne(n,{x1:r.x,y1:r.y,x2:s.x,y2:s.y}),!t.lineDecoration)return;l.style.display="none",o.style.display="none";let p=yo({x:s.x-r.x,y:s.y-r.y}),c=me(.05,i,a);if(t.lineDecoration.indexOf("arrow-begin")!==-1){let d=Ri(p,c),m=Si(r,d),u=qe(r,2,m),g=qe(r,-2,m);Ne(l,{style:"display:block;",d:`M${u.x},${u.y} L${r.x},${r.y} L${g.x},${g.y}`})}if(t.lineDecoration.indexOf("arrow-end")!==-1){let d=Ri(p,-c),m=Si(s,d),u=qe(s,2,m),g=qe(s,-2,m);Ne(o,{style:"display:block;",d:`M${u.x},${u.y} L${s.x},${s.y} L${g.x},${g.y}`})}},Gu=(e,t,i,a)=>{Ne(e,{...e.styles,fill:"none",d:zu(t.points.map(n=>({x:me(n.x,i,a,"width"),y:me(n.y,i,a,"height")})))})},yi=e=>t=>_t(e,{id:t.id}),Uu=e=>{let t=_t("image",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return t.onload=()=>{t.setAttribute("opacity",e.opacity||1)},t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.src),t},Wu=e=>{let t=_t("g",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round"}),i=_t("line");t.appendChild(i);let a=_t("path");t.appendChild(a);let n=_t("path");return t.appendChild(n),t},Hu={image:Uu,rect:yi("rect"),ellipse:yi("ellipse"),text:yi("text"),path:yi("path"),line:Wu},ju={rect:Fu,ellipse:Du,image:Bu,text:ku,path:Gu,line:Vu},Yu=(e,t)=>Hu[e](t),qu=(e,t,i,a,n)=>{t!=="path"&&(e.rect=wt(i,a,n)),e.styles=ct(i,a,n),ju[t](e,i,a,n)},Ro=(e,t)=>e[1].zIndex>t[1].zIndex?1:e[1].zIndexnew Promise(n=>{let{background:l=null}=a,o=new FileReader;o.onloadend=()=>{let r=o.result,s=document.createElement("div");s.style.cssText="position:absolute;pointer-events:none;width:0;height:0;visibility:hidden;",s.innerHTML=r;let p=s.querySelector("svg");document.body.appendChild(s);let c=p.getBBox();s.parentNode.removeChild(s);let d=s.querySelector("title"),m=p.getAttribute("viewBox")||"",u=p.getAttribute("width")||"",g=p.getAttribute("height")||"",f=parseFloat(u)||null,h=parseFloat(g)||null,I=(u.match(/[a-z]+/)||[])[0]||"",b=(g.match(/[a-z]+/)||[])[0]||"",T=m.split(" ").map(parseFloat),v=T.length?{x:T[0],y:T[1],width:T[2],height:T[3]}:c,y=f??v.width,E=h??v.height;p.style.overflow="visible",p.setAttribute("width",y),p.setAttribute("height",E);let _="";if(i&&i.length){let K={width:y,height:E};_=i.sort(Ro).reduce((oe,k)=>{let H=Yu(k[0],k[1]);return qu(H,k[0],k[1],K),H.removeAttribute("id"),H.getAttribute("opacity")===1&&H.removeAttribute("opacity"),oe+` +`+H.outerHTML+` +`},""),_=` + +${_.replace(/ /g," ")} + +`}let x=t.aspectRatio||E/y,R=y,z=R*x,P=typeof t.scaleToFit>"u"||t.scaleToFit,A=t.center?t.center.x:.5,B=t.center?t.center.y:.5,w=Io({width:y,height:E},vo({width:R,height:z},x),t.rotation,P?{x:A,y:B}:{x:.5,y:.5}),O=t.zoom*w,S=t.rotation*(180/Math.PI),L={x:R*.5,y:z*.5},D={x:L.x-y*A,y:L.y-E*B},F=[`rotate(${S} ${L.x} ${L.y})`,`translate(${L.x} ${L.y})`,`scale(${O})`,`translate(${-L.x} ${-L.y})`,`translate(${D.x} ${D.y})`],G=t.flip&&t.flip.horizontal,C=t.flip&&t.flip.vertical,q=[`scale(${G?-1:1} ${C?-1:1})`,`translate(${G?-y:0} ${C?-E:0})`],X=` + + +${d?d.textContent:""} + + +${p.outerHTML}${_} + + +`;n(X)},o.readAsText(e)}),Xu=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},Ku=()=>{let e={resize:c,filter:p},t=(d,m)=>(d.forEach(u=>{m=e[u.type](m,u.data)}),m),i=(d,m)=>{let u=d.transforms,g=null;if(u.forEach(f=>{f.type==="filter"&&(g=f)}),g){let f=null;u.forEach(h=>{h.type==="resize"&&(f=h)}),f&&(f.data.matrix=g.data,u=u.filter(h=>h.type!=="filter"))}m(t(u,d.imageData))};self.onmessage=d=>{i(d.data.message,m=>{self.postMessage({id:d.data.id,message:m},[m.data.buffer])})};let a=1,n=1,l=1;function o(d,m,u){let g=m[d]/255,f=m[d+1]/255,h=m[d+2]/255,I=m[d+3]/255,b=g*u[0]+f*u[1]+h*u[2]+I*u[3]+u[4],T=g*u[5]+f*u[6]+h*u[7]+I*u[8]+u[9],v=g*u[10]+f*u[11]+h*u[12]+I*u[13]+u[14],y=g*u[15]+f*u[16]+h*u[17]+I*u[18]+u[19],E=Math.max(0,b*y)+a*(1-y),_=Math.max(0,T*y)+n*(1-y),x=Math.max(0,v*y)+l*(1-y);m[d]=Math.max(0,Math.min(1,E))*255,m[d+1]=Math.max(0,Math.min(1,_))*255,m[d+2]=Math.max(0,Math.min(1,x))*255}let r=self.JSON.stringify([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]);function s(d){return self.JSON.stringify(d||[])===r}function p(d,m){if(!m||s(m))return d;let u=d.data,g=u.length,f=m[0],h=m[1],I=m[2],b=m[3],T=m[4],v=m[5],y=m[6],E=m[7],_=m[8],x=m[9],R=m[10],z=m[11],P=m[12],A=m[13],B=m[14],w=m[15],O=m[16],S=m[17],L=m[18],D=m[19],F=0,G=0,C=0,q=0,X=0,K=0,oe=0,k=0,H=0,Y=0,re=0,ee=0;for(;F1&&g===!1)return p(d,I);f=d.width*w,h=d.height*w}let b=d.width,T=d.height,v=Math.round(f),y=Math.round(h),E=d.data,_=new Uint8ClampedArray(v*y*4),x=b/v,R=T/y,z=Math.ceil(x*.5),P=Math.ceil(R*.5);for(let A=0;A=-1&&re<=1&&(O=2*re*re*re-3*re*re+1,O>0)){Y=4*(H+X*b);let ee=E[Y+3];C+=O*ee,L+=O,ee<255&&(O=O*ee/250),D+=O*E[Y],F+=O*E[Y+1],G+=O*E[Y+2],S+=O}}}_[w]=D/S,_[w+1]=F/S,_[w+2]=G/S,_[w+3]=C/L,I&&o(w,_,I)}return{data:_,width:v,height:y}}},Qu=(e,t)=>{if(e.getUint32(t+4,!1)!==1165519206)return;t+=4;let i=e.getUint16(t+=6,!1)===18761;t+=e.getUint32(t+4,i);let a=e.getUint16(t,i);t+=2;for(let n=0;n{let t=new DataView(e);if(t.getUint16(0)!==65496)return null;let i=2,a,n,l=!1;for(;i=65504&&a<=65519||a===65534)||(l||(l=Qu(t,i,n)),i+n>t.byteLength)));)i+=n;return e.slice(0,i)},Ju=e=>new Promise(t=>{let i=new FileReader;i.onload=()=>t(Zu(i.result)||null),i.readAsArrayBuffer(e.slice(0,256*1024))}),eg=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,tg=(e,t)=>{let i=eg();if(i){let a=new i;return a.append(e),a.getBlob(t)}return new Blob([e],{type:t})},ig=()=>Math.random().toString(36).substr(2,9),ag=e=>{let t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),i=URL.createObjectURL(t),a=new Worker(i),n=[];return{transfer:()=>{},post:(l,o,r)=>{let s=ig();n[s]=o,a.onmessage=p=>{let c=n[p.data.id];c&&(c(p.data.message),delete n[p.data.id])},a.postMessage({id:s,message:l},r)},terminate:()=>{a.terminate(),URL.revokeObjectURL(i)}}},ng=e=>new Promise((t,i)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),lg=e=>e.reduce((t,i)=>t.then(a=>i().then(Array.prototype.concat.bind(a))),Promise.resolve([])),og=(e,t)=>new Promise(i=>{let a={width:e.width,height:e.height},n=e.getContext("2d"),l=t.sort(Ro).map(o=>()=>new Promise(r=>{ug[o[0]](n,a,o[1],r)&&r()}));lg(l).then(()=>i(e))}),Lt=(e,t)=>{e.beginPath(),e.lineCap=t["stroke-linecap"],e.lineJoin=t["stroke-linejoin"],e.lineWidth=t["stroke-width"],t["stroke-dasharray"].length&&e.setLineDash(t["stroke-dasharray"].split(",")),e.fillStyle=t.fill,e.strokeStyle=t.stroke,e.globalAlpha=t.opacity||1},Mt=e=>{e.fill(),e.stroke(),e.globalAlpha=1},rg=(e,t,i)=>{let a=wt(i,t),n=ct(i,t);return Lt(e,n),e.rect(a.x,a.y,a.width,a.height),Mt(e,n),!0},sg=(e,t,i)=>{let a=wt(i,t),n=ct(i,t);Lt(e,n);let l=a.x,o=a.y,r=a.width,s=a.height,p=.5522848,c=r/2*p,d=s/2*p,m=l+r,u=o+s,g=l+r/2,f=o+s/2;return e.moveTo(l,f),e.bezierCurveTo(l,f-d,g-c,o,g,o),e.bezierCurveTo(g+c,o,m,f-d,m,f),e.bezierCurveTo(m,f+d,g+c,u,g,u),e.bezierCurveTo(g-c,u,l,f+d,l,f),Mt(e,n),!0},cg=(e,t,i,a)=>{let n=wt(i,t),l=ct(i,t);Lt(e,l);let o=new Image;new URL(i.src,window.location.href).origin!==window.location.origin&&(o.crossOrigin=""),o.onload=()=>{if(i.fit==="cover"){let s=n.width/n.height,p=s>1?o.width:o.height*s,c=s>1?o.width/s:o.height,d=o.width*.5-p*.5,m=o.height*.5-c*.5;e.drawImage(o,d,m,p,c,n.x,n.y,n.width,n.height)}else if(i.fit==="contain"){let s=Math.min(n.width/o.width,n.height/o.height),p=s*o.width,c=s*o.height,d=n.x+n.width*.5-p*.5,m=n.y+n.height*.5-c*.5;e.drawImage(o,0,0,o.width,o.height,d,m,p,c)}else e.drawImage(o,0,0,o.width,o.height,n.x,n.y,n.width,n.height);Mt(e,l),a()},o.src=i.src},dg=(e,t,i)=>{let a=wt(i,t),n=ct(i,t);Lt(e,n);let l=me(i.fontSize,t),o=i.fontFamily||"sans-serif",r=i.fontWeight||"normal",s=i.textAlign||"left";return e.font=`${r} ${l}px ${o}`,e.textAlign=s,e.fillText(i.text,a.x,a.y),Mt(e,n),!0},pg=(e,t,i)=>{let a=ct(i,t);Lt(e,a),e.beginPath();let n=i.points.map(o=>({x:me(o.x,t,1,"width"),y:me(o.y,t,1,"height")}));e.moveTo(n[0].x,n[0].y);let l=n.length;for(let o=1;o{let a=wt(i,t),n=ct(i,t);Lt(e,n),e.beginPath();let l={x:a.x,y:a.y},o={x:a.x+a.width,y:a.y+a.height};e.moveTo(l.x,l.y),e.lineTo(o.x,o.y);let r=yo({x:o.x-l.x,y:o.y-l.y}),s=.04*Math.min(t.width,t.height);if(i.lineDecoration.indexOf("arrow-begin")!==-1){let p=Ri(r,s),c=Si(l,p),d=qe(l,2,c),m=qe(l,-2,c);e.moveTo(d.x,d.y),e.lineTo(l.x,l.y),e.lineTo(m.x,m.y)}if(i.lineDecoration.indexOf("arrow-end")!==-1){let p=Ri(r,-s),c=Si(o,p),d=qe(o,2,c),m=qe(o,-2,c);e.moveTo(d.x,d.y),e.lineTo(o.x,o.y),e.lineTo(m.x,m.y)}return Mt(e,n),!0},ug={rect:rg,ellipse:sg,image:cg,text:dg,line:mg,path:pg},gg=e=>{let t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").putImageData(e,0,0),t},fg=(e,t,i={})=>new Promise((a,n)=>{if(!e||!xu(e))return n({status:"not an image file",file:e});let{stripImageHead:l,beforeCreateBlob:o,afterCreateBlob:r,canvasMemoryLimit:s}=i,{crop:p,size:c,filter:d,markup:m,output:u}=t,g=t.image&&t.image.orientation?Math.max(1,Math.min(8,t.image.orientation)):null,f=u&&u.quality,h=f===null?null:f/100,I=u&&u.type||null,b=u&&u.background||null,T=[];c&&(typeof c.width=="number"||typeof c.height=="number")&&T.push({type:"resize",data:c}),d&&d.length===20&&T.push({type:"filter",data:d});let v=_=>{let x=r?r(_):_;Promise.resolve(x).then(a)},y=(_,x)=>{let R=gg(_),z=m.length?og(R,m):R;Promise.resolve(z).then(P=>{Pu(P,x,o).then(A=>{if(xo(P),l)return v(A);Ju(e).then(B=>{B!==null&&(A=new Blob([B,A.slice(20)],{type:A.type})),v(A)})}).catch(n)})};if(/svg/.test(e.type)&&I===null)return $u(e,p,m,{background:b}).then(_=>{a(tg(_,"image/svg+xml"))});let E=URL.createObjectURL(e);ng(E).then(_=>{URL.revokeObjectURL(E);let x=Mu(_,g,p,{canvasMemoryLimit:s,background:b}),R={quality:h,type:I||e.type};if(!T.length)return y(x,R);let z=ag(Ku);z.post({transforms:T,imageData:x},P=>{y(Xu(P),R),z.terminate()},[x.data.buffer])}).catch(n)}),hg=["x","y","left","top","right","bottom","width","height"],bg=e=>typeof e=="string"&&/%/.test(e)?parseFloat(e)/100:e,Eg=e=>{let[t,i]=e,a=i.points?{}:hg.reduce((n,l)=>(n[l]=bg(i[l]),n),{});return[t,{zIndex:0,...i,...a}]},Tg=e=>new Promise((t,i)=>{let a=new Image;a.src=URL.createObjectURL(e);let n=()=>{let o=a.naturalWidth,r=a.naturalHeight;o&&r&&(URL.revokeObjectURL(a.src),clearInterval(l),t({width:o,height:r}))};a.onerror=o=>{URL.revokeObjectURL(a.src),clearInterval(l),i(o)};let l=setInterval(n,1);n()});typeof window<"u"&&typeof window.document<"u"&&(HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(e,t,i){let a=this;setTimeout(()=>{let n=a.toDataURL(t,i).split(",")[1],l=atob(n),o=l.length,r=new Uint8Array(o);for(;o--;)r[o]=l.charCodeAt(o);e(new Blob([r],{type:t||"image/png"}))})}}));var La=typeof window<"u"&&typeof window.document<"u",Ig=La&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,So=({addFilter:e,utils:t})=>{let{Type:i,forin:a,getFileFromBlob:n,isFile:l}=t,o=["crop","resize","filter","markup","output"],r=c=>(d,m,u)=>d(m,c?c(u):u),s=c=>c.aspectRatio===null&&c.rotation===0&&c.zoom===1&&c.center&&c.center.x===.5&&c.center.y===.5&&c.flip&&c.flip.horizontal===!1&&c.flip.vertical===!1;e("SHOULD_PREPARE_OUTPUT",(c,{query:d})=>new Promise(m=>{m(!d("IS_ASYNC"))}));let p=(c,d,m)=>new Promise(u=>{if(!c("GET_ALLOW_IMAGE_TRANSFORM")||m.archived||!l(d)||!bu(d))return u(!1);Tg(d).then(()=>{let g=c("GET_IMAGE_TRANSFORM_IMAGE_FILTER");if(g){let f=g(d);if(f==null)return handleRevert(!0);if(typeof f=="boolean")return u(f);if(typeof f.then=="function")return f.then(u)}u(!0)}).catch(g=>{u(!1)})});return e("DID_CREATE_ITEM",(c,{query:d,dispatch:m})=>{d("GET_ALLOW_IMAGE_TRANSFORM")&&c.extend("requestPrepare",()=>new Promise((u,g)=>{m("REQUEST_PREPARE_OUTPUT",{query:c.id,item:c,success:u,failure:g},!0)}))}),e("PREPARE_OUTPUT",(c,{query:d,item:m})=>new Promise(u=>{p(d,c,m).then(g=>{if(!g)return u(c);let f=[];d("GET_IMAGE_TRANSFORM_VARIANTS_INCLUDE_ORIGINAL")&&f.push(()=>new Promise(x=>{x({name:d("GET_IMAGE_TRANSFORM_VARIANTS_ORIGINAL_NAME"),file:c})})),d("GET_IMAGE_TRANSFORM_VARIANTS_INCLUDE_DEFAULT")&&f.push((x,R,z)=>new Promise(P=>{x(R,z).then(A=>P({name:d("GET_IMAGE_TRANSFORM_VARIANTS_DEFAULT_NAME"),file:A}))}));let h=d("GET_IMAGE_TRANSFORM_VARIANTS")||{};a(h,(x,R)=>{let z=r(R);f.push((P,A,B)=>new Promise(w=>{z(P,A,B).then(O=>w({name:x,file:O}))}))});let I=d("GET_IMAGE_TRANSFORM_OUTPUT_QUALITY"),b=d("GET_IMAGE_TRANSFORM_OUTPUT_QUALITY_MODE"),T=I===null?null:I/100,v=d("GET_IMAGE_TRANSFORM_OUTPUT_MIME_TYPE"),y=d("GET_IMAGE_TRANSFORM_CLIENT_TRANSFORMS")||o;m.setMetadata("output",{type:v,quality:T,client:y},!0);let E=(x,R)=>new Promise((z,P)=>{let A={...R};Object.keys(A).filter(C=>C!=="exif").forEach(C=>{y.indexOf(C)===-1&&delete A[C]});let{resize:B,exif:w,output:O,crop:S,filter:L,markup:D}=A,F={image:{orientation:w?w.orientation:null},output:O&&(O.type||typeof O.quality=="number"||O.background)?{type:O.type,quality:typeof O.quality=="number"?O.quality*100:null,background:O.background||d("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||null}:void 0,size:B&&(B.size.width||B.size.height)?{mode:B.mode,upscale:B.upscale,...B.size}:void 0,crop:S&&!s(S)?{...S}:void 0,markup:D&&D.length?D.map(Eg):[],filter:L};if(F.output){let C=O.type?O.type!==x.type:!1,q=/\/jpe?g$/.test(x.type),X=O.quality!==null?q&&b==="always":!1;if(!!!(F.size||F.crop||F.filter||C||X))return z(x)}let G={beforeCreateBlob:d("GET_IMAGE_TRANSFORM_BEFORE_CREATE_BLOB"),afterCreateBlob:d("GET_IMAGE_TRANSFORM_AFTER_CREATE_BLOB"),canvasMemoryLimit:d("GET_IMAGE_TRANSFORM_CANVAS_MEMORY_LIMIT"),stripImageHead:d("GET_IMAGE_TRANSFORM_OUTPUT_STRIP_IMAGE_HEAD")};fg(x,F,G).then(C=>{let q=n(C,Iu(x.name,vu(C.type)));z(q)}).catch(P)}),_=f.map(x=>x(E,c,m.getMetadata()));Promise.all(_).then(x=>{u(x.length===1&&x[0].name===null?x[0].file:x)})})})),{options:{allowImageTransform:[!0,i.BOOLEAN],imageTransformImageFilter:[null,i.FUNCTION],imageTransformOutputMimeType:[null,i.STRING],imageTransformOutputQuality:[null,i.INT],imageTransformOutputStripImageHead:[!0,i.BOOLEAN],imageTransformClientTransforms:[null,i.ARRAY],imageTransformOutputQualityMode:["always",i.STRING],imageTransformVariants:[null,i.OBJECT],imageTransformVariantsIncludeDefault:[!0,i.BOOLEAN],imageTransformVariantsDefaultName:[null,i.STRING],imageTransformVariantsIncludeOriginal:[!1,i.BOOLEAN],imageTransformVariantsOriginalName:["original_",i.STRING],imageTransformBeforeCreateBlob:[null,i.FUNCTION],imageTransformAfterCreateBlob:[null,i.FUNCTION],imageTransformCanvasMemoryLimit:[La&&Ig?4096*4096:null,i.INT],imageTransformCanvasBackgroundColor:[null,i.STRING]}}};La&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:So}));var _o=So;var Ma=e=>/^video/.test(e.type),Xt=e=>/^audio/.test(e.type),Aa=class{constructor(t,i){this.mediaEl=t,this.audioElems=i,this.onplayhead=!1,this.duration=0,this.timelineWidth=this.audioElems.timeline.offsetWidth-this.audioElems.playhead.offsetWidth,this.moveplayheadFn=this.moveplayhead.bind(this),this.registerListeners()}registerListeners(){this.mediaEl.addEventListener("timeupdate",this.timeUpdate.bind(this),!1),this.mediaEl.addEventListener("canplaythrough",()=>this.duration=this.mediaEl.duration,!1),this.audioElems.timeline.addEventListener("click",this.timelineClicked.bind(this),!1),this.audioElems.button.addEventListener("click",this.play.bind(this)),this.audioElems.playhead.addEventListener("mousedown",this.mouseDown.bind(this),!1),window.addEventListener("mouseup",this.mouseUp.bind(this),!1)}play(){this.mediaEl.paused?this.mediaEl.play():this.mediaEl.pause(),this.audioElems.button.classList.toggle("play"),this.audioElems.button.classList.toggle("pause")}timeUpdate(){let t=this.mediaEl.currentTime/this.duration*100;this.audioElems.playhead.style.marginLeft=t+"%",this.mediaEl.currentTime===this.duration&&(this.audioElems.button.classList.toggle("play"),this.audioElems.button.classList.toggle("pause"))}moveplayhead(t){let i=t.clientX-this.getPosition(this.audioElems.timeline);i>=0&&i<=this.timelineWidth&&(this.audioElems.playhead.style.marginLeft=i+"px"),i<0&&(this.audioElems.playhead.style.marginLeft="0px"),i>this.timelineWidth&&(this.audioElems.playhead.style.marginLeft=this.timelineWidth-4+"px")}timelineClicked(t){this.moveplayhead(t),this.mediaEl.currentTime=this.duration*this.clickPercent(t)}mouseDown(){this.onplayhead=!0,window.addEventListener("mousemove",this.moveplayheadFn,!0),this.mediaEl.removeEventListener("timeupdate",this.timeUpdate.bind(this),!1)}mouseUp(t){window.removeEventListener("mousemove",this.moveplayheadFn,!0),this.onplayhead==!0&&(this.moveplayhead(t),this.mediaEl.currentTime=this.duration*this.clickPercent(t),this.mediaEl.addEventListener("timeupdate",this.timeUpdate.bind(this),!1)),this.onplayhead=!1}clickPercent(t){return(t.clientX-this.getPosition(this.audioElems.timeline))/this.timelineWidth}getPosition(t){return t.getBoundingClientRect().left}},vg=e=>e.utils.createView({name:"media-preview",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let{id:a}=i,n=t.query("GET_ITEM",{id:i.id}),l=Xt(n.file)?"audio":"video";if(t.ref.media=document.createElement(l),t.ref.media.setAttribute("controls",!0),t.element.appendChild(t.ref.media),Xt(n.file)){let o=document.createDocumentFragment();t.ref.audio=[],t.ref.audio.container=document.createElement("div"),t.ref.audio.button=document.createElement("span"),t.ref.audio.timeline=document.createElement("div"),t.ref.audio.playhead=document.createElement("div"),t.ref.audio.container.className="audioplayer",t.ref.audio.button.className="playpausebtn play",t.ref.audio.timeline.className="timeline",t.ref.audio.playhead.className="playhead",t.ref.audio.timeline.appendChild(t.ref.audio.playhead),t.ref.audio.container.appendChild(t.ref.audio.button),t.ref.audio.container.appendChild(t.ref.audio.timeline),o.appendChild(t.ref.audio.container),t.element.appendChild(o)}},write:e.utils.createRoute({DID_MEDIA_PREVIEW_LOAD:({root:t,props:i})=>{let{id:a}=i,n=t.query("GET_ITEM",{id:i.id});if(!n)return;let l=window.URL||window.webkitURL,o=new Blob([n.file],{type:n.file.type});t.ref.media.type=n.file.type,t.ref.media.src=n.file.mock&&n.file.url||l.createObjectURL(o),Xt(n.file)&&new Aa(t.ref.media,t.ref.audio),t.ref.media.addEventListener("loadeddata",()=>{let r=75;if(Ma(n.file)){let s=t.ref.media.offsetWidth,p=t.ref.media.videoWidth/s;r=t.ref.media.videoHeight/p}t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:i.id,height:r})},!1)}})}),xg=e=>{let t=({root:a,props:n})=>{let{id:l}=n;a.query("GET_ITEM",l)&&a.dispatch("DID_MEDIA_PREVIEW_LOAD",{id:l})},i=({root:a,props:n})=>{let l=vg(e);a.ref.media=a.appendChildView(a.createChildView(l,{id:n.id}))};return e.utils.createView({name:"media-preview-wrapper",create:i,write:e.utils.createRoute({DID_MEDIA_PREVIEW_CONTAINER_CREATE:t})})},Pa=e=>{let{addFilter:t,utils:i}=e,{Type:a,createRoute:n}=i,l=xg(e);return t("CREATE_VIEW",o=>{let{is:r,view:s,query:p}=o;if(!r("file"))return;let c=({root:d,props:m})=>{let{id:u}=m,g=p("GET_ITEM",u),f=p("GET_ALLOW_VIDEO_PREVIEW"),h=p("GET_ALLOW_AUDIO_PREVIEW");!g||g.archived||(!Ma(g.file)||!f)&&(!Xt(g.file)||!h)||(d.ref.mediaPreview=s.appendChildView(s.createChildView(l,{id:u})),d.dispatch("DID_MEDIA_PREVIEW_CONTAINER_CREATE",{id:u}))};s.registerWriter(n({DID_LOAD_ITEM:c},({root:d,props:m})=>{let{id:u}=m,g=p("GET_ITEM",u),f=d.query("GET_ALLOW_VIDEO_PREVIEW"),h=d.query("GET_ALLOW_AUDIO_PREVIEW");!g||(!Ma(g.file)||!f)&&(!Xt(g.file)||!h)||d.rect.element.hidden}))}),{options:{allowVideoPreview:[!0,a.BOOLEAN],allowAudioPreview:[!0,a.BOOLEAN]}}},yg=typeof window<"u"&&typeof window.document<"u";yg&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Pa}));var wo={labelIdle:'\u134B\u12ED\u120E\u127D \u1235\u1260\u12CD \u12A5\u12DA\u1205 \u130B\u122D \u12ED\u120D\u1240\u1241\u1275 \u12C8\u12ED\u121D \u134B\u12ED\u1209\u1295 \u12ED\u121D\u1228\u1321 ',labelInvalidField:"\u1218\u1235\u12A9 \u120D\u12AD \u12EB\u120D\u1206\u1291 \u134B\u12ED\u120E\u127D\u1295 \u12ED\u12DF\u120D",labelFileWaitingForSize:"\u12E8\u134B\u12ED\u1209\u1295 \u1218\u1320\u1295 \u1260\u1218\u1320\u1263\u1260\u1245 \u120B\u12ED",labelFileSizeNotAvailable:"\u12E8\u134B\u12ED\u1209\u1295 \u1218\u1320\u1295 \u120A\u1308\u129D \u12A0\u120D\u127B\u1208\u121D",labelFileLoading:"\u1260\u121B\u1295\u1260\u1265 \u120B\u12ED",labelFileLoadError:"\u1260\u121B\u1295\u1260\u1265 \u120B\u12ED \u127D\u130D\u122D \u1270\u1348\u1325\u122F\u120D",labelFileProcessing:"\u134B\u12ED\u1209\u1295 \u1260\u1218\u132B\u1295 \u120B\u12ED",labelFileProcessingComplete:"\u134B\u12ED\u1209\u1295 \u1218\u132B\u1295 \u1270\u1320\u1293\u1245\u124B\u120D",labelFileProcessingAborted:"\u134B\u12ED\u1209\u1295 \u1218\u132B\u1295 \u1270\u124B\u122D\u1327\u120D",labelFileProcessingError:"\u134B\u12ED\u1209\u1295 \u1260\u1218\u132B\u1295 \u120B\u12ED \u127D\u130D\u122D \u1270\u1348\u1325\u122F\u120D",labelFileProcessingRevertError:"\u1348\u12ED\u1209\u1295 \u1260\u1218\u1240\u120D\u1260\u1235 \u120B\u12ED \u127D\u130D\u122D \u1270\u1348\u1325\u122F\u120D",labelFileRemoveError:"\u1260\u121B\u1325\u134B\u1275 \u120B\u12ED \u127D\u130D\u122D \u1270\u1348\u1325\u122F\u120D",labelTapToCancel:"\u1208\u121B\u124B\u1228\u1325 \u1290\u12AB \u12EB\u12F5\u122D\u1309",labelTapToRetry:"\u12F0\u130D\u121E \u1208\u1218\u121E\u12A8\u122D \u1290\u12AB \u12EB\u12F5\u122D\u1309",labelTapToUndo:"\u12C8\u12F0\u1290\u1260\u1228\u1260\u1275 \u1208\u1218\u1218\u1208\u1235 \u1290\u12AB \u12EB\u12F5\u122D\u1309",labelButtonRemoveItem:"\u120B\u1325\u134B",labelButtonAbortItemLoad:"\u120B\u124B\u122D\u1325",labelButtonRetryItemLoad:"\u12F0\u130D\u121C \u120D\u121E\u12AD\u122D",labelButtonAbortItemProcessing:"\u12ED\u1245\u122D",labelButtonUndoItemProcessing:"\u12C8\u12F0\u1290\u1260\u1228\u1260\u1275 \u120D\u1218\u120D\u1235",labelButtonRetryItemProcessing:"\u12F0\u130D\u121C \u120D\u121E\u12AD\u122D",labelButtonProcessItem:"\u120D\u132B\u1295",labelMaxFileSizeExceeded:"\u134B\u12ED\u1209 \u1270\u120D\u124B\u120D",labelMaxFileSize:"\u12E8\u134B\u12ED\u120D \u1218\u1320\u1295 \u12A8 {filesize} \u1218\u1265\u1208\u1325 \u12A0\u12ED\u1348\u1240\u12F5\u121D",labelMaxTotalFileSizeExceeded:"\u12E8\u121A\u1348\u1240\u12F0\u12CD\u1295 \u1320\u1245\u120B\u120B \u12E8\u134B\u12ED\u120D \u1218\u1320\u1295 \u12A0\u120D\u1348\u12CB\u120D",labelMaxTotalFileSize:"\u1320\u1245\u120B\u120B \u12E8\u134B\u12ED\u120D \u1218\u1320\u1295 \u12A8 {filesize} \u1218\u1265\u1208\u1325 \u12A0\u12ED\u1348\u1240\u12F5\u121D",labelFileTypeNotAllowed:"\u12E8\u1270\u1233\u1233\u1270 \u12E8\u134B\u12ED\u120D \u12A0\u12ED\u1290\u1275 \u1290\u12CD",fileValidateTypeLabelExpectedTypes:"\u12E8\u134B\u12ED\u120D \u12A0\u12ED\u1290\u1271 \u1218\u1206\u1295 \u12E8\u121A\u1308\u1263\u12CD {allButLastType} \u12A5\u1293 {lastType} \u1290\u12CD",imageValidateSizeLabelFormatError:"\u12E8\u121D\u1235\u120D \u12A0\u12ED\u1290\u1271 \u1208\u1218\u132B\u1295 \u12A0\u12ED\u1206\u1295\u121D",imageValidateSizeLabelImageSizeTooSmall:"\u121D\u1235\u1209 \u1260\u1323\u121D \u12A0\u1295\u1237\u120D",imageValidateSizeLabelImageSizeTooBig:"\u121D\u1235\u1209 \u1260\u1323\u121D \u1270\u120D\u124B\u120D",imageValidateSizeLabelExpectedMinSize:"\u12DD\u1245\u1270\u129B\u12CD \u12E8\u121D\u1235\u120D \u120D\u12AC\u1275 {minWidth} \xD7 {minHeight} \u1290\u12CD",imageValidateSizeLabelExpectedMaxSize:"\u12A8\u134D\u1270\u129B\u12CD \u12E8\u121D\u1235\u120D \u120D\u12AC\u1275 {maxWidth} \xD7 {maxHeight} \u1290\u12CD",imageValidateSizeLabelImageResolutionTooLow:"\u12E8\u121D\u1235\u1209 \u1325\u122B\u1275 \u1260\u1323\u121D \u12DD\u1245\u1270\u129B \u1290\u12CD",imageValidateSizeLabelImageResolutionTooHigh:"\u12E8\u121D\u1235\u1209 \u1325\u122B\u1275 \u1260\u1323\u121D \u12A8\u134D\u1270\u129B \u1290\u12CD",imageValidateSizeLabelExpectedMinResolution:"\u12DD\u1245\u1270\u129B\u12CD \u12E8\u121D\u1235\u120D \u1325\u122B\u1275 {minResolution} \u1290\u12CD",imageValidateSizeLabelExpectedMaxResolution:"\u12A8\u134D\u1270\u129B\u12CD \u12E8\u121D\u1235\u120D \u1325\u122B\u1275 {maxResolution} \u1290\u12CD"};var Lo={labelIdle:'\u0627\u0633\u062D\u0628 \u0648 \u0627\u062F\u0631\u062C \u0645\u0644\u0641\u0627\u062A\u0643 \u0623\u0648 \u062A\u0635\u0641\u062D ',labelInvalidField:"\u0627\u0644\u062D\u0642\u0644 \u064A\u062D\u062A\u0648\u064A \u0639\u0644\u0649 \u0645\u0644\u0641\u0627\u062A \u063A\u064A\u0631 \u0635\u0627\u0644\u062D\u0629",labelFileWaitingForSize:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u062D\u062C\u0645",labelFileSizeNotAvailable:"\u0627\u0644\u062D\u062C\u0645 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D",labelFileLoading:"\u0628\u0627\u0644\u0625\u0646\u062A\u0638\u0627\u0631",labelFileLoadError:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062A\u062D\u0645\u064A\u0644",labelFileProcessing:"\u064A\u062A\u0645 \u0627\u0644\u0631\u0641\u0639",labelFileProcessingComplete:"\u062A\u0645 \u0627\u0644\u0631\u0641\u0639",labelFileProcessingAborted:"\u062A\u0645 \u0625\u0644\u063A\u0627\u0621 \u0627\u0644\u0631\u0641\u0639",labelFileProcessingError:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u0631\u0641\u0639",labelFileProcessingRevertError:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062A\u0631\u0627\u062C\u0639",labelFileRemoveError:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062D\u0630\u0641",labelTapToCancel:"\u0627\u0646\u0642\u0631 \u0644\u0644\u0625\u0644\u063A\u0627\u0621",labelTapToRetry:"\u0627\u0646\u0642\u0631 \u0644\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",labelTapToUndo:"\u0627\u0646\u0642\u0631 \u0644\u0644\u062A\u0631\u0627\u062C\u0639",labelButtonRemoveItem:"\u0645\u0633\u062D",labelButtonAbortItemLoad:"\u0625\u0644\u063A\u0627\u0621",labelButtonRetryItemLoad:"\u0625\u0639\u0627\u062F\u0629",labelButtonAbortItemProcessing:"\u0625\u0644\u063A\u0627\u0621",labelButtonUndoItemProcessing:"\u062A\u0631\u0627\u062C\u0639",labelButtonRetryItemProcessing:"\u0625\u0639\u0627\u062F\u0629",labelButtonProcessItem:"\u0631\u0641\u0639",labelMaxFileSizeExceeded:"\u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u0627",labelMaxFileSize:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0627\u0644\u0623\u0642\u0635\u0649: {filesize}",labelMaxTotalFileSizeExceeded:"\u062A\u0645 \u062A\u062C\u0627\u0648\u0632 \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u062D\u062C\u0645 \u0627\u0644\u0625\u062C\u0645\u0627\u0644\u064A",labelMaxTotalFileSize:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641: {filesize}",labelFileTypeNotAllowed:"\u0645\u0644\u0641 \u0645\u0646 \u0646\u0648\u0639 \u063A\u064A\u0631 \u0635\u0627\u0644\u062D",fileValidateTypeLabelExpectedTypes:"\u062A\u062A\u0648\u0642\u0639 {allButLastType} \u0645\u0646 {lastType}",imageValidateSizeLabelFormatError:"\u0646\u0648\u0639 \u0627\u0644\u0635\u0648\u0631\u0629 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",imageValidateSizeLabelImageSizeTooSmall:"\u0627\u0644\u0635\u0648\u0631\u0629 \u0635\u063A\u064A\u0631 \u062C\u062F\u0627",imageValidateSizeLabelImageSizeTooBig:"\u0627\u0644\u0635\u0648\u0631\u0629 \u0643\u0628\u064A\u0631\u0629 \u062C\u062F\u0627",imageValidateSizeLabelExpectedMinSize:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 \u0644\u0644\u0623\u0628\u0639\u0627\u062F \u0647\u0648: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0623\u0628\u0639\u0627\u062F \u0647\u0648: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0627\u0644\u062F\u0642\u0629 \u0636\u0639\u064A\u0641\u0629 \u062C\u062F\u0627",imageValidateSizeLabelImageResolutionTooHigh:"\u0627\u0644\u062F\u0642\u0629 \u0645\u0631\u062A\u0641\u0639\u0629 \u062C\u062F\u0627",imageValidateSizeLabelExpectedMinResolution:"\u0623\u0642\u0644 \u062F\u0642\u0629: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u0623\u0642\u0635\u0649 \u062F\u0642\u0629: {maxResolution}"};var Mo={labelIdle:'Fayl\u0131n\u0131z\u0131 S\xFCr\xFC\u015Fd\xFCr\xFCn & Burax\u0131n ya da Se\xE7in ',labelInvalidField:"Sah\u0259d\u0259 etibars\u0131z fayllar var",labelFileWaitingForSize:"\xD6l\xE7\xFC hesablan\u0131r",labelFileSizeNotAvailable:"\xD6l\xE7\xFC m\xF6vcud deyil",labelFileLoading:"Y\xFCkl\u0259nir",labelFileLoadError:"Y\xFCkl\u0259m\u0259 \u0259snas\u0131nda x\u0259ta ba\u015F verdi",labelFileProcessing:"Y\xFCkl\u0259nir",labelFileProcessingComplete:"Y\xFCkl\u0259m\u0259 tamamland\u0131",labelFileProcessingAborted:"Y\xFCkl\u0259m\u0259 l\u0259\u011Fv edildi",labelFileProcessingError:"Y\xFCk\u0259y\u0259rk\u0259n x\u0259ta ba\u015F verdi",labelFileProcessingRevertError:"Geri \xE7\u0259k\u0259rk\u0259n x\u0259ta ba\u015F verdi",labelFileRemoveError:"\xC7\u0131xarark\u0259n x\u0259ta ba\u015F verdi",labelTapToCancel:"\u0130mtina etm\u0259k \xFC\xE7\xFCn klikl\u0259yin",labelTapToRetry:"T\u0259krar yoxlamaq \xFC\xE7\xFCn klikl\u0259yin",labelTapToUndo:"Geri almaq \xFC\xE7\xFCn klikl\u0259yin",labelButtonRemoveItem:"\xC7\u0131xar",labelButtonAbortItemLoad:"\u0130mtina Et",labelButtonRetryItemLoad:"T\u0259krar yoxla",labelButtonAbortItemProcessing:"\u0130mtina et",labelButtonUndoItemProcessing:"Geri Al",labelButtonRetryItemProcessing:"T\u0259krar yoxla",labelButtonProcessItem:"Y\xFCkl\u0259",labelMaxFileSizeExceeded:"Fayl \xE7ox b\xF6y\xFCkd\xFCr",labelMaxFileSize:"\u018Fn b\xF6y\xFCk fayl \xF6l\xE7\xFCs\xFC: {filesize}",labelMaxTotalFileSizeExceeded:"Maksimum \xF6l\xE7\xFC ke\xE7ildi",labelMaxTotalFileSize:"Maksimum fayl \xF6l\xE7\xFCs\xFC :{filesize}",labelFileTypeNotAllowed:"Etibars\u0131z fayl tipi",fileValidateTypeLabelExpectedTypes:"Bu {allButLastType} ya da bu fayl olmas\u0131 laz\u0131md\u0131r: {lastType}",imageValidateSizeLabelFormatError:"\u015E\u0259kil tipi d\u0259st\u0259kl\u0259nmir",imageValidateSizeLabelImageSizeTooSmall:"\u015E\u0259kil \xE7ox ki\xE7ik",imageValidateSizeLabelImageSizeTooBig:"\u015E\u0259kil \xE7ox b\xF6y\xFCk",imageValidateSizeLabelExpectedMinSize:"Minimum \xF6l\xE7\xFC {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksimum \xF6l\xE7\xFC {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"G\xF6r\xFCnt\xFC imkan\u0131 \xE7ox a\u015Fa\u011F\u0131",imageValidateSizeLabelImageResolutionTooHigh:"G\xF6r\xFCnt\xFC imkan\u0131 \xE7ox y\xFCks\u0259k",imageValidateSizeLabelExpectedMinResolution:"Minimum g\xF6r\xFCnt\xFC imkan\u0131 {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximum g\xF6r\xFCnt\xFC imkan\u0131 {maxResolution}"};var Ao={labelIdle:'Arrossega i deixa anar els teus fitxers o Navega ',labelInvalidField:"El camp cont\xE9 fitxers inv\xE0lids",labelFileWaitingForSize:"Esperant mida",labelFileSizeNotAvailable:"Mida no disponible",labelFileLoading:"Carregant",labelFileLoadError:"Error durant la c\xE0rrega",labelFileProcessing:"Pujant",labelFileProcessingComplete:"Pujada completada",labelFileProcessingAborted:"Pujada cancel\xB7lada",labelFileProcessingError:"Error durant la pujada",labelFileProcessingRevertError:"Error durant la reversi\xF3",labelFileRemoveError:"Error durant l'eliminaci\xF3",labelTapToCancel:"toca per cancel\xB7lar",labelTapToRetry:"toca per reintentar",labelTapToUndo:"toca per desfer",labelButtonRemoveItem:"Eliminar",labelButtonAbortItemLoad:"Cancel\xB7lar",labelButtonRetryItemLoad:"Reintentar",labelButtonAbortItemProcessing:"Cancel\xB7lar",labelButtonUndoItemProcessing:"Desfer",labelButtonRetryItemProcessing:"Reintentar",labelButtonProcessItem:"Pujar",labelMaxFileSizeExceeded:"El fitxer \xE9s massa gran",labelMaxFileSize:"La mida m\xE0xima del fitxer \xE9s {filesize}",labelMaxTotalFileSizeExceeded:"Mida m\xE0xima total excedida",labelMaxTotalFileSize:"La mida m\xE0xima total del fitxer \xE9s {filesize}",labelFileTypeNotAllowed:"Fitxer de tipus inv\xE0lid",fileValidateTypeLabelExpectedTypes:"Espera {allButLastType} o {lastType}",imageValidateSizeLabelFormatError:"Tipus d'imatge no suportada",imageValidateSizeLabelImageSizeTooSmall:"La imatge \xE9s massa petita",imageValidateSizeLabelImageSizeTooBig:"La imatge \xE9s massa gran",imageValidateSizeLabelExpectedMinSize:"La mida m\xEDnima \xE9s {minWidth} x {minHeight}",imageValidateSizeLabelExpectedMaxSize:"La mida m\xE0xima \xE9s {maxWidth} x {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"La resoluci\xF3 \xE9s massa baixa",imageValidateSizeLabelImageResolutionTooHigh:"La resoluci\xF3 \xE9s massa alta",imageValidateSizeLabelExpectedMinResolution:"La resoluci\xF3 m\xEDnima \xE9s {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"La resoluci\xF3 m\xE0xima \xE9s {maxResolution}"};var Po={labelIdle:'\u067E\u06D5\u0695\u06AF\u06D5\u06A9\u0627\u0646 \u0641\u0695\u06CE \u0628\u062F\u06D5 \u0626\u06CE\u0631\u06D5 \u0628\u06C6 \u0628\u0627\u0631\u06A9\u0631\u062F\u0646 \u06CC\u0627\u0646 \u0647\u06D5\u06B5\u0628\u0698\u06CE\u0631\u06D5 ',labelInvalidField:"\u067E\u06D5\u0695\u06AF\u06D5\u06CC \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06CC \u062A\u06CE\u062F\u0627\u06CC\u06D5",labelFileWaitingForSize:"\u0686\u0627\u0648\u06D5\u0695\u0648\u0627\u0646\u06CC\u06CC \u0642\u06D5\u0628\u0627\u0631\u06D5",labelFileSizeNotAvailable:"\u0642\u06D5\u0628\u0627\u0631\u06D5 \u0628\u06D5\u0631\u062F\u06D5\u0633\u062A \u0646\u06CC\u06D5",labelFileLoading:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646",labelFileLoadError:"\u0647\u06D5\u06B5\u06D5 \u0644\u06D5\u0645\u0627\u0648\u06D5\u06CC \u0628\u0627\u0631\u06A9\u0631\u062F\u0646",labelFileProcessing:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646",labelFileProcessingComplete:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646 \u062A\u06D5\u0648\u0627\u0648 \u0628\u0648\u0648",labelFileProcessingAborted:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646 \u0647\u06D5\u06B5\u0648\u06D5\u0634\u0627\u06CC\u06D5\u0648\u06D5",labelFileProcessingError:"\u0647\u06D5\u06B5\u06D5 \u0644\u06D5\u06A9\u0627\u062A\u06CC \u0628\u0627\u0631\u06A9\u0631\u062F\u0646\u062F\u0627",labelFileProcessingRevertError:"\u0647\u06D5\u06B5\u06D5 \u0644\u06D5 \u06A9\u0627\u062A\u06CC \u06AF\u06D5\u0695\u0627\u0646\u06D5\u0648\u06D5",labelFileRemoveError:"\u0647\u06D5\u06B5\u06D5 \u0644\u06D5 \u06A9\u0627\u062A\u06CC \u0633\u0695\u06CC\u0646\u06D5\u0648\u06D5",labelTapToCancel:"\u0628\u06C6 \u0647\u06D5\u06B5\u0648\u06D5\u0634\u0627\u0646\u062F\u0646\u06D5\u0648\u06D5 Tab \u062F\u0627\u0628\u06AF\u0631\u06D5",labelTapToRetry:"tap \u062F\u0627\u0628\u06AF\u0631\u06D5 \u0628\u06C6 \u062F\u0648\u0648\u0628\u0627\u0631\u06D5\u06A9\u0631\u062F\u0646\u06D5\u0648\u06D5",labelTapToUndo:"tap \u062F\u0627\u0628\u06AF\u0631\u06D5 \u0628\u06C6 \u06AF\u06D5\u0695\u0627\u0646\u062F\u0646\u06D5\u0648\u06D5",labelButtonRemoveItem:"\u0633\u0695\u06CC\u0646\u06D5\u0648\u06D5",labelButtonAbortItemLoad:"\u0647\u06D5\u06B5\u0648\u06D5\u0634\u0627\u0646\u062F\u0646\u06D5\u0648\u06D5",labelButtonRetryItemLoad:"\u0647\u06D5\u0648\u06B5\u062F\u0627\u0646\u06D5\u0648\u06D5",labelButtonAbortItemProcessing:"\u067E\u06D5\u0634\u06CC\u0645\u0627\u0646\u0628\u0648\u0648\u0646\u06D5\u0648\u06D5",labelButtonUndoItemProcessing:"\u06AF\u06D5\u0695\u0627\u0646\u062F\u0646\u06D5\u0648\u06D5",labelButtonRetryItemProcessing:"\u0647\u06D5\u0648\u06B5\u062F\u0627\u0646\u06D5\u0648\u06D5",labelButtonProcessItem:"\u0628\u0627\u0631\u06A9\u0631\u062F\u0646",labelMaxFileSizeExceeded:"\u067E\u06D5\u0695\u06AF\u06D5 \u0632\u06C6\u0631 \u06AF\u06D5\u0648\u0631\u06D5\u06CC\u06D5",labelMaxFileSize:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5 {filesize}",labelMaxTotalFileSizeExceeded:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5\u06CC \u06A9\u06C6\u06CC \u06AF\u0634\u062A\u06CC \u062A\u06CE\u067E\u06D5\u0695\u06CE\u0646\u062F\u0631\u0627",labelMaxTotalFileSize:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5\u06CC \u06A9\u06C6\u06CC \u067E\u06D5\u0695\u06AF\u06D5 {filesize}",labelFileTypeNotAllowed:"\u062C\u06C6\u0631\u06CC \u067E\u06D5\u0695\u06AF\u06D5\u06A9\u06D5 \u0646\u0627\u062F\u0631\u0648\u0633\u062A\u06D5",fileValidateTypeLabelExpectedTypes:"\u062C\u06AF\u06D5 \u0644\u06D5 {allButLastType} \u06CC\u0627\u0646 {lastType}",imageValidateSizeLabelFormatError:"\u062C\u06C6\u0631\u06CC \u0648\u06CE\u0646\u06D5 \u067E\u0627\u06B5\u067E\u0634\u062A\u06CC\u06CC \u0646\u06D5\u06A9\u0631\u0627\u0648\u06D5",imageValidateSizeLabelImageSizeTooSmall:"\u0648\u06CE\u0646\u06D5\u06A9\u06D5 \u0632\u06C6\u0631 \u0628\u0686\u0648\u0648\u06A9\u06D5",imageValidateSizeLabelImageSizeTooBig:"\u0648\u06CE\u0646\u06D5\u06A9\u06D5 \u0632\u06C6\u0631 \u06AF\u06D5\u0648\u0631\u06D5\u06CC\u06D5",imageValidateSizeLabelExpectedMinSize:"\u06A9\u06D5\u0645\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5 {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0642\u06D5\u0628\u0627\u0631\u06D5 {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0648\u0631\u062F\u0628\u06CC\u0646\u06CC\u06CC\u06D5\u06A9\u06D5\u06CC \u0632\u06C6\u0631 \u06A9\u06D5\u0645\u06D5",imageValidateSizeLabelImageResolutionTooHigh:"\u0648\u0631\u062F\u0628\u06CC\u0646\u06CC\u06CC\u06D5\u06A9\u06D5\u06CC \u0632\u06C6\u0631 \u0628\u06D5\u0631\u0632\u06D5",imageValidateSizeLabelExpectedMinResolution:"\u06A9\u06D5\u0645\u062A\u0631\u06CC\u0646 \u0648\u0631\u062F\u0628\u06CC\u0646\u06CC\u06CC {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u0632\u06C6\u0631\u062A\u0631\u06CC\u0646 \u0648\u0631\u062F\u0628\u06CC\u0646\u06CC {maxResolution}"};var zo={labelIdle:'P\u0159et\xE1hn\u011Bte soubor sem (drag&drop) nebo Vyhledat ',labelInvalidField:"Pole obsahuje chybn\xE9 soubory",labelFileWaitingForSize:"Zji\u0161\u0165uje se velikost",labelFileSizeNotAvailable:"Velikost nen\xED zn\xE1m\xE1",labelFileLoading:"P\u0159en\xE1\u0161\xED se",labelFileLoadError:"Chyba p\u0159i p\u0159enosu",labelFileProcessing:"Prob\xEDh\xE1 upload",labelFileProcessingComplete:"Upload dokon\u010Den",labelFileProcessingAborted:"Upload stornov\xE1n",labelFileProcessingError:"Chyba p\u0159i uploadu",labelFileProcessingRevertError:"Chyba p\u0159i obnov\u011B",labelFileRemoveError:"Chyba p\u0159i odstran\u011Bn\xED",labelTapToCancel:"klepn\u011Bte pro storno",labelTapToRetry:"klepn\u011Bte pro opakov\xE1n\xED",labelTapToUndo:"klepn\u011Bte pro vr\xE1cen\xED",labelButtonRemoveItem:"Odstranit",labelButtonAbortItemLoad:"Storno",labelButtonRetryItemLoad:"Opakovat",labelButtonAbortItemProcessing:"Zp\u011Bt",labelButtonUndoItemProcessing:"Vr\xE1tit",labelButtonRetryItemProcessing:"Opakovat",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"Soubor je p\u0159\xEDli\u0161 velk\xFD",labelMaxFileSize:"Nejv\u011Bt\u0161\xED velikost souboru je {filesize}",labelMaxTotalFileSizeExceeded:"P\u0159ekro\u010Dena maxim\xE1ln\xED celkov\xE1 velikost souboru",labelMaxTotalFileSize:"Maxim\xE1ln\xED celkov\xE1 velikost souboru je {filesize}",labelFileTypeNotAllowed:"Soubor je nespr\xE1vn\xE9ho typu",fileValidateTypeLabelExpectedTypes:"O\u010Dek\xE1v\xE1 se {allButLastType} nebo {lastType}",imageValidateSizeLabelFormatError:"Obr\xE1zek tohoto typu nen\xED podporov\xE1n",imageValidateSizeLabelImageSizeTooSmall:"Obr\xE1zek je p\u0159\xEDli\u0161 mal\xFD",imageValidateSizeLabelImageSizeTooBig:"Obr\xE1zek je p\u0159\xEDli\u0161 velk\xFD",imageValidateSizeLabelExpectedMinSize:"Minim\xE1ln\xED rozm\u011Br je {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maxim\xE1ln\xED rozm\u011Br je {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Rozli\u0161en\xED je p\u0159\xEDli\u0161 mal\xE9",imageValidateSizeLabelImageResolutionTooHigh:"Rozli\u0161en\xED je p\u0159\xEDli\u0161 velk\xE9",imageValidateSizeLabelExpectedMinResolution:"Minim\xE1ln\xED rozli\u0161en\xED je {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maxim\xE1ln\xED rozli\u0161en\xED je {maxResolution}"};var Oo={labelIdle:'Tr\xE6k & slip filer eller Gennemse ',labelInvalidField:"Felt indeholder ugyldige filer",labelFileWaitingForSize:"Venter p\xE5 st\xF8rrelse",labelFileSizeNotAvailable:"St\xF8rrelse ikke tilg\xE6ngelig",labelFileLoading:"Loader",labelFileLoadError:"Load fejlede",labelFileProcessing:"Uploader",labelFileProcessingComplete:"Upload f\xE6rdig",labelFileProcessingAborted:"Upload annulleret",labelFileProcessingError:"Upload fejlede",labelFileProcessingRevertError:"Fortryd fejlede",labelFileRemoveError:"Fjern fejlede",labelTapToCancel:"tryk for at annullere",labelTapToRetry:"tryk for at pr\xF8ve igen",labelTapToUndo:"tryk for at fortryde",labelButtonRemoveItem:"Fjern",labelButtonAbortItemLoad:"Annuller",labelButtonRetryItemLoad:"Fors\xF8g igen",labelButtonAbortItemProcessing:"Annuller",labelButtonUndoItemProcessing:"Fortryd",labelButtonRetryItemProcessing:"Pr\xF8v igen",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"Filen er for stor",labelMaxFileSize:"Maksimal filst\xF8rrelse er {filesize}",labelMaxTotalFileSizeExceeded:"Maksimal totalst\xF8rrelse overskredet",labelMaxTotalFileSize:"Maksimal total filst\xF8rrelse er {filesize}",labelFileTypeNotAllowed:"Ugyldig filtype",fileValidateTypeLabelExpectedTypes:"Forventer {allButLastType} eller {lastType}",imageValidateSizeLabelFormatError:"Ugyldigt format",imageValidateSizeLabelImageSizeTooSmall:"Billedet er for lille",imageValidateSizeLabelImageSizeTooBig:"Billedet er for stort",imageValidateSizeLabelExpectedMinSize:"Minimum st\xF8rrelse er {minBredde} \xD7 {minH\xF8jde}",imageValidateSizeLabelExpectedMaxSize:"Maksimal st\xF8rrelse er {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"For lav opl\xF8sning",imageValidateSizeLabelImageResolutionTooHigh:"For h\xF8j opl\xF8sning",imageValidateSizeLabelExpectedMinResolution:"Minimum opl\xF8sning er {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksimal opl\xF8sning er {maxResolution}"};var Fo={labelIdle:'Dateien ablegen oder ausw\xE4hlen ',labelInvalidField:"Feld beinhaltet ung\xFCltige Dateien",labelFileWaitingForSize:"Dateigr\xF6\xDFe berechnen",labelFileSizeNotAvailable:"Dateigr\xF6\xDFe nicht verf\xFCgbar",labelFileLoading:"Laden",labelFileLoadError:"Fehler beim Laden",labelFileProcessing:"Upload l\xE4uft",labelFileProcessingComplete:"Upload abgeschlossen",labelFileProcessingAborted:"Upload abgebrochen",labelFileProcessingError:"Fehler beim Upload",labelFileProcessingRevertError:"Fehler beim Wiederherstellen",labelFileRemoveError:"Fehler beim L\xF6schen",labelTapToCancel:"abbrechen",labelTapToRetry:"erneut versuchen",labelTapToUndo:"r\xFCckg\xE4ngig",labelButtonRemoveItem:"Entfernen",labelButtonAbortItemLoad:"Verwerfen",labelButtonRetryItemLoad:"Erneut versuchen",labelButtonAbortItemProcessing:"Abbrechen",labelButtonUndoItemProcessing:"R\xFCckg\xE4ngig",labelButtonRetryItemProcessing:"Erneut versuchen",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"Datei ist zu gro\xDF",labelMaxFileSize:"Maximale Dateigr\xF6\xDFe: {filesize}",labelMaxTotalFileSizeExceeded:"Maximale gesamte Dateigr\xF6\xDFe \xFCberschritten",labelMaxTotalFileSize:"Maximale gesamte Dateigr\xF6\xDFe: {filesize}",labelFileTypeNotAllowed:"Dateityp ung\xFCltig",fileValidateTypeLabelExpectedTypes:"Erwartet {allButLastType} oder {lastType}",imageValidateSizeLabelFormatError:"Bildtyp nicht unterst\xFCtzt",imageValidateSizeLabelImageSizeTooSmall:"Bild ist zu klein",imageValidateSizeLabelImageSizeTooBig:"Bild ist zu gro\xDF",imageValidateSizeLabelExpectedMinSize:"Mindestgr\xF6\xDFe: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximale Gr\xF6\xDFe: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Aufl\xF6sung ist zu niedrig",imageValidateSizeLabelImageResolutionTooHigh:"Aufl\xF6sung ist zu hoch",imageValidateSizeLabelExpectedMinResolution:"Mindestaufl\xF6sung: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximale Aufl\xF6sung: {maxResolution}"};var Do={labelIdle:'\u03A3\u03CD\u03C1\u03B5\u03C4\u03B5 \u03C4\u03B1 \u03B1\u03C1\u03C7\u03B5\u03AF\u03B1 \u03C3\u03B1\u03C2 \u03C3\u03C4\u03BF \u03C0\u03BB\u03B1\u03AF\u03C3\u03B9\u03BF \u03AE \u0395\u03C0\u03B9\u03BB\u03AD\u03BE\u03C4\u03B5 ',labelInvalidField:"\u03A4\u03BF \u03C0\u03B5\u03B4\u03AF\u03BF \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 \u03BC\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B1 \u03B1\u03C1\u03C7\u03B5\u03AF\u03B1",labelFileWaitingForSize:"\u03A3\u03B5 \u03B1\u03BD\u03B1\u03BC\u03BF\u03BD\u03AE \u03B3\u03B9\u03B1 \u03C4\u03BF \u03BC\u03AD\u03B3\u03B5\u03B8\u03BF\u03C2",labelFileSizeNotAvailable:"\u039C\u03AD\u03B3\u03B5\u03B8\u03BF\u03C2 \u03BC\u03B7 \u03B4\u03B9\u03B1\u03B8\u03AD\u03C3\u03B9\u03BC\u03BF",labelFileLoading:"\u03A6\u03CC\u03C1\u03C4\u03C9\u03C3\u03B7 \u03C3\u03B5 \u03B5\u03BE\u03AD\u03BB\u03B9\u03BE\u03B7",labelFileLoadError:"\u03A3\u03C6\u03AC\u03BB\u03BC\u03B1 \u03BA\u03B1\u03C4\u03AC \u03C4\u03B7 \u03C6\u03CC\u03C1\u03C4\u03C9\u03C3\u03B7",labelFileProcessing:"\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1",labelFileProcessingComplete:"\u0397 \u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03BF\u03BB\u03BF\u03BA\u03BB\u03B7\u03C1\u03CE\u03B8\u03B7\u03BA\u03B5",labelFileProcessingAborted:"\u0397 \u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03B1\u03BA\u03C5\u03C1\u03CE\u03B8\u03B7\u03BA\u03B5",labelFileProcessingError:"\u03A3\u03C6\u03AC\u03BB\u03BC\u03B1 \u03BA\u03B1\u03C4\u03AC \u03C4\u03B7\u03BD \u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1",labelFileProcessingRevertError:"\u03A3\u03C6\u03AC\u03BB\u03BC\u03B1 \u03BA\u03B1\u03C4\u03AC \u03C4\u03B7\u03BD \u03B5\u03C0\u03B1\u03BD\u03B1\u03C6\u03BF\u03C1\u03AC",labelFileRemoveError:"\u03A3\u03C6\u03AC\u03BB\u03BC\u03B1 \u03BA\u03B1\u03C4\u03AC \u03C4\u03B7\u03BD \u03B4\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE",labelTapToCancel:"\u03C0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03B3\u03B9\u03B1 \u03B1\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7",labelTapToRetry:"\u03C0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03B3\u03B9\u03B1 \u03B5\u03C0\u03B1\u03BD\u03AC\u03BB\u03B7\u03C8\u03B7",labelTapToUndo:"\u03C0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03B3\u03B9\u03B1 \u03B1\u03BD\u03B1\u03AF\u03C1\u03B5\u03C3\u03B7",labelButtonRemoveItem:"\u0391\u03C6\u03B1\u03AF\u03C1\u03B5\u03C3\u03B7",labelButtonAbortItemLoad:"\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7",labelButtonRetryItemLoad:"\u0395\u03C0\u03B1\u03BD\u03AC\u03BB\u03B7\u03C8\u03B7",labelButtonAbortItemProcessing:"\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7",labelButtonUndoItemProcessing:"\u0391\u03BD\u03B1\u03AF\u03C1\u03B5\u03C3\u03B7",labelButtonRetryItemProcessing:"\u0395\u03C0\u03B1\u03BD\u03AC\u03BB\u03B7\u03C8\u03B7",labelButtonProcessItem:"\u039C\u03B5\u03C4\u03B1\u03C6\u03CC\u03C1\u03C4\u03C9\u03C3\u03B7",labelMaxFileSizeExceeded:"\u03A4\u03BF \u03B1\u03C1\u03C7\u03B5\u03AF\u03BF \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF",labelMaxFileSize:"\u03A4\u03BF \u03BC\u03AD\u03B3\u03B9\u03C3\u03C4\u03BF \u03BC\u03AD\u03B3\u03B5\u03B8\u03BF\u03C2 \u03B1\u03C1\u03C7\u03B5\u03AF\u03BF\u03C5 \u03B5\u03AF\u03BD\u03B1\u03B9 {filesize}",labelMaxTotalFileSizeExceeded:"\u03A5\u03C0\u03AD\u03C1\u03B2\u03B1\u03C3\u03B7 \u03C4\u03BF\u03C5 \u03BC\u03AD\u03B3\u03B9\u03C3\u03C4\u03BF\u03C5 \u03C3\u03C5\u03BD\u03BF\u03BB\u03B9\u03BA\u03BF\u03CD \u03BC\u03B5\u03B3\u03AD\u03B8\u03BF\u03C5\u03C2",labelMaxTotalFileSize:"\u03A4\u03BF \u03BC\u03AD\u03B3\u03B9\u03C3\u03C4\u03BF \u03C3\u03C5\u03BD\u03BF\u03BB\u03B9\u03BA\u03CC \u03BC\u03AD\u03B3\u03B5\u03B8\u03BF\u03C2 \u03B1\u03C1\u03C7\u03B5\u03AF\u03C9\u03BD \u03B5\u03AF\u03BD\u03B1\u03B9 {filesize}",labelFileTypeNotAllowed:"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03C4\u03CD\u03C0\u03BF\u03C2 \u03B1\u03C1\u03C7\u03B5\u03AF\u03BF\u03C5",fileValidateTypeLabelExpectedTypes:"\u03A4\u03B1 \u03B1\u03C0\u03BF\u03B4\u03B5\u03BA\u03C4\u03AC \u03B1\u03C1\u03C7\u03B5\u03AF\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 {allButLastType} \u03AE {lastType}",imageValidateSizeLabelFormatError:"\u039F \u03C4\u03CD\u03C0\u03BF\u03C2 \u03C4\u03B7\u03C2 \u03B5\u03B9\u03BA\u03CC\u03BD\u03B1\u03C2 \u03B4\u03B5\u03BD \u03C5\u03C0\u03BF\u03C3\u03C4\u03B7\u03C1\u03AF\u03B6\u03B5\u03C4\u03B1\u03B9",imageValidateSizeLabelImageSizeTooSmall:"\u0397 \u03B5\u03B9\u03BA\u03CC\u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03AE",imageValidateSizeLabelImageSizeTooBig:"\u0397 \u03B5\u03B9\u03BA\u03CC\u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03B7",imageValidateSizeLabelExpectedMinSize:"\u03A4\u03BF \u03B5\u03BB\u03AC\u03C7\u03B9\u03C3\u03C4\u03BF \u03B1\u03C0\u03BF\u03B4\u03B5\u03BA\u03C4\u03CC \u03BC\u03AD\u03B3\u03B5\u03B8\u03BF\u03C2 \u03B5\u03AF\u03BD\u03B1\u03B9 {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u03A4\u03BF \u03BC\u03AD\u03B3\u03B9\u03C3\u03C4\u03BF \u03B1\u03C0\u03BF\u03B4\u03B5\u03BA\u03C4\u03CC \u03BC\u03AD\u03B3\u03B5\u03B8\u03BF\u03C2 \u03B5\u03AF\u03BD\u03B1\u03B9 {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0397 \u03B1\u03BD\u03AC\u03BB\u03C5\u03C3\u03B7 \u03C4\u03B7\u03C2 \u03B5\u03B9\u03BA\u03CC\u03BD\u03B1\u03C2 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03CD \u03C7\u03B1\u03BC\u03B7\u03BB\u03AE",imageValidateSizeLabelImageResolutionTooHigh:"\u0397 \u03B1\u03BD\u03AC\u03BB\u03C5\u03C3\u03B7 \u03C4\u03B7\u03C2 \u03B5\u03B9\u03BA\u03CC\u03BD\u03B1\u03C2 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03CD \u03C5\u03C8\u03B7\u03BB\u03AE",imageValidateSizeLabelExpectedMinResolution:"\u0397 \u03B5\u03BB\u03AC\u03C7\u03B9\u03C3\u03C4\u03B7 \u03B1\u03C0\u03BF\u03B4\u03B5\u03BA\u03C4\u03AE \u03B1\u03BD\u03AC\u03BB\u03C5\u03C3\u03B7 \u03B5\u03AF\u03BD\u03B1\u03B9 {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u0397 \u03BC\u03AD\u03B3\u03B9\u03C3\u03C4\u03B7 \u03B1\u03C0\u03BF\u03B4\u03B5\u03BA\u03C4\u03AE \u03B1\u03BD\u03AC\u03BB\u03C5\u03C3\u03B7 \u03B5\u03AF\u03BD\u03B1\u03B9 {maxResolution}"};var Co={labelIdle:'Drag & Drop your files or Browse ',labelInvalidField:"Field contains invalid files",labelFileWaitingForSize:"Waiting for size",labelFileSizeNotAvailable:"Size not available",labelFileLoading:"Loading",labelFileLoadError:"Error during load",labelFileProcessing:"Uploading",labelFileProcessingComplete:"Upload complete",labelFileProcessingAborted:"Upload cancelled",labelFileProcessingError:"Error during upload",labelFileProcessingRevertError:"Error during revert",labelFileRemoveError:"Error during remove",labelTapToCancel:"tap to cancel",labelTapToRetry:"tap to retry",labelTapToUndo:"tap to undo",labelButtonRemoveItem:"Remove",labelButtonAbortItemLoad:"Abort",labelButtonRetryItemLoad:"Retry",labelButtonAbortItemProcessing:"Cancel",labelButtonUndoItemProcessing:"Undo",labelButtonRetryItemProcessing:"Retry",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"File is too large",labelMaxFileSize:"Maximum file size is {filesize}",labelMaxTotalFileSizeExceeded:"Maximum total size exceeded",labelMaxTotalFileSize:"Maximum total file size is {filesize}",labelFileTypeNotAllowed:"File of invalid type",fileValidateTypeLabelExpectedTypes:"Expects {allButLastType} or {lastType}",imageValidateSizeLabelFormatError:"Image type not supported",imageValidateSizeLabelImageSizeTooSmall:"Image is too small",imageValidateSizeLabelImageSizeTooBig:"Image is too big",imageValidateSizeLabelExpectedMinSize:"Minimum size is {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximum size is {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resolution is too low",imageValidateSizeLabelImageResolutionTooHigh:"Resolution is too high",imageValidateSizeLabelExpectedMinResolution:"Minimum resolution is {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximum resolution is {maxResolution}"};var Bo={labelIdle:'Arrastra y suelta tus archivos o Examina ',labelInvalidField:"El campo contiene archivos inv\xE1lidos",labelFileWaitingForSize:"Esperando tama\xF1o",labelFileSizeNotAvailable:"Tama\xF1o no disponible",labelFileLoading:"Cargando",labelFileLoadError:"Error durante la carga",labelFileProcessing:"Subiendo",labelFileProcessingComplete:"Subida completa",labelFileProcessingAborted:"Subida cancelada",labelFileProcessingError:"Error durante la subida",labelFileProcessingRevertError:"Error durante la reversi\xF3n",labelFileRemoveError:"Error durante la eliminaci\xF3n",labelTapToCancel:"toca para cancelar",labelTapToRetry:"tocar para reintentar",labelTapToUndo:"tocar para deshacer",labelButtonRemoveItem:"Eliminar",labelButtonAbortItemLoad:"Cancelar",labelButtonRetryItemLoad:"Reintentar",labelButtonAbortItemProcessing:"Cancelar",labelButtonUndoItemProcessing:"Deshacer",labelButtonRetryItemProcessing:"Reintentar",labelButtonProcessItem:"Subir",labelMaxFileSizeExceeded:"El archivo es demasiado grande",labelMaxFileSize:"El tama\xF1o m\xE1ximo del archivo es {filesize}",labelMaxTotalFileSizeExceeded:"Tama\xF1o total m\xE1ximo excedido",labelMaxTotalFileSize:"El tama\xF1o total m\xE1ximo del archivo es {filesize}",labelFileTypeNotAllowed:"Archivo de tipo inv\xE1lido",fileValidateTypeLabelExpectedTypes:"Espera {allButLastType} o {lastType}",imageValidateSizeLabelFormatError:"Tipo de imagen no soportada",imageValidateSizeLabelImageSizeTooSmall:"La imagen es demasiado peque\xF1a",imageValidateSizeLabelImageSizeTooBig:"La imagen es demasiado grande",imageValidateSizeLabelExpectedMinSize:"El tama\xF1o m\xEDnimo es {minWidth} x {minHeight}",imageValidateSizeLabelExpectedMaxSize:"El tama\xF1o m\xE1ximo es {maxWidth} x {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"La resoluci\xF3n es demasiado baja",imageValidateSizeLabelImageResolutionTooHigh:"La resoluci\xF3n es demasiado alta",imageValidateSizeLabelExpectedMinResolution:"La resoluci\xF3n m\xEDnima es {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"La resoluci\xF3n m\xE1xima es {maxResolution}"};var No={labelIdle:'\u0641\u0627\u06CC\u0644 \u0631\u0627 \u0627\u06CC\u0646\u062C\u0627 \u0628\u06A9\u0634\u06CC\u062F \u0648 \u0631\u0647\u0627 \u06A9\u0646\u06CC\u062F\u060C \u06CC\u0627 \u062C\u0633\u062A\u062C\u0648 \u06A9\u0646\u06CC\u062F ',labelInvalidField:"\u0641\u06CC\u0644\u062F \u062F\u0627\u0631\u0627\u06CC \u0641\u0627\u06CC\u0644 \u0647\u0627\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A",labelFileWaitingForSize:"Waiting for size",labelFileSizeNotAvailable:"\u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 \u0645\u062C\u0627\u0632 \u0646\u06CC\u0633\u062A",labelFileLoading:"\u062F\u0631\u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",labelFileLoadError:"\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u0627\u062C\u0631\u0627",labelFileProcessing:"\u062F\u0631\u062D\u0627\u0644 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",labelFileProcessingComplete:"\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u06A9\u0627\u0645\u0644 \u0634\u062F",labelFileProcessingAborted:"\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC \u0644\u063A\u0648 \u0634\u062F",labelFileProcessingError:"\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",labelFileProcessingRevertError:"\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u062D\u0630\u0641",labelFileRemoveError:"\u062E\u0637\u0627 \u062F\u0631 \u0632\u0645\u0627\u0646 \u062D\u0630\u0641",labelTapToCancel:"\u0628\u0631\u0627\u06CC \u0644\u063A\u0648 \u0636\u0631\u0628\u0647 \u0628\u0632\u0646\u06CC\u062F",labelTapToRetry:"\u0628\u0631\u0627\u06CC \u062A\u06A9\u0631\u0627\u0631 \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F",labelTapToUndo:"\u0628\u0631\u0627\u06CC \u0628\u0631\u06AF\u0634\u062A \u06A9\u0644\u06CC\u06A9 \u06A9\u0646\u06CC\u062F",labelButtonRemoveItem:"\u062D\u0630\u0641",labelButtonAbortItemLoad:"\u0644\u063A\u0648",labelButtonRetryItemLoad:"\u062A\u06A9\u0631\u0627\u0631",labelButtonAbortItemProcessing:"\u0644\u063A\u0648",labelButtonUndoItemProcessing:"\u0628\u0631\u06AF\u0634\u062A",labelButtonRetryItemProcessing:"\u062A\u06A9\u0631\u0627\u0631",labelButtonProcessItem:"\u0628\u0627\u0631\u06AF\u0630\u0627\u0631\u06CC",labelMaxFileSizeExceeded:"\u0641\u0627\u06CC\u0644 \u0628\u0633\u06CC\u0627\u0631 \u062D\u062C\u06CC\u0645 \u0627\u0633\u062A",labelMaxFileSize:"\u062D\u062F\u0627\u06A9\u062B\u0631 \u0645\u062C\u0627\u0632 \u0641\u0627\u06CC\u0644 {filesize} \u0627\u0633\u062A",labelMaxTotalFileSizeExceeded:"\u0627\u0632 \u062D\u062F\u0627\u06A9\u062B\u0631 \u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 \u0628\u06CC\u0634\u062A\u0631 \u0634\u062F",labelMaxTotalFileSize:"\u062D\u062F\u0627\u06A9\u062B\u0631 \u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 {filesize} \u0627\u0633\u062A",labelFileTypeNotAllowed:"\u0646\u0648\u0639 \u0641\u0627\u06CC\u0644 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A",fileValidateTypeLabelExpectedTypes:"\u062F\u0631 \u0627\u0646\u062A\u0638\u0627\u0631 {allButLastType} \u06CC\u0627 {lastType}",imageValidateSizeLabelFormatError:"\u0641\u0631\u0645\u062A \u062A\u0635\u0648\u06CC\u0631 \u067E\u0634\u062A\u06CC\u0628\u0627\u0646\u06CC \u0646\u0645\u06CC \u0634\u0648\u062F",imageValidateSizeLabelImageSizeTooSmall:"\u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u06A9\u0648\u0686\u06A9 \u0627\u0633\u062A",imageValidateSizeLabelImageSizeTooBig:"\u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u0628\u0632\u0631\u06AF \u0627\u0633\u062A",imageValidateSizeLabelExpectedMinSize:"\u062D\u062F\u0627\u0642\u0644 \u0627\u0646\u062F\u0627\u0632\u0647 {minWidth} \xD7 {minHeight} \u0627\u0633\u062A",imageValidateSizeLabelExpectedMaxSize:"\u062D\u062F\u0627\u06A9\u062B\u0631 \u0627\u0646\u062F\u0627\u0632\u0647 {maxWidth} \xD7 {maxHeight} \u0627\u0633\u062A",imageValidateSizeLabelImageResolutionTooLow:"\u0648\u0636\u0648\u062D \u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u06A9\u0645 \u0627\u0633\u062A",imageValidateSizeLabelImageResolutionTooHigh:"\u0648\u0636\u0648\u0639 \u062A\u0635\u0648\u06CC\u0631 \u0628\u0633\u06CC\u0627\u0631 \u0632\u06CC\u0627\u062F \u0627\u0633\u062A",imageValidateSizeLabelExpectedMinResolution:"\u062D\u062F\u0627\u0642\u0644 \u0648\u0636\u0648\u062D \u062A\u0635\u0648\u06CC\u0631 {minResolution} \u0627\u0633\u062A",imageValidateSizeLabelExpectedMaxResolution:"\u062D\u062F\u0627\u06A9\u062B\u0631 \u0648\u0636\u0648\u062D \u062A\u0635\u0648\u06CC\u0631 {maxResolution} \u0627\u0633\u062A"};var ko={labelIdle:'Ved\xE4 ja pudota tiedostoja tai Selaa ',labelInvalidField:"Kent\xE4ss\xE4 on virheellisi\xE4 tiedostoja",labelFileWaitingForSize:"Odotetaan kokoa",labelFileSizeNotAvailable:"Kokoa ei saatavilla",labelFileLoading:"Ladataan",labelFileLoadError:"Virhe latauksessa",labelFileProcessing:"L\xE4hetet\xE4\xE4n",labelFileProcessingComplete:"L\xE4hetys valmis",labelFileProcessingAborted:"L\xE4hetys peruttu",labelFileProcessingError:"Virhe l\xE4hetyksess\xE4",labelFileProcessingRevertError:"Virhe palautuksessa",labelFileRemoveError:"Virhe poistamisessa",labelTapToCancel:"peruuta napauttamalla",labelTapToRetry:"yrit\xE4 uudelleen napauttamalla",labelTapToUndo:"kumoa napauttamalla",labelButtonRemoveItem:"Poista",labelButtonAbortItemLoad:"Keskeyt\xE4",labelButtonRetryItemLoad:"Yrit\xE4 uudelleen",labelButtonAbortItemProcessing:"Peruuta",labelButtonUndoItemProcessing:"Kumoa",labelButtonRetryItemProcessing:"Yrit\xE4 uudelleen",labelButtonProcessItem:"L\xE4het\xE4",labelMaxFileSizeExceeded:"Tiedoston koko on liian suuri",labelMaxFileSize:"Tiedoston maksimikoko on {filesize}",labelMaxTotalFileSizeExceeded:"Tiedostojen yhdistetty maksimikoko ylitetty",labelMaxTotalFileSize:"Tiedostojen yhdistetty maksimikoko on {filesize}",labelFileTypeNotAllowed:"Tiedostotyyppi\xE4 ei sallita",fileValidateTypeLabelExpectedTypes:"Sallitaan {allButLastType} tai {lastType}",imageValidateSizeLabelFormatError:"Kuvatyyppi\xE4 ei tueta",imageValidateSizeLabelImageSizeTooSmall:"Kuva on liian pieni",imageValidateSizeLabelImageSizeTooBig:"Kuva on liian suuri",imageValidateSizeLabelExpectedMinSize:"Minimikoko on {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksimikoko on {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resoluutio on liian pieni",imageValidateSizeLabelImageResolutionTooHigh:"Resoluutio on liian suuri",imageValidateSizeLabelExpectedMinResolution:"Minimiresoluutio on {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksimiresoluutio on {maxResolution}"};var Vo={labelIdle:'Faites glisser vos fichiers ou Parcourir ',labelInvalidField:"Le champ contient des fichiers invalides",labelFileWaitingForSize:"En attente de taille",labelFileSizeNotAvailable:"Taille non disponible",labelFileLoading:"Chargement",labelFileLoadError:"Erreur durant le chargement",labelFileProcessing:"Traitement",labelFileProcessingComplete:"Traitement effectu\xE9",labelFileProcessingAborted:"Traitement interrompu",labelFileProcessingError:"Erreur durant le traitement",labelFileProcessingRevertError:"Erreur durant la restauration",labelFileRemoveError:"Erreur durant la suppression",labelTapToCancel:"appuyer pour annuler",labelTapToRetry:"appuyer pour r\xE9essayer",labelTapToUndo:"appuyer pour revenir en arri\xE8re",labelButtonRemoveItem:"Retirer",labelButtonAbortItemLoad:"Annuler",labelButtonRetryItemLoad:"Recommencer",labelButtonAbortItemProcessing:"Annuler",labelButtonUndoItemProcessing:"Revenir en arri\xE8re",labelButtonRetryItemProcessing:"Recommencer",labelButtonProcessItem:"Transf\xE9rer",labelMaxFileSizeExceeded:"Le fichier est trop volumineux",labelMaxFileSize:"La taille maximale de fichier est {filesize}",labelMaxTotalFileSizeExceeded:"Taille totale maximale d\xE9pass\xE9e",labelMaxTotalFileSize:"La taille totale maximale des fichiers est {filesize}",labelFileTypeNotAllowed:"Fichier non valide",fileValidateTypeLabelExpectedTypes:"Attendu {allButLastType} ou {lastType}",imageValidateSizeLabelFormatError:"Type d'image non pris en charge",imageValidateSizeLabelImageSizeTooSmall:"L'image est trop petite",imageValidateSizeLabelImageSizeTooBig:"L'image est trop grande",imageValidateSizeLabelExpectedMinSize:"La taille minimale est {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"La taille maximale est {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"La r\xE9solution est trop faible",imageValidateSizeLabelImageResolutionTooHigh:"La r\xE9solution est trop \xE9lev\xE9e",imageValidateSizeLabelExpectedMinResolution:"La r\xE9solution minimale est {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"La r\xE9solution maximale est {maxResolution}"};var Go={labelIdle:'\u05D2\u05E8\u05D5\u05E8 \u05D5\u05E9\u05D7\u05E8\u05E8 \u05D0\u05EA \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D0\u05DF \u05D0\u05D5 \u05DC\u05D7\u05E5 \u05DB\u05D0\u05DF \u05DC\u05D1\u05D7\u05D9\u05E8\u05D4 ',labelInvalidField:"\u05E7\u05D5\u05D1\u05E5 \u05DC\u05D0 \u05D7\u05D5\u05E7\u05D9",labelFileWaitingForSize:"\u05DE\u05D7\u05E9\u05D1 \u05D0\u05EA \u05D2\u05D5\u05D3\u05DC \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD",labelFileSizeNotAvailable:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E7\u05D1\u05D5\u05E2 \u05D0\u05EA \u05D2\u05D5\u05D3\u05DC \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD",labelFileLoading:"\u05D8\u05D5\u05E2\u05DF...",labelFileLoadError:"\u05E9\u05D2\u05D9\u05D0\u05D4 \u05D0\u05E8\u05E2\u05D4 \u05D1\u05E2\u05EA \u05D8\u05E2\u05D9\u05E0\u05EA \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD",labelFileProcessing:"\u05DE\u05E2\u05DC\u05D4 \u05D0\u05EA \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD",labelFileProcessingComplete:"\u05D4\u05E2\u05DC\u05D0\u05EA \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D4\u05E1\u05EA\u05D9\u05D9\u05DE\u05D4",labelFileProcessingAborted:"\u05D4\u05E2\u05DC\u05D0\u05EA \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D1\u05D5\u05D8\u05DC\u05D4",labelFileProcessingError:"\u05E9\u05D2\u05D9\u05D0\u05D4 \u05D0\u05E8\u05E2\u05D4 \u05D1\u05E2\u05EA \u05D4\u05E2\u05DC\u05D0\u05EA \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD",labelFileProcessingRevertError:"\u05E9\u05D2\u05D9\u05D0\u05D4 \u05D0\u05E8\u05E2\u05D4 \u05D1\u05E2\u05EA \u05E9\u05D7\u05D6\u05D5\u05E8 \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD",labelFileRemoveError:"\u05E9\u05D2\u05D9\u05D0\u05D4 \u05D0\u05E8\u05E2\u05D4 \u05D1\u05E2\u05EA \u05D4\u05E1\u05E8\u05EA \u05D4\u05E7\u05D5\u05D1\u05E5",labelTapToCancel:"\u05D4\u05E7\u05DC\u05E7 \u05DC\u05D1\u05D9\u05D8\u05D5\u05DC",labelTapToRetry:"\u05D4\u05E7\u05DC\u05E7 \u05DC\u05E0\u05E1\u05D5\u05EA \u05E9\u05E0\u05D9\u05EA",labelTapToUndo:"\u05D4\u05E7\u05DC\u05E7 \u05DC\u05E9\u05D7\u05D6\u05E8",labelButtonRemoveItem:"\u05D4\u05E1\u05E8",labelButtonAbortItemLoad:"\u05D1\u05D8\u05DC",labelButtonRetryItemLoad:"\u05D8\u05E2\u05DF \u05E9\u05E0\u05D9\u05EA",labelButtonAbortItemProcessing:"\u05D1\u05D8\u05DC",labelButtonUndoItemProcessing:"\u05E9\u05D7\u05D6\u05E8",labelButtonRetryItemProcessing:"\u05E0\u05E1\u05D4 \u05E9\u05E0\u05D9\u05EA",labelButtonProcessItem:"\u05D4\u05E2\u05DC\u05D4 \u05E7\u05D5\u05D1\u05E5",labelMaxFileSizeExceeded:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",labelMaxFileSize:"\u05D2\u05D5\u05D3\u05DC \u05D4\u05DE\u05D9\u05E8\u05D1\u05D9 \u05D4\u05DE\u05D5\u05EA\u05E8 \u05D4\u05D5\u05D0: {filesize}",labelMaxTotalFileSizeExceeded:"\u05D2\u05D5\u05D3\u05DC \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D7\u05D5\u05E8\u05D2 \u05DE\u05D4\u05DB\u05DE\u05D5\u05EA \u05D4\u05DE\u05D5\u05EA\u05E8\u05EA",labelMaxTotalFileSize:"\u05D4\u05D2\u05D5\u05D3\u05DC \u05D4\u05DE\u05D9\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E1\u05DA \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD: {filesize}",labelFileTypeNotAllowed:"\u05E7\u05D5\u05D1\u05E5 \u05DE\u05E1\u05D5\u05D2 \u05D6\u05D4 \u05D0\u05D9\u05E0\u05D5 \u05DE\u05D5\u05EA\u05E8",fileValidateTypeLabelExpectedTypes:"\u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D4\u05DE\u05D5\u05EA\u05E8\u05D9\u05DD \u05D4\u05DD {allButLastType} \u05D0\u05D5 {lastType}",imageValidateSizeLabelFormatError:"\u05EA\u05DE\u05D5\u05E0\u05D4 \u05D1\u05E4\u05D5\u05E8\u05DE\u05D8 \u05D6\u05D4 \u05D0\u05D9\u05E0\u05D4 \u05E0\u05EA\u05DE\u05DB\u05EA",imageValidateSizeLabelImageSizeTooSmall:"\u05EA\u05DE\u05D5\u05E0\u05D4 \u05D6\u05D5 \u05E7\u05D8\u05E0\u05D4 \u05DE\u05D3\u05D9",imageValidateSizeLabelImageSizeTooBig:"\u05EA\u05DE\u05D5\u05E0\u05D4 \u05D6\u05D5 \u05D2\u05D3\u05D5\u05DC\u05D4 \u05DE\u05D3\u05D9",imageValidateSizeLabelExpectedMinSize:"\u05D4\u05D2\u05D5\u05D3\u05DC \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u05D4\u05D2\u05D5\u05D3\u05DC \u05D4\u05DE\u05E8\u05D1\u05D9 \u05D4\u05DE\u05D5\u05EA\u05E8: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u05D4\u05E8\u05D6\u05D5\u05DC\u05D5\u05E6\u05D9\u05D4 \u05E9\u05DC \u05EA\u05DE\u05D5\u05E0\u05D4 \u05D6\u05D5 \u05E0\u05DE\u05D5\u05DB\u05D4 \u05DE\u05D3\u05D9",imageValidateSizeLabelImageResolutionTooHigh:"\u05D4\u05E8\u05D6\u05D5\u05DC\u05D5\u05E6\u05D9\u05D4 \u05E9\u05DC \u05EA\u05DE\u05D5\u05E0\u05D4 \u05D6\u05D5 \u05D2\u05D1\u05D5\u05D4\u05D4 \u05DE\u05D3\u05D9",imageValidateSizeLabelExpectedMinResolution:"\u05D4\u05E8\u05D6\u05D5\u05DC\u05D5\u05E6\u05D9\u05D4 \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u05D4\u05E8\u05D6\u05D5\u05DC\u05D5\u05E6\u05D9\u05D4 \u05D4\u05DE\u05D9\u05E8\u05D1\u05D9\u05EA \u05D4\u05DE\u05D5\u05EA\u05E8\u05EA \u05D4\u05D9\u05D0: {maxResolution}"};var Uo={labelIdle:'Ovdje "ispusti" datoteku ili Pretra\u017Ei ',labelInvalidField:"Polje sadr\u017Ei neispravne datoteke",labelFileWaitingForSize:"\u010Cekanje na veli\u010Dinu datoteke",labelFileSizeNotAvailable:"Veli\u010Dina datoteke nije dostupna",labelFileLoading:"U\u010Ditavanje",labelFileLoadError:"Gre\u0161ka tijekom u\u010Ditavanja",labelFileProcessing:"Prijenos",labelFileProcessingComplete:"Prijenos zavr\u0161en",labelFileProcessingAborted:"Prijenos otkazan",labelFileProcessingError:"Gre\u0161ka tijekom prijenosa",labelFileProcessingRevertError:"Gre\u0161ka tijekom vra\u0107anja",labelFileRemoveError:"Gre\u0161ka tijekom uklananja datoteke",labelTapToCancel:"Dodirni za prekid",labelTapToRetry:"Dodirni za ponovno",labelTapToUndo:"Dodirni za vra\u0107anje",labelButtonRemoveItem:"Ukloni",labelButtonAbortItemLoad:"Odbaci",labelButtonRetryItemLoad:"Ponovi",labelButtonAbortItemProcessing:"Prekini",labelButtonUndoItemProcessing:"Vrati",labelButtonRetryItemProcessing:"Ponovi",labelButtonProcessItem:"Prijenos",labelMaxFileSizeExceeded:"Datoteka je prevelika",labelMaxFileSize:"Maksimalna veli\u010Dina datoteke je {filesize}",labelMaxTotalFileSizeExceeded:"Maksimalna ukupna veli\u010Dina datoteke prekora\u010Dena",labelMaxTotalFileSize:"Maksimalna ukupna veli\u010Dina datoteke je {filesize}",labelFileTypeNotAllowed:"Tip datoteke nije podr\u017Ean",fileValidateTypeLabelExpectedTypes:"O\u010Dekivan {allButLastType} ili {lastType}",imageValidateSizeLabelFormatError:"Tip slike nije podr\u017Ean",imageValidateSizeLabelImageSizeTooSmall:"Slika je premala",imageValidateSizeLabelImageSizeTooBig:"Slika je prevelika",imageValidateSizeLabelExpectedMinSize:"Minimalna veli\u010Dina je {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksimalna veli\u010Dina je {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Rezolucija je preniska",imageValidateSizeLabelImageResolutionTooHigh:"Rezolucija je previsoka",imageValidateSizeLabelExpectedMinResolution:"Minimalna rezolucija je {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksimalna rezolucija je {maxResolution}"};var Wo={labelIdle:'Mozgasd ide a f\xE1jlt a felt\xF6lt\xE9shez, vagy tall\xF3z\xE1s ',labelInvalidField:"A mez\u0151 \xE9rv\xE9nytelen f\xE1jlokat tartalmaz",labelFileWaitingForSize:"F\xE1ljm\xE9ret kisz\xE1mol\xE1sa",labelFileSizeNotAvailable:"A f\xE1jlm\xE9ret nem el\xE9rhet\u0151",labelFileLoading:"T\xF6lt\xE9s",labelFileLoadError:"Hiba a bet\xF6lt\xE9s sor\xE1n",labelFileProcessing:"Felt\xF6lt\xE9s",labelFileProcessingComplete:"Sikeres felt\xF6lt\xE9s",labelFileProcessingAborted:"A felt\xF6lt\xE9s megszak\xEDtva",labelFileProcessingError:"Hiba t\xF6rt\xE9nt a felt\xF6lt\xE9s sor\xE1n",labelFileProcessingRevertError:"Hiba a vissza\xE1ll\xEDt\xE1s sor\xE1n",labelFileRemoveError:"Hiba t\xF6rt\xE9nt az elt\xE1vol\xEDt\xE1s sor\xE1n",labelTapToCancel:"koppints a t\xF6rl\xE9shez",labelTapToRetry:"koppints az \xFAjrakezd\xE9shez",labelTapToUndo:"koppints a visszavon\xE1shoz",labelButtonRemoveItem:"Elt\xE1vol\xEDt\xE1s",labelButtonAbortItemLoad:"Megszak\xEDt\xE1s",labelButtonRetryItemLoad:"\xDAjrapr\xF3b\xE1lkoz\xE1s",labelButtonAbortItemProcessing:"Megszak\xEDt\xE1s",labelButtonUndoItemProcessing:"Visszavon\xE1s",labelButtonRetryItemProcessing:"\xDAjrapr\xF3b\xE1lkoz\xE1s",labelButtonProcessItem:"Felt\xF6lt\xE9s",labelMaxFileSizeExceeded:"A f\xE1jl t\xFAll\xE9pte a maxim\xE1lis m\xE9retet",labelMaxFileSize:"Maxim\xE1lis f\xE1jlm\xE9ret: {filesize}",labelMaxTotalFileSizeExceeded:"T\xFAll\xE9pte a maxim\xE1lis teljes m\xE9retet",labelMaxTotalFileSize:"A maxim\xE1is teljes f\xE1jlm\xE9ret: {filesize}",labelFileTypeNotAllowed:"\xC9rv\xE9nytelen t\xEDpus\xFA f\xE1jl",fileValidateTypeLabelExpectedTypes:"Enged\xE9lyezett t\xEDpusok {allButLastType} vagy {lastType}",imageValidateSizeLabelFormatError:"A k\xE9pt\xEDpus nem t\xE1mogatott",imageValidateSizeLabelImageSizeTooSmall:"A k\xE9p t\xFAl kicsi",imageValidateSizeLabelImageSizeTooBig:"A k\xE9p t\xFAl nagy",imageValidateSizeLabelExpectedMinSize:"Minimum m\xE9ret: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximum m\xE9ret: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"A felbont\xE1s t\xFAl alacsony",imageValidateSizeLabelImageResolutionTooHigh:"A felbont\xE1s t\xFAl magas",imageValidateSizeLabelExpectedMinResolution:"Minim\xE1is felbont\xE1s: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maxim\xE1lis felbont\xE1s: {maxResolution}"};var Ho={labelIdle:'Seret & Jatuhkan berkas Anda atau Jelajahi',labelInvalidField:"Isian berisi berkas yang tidak valid",labelFileWaitingForSize:"Menunggu ukuran berkas",labelFileSizeNotAvailable:"Ukuran berkas tidak tersedia",labelFileLoading:"Memuat",labelFileLoadError:"Kesalahan saat memuat",labelFileProcessing:"Mengunggah",labelFileProcessingComplete:"Pengunggahan selesai",labelFileProcessingAborted:"Pengunggahan dibatalkan",labelFileProcessingError:"Kesalahan saat pengunggahan",labelFileProcessingRevertError:"Kesalahan saat pemulihan",labelFileRemoveError:"Kesalahan saat penghapusan",labelTapToCancel:"ketuk untuk membatalkan",labelTapToRetry:"ketuk untuk mencoba lagi",labelTapToUndo:"ketuk untuk mengurungkan",labelButtonRemoveItem:"Hapus",labelButtonAbortItemLoad:"Batalkan",labelButtonRetryItemLoad:"Coba Kembali",labelButtonAbortItemProcessing:"Batalkan",labelButtonUndoItemProcessing:"Urungkan",labelButtonRetryItemProcessing:"Coba Kembali",labelButtonProcessItem:"Unggah",labelMaxFileSizeExceeded:"Berkas terlalu besar",labelMaxFileSize:"Ukuran berkas maksimum adalah {filesize}",labelMaxTotalFileSizeExceeded:"Jumlah berkas maksimum terlampaui",labelMaxTotalFileSize:"Jumlah berkas maksimum adalah {filesize}",labelFileTypeNotAllowed:"Jenis berkas tidak valid",fileValidateTypeLabelExpectedTypes:"Mengharapkan {allButLastType} atau {lastType}",imageValidateSizeLabelFormatError:"Jenis citra tidak didukung",imageValidateSizeLabelImageSizeTooSmall:"Citra terlalu kecil",imageValidateSizeLabelImageSizeTooBig:"Citra terlalu besar",imageValidateSizeLabelExpectedMinSize:"Ukuran minimum adalah {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Ukuran maksimum adalah {minWidth} \xD7 {minHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resolusi terlalu rendah",imageValidateSizeLabelImageResolutionTooHigh:"Resolusi terlalu tinggi",imageValidateSizeLabelExpectedMinResolution:"Resolusi minimum adalah {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Resolusi maksimum adalah {maxResolution}"};var jo={labelIdle:'Trascina e rilascia i tuoi file oppure Carica ',labelInvalidField:"Il campo contiene dei file non validi",labelFileWaitingForSize:"Aspettando le dimensioni",labelFileSizeNotAvailable:"Dimensioni non disponibili",labelFileLoading:"Caricamento",labelFileLoadError:"Errore durante il caricamento",labelFileProcessing:"Caricamento",labelFileProcessingComplete:"Caricamento completato",labelFileProcessingAborted:"Caricamento cancellato",labelFileProcessingError:"Errore durante il caricamento",labelFileProcessingRevertError:"Errore durante il ripristino",labelFileRemoveError:"Errore durante l'eliminazione",labelTapToCancel:"tocca per cancellare",labelTapToRetry:"tocca per riprovare",labelTapToUndo:"tocca per ripristinare",labelButtonRemoveItem:"Elimina",labelButtonAbortItemLoad:"Cancella",labelButtonRetryItemLoad:"Ritenta",labelButtonAbortItemProcessing:"Camcella",labelButtonUndoItemProcessing:"Indietro",labelButtonRetryItemProcessing:"Ritenta",labelButtonProcessItem:"Carica",labelMaxFileSizeExceeded:"Il peso del file \xE8 eccessivo",labelMaxFileSize:"Il peso massimo del file \xE8 {filesize}",labelMaxTotalFileSizeExceeded:"Dimensione totale massima superata",labelMaxTotalFileSize:"La dimensione massima totale del file \xE8 {filesize}",labelFileTypeNotAllowed:"File non supportato",fileValidateTypeLabelExpectedTypes:"Aspetta {allButLastType} o {lastType}",imageValidateSizeLabelFormatError:"Tipo di immagine non compatibile",imageValidateSizeLabelImageSizeTooSmall:"L'immagine \xE8 troppo piccola",imageValidateSizeLabelImageSizeTooBig:"L'immagine \xE8 troppo grande",imageValidateSizeLabelExpectedMinSize:"La dimensione minima \xE8 {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"La dimensione massima \xE8 {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"La risoluzione \xE8 troppo bassa",imageValidateSizeLabelImageResolutionTooHigh:"La risoluzione \xE8 troppo alta",imageValidateSizeLabelExpectedMinResolution:"La risoluzione minima \xE8 {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"La risoluzione massima \xE8 {maxResolution}"};var Yo={labelIdle:'\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30E9\u30C3\u30B0&\u30C9\u30ED\u30C3\u30D7\u53C8\u306F\u30D5\u30A1\u30A4\u30EB\u9078\u629E',labelInvalidField:"\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3067\u304D\u306A\u3044\u30D5\u30A1\u30A4\u30EB\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059",labelFileWaitingForSize:"\u30D5\u30A1\u30A4\u30EB\u30B5\u30A4\u30BA\u3092\u5F85\u3063\u3066\u3044\u307E\u3059",labelFileSizeNotAvailable:"\u30D5\u30A1\u30A4\u30EB\u30B5\u30A4\u30BA\u304C\u307F\u3064\u304B\u308A\u307E\u305B\u3093",labelFileLoading:"\u8AAD\u8FBC\u4E2D...",labelFileLoadError:"\u8AAD\u8FBC\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F",labelFileProcessing:"\u8AAD\u8FBC\u4E2D...",labelFileProcessingComplete:"\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u5B8C\u4E86",labelFileProcessingAborted:"\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u304C\u30AD\u30E3\u30F3\u30BB\u30EB\u3055\u308C\u307E\u3057\u305F",labelFileProcessingError:"\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F",labelFileProcessingRevertError:"\u30ED\u30FC\u30EB\u30D0\u30C3\u30AF\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F",labelFileRemoveError:"\u524A\u9664\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F",labelTapToCancel:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30AD\u30E3\u30F3\u30BB\u30EB",labelTapToRetry:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u4E0B\u3055\u3044",labelTapToUndo:"\u5143\u306B\u623B\u3059\u306B\u306F\u30BF\u30C3\u30D7\u3057\u307E\u3059",labelButtonRemoveItem:"\u524A\u9664",labelButtonAbortItemLoad:"\u4E2D\u65AD",labelButtonRetryItemLoad:"\u3082\u3046\u4E00\u5EA6\u5B9F\u884C",labelButtonAbortItemProcessing:"\u30AD\u30E3\u30F3\u30BB\u30EB",labelButtonUndoItemProcessing:"\u5143\u306B\u623B\u3059",labelButtonRetryItemProcessing:"\u3082\u3046\u4E00\u5EA6\u5B9F\u884C",labelButtonProcessItem:"\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",labelMaxFileSizeExceeded:"\u30D5\u30A1\u30A4\u30EB\u30B5\u30A4\u30BA\u304C\u5927\u304D\u3059\u304E\u307E\u3059",labelMaxFileSize:"\u6700\u5927\u30D5\u30A1\u30A4\u30EB\u30B5\u30A4\u30BA\u306F {filesize} \u3067\u3059",labelMaxTotalFileSizeExceeded:"\u6700\u5927\u5408\u8A08\u30B5\u30A4\u30BA\u3092\u8D85\u3048\u307E\u3057\u305F",labelMaxTotalFileSize:"\u6700\u5927\u5408\u8A08\u30D5\u30A1\u30A4\u30EB\u30B5\u30A4\u30BA\u306F {filesize} \u3067\u3059",labelFileTypeNotAllowed:"\u7121\u52B9\u306A\u30D5\u30A1\u30A4\u30EB\u3067\u3059",fileValidateTypeLabelExpectedTypes:"\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u308B\u30D5\u30A1\u30A4\u30EB\u306F {allButLastType} \u53C8\u306F {lastType} \u3067\u3059",imageValidateSizeLabelFormatError:"\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u306A\u3044\u753B\u50CF\u3067\u3059",imageValidateSizeLabelImageSizeTooSmall:"\u753B\u50CF\u304C\u5C0F\u3055\u3059\u304E\u307E\u3059",imageValidateSizeLabelImageSizeTooBig:"\u753B\u50CF\u304C\u5927\u304D\u3059\u304E\u307E\u3059",imageValidateSizeLabelExpectedMinSize:"\u753B\u50CF\u306E\u6700\u5C0F\u30B5\u30A4\u30BA\u306F{minWidth}\xD7{minHeight}\u3067\u3059",imageValidateSizeLabelExpectedMaxSize:"\u753B\u50CF\u306E\u6700\u5927\u30B5\u30A4\u30BA\u306F{maxWidth} \xD7 {maxHeight}\u3067\u3059",imageValidateSizeLabelImageResolutionTooLow:"\u753B\u50CF\u306E\u89E3\u50CF\u5EA6\u304C\u4F4E\u3059\u304E\u307E\u3059",imageValidateSizeLabelImageResolutionTooHigh:"\u753B\u50CF\u306E\u89E3\u50CF\u5EA6\u304C\u9AD8\u3059\u304E\u307E\u3059",imageValidateSizeLabelExpectedMinResolution:"\u753B\u50CF\u306E\u6700\u5C0F\u89E3\u50CF\u5EA6\u306F{minResolution}\u3067\u3059",imageValidateSizeLabelExpectedMaxResolution:"\u753B\u50CF\u306E\u6700\u5927\u89E3\u50CF\u5EA6\u306F{maxResolution}\u3067\u3059"};var qo={labelIdle:'\u1791\u17B6\u1789&\u178A\u17B6\u1780\u17CB\u17A0\u17D2\u179C\u17B6\u179B\u17CB\u17AF\u1780\u179F\u17B6\u179A\u179A\u1794\u179F\u17CB\u17A2\u17D2\u1793\u1780 \u17AC \u179F\u17D2\u179C\u17C2\u1784\u179A\u1780 ',labelInvalidField:"\u1785\u1793\u17D2\u179B\u17C4\u17C7\u1798\u17B6\u1793\u17AF\u1780\u179F\u17B6\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C",labelFileWaitingForSize:"\u1780\u17C6\u1796\u17BB\u1784\u179A\u1784\u17CB\u1785\u17B6\u17C6\u1791\u17C6\u17A0\u17C6",labelFileSizeNotAvailable:"\u1791\u17C6\u17A0\u17C6\u1798\u17B7\u1793\u17A2\u17B6\u1785\u1794\u17D2\u179A\u17BE\u1794\u17B6\u1793",labelFileLoading:"\u1780\u17C6\u1796\u17BB\u1784\u178A\u17C6\u178E\u17BE\u179A\u1780\u17B6\u179A",labelFileLoadError:"\u1798\u17B6\u1793\u1794\u1789\u17D2\u17A0\u17B6\u1780\u17C6\u17A1\u17BB\u1784\u1796\u17C1\u179B\u178A\u17C6\u178E\u17BE\u179A\u1780\u17B6\u179A",labelFileProcessing:"\u1780\u17C6\u1796\u17BB\u1784\u1795\u17D2\u1791\u17BB\u1780\u17A1\u17BE\u1784",labelFileProcessingComplete:"\u1780\u17B6\u179A\u1795\u17D2\u1791\u17BB\u1780\u17A1\u17BE\u1784\u1796\u17C1\u1789\u179B\u17C1\u1789",labelFileProcessingAborted:"\u1780\u17B6\u179A\u1794\u1784\u17D2\u17A0\u17C4\u17C7\u178F\u17D2\u179A\u17BC\u179C\u1794\u17B6\u1793\u1794\u17C4\u17C7\u1794\u1784\u17CB",labelFileProcessingError:"\u1798\u17B6\u1793\u1794\u1789\u17D2\u17A0\u17B6\u1780\u17C6\u17A1\u17BB\u1784\u1796\u17C1\u179B\u1780\u17C6\u1796\u17BB\u1784\u1795\u17D2\u1791\u17BB\u1780\u17A1\u17BE\u1784",labelFileProcessingRevertError:"\u1798\u17B6\u1793\u1794\u1789\u17D2\u17A0\u17B6\u1780\u17C6\u17A1\u17BB\u1784\u1796\u17C1\u179B\u178F\u17D2\u179A\u17A1\u1794\u17CB",labelFileRemoveError:"\u1798\u17B6\u1793\u1794\u1789\u17D2\u17A0\u17B6\u1780\u17C6\u17A1\u17BB\u1784\u1796\u17C1\u179B\u178A\u1780\u1785\u17C1\u1789",labelTapToCancel:"\u1785\u17BB\u1785\u178A\u17BE\u1798\u17D2\u1794\u17B8\u1794\u17C4\u17C7\u1794\u1784\u17CB",labelTapToRetry:"\u1785\u17BB\u1785\u178A\u17BE\u1798\u17D2\u1794\u17B8\u1796\u17D2\u1799\u17B6\u1799\u17B6\u1798\u1798\u17D2\u178F\u1784\u1791\u17C0\u178F",labelTapToUndo:"\u1785\u17BB\u1785\u178A\u17BE\u1798\u17D2\u1794\u17B8\u1798\u17B7\u1793\u1792\u17D2\u179C\u17BE\u179C\u17B7\u1789",labelButtonRemoveItem:"\u1799\u1780\u1785\u17C1\u1789",labelButtonAbortItemLoad:"\u1794\u17C4\u17C7\u1794\u1784\u17CB",labelButtonRetryItemLoad:"\u1796\u17D2\u1799\u17B6\u1799\u17B6\u1798\u1798\u17D2\u178F\u1784\u1791\u17C0\u178F",labelButtonAbortItemProcessing:"\u1794\u17C4\u17C7\u1794\u1784\u17CB",labelButtonUndoItemProcessing:"\u1798\u17B7\u1793\u1792\u17D2\u179C\u17BE\u179C\u17B7\u1789",labelButtonRetryItemProcessing:"\u1796\u17D2\u1799\u17B6\u1799\u17B6\u1798\u1798\u17D2\u178F\u1784\u1791\u17C0\u178F",labelButtonProcessItem:"\u1795\u17D2\u1791\u17BB\u1780\u17A1\u17BE\u1784",labelMaxFileSizeExceeded:"\u17AF\u1780\u179F\u17B6\u179A\u1792\u17C6\u1796\u17C1\u1780",labelMaxFileSize:"\u1791\u17C6\u17A0\u17C6\u17AF\u1780\u179F\u17B6\u179A\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6\u1782\u17BA {filesize}",labelMaxTotalFileSizeExceeded:"\u179B\u17BE\u179F\u1791\u17C6\u17A0\u17C6\u179F\u179A\u17BB\u1794\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6",labelMaxTotalFileSize:"\u1791\u17C6\u17A0\u17C6\u17AF\u1780\u179F\u17B6\u179A\u179F\u179A\u17BB\u1794\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6\u1782\u17BA {filesize}",labelFileTypeNotAllowed:"\u1794\u17D2\u179A\u1797\u17C1\u1791\u17AF\u1780\u179F\u17B6\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C",fileValidateTypeLabelExpectedTypes:"\u179A\u17C6\u1796\u17B9\u1784\u1790\u17B6 {allButLastType} \u17AC {lastType}",imageValidateSizeLabelFormatError:"\u1794\u17D2\u179A\u1797\u17C1\u1791\u179A\u17BC\u1794\u1797\u17B6\u1796\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C",imageValidateSizeLabelImageSizeTooSmall:"\u179A\u17BC\u1794\u1797\u17B6\u1796\u178F\u17BC\u1785\u1796\u17C1\u1780",imageValidateSizeLabelImageSizeTooBig:"\u179A\u17BC\u1794\u1797\u17B6\u1796\u1792\u17C6\u1796\u17C1\u1780",imageValidateSizeLabelExpectedMinSize:"\u1791\u17C6\u17A0\u17C6\u17A2\u1794\u17D2\u1794\u1794\u179A\u1798\u17B6\u1782\u17BA {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u1791\u17C6\u17A0\u17C6\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6\u1782\u17BA {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u1782\u17BB\u178E\u1797\u17B6\u1796\u1794\u1784\u17D2\u17A0\u17B6\u1789\u1791\u17B6\u1794\u1796\u17C1\u1780",imageValidateSizeLabelImageResolutionTooHigh:"\u1782\u17BB\u178E\u1797\u17B6\u1796\u1794\u1784\u17D2\u17A0\u17B6\u1789\u1781\u17D2\u1796\u179F\u17CB\u1796\u17C1\u1780",imageValidateSizeLabelExpectedMinResolution:"\u1782\u17BB\u178E\u1797\u17B6\u1796\u1794\u1784\u17D2\u17A0\u17B6\u1789\u17A2\u1794\u17D2\u1794\u1794\u179A\u1798\u17B6\u1782\u17BA {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u1782\u17BB\u178E\u1797\u17B6\u1796\u1794\u1784\u17D2\u17A0\u17B6\u1789\u17A2\u178F\u17B7\u1794\u179A\u1798\u17B6\u1782\u17BA {maxResolution}"};var $o={labelIdle:'\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8 \uD558\uAC70\uB098 \uCC3E\uC544\uBCF4\uAE30 ',labelInvalidField:"\uD544\uB4DC\uC5D0 \uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 \uD30C\uC77C\uC774 \uC788\uC2B5\uB2C8\uB2E4.",labelFileWaitingForSize:"\uC6A9\uB7C9 \uD655\uC778\uC911",labelFileSizeNotAvailable:"\uC0AC\uC6A9\uD560 \uC218 \uC5C6\uB294 \uC6A9\uB7C9",labelFileLoading:"\uBD88\uB7EC\uC624\uB294 \uC911",labelFileLoadError:"\uD30C\uC77C \uBD88\uB7EC\uC624\uAE30 \uC2E4\uD328",labelFileProcessing:"\uC5C5\uB85C\uB4DC \uC911",labelFileProcessingComplete:"\uC5C5\uB85C\uB4DC \uC131\uACF5",labelFileProcessingAborted:"\uC5C5\uB85C\uB4DC \uCDE8\uC18C\uB428",labelFileProcessingError:"\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC2E4\uD328",labelFileProcessingRevertError:"\uB418\uB3CC\uB9AC\uAE30 \uC2E4\uD328",labelFileRemoveError:"\uC81C\uAC70 \uC2E4\uD328",labelTapToCancel:"\uD0ED\uD558\uC5EC \uCDE8\uC18C",labelTapToRetry:"\uD0ED\uD558\uC5EC \uC7AC\uC2DC\uC791",labelTapToUndo:"\uD0ED\uD558\uC5EC \uC2E4\uD589 \uCDE8\uC18C",labelButtonRemoveItem:"\uC81C\uAC70",labelButtonAbortItemLoad:"\uC911\uB2E8",labelButtonRetryItemLoad:"\uC7AC\uC2DC\uC791",labelButtonAbortItemProcessing:"\uCDE8\uC18C",labelButtonUndoItemProcessing:"\uC2E4\uD589 \uCDE8\uC18C",labelButtonRetryItemProcessing:"\uC7AC\uC2DC\uC791",labelButtonProcessItem:"\uC5C5\uB85C\uB4DC",labelMaxFileSizeExceeded:"\uD30C\uC77C\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4.",labelMaxFileSize:"\uCD5C\uB300 \uD30C\uC77C \uC6A9\uB7C9\uC740 {filesize} \uC785\uB2C8\uB2E4.",labelMaxTotalFileSizeExceeded:"\uCD5C\uB300 \uC804\uCCB4 \uD30C\uC77C \uC6A9\uB7C9 \uCD08\uACFC\uD558\uC600\uC2B5\uB2C8\uB2E4.",labelMaxTotalFileSize:"\uCD5C\uB300 \uC804\uCCB4 \uD30C\uC77C \uC6A9\uB7C9\uC740 {filesize} \uC785\uB2C8\uB2E4.",labelFileTypeNotAllowed:"\uC798\uBABB\uB41C \uD615\uC2DD\uC758 \uD30C\uC77C",fileValidateTypeLabelExpectedTypes:"{allButLastType} \uB610\uB294 {lastType}",imageValidateSizeLabelFormatError:"\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 \uC774\uBBF8\uC9C0 \uC720\uD615",imageValidateSizeLabelImageSizeTooSmall:"\uC774\uBBF8\uC9C0\uAC00 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4.",imageValidateSizeLabelImageSizeTooBig:"\uC774\uBBF8\uC9C0\uAC00 \uB108\uBB34 \uD07D\uB2C8\uB2E4.",imageValidateSizeLabelExpectedMinSize:"\uC774\uBBF8\uC9C0 \uCD5C\uC18C \uD06C\uAE30\uB294 {minWidth} \xD7 {minHeight} \uC785\uB2C8\uB2E4",imageValidateSizeLabelExpectedMaxSize:"\uC774\uBBF8\uC9C0 \uCD5C\uB300 \uD06C\uAE30\uB294 {maxWidth} \xD7 {maxHeight} \uC785\uB2C8\uB2E4",imageValidateSizeLabelImageResolutionTooLow:"\uD574\uC0C1\uB3C4\uAC00 \uB108\uBB34 \uB0AE\uC2B5\uB2C8\uB2E4.",imageValidateSizeLabelImageResolutionTooHigh:"\uD574\uC0C1\uB3C4\uAC00 \uB108\uBB34 \uB192\uC2B5\uB2C8\uB2E4.",imageValidateSizeLabelExpectedMinResolution:"\uCD5C\uC18C \uD574\uC0C1\uB3C4\uB294 {minResolution} \uC785\uB2C8\uB2E4.",imageValidateSizeLabelExpectedMaxResolution:"\uCD5C\uB300 \uD574\uC0C1\uB3C4\uB294 {maxResolution} \uC785\uB2C8\uB2E4."};var Xo={labelIdle:'\u012Ed\u0117kite failus \u010Dia arba Ie\u0161kokite ',labelInvalidField:"Laukelis talpina netinkamus failus",labelFileWaitingForSize:"Laukiama dyd\u017Eio",labelFileSizeNotAvailable:"Dydis ne\u017Einomas",labelFileLoading:"Kraunama",labelFileLoadError:"Klaida \u012Fkeliant",labelFileProcessing:"\u012Ekeliama",labelFileProcessingComplete:"\u012Ek\u0117limas s\u0117kmingas",labelFileProcessingAborted:"\u012Ek\u0117limas at\u0161auktas",labelFileProcessingError:"\u012Ekeliant \u012Fvyko klaida",labelFileProcessingRevertError:"At\u0161aukiant \u012Fvyko klaida",labelFileRemoveError:"I\u0161trinant \u012Fvyko klaida",labelTapToCancel:"Palieskite nor\u0117dami at\u0161aukti",labelTapToRetry:"Palieskite nor\u0117dami pakartoti",labelTapToUndo:"Palieskite nor\u0117dami at\u0161aukti",labelButtonRemoveItem:"I\u0161trinti",labelButtonAbortItemLoad:"Sustabdyti",labelButtonRetryItemLoad:"Pakartoti",labelButtonAbortItemProcessing:"At\u0161aukti",labelButtonUndoItemProcessing:"At\u0161aukti",labelButtonRetryItemProcessing:"Pakartoti",labelButtonProcessItem:"\u012Ekelti",labelMaxFileSizeExceeded:"Failas per didelis",labelMaxFileSize:"Maksimalus failo dydis yra {filesize}",labelMaxTotalFileSizeExceeded:"Vir\u0161ijote maksimal\u0173 leistin\u0105 dyd\u012F",labelMaxTotalFileSize:"Maksimalus leistinas dydis yra {filesize}",labelFileTypeNotAllowed:"Netinkamas failas",fileValidateTypeLabelExpectedTypes:"Tikisi {allButLastType} arba {lastType}",imageValidateSizeLabelFormatError:"Nuotraukos formatas nepalaikomas",imageValidateSizeLabelImageSizeTooSmall:"Nuotrauka per ma\u017Ea",imageValidateSizeLabelImageSizeTooBig:"Nuotrauka per didel\u0117",imageValidateSizeLabelExpectedMinSize:"Minimalus dydis yra {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksimalus dydis yra {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Rezoliucija per ma\u017Ea",imageValidateSizeLabelImageResolutionTooHigh:"Rezoliucija per didel\u0117",imageValidateSizeLabelExpectedMinResolution:"Minimali rezoliucija yra {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksimali rezoliucija yra {maxResolution}"};var Ko={labelIdle:'Ievelciet savus failus vai p\u0101rl\u016Bkojiet \u0161eit ',labelInvalidField:"Lauks satur neder\u012Bgus failus",labelFileWaitingForSize:"Gaid\u0101m faila izm\u0113ru",labelFileSizeNotAvailable:"Izm\u0113rs nav pieejams",labelFileLoading:"Notiek iel\u0101de",labelFileLoadError:"Notika k\u013C\u016Bda iel\u0101des laik\u0101",labelFileProcessing:"Notiek aug\u0161upiel\u0101de",labelFileProcessingComplete:"Aug\u0161upiel\u0101de pabeigta",labelFileProcessingAborted:"Aug\u0161upiel\u0101de atcelta",labelFileProcessingError:"Notika k\u013C\u016Bda aug\u0161upiel\u0101des laik\u0101",labelFileProcessingRevertError:"Notika k\u013C\u016Bda atgrie\u0161anas laik\u0101",labelFileRemoveError:"Notika k\u013C\u016Bda dz\u0113\u0161anas laik\u0101",labelTapToCancel:"pieskarieties, lai atceltu",labelTapToRetry:"pieskarieties, lai m\u0113\u0123in\u0101tu v\u0113lreiz",labelTapToUndo:"pieskarieties, lai atsauktu",labelButtonRemoveItem:"Dz\u0113st",labelButtonAbortItemLoad:"P\u0101rtraukt",labelButtonRetryItemLoad:"M\u0113\u0123in\u0101t v\u0113lreiz",labelButtonAbortItemProcessing:"P\u0101rtraucam",labelButtonUndoItemProcessing:"Atsaucam",labelButtonRetryItemProcessing:"M\u0113\u0123in\u0101m v\u0113lreiz",labelButtonProcessItem:"Aug\u0161upiel\u0101d\u0113t",labelMaxFileSizeExceeded:"Fails ir p\u0101r\u0101k liels",labelMaxFileSize:"Maksim\u0101lais faila izm\u0113rs ir {filesize}",labelMaxTotalFileSizeExceeded:"P\u0101rsniegts maksim\u0101lais kop\u0113jais failu izm\u0113rs",labelMaxTotalFileSize:"Maksim\u0101lais kop\u0113jais failu izm\u0113rs ir {filesize}",labelFileTypeNotAllowed:"Neder\u012Bgs faila tips",fileValidateTypeLabelExpectedTypes:"Sagaid\u0101m {allButLastType} vai {lastType}",imageValidateSizeLabelFormatError:"Neatbilsto\u0161s att\u0113la tips",imageValidateSizeLabelImageSizeTooSmall:"Att\u0113ls ir p\u0101r\u0101k mazs",imageValidateSizeLabelImageSizeTooBig:"Att\u0113ls ir p\u0101r\u0101k liels",imageValidateSizeLabelExpectedMinSize:"Minim\u0101lais izm\u0113rs ir {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksim\u0101lais izm\u0113rs ir {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Iz\u0161\u0137irtsp\u0113ja ir p\u0101r\u0101k zema",imageValidateSizeLabelImageResolutionTooHigh:"Iz\u0161\u0137irtsp\u0113ja ir p\u0101r\u0101k augsta",imageValidateSizeLabelExpectedMinResolution:"Minim\u0101l\u0101 iz\u0161\u0137irtsp\u0113ja ir {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksim\u0101l\u0101 iz\u0161\u0137irtsp\u0113ja ir {maxResolution}"};var Qo={labelIdle:'Drag & Drop je bestanden of Bladeren ',labelInvalidField:"Veld bevat ongeldige bestanden",labelFileWaitingForSize:"Wachten op grootte",labelFileSizeNotAvailable:"Grootte niet beschikbaar",labelFileLoading:"Laden",labelFileLoadError:"Fout tijdens laden",labelFileProcessing:"Uploaden",labelFileProcessingComplete:"Upload afgerond",labelFileProcessingAborted:"Upload geannuleerd",labelFileProcessingError:"Fout tijdens upload",labelFileProcessingRevertError:"Fout bij herstellen",labelFileRemoveError:"Fout bij verwijderen",labelTapToCancel:"tik om te annuleren",labelTapToRetry:"tik om opnieuw te proberen",labelTapToUndo:"tik om ongedaan te maken",labelButtonRemoveItem:"Verwijderen",labelButtonAbortItemLoad:"Afbreken",labelButtonRetryItemLoad:"Opnieuw proberen",labelButtonAbortItemProcessing:"Annuleren",labelButtonUndoItemProcessing:"Ongedaan maken",labelButtonRetryItemProcessing:"Opnieuw proberen",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"Bestand is te groot",labelMaxFileSize:"Maximale bestandsgrootte is {filesize}",labelMaxTotalFileSizeExceeded:"Maximale totale grootte overschreden",labelMaxTotalFileSize:"Maximale totale bestandsgrootte is {filesize}",labelFileTypeNotAllowed:"Ongeldig bestandstype",fileValidateTypeLabelExpectedTypes:"Verwacht {allButLastType} of {lastType}",imageValidateSizeLabelFormatError:"Afbeeldingstype niet ondersteund",imageValidateSizeLabelImageSizeTooSmall:"Afbeelding is te klein",imageValidateSizeLabelImageSizeTooBig:"Afbeelding is te groot",imageValidateSizeLabelExpectedMinSize:"Minimale afmeting is {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximale afmeting is {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resolutie is te laag",imageValidateSizeLabelImageResolutionTooHigh:"Resolution is too high",imageValidateSizeLabelExpectedMinResolution:"Minimale resolutie is {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximale resolutie is {maxResolution}"};var Zo={labelIdle:'Dra og slipp filene dine, eller Bla gjennom... ',labelInvalidField:"Feltet inneholder ugyldige filer",labelFileWaitingForSize:"Venter p\xE5 st\xF8rrelse",labelFileSizeNotAvailable:"St\xF8rrelse ikke tilgjengelig",labelFileLoading:"Laster",labelFileLoadError:"Feil under lasting",labelFileProcessing:"Laster opp",labelFileProcessingComplete:"Opplasting ferdig",labelFileProcessingAborted:"Opplasting avbrutt",labelFileProcessingError:"Feil under opplasting",labelFileProcessingRevertError:"Feil under reversering",labelFileRemoveError:"Feil under flytting",labelTapToCancel:"klikk for \xE5 avbryte",labelTapToRetry:"klikk for \xE5 pr\xF8ve p\xE5 nytt",labelTapToUndo:"klikk for \xE5 angre",labelButtonRemoveItem:"Fjern",labelButtonAbortItemLoad:"Avbryt",labelButtonRetryItemLoad:"Pr\xF8v p\xE5 nytt",labelButtonAbortItemProcessing:"Avbryt",labelButtonUndoItemProcessing:"Angre",labelButtonRetryItemProcessing:"Pr\xF8v p\xE5 nytt",labelButtonProcessItem:"Last opp",labelMaxFileSizeExceeded:"Filen er for stor",labelMaxFileSize:"Maksimal filst\xF8rrelse er {filesize}",labelMaxTotalFileSizeExceeded:"Maksimal total st\xF8rrelse oversteget",labelMaxTotalFileSize:"Maksimal total st\xF8rrelse er {filesize}",labelFileTypeNotAllowed:"Ugyldig filtype",fileValidateTypeLabelExpectedTypes:"Forventer {allButLastType} eller {lastType}",imageValidateSizeLabelFormatError:"Bildeformat ikke st\xF8ttet",imageValidateSizeLabelImageSizeTooSmall:"Bildet er for lite",imageValidateSizeLabelImageSizeTooBig:"Bildet er for stort",imageValidateSizeLabelExpectedMinSize:"Minimumsst\xF8rrelse er {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksimumsst\xF8rrelse er {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Oppl\xF8sningen er for lav",imageValidateSizeLabelImageResolutionTooHigh:"Oppl\xF8sningen er for h\xF8y",imageValidateSizeLabelExpectedMinResolution:"Minimum oppl\xF8sning er {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksimal oppl\xF8sning er {maxResolution}"};var Jo={labelIdle:'Przeci\u0105gnij i upu\u015B\u0107 lub wybierz pliki',labelInvalidField:"Nieprawid\u0142owe pliki",labelFileWaitingForSize:"Pobieranie rozmiaru",labelFileSizeNotAvailable:"Nieznany rozmiar",labelFileLoading:"Wczytywanie",labelFileLoadError:"B\u0142\u0105d wczytywania",labelFileProcessing:"Przesy\u0142anie",labelFileProcessingComplete:"Przes\u0142ano",labelFileProcessingAborted:"Przerwano",labelFileProcessingError:"Przesy\u0142anie nie powiod\u0142o si\u0119",labelFileProcessingRevertError:"Co\u015B posz\u0142o nie tak",labelFileRemoveError:"Nieudane usuni\u0119cie",labelTapToCancel:"Anuluj",labelTapToRetry:"Pon\xF3w",labelTapToUndo:"Cofnij",labelButtonRemoveItem:"Usu\u0144",labelButtonAbortItemLoad:"Przerwij",labelButtonRetryItemLoad:"Pon\xF3w",labelButtonAbortItemProcessing:"Anuluj",labelButtonUndoItemProcessing:"Cofnij",labelButtonRetryItemProcessing:"Pon\xF3w",labelButtonProcessItem:"Prze\u015Blij",labelMaxFileSizeExceeded:"Plik jest zbyt du\u017Cy",labelMaxFileSize:"Dopuszczalna wielko\u015B\u0107 pliku to {filesize}",labelMaxTotalFileSizeExceeded:"Przekroczono \u0142\u0105czny rozmiar plik\xF3w",labelMaxTotalFileSize:"\u0141\u0105czny rozmiar plik\xF3w nie mo\u017Ce przekroczy\u0107 {filesize}",labelFileTypeNotAllowed:"Niedozwolony rodzaj pliku",fileValidateTypeLabelExpectedTypes:"Oczekiwano {allButLastType} lub {lastType}",imageValidateSizeLabelFormatError:"Nieobs\u0142ugiwany format obrazu",imageValidateSizeLabelImageSizeTooSmall:"Obraz jest zbyt ma\u0142y",imageValidateSizeLabelImageSizeTooBig:"Obraz jest zbyt du\u017Cy",imageValidateSizeLabelExpectedMinSize:"Minimalne wymiary obrazu to {minWidth}\xD7{minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maksymalna wymiary obrazu to {maxWidth}\xD7{maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Rozdzielczo\u015B\u0107 jest zbyt niska",imageValidateSizeLabelImageResolutionTooHigh:"Rozdzielczo\u015B\u0107 jest zbyt wysoka",imageValidateSizeLabelExpectedMinResolution:"Minimalna rozdzielczo\u015B\u0107 to {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maksymalna rozdzielczo\u015B\u0107 to {maxResolution}"};var _i={labelIdle:'Arraste e solte os arquivos ou Clique aqui ',labelInvalidField:"Arquivos inv\xE1lidos",labelFileWaitingForSize:"Calculando o tamanho do arquivo",labelFileSizeNotAvailable:"Tamanho do arquivo indispon\xEDvel",labelFileLoading:"Carregando",labelFileLoadError:"Erro durante o carregamento",labelFileProcessing:"Enviando",labelFileProcessingComplete:"Envio finalizado",labelFileProcessingAborted:"Envio cancelado",labelFileProcessingError:"Erro durante o envio",labelFileProcessingRevertError:"Erro ao reverter o envio",labelFileRemoveError:"Erro ao remover o arquivo",labelTapToCancel:"clique para cancelar",labelTapToRetry:"clique para reenviar",labelTapToUndo:"clique para desfazer",labelButtonRemoveItem:"Remover",labelButtonAbortItemLoad:"Abortar",labelButtonRetryItemLoad:"Reenviar",labelButtonAbortItemProcessing:"Cancelar",labelButtonUndoItemProcessing:"Desfazer",labelButtonRetryItemProcessing:"Reenviar",labelButtonProcessItem:"Enviar",labelMaxFileSizeExceeded:"Arquivo \xE9 muito grande",labelMaxFileSize:"O tamanho m\xE1ximo permitido: {filesize}",labelMaxTotalFileSizeExceeded:"Tamanho total dos arquivos excedido",labelMaxTotalFileSize:"Tamanho total permitido: {filesize}",labelFileTypeNotAllowed:"Tipo de arquivo inv\xE1lido",fileValidateTypeLabelExpectedTypes:"Tipos de arquivo suportados s\xE3o {allButLastType} ou {lastType}",imageValidateSizeLabelFormatError:"Tipo de imagem inv\xE1lida",imageValidateSizeLabelImageSizeTooSmall:"Imagem muito pequena",imageValidateSizeLabelImageSizeTooBig:"Imagem muito grande",imageValidateSizeLabelExpectedMinSize:"Tamanho m\xEDnimo permitida: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Tamanho m\xE1ximo permitido: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Resolu\xE7\xE3o muito baixa",imageValidateSizeLabelImageResolutionTooHigh:"Resolu\xE7\xE3o muito alta",imageValidateSizeLabelExpectedMinResolution:"Resolu\xE7\xE3o m\xEDnima permitida: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Resolu\xE7\xE3o m\xE1xima permitida: {maxResolution}"};var er={labelIdle:'Trage \u0219i plaseaz\u0103 fi\u0219iere sau Caut\u0103-le ',labelInvalidField:"C\xE2mpul con\u021Bine fi\u0219iere care nu sunt valide",labelFileWaitingForSize:"\xCEn a\u0219teptarea dimensiunii",labelFileSizeNotAvailable:"Dimensiunea nu este diponibil\u0103",labelFileLoading:"Se \xEEncarc\u0103",labelFileLoadError:"Eroare la \xEEnc\u0103rcare",labelFileProcessing:"Se \xEEncarc\u0103",labelFileProcessingComplete:"\xCEnc\u0103rcare finalizat\u0103",labelFileProcessingAborted:"\xCEnc\u0103rcare anulat\u0103",labelFileProcessingError:"Eroare la \xEEnc\u0103rcare",labelFileProcessingRevertError:"Eroare la anulare",labelFileRemoveError:"Eroare la \u015Ftergere",labelTapToCancel:"apas\u0103 pentru a anula",labelTapToRetry:"apas\u0103 pentru a re\xEEncerca",labelTapToUndo:"apas\u0103 pentru a anula",labelButtonRemoveItem:"\u015Eterge",labelButtonAbortItemLoad:"Anuleaz\u0103",labelButtonRetryItemLoad:"Re\xEEncearc\u0103",labelButtonAbortItemProcessing:"Anuleaz\u0103",labelButtonUndoItemProcessing:"Anuleaz\u0103",labelButtonRetryItemProcessing:"Re\xEEncearc\u0103",labelButtonProcessItem:"\xCEncarc\u0103",labelMaxFileSizeExceeded:"Fi\u0219ierul este prea mare",labelMaxFileSize:"Dimensiunea maxim\u0103 a unui fi\u0219ier este de {filesize}",labelMaxTotalFileSizeExceeded:"Dimensiunea total\u0103 maxim\u0103 a fost dep\u0103\u0219it\u0103",labelMaxTotalFileSize:"Dimensiunea total\u0103 maxim\u0103 a fi\u0219ierelor este de {filesize}",labelFileTypeNotAllowed:"Tipul fi\u0219ierului nu este valid",fileValidateTypeLabelExpectedTypes:"Se a\u0219teapt\u0103 {allButLastType} sau {lastType}",imageValidateSizeLabelFormatError:"Formatul imaginii nu este acceptat",imageValidateSizeLabelImageSizeTooSmall:"Imaginea este prea mic\u0103",imageValidateSizeLabelImageSizeTooBig:"Imaginea este prea mare",imageValidateSizeLabelExpectedMinSize:"M\u0103rimea minim\u0103 este de {maxWidth} x {maxHeight}",imageValidateSizeLabelExpectedMaxSize:"M\u0103rimea maxim\u0103 este de {maxWidth} x {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Rezolu\u021Bia este prea mic\u0103",imageValidateSizeLabelImageResolutionTooHigh:"Rezolu\u021Bia este prea mare",imageValidateSizeLabelExpectedMinResolution:"Rezolu\u021Bia minim\u0103 este de {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Rezolu\u021Bia maxim\u0103 este de {maxResolution}"};var tr={labelIdle:'\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B \u0438\u043B\u0438 \u0432\u044B\u0431\u0435\u0440\u0438\u0442\u0435 ',labelInvalidField:"\u041F\u043E\u043B\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0435 \u0444\u0430\u0439\u043B\u044B",labelFileWaitingForSize:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0440\u0430\u0437\u043C\u0435\u0440",labelFileSizeNotAvailable:"\u0420\u0430\u0437\u043C\u0435\u0440 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F",labelFileLoading:"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435",labelFileLoadError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0438",labelFileProcessing:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430",labelFileProcessingComplete:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0430",labelFileProcessingAborted:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043E\u0442\u043C\u0435\u043D\u0435\u043D\u0430",labelFileProcessingError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0435",labelFileProcessingRevertError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0432\u043E\u0437\u0432\u0440\u0430\u0442\u0435",labelFileRemoveError:"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u0438",labelTapToCancel:"\u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u0434\u043B\u044F \u043E\u0442\u043C\u0435\u043D\u044B",labelTapToRetry:"\u043D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u043F\u043E\u043F\u044B\u0442\u043A\u0443",labelTapToUndo:"\u043D\u0430\u0436\u043C\u0438\u0442\u0435 \u0434\u043B\u044F \u043E\u0442\u043C\u0435\u043D\u044B \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0433\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F",labelButtonRemoveItem:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C",labelButtonAbortItemLoad:"\u041F\u0440\u0435\u043A\u0440\u0430\u0449\u0435\u043D\u043E",labelButtonRetryItemLoad:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0443",labelButtonAbortItemProcessing:"\u041E\u0442\u043C\u0435\u043D\u0430",labelButtonUndoItemProcessing:"\u041E\u0442\u043C\u0435\u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0433\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F",labelButtonRetryItemProcessing:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0443",labelButtonProcessItem:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430",labelMaxFileSizeExceeded:"\u0424\u0430\u0439\u043B \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0439",labelMaxFileSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430: {filesize}",labelMaxTotalFileSizeExceeded:"\u041F\u0440\u0435\u0432\u044B\u0448\u0435\u043D \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440",labelMaxTotalFileSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430: {filesize}",labelFileTypeNotAllowed:"\u0424\u0430\u0439\u043B \u043D\u0435\u0432\u0435\u0440\u043D\u043E\u0433\u043E \u0442\u0438\u043F\u0430",fileValidateTypeLabelExpectedTypes:"\u041E\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044F {allButLastType} \u0438\u043B\u0438 {lastType}",imageValidateSizeLabelFormatError:"\u0422\u0438\u043F \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F",imageValidateSizeLabelImageSizeTooSmall:"\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435",imageValidateSizeLabelImageSizeTooBig:"\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435",imageValidateSizeLabelExpectedMinSize:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u043D\u0438\u0437\u043A\u043E\u0435",imageValidateSizeLabelImageResolutionTooHigh:"\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0432\u044B\u0441\u043E\u043A\u043E\u0435",imageValidateSizeLabelExpectedMinResolution:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435: {maxResolution}"};var ir={labelIdle:'Natiahn\xFA\u0165 s\xFAbor (drag&drop) alebo Vyh\u013Eada\u0165 ',labelInvalidField:"Pole obsahuje chybn\xE9 s\xFAbory",labelFileWaitingForSize:"Zis\u0165uje sa ve\u013Ekos\u0165",labelFileSizeNotAvailable:"Nezn\xE1ma ve\u013Ekos\u0165",labelFileLoading:"Pren\xE1\u0161a sa",labelFileLoadError:"Chyba pri prenose",labelFileProcessing:"Prebieha upload",labelFileProcessingComplete:"Upload dokon\u010Den\xFD",labelFileProcessingAborted:"Upload stornovan\xFD",labelFileProcessingError:"Chyba pri uploade",labelFileProcessingRevertError:"Chyba pri obnove",labelFileRemoveError:"Chyba pri odstr\xE1nen\xED",labelTapToCancel:"Kliknite pre storno",labelTapToRetry:"Kliknite pre opakovanie",labelTapToUndo:"Kliknite pre vr\xE1tenie",labelButtonRemoveItem:"Odstr\xE1ni\u0165",labelButtonAbortItemLoad:"Storno",labelButtonRetryItemLoad:"Opakova\u0165",labelButtonAbortItemProcessing:"Sp\xE4\u0165",labelButtonUndoItemProcessing:"Vr\xE1ti\u0165",labelButtonRetryItemProcessing:"Opakova\u0165",labelButtonProcessItem:"Upload",labelMaxFileSizeExceeded:"S\xFAbor je pr\xEDli\u0161 ve\u013Ek\xFD",labelMaxFileSize:"Najv\xE4\u010D\u0161ia ve\u013Ekos\u0165 s\xFAboru je {filesize}",labelMaxTotalFileSizeExceeded:"Prekro\u010Den\xE1 maxim\xE1lna celkov\xE1 ve\u013Ekos\u0165 s\xFAboru",labelMaxTotalFileSize:"Maxim\xE1lna celkov\xE1 ve\u013Ekos\u0165 s\xFAboru je {filesize}",labelFileTypeNotAllowed:"S\xFAbor je nespr\xE1vneho typu",fileValidateTypeLabelExpectedTypes:"O\u010Dak\xE1va sa {allButLastType} alebo {lastType}",imageValidateSizeLabelFormatError:"Obr\xE1zok tohto typu nie je podporovan\xFD",imageValidateSizeLabelImageSizeTooSmall:"Obr\xE1zok je pr\xEDli\u0161 mal\xFD",imageValidateSizeLabelImageSizeTooBig:"Obr\xE1zok je pr\xEDli\u0161 ve\u013Ek\xFD",imageValidateSizeLabelExpectedMinSize:"Minim\xE1lny rozmer je {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maxim\xE1lny rozmer je {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Rozl\xED\u0161enie je pr\xEDli\u0161 mal\xE9",imageValidateSizeLabelImageResolutionTooHigh:"Rozli\u0161enie je pr\xEDli\u0161 ve\u013Ek\xE9",imageValidateSizeLabelExpectedMinResolution:"Minim\xE1lne rozl\xED\u0161enie je {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maxim\xE1lne rozl\xED\u0161enie je {maxResolution}"};var ar={labelIdle:'Drag och sl\xE4pp dina filer eller Bl\xE4ddra ',labelInvalidField:"F\xE4ltet inneh\xE5ller felaktiga filer",labelFileWaitingForSize:"V\xE4ntar p\xE5 storlek",labelFileSizeNotAvailable:"Storleken finns inte tillg\xE4nglig",labelFileLoading:"Laddar",labelFileLoadError:"Fel under laddning",labelFileProcessing:"Laddar upp",labelFileProcessingComplete:"Uppladdning klar",labelFileProcessingAborted:"Uppladdning avbruten",labelFileProcessingError:"Fel under uppladdning",labelFileProcessingRevertError:"Fel under \xE5terst\xE4llning",labelFileRemoveError:"Fel under borttagning",labelTapToCancel:"tryck f\xF6r att avbryta",labelTapToRetry:"tryck f\xF6r att f\xF6rs\xF6ka igen",labelTapToUndo:"tryck f\xF6r att \xE5ngra",labelButtonRemoveItem:"Tabort",labelButtonAbortItemLoad:"Avbryt",labelButtonRetryItemLoad:"F\xF6rs\xF6k igen",labelButtonAbortItemProcessing:"Avbryt",labelButtonUndoItemProcessing:"\xC5ngra",labelButtonRetryItemProcessing:"F\xF6rs\xF6k igen",labelButtonProcessItem:"Ladda upp",labelMaxFileSizeExceeded:"Filen \xE4r f\xF6r stor",labelMaxFileSize:"St\xF6rsta till\xE5tna filstorlek \xE4r {filesize}",labelMaxTotalFileSizeExceeded:"Maximal uppladdningsstorlek uppn\xE5d",labelMaxTotalFileSize:"Maximal uppladdningsstorlek \xE4r {filesize}",labelFileTypeNotAllowed:"Felaktig filtyp",fileValidateTypeLabelExpectedTypes:"Godk\xE4nda filtyper {allButLastType} eller {lastType}",imageValidateSizeLabelFormatError:"Bildtypen saknar st\xF6d",imageValidateSizeLabelImageSizeTooSmall:"Bilden \xE4r f\xF6r liten",imageValidateSizeLabelImageSizeTooBig:"Bilden \xE4r f\xF6r stor",imageValidateSizeLabelExpectedMinSize:"Minimal storlek \xE4r {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximal storlek \xE4r {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"Uppl\xF6sningen \xE4r f\xF6r l\xE5g",imageValidateSizeLabelImageResolutionTooHigh:"Uppl\xF6sningen \xE4r f\xF6r h\xF6g",imageValidateSizeLabelExpectedMinResolution:"Minsta till\xE5tna uppl\xF6sning \xE4r {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"H\xF6gsta till\xE5tna uppl\xF6sning \xE4r {maxResolution}"};var nr={labelIdle:'Dosyan\u0131z\u0131 S\xFCr\xFCkleyin & B\u0131rak\u0131n ya da Se\xE7in ',labelInvalidField:"Alan ge\xE7ersiz dosyalar i\xE7eriyor",labelFileWaitingForSize:"Boyut hesaplan\u0131yor",labelFileSizeNotAvailable:"Boyut mevcut de\u011Fil",labelFileLoading:"Y\xFCkleniyor",labelFileLoadError:"Y\xFCkleme s\u0131ras\u0131nda hata olu\u015Ftu",labelFileProcessing:"Y\xFCkleniyor",labelFileProcessingComplete:"Y\xFCkleme tamamland\u0131",labelFileProcessingAborted:"Y\xFCkleme iptal edildi",labelFileProcessingError:"Y\xFCklerken hata olu\u015Ftu",labelFileProcessingRevertError:"Geri \xE7ekerken hata olu\u015Ftu",labelFileRemoveError:"Kald\u0131r\u0131rken hata olu\u015Ftu",labelTapToCancel:"\u0130ptal etmek i\xE7in t\u0131klay\u0131n",labelTapToRetry:"Tekrar denemek i\xE7in t\u0131klay\u0131n",labelTapToUndo:"Geri almak i\xE7in t\u0131klay\u0131n",labelButtonRemoveItem:"Kald\u0131r",labelButtonAbortItemLoad:"\u0130ptal Et",labelButtonRetryItemLoad:"Tekrar dene",labelButtonAbortItemProcessing:"\u0130ptal et",labelButtonUndoItemProcessing:"Geri Al",labelButtonRetryItemProcessing:"Tekrar dene",labelButtonProcessItem:"Y\xFCkle",labelMaxFileSizeExceeded:"Dosya \xE7ok b\xFCy\xFCk",labelMaxFileSize:"En fazla dosya boyutu: {filesize}",labelMaxTotalFileSizeExceeded:"Maximum boyut a\u015F\u0131ld\u0131",labelMaxTotalFileSize:"Maximum dosya boyutu :{filesize}",labelFileTypeNotAllowed:"Ge\xE7ersiz dosya tipi",fileValidateTypeLabelExpectedTypes:"\u015Eu {allButLastType} ya da \u015Fu dosya olmas\u0131 gerekir: {lastType}",imageValidateSizeLabelFormatError:"Resim tipi desteklenmiyor",imageValidateSizeLabelImageSizeTooSmall:"Resim \xE7ok k\xFC\xE7\xFCk",imageValidateSizeLabelImageSizeTooBig:"Resim \xE7ok b\xFCy\xFCk",imageValidateSizeLabelExpectedMinSize:"Minimum boyut {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"Maximum boyut {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\xC7\xF6z\xFCn\xFCrl\xFCk \xE7ok d\xFC\u015F\xFCk",imageValidateSizeLabelImageResolutionTooHigh:"\xC7\xF6z\xFCn\xFCrl\xFCk \xE7ok y\xFCksek",imageValidateSizeLabelExpectedMinResolution:"Minimum \xE7\xF6z\xFCn\xFCrl\xFCk {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"Maximum \xE7\xF6z\xFCn\xFCrl\xFCk {maxResolution}"};var lr={labelIdle:'\u041F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0456\u0442\u044C \u0444\u0430\u0439\u043B\u0438 \u0430\u0431\u043E \u0432\u0438\u0431\u0435\u0440\u0456\u0442\u044C ',labelInvalidField:"\u041F\u043E\u043B\u0435 \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u043D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u0456 \u0444\u0430\u0439\u043B\u0438",labelFileWaitingForSize:"\u0412\u043A\u0430\u0436\u0456\u0442\u044C \u0440\u043E\u0437\u043C\u0456\u0440",labelFileSizeNotAvailable:"\u0420\u043E\u0437\u043C\u0456\u0440 \u043D\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0438\u0439",labelFileLoading:"\u041E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u043D\u044F",labelFileLoadError:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u043E\u0447\u0456\u043A\u0443\u0432\u0430\u043D\u043D\u0456",labelFileProcessing:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F",labelFileProcessingComplete:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E",labelFileProcessingAborted:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F \u0441\u043A\u0430\u0441\u043E\u0432\u0430\u043D\u043E",labelFileProcessingError:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u0456",labelFileProcessingRevertError:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0432\u0456\u0434\u043D\u043E\u0432\u043B\u0435\u043D\u043D\u0456",labelFileRemoveError:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0432\u0438\u0434\u0430\u043B\u0435\u043D\u043D\u0456",labelTapToCancel:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438",labelTapToRetry:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438 \u0441\u043F\u0440\u043E\u0431\u0443",labelTapToUndo:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0432\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438 \u043E\u0441\u0442\u0430\u043D\u043D\u044E \u0434\u0456\u044E",labelButtonRemoveItem:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438",labelButtonAbortItemLoad:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438",labelButtonRetryItemLoad:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438 \u0441\u043F\u0440\u043E\u0431\u0443",labelButtonAbortItemProcessing:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438",labelButtonUndoItemProcessing:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438 \u043E\u0441\u0442\u0430\u043D\u043D\u044E \u0434\u0456\u044E",labelButtonRetryItemProcessing:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438 \u0441\u043F\u0440\u043E\u0431\u0443",labelButtonProcessItem:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F",labelMaxFileSizeExceeded:"\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439",labelMaxFileSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440 \u0444\u0430\u0439\u043B\u0443: {filesize}",labelMaxTotalFileSizeExceeded:"\u041F\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043D\u043E \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440",labelMaxTotalFileSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0437\u0430\u0433\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440: {filesize}",labelFileTypeNotAllowed:"\u0424\u043E\u0440\u043C\u0430\u0442 \u0444\u0430\u0439\u043B\u0443 \u043D\u0435 \u043F\u0456\u0434\u0442\u0440\u0438\u043C\u0443\u0454\u0442\u044C\u0441\u044F",fileValidateTypeLabelExpectedTypes:"\u041E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F {allButLastType} \u0430\u0431\u043E {lastType}",imageValidateSizeLabelFormatError:"\u0424\u043E\u0440\u043C\u0430\u0442 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u043D\u0435 \u043F\u0456\u0434\u0442\u0440\u0438\u043C\u0443\u0454\u0442\u044C\u0441\u044F",imageValidateSizeLabelImageSizeTooSmall:"\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0435",imageValidateSizeLabelImageSizeTooBig:"\u0417\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435",imageValidateSizeLabelExpectedMinSize:"\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0438\u0439 \u0440\u043E\u0437\u043C\u0456\u0440: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0420\u043E\u0437\u043C\u0456\u0440\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0456",imageValidateSizeLabelImageResolutionTooHigh:"\u0420\u043E\u0437\u043C\u0456\u0440\u0438 \u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u043D\u044F \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0456",imageValidateSizeLabelExpectedMinResolution:"\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0456 \u0440\u043E\u0437\u043C\u0456\u0440\u0438: {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0456 \u0440\u043E\u0437\u043C\u0456\u0440\u0438: {maxResolution}"};var or={labelIdle:'K\xE9o th\u1EA3 t\u1EC7p c\u1EE7a b\u1EA1n ho\u1EB7c T\xECm ki\u1EBFm ',labelInvalidField:"Tr\u01B0\u1EDDng ch\u1EE9a c\xE1c t\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7",labelFileWaitingForSize:"\u0110ang ch\u1EDD k\xEDch th\u01B0\u1EDBc",labelFileSizeNotAvailable:"K\xEDch th\u01B0\u1EDBc kh\xF4ng c\xF3 s\u1EB5n",labelFileLoading:"\u0110ang t\u1EA3i",labelFileLoadError:"L\u1ED7i khi t\u1EA3i",labelFileProcessing:"\u0110ang t\u1EA3i l\xEAn",labelFileProcessingComplete:"T\u1EA3i l\xEAn th\xE0nh c\xF4ng",labelFileProcessingAborted:"\u0110\xE3 hu\u1EF7 t\u1EA3i l\xEAn",labelFileProcessingError:"L\u1ED7i khi t\u1EA3i l\xEAn",labelFileProcessingRevertError:"L\u1ED7i khi ho\xE0n nguy\xEAn",labelFileRemoveError:"L\u1ED7i khi x\xF3a",labelTapToCancel:"nh\u1EA5n \u0111\u1EC3 h\u1EE7y",labelTapToRetry:"nh\u1EA5n \u0111\u1EC3 th\u1EED l\u1EA1i",labelTapToUndo:"nh\u1EA5n \u0111\u1EC3 ho\xE0n t\xE1c",labelButtonRemoveItem:"Xo\xE1",labelButtonAbortItemLoad:"Hu\u1EF7 b\u1ECF",labelButtonRetryItemLoad:"Th\u1EED l\u1EA1i",labelButtonAbortItemProcessing:"H\u1EE7y b\u1ECF",labelButtonUndoItemProcessing:"Ho\xE0n t\xE1c",labelButtonRetryItemProcessing:"Th\u1EED l\u1EA1i",labelButtonProcessItem:"T\u1EA3i l\xEAn",labelMaxFileSizeExceeded:"T\u1EADp tin qu\xE1 l\u1EDBn",labelMaxFileSize:"K\xEDch th\u01B0\u1EDBc t\u1EC7p t\u1ED1i \u0111a l\xE0 {filesize}",labelMaxTotalFileSizeExceeded:"\u0110\xE3 v\u01B0\u1EE3t qu\xE1 t\u1ED5ng k\xEDch th\u01B0\u1EDBc t\u1ED1i \u0111a",labelMaxTotalFileSize:"T\u1ED5ng k\xEDch th\u01B0\u1EDBc t\u1EC7p t\u1ED1i \u0111a l\xE0 {filesize}",labelFileTypeNotAllowed:"T\u1EC7p thu\u1ED9c lo\u1EA1i kh\xF4ng h\u1EE3p l\u1EC7",fileValidateTypeLabelExpectedTypes:"Ki\u1EC3u t\u1EC7p h\u1EE3p l\u1EC7 l\xE0 {allButLastType} ho\u1EB7c {lastType}",imageValidateSizeLabelFormatError:"Lo\u1EA1i h\xECnh \u1EA3nh kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3",imageValidateSizeLabelImageSizeTooSmall:"H\xECnh \u1EA3nh qu\xE1 nh\u1ECF",imageValidateSizeLabelImageSizeTooBig:"H\xECnh \u1EA3nh qu\xE1 l\u1EDBn",imageValidateSizeLabelExpectedMinSize:"K\xEDch th\u01B0\u1EDBc t\u1ED1i thi\u1EC3u l\xE0 {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"K\xEDch th\u01B0\u1EDBc t\u1ED1i \u0111a l\xE0 {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u0110\u1ED9 ph\xE2n gi\u1EA3i qu\xE1 th\u1EA5p",imageValidateSizeLabelImageResolutionTooHigh:"\u0110\u1ED9 ph\xE2n gi\u1EA3i qu\xE1 cao",imageValidateSizeLabelExpectedMinResolution:"\u0110\u1ED9 ph\xE2n gi\u1EA3i t\u1ED1i thi\u1EC3u l\xE0 {minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u0110\u1ED9 ph\xE2n gi\u1EA3i t\u1ED1i \u0111a l\xE0 {maxResolution}"};var rr={labelIdle:'\u62D6\u653E\u6587\u4EF6\uFF0C\u6216\u8005 \u6D4F\u89C8 ',labelInvalidField:"\u5B57\u6BB5\u5305\u542B\u65E0\u6548\u6587\u4EF6",labelFileWaitingForSize:"\u8BA1\u7B97\u6587\u4EF6\u5927\u5C0F",labelFileSizeNotAvailable:"\u6587\u4EF6\u5927\u5C0F\u4E0D\u53EF\u7528",labelFileLoading:"\u52A0\u8F7D",labelFileLoadError:"\u52A0\u8F7D\u9519\u8BEF",labelFileProcessing:"\u4E0A\u4F20",labelFileProcessingComplete:"\u5DF2\u4E0A\u4F20",labelFileProcessingAborted:"\u4E0A\u4F20\u5DF2\u53D6\u6D88",labelFileProcessingError:"\u4E0A\u4F20\u51FA\u9519",labelFileProcessingRevertError:"\u8FD8\u539F\u51FA\u9519",labelFileRemoveError:"\u5220\u9664\u51FA\u9519",labelTapToCancel:"\u70B9\u51FB\u53D6\u6D88",labelTapToRetry:"\u70B9\u51FB\u91CD\u8BD5",labelTapToUndo:"\u70B9\u51FB\u64A4\u6D88",labelButtonRemoveItem:"\u5220\u9664",labelButtonAbortItemLoad:"\u4E2D\u6B62",labelButtonRetryItemLoad:"\u91CD\u8BD5",labelButtonAbortItemProcessing:"\u53D6\u6D88",labelButtonUndoItemProcessing:"\u64A4\u6D88",labelButtonRetryItemProcessing:"\u91CD\u8BD5",labelButtonProcessItem:"\u4E0A\u4F20",labelMaxFileSizeExceeded:"\u6587\u4EF6\u592A\u5927",labelMaxFileSize:"\u6700\u5927\u503C: {filesize}",labelMaxTotalFileSizeExceeded:"\u8D85\u8FC7\u6700\u5927\u6587\u4EF6\u5927\u5C0F",labelMaxTotalFileSize:"\u6700\u5927\u6587\u4EF6\u5927\u5C0F\uFF1A{filesize}",labelFileTypeNotAllowed:"\u6587\u4EF6\u7C7B\u578B\u65E0\u6548",fileValidateTypeLabelExpectedTypes:"\u5E94\u4E3A {allButLastType} \u6216 {lastType}",imageValidateSizeLabelFormatError:"\u4E0D\u652F\u6301\u56FE\u50CF\u7C7B\u578B",imageValidateSizeLabelImageSizeTooSmall:"\u56FE\u50CF\u592A\u5C0F",imageValidateSizeLabelImageSizeTooBig:"\u56FE\u50CF\u592A\u5927",imageValidateSizeLabelExpectedMinSize:"\u6700\u5C0F\u503C: {minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u6700\u5927\u503C: {maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u5206\u8FA8\u7387\u592A\u4F4E",imageValidateSizeLabelImageResolutionTooHigh:"\u5206\u8FA8\u7387\u592A\u9AD8",imageValidateSizeLabelExpectedMinResolution:"\u6700\u5C0F\u5206\u8FA8\u7387\uFF1A{minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u6700\u5927\u5206\u8FA8\u7387\uFF1A{maxResolution}"};var sr={labelIdle:'\u62D6\u653E\u6A94\u6848\uFF0C\u6216\u8005 \u700F\u89BD ',labelInvalidField:"\u4E0D\u652F\u63F4\u6B64\u6A94\u6848",labelFileWaitingForSize:"\u6B63\u5728\u8A08\u7B97\u6A94\u6848\u5927\u5C0F",labelFileSizeNotAvailable:"\u6A94\u6848\u5927\u5C0F\u4E0D\u7B26",labelFileLoading:"\u8B80\u53D6\u4E2D",labelFileLoadError:"\u8B80\u53D6\u932F\u8AA4",labelFileProcessing:"\u4E0A\u50B3",labelFileProcessingComplete:"\u5DF2\u4E0A\u50B3",labelFileProcessingAborted:"\u4E0A\u50B3\u5DF2\u53D6\u6D88",labelFileProcessingError:"\u4E0A\u50B3\u767C\u751F\u932F\u8AA4",labelFileProcessingRevertError:"\u9084\u539F\u932F\u8AA4",labelFileRemoveError:"\u522A\u9664\u932F\u8AA4",labelTapToCancel:"\u9EDE\u64CA\u53D6\u6D88",labelTapToRetry:"\u9EDE\u64CA\u91CD\u8A66",labelTapToUndo:"\u9EDE\u64CA\u9084\u539F",labelButtonRemoveItem:"\u522A\u9664",labelButtonAbortItemLoad:"\u505C\u6B62",labelButtonRetryItemLoad:"\u91CD\u8A66",labelButtonAbortItemProcessing:"\u53D6\u6D88",labelButtonUndoItemProcessing:"\u53D6\u6D88",labelButtonRetryItemProcessing:"\u91CD\u8A66",labelButtonProcessItem:"\u4E0A\u50B3",labelMaxFileSizeExceeded:"\u6A94\u6848\u904E\u5927",labelMaxFileSize:"\u6700\u5927\u503C\uFF1A{filesize}",labelMaxTotalFileSizeExceeded:"\u8D85\u904E\u6700\u5927\u53EF\u4E0A\u50B3\u5927\u5C0F",labelMaxTotalFileSize:"\u6700\u5927\u53EF\u4E0A\u50B3\u5927\u5C0F\uFF1A{filesize}",labelFileTypeNotAllowed:"\u4E0D\u652F\u63F4\u6B64\u985E\u578B\u6A94\u6848",fileValidateTypeLabelExpectedTypes:"\u61C9\u70BA {allButLastType} \u6216 {lastType}",imageValidateSizeLabelFormatError:"\u4E0D\u652F\u6301\u6B64\u985E\u5716\u7247\u985E\u578B",imageValidateSizeLabelImageSizeTooSmall:"\u5716\u7247\u904E\u5C0F",imageValidateSizeLabelImageSizeTooBig:"\u5716\u7247\u904E\u5927",imageValidateSizeLabelExpectedMinSize:"\u6700\u5C0F\u5C3A\u5BF8\uFF1A{minWidth} \xD7 {minHeight}",imageValidateSizeLabelExpectedMaxSize:"\u6700\u5927\u5C3A\u5BF8\uFF1A{maxWidth} \xD7 {maxHeight}",imageValidateSizeLabelImageResolutionTooLow:"\u89E3\u6790\u5EA6\u904E\u4F4E",imageValidateSizeLabelImageResolutionTooHigh:"\u89E3\u6790\u5EA6\u904E\u9AD8",imageValidateSizeLabelExpectedMinResolution:"\u6700\u4F4E\u89E3\u6790\u5EA6\uFF1A{minResolution}",imageValidateSizeLabelExpectedMaxResolution:"\u6700\u9AD8\u89E3\u6790\u5EA6\uFF1A{maxResolution}"};ve(Wl);ve(jl);ve($l);ve(Kl);ve(eo);ve(mo);ve(go);ve(_o);ve(Pa);window.FilePond=la;function Rg({acceptedFileTypes:e,imageEditorEmptyFillColor:t,imageEditorMode:i,imageEditorViewportHeight:a,imageEditorViewportWidth:n,deleteUploadedFileUsing:l,isDeletable:o,isDisabled:r,getUploadedFilesUsing:s,imageCropAspectRatio:p,imagePreviewHeight:c,imageResizeMode:d,imageResizeTargetHeight:m,imageResizeTargetWidth:u,imageResizeUpscale:g,isAvatar:f,hasImageEditor:h,hasCircleCropper:I,canEditSvgs:b,isSvgEditingConfirmed:T,confirmSvgEditingMessage:v,disabledSvgEditingMessage:y,isDownloadable:E,isMultiple:_,isOpenable:x,isPreviewable:R,isReorderable:z,itemPanelAspectRatio:P,loadingIndicatorPosition:A,locale:B,maxFiles:w,maxSize:O,minSize:S,maxParallelUploads:L,mimeTypeMap:D,panelAspectRatio:F,panelLayout:G,placeholder:C,removeUploadedFileButtonPosition:q,removeUploadedFileUsing:X,reorderUploadedFilesUsing:K,shouldAppendFiles:oe,shouldOrientImageFromExif:k,shouldTransformImage:H,state:Y,uploadButtonPosition:re,uploadingMessage:ee,uploadProgressIndicatorPosition:dt,uploadUsing:dr}){return{fileKeyIndex:{},pond:null,shouldUpdateState:!0,state:Y,lastState:null,error:null,uploadedFileIndex:{},isEditorOpen:!1,editingFile:{},currentRatio:"",editor:{},init:async function(){Ft(cr[B]??cr.en),this.pond=gt(this.$refs.input,{acceptedFileTypes:e,allowImageExifOrientation:k,allowPaste:!1,allowRemove:o,allowReorder:z,allowImagePreview:R,allowVideoPreview:R,allowAudioPreview:R,allowImageTransform:H,credits:!1,files:await this.getFiles(),imageCropAspectRatio:p,imagePreviewHeight:c,imageResizeTargetHeight:m,imageResizeTargetWidth:u,imageResizeMode:d,imageResizeUpscale:g,imageTransformOutputStripImageHead:!1,itemInsertLocation:oe?"after":"before",...C&&{labelIdle:C},maxFiles:w,maxFileSize:O,minFileSize:S,...L&&{maxParallelUploads:L},styleButtonProcessItemPosition:re,styleButtonRemoveItemPosition:q,styleItemPanelAspectRatio:P,styleLoadIndicatorPosition:A,stylePanelAspectRatio:F,stylePanelLayout:G,styleProgressIndicatorPosition:dt,server:{load:async(N,W)=>{let Q=await(await fetch(N,{cache:"no-store"})).blob();W(Q)},process:(N,W,$,Q,Ge,Me)=>{this.shouldUpdateState=!1;let Kt=("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,Qt=>(Qt^crypto.getRandomValues(new Uint8Array(1))[0]&15>>Qt/4).toString(16));dr(Kt,W,Qt=>{this.shouldUpdateState=!0,Q(Qt)},Ge,Me)},remove:async(N,W)=>{let $=this.uploadedFileIndex[N]??null;$&&(await l($),W())},revert:async(N,W)=>{await X(N),W()}},allowImageEdit:h,imageEditEditor:{open:N=>this.loadEditor(N),onconfirm:()=>{},oncancel:()=>this.closeEditor(),onclose:()=>this.closeEditor()},fileValidateTypeDetectType:(N,W)=>new Promise(($,Q)=>{let Ge=N.name.split(".").pop().toLowerCase(),Me=D[Ge]||W||Gl.getType(Ge);Me?$(Me):Q()})}),this.$watch("state",async()=>{if(this.pond&&this.shouldUpdateState&&this.state!==void 0){if(this.state!==null&&Object.values(this.state).filter(N=>N.startsWith("livewire-file:")).length){this.lastState=null;return}JSON.stringify(this.state)!==this.lastState&&(this.lastState=JSON.stringify(this.state),this.pond.files=await this.getFiles())}}),this.pond.on("reorderfiles",async N=>{let W=N.map($=>$.source instanceof File?$.serverId:this.uploadedFileIndex[$.source]??null).filter($=>$);await K(oe?W:W.reverse())}),this.pond.on("initfile",async N=>{E&&(f||this.insertDownloadLink(N))}),this.pond.on("initfile",async N=>{x&&(f||this.insertOpenLink(N))}),this.pond.on("addfilestart",async N=>{N.status===Et.PROCESSING_QUEUED&&this.dispatchFormEvent("form-processing-started",{message:ee})});let V=async()=>{this.pond.getFiles().filter(N=>N.status===Et.PROCESSING||N.status===Et.PROCESSING_QUEUED).length||this.dispatchFormEvent("form-processing-finished")};this.pond.on("processfile",V),this.pond.on("processfileabort",V),this.pond.on("processfilerevert",V),G==="compact circle"&&(this.pond.on("error",N=>{this.error=`${N.main}: ${N.sub}`.replace("Expects or","Expects")}),this.pond.on("removefile",()=>this.error=null))},destroy:function(){this.destroyEditor(),ft(this.$refs.input),this.pond=null},dispatchFormEvent:function(V,N={}){this.$el.closest("form")?.dispatchEvent(new CustomEvent(V,{composed:!0,cancelable:!0,detail:N}))},getUploadedFiles:async function(){let V=await s();this.fileKeyIndex=V??{},this.uploadedFileIndex=Object.entries(this.fileKeyIndex).filter(([N,W])=>W?.url).reduce((N,[W,$])=>(N[$.url]=W,N),{})},getFiles:async function(){await this.getUploadedFiles();let V=[];for(let N of Object.values(this.fileKeyIndex))N&&V.push({source:N.url,options:{type:"local",...!N.type||R&&(/^audio/.test(N.type)||/^image/.test(N.type)||/^video/.test(N.type))?{}:{file:{name:N.name,size:N.size,type:N.type}}}});return oe?V:V.reverse()},insertDownloadLink:function(V){if(V.origin!==Ct.LOCAL)return;let N=this.getDownloadLink(V);N&&document.getElementById(`filepond--item-${V.id}`).querySelector(".filepond--file-info-main").prepend(N)},insertOpenLink:function(V){if(V.origin!==Ct.LOCAL)return;let N=this.getOpenLink(V);N&&document.getElementById(`filepond--item-${V.id}`).querySelector(".filepond--file-info-main").prepend(N)},getDownloadLink:function(V){let N=V.source;if(!N)return;let W=document.createElement("a");return W.className="filepond--download-icon",W.href=N,W.download=V.file.name,W},getOpenLink:function(V){let N=V.source;if(!N)return;let W=document.createElement("a");return W.className="filepond--open-icon",W.href=N,W.target="_blank",W},initEditor:function(){r||h&&(this.editor=new ya(this.$refs.editor,{aspectRatio:n/a,autoCropArea:1,center:!0,crop:V=>{this.$refs.xPositionInput.value=Math.round(V.detail.x),this.$refs.yPositionInput.value=Math.round(V.detail.y),this.$refs.heightInput.value=Math.round(V.detail.height),this.$refs.widthInput.value=Math.round(V.detail.width),this.$refs.rotationInput.value=V.detail.rotate},cropBoxResizable:!0,guides:!0,highlight:!0,responsive:!0,toggleDragModeOnDblclick:!0,viewMode:i,wheelZoomRatio:.02}))},closeEditor:function(){this.editingFile={},this.isEditorOpen=!1,this.destroyEditor()},fixImageDimensions:function(V,N){if(V.type!=="image/svg+xml")return N(V);let W=new FileReader;W.onload=$=>{let Q=new DOMParser().parseFromString($.target.result,"image/svg+xml")?.querySelector("svg");if(!Q)return N(V);let Ge=["viewBox","ViewBox","viewbox"].find(Kt=>Q.hasAttribute(Kt));if(!Ge)return N(V);let Me=Q.getAttribute(Ge).split(" ");return!Me||Me.length!==4?N(V):(Q.setAttribute("width",parseFloat(Me[2])+"pt"),Q.setAttribute("height",parseFloat(Me[3])+"pt"),N(new File([new Blob([new XMLSerializer().serializeToString(Q)],{type:"image/svg+xml"})],V.name,{type:"image/svg+xml",_relativePath:""})))},W.readAsText(V)},loadEditor:function(V){if(r||!h||!V)return;let N=V.type==="image/svg+xml";if(!b&&N){alert(y);return}T&&N&&!confirm(v)||this.fixImageDimensions(V,W=>{this.editingFile=W,this.initEditor();let $=new FileReader;$.onload=Q=>{this.isEditorOpen=!0,setTimeout(()=>this.editor.replace(Q.target.result),200)},$.readAsDataURL(V)})},getRoundedCanvas:function(V){let N=V.width,W=V.height,$=document.createElement("canvas");$.width=N,$.height=W;let Q=$.getContext("2d");return Q.imageSmoothingEnabled=!0,Q.drawImage(V,0,0,N,W),Q.globalCompositeOperation="destination-in",Q.beginPath(),Q.ellipse(N/2,W/2,N/2,W/2,0,0,2*Math.PI),Q.fill(),$},saveEditor:function(){if(r||!h)return;let V=this.editor.getCroppedCanvas({fillColor:t??"transparent",height:m,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",width:u});I&&(V=this.getRoundedCanvas(V)),V.toBlob(N=>{_&&this.pond.removeFile(this.pond.getFiles().find(W=>W.filename===this.editingFile.name)?.id,{revert:!0}),this.$nextTick(()=>{this.shouldUpdateState=!1;let W=this.editingFile.name.slice(0,this.editingFile.name.lastIndexOf(".")),$=this.editingFile.name.split(".").pop();$==="svg"&&($="png");let Q=/-v(\d+)/;Q.test(W)?W=W.replace(Q,(Ge,Me)=>`-v${Number(Me)+1}`):W+="-v1",this.pond.addFile(new File([N],`${W}.${$}`,{type:this.editingFile.type==="image/svg+xml"||I?"image/png":this.editingFile.type,lastModified:new Date().getTime()})).then(()=>{this.closeEditor()}).catch(()=>{this.closeEditor()})})},I?"image/png":this.editingFile.type)},destroyEditor:function(){this.editor&&typeof this.editor.destroy=="function"&&this.editor.destroy(),this.editor=null}}}var cr={am:wo,ar:Lo,az:Mo,ca:Ao,ckb:Po,cs:zo,da:Oo,de:Fo,el:Do,en:Co,es:Bo,fa:No,fi:ko,fr:Vo,he:Go,hr:Uo,hu:Wo,id:Ho,it:jo,ja:Yo,km:qo,ko:$o,lt:Xo,lv:Ko,nl:Qo,no:Zo,pl:Jo,pt_BR:_i,pt_PT:_i,ro:er,ru:tr,sk:ir,sv:ar,tr:nr,uk:lr,vi:or,zh_CN:rr,zh_TW:sr};export{Rg as default}; +/*! Bundled license information: + +filepond/dist/filepond.esm.js: + (*! + * FilePond 4.32.7 + * Licensed under MIT, https://opensource.org/licenses/MIT/ + * Please visit https://pqina.nl/filepond/ for details. + *) + +cropperjs/dist/cropper.esm.js: + (*! + * Cropper.js v1.6.2 + * https://fengyuanchen.github.io/cropperjs + * + * Copyright 2015-present Chen Fengyuan + * Released under the MIT license + * + * Date: 2024-04-21T07:43:05.335Z + *) + +filepond-plugin-file-validate-size/dist/filepond-plugin-file-validate-size.esm.js: + (*! + * FilePondPluginFileValidateSize 2.2.8 + * Licensed under MIT, https://opensource.org/licenses/MIT/ + * Please visit https://pqina.nl/filepond/ for details. + *) + +filepond-plugin-file-validate-type/dist/filepond-plugin-file-validate-type.esm.js: + (*! + * FilePondPluginFileValidateType 1.2.9 + * Licensed under MIT, https://opensource.org/licenses/MIT/ + * Please visit https://pqina.nl/filepond/ for details. + *) + +filepond-plugin-image-crop/dist/filepond-plugin-image-crop.esm.js: + (*! + * FilePondPluginImageCrop 2.0.6 + * Licensed under MIT, https://opensource.org/licenses/MIT/ + * Please visit https://pqina.nl/filepond/ for details. + *) + +filepond-plugin-image-edit/dist/filepond-plugin-image-edit.esm.js: + (*! + * FilePondPluginImageEdit 1.6.3 + * Licensed under MIT, https://opensource.org/licenses/MIT/ + * Please visit https://pqina.nl/filepond/ for details. + *) + +filepond-plugin-image-exif-orientation/dist/filepond-plugin-image-exif-orientation.esm.js: + (*! + * FilePondPluginImageExifOrientation 1.0.11 + * Licensed under MIT, https://opensource.org/licenses/MIT/ + * Please visit https://pqina.nl/filepond/ for details. + *) + +filepond-plugin-image-preview/dist/filepond-plugin-image-preview.esm.js: + (*! + * FilePondPluginImagePreview 4.6.12 + * Licensed under MIT, https://opensource.org/licenses/MIT/ + * Please visit https://pqina.nl/filepond/ for details. + *) + +filepond-plugin-image-resize/dist/filepond-plugin-image-resize.esm.js: + (*! + * FilePondPluginImageResize 2.0.10 + * Licensed under MIT, https://opensource.org/licenses/MIT/ + * Please visit https://pqina.nl/filepond/ for details. + *) + +filepond-plugin-image-transform/dist/filepond-plugin-image-transform.esm.js: + (*! + * FilePondPluginImageTransform 3.8.7 + * Licensed under MIT, https://opensource.org/licenses/MIT/ + * Please visit https://pqina.nl/filepond/ for details. + *) + +filepond-plugin-media-preview/dist/filepond-plugin-media-preview.esm.js: + (*! + * FilePondPluginMediaPreview 1.0.11 + * Licensed under MIT, https://opensource.org/licenses/MIT/ + * Please visit undefined for details. + *) +*/ diff --git a/public/js/filament/forms/components/key-value.js b/public/js/filament/forms/components/key-value.js new file mode 100644 index 00000000..9c847c01 --- /dev/null +++ b/public/js/filament/forms/components/key-value.js @@ -0,0 +1 @@ +function r({state:o}){return{state:o,rows:[],shouldUpdateRows:!0,init:function(){this.updateRows(),this.rows.length<=0?this.rows.push({key:"",value:""}):this.updateState(),this.$watch("state",(t,e)=>{let s=i=>i===null?0:Array.isArray(i)?i.length:typeof i!="object"?0:Object.keys(i).length;s(t)===0&&s(e)===0||this.updateRows()})},addRow:function(){this.rows.push({key:"",value:""}),this.updateState()},deleteRow:function(t){this.rows.splice(t,1),this.rows.length<=0&&this.addRow(),this.updateState()},reorderRows:function(t){let e=Alpine.raw(this.rows);this.rows=[];let s=e.splice(t.oldIndex,1)[0];e.splice(t.newIndex,0,s),this.$nextTick(()=>{this.rows=e,this.updateState()})},updateRows:function(){if(!this.shouldUpdateRows){this.shouldUpdateRows=!0;return}let t=[];for(let[e,s]of Object.entries(this.state??{}))t.push({key:e,value:s});this.rows=t},updateState:function(){let t={};this.rows.forEach(e=>{e.key===""||e.key===null||(t[e.key]=e.value)}),this.shouldUpdateRows=!1,this.state=t}}}export{r as default}; diff --git a/public/js/filament/forms/components/markdown-editor.js b/public/js/filament/forms/components/markdown-editor.js new file mode 100644 index 00000000..14c4fc4f --- /dev/null +++ b/public/js/filament/forms/components/markdown-editor.js @@ -0,0 +1,51 @@ +var ss=Object.defineProperty;var Sd=Object.getOwnPropertyDescriptor;var Td=Object.getOwnPropertyNames;var Ld=Object.prototype.hasOwnProperty;var Cd=(o,p)=>()=>(o&&(p=o(o=0)),p);var Ke=(o,p)=>()=>(p||o((p={exports:{}}).exports,p),p.exports);var Ed=(o,p,v,C)=>{if(p&&typeof p=="object"||typeof p=="function")for(let b of Td(p))!Ld.call(o,b)&&b!==v&&ss(o,b,{get:()=>p[b],enumerable:!(C=Sd(p,b))||C.enumerable});return o};var zd=o=>Ed(ss({},"__esModule",{value:!0}),o);var We=Ke((Yo,Qo)=>{(function(o,p){typeof Yo=="object"&&typeof Qo<"u"?Qo.exports=p():typeof define=="function"&&define.amd?define(p):(o=o||self,o.CodeMirror=p())})(Yo,function(){"use strict";var o=navigator.userAgent,p=navigator.platform,v=/gecko\/\d/i.test(o),C=/MSIE \d/.test(o),b=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(o),S=/Edge\/(\d+)/.exec(o),s=C||b||S,h=s&&(C?document.documentMode||6:+(S||b)[1]),g=!S&&/WebKit\//.test(o),T=g&&/Qt\/\d+\.\d+/.test(o),y=!S&&/Chrome\/(\d+)/.exec(o),c=y&&+y[1],d=/Opera\//.test(o),k=/Apple Computer/.test(navigator.vendor),z=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(o),M=/PhantomJS/.test(o),w=k&&(/Mobile\/\w+/.test(o)||navigator.maxTouchPoints>2),W=/Android/.test(o),E=w||W||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(o),N=w||/Mac/.test(p),G=/\bCrOS\b/.test(o),J=/win/i.test(p),re=d&&o.match(/Version\/(\d*\.\d*)/);re&&(re=Number(re[1])),re&&re>=15&&(d=!1,g=!0);var q=N&&(T||d&&(re==null||re<12.11)),O=v||s&&h>=9;function D(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Q=function(e,t){var n=e.className,r=D(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function R(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function V(e,t){return R(e).appendChild(t)}function x(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a=t)return l+(t-a);l+=u-a,l+=n-l%n,a=u+1}}var qe=function(){this.id=null,this.f=null,this.time=0,this.handler=Ee(this.onTimeout,this)};qe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},qe.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(l,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var U=[""];function Z(e){for(;U.length<=e;)U.push(ce(U)+" ");return U[e]}function ce(e){return e[e.length-1]}function Be(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ue.test(e))}function Me(e,t){return t?t.source.indexOf("\\w")>-1&&we(e)?!0:t.test(e):we(e)}function Le(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var $=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function B(e){return e.charCodeAt(0)>=768&&$.test(e)}function se(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}function nt(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,a=0;at||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",a),i=!0)}i||r(t,n,"ltr")}var dt=null;function Pt(e,t,n){var r;dt=null;for(var i=0;it)return i;a.to==t&&(a.from!=a.to&&n=="before"?r=i:dt=i),a.from==t&&(a.from!=a.to&&n!="before"?r=i:dt=i)}return r??dt}var Ft=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(m){return m<=247?e.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1785?t.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,u=/[1n]/;function f(m,A,j){this.level=m,this.from=A,this.to=j}return function(m,A){var j=A=="ltr"?"L":"R";if(m.length==0||A=="ltr"&&!r.test(m))return!1;for(var ee=m.length,Y=[],ie=0;ie-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function it(e,t){var n=nr(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Wt(e){e.prototype.on=function(t,n){Ie(this,t,n)},e.prototype.off=function(t,n){_t(this,t,n)}}function kt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Hr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ct(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function dr(e){kt(e),Hr(e)}function yn(e){return e.target||e.srcElement}function Ut(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),N&&e.ctrlKey&&t==1&&(t=3),t}var eo=function(){if(s&&h<9)return!1;var e=x("div");return"draggable"in e||"dragDrop"in e}(),Br;function ei(e){if(Br==null){var t=x("span","\u200B");V(e,x("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Br=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&h<8))}var n=Br?x("span","\u200B"):x("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var xn;function pr(e){if(xn!=null)return xn;var t=V(e,document.createTextNode("A\u062EA")),n=X(t,0,1).getBoundingClientRect(),r=X(t,1,2).getBoundingClientRect();return R(e),!n||n.left==n.right?!1:xn=r.right-n.right<3}var Bt=` + +b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(` +`,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=a.indexOf("\r");l!=-1?(n.push(a.slice(0,l)),t+=l+1):(n.push(a),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},hr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},ti=function(){var e=x("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),$t=null;function to(e){if($t!=null)return $t;var t=V(e,x("span","x")),n=t.getBoundingClientRect(),r=X(t,0,1).getBoundingClientRect();return $t=Math.abs(n.left-r.left)>1}var Wr={},Kt={};function Gt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Wr[e]=t}function Cr(e,t){Kt[e]=t}function Ur(e){if(typeof e=="string"&&Kt.hasOwnProperty(e))e=Kt[e];else if(e&&typeof e.name=="string"&&Kt.hasOwnProperty(e.name)){var t=Kt[e.name];typeof t=="string"&&(t={name:t}),e=oe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ur("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ur("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function $r(e,t){t=Ur(t);var n=Wr[t.name];if(!n)return $r(e,"text/plain");var r=n(e,t);if(gr.hasOwnProperty(t.name)){var i=gr[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var gr={};function Kr(e,t){var n=gr.hasOwnProperty(e)?gr[e]:gr[e]={};ge(t,n)}function Vt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function _n(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Gr(e,t,n){return e.startState?e.startState(t,n):!0}var at=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};at.prototype.eol=function(){return this.pos>=this.string.length},at.prototype.sol=function(){return this.pos==this.lineStart},at.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},at.prototype.next=function(){if(this.post},at.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},at.prototype.skipToEnd=function(){this.pos=this.string.length},at.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},at.prototype.backUp=function(e){this.pos-=e},at.prototype.column=function(){return this.lastColumnPos0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},at.prototype.current=function(){return this.string.slice(this.start,this.pos)},at.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},at.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},at.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ae(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t=e.first&&tn?ne(n,Ae(e,n).text.length):Sc(t,Ae(e,t.line).text.length)}function Sc(e,t){var n=e.ch;return n==null||n>t?ne(e.line,t):n<0?ne(e.line,0):e}function ca(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},Jt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Jt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Jt.fromSaved=function(e,t,n){return t instanceof ri?new Jt(e,Vt(e.mode,t.state),n,t.lookAhead):new Jt(e,Vt(e.mode,t),n)},Jt.prototype.save=function(e){var t=e!==!1?Vt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ri(t,this.maxLookAhead):t};function fa(e,t,n,r){var i=[e.state.modeGen],a={};va(e,t.text,e.doc.mode,n,function(m,A){return i.push(m,A)},a,r);for(var l=n.state,u=function(m){n.baseTokens=i;var A=e.state.overlays[m],j=1,ee=0;n.state=!0,va(e,t.text,A.mode,n,function(Y,ie){for(var ue=j;eeY&&i.splice(j,1,Y,i[j+1],me),j+=2,ee=Math.min(Y,me)}if(ie)if(A.opaque)i.splice(ue,j-ue,Y,"overlay "+ie),j=ue+2;else for(;uee.options.maxHighlightLength&&Vt(e.doc.mode,r.state),a=fa(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function wn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Jt(r,!0,t);var a=Tc(e,t,n),l=a>r.first&&Ae(r,a-1).stateAfter,u=l?Jt.fromSaved(r,l,a):new Jt(r,Gr(r.mode),a);return r.iter(a,t,function(f){ro(e,f.text,u);var m=u.line;f.stateAfter=m==t-1||m%5==0||m>=i.viewFrom&&mt.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}var ha=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function ga(e,t,n,r){var i=e.doc,a=i.mode,l;t=Re(i,t);var u=Ae(i,t.line),f=wn(e,t.line,n),m=new at(u.text,e.options.tabSize,f),A;for(r&&(A=[]);(r||m.pose.options.maxHighlightLength?(u=!1,l&&ro(e,t,r,A.pos),A.pos=t.length,j=null):j=ma(no(n,A,r.state,ee),a),ee){var Y=ee[0].name;Y&&(j="m-"+(j?Y+" "+j:Y))}if(!u||m!=j){for(;fl;--u){if(u<=a.first)return a.first;var f=Ae(a,u-1),m=f.stateAfter;if(m&&(!n||u+(m instanceof ri?m.lookAhead:0)<=a.modeFrontier))return u;var A=Oe(f.text,null,e.options.tabSize);(i==null||r>A)&&(i=u-1,r=A)}return i}function Lc(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Ae(e,r).stateAfter;if(i&&(!(i instanceof ri)||r+i.lookAhead=t:a.to>t);(r||(r=[])).push(new ni(l,a.from,f?null:a.to))}}return r}function Dc(e,t,n){var r;if(e)for(var i=0;i=t:a.to>t);if(u||a.from==t&&l.type=="bookmark"&&(!n||a.marker.insertLeft)){var f=a.from==null||(l.inclusiveLeft?a.from<=t:a.from0&&u)for(var Ce=0;Ce0)){var A=[f,1],j=ye(m.from,u.from),ee=ye(m.to,u.to);(j<0||!l.inclusiveLeft&&!j)&&A.push({from:m.from,to:u.from}),(ee>0||!l.inclusiveRight&&!ee)&&A.push({from:u.to,to:m.to}),i.splice.apply(i,A),f+=A.length-3}}return i}function xa(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!r||oo(r,a.marker)<0)&&(r=a.marker)}return r}function Sa(e,t,n,r,i){var a=Ae(e,t),l=or&&a.markedSpans;if(l)for(var u=0;u=0&&j<=0||A<=0&&j>=0)&&(A<=0&&(f.marker.inclusiveRight&&i.inclusiveLeft?ye(m.to,n)>=0:ye(m.to,n)>0)||A>=0&&(f.marker.inclusiveRight&&i.inclusiveLeft?ye(m.from,r)<=0:ye(m.from,r)<0)))return!0}}}function Zt(e){for(var t;t=wa(e);)e=t.find(-1,!0).line;return e}function Ic(e){for(var t;t=ai(e);)e=t.find(1,!0).line;return e}function Nc(e){for(var t,n;t=ai(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function ao(e,t){var n=Ae(e,t),r=Zt(n);return n==r?t:_(r)}function Ta(e,t){if(t>e.lastLine())return t;var n=Ae(e,t),r;if(!mr(e,n))return t;for(;r=ai(n);)n=r.find(1,!0).line;return _(n)+1}function mr(e,t){var n=or&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Xr=function(e,t,n){this.text=e,_a(this,t),this.height=n?n(this):1};Xr.prototype.lineNo=function(){return _(this)},Wt(Xr);function Oc(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),xa(e),_a(e,n);var i=r?r(e):1;i!=e.height&&jt(e,i)}function Pc(e){e.parent=null,xa(e)}var jc={},Rc={};function La(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Rc:jc;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Ca(e,t){var n=K("span",null,null,g?"padding-right: .1px":null),r={pre:K("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=Bc,pr(e.display.measure)&&(l=Pe(a,e.doc.direction))&&(r.addToken=Uc(r.addToken,l)),r.map=[];var u=t!=e.display.externalMeasured&&_(a);$c(a,r,da(e,a,u)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=xe(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=xe(a.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(ei(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(g){var f=r.content.lastChild;(/\bcm-tab\b/.test(f.className)||f.querySelector&&f.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return it(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=xe(r.pre.className,r.textClass||"")),r}function Hc(e){var t=x("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Bc(e,t,n,r,i,a,l){if(t){var u=e.splitSpaces?Wc(t,e.trailingSpace):t,f=e.cm.state.specialChars,m=!1,A;if(!f.test(t))e.col+=t.length,A=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,A),s&&h<9&&(m=!0),e.pos+=t.length;else{A=document.createDocumentFragment();for(var j=0;;){f.lastIndex=j;var ee=f.exec(t),Y=ee?ee.index-j:t.length-j;if(Y){var ie=document.createTextNode(u.slice(j,j+Y));s&&h<9?A.appendChild(x("span",[ie])):A.appendChild(ie),e.map.push(e.pos,e.pos+Y,ie),e.col+=Y,e.pos+=Y}if(!ee)break;j+=Y+1;var ue=void 0;if(ee[0]==" "){var me=e.cm.options.tabSize,ve=me-e.col%me;ue=A.appendChild(x("span",Z(ve),"cm-tab")),ue.setAttribute("role","presentation"),ue.setAttribute("cm-text"," "),e.col+=ve}else ee[0]=="\r"||ee[0]==` +`?(ue=A.appendChild(x("span",ee[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ue.setAttribute("cm-text",ee[0]),e.col+=1):(ue=e.cm.options.specialCharPlaceholder(ee[0]),ue.setAttribute("cm-text",ee[0]),s&&h<9?A.appendChild(x("span",[ue])):A.appendChild(ue),e.col+=1);e.map.push(e.pos,e.pos+1,ue),e.pos++}}if(e.trailingSpace=u.charCodeAt(t.length-1)==32,n||r||i||m||a||l){var _e=n||"";r&&(_e+=r),i&&(_e+=i);var be=x("span",[A],_e,a);if(l)for(var Ce in l)l.hasOwnProperty(Ce)&&Ce!="style"&&Ce!="class"&&be.setAttribute(Ce,l[Ce]);return e.content.appendChild(be)}e.content.appendChild(A)}}function Wc(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;im&&j.from<=m));ee++);if(j.to>=A)return e(n,r,i,a,l,u,f);e(n,r.slice(0,j.to-m),i,a,null,u,f),a=null,r=r.slice(j.to-m),m=j.to}}}function Ea(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function $c(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var l=1;lf||$e.collapsed&&Fe.to==f&&Fe.from==f)){if(Fe.to!=null&&Fe.to!=f&&Y>Fe.to&&(Y=Fe.to,ue=""),$e.className&&(ie+=" "+$e.className),$e.css&&(ee=(ee?ee+";":"")+$e.css),$e.startStyle&&Fe.from==f&&(me+=" "+$e.startStyle),$e.endStyle&&Fe.to==Y&&(Ce||(Ce=[])).push($e.endStyle,Fe.to),$e.title&&((_e||(_e={})).title=$e.title),$e.attributes)for(var Ve in $e.attributes)(_e||(_e={}))[Ve]=$e.attributes[Ve];$e.collapsed&&(!ve||oo(ve.marker,$e)<0)&&(ve=Fe)}else Fe.from>f&&Y>Fe.from&&(Y=Fe.from)}if(Ce)for(var vt=0;vt=u)break;for(var Ot=Math.min(u,Y);;){if(A){var At=f+A.length;if(!ve){var ut=At>Ot?A.slice(0,Ot-f):A;t.addToken(t,ut,j?j+ie:ie,me,f+ut.length==Y?ue:"",ee,_e)}if(At>=Ot){A=A.slice(Ot-f),f=Ot;break}f=At,me=""}A=i.slice(a,a=n[m++]),j=La(n[m++],t.cm.options)}}}function za(e,t,n){this.line=t,this.rest=Nc(t),this.size=this.rest?_(ce(this.rest))-n+1:1,this.node=this.text=null,this.hidden=mr(e,t)}function si(e,t,n){for(var r=[],i,a=t;a2&&a.push((f.bottom+m.top)/2-n.top)}}a.push(n.bottom-n.top)}}function Na(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function rf(e,t){t=Zt(t);var n=_(t),r=e.display.externalMeasured=new za(e.doc,t,n);r.lineN=n;var i=r.built=Ca(e,r);return r.text=i.pre,V(e.display.lineMeasure,i.pre),r}function Oa(e,t,n,r){return tr(e,Qr(e,t),n,r)}function po(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(a=f-u,i=a-1,t>=f&&(l="right")),i!=null){if(r=e[m+2],u==f&&n==(r.insertLeft?"left":"right")&&(l=n),n=="left"&&i==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)r=e[(m-=3)+2],l="left";if(n=="right"&&i==f-u)for(;m=0&&(n=e[i]).left==n.right;i--);return n}function of(e,t,n,r){var i=ja(t.map,n,r),a=i.node,l=i.start,u=i.end,f=i.collapse,m;if(a.nodeType==3){for(var A=0;A<4;A++){for(;l&&B(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+u0&&(f=r="right");var j;e.options.lineWrapping&&(j=a.getClientRects()).length>1?m=j[r=="right"?j.length-1:0]:m=a.getBoundingClientRect()}if(s&&h<9&&!l&&(!m||!m.left&&!m.right)){var ee=a.parentNode.getClientRects()[0];ee?m={left:ee.left,right:ee.left+Jr(e.display),top:ee.top,bottom:ee.bottom}:m=Pa}for(var Y=m.top-t.rect.top,ie=m.bottom-t.rect.top,ue=(Y+ie)/2,me=t.view.measure.heights,ve=0;ve=r.text.length?(f=r.text.length,m="before"):f<=0&&(f=0,m="after"),!u)return l(m=="before"?f-1:f,m=="before");function A(ie,ue,me){var ve=u[ue],_e=ve.level==1;return l(me?ie-1:ie,_e!=me)}var j=Pt(u,f,m),ee=dt,Y=A(f,j,m=="before");return ee!=null&&(Y.other=A(f,ee,m!="before")),Y}function $a(e,t){var n=0;t=Re(e.doc,t),e.options.lineWrapping||(n=Jr(e.display)*t.ch);var r=Ae(e.doc,t.line),i=ar(r)+ui(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function go(e,t,n,r,i){var a=ne(e,t,n);return a.xRel=i,r&&(a.outside=r),a}function mo(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return go(r.first,0,null,-1,-1);var i=P(r,n),a=r.first+r.size-1;if(i>a)return go(r.first+r.size-1,Ae(r,a).text.length,null,1,1);t<0&&(t=0);for(var l=Ae(r,i);;){var u=lf(e,l,i,t,n),f=Fc(l,u.ch+(u.xRel>0||u.outside>0?1:0));if(!f)return u;var m=f.find(1);if(m.line==i)return m;l=Ae(r,i=m.line)}}function Ka(e,t,n,r){r-=ho(t);var i=t.text.length,a=De(function(l){return tr(e,n,l-1).bottom<=r},i,0);return i=De(function(l){return tr(e,n,l).top>r},a,i),{begin:a,end:i}}function Ga(e,t,n,r){n||(n=Qr(e,t));var i=ci(e,t,tr(e,n,r),"line").top;return Ka(e,t,n,i)}function vo(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function lf(e,t,n,r,i){i-=ar(t);var a=Qr(e,t),l=ho(t),u=0,f=t.text.length,m=!0,A=Pe(t,e.doc.direction);if(A){var j=(e.options.lineWrapping?uf:sf)(e,t,n,a,A,r,i);m=j.level!=1,u=m?j.from:j.to-1,f=m?j.to:j.from-1}var ee=null,Y=null,ie=De(function(Ne){var Fe=tr(e,a,Ne);return Fe.top+=l,Fe.bottom+=l,vo(Fe,r,i,!1)?(Fe.top<=i&&Fe.left<=r&&(ee=Ne,Y=Fe),!0):!1},u,f),ue,me,ve=!1;if(Y){var _e=r-Y.left=Ce.bottom?1:0}return ie=se(t.text,ie,1),go(n,ie,me,ve,r-ue)}function sf(e,t,n,r,i,a,l){var u=De(function(j){var ee=i[j],Y=ee.level!=1;return vo(Xt(e,ne(n,Y?ee.to:ee.from,Y?"before":"after"),"line",t,r),a,l,!0)},0,i.length-1),f=i[u];if(u>0){var m=f.level!=1,A=Xt(e,ne(n,m?f.from:f.to,m?"after":"before"),"line",t,r);vo(A,a,l,!0)&&A.top>l&&(f=i[u-1])}return f}function uf(e,t,n,r,i,a,l){var u=Ka(e,t,r,l),f=u.begin,m=u.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var A=null,j=null,ee=0;ee=m||Y.to<=f)){var ie=Y.level!=1,ue=tr(e,r,ie?Math.min(m,Y.to)-1:Math.max(f,Y.from)).right,me=ueme)&&(A=Y,j=me)}}return A||(A=i[i.length-1]),A.fromm&&(A={from:A.from,to:m,level:A.level}),A}var zr;function Vr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(zr==null){zr=x("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)zr.appendChild(document.createTextNode("x")),zr.appendChild(x("br"));zr.appendChild(document.createTextNode("x"))}V(e.measure,zr);var n=zr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),R(e.measure),n||1}function Jr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=x("span","xxxxxxxxxx"),n=x("pre",[t],"CodeMirror-line-like");V(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function bo(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,a=t.gutters.firstChild,l=0;a;a=a.nextSibling,++l){var u=e.display.gutterSpecs[l].className;n[u]=a.offsetLeft+a.clientLeft+i,r[u]=a.clientWidth}return{fixedPos:yo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function yo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Za(e){var t=Vr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Jr(e.display)-3);return function(i){if(mr(e.doc,i))return 0;var a=0;if(i.widgets)for(var l=0;l0&&(m=Ae(e.doc,f.line).text).length==f.ch){var A=Oe(m,m.length,e.options.tabSize)-m.length;f=ne(f.line,Math.max(0,Math.round((a-Ia(e.display).left)/Jr(e.display))-A))}return f}function Ar(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)or&&ao(e.doc,t)i.viewFrom?br(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)br(e);else if(t<=i.viewFrom){var a=di(e,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):br(e)}else if(n>=i.viewTo){var l=di(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):br(e)}else{var u=di(e,t,t,-1),f=di(e,n,n+r,1);u&&f?(i.view=i.view.slice(0,u.index).concat(si(e,u.lineN,f.lineN)).concat(i.view.slice(f.index)),i.viewTo+=r):br(e)}var m=i.externalMeasured;m&&(n=i.lineN&&t=r.viewTo)){var a=r.view[Ar(e,t)];if(a.node!=null){var l=a.changes||(a.changes=[]);Se(l,n)==-1&&l.push(n)}}}function br(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function di(e,t,n,r){var i=Ar(e,t),a,l=e.display.view;if(!or||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var u=e.display.viewFrom,f=0;f0){if(i==l.length-1)return null;a=u+l[i].size-t,i++}else a=u-t;t+=a,n+=a}for(;ao(e.doc,n)!=n;){if(i==(r<0?0:l.length-1))return null;n+=r*l[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function cf(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=si(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=si(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Ar(e,n)))),r.viewTo=n}function Xa(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||f.to().line0?l:e.defaultCharWidth())+"px"}if(r.other){var u=n.appendChild(x("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));u.style.display="",u.style.left=r.other.left+"px",u.style.top=r.other.top+"px",u.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function pi(e,t){return e.top-t.top||e.left-t.left}function ff(e,t,n){var r=e.display,i=e.doc,a=document.createDocumentFragment(),l=Ia(e.display),u=l.left,f=Math.max(r.sizerWidth,Er(e)-r.sizer.offsetLeft)-l.right,m=i.direction=="ltr";function A(be,Ce,Ne,Fe){Ce<0&&(Ce=0),Ce=Math.round(Ce),Fe=Math.round(Fe),a.appendChild(x("div",null,"CodeMirror-selected","position: absolute; left: "+be+`px; + top: `+Ce+"px; width: "+(Ne??f-be)+`px; + height: `+(Fe-Ce)+"px"))}function j(be,Ce,Ne){var Fe=Ae(i,be),$e=Fe.text.length,Ve,vt;function rt(ut,Dt){return fi(e,ne(be,ut),"div",Fe,Dt)}function Ot(ut,Dt,yt){var ft=Ga(e,Fe,null,ut),ct=Dt=="ltr"==(yt=="after")?"left":"right",lt=yt=="after"?ft.begin:ft.end-(/\s/.test(Fe.text.charAt(ft.end-1))?2:1);return rt(lt,ct)[ct]}var At=Pe(Fe,i.direction);return nt(At,Ce||0,Ne??$e,function(ut,Dt,yt,ft){var ct=yt=="ltr",lt=rt(ut,ct?"left":"right"),qt=rt(Dt-1,ct?"right":"left"),pn=Ce==null&&ut==0,Sr=Ne==null&&Dt==$e,St=ft==0,rr=!At||ft==At.length-1;if(qt.top-lt.top<=3){var bt=(m?pn:Sr)&&St,Zo=(m?Sr:pn)&&rr,cr=bt?u:(ct?lt:qt).left,Nr=Zo?f:(ct?qt:lt).right;A(cr,lt.top,Nr-cr,lt.bottom)}else{var Or,Lt,hn,Xo;ct?(Or=m&&pn&&St?u:lt.left,Lt=m?f:Ot(ut,yt,"before"),hn=m?u:Ot(Dt,yt,"after"),Xo=m&&Sr&&rr?f:qt.right):(Or=m?Ot(ut,yt,"before"):u,Lt=!m&&pn&&St?f:lt.right,hn=!m&&Sr&&rr?u:qt.left,Xo=m?Ot(Dt,yt,"after"):f),A(Or,lt.top,Lt-Or,lt.bottom),lt.bottom0?t.blinker=setInterval(function(){e.hasFocus()||en(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Qa(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||So(e))}function wo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&en(e))},100)}function So(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(it(e,"focus",e,t),e.state.focused=!0,le(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ko(e))}function en(e,t){e.state.delayingBlurEvent||(e.state.focused&&(it(e,"blur",e,t),e.state.focused=!1,Q(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function hi(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,a=0,l=0;l.005||Y<-.005)&&(ie.display.sizerWidth){var ue=Math.ceil(A/Jr(e.display));ue>e.display.maxLineLength&&(e.display.maxLineLength=ue,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function Va(e){if(e.widgets)for(var t=0;t=l&&(a=P(t,ar(Ae(t,f))-e.wrapper.clientHeight),l=f)}return{from:a,to:Math.max(l,a+1)}}function df(e,t){if(!ot(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,a=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(i=!1),i!=null&&!M){var l=x("div","\u200B",null,`position: absolute; + top: `+(t.top-n.viewOffset-ui(e.display))+`px; + height: `+(t.bottom-t.top+er(e)+n.barHeight)+`px; + left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function pf(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?ne(t.line,t.ch+1,"before"):t,t=t.ch?ne(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var a=0;a<5;a++){var l=!1,u=Xt(e,t),f=!n||n==t?u:Xt(e,n);i={left:Math.min(u.left,f.left),top:Math.min(u.top,f.top)-r,right:Math.max(u.left,f.left),bottom:Math.max(u.bottom,f.bottom)+r};var m=To(e,i),A=e.doc.scrollTop,j=e.doc.scrollLeft;if(m.scrollTop!=null&&(An(e,m.scrollTop),Math.abs(e.doc.scrollTop-A)>1&&(l=!0)),m.scrollLeft!=null&&(Dr(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-j)>1&&(l=!0)),!l)break}return i}function hf(e,t){var n=To(e,t);n.scrollTop!=null&&An(e,n.scrollTop),n.scrollLeft!=null&&Dr(e,n.scrollLeft)}function To(e,t){var n=e.display,r=Vr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=fo(e),l={};t.bottom-t.top>a&&(t.bottom=t.top+a);var u=e.doc.height+co(n),f=t.topu-r;if(t.topi+a){var A=Math.min(t.top,(m?u:t.bottom)-a);A!=i&&(l.scrollTop=A)}var j=e.options.fixedGutter?0:n.gutters.offsetWidth,ee=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-j,Y=Er(e)-n.gutters.offsetWidth,ie=t.right-t.left>Y;return ie&&(t.right=t.left+Y),t.left<10?l.scrollLeft=0:t.leftY+ee-3&&(l.scrollLeft=t.right+(ie?0:10)-Y),l}function Lo(e,t){t!=null&&(mi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function tn(e){mi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Mn(e,t,n){(t!=null||n!=null)&&mi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function gf(e,t){mi(e),e.curOp.scrollToPos=t}function mi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=$a(e,t.from),r=$a(e,t.to);Ja(e,n,r,t.margin)}}function Ja(e,t,n,r){var i=To(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Mn(e,i.scrollLeft,i.scrollTop)}function An(e,t){Math.abs(e.doc.scrollTop-t)<2||(v||Eo(e,{top:t}),el(e,t,!0),v&&Eo(e),Fn(e,100))}function el(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Dr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,ol(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Dn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+co(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+er(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var qr=function(e,t,n){this.cm=n;var r=this.vert=x("div",[x("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=x("div",[x("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),Ie(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ie(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&h<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};qr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},qr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},qr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},qr.prototype.zeroWidthHack=function(){var e=N&&!z?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new qe,this.disableVert=new qe},qr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),a=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);a!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},qr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var qn=function(){};qn.prototype.update=function(){return{bottom:0,right:0}},qn.prototype.setScrollLeft=function(){},qn.prototype.setScrollTop=function(){},qn.prototype.clear=function(){};function rn(e,t){t||(t=Dn(e));var n=e.display.barWidth,r=e.display.barHeight;tl(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&hi(e),tl(e,Dn(e)),n=e.display.barWidth,r=e.display.barHeight}function tl(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var rl={native:qr,null:qn};function nl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Q(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new rl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ie(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Dr(e,t):An(e,t)},e),e.display.scrollbars.addClass&&le(e.display.wrapper,e.display.scrollbars.addClass)}var mf=0;function Fr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++mf,markArrays:null},Kc(e.curOp)}function Ir(e){var t=e.curOp;t&&Zc(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new vi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function yf(e){e.updatedDisplay=e.mustUpdate&&Co(e.cm,e.update)}function xf(e){var t=e.cm,n=t.display;e.updatedDisplay&&hi(t),e.barMeasure=Dn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Oa(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+er(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Er(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function _f(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=wn(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(r.line>=e.display.viewFrom){var l=a.styles,u=a.text.length>e.options.maxHighlightLength?Vt(t.mode,r.state):null,f=fa(e,a,r,!0);u&&(r.state=u),a.styles=f.styles;var m=a.styleClasses,A=f.classes;A?a.styleClasses=A:m&&(a.styleClasses=null);for(var j=!l||l.length!=a.styles.length||m!=A&&(!m||!A||m.bgClass!=A.bgClass||m.textClass!=A.textClass),ee=0;!j&&een)return Fn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Nt(e,function(){for(var a=0;a=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Xa(e)==0)return!1;al(e)&&(br(e),t.dims=bo(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroml&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),or&&(a=ao(e.doc,a),l=Ta(e.doc,l));var u=a!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;cf(e,a,l),n.viewOffset=ar(Ae(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var f=Xa(e);if(!u&&f==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var m=Tf(e);return f>4&&(n.lineDiv.style.display="none"),Cf(e,n.updateLineNumbers,t.dims),f>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Lf(m),R(n.cursorDiv),R(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,u&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Fn(e,400)),n.updateLineNumbers=null,!0}function il(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Er(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+co(e.display)-fo(e),n.top)}),t.visible=gi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=gi(e.display,e.doc,n));if(!Co(e,t))break;hi(e);var i=Dn(e);zn(e),rn(e,i),Mo(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Eo(e,t){var n=new vi(e,t);if(Co(e,n)){hi(e),il(e,n);var r=Dn(e);zn(e),rn(e,r),Mo(e,r),n.finish()}}function Cf(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,l=a.firstChild;function u(ie){var ue=ie.nextSibling;return g&&N&&e.display.currentWheelTarget==ie?ie.style.display="none":ie.parentNode.removeChild(ie),ue}for(var f=r.view,m=r.viewFrom,A=0;A-1&&(Y=!1),Ma(e,j,m,n)),Y&&(R(j.lineNumber),j.lineNumber.appendChild(document.createTextNode(he(e.options,m)))),l=j.node.nextSibling}m+=j.size}for(;l;)l=u(l)}function zo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ht(e,"gutterChanged",e)}function Mo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+er(e)+"px"}function ol(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=yo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+"px",l=0;l=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),s&&h<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!g&&!(v&&E)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Ao(r.gutters,r.lineNumbers),ll(i),n.init(i)}var bi=0,sr=null;s?sr=-.53:v?sr=15:y?sr=-.7:k&&(sr=-1/3);function sl(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function zf(e){var t=sl(e);return t.x*=sr,t.y*=sr,t}function ul(e,t){y&&c==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=sl(t),r=n.x,i=n.y,a=sr;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,a=1);var l=e.display,u=l.scroller,f=u.scrollWidth>u.clientWidth,m=u.scrollHeight>u.clientHeight;if(r&&f||i&&m){if(i&&N&&g){e:for(var A=t.target,j=l.view;A!=u;A=A.parentNode)for(var ee=0;ee=0&&ye(e,r.to())<=0)return n}return-1};var Ye=function(e,t){this.anchor=e,this.head=t};Ye.prototype.from=function(){return Zr(this.anchor,this.head)},Ye.prototype.to=function(){return Et(this.anchor,this.head)},Ye.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Yt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(ee,Y){return ye(ee.from(),Y.from())}),n=Se(t,i);for(var a=1;a0:f>=0){var m=Zr(u.from(),l.from()),A=Et(u.to(),l.to()),j=u.empty()?l.from()==l.head:u.from()==u.head;a<=n&&--n,t.splice(--a,2,new Ye(j?A:m,j?m:A))}}return new Rt(t,n)}function yr(e,t){return new Rt([new Ye(e,t||e)],0)}function xr(e){return e.text?ne(e.from.line+e.text.length-1,ce(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function cl(e,t){if(ye(e,t.from)<0)return e;if(ye(e,t.to)<=0)return xr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=xr(t).ch-t.to.ch),ne(n,r)}function Do(e,t){for(var n=[],r=0;r1&&e.remove(u.line+1,ie-1),e.insert(u.line+1,ve)}ht(e,"change",e,t)}function _r(e,t,n){function r(i,a,l){if(i.linked)for(var u=0;u1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ce(e.done)}function ml(e,t,n,r){var i=e.history;i.undone.length=0;var a=+new Date,l,u;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=Df(i,i.lastOp==r)))u=ce(l.changes),ye(t.from,t.to)==0&&ye(t.from,u.to)==0?u.to=xr(t):l.changes.push(Io(e,t));else{var f=ce(i.done);for((!f||!f.ranges)&&xi(e.sel,i.done),l={changes:[Io(e,t)],generation:i.generation},i.done.push(l);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,u||it(e,"historyAdded")}function qf(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ff(e,t,n,r){var i=e.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||qf(e,a,ce(i.done),t))?i.done[i.done.length-1]=t:xi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&r.clearRedo!==!1&&gl(i.undone)}function xi(e,t){var n=ce(t);n&&n.ranges&&n.equals(e)||t.push(e)}function vl(e,t,n,r){var i=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(l){l.markedSpans&&((i||(i=t["spans_"+e.id]={}))[a]=l.markedSpans),++a})}function If(e){if(!e)return null;for(var t,n=0;n-1&&(ce(u)[j]=m[j],delete m[j])}}return r}function No(e,t,n,r){if(r){var i=e.anchor;if(n){var a=ye(t,i)<0;a!=ye(n,i)<0?(i=t,t=n):a!=ye(t,n)<0&&(t=n)}return new Ye(i,t)}else return new Ye(n||t,t)}function _i(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),wt(e,new Rt([No(e.sel.primary(),t,n,i)],0),r)}function yl(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a=t.ch:u.to>t.ch))){if(i&&(it(f,"beforeCursorEnter"),f.explicitlyCleared))if(a.markedSpans){--l;continue}else break;if(!f.atomic)continue;if(n){var j=f.find(r<0?1:-1),ee=void 0;if((r<0?A:m)&&(j=Tl(e,j,-r,j&&j.line==t.line?a:null)),j&&j.line==t.line&&(ee=ye(j,n))&&(r<0?ee<0:ee>0))return on(e,j,t,r,i)}var Y=f.find(r<0?-1:1);return(r<0?m:A)&&(Y=Tl(e,Y,r,Y.line==t.line?a:null)),Y?on(e,Y,t,r,i):null}}return t}function wi(e,t,n,r,i){var a=r||1,l=on(e,t,n,a,i)||!i&&on(e,t,n,a,!0)||on(e,t,n,-a,i)||!i&&on(e,t,n,-a,!0);return l||(e.cantEdit=!0,ne(e.first,0))}function Tl(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?Re(e,ne(t.line-1)):null:n>0&&t.ch==(r||Ae(e,t.line)).text.length?t.line=0;--i)El(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else El(e,t)}}function El(e,t){if(!(t.text.length==1&&t.text[0]==""&&ye(t.from,t.to)==0)){var n=Do(e,t);ml(e,t,n,e.cm?e.cm.curOp.id:NaN),On(e,t,n,io(e,t));var r=[];_r(e,function(i,a){!a&&Se(r,i.history)==-1&&(Dl(i.history,t),r.push(i.history)),On(i,t,null,io(i,t))})}}function Si(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,a,l=e.sel,u=t=="undo"?i.done:i.undone,f=t=="undo"?i.undone:i.done,m=0;m=0;--Y){var ie=ee(Y);if(ie)return ie.v}}}}function zl(e,t){if(t!=0&&(e.first+=t,e.sel=new Rt(Be(e.sel.ranges,function(i){return new Ye(ne(i.anchor.line+t,i.anchor.ch),ne(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){zt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.linea&&(t={from:t.from,to:ne(a,Ae(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ir(e,t.from,t.to),n||(n=Do(e,t)),e.cm?Pf(e.cm,t,r):Fo(e,t,r),ki(e,n,ke),e.cantEdit&&wi(e,ne(e.firstLine(),0))&&(e.cantEdit=!1)}}function Pf(e,t,n){var r=e.doc,i=e.display,a=t.from,l=t.to,u=!1,f=a.line;e.options.lineWrapping||(f=_(Zt(Ae(r,a.line))),r.iter(f,l.line+1,function(Y){if(Y==i.maxLine)return u=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ht(e),Fo(r,t,n,Za(e)),e.options.lineWrapping||(r.iter(f,a.line+t.text.length,function(Y){var ie=li(Y);ie>i.maxLineLength&&(i.maxLine=Y,i.maxLineLength=ie,i.maxLineChanged=!0,u=!1)}),u&&(e.curOp.updateMaxLine=!0)),Lc(r,a.line),Fn(e,400);var m=t.text.length-(l.line-a.line)-1;t.full?zt(e):a.line==l.line&&t.text.length==1&&!dl(e.doc,t)?vr(e,a.line,"text"):zt(e,a.line,l.line+1,m);var A=It(e,"changes"),j=It(e,"change");if(j||A){var ee={from:a,to:l,text:t.text,removed:t.removed,origin:t.origin};j&&ht(e,"change",e,ee),A&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ee)}e.display.selForContextMenu=null}function ln(e,t,n,r,i){var a;r||(r=n),ye(r,n)<0&&(a=[r,n],n=a[0],r=a[1]),typeof t=="string"&&(t=e.splitLines(t)),an(e,{from:n,to:r,text:t,origin:i})}function Ml(e,t,n,r){n1||!(this.children[0]instanceof jn))){var u=[];this.collapse(u),this.children=[new jn(u)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=i.lines.length%25+25,u=l;u10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=A,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&zt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&wl(e.doc)),e&&ht(e,"markerCleared",e,this,r,i),t&&Ir(e),this.parent&&this.parent.clear()}},kr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i0||l==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=K("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Sa(e,t.line,t,n,a)||t.line!=n.line&&Sa(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ec()}a.addToHistory&&ml(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var u=t.line,f=e.cm,m;if(e.iter(u,n.line+1,function(j){f&&a.collapsed&&!f.options.lineWrapping&&Zt(j)==f.display.maxLine&&(m=!0),a.collapsed&&u!=t.line&&jt(j,0),Mc(j,new ni(a,u==t.line?t.ch:null,u==n.line?n.ch:null),e.cm&&e.cm.curOp),++u}),a.collapsed&&e.iter(t.line,n.line+1,function(j){mr(e,j)&&jt(j,0)}),a.clearOnEnter&&Ie(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(Cc(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++Fl,a.atomic=!0),f){if(m&&(f.curOp.updateMaxLine=!0),a.collapsed)zt(f,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var A=t.line;A<=n.line;A++)vr(f,A,"text");a.atomic&&wl(f.doc),ht(f,"markerAdded",f,a)}return a}var Bn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;f--)an(this,r[f]);u?_l(this,u):this.cm&&tn(this.cm)}),undo:mt(function(){Si(this,"undo")}),redo:mt(function(){Si(this,"redo")}),undoSelection:mt(function(){Si(this,"undo",!0)}),redoSelection:mt(function(){Si(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Re(this,e),t=Re(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var l=a.markedSpans;if(l)for(var u=0;u=f.to||f.from==null&&i!=e.line||f.from!=null&&i==t.line&&f.from>=t.ch)&&(!n||n(f.marker))&&r.push(f.marker.parent||f.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=a,++n}),Re(this,ne(n,t))},indexFromPos:function(e){e=Re(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var A=e.dataTransfer.getData("Text");if(A){var j;if(t.state.draggingText&&!t.state.draggingText.copy&&(j=t.listSelections()),ki(t.doc,yr(n,n)),j)for(var ee=0;ee=0;u--)ln(e.doc,"",r[u].from,r[u].to,"+delete");tn(e)})}function Po(e,t,n){var r=se(e.text,t+n,n);return r<0||r>e.text.length?null:r}function jo(e,t,n){var r=Po(e,t.ch,n);return r==null?null:new ne(t.line,r,n<0?"after":"before")}function Ro(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var a=Pe(n,t.doc.direction);if(a){var l=i<0?ce(a):a[0],u=i<0==(l.level==1),f=u?"after":"before",m;if(l.level>0||t.doc.direction=="rtl"){var A=Qr(t,n);m=i<0?n.text.length-1:0;var j=tr(t,A,m).top;m=De(function(ee){return tr(t,A,ee).top==j},i<0==(l.level==1)?l.from:l.to-1,m),f=="before"&&(m=Po(n,m,1))}else m=i<0?l.to:l.from;return new ne(r,m,f)}}return new ne(r,i<0?n.text.length:0,i<0?"before":"after")}function Vf(e,t,n,r){var i=Pe(t,e.doc.direction);if(!i)return jo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=Pt(i,n.ch,n.sticky),l=i[a];if(e.doc.direction=="ltr"&&l.level%2==0&&(r>0?l.to>n.ch:l.from=l.from&&ee>=A.begin)){var Y=j?"before":"after";return new ne(n.line,ee,Y)}}var ie=function(ve,_e,be){for(var Ce=function(Ve,vt){return vt?new ne(n.line,u(Ve,1),"before"):new ne(n.line,Ve,"after")};ve>=0&&ve0==(Ne.level!=1),$e=Fe?be.begin:u(be.end,-1);if(Ne.from<=$e&&$e0?A.end:u(A.begin,-1);return me!=null&&!(r>0&&me==t.text.length)&&(ue=ie(r>0?0:i.length-1,r,m(me)),ue)?ue:null}var $n={selectAll:Ll,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ke)},killLine:function(e){return cn(e,function(t){if(t.empty()){var n=Ae(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new ne(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),ne(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Ae(e.doc,i.line-1).text;l&&(i=new ne(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),ne(i.line-1,l.length-1),i,"+transpose"))}}n.push(new Ye(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Nt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;re&&ye(t,this.pos)==0&&n==this.button};var Gn,Zn;function od(e,t){var n=+new Date;return Zn&&Zn.compare(n,e,t)?(Gn=Zn=null,"triple"):Gn&&Gn.compare(n,e,t)?(Zn=new Bo(n,e,t),Gn=null,"double"):(Gn=new Bo(n,e,t),Zn=null,"single")}function Yl(e){var t=this,n=t.display;if(!(ot(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,lr(n,e)){g||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Wo(t,e)){var r=Mr(t,e),i=Ut(e),a=r?od(r,i):"single";pe(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&ad(t,i,r,a,e))&&(i==1?r?sd(t,r,a,e):yn(e)==n.scroller&&kt(e):i==2?(r&&_i(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(O?t.display.input.onContextMenu(e):wo(t)))}}}function ad(e,t,n,r,i){var a="Click";return r=="double"?a="Double"+a:r=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,Kn(e,Hl(a,i),i,function(l){if(typeof l=="string"&&(l=$n[l]),!l)return!1;var u=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),u=l(e,n)!=Ze}finally{e.state.suppressEdits=!1}return u})}function ld(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var a=G?n.shiftKey&&n.metaKey:n.altKey;i.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=N?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(N?n.altKey:n.ctrlKey)),i}function sd(e,t,n,r){s?setTimeout(Ee(Qa,e),0):e.curOp.focus=H(de(e));var i=ld(e,n,r),a=e.doc.sel,l;e.options.dragDrop&&eo&&!e.isReadOnly()&&n=="single"&&(l=a.contains(t))>-1&&(ye((l=a.ranges[l]).from(),t)<0||t.xRel>0)&&(ye(l.to(),t)>0||t.xRel<0)?ud(e,r,t,i):cd(e,r,t,i)}function ud(e,t,n,r){var i=e.display,a=!1,l=gt(e,function(m){g&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:wo(e)),_t(i.wrapper.ownerDocument,"mouseup",l),_t(i.wrapper.ownerDocument,"mousemove",u),_t(i.scroller,"dragstart",f),_t(i.scroller,"drop",l),a||(kt(m),r.addNew||_i(e.doc,n,null,null,r.extend),g&&!k||s&&h==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),u=function(m){a=a||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},f=function(){return a=!0};g&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,Ie(i.wrapper.ownerDocument,"mouseup",l),Ie(i.wrapper.ownerDocument,"mousemove",u),Ie(i.scroller,"dragstart",f),Ie(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ql(e,t,n){if(n=="char")return new Ye(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Ye(ne(t.line,0),Re(e.doc,ne(t.line+1,0)));var r=n(e,t);return new Ye(r.from,r.to)}function cd(e,t,n,r){s&&wo(e);var i=e.display,a=e.doc;kt(t);var l,u,f=a.sel,m=f.ranges;if(r.addNew&&!r.extend?(u=a.sel.contains(n),u>-1?l=m[u]:l=new Ye(n,n)):(l=a.sel.primary(),u=a.sel.primIndex),r.unit=="rectangle")r.addNew||(l=new Ye(n,n)),n=Mr(e,t,!0,!0),u=-1;else{var A=Ql(e,n,r.unit);r.extend?l=No(l,A.anchor,A.head,r.extend):l=A}r.addNew?u==-1?(u=m.length,wt(a,Yt(e,m.concat([l]),u),{scroll:!1,origin:"*mouse"})):m.length>1&&m[u].empty()&&r.unit=="char"&&!r.extend?(wt(a,Yt(e,m.slice(0,u).concat(m.slice(u+1)),0),{scroll:!1,origin:"*mouse"}),f=a.sel):Oo(a,u,l,Je):(u=0,wt(a,new Rt([l],0),Je),f=a.sel);var j=n;function ee(be){if(ye(j,be)!=0)if(j=be,r.unit=="rectangle"){for(var Ce=[],Ne=e.options.tabSize,Fe=Oe(Ae(a,n.line).text,n.ch,Ne),$e=Oe(Ae(a,be.line).text,be.ch,Ne),Ve=Math.min(Fe,$e),vt=Math.max(Fe,$e),rt=Math.min(n.line,be.line),Ot=Math.min(e.lastLine(),Math.max(n.line,be.line));rt<=Ot;rt++){var At=Ae(a,rt).text,ut=Ge(At,Ve,Ne);Ve==vt?Ce.push(new Ye(ne(rt,ut),ne(rt,ut))):At.length>ut&&Ce.push(new Ye(ne(rt,ut),ne(rt,Ge(At,vt,Ne))))}Ce.length||Ce.push(new Ye(n,n)),wt(a,Yt(e,f.ranges.slice(0,u).concat(Ce),u),{origin:"*mouse",scroll:!1}),e.scrollIntoView(be)}else{var Dt=l,yt=Ql(e,be,r.unit),ft=Dt.anchor,ct;ye(yt.anchor,ft)>0?(ct=yt.head,ft=Zr(Dt.from(),yt.anchor)):(ct=yt.anchor,ft=Et(Dt.to(),yt.head));var lt=f.ranges.slice(0);lt[u]=fd(e,new Ye(Re(a,ft),ct)),wt(a,Yt(e,lt,u),Je)}}var Y=i.wrapper.getBoundingClientRect(),ie=0;function ue(be){var Ce=++ie,Ne=Mr(e,be,!0,r.unit=="rectangle");if(Ne)if(ye(Ne,j)!=0){e.curOp.focus=H(de(e)),ee(Ne);var Fe=gi(i,a);(Ne.line>=Fe.to||Ne.lineY.bottom?20:0;$e&&setTimeout(gt(e,function(){ie==Ce&&(i.scroller.scrollTop+=$e,ue(be))}),50)}}function me(be){e.state.selectingText=!1,ie=1/0,be&&(kt(be),i.input.focus()),_t(i.wrapper.ownerDocument,"mousemove",ve),_t(i.wrapper.ownerDocument,"mouseup",_e),a.history.lastSelOrigin=null}var ve=gt(e,function(be){be.buttons===0||!Ut(be)?me(be):ue(be)}),_e=gt(e,me);e.state.selectingText=_e,Ie(i.wrapper.ownerDocument,"mousemove",ve),Ie(i.wrapper.ownerDocument,"mouseup",_e)}function fd(e,t){var n=t.anchor,r=t.head,i=Ae(e.doc,n.line);if(ye(n,r)==0&&n.sticky==r.sticky)return t;var a=Pe(i);if(!a)return t;var l=Pt(a,n.ch,n.sticky),u=a[l];if(u.from!=n.ch&&u.to!=n.ch)return t;var f=l+(u.from==n.ch==(u.level!=1)?0:1);if(f==0||f==a.length)return t;var m;if(r.line!=n.line)m=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var A=Pt(a,r.ch,r.sticky),j=A-l||(r.ch-n.ch)*(u.level==1?-1:1);A==f-1||A==f?m=j<0:m=j>0}var ee=a[f+(m?-1:0)],Y=m==(ee.level==1),ie=Y?ee.from:ee.to,ue=Y?"after":"before";return n.ch==ie&&n.sticky==ue?t:new Ye(new ne(n.line,ie,ue),r)}function Vl(e,t,n,r){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&kt(t);var l=e.display,u=l.lineDiv.getBoundingClientRect();if(a>u.bottom||!It(e,n))return Ct(t);a-=u.top-l.viewOffset;for(var f=0;f=i){var A=P(e.doc,a),j=e.display.gutterSpecs[f];return it(e,n,e,A,j.className,t),Ct(t)}}}function Wo(e,t){return Vl(e,t,"gutterClick",!0)}function Jl(e,t){lr(e.display,t)||dd(e,t)||ot(e,t,"contextmenu")||O||e.display.input.onContextMenu(t)}function dd(e,t){return It(e,"gutterContextMenu")?Vl(e,t,"gutterContextMenu",!1):!1}function es(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),En(e)}var fn={toString:function(){return"CodeMirror.Init"}},ts={},Ei={};function pd(e){var t=e.optionHandlers;function n(r,i,a,l){e.defaults[r]=i,a&&(t[r]=l?function(u,f,m){m!=fn&&a(u,f,m)}:a)}e.defineOption=n,e.Init=fn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,qo(r)},!0),n("indentUnit",2,qo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Nn(r),En(r),zt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var a=[],l=r.doc.first;r.doc.iter(function(f){for(var m=0;;){var A=f.text.indexOf(i,m);if(A==-1)break;m=A+i.length,a.push(ne(l,A))}l++});for(var u=a.length-1;u>=0;u--)ln(r.doc,i,a[u],ne(a[u].line,a[u].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,a){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),a!=fn&&r.refresh()}),n("specialCharPlaceholder",Hc,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",E?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!J),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){es(r),In(r)},!0),n("keyMap","default",function(r,i,a){var l=Li(i),u=a!=fn&&Li(a);u&&u.detach&&u.detach(r,l),l.attach&&l.attach(r,u||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,gd,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Ao(i,r.options.lineNumbers),In(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?yo(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return rn(r)},!0),n("scrollbarStyle","native",function(r){nl(r),rn(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Ao(r.options.gutters,i),In(r)},!0),n("firstLineNumber",1,In,!0),n("lineNumberFormatter",function(r){return r},In,!0),n("showCursorWhenSelecting",!1,zn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(en(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,hd),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,zn,!0),n("singleCursorHeightPerLine",!0,zn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Nn,!0),n("addModeClass",!1,Nn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Nn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function hd(e,t,n){var r=n&&n!=fn;if(!t!=!r){var i=e.display.dragFunctions,a=t?Ie:_t;a(e.display.scroller,"dragstart",i.start),a(e.display.scroller,"dragenter",i.enter),a(e.display.scroller,"dragover",i.over),a(e.display.scroller,"dragleave",i.leave),a(e.display.scroller,"drop",i.drop)}}function gd(e){e.options.lineWrapping?(le(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Q(e.display.wrapper,"CodeMirror-wrap"),so(e)),xo(e),zt(e),En(e),setTimeout(function(){return rn(e)},100)}function tt(e,t){var n=this;if(!(this instanceof tt))return new tt(e,t);this.options=t=t?ge(t):{},ge(ts,t,!1);var r=t.value;typeof r=="string"?r=new Mt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new tt.inputStyles[t.inputStyle](this),a=this.display=new Ef(e,r,i,t);a.wrapper.CodeMirror=this,es(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),nl(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new qe,keySeq:null,specialChars:null},t.autofocus&&!E&&a.input.focus(),s&&h<11&&setTimeout(function(){return n.display.input.reset(!0)},20),md(this),Gf(),Fr(this),this.curOp.forceUpdate=!0,pl(this,r),t.autofocus&&!E||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&So(n)},20):en(this);for(var l in Ei)Ei.hasOwnProperty(l)&&Ei[l](this,t[l],fn);al(this),t.finishInit&&t.finishInit(this);for(var u=0;u20*20}Ie(t.scroller,"touchstart",function(f){if(!ot(e,f)&&!a(f)&&!Wo(e,f)){t.input.ensurePolled(),clearTimeout(n);var m=+new Date;t.activeTouch={start:m,moved:!1,prev:m-r.end<=300?r:null},f.touches.length==1&&(t.activeTouch.left=f.touches[0].pageX,t.activeTouch.top=f.touches[0].pageY)}}),Ie(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ie(t.scroller,"touchend",function(f){var m=t.activeTouch;if(m&&!lr(t,f)&&m.left!=null&&!m.moved&&new Date-m.start<300){var A=e.coordsChar(t.activeTouch,"page"),j;!m.prev||l(m,m.prev)?j=new Ye(A,A):!m.prev.prev||l(m,m.prev.prev)?j=e.findWordAt(A):j=new Ye(ne(A.line,0),Re(e.doc,ne(A.line+1,0))),e.setSelection(j.anchor,j.head),e.focus(),kt(f)}i()}),Ie(t.scroller,"touchcancel",i),Ie(t.scroller,"scroll",function(){t.scroller.clientHeight&&(An(e,t.scroller.scrollTop),Dr(e,t.scroller.scrollLeft,!0),it(e,"scroll",e))}),Ie(t.scroller,"mousewheel",function(f){return ul(e,f)}),Ie(t.scroller,"DOMMouseScroll",function(f){return ul(e,f)}),Ie(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(f){ot(e,f)||dr(f)},over:function(f){ot(e,f)||(Kf(e,f),dr(f))},start:function(f){return $f(e,f)},drop:gt(e,Uf),leave:function(f){ot(e,f)||Ol(e)}};var u=t.input.getField();Ie(u,"keyup",function(f){return Zl.call(e,f)}),Ie(u,"keydown",gt(e,Gl)),Ie(u,"keypress",gt(e,Xl)),Ie(u,"focus",function(f){return So(e,f)}),Ie(u,"blur",function(f){return en(e,f)})}var Uo=[];tt.defineInitHook=function(e){return Uo.push(e)};function Xn(e,t,n,r){var i=e.doc,a;n==null&&(n="add"),n=="smart"&&(i.mode.indent?a=wn(e,t).state:n="prev");var l=e.options.tabSize,u=Ae(i,t),f=Oe(u.text,null,l);u.stateAfter&&(u.stateAfter=null);var m=u.text.match(/^\s*/)[0],A;if(!r&&!/\S/.test(u.text))A=0,n="not";else if(n=="smart"&&(A=i.mode.indent(a,u.text.slice(m.length),u.text),A==Ze||A>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?A=Oe(Ae(i,t-1).text,null,l):A=0:n=="add"?A=f+e.options.indentUnit:n=="subtract"?A=f-e.options.indentUnit:typeof n=="number"&&(A=f+n),A=Math.max(0,A);var j="",ee=0;if(e.options.indentWithTabs)for(var Y=Math.floor(A/l);Y;--Y)ee+=l,j+=" ";if(eel,f=Bt(t),m=null;if(u&&r.ranges.length>1)if(Qt&&Qt.text.join(` +`)==t){if(r.ranges.length%Qt.text.length==0){m=[];for(var A=0;A=0;ee--){var Y=r.ranges[ee],ie=Y.from(),ue=Y.to();Y.empty()&&(n&&n>0?ie=ne(ie.line,ie.ch-n):e.state.overwrite&&!u?ue=ne(ue.line,Math.min(Ae(a,ue.line).text.length,ue.ch+ce(f).length)):u&&Qt&&Qt.lineWise&&Qt.text.join(` +`)==f.join(` +`)&&(ie=ue=ne(ie.line,0)));var me={from:ie,to:ue,text:m?m[ee%m.length]:f,origin:i||(u?"paste":e.state.cutIncoming>l?"cut":"+input")};an(e.doc,me),ht(e,"inputRead",e,me)}t&&!u&&ns(e,t),tn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=j),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function rs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Nt(t,function(){return $o(t,n,0,null,"paste")}),!0}function ns(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),l=!1;if(a.electricChars){for(var u=0;u-1){l=Xn(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Ae(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Xn(e,i.head.line,"smart"));l&&ht(e,"electricInput",e,i.head.line)}}}function is(e){for(var t=[],n=[],r=0;ra&&(Xn(this,u.head.line,r,!0),a=u.head.line,l==this.doc.sel.primIndex&&tn(this));else{var f=u.from(),m=u.to(),A=Math.max(a,f.line);a=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var j=A;j0&&Oo(this.doc,l,new Ye(f,ee[l].to()),ke)}}}),getTokenAt:function(r,i){return ga(this,r,i)},getLineTokens:function(r,i){return ga(this,ne(r),i,!0)},getTokenTypeAt:function(r){r=Re(this.doc,r);var i=da(this,Ae(this.doc,r.line)),a=0,l=(i.length-1)/2,u=r.ch,f;if(u==0)f=i[2];else for(;;){var m=a+l>>1;if((m?i[m*2-1]:0)>=u)l=m;else if(i[m*2+1]f&&(r=f,l=!0),u=Ae(this.doc,r)}else u=r;return ci(this,u,{top:0,left:0},i||"page",a||l).top+(l?this.doc.height-ar(u):0)},defaultTextHeight:function(){return Vr(this.display)},defaultCharWidth:function(){return Jr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,a,l,u){var f=this.display;r=Xt(this,Re(this.doc,r));var m=r.bottom,A=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),f.sizer.appendChild(i),l=="over")m=r.top;else if(l=="above"||l=="near"){var j=Math.max(f.wrapper.clientHeight,this.doc.height),ee=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);(l=="above"||r.bottom+i.offsetHeight>j)&&r.top>i.offsetHeight?m=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=j&&(m=r.bottom),A+i.offsetWidth>ee&&(A=ee-i.offsetWidth)}i.style.top=m+"px",i.style.left=i.style.right="",u=="right"?(A=f.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(u=="left"?A=0:u=="middle"&&(A=(f.sizer.clientWidth-i.offsetWidth)/2),i.style.left=A+"px"),a&&hf(this,{left:A,top:m,right:A+i.offsetWidth,bottom:m+i.offsetHeight})},triggerOnKeyDown:Tt(Gl),triggerOnKeyPress:Tt(Xl),triggerOnKeyUp:Zl,triggerOnMouseDown:Tt(Yl),execCommand:function(r){if($n.hasOwnProperty(r))return $n[r].call(null,this)},triggerElectric:Tt(function(r){ns(this,r)}),findPosH:function(r,i,a,l){var u=1;i<0&&(u=-1,i=-i);for(var f=Re(this.doc,r),m=0;m0&&A(a.charAt(l-1));)--l;for(;u.5||this.options.lineWrapping)&&xo(this),it(this,"refresh",this)}),swapDoc:Tt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),pl(this,r),En(this),this.display.input.reset(),Mn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,ht(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Wt(e),e.registerHelper=function(r,i,a){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=a},e.registerGlobalHelper=function(r,i,a,l){e.registerHelper(r,i,l),n[r]._global.push({pred:a,val:l})}}function Go(e,t,n,r,i){var a=t,l=n,u=Ae(e,t.line),f=i&&e.direction=="rtl"?-n:n;function m(){var _e=t.line+f;return _e=e.first+e.size?!1:(t=new ne(_e,t.ch,t.sticky),u=Ae(e,_e))}function A(_e){var be;if(r=="codepoint"){var Ce=u.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(Ce))be=null;else{var Ne=n>0?Ce>=55296&&Ce<56320:Ce>=56320&&Ce<57343;be=new ne(t.line,Math.max(0,Math.min(u.text.length,t.ch+n*(Ne?2:1))),-n)}}else i?be=Vf(e.cm,u,t,n):be=jo(u,t,n);if(be==null)if(!_e&&m())t=Ro(i,e.cm,u,t.line,f);else return!1;else t=be;return!0}if(r=="char"||r=="codepoint")A();else if(r=="column")A(!0);else if(r=="word"||r=="group")for(var j=null,ee=r=="group",Y=e.cm&&e.cm.getHelper(t,"wordChars"),ie=!0;!(n<0&&!A(!ie));ie=!1){var ue=u.text.charAt(t.ch)||` +`,me=Me(ue,Y)?"w":ee&&ue==` +`?"n":!ee||/\s/.test(ue)?null:"p";if(ee&&!ie&&!me&&(me="s"),j&&j!=me){n<0&&(n=1,A(),t.sticky="after");break}if(me&&(j=me),n>0&&!A(!ie))break}var ve=wi(e,t,a,l,!0);return Xe(a,ve)&&(ve.hitSide=!0),ve}function as(e,t,n,r){var i=e.doc,a=t.left,l;if(r=="page"){var u=Math.min(e.display.wrapper.clientHeight,pe(e).innerHeight||i(e).documentElement.clientHeight),f=Math.max(u-.5*Vr(e.display),3);l=(n>0?t.bottom:t.top)+n*f}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var m;m=mo(e,a,l),!!m.outside;){if(n<0?l<=0:l>=i.height){m.hitSide=!0;break}l+=n*5}return m}var Qe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new qe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Qe.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,Ko(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(u){for(var f=u.target;f;f=f.parentNode){if(f==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(f.className))break}return!1}Ie(i,"paste",function(u){!a(u)||ot(r,u)||rs(u,r)||h<=11&&setTimeout(gt(r,function(){return t.updateFromDOM()}),20)}),Ie(i,"compositionstart",function(u){t.composing={data:u.data,done:!1}}),Ie(i,"compositionupdate",function(u){t.composing||(t.composing={data:u.data,done:!1})}),Ie(i,"compositionend",function(u){t.composing&&(u.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ie(i,"touchstart",function(){return n.forceCompositionEnd()}),Ie(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(u){if(!(!a(u)||ot(r,u))){if(r.somethingSelected())zi({lineWise:!1,text:r.getSelections()}),u.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var f=is(r);zi({lineWise:!0,text:f.text}),u.type=="cut"&&r.operation(function(){r.setSelections(f.ranges,0,ke),r.replaceSelection("",null,"cut")})}else return;if(u.clipboardData){u.clipboardData.clearData();var m=Qt.text.join(` +`);if(u.clipboardData.setData("Text",m),u.clipboardData.getData("Text")==m){u.preventDefault();return}}var A=os(),j=A.firstChild;Ko(j),r.display.lineSpace.insertBefore(A,r.display.lineSpace.firstChild),j.value=Qt.text.join(` +`);var ee=H(ze(i));F(j),setTimeout(function(){r.display.lineSpace.removeChild(A),ee.focus(),ee==i&&n.showPrimarySelection()},50)}}Ie(i,"copy",l),Ie(i,"cut",l)},Qe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Qe.prototype.prepareSelection=function(){var e=Ya(this.cm,!1);return e.focus=H(ze(this.div))==this.div,e},Qe.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Qe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qe.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line=t.display.viewFrom&&ls(t,r)||{node:u[0].measure.map[2],offset:0},m=i.linee.firstLine()&&(r=ne(r.line-1,Ae(e.doc,r.line-1).length)),i.ch==Ae(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var a,l,u;r.line==t.viewFrom||(a=Ar(e,r.line))==0?(l=_(t.view[0].line),u=t.view[0].node):(l=_(t.view[a].line),u=t.view[a-1].node.nextSibling);var f=Ar(e,i.line),m,A;if(f==t.view.length-1?(m=t.viewTo-1,A=t.lineDiv.lastChild):(m=_(t.view[f+1].line)-1,A=t.view[f+1].node.previousSibling),!u)return!1;for(var j=e.doc.splitLines(yd(e,u,A,l,m)),ee=ir(e.doc,ne(l,0),ne(m,Ae(e.doc,m).text.length));j.length>1&&ee.length>1;)if(ce(j)==ce(ee))j.pop(),ee.pop(),m--;else if(j[0]==ee[0])j.shift(),ee.shift(),l++;else break;for(var Y=0,ie=0,ue=j[0],me=ee[0],ve=Math.min(ue.length,me.length);Yr.ch&&_e.charCodeAt(_e.length-ie-1)==be.charCodeAt(be.length-ie-1);)Y--,ie++;j[j.length-1]=_e.slice(0,_e.length-ie).replace(/^\u200b+/,""),j[0]=j[0].slice(Y).replace(/\u200b+$/,"");var Ne=ne(l,Y),Fe=ne(m,ee.length?ce(ee).length-ie:0);if(j.length>1||j[0]||ye(Ne,Fe))return ln(e.doc,j,Ne,Fe,"+input"),!0},Qe.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qe.prototype.reset=function(){this.forceCompositionEnd()},Qe.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Qe.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},Qe.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Nt(this.cm,function(){return zt(e.cm)})},Qe.prototype.setUneditable=function(e){e.contentEditable="false"},Qe.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||gt(this.cm,$o)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Qe.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Qe.prototype.onContextMenu=function(){},Qe.prototype.resetPosition=function(){},Qe.prototype.needsContentAttribute=!0;function ls(e,t){var n=po(e,t.line);if(!n||n.hidden)return null;var r=Ae(e.doc,t.line),i=Na(n,r,t.line),a=Pe(r,e.doc.direction),l="left";if(a){var u=Pt(a,t.ch);l=u%2?"right":"left"}var f=ja(i.map,t.ch,l);return f.offset=f.collapse=="right"?f.end:f.start,f}function bd(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function dn(e,t){return t&&(e.bad=!0),e}function yd(e,t,n,r,i){var a="",l=!1,u=e.doc.lineSeparator(),f=!1;function m(Y){return function(ie){return ie.id==Y}}function A(){l&&(a+=u,f&&(a+=u),l=f=!1)}function j(Y){Y&&(A(),a+=Y)}function ee(Y){if(Y.nodeType==1){var ie=Y.getAttribute("cm-text");if(ie){j(ie);return}var ue=Y.getAttribute("cm-marker"),me;if(ue){var ve=e.findMarks(ne(r,0),ne(i+1,0),m(+ue));ve.length&&(me=ve[0].find(0))&&j(ir(e.doc,me.from,me.to).join(u));return}if(Y.getAttribute("contenteditable")=="false")return;var _e=/^(pre|div|p|li|table|br)$/i.test(Y.nodeName);if(!/^br$/i.test(Y.nodeName)&&Y.textContent.length==0)return;_e&&A();for(var be=0;be=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Ie(i,"paste",function(l){ot(r,l)||rs(l,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function a(l){if(!ot(r,l)){if(r.somethingSelected())zi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var u=is(r);zi({lineWise:!0,text:u.text}),l.type=="cut"?r.setSelections(u.ranges,null,ke):(n.prevInput="",i.value=u.text.join(` +`),F(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}Ie(i,"cut",a),Ie(i,"copy",a),Ie(e.scroller,"paste",function(l){if(!(lr(e,l)||ot(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var u=new Event("paste");u.clipboardData=l.clipboardData,i.dispatchEvent(u)}}),Ie(e.lineSpace,"selectstart",function(l){lr(e,l)||kt(l)}),Ie(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ie(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},st.prototype.createField=function(e){this.wrapper=os(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Ko(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},st.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},st.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Ya(e);if(e.options.moveInputWithCursor){var i=Xt(e,n.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-a.left))}return r},st.prototype.showSelection=function(e){var t=this.cm,n=t.display;V(n.cursorDiv,e.cursors),V(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},st.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&F(this.textarea),s&&h>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&h>=9&&(this.hasSelection=null));this.resetting=!1}},st.prototype.getField=function(){return this.textarea},st.prototype.supportsTouch=function(){return!1},st.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!E||H(ze(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},st.prototype.blur=function(){this.textarea.blur()},st.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},st.prototype.receivedFocus=function(){this.slowPoll()},st.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},st.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},st.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||hr(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&h>=9&&this.hasSelection===i||N&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r="\u200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l1e3||i.indexOf(` +`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},st.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},st.prototype.onKeyPress=function(){s&&h>=9&&(this.hasSelection=null),this.fastPoll()},st.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Mr(n,e),l=r.scroller.scrollTop;if(!a||d)return;var u=n.options.resetSelectionOnContextMenu;u&&n.doc.sel.contains(a)==-1&>(n,wt)(n.doc,yr(a),ke);var f=i.style.cssText,m=t.wrapper.style.cssText,A=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; + top: `+(e.clientY-A.top-5)+"px; left: "+(e.clientX-A.left-5)+`px; + z-index: 1000; background: `+(s?"rgba(255, 255, 255, .05)":"transparent")+`; + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var j;g&&(j=i.ownerDocument.defaultView.scrollY),r.input.focus(),g&&i.ownerDocument.defaultView.scrollTo(null,j),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=Y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function ee(){if(i.selectionStart!=null){var ue=n.somethingSelected(),me="\u200B"+(ue?i.value:"");i.value="\u21DA",i.value=me,t.prevInput=ue?"":"\u200B",i.selectionStart=1,i.selectionEnd=me.length,r.selForContextMenu=n.doc.sel}}function Y(){if(t.contextMenuPending==Y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,i.style.cssText=f,s&&h<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!s||s&&h<9)&&ee();var ue=0,me=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?gt(n,Ll)(n):ue++<10?r.detectingSelectAll=setTimeout(me,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(me,200)}}if(s&&h>=9&&ee(),O){dr(e);var ie=function(){_t(window,"mouseup",ie),setTimeout(Y,20)};Ie(window,"mouseup",ie)}else setTimeout(Y,50)},st.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},st.prototype.setUneditable=function(){},st.prototype.needsContentAttribute=!1;function _d(e,t){if(t=t?ge(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=H(ze(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=u.getValue()}var i;if(e.form&&(Ie(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var l=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=l}}catch{}}t.finishInit=function(f){f.save=r,f.getTextArea=function(){return e},f.toTextArea=function(){f.toTextArea=isNaN,r(),e.parentNode.removeChild(f.getWrapperElement()),e.style.display="",e.form&&(_t(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var u=tt(function(f){return e.parentNode.insertBefore(f,e.nextSibling)},t);return u}function kd(e){e.off=_t,e.on=Ie,e.wheelEventPixels=zf,e.Doc=Mt,e.splitLines=Bt,e.countColumn=Oe,e.findColumn=Ge,e.isWordChar=we,e.Pass=Ze,e.signal=it,e.Line=Xr,e.changeEnd=xr,e.scrollbarModel=rl,e.Pos=ne,e.cmpPos=ye,e.modes=Wr,e.mimeModes=Kt,e.resolveMode=Ur,e.getMode=$r,e.modeExtensions=gr,e.extendMode=Kr,e.copyState=Vt,e.startState=Gr,e.innerMode=_n,e.commands=$n,e.keyMap=ur,e.keyName=Bl,e.isModifierKey=Rl,e.lookupKey=un,e.normalizeKeyMap=Qf,e.StringStream=at,e.SharedTextMarker=Bn,e.TextMarker=kr,e.LineWidget=Hn,e.e_preventDefault=kt,e.e_stopPropagation=Hr,e.e_stop=dr,e.addClass=le,e.contains=I,e.rmClass=Q,e.keyNames=wr}pd(tt),vd(tt);var wd="iter insert remove copy getEditor constructor".split(" ");for(var Ai in Mt.prototype)Mt.prototype.hasOwnProperty(Ai)&&Se(wd,Ai)<0&&(tt.prototype[Ai]=function(e){return function(){return e.apply(this.doc,arguments)}}(Mt.prototype[Ai]));return Wt(Mt),tt.inputStyles={textarea:st,contenteditable:Qe},tt.defineMode=function(e){!tt.defaults.mode&&e!="null"&&(tt.defaults.mode=e),Gt.apply(this,arguments)},tt.defineMIME=Cr,tt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),tt.defineMIME("text/plain","null"),tt.defineExtension=function(e,t){tt.prototype[e]=t},tt.defineDocExtension=function(e,t){Mt.prototype[e]=t},tt.fromTextArea=_d,kd(tt),tt.version="5.65.18",tt})});var Yn=Ke((us,cs)=>{(function(o){typeof us=="object"&&typeof cs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.overlayMode=function(p,v,C){return{startState:function(){return{base:o.startState(p),overlay:o.startState(v),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(b){return{base:o.copyState(p,b.base),overlay:o.copyState(v,b.overlay),basePos:b.basePos,baseCur:null,overlayPos:b.overlayPos,overlayCur:null}},token:function(b,S){return(b!=S.streamSeen||Math.min(S.basePos,S.overlayPos){(function(o){typeof fs=="object"&&typeof ds=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var p=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,v=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,C=/[*+-]\s/;o.commands.newlineAndIndentContinueMarkdownList=function(S){if(S.getOption("disableInput"))return o.Pass;for(var s=S.listSelections(),h=[],g=0;g\s*$/.test(z),E=!/>\s*$/.test(z);(W||E)&&S.replaceRange("",{line:T.line,ch:0},{line:T.line,ch:T.ch+1}),h[g]=` +`}else{var N=M[1],G=M[5],J=!(C.test(M[2])||M[2].indexOf(">")>=0),re=J?parseInt(M[3],10)+1+M[4]:M[2].replace("x"," ");h[g]=` +`+N+re+G,J&&b(S,T)}}S.replaceSelections(h)};function b(S,s){var h=s.line,g=0,T=0,y=p.exec(S.getLine(h)),c=y[1];do{g+=1;var d=h+g,k=S.getLine(d),z=p.exec(k);if(z){var M=z[1],w=parseInt(y[3],10)+g-T,W=parseInt(z[3],10),E=W;if(c===M&&!isNaN(W))w===W&&(E=W+1),w>W&&(E=w+1),S.replaceRange(k.replace(p,M+E+z[4]+z[5]),{line:d,ch:0},{line:d,ch:k.length});else{if(c.length>M.length||c.length{(function(o){typeof hs=="object"&&typeof gs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){o.defineOption("placeholder","",function(h,g,T){var y=T&&T!=o.Init;if(g&&!y)h.on("blur",b),h.on("change",S),h.on("swapDoc",S),o.on(h.getInputField(),"compositionupdate",h.state.placeholderCompose=function(){C(h)}),S(h);else if(!g&&y){h.off("blur",b),h.off("change",S),h.off("swapDoc",S),o.off(h.getInputField(),"compositionupdate",h.state.placeholderCompose),p(h);var c=h.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}g&&!h.hasFocus()&&b(h)});function p(h){h.state.placeholder&&(h.state.placeholder.parentNode.removeChild(h.state.placeholder),h.state.placeholder=null)}function v(h){p(h);var g=h.state.placeholder=document.createElement("pre");g.style.cssText="height: 0; overflow: visible",g.style.direction=h.getOption("direction"),g.className="CodeMirror-placeholder CodeMirror-line-like";var T=h.getOption("placeholder");typeof T=="string"&&(T=document.createTextNode(T)),g.appendChild(T),h.display.lineSpace.insertBefore(g,h.display.lineSpace.firstChild)}function C(h){setTimeout(function(){var g=!1;if(h.lineCount()==1){var T=h.getInputField();g=T.nodeName=="TEXTAREA"?!h.getLine(0).length:!/[^\u200b]/.test(T.querySelector(".CodeMirror-line").textContent)}g?v(h):p(h)},20)}function b(h){s(h)&&v(h)}function S(h){var g=h.getWrapperElement(),T=s(h);g.className=g.className.replace(" CodeMirror-empty","")+(T?" CodeMirror-empty":""),T?v(h):p(h)}function s(h){return h.lineCount()===1&&h.getLine(0)===""}})});var ys=Ke((vs,bs)=>{(function(o){typeof vs=="object"&&typeof bs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("styleSelectedText",!1,function(y,c,d){var k=d&&d!=o.Init;c&&!k?(y.state.markedSelection=[],y.state.markedSelectionStyle=typeof c=="string"?c:"CodeMirror-selectedtext",g(y),y.on("cursorActivity",p),y.on("change",v)):!c&&k&&(y.off("cursorActivity",p),y.off("change",v),h(y),y.state.markedSelection=y.state.markedSelectionStyle=null)});function p(y){y.state.markedSelection&&y.operation(function(){T(y)})}function v(y){y.state.markedSelection&&y.state.markedSelection.length&&y.operation(function(){h(y)})}var C=8,b=o.Pos,S=o.cmpPos;function s(y,c,d,k){if(S(c,d)!=0)for(var z=y.state.markedSelection,M=y.state.markedSelectionStyle,w=c.line;;){var W=w==c.line?c:b(w,0),E=w+C,N=E>=d.line,G=N?d:b(E,0),J=y.markText(W,G,{className:M});if(k==null?z.push(J):z.splice(k++,0,J),N)break;w=E}}function h(y){for(var c=y.state.markedSelection,d=0;d1)return g(y);var c=y.getCursor("start"),d=y.getCursor("end"),k=y.state.markedSelection;if(!k.length)return s(y,c,d);var z=k[0].find(),M=k[k.length-1].find();if(!z||!M||d.line-c.line<=C||S(c,M.to)>=0||S(d,z.from)<=0)return g(y);for(;S(c,z.from)>0;)k.shift().clear(),z=k[0].find();for(S(c,z.from)<0&&(z.to.line-c.line0&&(d.line-M.from.line{(function(o){typeof xs=="object"&&typeof _s=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var p=o.Pos;function v(w){var W=w.flags;return W??(w.ignoreCase?"i":"")+(w.global?"g":"")+(w.multiline?"m":"")}function C(w,W){for(var E=v(w),N=E,G=0;Gre);q++){var O=w.getLine(J++);N=N==null?O:N+` +`+O}G=G*2,W.lastIndex=E.ch;var D=W.exec(N);if(D){var Q=N.slice(0,D.index).split(` +`),R=D[0].split(` +`),V=E.line+Q.length-1,x=Q[Q.length-1].length;return{from:p(V,x),to:p(V+R.length-1,R.length==1?x+R[0].length:R[R.length-1].length),match:D}}}}function h(w,W,E){for(var N,G=0;G<=w.length;){W.lastIndex=G;var J=W.exec(w);if(!J)break;var re=J.index+J[0].length;if(re>w.length-E)break;(!N||re>N.index+N[0].length)&&(N=J),G=J.index+1}return N}function g(w,W,E){W=C(W,"g");for(var N=E.line,G=E.ch,J=w.firstLine();N>=J;N--,G=-1){var re=w.getLine(N),q=h(re,W,G<0?0:re.length-G);if(q)return{from:p(N,q.index),to:p(N,q.index+q[0].length),match:q}}}function T(w,W,E){if(!b(W))return g(w,W,E);W=C(W,"gm");for(var N,G=1,J=w.getLine(E.line).length-E.ch,re=E.line,q=w.firstLine();re>=q;){for(var O=0;O=q;O++){var D=w.getLine(re--);N=N==null?D:D+` +`+N}G*=2;var Q=h(N,W,J);if(Q){var R=N.slice(0,Q.index).split(` +`),V=Q[0].split(` +`),x=re+R.length,K=R[R.length-1].length;return{from:p(x,K),to:p(x+V.length-1,V.length==1?K+V[0].length:V[V.length-1].length),match:Q}}}}var y,c;String.prototype.normalize?(y=function(w){return w.normalize("NFD").toLowerCase()},c=function(w){return w.normalize("NFD")}):(y=function(w){return w.toLowerCase()},c=function(w){return w});function d(w,W,E,N){if(w.length==W.length)return E;for(var G=0,J=E+Math.max(0,w.length-W.length);;){if(G==J)return G;var re=G+J>>1,q=N(w.slice(0,re)).length;if(q==E)return re;q>E?J=re:G=re+1}}function k(w,W,E,N){if(!W.length)return null;var G=N?y:c,J=G(W).split(/\r|\n\r?/);e:for(var re=E.line,q=E.ch,O=w.lastLine()+1-J.length;re<=O;re++,q=0){var D=w.getLine(re).slice(q),Q=G(D);if(J.length==1){var R=Q.indexOf(J[0]);if(R==-1)continue e;var E=d(D,Q,R,G)+q;return{from:p(re,d(D,Q,R,G)+q),to:p(re,d(D,Q,R+J[0].length,G)+q)}}else{var V=Q.length-J[0].length;if(Q.slice(V)!=J[0])continue e;for(var x=1;x=O;re--,q=-1){var D=w.getLine(re);q>-1&&(D=D.slice(0,q));var Q=G(D);if(J.length==1){var R=Q.lastIndexOf(J[0]);if(R==-1)continue e;return{from:p(re,d(D,Q,R,G)),to:p(re,d(D,Q,R+J[0].length,G))}}else{var V=J[J.length-1];if(Q.slice(0,V.length)!=V)continue e;for(var x=1,E=re-J.length+1;x(this.doc.getLine(W.line)||"").length&&(W.ch=0,W.line++)),o.cmpPos(W,this.doc.clipPos(W))!=0))return this.atOccurrence=!1;var E=this.matches(w,W);if(this.afterEmptyMatch=E&&o.cmpPos(E.from,E.to)==0,E)return this.pos=E,this.atOccurrence=!0,this.pos.match||!0;var N=p(w?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:N,to:N},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(w,W){if(this.atOccurrence){var E=o.splitLines(w);this.doc.replaceRange(E,this.pos.from,this.pos.to,W),this.pos.to=p(this.pos.from.line+E.length-1,E[E.length-1].length+(E.length==1?this.pos.from.ch:0))}}},o.defineExtension("getSearchCursor",function(w,W,E){return new M(this.doc,w,W,E)}),o.defineDocExtension("getSearchCursor",function(w,W,E){return new M(this,w,W,E)}),o.defineExtension("selectMatches",function(w,W){for(var E=[],N=this.getSearchCursor(w,this.getCursor("from"),W);N.findNext()&&!(o.cmpPos(N.to(),this.getCursor("to"))>0);)E.push({anchor:N.from(),head:N.to()});E.length&&this.setSelections(E,0)})})});var Vo=Ke((ws,Ss)=>{(function(o){typeof ws=="object"&&typeof Ss=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";function p(I,H,le,xe,F,L){this.indented=I,this.column=H,this.type=le,this.info=xe,this.align=F,this.prev=L}function v(I,H,le,xe){var F=I.indented;return I.context&&I.context.type=="statement"&&le!="statement"&&(F=I.context.indented),I.context=new p(F,H,le,xe,null,I.context)}function C(I){var H=I.context.type;return(H==")"||H=="]"||H=="}")&&(I.indented=I.context.indented),I.context=I.context.prev}function b(I,H,le){if(H.prevToken=="variable"||H.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(I.string.slice(0,le))||H.typeAtEndOfLine&&I.column()==I.indentation())return!0}function S(I){for(;;){if(!I||I.type=="top")return!0;if(I.type=="}"&&I.prev.info!="namespace")return!1;I=I.prev}}o.defineMode("clike",function(I,H){var le=I.indentUnit,xe=H.statementIndentUnit||le,F=H.dontAlignCalls,L=H.keywords||{},de=H.types||{},ze=H.builtin||{},pe=H.blockKeywords||{},Ee=H.defKeywords||{},ge=H.atoms||{},Oe=H.hooks||{},qe=H.multiLineStrings,Se=H.indentStatements!==!1,je=H.indentSwitch!==!1,Ze=H.namespaceSeparator,ke=H.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,Je=H.numberStart||/[\d\.]/,He=H.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,Ge=H.isOperatorChar||/[+\-*&%=<>!?|\/]/,U=H.isIdentifierChar||/[\w\$_\xa1-\uffff]/,Z=H.isReservedIdentifier||!1,ce,Be;function te(we,Me){var Le=we.next();if(Oe[Le]){var $=Oe[Le](we,Me);if($!==!1)return $}if(Le=='"'||Le=="'")return Me.tokenize=fe(Le),Me.tokenize(we,Me);if(Je.test(Le)){if(we.backUp(1),we.match(He))return"number";we.next()}if(ke.test(Le))return ce=Le,null;if(Le=="/"){if(we.eat("*"))return Me.tokenize=oe,oe(we,Me);if(we.eat("/"))return we.skipToEnd(),"comment"}if(Ge.test(Le)){for(;!we.match(/^\/[\/*]/,!1)&&we.eat(Ge););return"operator"}if(we.eatWhile(U),Ze)for(;we.match(Ze);)we.eatWhile(U);var B=we.current();return h(L,B)?(h(pe,B)&&(ce="newstatement"),h(Ee,B)&&(Be=!0),"keyword"):h(de,B)?"type":h(ze,B)||Z&&Z(B)?(h(pe,B)&&(ce="newstatement"),"builtin"):h(ge,B)?"atom":"variable"}function fe(we){return function(Me,Le){for(var $=!1,B,se=!1;(B=Me.next())!=null;){if(B==we&&!$){se=!0;break}$=!$&&B=="\\"}return(se||!($||qe))&&(Le.tokenize=null),"string"}}function oe(we,Me){for(var Le=!1,$;$=we.next();){if($=="/"&&Le){Me.tokenize=null;break}Le=$=="*"}return"comment"}function Ue(we,Me){H.typeFirstDefinitions&&we.eol()&&S(Me.context)&&(Me.typeAtEndOfLine=b(we,Me,we.pos))}return{startState:function(we){return{tokenize:null,context:new p((we||0)-le,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(we,Me){var Le=Me.context;if(we.sol()&&(Le.align==null&&(Le.align=!1),Me.indented=we.indentation(),Me.startOfLine=!0),we.eatSpace())return Ue(we,Me),null;ce=Be=null;var $=(Me.tokenize||te)(we,Me);if($=="comment"||$=="meta")return $;if(Le.align==null&&(Le.align=!0),ce==";"||ce==":"||ce==","&&we.match(/^\s*(?:\/\/.*)?$/,!1))for(;Me.context.type=="statement";)C(Me);else if(ce=="{")v(Me,we.column(),"}");else if(ce=="[")v(Me,we.column(),"]");else if(ce=="(")v(Me,we.column(),")");else if(ce=="}"){for(;Le.type=="statement";)Le=C(Me);for(Le.type=="}"&&(Le=C(Me));Le.type=="statement";)Le=C(Me)}else ce==Le.type?C(Me):Se&&((Le.type=="}"||Le.type=="top")&&ce!=";"||Le.type=="statement"&&ce=="newstatement")&&v(Me,we.column(),"statement",we.current());if($=="variable"&&(Me.prevToken=="def"||H.typeFirstDefinitions&&b(we,Me,we.start)&&S(Me.context)&&we.match(/^\s*\(/,!1))&&($="def"),Oe.token){var B=Oe.token(we,Me,$);B!==void 0&&($=B)}return $=="def"&&H.styleDefs===!1&&($="variable"),Me.startOfLine=!1,Me.prevToken=Be?"def":$||ce,Ue(we,Me),$},indent:function(we,Me){if(we.tokenize!=te&&we.tokenize!=null||we.typeAtEndOfLine&&S(we.context))return o.Pass;var Le=we.context,$=Me&&Me.charAt(0),B=$==Le.type;if(Le.type=="statement"&&$=="}"&&(Le=Le.prev),H.dontIndentStatements)for(;Le.type=="statement"&&H.dontIndentStatements.test(Le.info);)Le=Le.prev;if(Oe.indent){var se=Oe.indent(we,Le,Me,le);if(typeof se=="number")return se}var De=Le.prev&&Le.prev.info=="switch";if(H.allmanIndentation&&/[{(]/.test($)){for(;Le.type!="top"&&Le.type!="}";)Le=Le.prev;return Le.indented}return Le.type=="statement"?Le.indented+($=="{"?0:xe):Le.align&&(!F||Le.type!=")")?Le.column+(B?0:1):Le.type==")"&&!B?Le.indented+xe:Le.indented+(B?0:le)+(!B&&De&&!/^(?:case|default)\b/.test(Me)?le:0)},electricInput:je?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});function s(I){for(var H={},le=I.split(" "),xe=0;xe!?|\/#:@]/,hooks:{"@":function(I){return I.eatWhile(/[\w\$_]/),"meta"},'"':function(I,H){return I.match('""')?(H.tokenize=R,H.tokenize(I,H)):!1},"'":function(I){return I.match(/^(\\[^'\s]+|[^\\'])'/)?"string-2":(I.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(I,H){var le=H.context;return le.type=="}"&&le.align&&I.eat(">")?(H.context=new p(le.indented,le.column,le.type,le.info,null,le.prev),"operator"):!1},"/":function(I,H){return I.eat("*")?(H.tokenize=V(1),H.tokenize(I,H)):!1}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}});function x(I){return function(H,le){for(var xe=!1,F,L=!1;!H.eol();){if(!I&&!xe&&H.match('"')){L=!0;break}if(I&&H.match('"""')){L=!0;break}F=H.next(),!xe&&F=="$"&&H.match("{")&&H.skipTo("}"),xe=!xe&&F=="\\"&&!I}return(L||!I)&&(le.tokenize=null),"string"}}Q("text/x-kotlin",{name:"clike",keywords:s("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:s("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:s("catch class do else finally for if where try while enum"),defKeywords:s("class val var object interface fun"),atoms:s("true false null this"),hooks:{"@":function(I){return I.eatWhile(/[\w\$_]/),"meta"},"*":function(I,H){return H.prevToken=="."?"variable":"operator"},'"':function(I,H){return H.tokenize=x(I.match('""')),H.tokenize(I,H)},"/":function(I,H){return I.eat("*")?(H.tokenize=V(1),H.tokenize(I,H)):!1},indent:function(I,H,le,xe){var F=le&&le.charAt(0);if((I.prevToken=="}"||I.prevToken==")")&&le=="")return I.indented;if(I.prevToken=="operator"&&le!="}"&&I.context.type!="}"||I.prevToken=="variable"&&F=="."||(I.prevToken=="}"||I.prevToken==")")&&F==".")return xe*2+H.indented;if(H.align&&H.type=="}")return H.indented+(I.context.type==(le||"").charAt(0)?0:xe)}},modeProps:{closeBrackets:{triples:'"'}}}),Q(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:s("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:s("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:s("for while do if else struct"),builtin:s("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:s("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":E},modeProps:{fold:["brace","include"]}}),Q("text/x-nesc",{name:"clike",keywords:s(g+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:z,blockKeywords:s(w),atoms:s("null true false"),hooks:{"#":E},modeProps:{fold:["brace","include"]}}),Q("text/x-objectivec",{name:"clike",keywords:s(g+" "+y),types:M,builtin:s(c),blockKeywords:s(w+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:s(W+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:s("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:G,hooks:{"#":E,"*":N},modeProps:{fold:["brace","include"]}}),Q("text/x-objectivec++",{name:"clike",keywords:s(g+" "+y+" "+T),types:M,builtin:s(c),blockKeywords:s(w+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:s(W+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:s("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:G,hooks:{"#":E,"*":N,u:re,U:re,L:re,R:re,0:J,1:J,2:J,3:J,4:J,5:J,6:J,7:J,8:J,9:J,token:function(I,H,le){if(le=="variable"&&I.peek()=="("&&(H.prevToken==";"||H.prevToken==null||H.prevToken=="}")&&q(I.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),Q("text/x-squirrel",{name:"clike",keywords:s("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:z,blockKeywords:s("case catch class else for foreach if switch try while"),defKeywords:s("function local class"),typeFirstDefinitions:!0,atoms:s("true false null"),hooks:{"#":E},modeProps:{fold:["brace","include"]}});var K=null;function X(I){return function(H,le){for(var xe=!1,F,L=!1;!H.eol();){if(!xe&&H.match('"')&&(I=="single"||H.match('""'))){L=!0;break}if(!xe&&H.match("``")){K=X(I),L=!0;break}F=H.next(),xe=I=="single"&&!xe&&F=="\\"}return L&&(le.tokenize=null),"string"}}Q("text/x-ceylon",{name:"clike",keywords:s("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(I){var H=I.charAt(0);return H===H.toUpperCase()&&H!==H.toLowerCase()},blockKeywords:s("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:s("class dynamic function interface module object package value"),builtin:s("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:s("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(I){return I.eatWhile(/[\w\$_]/),"meta"},'"':function(I,H){return H.tokenize=X(I.match('""')?"triple":"single"),H.tokenize(I,H)},"`":function(I,H){return!K||!I.match("`")?!1:(H.tokenize=K,K=null,H.tokenize(I,H))},"'":function(I){return I.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(I,H,le){if((le=="variable"||le=="type")&&H.prevToken==".")return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})});var Cs=Ke((Ts,Ls)=>{(function(o){typeof Ts=="object"&&typeof Ls=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("cmake",function(){var p=/({)?[a-zA-Z0-9_]+(})?/;function v(b,S){for(var s,h,g=!1;!b.eol()&&(s=b.next())!=S.pending;){if(s==="$"&&h!="\\"&&S.pending=='"'){g=!0;break}h=s}return g&&b.backUp(1),s==S.pending?S.continueString=!1:S.continueString=!0,"string"}function C(b,S){var s=b.next();return s==="$"?b.match(p)?"variable-2":"variable":S.continueString?(b.backUp(1),v(b,S)):b.match(/(\s+)?\w+\(/)||b.match(/(\s+)?\w+\ \(/)?(b.backUp(1),"def"):s=="#"?(b.skipToEnd(),"comment"):s=="'"||s=='"'?(S.pending=s,v(b,S)):s=="("||s==")"?"bracket":s.match(/[0-9]/)?"number":(b.eatWhile(/[\w-]/),null)}return{startState:function(){var b={};return b.inDefinition=!1,b.inInclude=!1,b.continueString=!1,b.pending=!1,b},token:function(b,S){return b.eatSpace()?null:C(b,S)}}}),o.defineMIME("text/x-cmake","cmake")})});var gn=Ke((Es,zs)=>{(function(o){typeof Es=="object"&&typeof zs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("css",function(O,D){var Q=D.inline;D.propertyKeywords||(D=o.resolveMode("text/css"));var R=O.indentUnit,V=D.tokenHooks,x=D.documentTypes||{},K=D.mediaTypes||{},X=D.mediaFeatures||{},I=D.mediaValueKeywords||{},H=D.propertyKeywords||{},le=D.nonStandardPropertyKeywords||{},xe=D.fontProperties||{},F=D.counterDescriptors||{},L=D.colorKeywords||{},de=D.valueKeywords||{},ze=D.allowNested,pe=D.lineComment,Ee=D.supportsAtComponent===!0,ge=O.highlightNonStandardPropertyKeywords!==!1,Oe,qe;function Se(te,fe){return Oe=fe,te}function je(te,fe){var oe=te.next();if(V[oe]){var Ue=V[oe](te,fe);if(Ue!==!1)return Ue}if(oe=="@")return te.eatWhile(/[\w\\\-]/),Se("def",te.current());if(oe=="="||(oe=="~"||oe=="|")&&te.eat("="))return Se(null,"compare");if(oe=='"'||oe=="'")return fe.tokenize=Ze(oe),fe.tokenize(te,fe);if(oe=="#")return te.eatWhile(/[\w\\\-]/),Se("atom","hash");if(oe=="!")return te.match(/^\s*\w*/),Se("keyword","important");if(/\d/.test(oe)||oe=="."&&te.eat(/\d/))return te.eatWhile(/[\w.%]/),Se("number","unit");if(oe==="-"){if(/[\d.]/.test(te.peek()))return te.eatWhile(/[\w.%]/),Se("number","unit");if(te.match(/^-[\w\\\-]*/))return te.eatWhile(/[\w\\\-]/),te.match(/^\s*:/,!1)?Se("variable-2","variable-definition"):Se("variable-2","variable");if(te.match(/^\w+-/))return Se("meta","meta")}else return/[,+>*\/]/.test(oe)?Se(null,"select-op"):oe=="."&&te.match(/^-?[_a-z][_a-z0-9-]*/i)?Se("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(oe)?Se(null,oe):te.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(te.current())&&(fe.tokenize=ke),Se("variable callee","variable")):/[\w\\\-]/.test(oe)?(te.eatWhile(/[\w\\\-]/),Se("property","word")):Se(null,null)}function Ze(te){return function(fe,oe){for(var Ue=!1,we;(we=fe.next())!=null;){if(we==te&&!Ue){te==")"&&fe.backUp(1);break}Ue=!Ue&&we=="\\"}return(we==te||!Ue&&te!=")")&&(oe.tokenize=null),Se("string","string")}}function ke(te,fe){return te.next(),te.match(/^\s*[\"\')]/,!1)?fe.tokenize=null:fe.tokenize=Ze(")"),Se(null,"(")}function Je(te,fe,oe){this.type=te,this.indent=fe,this.prev=oe}function He(te,fe,oe,Ue){return te.context=new Je(oe,fe.indentation()+(Ue===!1?0:R),te.context),oe}function Ge(te){return te.context.prev&&(te.context=te.context.prev),te.context.type}function U(te,fe,oe){return Be[oe.context.type](te,fe,oe)}function Z(te,fe,oe,Ue){for(var we=Ue||1;we>0;we--)oe.context=oe.context.prev;return U(te,fe,oe)}function ce(te){var fe=te.current().toLowerCase();de.hasOwnProperty(fe)?qe="atom":L.hasOwnProperty(fe)?qe="keyword":qe="variable"}var Be={};return Be.top=function(te,fe,oe){if(te=="{")return He(oe,fe,"block");if(te=="}"&&oe.context.prev)return Ge(oe);if(Ee&&/@component/i.test(te))return He(oe,fe,"atComponentBlock");if(/^@(-moz-)?document$/i.test(te))return He(oe,fe,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(te))return He(oe,fe,"atBlock");if(/^@(font-face|counter-style)/i.test(te))return oe.stateArg=te,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(te))return"keyframes";if(te&&te.charAt(0)=="@")return He(oe,fe,"at");if(te=="hash")qe="builtin";else if(te=="word")qe="tag";else{if(te=="variable-definition")return"maybeprop";if(te=="interpolation")return He(oe,fe,"interpolation");if(te==":")return"pseudo";if(ze&&te=="(")return He(oe,fe,"parens")}return oe.context.type},Be.block=function(te,fe,oe){if(te=="word"){var Ue=fe.current().toLowerCase();return H.hasOwnProperty(Ue)?(qe="property","maybeprop"):le.hasOwnProperty(Ue)?(qe=ge?"string-2":"property","maybeprop"):ze?(qe=fe.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(qe+=" error","maybeprop")}else return te=="meta"?"block":!ze&&(te=="hash"||te=="qualifier")?(qe="error","block"):Be.top(te,fe,oe)},Be.maybeprop=function(te,fe,oe){return te==":"?He(oe,fe,"prop"):U(te,fe,oe)},Be.prop=function(te,fe,oe){if(te==";")return Ge(oe);if(te=="{"&&ze)return He(oe,fe,"propBlock");if(te=="}"||te=="{")return Z(te,fe,oe);if(te=="(")return He(oe,fe,"parens");if(te=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(fe.current()))qe+=" error";else if(te=="word")ce(fe);else if(te=="interpolation")return He(oe,fe,"interpolation");return"prop"},Be.propBlock=function(te,fe,oe){return te=="}"?Ge(oe):te=="word"?(qe="property","maybeprop"):oe.context.type},Be.parens=function(te,fe,oe){return te=="{"||te=="}"?Z(te,fe,oe):te==")"?Ge(oe):te=="("?He(oe,fe,"parens"):te=="interpolation"?He(oe,fe,"interpolation"):(te=="word"&&ce(fe),"parens")},Be.pseudo=function(te,fe,oe){return te=="meta"?"pseudo":te=="word"?(qe="variable-3",oe.context.type):U(te,fe,oe)},Be.documentTypes=function(te,fe,oe){return te=="word"&&x.hasOwnProperty(fe.current())?(qe="tag",oe.context.type):Be.atBlock(te,fe,oe)},Be.atBlock=function(te,fe,oe){if(te=="(")return He(oe,fe,"atBlock_parens");if(te=="}"||te==";")return Z(te,fe,oe);if(te=="{")return Ge(oe)&&He(oe,fe,ze?"block":"top");if(te=="interpolation")return He(oe,fe,"interpolation");if(te=="word"){var Ue=fe.current().toLowerCase();Ue=="only"||Ue=="not"||Ue=="and"||Ue=="or"?qe="keyword":K.hasOwnProperty(Ue)?qe="attribute":X.hasOwnProperty(Ue)?qe="property":I.hasOwnProperty(Ue)?qe="keyword":H.hasOwnProperty(Ue)?qe="property":le.hasOwnProperty(Ue)?qe=ge?"string-2":"property":de.hasOwnProperty(Ue)?qe="atom":L.hasOwnProperty(Ue)?qe="keyword":qe="error"}return oe.context.type},Be.atComponentBlock=function(te,fe,oe){return te=="}"?Z(te,fe,oe):te=="{"?Ge(oe)&&He(oe,fe,ze?"block":"top",!1):(te=="word"&&(qe="error"),oe.context.type)},Be.atBlock_parens=function(te,fe,oe){return te==")"?Ge(oe):te=="{"||te=="}"?Z(te,fe,oe,2):Be.atBlock(te,fe,oe)},Be.restricted_atBlock_before=function(te,fe,oe){return te=="{"?He(oe,fe,"restricted_atBlock"):te=="word"&&oe.stateArg=="@counter-style"?(qe="variable","restricted_atBlock_before"):U(te,fe,oe)},Be.restricted_atBlock=function(te,fe,oe){return te=="}"?(oe.stateArg=null,Ge(oe)):te=="word"?(oe.stateArg=="@font-face"&&!xe.hasOwnProperty(fe.current().toLowerCase())||oe.stateArg=="@counter-style"&&!F.hasOwnProperty(fe.current().toLowerCase())?qe="error":qe="property","maybeprop"):"restricted_atBlock"},Be.keyframes=function(te,fe,oe){return te=="word"?(qe="variable","keyframes"):te=="{"?He(oe,fe,"top"):U(te,fe,oe)},Be.at=function(te,fe,oe){return te==";"?Ge(oe):te=="{"||te=="}"?Z(te,fe,oe):(te=="word"?qe="tag":te=="hash"&&(qe="builtin"),"at")},Be.interpolation=function(te,fe,oe){return te=="}"?Ge(oe):te=="{"||te==";"?Z(te,fe,oe):(te=="word"?qe="variable":te!="variable"&&te!="("&&te!=")"&&(qe="error"),"interpolation")},{startState:function(te){return{tokenize:null,state:Q?"block":"top",stateArg:null,context:new Je(Q?"block":"top",te||0,null)}},token:function(te,fe){if(!fe.tokenize&&te.eatSpace())return null;var oe=(fe.tokenize||je)(te,fe);return oe&&typeof oe=="object"&&(Oe=oe[1],oe=oe[0]),qe=oe,Oe!="comment"&&(fe.state=Be[fe.state](Oe,te,fe)),qe},indent:function(te,fe){var oe=te.context,Ue=fe&&fe.charAt(0),we=oe.indent;return oe.type=="prop"&&(Ue=="}"||Ue==")")&&(oe=oe.prev),oe.prev&&(Ue=="}"&&(oe.type=="block"||oe.type=="top"||oe.type=="interpolation"||oe.type=="restricted_atBlock")?(oe=oe.prev,we=oe.indent):(Ue==")"&&(oe.type=="parens"||oe.type=="atBlock_parens")||Ue=="{"&&(oe.type=="at"||oe.type=="atBlock"))&&(we=Math.max(0,oe.indent-R))),we},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:pe,fold:"brace"}});function p(O){for(var D={},Q=0;Q{(function(o){typeof Ms=="object"&&typeof As=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("diff",function(){var p={"+":"positive","-":"negative","@":"meta"};return{token:function(v){var C=v.string.search(/[\t ]+?$/);if(!v.sol()||C===0)return v.skipToEnd(),("error "+(p[v.string.charAt(0)]||"")).replace(/ $/,"");var b=p[v.peek()]||v.skipToEnd();return C===-1?v.skipToEnd():v.pos=C,b}}}),o.defineMIME("text/x-diff","diff")})});var mn=Ke((qs,Fs)=>{(function(o){typeof qs=="object"&&typeof Fs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var p={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},v={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};o.defineMode("xml",function(C,b){var S=C.indentUnit,s={},h=b.htmlMode?p:v;for(var g in h)s[g]=h[g];for(var g in b)s[g]=b[g];var T,y;function c(x,K){function X(le){return K.tokenize=le,le(x,K)}var I=x.next();if(I=="<")return x.eat("!")?x.eat("[")?x.match("CDATA[")?X(z("atom","]]>")):null:x.match("--")?X(z("comment","-->")):x.match("DOCTYPE",!0,!0)?(x.eatWhile(/[\w\._\-]/),X(M(1))):null:x.eat("?")?(x.eatWhile(/[\w\._\-]/),K.tokenize=z("meta","?>"),"meta"):(T=x.eat("/")?"closeTag":"openTag",K.tokenize=d,"tag bracket");if(I=="&"){var H;return x.eat("#")?x.eat("x")?H=x.eatWhile(/[a-fA-F\d]/)&&x.eat(";"):H=x.eatWhile(/[\d]/)&&x.eat(";"):H=x.eatWhile(/[\w\.\-:]/)&&x.eat(";"),H?"atom":"error"}else return x.eatWhile(/[^&<]/),null}c.isInText=!0;function d(x,K){var X=x.next();if(X==">"||X=="/"&&x.eat(">"))return K.tokenize=c,T=X==">"?"endTag":"selfcloseTag","tag bracket";if(X=="=")return T="equals",null;if(X=="<"){K.tokenize=c,K.state=G,K.tagName=K.tagStart=null;var I=K.tokenize(x,K);return I?I+" tag error":"tag error"}else return/[\'\"]/.test(X)?(K.tokenize=k(X),K.stringStartCol=x.column(),K.tokenize(x,K)):(x.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function k(x){var K=function(X,I){for(;!X.eol();)if(X.next()==x){I.tokenize=d;break}return"string"};return K.isInAttribute=!0,K}function z(x,K){return function(X,I){for(;!X.eol();){if(X.match(K)){I.tokenize=c;break}X.next()}return x}}function M(x){return function(K,X){for(var I;(I=K.next())!=null;){if(I=="<")return X.tokenize=M(x+1),X.tokenize(K,X);if(I==">")if(x==1){X.tokenize=c;break}else return X.tokenize=M(x-1),X.tokenize(K,X)}return"meta"}}function w(x){return x&&x.toLowerCase()}function W(x,K,X){this.prev=x.context,this.tagName=K||"",this.indent=x.indented,this.startOfLine=X,(s.doNotIndent.hasOwnProperty(K)||x.context&&x.context.noIndent)&&(this.noIndent=!0)}function E(x){x.context&&(x.context=x.context.prev)}function N(x,K){for(var X;;){if(!x.context||(X=x.context.tagName,!s.contextGrabbers.hasOwnProperty(w(X))||!s.contextGrabbers[w(X)].hasOwnProperty(w(K))))return;E(x)}}function G(x,K,X){return x=="openTag"?(X.tagStart=K.column(),J):x=="closeTag"?re:G}function J(x,K,X){return x=="word"?(X.tagName=K.current(),y="tag",D):s.allowMissingTagName&&x=="endTag"?(y="tag bracket",D(x,K,X)):(y="error",J)}function re(x,K,X){if(x=="word"){var I=K.current();return X.context&&X.context.tagName!=I&&s.implicitlyClosed.hasOwnProperty(w(X.context.tagName))&&E(X),X.context&&X.context.tagName==I||s.matchClosing===!1?(y="tag",q):(y="tag error",O)}else return s.allowMissingTagName&&x=="endTag"?(y="tag bracket",q(x,K,X)):(y="error",O)}function q(x,K,X){return x!="endTag"?(y="error",q):(E(X),G)}function O(x,K,X){return y="error",q(x,K,X)}function D(x,K,X){if(x=="word")return y="attribute",Q;if(x=="endTag"||x=="selfcloseTag"){var I=X.tagName,H=X.tagStart;return X.tagName=X.tagStart=null,x=="selfcloseTag"||s.autoSelfClosers.hasOwnProperty(w(I))?N(X,I):(N(X,I),X.context=new W(X,I,H==X.indented)),G}return y="error",D}function Q(x,K,X){return x=="equals"?R:(s.allowMissing||(y="error"),D(x,K,X))}function R(x,K,X){return x=="string"?V:x=="word"&&s.allowUnquoted?(y="string",D):(y="error",D(x,K,X))}function V(x,K,X){return x=="string"?V:D(x,K,X)}return{startState:function(x){var K={tokenize:c,state:G,indented:x||0,tagName:null,tagStart:null,context:null};return x!=null&&(K.baseIndent=x),K},token:function(x,K){if(!K.tagName&&x.sol()&&(K.indented=x.indentation()),x.eatSpace())return null;T=null;var X=K.tokenize(x,K);return(X||T)&&X!="comment"&&(y=null,K.state=K.state(T||X,x,K),y&&(X=y=="error"?X+" error":y)),X},indent:function(x,K,X){var I=x.context;if(x.tokenize.isInAttribute)return x.tagStart==x.indented?x.stringStartCol+1:x.indented+S;if(I&&I.noIndent)return o.Pass;if(x.tokenize!=d&&x.tokenize!=c)return X?X.match(/^(\s*)/)[0].length:0;if(x.tagName)return s.multilineTagIndentPastTag!==!1?x.tagStart+x.tagName.length+2:x.tagStart+S*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/$/,blockCommentStart:"",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(x){x.state==R&&(x.state=D)},xmlCurrentTag:function(x){return x.tagName?{name:x.tagName,close:x.type=="closeTag"}:null},xmlCurrentContext:function(x){for(var K=[],X=x.context;X;X=X.prev)K.push(X.tagName);return K.reverse()}}}),o.defineMIME("text/xml","xml"),o.defineMIME("application/xml","xml"),o.mimeModes.hasOwnProperty("text/html")||o.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var vn=Ke((Is,Ns)=>{(function(o){typeof Is=="object"&&typeof Ns=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("javascript",function(p,v){var C=p.indentUnit,b=v.statementIndent,S=v.jsonld,s=v.json||S,h=v.trackScope!==!1,g=v.typescript,T=v.wordCharacters||/[\w$\xa1-\uffff]/,y=function(){function _(pt){return{type:pt,style:"keyword"}}var P=_("keyword a"),ae=_("keyword b"),he=_("keyword c"),ne=_("keyword d"),ye=_("operator"),Xe={type:"atom",style:"atom"};return{if:_("if"),while:P,with:P,else:ae,do:ae,try:ae,finally:ae,return:ne,break:ne,continue:ne,new:_("new"),delete:he,void:he,throw:he,debugger:_("debugger"),var:_("var"),const:_("var"),let:_("var"),function:_("function"),catch:_("catch"),for:_("for"),switch:_("switch"),case:_("case"),default:_("default"),in:ye,typeof:ye,instanceof:ye,true:Xe,false:Xe,null:Xe,undefined:Xe,NaN:Xe,Infinity:Xe,this:_("this"),class:_("class"),super:_("atom"),yield:he,export:_("export"),import:_("import"),extends:he,await:he}}(),c=/[+\-*&%=<>!?|~^@]/,d=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function k(_){for(var P=!1,ae,he=!1;(ae=_.next())!=null;){if(!P){if(ae=="/"&&!he)return;ae=="["?he=!0:he&&ae=="]"&&(he=!1)}P=!P&&ae=="\\"}}var z,M;function w(_,P,ae){return z=_,M=ae,P}function W(_,P){var ae=_.next();if(ae=='"'||ae=="'")return P.tokenize=E(ae),P.tokenize(_,P);if(ae=="."&&_.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return w("number","number");if(ae=="."&&_.match(".."))return w("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(ae))return w(ae);if(ae=="="&&_.eat(">"))return w("=>","operator");if(ae=="0"&&_.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return w("number","number");if(/\d/.test(ae))return _.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),w("number","number");if(ae=="/")return _.eat("*")?(P.tokenize=N,N(_,P)):_.eat("/")?(_.skipToEnd(),w("comment","comment")):jt(_,P,1)?(k(_),_.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),w("regexp","string-2")):(_.eat("="),w("operator","operator",_.current()));if(ae=="`")return P.tokenize=G,G(_,P);if(ae=="#"&&_.peek()=="!")return _.skipToEnd(),w("meta","meta");if(ae=="#"&&_.eatWhile(T))return w("variable","property");if(ae=="<"&&_.match("!--")||ae=="-"&&_.match("->")&&!/\S/.test(_.string.slice(0,_.start)))return _.skipToEnd(),w("comment","comment");if(c.test(ae))return(ae!=">"||!P.lexical||P.lexical.type!=">")&&(_.eat("=")?(ae=="!"||ae=="=")&&_.eat("="):/[<>*+\-|&?]/.test(ae)&&(_.eat(ae),ae==">"&&_.eat(ae))),ae=="?"&&_.eat(".")?w("."):w("operator","operator",_.current());if(T.test(ae)){_.eatWhile(T);var he=_.current();if(P.lastType!="."){if(y.propertyIsEnumerable(he)){var ne=y[he];return w(ne.type,ne.style,he)}if(he=="async"&&_.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return w("async","keyword",he)}return w("variable","variable",he)}}function E(_){return function(P,ae){var he=!1,ne;if(S&&P.peek()=="@"&&P.match(d))return ae.tokenize=W,w("jsonld-keyword","meta");for(;(ne=P.next())!=null&&!(ne==_&&!he);)he=!he&&ne=="\\";return he||(ae.tokenize=W),w("string","string")}}function N(_,P){for(var ae=!1,he;he=_.next();){if(he=="/"&&ae){P.tokenize=W;break}ae=he=="*"}return w("comment","comment")}function G(_,P){for(var ae=!1,he;(he=_.next())!=null;){if(!ae&&(he=="`"||he=="$"&&_.eat("{"))){P.tokenize=W;break}ae=!ae&&he=="\\"}return w("quasi","string-2",_.current())}var J="([{}])";function re(_,P){P.fatArrowAt&&(P.fatArrowAt=null);var ae=_.string.indexOf("=>",_.start);if(!(ae<0)){if(g){var he=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(_.string.slice(_.start,ae));he&&(ae=he.index)}for(var ne=0,ye=!1,Xe=ae-1;Xe>=0;--Xe){var pt=_.string.charAt(Xe),Et=J.indexOf(pt);if(Et>=0&&Et<3){if(!ne){++Xe;break}if(--ne==0){pt=="("&&(ye=!0);break}}else if(Et>=3&&Et<6)++ne;else if(T.test(pt))ye=!0;else if(/["'\/`]/.test(pt))for(;;--Xe){if(Xe==0)return;var Zr=_.string.charAt(Xe-1);if(Zr==pt&&_.string.charAt(Xe-2)!="\\"){Xe--;break}}else if(ye&&!ne){++Xe;break}}ye&&!ne&&(P.fatArrowAt=Xe)}}var q={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function O(_,P,ae,he,ne,ye){this.indented=_,this.column=P,this.type=ae,this.prev=ne,this.info=ye,he!=null&&(this.align=he)}function D(_,P){if(!h)return!1;for(var ae=_.localVars;ae;ae=ae.next)if(ae.name==P)return!0;for(var he=_.context;he;he=he.prev)for(var ae=he.vars;ae;ae=ae.next)if(ae.name==P)return!0}function Q(_,P,ae,he,ne){var ye=_.cc;for(R.state=_,R.stream=ne,R.marked=null,R.cc=ye,R.style=P,_.lexical.hasOwnProperty("align")||(_.lexical.align=!0);;){var Xe=ye.length?ye.pop():s?Se:Oe;if(Xe(ae,he)){for(;ye.length&&ye[ye.length-1].lex;)ye.pop()();return R.marked?R.marked:ae=="variable"&&D(_,he)?"variable-2":P}}}var R={state:null,column:null,marked:null,cc:null};function V(){for(var _=arguments.length-1;_>=0;_--)R.cc.push(arguments[_])}function x(){return V.apply(null,arguments),!0}function K(_,P){for(var ae=P;ae;ae=ae.next)if(ae.name==_)return!0;return!1}function X(_){var P=R.state;if(R.marked="def",!!h){if(P.context){if(P.lexical.info=="var"&&P.context&&P.context.block){var ae=I(_,P.context);if(ae!=null){P.context=ae;return}}else if(!K(_,P.localVars)){P.localVars=new xe(_,P.localVars);return}}v.globalVars&&!K(_,P.globalVars)&&(P.globalVars=new xe(_,P.globalVars))}}function I(_,P){if(P)if(P.block){var ae=I(_,P.prev);return ae?ae==P.prev?P:new le(ae,P.vars,!0):null}else return K(_,P.vars)?P:new le(P.prev,new xe(_,P.vars),!1);else return null}function H(_){return _=="public"||_=="private"||_=="protected"||_=="abstract"||_=="readonly"}function le(_,P,ae){this.prev=_,this.vars=P,this.block=ae}function xe(_,P){this.name=_,this.next=P}var F=new xe("this",new xe("arguments",null));function L(){R.state.context=new le(R.state.context,R.state.localVars,!1),R.state.localVars=F}function de(){R.state.context=new le(R.state.context,R.state.localVars,!0),R.state.localVars=null}L.lex=de.lex=!0;function ze(){R.state.localVars=R.state.context.vars,R.state.context=R.state.context.prev}ze.lex=!0;function pe(_,P){var ae=function(){var he=R.state,ne=he.indented;if(he.lexical.type=="stat")ne=he.lexical.indented;else for(var ye=he.lexical;ye&&ye.type==")"&&ye.align;ye=ye.prev)ne=ye.indented;he.lexical=new O(ne,R.stream.column(),_,null,he.lexical,P)};return ae.lex=!0,ae}function Ee(){var _=R.state;_.lexical.prev&&(_.lexical.type==")"&&(_.indented=_.lexical.indented),_.lexical=_.lexical.prev)}Ee.lex=!0;function ge(_){function P(ae){return ae==_?x():_==";"||ae=="}"||ae==")"||ae=="]"?V():x(P)}return P}function Oe(_,P){return _=="var"?x(pe("vardef",P),Hr,ge(";"),Ee):_=="keyword a"?x(pe("form"),Ze,Oe,Ee):_=="keyword b"?x(pe("form"),Oe,Ee):_=="keyword d"?R.stream.match(/^\s*$/,!1)?x():x(pe("stat"),Je,ge(";"),Ee):_=="debugger"?x(ge(";")):_=="{"?x(pe("}"),de,De,Ee,ze):_==";"?x():_=="if"?(R.state.lexical.info=="else"&&R.state.cc[R.state.cc.length-1]==Ee&&R.state.cc.pop()(),x(pe("form"),Ze,Oe,Ee,Br)):_=="function"?x(Bt):_=="for"?x(pe("form"),de,ei,Oe,ze,Ee):_=="class"||g&&P=="interface"?(R.marked="keyword",x(pe("form",_=="class"?_:P),Wr,Ee)):_=="variable"?g&&P=="declare"?(R.marked="keyword",x(Oe)):g&&(P=="module"||P=="enum"||P=="type")&&R.stream.match(/^\s*\w/,!1)?(R.marked="keyword",P=="enum"?x(Ae):P=="type"?x(ti,ge("operator"),Pe,ge(";")):x(pe("form"),Ct,ge("{"),pe("}"),De,Ee,Ee)):g&&P=="namespace"?(R.marked="keyword",x(pe("form"),Se,Oe,Ee)):g&&P=="abstract"?(R.marked="keyword",x(Oe)):x(pe("stat"),Ue):_=="switch"?x(pe("form"),Ze,ge("{"),pe("}","switch"),de,De,Ee,Ee,ze):_=="case"?x(Se,ge(":")):_=="default"?x(ge(":")):_=="catch"?x(pe("form"),L,qe,Oe,Ee,ze):_=="export"?x(pe("stat"),Ur,Ee):_=="import"?x(pe("stat"),gr,Ee):_=="async"?x(Oe):P=="@"?x(Se,Oe):V(pe("stat"),Se,ge(";"),Ee)}function qe(_){if(_=="(")return x($t,ge(")"))}function Se(_,P){return ke(_,P,!1)}function je(_,P){return ke(_,P,!0)}function Ze(_){return _!="("?V():x(pe(")"),Je,ge(")"),Ee)}function ke(_,P,ae){if(R.state.fatArrowAt==R.stream.start){var he=ae?Be:ce;if(_=="(")return x(L,pe(")"),B($t,")"),Ee,ge("=>"),he,ze);if(_=="variable")return V(L,Ct,ge("=>"),he,ze)}var ne=ae?Ge:He;return q.hasOwnProperty(_)?x(ne):_=="function"?x(Bt,ne):_=="class"||g&&P=="interface"?(R.marked="keyword",x(pe("form"),to,Ee)):_=="keyword c"||_=="async"?x(ae?je:Se):_=="("?x(pe(")"),Je,ge(")"),Ee,ne):_=="operator"||_=="spread"?x(ae?je:Se):_=="["?x(pe("]"),at,Ee,ne):_=="{"?se(Me,"}",null,ne):_=="quasi"?V(U,ne):_=="new"?x(te(ae)):x()}function Je(_){return _.match(/[;\}\)\],]/)?V():V(Se)}function He(_,P){return _==","?x(Je):Ge(_,P,!1)}function Ge(_,P,ae){var he=ae==!1?He:Ge,ne=ae==!1?Se:je;if(_=="=>")return x(L,ae?Be:ce,ze);if(_=="operator")return/\+\+|--/.test(P)||g&&P=="!"?x(he):g&&P=="<"&&R.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?x(pe(">"),B(Pe,">"),Ee,he):P=="?"?x(Se,ge(":"),ne):x(ne);if(_=="quasi")return V(U,he);if(_!=";"){if(_=="(")return se(je,")","call",he);if(_==".")return x(we,he);if(_=="[")return x(pe("]"),Je,ge("]"),Ee,he);if(g&&P=="as")return R.marked="keyword",x(Pe,he);if(_=="regexp")return R.state.lastType=R.marked="operator",R.stream.backUp(R.stream.pos-R.stream.start-1),x(ne)}}function U(_,P){return _!="quasi"?V():P.slice(P.length-2)!="${"?x(U):x(Je,Z)}function Z(_){if(_=="}")return R.marked="string-2",R.state.tokenize=G,x(U)}function ce(_){return re(R.stream,R.state),V(_=="{"?Oe:Se)}function Be(_){return re(R.stream,R.state),V(_=="{"?Oe:je)}function te(_){return function(P){return P=="."?x(_?oe:fe):P=="variable"&&g?x(It,_?Ge:He):V(_?je:Se)}}function fe(_,P){if(P=="target")return R.marked="keyword",x(He)}function oe(_,P){if(P=="target")return R.marked="keyword",x(Ge)}function Ue(_){return _==":"?x(Ee,Oe):V(He,ge(";"),Ee)}function we(_){if(_=="variable")return R.marked="property",x()}function Me(_,P){if(_=="async")return R.marked="property",x(Me);if(_=="variable"||R.style=="keyword"){if(R.marked="property",P=="get"||P=="set")return x(Le);var ae;return g&&R.state.fatArrowAt==R.stream.start&&(ae=R.stream.match(/^\s*:\s*/,!1))&&(R.state.fatArrowAt=R.stream.pos+ae[0].length),x($)}else{if(_=="number"||_=="string")return R.marked=S?"property":R.style+" property",x($);if(_=="jsonld-keyword")return x($);if(g&&H(P))return R.marked="keyword",x(Me);if(_=="[")return x(Se,nt,ge("]"),$);if(_=="spread")return x(je,$);if(P=="*")return R.marked="keyword",x(Me);if(_==":")return V($)}}function Le(_){return _!="variable"?V($):(R.marked="property",x(Bt))}function $(_){if(_==":")return x(je);if(_=="(")return V(Bt)}function B(_,P,ae){function he(ne,ye){if(ae?ae.indexOf(ne)>-1:ne==","){var Xe=R.state.lexical;return Xe.info=="call"&&(Xe.pos=(Xe.pos||0)+1),x(function(pt,Et){return pt==P||Et==P?V():V(_)},he)}return ne==P||ye==P?x():ae&&ae.indexOf(";")>-1?V(_):x(ge(P))}return function(ne,ye){return ne==P||ye==P?x():V(_,he)}}function se(_,P,ae){for(var he=3;he"),Pe);if(_=="quasi")return V(_t,Ht)}function xt(_){if(_=="=>")return x(Pe)}function Ie(_){return _.match(/[\}\)\]]/)?x():_==","||_==";"?x(Ie):V(nr,Ie)}function nr(_,P){if(_=="variable"||R.style=="keyword")return R.marked="property",x(nr);if(P=="?"||_=="number"||_=="string")return x(nr);if(_==":")return x(Pe);if(_=="[")return x(ge("variable"),dt,ge("]"),nr);if(_=="(")return V(hr,nr);if(!_.match(/[;\}\)\],]/))return x()}function _t(_,P){return _!="quasi"?V():P.slice(P.length-2)!="${"?x(_t):x(Pe,it)}function it(_){if(_=="}")return R.marked="string-2",R.state.tokenize=G,x(_t)}function ot(_,P){return _=="variable"&&R.stream.match(/^\s*[?:]/,!1)||P=="?"?x(ot):_==":"?x(Pe):_=="spread"?x(ot):V(Pe)}function Ht(_,P){if(P=="<")return x(pe(">"),B(Pe,">"),Ee,Ht);if(P=="|"||_=="."||P=="&")return x(Pe);if(_=="[")return x(Pe,ge("]"),Ht);if(P=="extends"||P=="implements")return R.marked="keyword",x(Pe);if(P=="?")return x(Pe,ge(":"),Pe)}function It(_,P){if(P=="<")return x(pe(">"),B(Pe,">"),Ee,Ht)}function Wt(){return V(Pe,kt)}function kt(_,P){if(P=="=")return x(Pe)}function Hr(_,P){return P=="enum"?(R.marked="keyword",x(Ae)):V(Ct,nt,Ut,eo)}function Ct(_,P){if(g&&H(P))return R.marked="keyword",x(Ct);if(_=="variable")return X(P),x();if(_=="spread")return x(Ct);if(_=="[")return se(yn,"]");if(_=="{")return se(dr,"}")}function dr(_,P){return _=="variable"&&!R.stream.match(/^\s*:/,!1)?(X(P),x(Ut)):(_=="variable"&&(R.marked="property"),_=="spread"?x(Ct):_=="}"?V():_=="["?x(Se,ge("]"),ge(":"),dr):x(ge(":"),Ct,Ut))}function yn(){return V(Ct,Ut)}function Ut(_,P){if(P=="=")return x(je)}function eo(_){if(_==",")return x(Hr)}function Br(_,P){if(_=="keyword b"&&P=="else")return x(pe("form","else"),Oe,Ee)}function ei(_,P){if(P=="await")return x(ei);if(_=="(")return x(pe(")"),xn,Ee)}function xn(_){return _=="var"?x(Hr,pr):_=="variable"?x(pr):V(pr)}function pr(_,P){return _==")"?x():_==";"?x(pr):P=="in"||P=="of"?(R.marked="keyword",x(Se,pr)):V(Se,pr)}function Bt(_,P){if(P=="*")return R.marked="keyword",x(Bt);if(_=="variable")return X(P),x(Bt);if(_=="(")return x(L,pe(")"),B($t,")"),Ee,Pt,Oe,ze);if(g&&P=="<")return x(pe(">"),B(Wt,">"),Ee,Bt)}function hr(_,P){if(P=="*")return R.marked="keyword",x(hr);if(_=="variable")return X(P),x(hr);if(_=="(")return x(L,pe(")"),B($t,")"),Ee,Pt,ze);if(g&&P=="<")return x(pe(">"),B(Wt,">"),Ee,hr)}function ti(_,P){if(_=="keyword"||_=="variable")return R.marked="type",x(ti);if(P=="<")return x(pe(">"),B(Wt,">"),Ee)}function $t(_,P){return P=="@"&&x(Se,$t),_=="spread"?x($t):g&&H(P)?(R.marked="keyword",x($t)):g&&_=="this"?x(nt,Ut):V(Ct,nt,Ut)}function to(_,P){return _=="variable"?Wr(_,P):Kt(_,P)}function Wr(_,P){if(_=="variable")return X(P),x(Kt)}function Kt(_,P){if(P=="<")return x(pe(">"),B(Wt,">"),Ee,Kt);if(P=="extends"||P=="implements"||g&&_==",")return P=="implements"&&(R.marked="keyword"),x(g?Pe:Se,Kt);if(_=="{")return x(pe("}"),Gt,Ee)}function Gt(_,P){if(_=="async"||_=="variable"&&(P=="static"||P=="get"||P=="set"||g&&H(P))&&R.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return R.marked="keyword",x(Gt);if(_=="variable"||R.style=="keyword")return R.marked="property",x(Cr,Gt);if(_=="number"||_=="string")return x(Cr,Gt);if(_=="[")return x(Se,nt,ge("]"),Cr,Gt);if(P=="*")return R.marked="keyword",x(Gt);if(g&&_=="(")return V(hr,Gt);if(_==";"||_==",")return x(Gt);if(_=="}")return x();if(P=="@")return x(Se,Gt)}function Cr(_,P){if(P=="!"||P=="?")return x(Cr);if(_==":")return x(Pe,Ut);if(P=="=")return x(je);var ae=R.state.lexical.prev,he=ae&&ae.info=="interface";return V(he?hr:Bt)}function Ur(_,P){return P=="*"?(R.marked="keyword",x(Gr,ge(";"))):P=="default"?(R.marked="keyword",x(Se,ge(";"))):_=="{"?x(B($r,"}"),Gr,ge(";")):V(Oe)}function $r(_,P){if(P=="as")return R.marked="keyword",x(ge("variable"));if(_=="variable")return V(je,$r)}function gr(_){return _=="string"?x():_=="("?V(Se):_=="."?V(He):V(Kr,Vt,Gr)}function Kr(_,P){return _=="{"?se(Kr,"}"):(_=="variable"&&X(P),P=="*"&&(R.marked="keyword"),x(_n))}function Vt(_){if(_==",")return x(Kr,Vt)}function _n(_,P){if(P=="as")return R.marked="keyword",x(Kr)}function Gr(_,P){if(P=="from")return R.marked="keyword",x(Se)}function at(_){return _=="]"?x():V(B(je,"]"))}function Ae(){return V(pe("form"),Ct,ge("{"),pe("}"),B(ir,"}"),Ee,Ee)}function ir(){return V(Ct,Ut)}function kn(_,P){return _.lastType=="operator"||_.lastType==","||c.test(P.charAt(0))||/[,.]/.test(P.charAt(0))}function jt(_,P,ae){return P.tokenize==W&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(P.lastType)||P.lastType=="quasi"&&/\{\s*$/.test(_.string.slice(0,_.pos-(ae||0)))}return{startState:function(_){var P={tokenize:W,lastType:"sof",cc:[],lexical:new O((_||0)-C,0,"block",!1),localVars:v.localVars,context:v.localVars&&new le(null,null,!1),indented:_||0};return v.globalVars&&typeof v.globalVars=="object"&&(P.globalVars=v.globalVars),P},token:function(_,P){if(_.sol()&&(P.lexical.hasOwnProperty("align")||(P.lexical.align=!1),P.indented=_.indentation(),re(_,P)),P.tokenize!=N&&_.eatSpace())return null;var ae=P.tokenize(_,P);return z=="comment"?ae:(P.lastType=z=="operator"&&(M=="++"||M=="--")?"incdec":z,Q(P,ae,z,M,_))},indent:function(_,P){if(_.tokenize==N||_.tokenize==G)return o.Pass;if(_.tokenize!=W)return 0;var ae=P&&P.charAt(0),he=_.lexical,ne;if(!/^\s*else\b/.test(P))for(var ye=_.cc.length-1;ye>=0;--ye){var Xe=_.cc[ye];if(Xe==Ee)he=he.prev;else if(Xe!=Br&&Xe!=ze)break}for(;(he.type=="stat"||he.type=="form")&&(ae=="}"||(ne=_.cc[_.cc.length-1])&&(ne==He||ne==Ge)&&!/^[,\.=+\-*:?[\(]/.test(P));)he=he.prev;b&&he.type==")"&&he.prev.type=="stat"&&(he=he.prev);var pt=he.type,Et=ae==pt;return pt=="vardef"?he.indented+(_.lastType=="operator"||_.lastType==","?he.info.length+1:0):pt=="form"&&ae=="{"?he.indented:pt=="form"?he.indented+C:pt=="stat"?he.indented+(kn(_,P)?b||C:0):he.info=="switch"&&!Et&&v.doubleIndentSwitch!=!1?he.indented+(/^(?:case|default)\b/.test(P)?C:2*C):he.align?he.column+(Et?0:1):he.indented+(Et?0:C)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:S,jsonMode:s,expressionAllowed:jt,skipExpression:function(_){Q(_,"atom","atom","true",new o.StringStream("",2,null))}}}),o.registerHelper("wordChars","javascript",/[\w$]/),o.defineMIME("text/javascript","javascript"),o.defineMIME("text/ecmascript","javascript"),o.defineMIME("application/javascript","javascript"),o.defineMIME("application/x-javascript","javascript"),o.defineMIME("application/ecmascript","javascript"),o.defineMIME("application/json",{name:"javascript",json:!0}),o.defineMIME("application/x-json",{name:"javascript",json:!0}),o.defineMIME("application/manifest+json",{name:"javascript",json:!0}),o.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),o.defineMIME("text/typescript",{name:"javascript",typescript:!0}),o.defineMIME("application/typescript",{name:"javascript",typescript:!0})})});var Qn=Ke((Os,Ps)=>{(function(o){typeof Os=="object"&&typeof Ps=="object"?o(We(),mn(),vn(),gn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],o):o(CodeMirror)})(function(o){"use strict";var p={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function v(T,y,c){var d=T.current(),k=d.search(y);return k>-1?T.backUp(d.length-k):d.match(/<\/?$/)&&(T.backUp(d.length),T.match(y,!1)||T.match(d)),c}var C={};function b(T){var y=C[T];return y||(C[T]=new RegExp("\\s+"+T+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function S(T,y){var c=T.match(b(y));return c?/^\s*(.*?)\s*$/.exec(c[2])[1]:""}function s(T,y){return new RegExp((y?"^":"")+"","i")}function h(T,y){for(var c in T)for(var d=y[c]||(y[c]=[]),k=T[c],z=k.length-1;z>=0;z--)d.unshift(k[z])}function g(T,y){for(var c=0;c=0;M--)d.script.unshift(["type",z[M].matches,z[M].mode]);function w(W,E){var N=c.token(W,E.htmlState),G=/\btag\b/.test(N),J;if(G&&!/[<>\s\/]/.test(W.current())&&(J=E.htmlState.tagName&&E.htmlState.tagName.toLowerCase())&&d.hasOwnProperty(J))E.inTag=J+" ";else if(E.inTag&&G&&/>$/.test(W.current())){var re=/^([\S]+) (.*)/.exec(E.inTag);E.inTag=null;var q=W.current()==">"&&g(d[re[1]],re[2]),O=o.getMode(T,q),D=s(re[1],!0),Q=s(re[1],!1);E.token=function(R,V){return R.match(D,!1)?(V.token=w,V.localState=V.localMode=null,null):v(R,Q,V.localMode.token(R,V.localState))},E.localMode=O,E.localState=o.startState(O,c.indent(E.htmlState,"",""))}else E.inTag&&(E.inTag+=W.current(),W.eol()&&(E.inTag+=" "));return N}return{startState:function(){var W=o.startState(c);return{token:w,inTag:null,localMode:null,localState:null,htmlState:W}},copyState:function(W){var E;return W.localState&&(E=o.copyState(W.localMode,W.localState)),{token:W.token,inTag:W.inTag,localMode:W.localMode,localState:E,htmlState:o.copyState(c,W.htmlState)}},token:function(W,E){return E.token(W,E)},indent:function(W,E,N){return!W.localMode||/^\s*<\//.test(E)?c.indent(W.htmlState,E,N):W.localMode.indent?W.localMode.indent(W.localState,E,N):o.Pass},innerMode:function(W){return{state:W.localState||W.htmlState,mode:W.localMode||c}}}},"xml","javascript","css"),o.defineMIME("text/html","htmlmixed")})});var Hs=Ke((js,Rs)=>{(function(o){typeof js=="object"&&typeof Rs=="object"?o(We(),Qn(),Yn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/overlay"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("django:inner",function(){var p=["block","endblock","for","endfor","true","false","filter","endfilter","loop","none","self","super","if","elif","endif","as","else","import","with","endwith","without","context","ifequal","endifequal","ifnotequal","endifnotequal","extends","include","load","comment","endcomment","empty","url","static","trans","blocktrans","endblocktrans","now","regroup","lorem","ifchanged","endifchanged","firstof","debug","cycle","csrf_token","autoescape","endautoescape","spaceless","endspaceless","ssi","templatetag","verbatim","endverbatim","widthratio"],v=["add","addslashes","capfirst","center","cut","date","default","default_if_none","dictsort","dictsortreversed","divisibleby","escape","escapejs","filesizeformat","first","floatformat","force_escape","get_digit","iriencode","join","last","length","length_is","linebreaks","linebreaksbr","linenumbers","ljust","lower","make_list","phone2numeric","pluralize","pprint","random","removetags","rjust","safe","safeseq","slice","slugify","stringformat","striptags","time","timesince","timeuntil","title","truncatechars","truncatechars_html","truncatewords","truncatewords_html","unordered_list","upper","urlencode","urlize","urlizetrunc","wordcount","wordwrap","yesno"],C=["==","!=","<",">","<=",">="],b=["in","not","or","and"];p=new RegExp("^\\b("+p.join("|")+")\\b"),v=new RegExp("^\\b("+v.join("|")+")\\b"),C=new RegExp("^\\b("+C.join("|")+")\\b"),b=new RegExp("^\\b("+b.join("|")+")\\b");function S(c,d){if(c.match("{{"))return d.tokenize=h,"tag";if(c.match("{%"))return d.tokenize=g,"tag";if(c.match("{#"))return d.tokenize=T,"comment";for(;c.next()!=null&&!c.match(/\{[{%#]/,!1););return null}function s(c,d){return function(k,z){if(!z.escapeNext&&k.eat(c))z.tokenize=d;else{z.escapeNext&&(z.escapeNext=!1);var M=k.next();M=="\\"&&(z.escapeNext=!0)}return"string"}}function h(c,d){if(d.waitDot){if(d.waitDot=!1,c.peek()!=".")return"null";if(c.match(/\.\W+/))return"error";if(c.eat("."))return d.waitProperty=!0,"null";throw Error("Unexpected error while waiting for property.")}if(d.waitPipe){if(d.waitPipe=!1,c.peek()!="|")return"null";if(c.match(/\.\W+/))return"error";if(c.eat("|"))return d.waitFilter=!0,"null";throw Error("Unexpected error while waiting for filter.")}return d.waitProperty&&(d.waitProperty=!1,c.match(/\b(\w+)\b/))?(d.waitDot=!0,d.waitPipe=!0,"property"):d.waitFilter&&(d.waitFilter=!1,c.match(v))?"variable-2":c.eatSpace()?(d.waitProperty=!1,"null"):c.match(/\b\d+(\.\d+)?\b/)?"number":c.match("'")?(d.tokenize=s("'",d.tokenize),"string"):c.match('"')?(d.tokenize=s('"',d.tokenize),"string"):c.match(/\b(\w+)\b/)&&!d.foundVariable?(d.waitDot=!0,d.waitPipe=!0,"variable"):c.match("}}")?(d.waitProperty=null,d.waitFilter=null,d.waitDot=null,d.waitPipe=null,d.tokenize=S,"tag"):(c.next(),"null")}function g(c,d){if(d.waitDot){if(d.waitDot=!1,c.peek()!=".")return"null";if(c.match(/\.\W+/))return"error";if(c.eat("."))return d.waitProperty=!0,"null";throw Error("Unexpected error while waiting for property.")}if(d.waitPipe){if(d.waitPipe=!1,c.peek()!="|")return"null";if(c.match(/\.\W+/))return"error";if(c.eat("|"))return d.waitFilter=!0,"null";throw Error("Unexpected error while waiting for filter.")}if(d.waitProperty&&(d.waitProperty=!1,c.match(/\b(\w+)\b/)))return d.waitDot=!0,d.waitPipe=!0,"property";if(d.waitFilter&&(d.waitFilter=!1,c.match(v)))return"variable-2";if(c.eatSpace())return d.waitProperty=!1,"null";if(c.match(/\b\d+(\.\d+)?\b/))return"number";if(c.match("'"))return d.tokenize=s("'",d.tokenize),"string";if(c.match('"'))return d.tokenize=s('"',d.tokenize),"string";if(c.match(C))return"operator";if(c.match(b))return"keyword";var k=c.match(p);return k?(k[0]=="comment"&&(d.blockCommentTag=!0),"keyword"):c.match(/\b(\w+)\b/)?(d.waitDot=!0,d.waitPipe=!0,"variable"):c.match("%}")?(d.waitProperty=null,d.waitFilter=null,d.waitDot=null,d.waitPipe=null,d.blockCommentTag?(d.blockCommentTag=!1,d.tokenize=y):d.tokenize=S,"tag"):(c.next(),"null")}function T(c,d){return c.match(/^.*?#\}/)?d.tokenize=S:c.skipToEnd(),"comment"}function y(c,d){return c.match(/\{%\s*endcomment\s*%\}/,!1)?(d.tokenize=g,c.match("{%"),"tag"):(c.next(),"comment")}return{startState:function(){return{tokenize:S}},token:function(c,d){return d.tokenize(c,d)},blockCommentStart:"{% comment %}",blockCommentEnd:"{% endcomment %}"}}),o.defineMode("django",function(p){var v=o.getMode(p,"text/html"),C=o.getMode(p,"django:inner");return o.overlayMode(v,C)}),o.defineMIME("text/x-django","django")})});var Di=Ke((Bs,Ws)=>{(function(o){typeof Bs=="object"&&typeof Ws=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineSimpleMode=function(y,c){o.defineMode(y,function(d){return o.simpleMode(d,c)})},o.simpleMode=function(y,c){p(c,"start");var d={},k=c.meta||{},z=!1;for(var M in c)if(M!=k&&c.hasOwnProperty(M))for(var w=d[M]=[],W=c[M],E=0;E2&&N.token&&typeof N.token!="string"){for(var re=2;re-1)return o.Pass;var M=d.indent.length-1,w=y[d.state];e:for(;;){for(var W=0;W{(function(o){typeof Us=="object"&&typeof $s=="object"?o(We(),Di()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],o):o(CodeMirror)})(function(o){"use strict";var p="from",v=new RegExp("^(\\s*)\\b("+p+")\\b","i"),C=["run","cmd","entrypoint","shell"],b=new RegExp("^(\\s*)("+C.join("|")+")(\\s+\\[)","i"),S="expose",s=new RegExp("^(\\s*)("+S+")(\\s+)","i"),h=["arg","from","maintainer","label","env","add","copy","volume","user","workdir","onbuild","stopsignal","healthcheck","shell"],g=[p,S].concat(C).concat(h),T="("+g.join("|")+")",y=new RegExp("^(\\s*)"+T+"(\\s*)(#.*)?$","i"),c=new RegExp("^(\\s*)"+T+"(\\s+)","i");o.defineSimpleMode("dockerfile",{start:[{regex:/^\s*#.*$/,sol:!0,token:"comment"},{regex:v,token:[null,"keyword"],sol:!0,next:"from"},{regex:y,token:[null,"keyword",null,"error"],sol:!0},{regex:b,token:[null,"keyword",null],sol:!0,next:"array"},{regex:s,token:[null,"keyword",null],sol:!0,next:"expose"},{regex:c,token:[null,"keyword",null],sol:!0,next:"arguments"},{regex:/./,token:null}],from:[{regex:/\s*$/,token:null,next:"start"},{regex:/(\s*)(#.*)$/,token:[null,"error"],next:"start"},{regex:/(\s*\S+\s+)(as)/i,token:[null,"keyword"],next:"start"},{token:null,next:"start"}],single:[{regex:/(?:[^\\']|\\.)/,token:"string"},{regex:/'/,token:"string",pop:!0}],double:[{regex:/(?:[^\\"]|\\.)/,token:"string"},{regex:/"/,token:"string",pop:!0}],array:[{regex:/\]/,token:null,next:"start"},{regex:/"(?:[^\\"]|\\.)*"?/,token:"string"}],expose:[{regex:/\d+$/,token:"number",next:"start"},{regex:/[^\d]+$/,token:null,next:"start"},{regex:/\d+/,token:"number"},{regex:/[^\d]+/,token:null},{token:null,next:"start"}],arguments:[{regex:/^\s*#.*$/,sol:!0,token:"comment"},{regex:/"(?:[^\\"]|\\.)*"?$/,token:"string",next:"start"},{regex:/"/,token:"string",push:"double"},{regex:/'(?:[^\\']|\\.)*'?$/,token:"string",next:"start"},{regex:/'/,token:"string",push:"single"},{regex:/[^#"']+[\\`]$/,token:null},{regex:/[^#"']+$/,token:null,next:"start"},{regex:/[^#"']+/,token:null},{token:null,next:"start"}],meta:{lineComment:"#"}}),o.defineMIME("text/x-dockerfile","dockerfile")})});var Xs=Ke((Gs,Zs)=>{(function(o){typeof Gs=="object"&&typeof Zs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var p=0;p-1&&C.substring(s+1,C.length);if(h)return o.findModeByExtension(h)},o.findModeByName=function(C){C=C.toLowerCase();for(var b=0;b{(function(o){typeof Ys=="object"&&typeof Qs=="object"?o(We(),mn(),Xs()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("markdown",function(p,v){var C=o.getMode(p,"text/html"),b=C.name=="null";function S(F){if(o.findModeByName){var L=o.findModeByName(F);L&&(F=L.mime||L.mimes[0])}var de=o.getMode(p,F);return de.name=="null"?null:de}v.highlightFormatting===void 0&&(v.highlightFormatting=!1),v.maxBlockquoteDepth===void 0&&(v.maxBlockquoteDepth=0),v.taskLists===void 0&&(v.taskLists=!1),v.strikethrough===void 0&&(v.strikethrough=!1),v.emoji===void 0&&(v.emoji=!1),v.fencedCodeBlockHighlighting===void 0&&(v.fencedCodeBlockHighlighting=!0),v.fencedCodeBlockDefaultMode===void 0&&(v.fencedCodeBlockDefaultMode="text/plain"),v.xml===void 0&&(v.xml=!0),v.tokenTypeOverrides===void 0&&(v.tokenTypeOverrides={});var s={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var h in s)s.hasOwnProperty(h)&&v.tokenTypeOverrides[h]&&(s[h]=v.tokenTypeOverrides[h]);var g=/^([*\-_])(?:\s*\1){2,}\s*$/,T=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,y=/^\[(x| )\](?=\s)/i,c=v.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ {0,3}(?:\={1,}|-{2,})\s*$/,k=/^[^#!\[\]*_\\<>` "'(~:]+/,z=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,M=/^\s*\[[^\]]+?\]:.*$/,w=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,W=" ";function E(F,L,de){return L.f=L.inline=de,de(F,L)}function N(F,L,de){return L.f=L.block=de,de(F,L)}function G(F){return!F||!/\S/.test(F.string)}function J(F){if(F.linkTitle=!1,F.linkHref=!1,F.linkText=!1,F.em=!1,F.strong=!1,F.strikethrough=!1,F.quote=0,F.indentedCode=!1,F.f==q){var L=b;if(!L){var de=o.innerMode(C,F.htmlState);L=de.mode.name=="xml"&&de.state.tagStart===null&&!de.state.context&&de.state.tokenize.isInText}L&&(F.f=R,F.block=re,F.htmlState=null)}return F.trailingSpace=0,F.trailingSpaceNewLine=!1,F.prevLine=F.thisLine,F.thisLine={stream:null},null}function re(F,L){var de=F.column()===L.indentation,ze=G(L.prevLine.stream),pe=L.indentedCode,Ee=L.prevLine.hr,ge=L.list!==!1,Oe=(L.listStack[L.listStack.length-1]||0)+3;L.indentedCode=!1;var qe=L.indentation;if(L.indentationDiff===null&&(L.indentationDiff=L.indentation,ge)){for(L.list=null;qe=4&&(pe||L.prevLine.fencedCodeEnd||L.prevLine.header||ze))return F.skipToEnd(),L.indentedCode=!0,s.code;if(F.eatSpace())return null;if(de&&L.indentation<=Oe&&(Ze=F.match(c))&&Ze[1].length<=6)return L.quote=0,L.header=Ze[1].length,L.thisLine.header=!0,v.highlightFormatting&&(L.formatting="header"),L.f=L.inline,D(L);if(L.indentation<=Oe&&F.eat(">"))return L.quote=de?1:L.quote+1,v.highlightFormatting&&(L.formatting="quote"),F.eatSpace(),D(L);if(!je&&!L.setext&&de&&L.indentation<=Oe&&(Ze=F.match(T))){var ke=Ze[1]?"ol":"ul";return L.indentation=qe+F.current().length,L.list=!0,L.quote=0,L.listStack.push(L.indentation),L.em=!1,L.strong=!1,L.code=!1,L.strikethrough=!1,v.taskLists&&F.match(y,!1)&&(L.taskList=!0),L.f=L.inline,v.highlightFormatting&&(L.formatting=["list","list-"+ke]),D(L)}else{if(de&&L.indentation<=Oe&&(Ze=F.match(z,!0)))return L.quote=0,L.fencedEndRE=new RegExp(Ze[1]+"+ *$"),L.localMode=v.fencedCodeBlockHighlighting&&S(Ze[2]||v.fencedCodeBlockDefaultMode),L.localMode&&(L.localState=o.startState(L.localMode)),L.f=L.block=O,v.highlightFormatting&&(L.formatting="code-block"),L.code=-1,D(L);if(L.setext||(!Se||!ge)&&!L.quote&&L.list===!1&&!L.code&&!je&&!M.test(F.string)&&(Ze=F.lookAhead(1))&&(Ze=Ze.match(d)))return L.setext?(L.header=L.setext,L.setext=0,F.skipToEnd(),v.highlightFormatting&&(L.formatting="header")):(L.header=Ze[0].charAt(0)=="="?1:2,L.setext=L.header),L.thisLine.header=!0,L.f=L.inline,D(L);if(je)return F.skipToEnd(),L.hr=!0,L.thisLine.hr=!0,s.hr;if(F.peek()==="[")return E(F,L,I)}return E(F,L,L.inline)}function q(F,L){var de=C.token(F,L.htmlState);if(!b){var ze=o.innerMode(C,L.htmlState);(ze.mode.name=="xml"&&ze.state.tagStart===null&&!ze.state.context&&ze.state.tokenize.isInText||L.md_inside&&F.current().indexOf(">")>-1)&&(L.f=R,L.block=re,L.htmlState=null)}return de}function O(F,L){var de=L.listStack[L.listStack.length-1]||0,ze=L.indentation=F.quote?L.push(s.formatting+"-"+F.formatting[de]+"-"+F.quote):L.push("error"))}if(F.taskOpen)return L.push("meta"),L.length?L.join(" "):null;if(F.taskClosed)return L.push("property"),L.length?L.join(" "):null;if(F.linkHref?L.push(s.linkHref,"url"):(F.strong&&L.push(s.strong),F.em&&L.push(s.em),F.strikethrough&&L.push(s.strikethrough),F.emoji&&L.push(s.emoji),F.linkText&&L.push(s.linkText),F.code&&L.push(s.code),F.image&&L.push(s.image),F.imageAltText&&L.push(s.imageAltText,"link"),F.imageMarker&&L.push(s.imageMarker)),F.header&&L.push(s.header,s.header+"-"+F.header),F.quote&&(L.push(s.quote),!v.maxBlockquoteDepth||v.maxBlockquoteDepth>=F.quote?L.push(s.quote+"-"+F.quote):L.push(s.quote+"-"+v.maxBlockquoteDepth)),F.list!==!1){var ze=(F.listStack.length-1)%3;ze?ze===1?L.push(s.list2):L.push(s.list3):L.push(s.list1)}return F.trailingSpaceNewLine?L.push("trailing-space-new-line"):F.trailingSpace&&L.push("trailing-space-"+(F.trailingSpace%2?"a":"b")),L.length?L.join(" "):null}function Q(F,L){if(F.match(k,!0))return D(L)}function R(F,L){var de=L.text(F,L);if(typeof de<"u")return de;if(L.list)return L.list=null,D(L);if(L.taskList){var ze=F.match(y,!0)[1]===" ";return ze?L.taskOpen=!0:L.taskClosed=!0,v.highlightFormatting&&(L.formatting="task"),L.taskList=!1,D(L)}if(L.taskOpen=!1,L.taskClosed=!1,L.header&&F.match(/^#+$/,!0))return v.highlightFormatting&&(L.formatting="header"),D(L);var pe=F.next();if(L.linkTitle){L.linkTitle=!1;var Ee=pe;pe==="("&&(Ee=")"),Ee=(Ee+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ge="^\\s*(?:[^"+Ee+"\\\\]+|\\\\\\\\|\\\\.)"+Ee;if(F.match(new RegExp(ge),!0))return s.linkHref}if(pe==="`"){var Oe=L.formatting;v.highlightFormatting&&(L.formatting="code"),F.eatWhile("`");var qe=F.current().length;if(L.code==0&&(!L.quote||qe==1))return L.code=qe,D(L);if(qe==L.code){var Se=D(L);return L.code=0,Se}else return L.formatting=Oe,D(L)}else if(L.code)return D(L);if(pe==="\\"&&(F.next(),v.highlightFormatting)){var je=D(L),Ze=s.formatting+"-escape";return je?je+" "+Ze:Ze}if(pe==="!"&&F.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return L.imageMarker=!0,L.image=!0,v.highlightFormatting&&(L.formatting="image"),D(L);if(pe==="["&&L.imageMarker&&F.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return L.imageMarker=!1,L.imageAltText=!0,v.highlightFormatting&&(L.formatting="image"),D(L);if(pe==="]"&&L.imageAltText){v.highlightFormatting&&(L.formatting="image");var je=D(L);return L.imageAltText=!1,L.image=!1,L.inline=L.f=x,je}if(pe==="["&&!L.image)return L.linkText&&F.match(/^.*?\]/)||(L.linkText=!0,v.highlightFormatting&&(L.formatting="link")),D(L);if(pe==="]"&&L.linkText){v.highlightFormatting&&(L.formatting="link");var je=D(L);return L.linkText=!1,L.inline=L.f=F.match(/\(.*?\)| ?\[.*?\]/,!1)?x:R,je}if(pe==="<"&&F.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){L.f=L.inline=V,v.highlightFormatting&&(L.formatting="link");var je=D(L);return je?je+=" ":je="",je+s.linkInline}if(pe==="<"&&F.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){L.f=L.inline=V,v.highlightFormatting&&(L.formatting="link");var je=D(L);return je?je+=" ":je="",je+s.linkEmail}if(v.xml&&pe==="<"&&F.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ke=F.string.indexOf(">",F.pos);if(ke!=-1){var Je=F.string.substring(F.start,ke);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Je)&&(L.md_inside=!0)}return F.backUp(1),L.htmlState=o.startState(C),N(F,L,q)}if(v.xml&&pe==="<"&&F.match(/^\/\w*?>/))return L.md_inside=!1,"tag";if(pe==="*"||pe==="_"){for(var He=1,Ge=F.pos==1?" ":F.string.charAt(F.pos-2);He<3&&F.eat(pe);)He++;var U=F.peek()||" ",Z=!/\s/.test(U)&&(!w.test(U)||/\s/.test(Ge)||w.test(Ge)),ce=!/\s/.test(Ge)&&(!w.test(Ge)||/\s/.test(U)||w.test(U)),Be=null,te=null;if(He%2&&(!L.em&&Z&&(pe==="*"||!ce||w.test(Ge))?Be=!0:L.em==pe&&ce&&(pe==="*"||!Z||w.test(U))&&(Be=!1)),He>1&&(!L.strong&&Z&&(pe==="*"||!ce||w.test(Ge))?te=!0:L.strong==pe&&ce&&(pe==="*"||!Z||w.test(U))&&(te=!1)),te!=null||Be!=null){v.highlightFormatting&&(L.formatting=Be==null?"strong":te==null?"em":"strong em"),Be===!0&&(L.em=pe),te===!0&&(L.strong=pe);var Se=D(L);return Be===!1&&(L.em=!1),te===!1&&(L.strong=!1),Se}}else if(pe===" "&&(F.eat("*")||F.eat("_"))){if(F.peek()===" ")return D(L);F.backUp(1)}if(v.strikethrough){if(pe==="~"&&F.eatWhile(pe)){if(L.strikethrough){v.highlightFormatting&&(L.formatting="strikethrough");var Se=D(L);return L.strikethrough=!1,Se}else if(F.match(/^[^\s]/,!1))return L.strikethrough=!0,v.highlightFormatting&&(L.formatting="strikethrough"),D(L)}else if(pe===" "&&F.match("~~",!0)){if(F.peek()===" ")return D(L);F.backUp(2)}}if(v.emoji&&pe===":"&&F.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){L.emoji=!0,v.highlightFormatting&&(L.formatting="emoji");var fe=D(L);return L.emoji=!1,fe}return pe===" "&&(F.match(/^ +$/,!1)?L.trailingSpace++:L.trailingSpace&&(L.trailingSpaceNewLine=!0)),D(L)}function V(F,L){var de=F.next();if(de===">"){L.f=L.inline=R,v.highlightFormatting&&(L.formatting="link");var ze=D(L);return ze?ze+=" ":ze="",ze+s.linkInline}return F.match(/^[^>]+/,!0),s.linkInline}function x(F,L){if(F.eatSpace())return null;var de=F.next();return de==="("||de==="["?(L.f=L.inline=X(de==="("?")":"]"),v.highlightFormatting&&(L.formatting="link-string"),L.linkHref=!0,D(L)):"error"}var K={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function X(F){return function(L,de){var ze=L.next();if(ze===F){de.f=de.inline=R,v.highlightFormatting&&(de.formatting="link-string");var pe=D(de);return de.linkHref=!1,pe}return L.match(K[F]),de.linkHref=!0,D(de)}}function I(F,L){return F.match(/^([^\]\\]|\\.)*\]:/,!1)?(L.f=H,F.next(),v.highlightFormatting&&(L.formatting="link"),L.linkText=!0,D(L)):E(F,L,R)}function H(F,L){if(F.match("]:",!0)){L.f=L.inline=le,v.highlightFormatting&&(L.formatting="link");var de=D(L);return L.linkText=!1,de}return F.match(/^([^\]\\]|\\.)+/,!0),s.linkText}function le(F,L){return F.eatSpace()?null:(F.match(/^[^\s]+/,!0),F.peek()===void 0?L.linkTitle=!0:F.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),L.f=L.inline=R,s.linkHref+" url")}var xe={startState:function(){return{f:re,prevLine:{stream:null},thisLine:{stream:null},block:re,htmlState:null,indentation:0,inline:R,text:Q,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(F){return{f:F.f,prevLine:F.prevLine,thisLine:F.thisLine,block:F.block,htmlState:F.htmlState&&o.copyState(C,F.htmlState),indentation:F.indentation,localMode:F.localMode,localState:F.localMode?o.copyState(F.localMode,F.localState):null,inline:F.inline,text:F.text,formatting:!1,linkText:F.linkText,linkTitle:F.linkTitle,linkHref:F.linkHref,code:F.code,em:F.em,strong:F.strong,strikethrough:F.strikethrough,emoji:F.emoji,header:F.header,setext:F.setext,hr:F.hr,taskList:F.taskList,list:F.list,listStack:F.listStack.slice(0),quote:F.quote,indentedCode:F.indentedCode,trailingSpace:F.trailingSpace,trailingSpaceNewLine:F.trailingSpaceNewLine,md_inside:F.md_inside,fencedEndRE:F.fencedEndRE}},token:function(F,L){if(L.formatting=!1,F!=L.thisLine.stream){if(L.header=0,L.hr=!1,F.match(/^\s*$/,!0))return J(L),null;if(L.prevLine=L.thisLine,L.thisLine={stream:F},L.taskList=!1,L.trailingSpace=0,L.trailingSpaceNewLine=!1,!L.localState&&(L.f=L.block,L.f!=q)){var de=F.match(/^\s*/,!0)[0].replace(/\t/g,W).length;if(L.indentation=de,L.indentationDiff=null,de>0)return null}}return L.f(F,L)},innerMode:function(F){return F.block==q?{state:F.htmlState,mode:C}:F.localState?{state:F.localState,mode:F.localMode}:{state:F,mode:xe}},indent:function(F,L,de){return F.block==q&&C.indent?C.indent(F.htmlState,L,de):F.localState&&F.localMode.indent?F.localMode.indent(F.localState,L,de):o.Pass},blankLine:J,getType:D,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return xe},"xml"),o.defineMIME("text/markdown","markdown"),o.defineMIME("text/x-markdown","markdown")})});var eu=Ke((Vs,Js)=>{(function(o){typeof Vs=="object"&&typeof Js=="object"?o(We(),Jo(),Yn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],o):o(CodeMirror)})(function(o){"use strict";var p=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;o.defineMode("gfm",function(v,C){var b=0;function S(T){return T.code=!1,null}var s={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(T){return{code:T.code,codeBlock:T.codeBlock,ateSpace:T.ateSpace}},token:function(T,y){if(y.combineTokens=null,y.codeBlock)return T.match(/^```+/)?(y.codeBlock=!1,null):(T.skipToEnd(),null);if(T.sol()&&(y.code=!1),T.sol()&&T.match(/^```+/))return T.skipToEnd(),y.codeBlock=!0,null;if(T.peek()==="`"){T.next();var c=T.pos;T.eatWhile("`");var d=1+T.pos-c;return y.code?d===b&&(y.code=!1):(b=d,y.code=!0),null}else if(y.code)return T.next(),null;if(T.eatSpace())return y.ateSpace=!0,null;if((T.sol()||y.ateSpace)&&(y.ateSpace=!1,C.gitHubSpice!==!1)){if(T.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return y.combineTokens=!0,"link";if(T.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return y.combineTokens=!0,"link"}return T.match(p)&&T.string.slice(T.start-2,T.start)!="]("&&(T.start==0||/\W/.test(T.string.charAt(T.start-1)))?(y.combineTokens=!0,"link"):(T.next(),null)},blankLine:S},h={taskLists:!0,strikethrough:!0,emoji:!0};for(var g in C)h[g]=C[g];return h.name="markdown",o.overlayMode(o.getMode(v,h),s)},"markdown"),o.defineMIME("text/x-gfm","gfm")})});var nu=Ke((tu,ru)=>{(function(o){typeof tu=="object"&&typeof ru=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("go",function(p){var v=p.indentUnit,C={break:!0,case:!0,chan:!0,const:!0,continue:!0,default:!0,defer:!0,else:!0,fallthrough:!0,for:!0,func:!0,go:!0,goto:!0,if:!0,import:!0,interface:!0,map:!0,package:!0,range:!0,return:!0,select:!0,struct:!0,switch:!0,type:!0,var:!0,bool:!0,byte:!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,int:!0,uint:!0,uintptr:!0,error:!0,rune:!0,any:!0,comparable:!0},b={true:!0,false:!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,delete:!0,imag:!0,len:!0,make:!0,new:!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},S=/[+\-*&^%:=<>!|\/]/,s;function h(k,z){var M=k.next();if(M=='"'||M=="'"||M=="`")return z.tokenize=g(M),z.tokenize(k,z);if(/[\d\.]/.test(M))return M=="."?k.match(/^[0-9_]+([eE][\-+]?[0-9_]+)?/):M=="0"?k.match(/^[xX][0-9a-fA-F_]+/)||k.match(/^[0-7_]+/):k.match(/^[0-9_]*\.?[0-9_]*([eE][\-+]?[0-9_]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(M))return s=M,null;if(M=="/"){if(k.eat("*"))return z.tokenize=T,T(k,z);if(k.eat("/"))return k.skipToEnd(),"comment"}if(S.test(M))return k.eatWhile(S),"operator";k.eatWhile(/[\w\$_\xa1-\uffff]/);var w=k.current();return C.propertyIsEnumerable(w)?((w=="case"||w=="default")&&(s="case"),"keyword"):b.propertyIsEnumerable(w)?"atom":"variable"}function g(k){return function(z,M){for(var w=!1,W,E=!1;(W=z.next())!=null;){if(W==k&&!w){E=!0;break}w=!w&&k!="`"&&W=="\\"}return(E||!(w||k=="`"))&&(M.tokenize=h),"string"}}function T(k,z){for(var M=!1,w;w=k.next();){if(w=="/"&&M){z.tokenize=h;break}M=w=="*"}return"comment"}function y(k,z,M,w,W){this.indented=k,this.column=z,this.type=M,this.align=w,this.prev=W}function c(k,z,M){return k.context=new y(k.indented,z,M,null,k.context)}function d(k){if(k.context.prev){var z=k.context.type;return(z==")"||z=="]"||z=="}")&&(k.indented=k.context.indented),k.context=k.context.prev}}return{startState:function(k){return{tokenize:null,context:new y((k||0)-v,0,"top",!1),indented:0,startOfLine:!0}},token:function(k,z){var M=z.context;if(k.sol()&&(M.align==null&&(M.align=!1),z.indented=k.indentation(),z.startOfLine=!0,M.type=="case"&&(M.type="}")),k.eatSpace())return null;s=null;var w=(z.tokenize||h)(k,z);return w=="comment"||(M.align==null&&(M.align=!0),s=="{"?c(z,k.column(),"}"):s=="["?c(z,k.column(),"]"):s=="("?c(z,k.column(),")"):s=="case"?M.type="case":(s=="}"&&M.type=="}"||s==M.type)&&d(z),z.startOfLine=!1),w},indent:function(k,z){if(k.tokenize!=h&&k.tokenize!=null)return o.Pass;var M=k.context,w=z&&z.charAt(0);if(M.type=="case"&&/^(?:case|default)\b/.test(z))return k.context.type="}",M.indented;var W=w==M.type;return M.align?M.column+(W?0:1):M.indented+(W?0:v)},electricChars:"{}):",closeBrackets:"()[]{}''\"\"``",fold:"brace",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),o.defineMIME("text/x-go","go")})});var au=Ke((iu,ou)=>{(function(o){typeof iu=="object"&&typeof ou=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("http",function(){function p(T,y){return T.skipToEnd(),y.cur=h,"error"}function v(T,y){return T.match(/^HTTP\/\d\.\d/)?(y.cur=C,"keyword"):T.match(/^[A-Z]+/)&&/[ \t]/.test(T.peek())?(y.cur=S,"keyword"):p(T,y)}function C(T,y){var c=T.match(/^\d+/);if(!c)return p(T,y);y.cur=b;var d=Number(c[0]);return d>=100&&d<200?"positive informational":d>=200&&d<300?"positive success":d>=300&&d<400?"positive redirect":d>=400&&d<500?"negative client-error":d>=500&&d<600?"negative server-error":"error"}function b(T,y){return T.skipToEnd(),y.cur=h,null}function S(T,y){return T.eatWhile(/\S/),y.cur=s,"string-2"}function s(T,y){return T.match(/^HTTP\/\d\.\d$/)?(y.cur=h,"keyword"):p(T,y)}function h(T){return T.sol()&&!T.eat(/[ \t]/)?T.match(/^.*?:/)?"atom":(T.skipToEnd(),"error"):(T.skipToEnd(),"string")}function g(T){return T.skipToEnd(),null}return{token:function(T,y){var c=y.cur;return c!=h&&c!=g&&T.eatSpace()?null:c(T,y)},blankLine:function(T){T.cur=g},startState:function(){return{cur:v}}}}),o.defineMIME("message/http","http")})});var uu=Ke((lu,su)=>{(function(o){typeof lu=="object"&&typeof su=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("jinja2",function(){var p=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","do","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","set","raw","endraw","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","call","endcall","macro","endmacro","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","without","context","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","pluralize","autoescape","endautoescape"],v=/^[+\-*&%=<>!?|~^]/,C=/^[:\[\(\{]/,b=["true","false"],S=/^(\d[+\-\*\/])?\d+(\.\d+)?/;p=new RegExp("(("+p.join(")|(")+"))\\b"),b=new RegExp("(("+b.join(")|(")+"))\\b");function s(h,g){var T=h.peek();if(g.incomment)return h.skipTo("#}")?(h.eatWhile(/\#|}/),g.incomment=!1):h.skipToEnd(),"comment";if(g.intag){if(g.operator){if(g.operator=!1,h.match(b))return"atom";if(h.match(S))return"number"}if(g.sign){if(g.sign=!1,h.match(b))return"atom";if(h.match(S))return"number"}if(g.instring)return T==g.instring&&(g.instring=!1),h.next(),"string";if(T=="'"||T=='"')return g.instring=T,h.next(),"string";if(g.inbraces>0&&T==")")h.next(),g.inbraces--;else if(T=="(")h.next(),g.inbraces++;else if(g.inbrackets>0&&T=="]")h.next(),g.inbrackets--;else if(T=="[")h.next(),g.inbrackets++;else{if(!g.lineTag&&(h.match(g.intag+"}")||h.eat("-")&&h.match(g.intag+"}")))return g.intag=!1,"tag";if(h.match(v))return g.operator=!0,"operator";if(h.match(C))g.sign=!0;else{if(h.column()==1&&g.lineTag&&h.match(p))return"keyword";if(h.eat(" ")||h.sol()){if(h.match(p))return"keyword";if(h.match(b))return"atom";if(h.match(S))return"number";h.sol()&&h.next()}else h.next()}}return"variable"}else if(h.eat("{")){if(h.eat("#"))return g.incomment=!0,h.skipTo("#}")?(h.eatWhile(/\#|}/),g.incomment=!1):h.skipToEnd(),"comment";if(T=h.eat(/\{|%/))return g.intag=T,g.inbraces=0,g.inbrackets=0,T=="{"&&(g.intag="}"),h.eat("-"),"tag"}else if(h.eat("#")){if(h.peek()=="#")return h.skipToEnd(),"comment";if(!h.eol())return g.intag=!0,g.lineTag=!0,g.inbraces=0,g.inbrackets=0,"tag"}h.next()}return{startState:function(){return{tokenize:s,inbrackets:0,inbraces:0}},token:function(h,g){var T=g.tokenize(h,g);return h.eol()&&g.lineTag&&!g.instring&&g.inbraces==0&&g.inbrackets==0&&(g.intag=!1,g.lineTag=!1),T},blockCommentStart:"{#",blockCommentEnd:"#}",lineComment:"##"}}),o.defineMIME("text/jinja2","jinja2")})});var du=Ke((cu,fu)=>{(function(o){typeof cu=="object"&&typeof fu=="object"?o(We(),mn(),vn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript"],o):o(CodeMirror)})(function(o){"use strict";function p(C,b,S,s){this.state=C,this.mode=b,this.depth=S,this.prev=s}function v(C){return new p(o.copyState(C.mode,C.state),C.mode,C.depth,C.prev&&v(C.prev))}o.defineMode("jsx",function(C,b){var S=o.getMode(C,{name:"xml",allowMissing:!0,multilineTagIndentPastTag:!1,allowMissingTagName:!0}),s=o.getMode(C,b&&b.base||"javascript");function h(c){var d=c.tagName;c.tagName=null;var k=S.indent(c,"","");return c.tagName=d,k}function g(c,d){return d.context.mode==S?T(c,d,d.context):y(c,d,d.context)}function T(c,d,k){if(k.depth==2)return c.match(/^.*?\*\//)?k.depth=1:c.skipToEnd(),"comment";if(c.peek()=="{"){S.skipAttribute(k.state);var z=h(k.state),M=k.state.context;if(M&&c.match(/^[^>]*>\s*$/,!1)){for(;M.prev&&!M.startOfLine;)M=M.prev;M.startOfLine?z-=C.indentUnit:k.prev.state.lexical&&(z=k.prev.state.lexical.indented)}else k.depth==1&&(z+=C.indentUnit);return d.context=new p(o.startState(s,z),s,0,d.context),null}if(k.depth==1){if(c.peek()=="<")return S.skipAttribute(k.state),d.context=new p(o.startState(S,h(k.state)),S,0,d.context),null;if(c.match("//"))return c.skipToEnd(),"comment";if(c.match("/*"))return k.depth=2,g(c,d)}var w=S.token(c,k.state),W=c.current(),E;return/\btag\b/.test(w)?/>$/.test(W)?k.state.context?k.depth=0:d.context=d.context.prev:/^-1&&c.backUp(W.length-E),w}function y(c,d,k){if(c.peek()=="<"&&!c.match(/^<([^<>]|<[^>]*>)+,\s*>/,!1)&&s.expressionAllowed(c,k.state))return d.context=new p(o.startState(S,s.indent(k.state,"","")),S,0,d.context),s.skipExpression(k.state),null;var z=s.token(c,k.state);if(!z&&k.depth!=null){var M=c.current();M=="{"?k.depth++:M=="}"&&--k.depth==0&&(d.context=d.context.prev)}return z}return{startState:function(){return{context:new p(o.startState(s),s)}},copyState:function(c){return{context:v(c.context)}},token:g,indent:function(c,d,k){return c.context.mode.indent(c.context.state,d,k)},innerMode:function(c){return c.context}}},"xml","javascript"),o.defineMIME("text/jsx","jsx"),o.defineMIME("text/typescript-jsx",{name:"jsx",base:{name:"javascript",typescript:!0}})})});var gu=Ke((pu,hu)=>{(function(o){typeof pu=="object"&&typeof hu=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("nginx",function(p){function v(k){for(var z={},M=k.split(" "),w=0;w*\/]/.test(w)?g(null,"select-op"):/[;{}:\[\]]/.test(w)?g(null,w):(k.eatWhile(/[\w\\\-]/),g("variable","variable"))}function y(k,z){for(var M=!1,w;(w=k.next())!=null;){if(M&&w=="/"){z.tokenize=T;break}M=w=="*"}return g("comment","comment")}function c(k,z){for(var M=0,w;(w=k.next())!=null;){if(M>=2&&w==">"){z.tokenize=T;break}M=w=="-"?M+1:0}return g("comment","comment")}function d(k){return function(z,M){for(var w=!1,W;(W=z.next())!=null&&!(W==k&&!w);)w=!w&&W=="\\";return w||(M.tokenize=T),g("string","string")}}return{startState:function(k){return{tokenize:T,baseIndent:k||0,stack:[]}},token:function(k,z){if(k.eatSpace())return null;h=null;var M=z.tokenize(k,z),w=z.stack[z.stack.length-1];return h=="hash"&&w=="rule"?M="atom":M=="variable"&&(w=="rule"?M="number":(!w||w=="@media{")&&(M="tag")),w=="rule"&&/^[\{\};]$/.test(h)&&z.stack.pop(),h=="{"?w=="@media"?z.stack[z.stack.length-1]="@media{":z.stack.push("{"):h=="}"?z.stack.pop():h=="@media"?z.stack.push("@media"):w=="{"&&h!="comment"&&z.stack.push("rule"),M},indent:function(k,z){var M=k.stack.length;return/^\}/.test(z)&&(M-=k.stack[k.stack.length-1]=="rule"?2:1),k.baseIndent+M*s},electricChars:"}"}}),o.defineMIME("text/x-nginx-conf","nginx")})});var bu=Ke((mu,vu)=>{(function(o){typeof mu=="object"&&typeof vu=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("pascal",function(){function p(T){for(var y={},c=T.split(" "),d=0;d!?|\/]/;function S(T,y){var c=T.next();if(c=="#"&&y.startOfLine)return T.skipToEnd(),"meta";if(c=='"'||c=="'")return y.tokenize=s(c),y.tokenize(T,y);if(c=="("&&T.eat("*"))return y.tokenize=h,h(T,y);if(c=="{")return y.tokenize=g,g(T,y);if(/[\[\]\(\),;\:\.]/.test(c))return null;if(/\d/.test(c))return T.eatWhile(/[\w\.]/),"number";if(c=="/"&&T.eat("/"))return T.skipToEnd(),"comment";if(b.test(c))return T.eatWhile(b),"operator";T.eatWhile(/[\w\$_]/);var d=T.current();return v.propertyIsEnumerable(d)?"keyword":C.propertyIsEnumerable(d)?"atom":"variable"}function s(T){return function(y,c){for(var d=!1,k,z=!1;(k=y.next())!=null;){if(k==T&&!d){z=!0;break}d=!d&&k=="\\"}return(z||!d)&&(c.tokenize=null),"string"}}function h(T,y){for(var c=!1,d;d=T.next();){if(d==")"&&c){y.tokenize=null;break}c=d=="*"}return"comment"}function g(T,y){for(var c;c=T.next();)if(c=="}"){y.tokenize=null;break}return"comment"}return{startState:function(){return{tokenize:null}},token:function(T,y){if(T.eatSpace())return null;var c=(y.tokenize||S)(T,y);return c=="comment"||c=="meta",c},electricChars:"{}"}}),o.defineMIME("text/x-pascal","pascal")})});var _u=Ke((yu,xu)=>{(function(o){typeof yu=="object"&&typeof xu=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("perl",function(){var S={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,if:[1,1],elsif:[1,1],else:[1,1],while:[1,1],unless:[1,1],for:[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,break:1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,continue:[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,default:1,defined:1,delete:1,die:1,do:1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,goto:1,grep:1,hex:1,import:1,index:1,int:1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,new:1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,package:1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,return:1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},s="string-2",h=/[goseximacplud]/;function g(c,d,k,z,M){return d.chain=null,d.style=null,d.tail=null,d.tokenize=function(w,W){for(var E=!1,N,G=0;N=w.next();){if(N===k[G]&&!E)return k[++G]!==void 0?(W.chain=k[G],W.style=z,W.tail=M):M&&w.eatWhile(M),W.tokenize=y,z;E=!E&&N=="\\"}return z},d.tokenize(c,d)}function T(c,d,k){return d.tokenize=function(z,M){return z.string==k&&(M.tokenize=y),z.skipToEnd(),"string"},d.tokenize(c,d)}function y(c,d){if(c.eatSpace())return null;if(d.chain)return g(c,d,d.chain,d.style,d.tail);if(c.match(/^(\-?((\d[\d_]*)?\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F_]+|0b[01_]+|\d[\d_]*(e[+-]?\d+)?)/))return"number";if(c.match(/^<<(?=[_a-zA-Z])/))return c.eatWhile(/\w/),T(c,d,c.current().substr(2));if(c.sol()&&c.match(/^\=item(?!\w)/))return T(c,d,"=cut");var k=c.next();if(k=='"'||k=="'"){if(v(c,3)=="<<"+k){var z=c.pos;c.eatWhile(/\w/);var M=c.current().substr(1);if(M&&c.eat(k))return T(c,d,M);c.pos=z}return g(c,d,[k],"string")}if(k=="q"){var w=p(c,-2);if(!(w&&/\w/.test(w))){if(w=p(c,0),w=="x"){if(w=p(c,1),w=="(")return b(c,2),g(c,d,[")"],s,h);if(w=="[")return b(c,2),g(c,d,["]"],s,h);if(w=="{")return b(c,2),g(c,d,["}"],s,h);if(w=="<")return b(c,2),g(c,d,[">"],s,h);if(/[\^'"!~\/]/.test(w))return b(c,1),g(c,d,[c.eat(w)],s,h)}else if(w=="q"){if(w=p(c,1),w=="(")return b(c,2),g(c,d,[")"],"string");if(w=="[")return b(c,2),g(c,d,["]"],"string");if(w=="{")return b(c,2),g(c,d,["}"],"string");if(w=="<")return b(c,2),g(c,d,[">"],"string");if(/[\^'"!~\/]/.test(w))return b(c,1),g(c,d,[c.eat(w)],"string")}else if(w=="w"){if(w=p(c,1),w=="(")return b(c,2),g(c,d,[")"],"bracket");if(w=="[")return b(c,2),g(c,d,["]"],"bracket");if(w=="{")return b(c,2),g(c,d,["}"],"bracket");if(w=="<")return b(c,2),g(c,d,[">"],"bracket");if(/[\^'"!~\/]/.test(w))return b(c,1),g(c,d,[c.eat(w)],"bracket")}else if(w=="r"){if(w=p(c,1),w=="(")return b(c,2),g(c,d,[")"],s,h);if(w=="[")return b(c,2),g(c,d,["]"],s,h);if(w=="{")return b(c,2),g(c,d,["}"],s,h);if(w=="<")return b(c,2),g(c,d,[">"],s,h);if(/[\^'"!~\/]/.test(w))return b(c,1),g(c,d,[c.eat(w)],s,h)}else if(/[\^'"!~\/(\[{<]/.test(w)){if(w=="(")return b(c,1),g(c,d,[")"],"string");if(w=="[")return b(c,1),g(c,d,["]"],"string");if(w=="{")return b(c,1),g(c,d,["}"],"string");if(w=="<")return b(c,1),g(c,d,[">"],"string");if(/[\^'"!~\/]/.test(w))return g(c,d,[c.eat(w)],"string")}}}if(k=="m"){var w=p(c,-2);if(!(w&&/\w/.test(w))&&(w=c.eat(/[(\[{<\^'"!~\/]/),w)){if(/[\^'"!~\/]/.test(w))return g(c,d,[w],s,h);if(w=="(")return g(c,d,[")"],s,h);if(w=="[")return g(c,d,["]"],s,h);if(w=="{")return g(c,d,["}"],s,h);if(w=="<")return g(c,d,[">"],s,h)}}if(k=="s"){var w=/[\/>\]})\w]/.test(p(c,-2));if(!w&&(w=c.eat(/[(\[{<\^'"!~\/]/),w))return w=="["?g(c,d,["]","]"],s,h):w=="{"?g(c,d,["}","}"],s,h):w=="<"?g(c,d,[">",">"],s,h):w=="("?g(c,d,[")",")"],s,h):g(c,d,[w,w],s,h)}if(k=="y"){var w=/[\/>\]})\w]/.test(p(c,-2));if(!w&&(w=c.eat(/[(\[{<\^'"!~\/]/),w))return w=="["?g(c,d,["]","]"],s,h):w=="{"?g(c,d,["}","}"],s,h):w=="<"?g(c,d,[">",">"],s,h):w=="("?g(c,d,[")",")"],s,h):g(c,d,[w,w],s,h)}if(k=="t"){var w=/[\/>\]})\w]/.test(p(c,-2));if(!w&&(w=c.eat("r"),w&&(w=c.eat(/[(\[{<\^'"!~\/]/),w)))return w=="["?g(c,d,["]","]"],s,h):w=="{"?g(c,d,["}","}"],s,h):w=="<"?g(c,d,[">",">"],s,h):w=="("?g(c,d,[")",")"],s,h):g(c,d,[w,w],s,h)}if(k=="`")return g(c,d,[k],"variable-2");if(k=="/")return/~\s*$/.test(v(c))?g(c,d,[k],s,h):"operator";if(k=="$"){var z=c.pos;if(c.eatWhile(/\d/)||c.eat("{")&&c.eatWhile(/\d/)&&c.eat("}"))return"variable-2";c.pos=z}if(/[$@%]/.test(k)){var z=c.pos;if(c.eat("^")&&c.eat(/[A-Z]/)||!/[@$%&]/.test(p(c,-2))&&c.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var w=c.current();if(S[w])return"variable-2"}c.pos=z}if(/[$@%&]/.test(k)&&(c.eatWhile(/[\w$]/)||c.eat("{")&&c.eatWhile(/[\w$]/)&&c.eat("}"))){var w=c.current();return S[w]?"variable-2":"variable"}if(k=="#"&&p(c,-2)!="$")return c.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(k)){var z=c.pos;if(c.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),S[c.current()])return"operator";c.pos=z}if(k=="_"&&c.pos==1){if(C(c,6)=="_END__")return g(c,d,["\0"],"comment");if(C(c,7)=="_DATA__")return g(c,d,["\0"],"variable-2");if(C(c,7)=="_C__")return g(c,d,["\0"],"string")}if(/\w/.test(k)){var z=c.pos;if(p(c,-2)=="{"&&(p(c,0)=="}"||c.eatWhile(/\w/)&&p(c,0)=="}"))return"string";c.pos=z}if(/[A-Z]/.test(k)){var W=p(c,-2),z=c.pos;if(c.eatWhile(/[A-Z_]/),/[\da-z]/.test(p(c,0)))c.pos=z;else{var w=S[c.current()];return w?(w[1]&&(w=w[0]),W!=":"?w==1?"keyword":w==2?"def":w==3?"atom":w==4?"operator":w==5?"variable-2":"meta":"meta"):"meta"}}if(/[a-zA-Z_]/.test(k)){var W=p(c,-2);c.eatWhile(/\w/);var w=S[c.current()];return w?(w[1]&&(w=w[0]),W!=":"?w==1?"keyword":w==2?"def":w==3?"atom":w==4?"operator":w==5?"variable-2":"meta":"meta"):"meta"}return null}return{startState:function(){return{tokenize:y,chain:null,style:null,tail:null}},token:function(c,d){return(d.tokenize||y)(c,d)},lineComment:"#"}}),o.registerHelper("wordChars","perl",/[\w$]/),o.defineMIME("text/x-perl","perl");function p(S,s){return S.string.charAt(S.pos+(s||0))}function v(S,s){if(s){var h=S.pos-s;return S.string.substr(h>=0?h:0,s)}else return S.string.substr(0,S.pos-1)}function C(S,s){var h=S.string.length,g=h-S.pos+1;return S.string.substr(S.pos,s&&s=(g=S.string.length-1)?S.pos=g:S.pos=h}})});var Su=Ke((ku,wu)=>{(function(o){typeof ku=="object"&&typeof wu=="object"?o(We(),Qn(),Vo()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],o):o(CodeMirror)})(function(o){"use strict";function p(T){for(var y={},c=T.split(" "),d=0;d\w/,!1)&&(y.tokenize=v([[["->",null]],[[/[\w]+/,"variable"]]],c,d)),"variable-2";for(var k=!1;!T.eol()&&(k||d===!1||!T.match("{$",!1)&&!T.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!k&&T.match(c)){y.tokenize=null,y.tokStack.pop(),y.tokStack.pop();break}k=T.next()=="\\"&&!k}return"string"}var S="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally readonly match",s="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",h="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage memory_get_peak_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";o.registerHelper("hintWords","php",[S,s,h].join(" ").split(" ")),o.registerHelper("wordChars","php",/[\w$]/);var g={name:"clike",helperType:"php",keywords:p(S),blockKeywords:p("catch do else elseif for foreach if switch try while finally"),defKeywords:p("class enum function interface namespace trait"),atoms:p(s),builtin:p(h),multiLineStrings:!0,hooks:{$:function(T){return T.eatWhile(/[\w\$_]/),"variable-2"},"<":function(T,y){var c;if(c=T.match(/^<<\s*/)){var d=T.eat(/['"]/);T.eatWhile(/[\w\.]/);var k=T.current().slice(c[0].length+(d?2:1));if(d&&T.eat(d),k)return(y.tokStack||(y.tokStack=[])).push(k,0),y.tokenize=C(k,d!="'"),"string"}return!1},"#":function(T){for(;!T.eol()&&!T.match("?>",!1);)T.next();return"comment"},"/":function(T){if(T.eat("/")){for(;!T.eol()&&!T.match("?>",!1);)T.next();return"comment"}return!1},'"':function(T,y){return(y.tokStack||(y.tokStack=[])).push('"',0),y.tokenize=C('"'),"string"},"{":function(T,y){return y.tokStack&&y.tokStack.length&&y.tokStack[y.tokStack.length-1]++,!1},"}":function(T,y){return y.tokStack&&y.tokStack.length>0&&!--y.tokStack[y.tokStack.length-1]&&(y.tokenize=C(y.tokStack[y.tokStack.length-2])),!1}}};o.defineMode("php",function(T,y){var c=o.getMode(T,y&&y.htmlMode||"text/html"),d=o.getMode(T,g);function k(z,M){var w=M.curMode==d;if(z.sol()&&M.pending&&M.pending!='"'&&M.pending!="'"&&(M.pending=null),w)return w&&M.php.tokenize==null&&z.match("?>")?(M.curMode=c,M.curState=M.html,M.php.context.prev||(M.php=null),"meta"):d.token(z,M.curState);if(z.match(/^<\?\w*/))return M.curMode=d,M.php||(M.php=o.startState(d,c.indent(M.html,"",""))),M.curState=M.php,"meta";if(M.pending=='"'||M.pending=="'"){for(;!z.eol()&&z.next()!=M.pending;);var W="string"}else if(M.pending&&z.pos/.test(E)?M.pending=G[0]:M.pending={end:z.pos,style:W},z.backUp(E.length-N)),W}return{startState:function(){var z=o.startState(c),M=y.startOpen?o.startState(d):null;return{html:z,php:M,curMode:y.startOpen?d:c,curState:y.startOpen?M:z,pending:null}},copyState:function(z){var M=z.html,w=o.copyState(c,M),W=z.php,E=W&&o.copyState(d,W),N;return z.curMode==c?N=w:N=E,{html:w,php:E,curMode:z.curMode,curState:N,pending:z.pending}},token:k,indent:function(z,M,w){return z.curMode!=d&&/^\s*<\//.test(M)||z.curMode==d&&/^\?>/.test(M)?c.indent(z.html,M,w):z.curMode.indent(z.curState,M,w)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(z){return{state:z.curState,mode:z.curMode}}}},"htmlmixed","clike"),o.defineMIME("application/x-httpd-php","php"),o.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),o.defineMIME("text/x-php",g)})});var Cu=Ke((Tu,Lu)=>{(function(o){typeof Tu=="object"&&typeof Lu=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";function p(s){return new RegExp("^(("+s.join(")|(")+"))\\b","i")}var v=["package","message","import","syntax","required","optional","repeated","reserved","default","extensions","packed","bool","bytes","double","enum","float","string","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","option","service","rpc","returns"],C=p(v);o.registerHelper("hintWords","protobuf",v);var b=new RegExp("^[_A-Za-z\xA1-\uFFFF][_A-Za-z0-9\xA1-\uFFFF]*");function S(s){return s.eatSpace()?null:s.match("//")?(s.skipToEnd(),"comment"):s.match(/^[0-9\.+-]/,!1)&&(s.match(/^[+-]?0x[0-9a-fA-F]+/)||s.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/)||s.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))?"number":s.match(/^"([^"]|(""))*"/)||s.match(/^'([^']|(''))*'/)?"string":s.match(C)?"keyword":s.match(b)?"variable":(s.next(),null)}o.defineMode("protobuf",function(){return{token:S,fold:"brace"}}),o.defineMIME("text/x-protobuf","protobuf")})});var Mu=Ke((Eu,zu)=>{(function(o){typeof Eu=="object"&&typeof zu=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";function p(h){return new RegExp("^(("+h.join(")|(")+"))\\b")}var v=p(["and","or","not","is"]),C=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in","False","True"],b=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];o.registerHelper("hintWords","python",C.concat(b).concat(["exec","print"]));function S(h){return h.scopes[h.scopes.length-1]}o.defineMode("python",function(h,g){for(var T="error",y=g.delimiters||g.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,c=[g.singleOperators,g.doubleOperators,g.doubleDelimiters,g.tripleDelimiters,g.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],d=0;dH?D(X):le0&&R(K,X)&&(xe+=" "+T),xe}}return re(K,X)}function re(K,X,I){if(K.eatSpace())return null;if(!I&&K.match(/^#.*/))return"comment";if(K.match(/^[0-9\.]/,!1)){var H=!1;if(K.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(H=!0),K.match(/^[\d_]+\.\d*/)&&(H=!0),K.match(/^\.\d+/)&&(H=!0),H)return K.eat(/J/i),"number";var le=!1;if(K.match(/^0x[0-9a-f_]+/i)&&(le=!0),K.match(/^0b[01_]+/i)&&(le=!0),K.match(/^0o[0-7_]+/i)&&(le=!0),K.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(K.eat(/J/i),le=!0),K.match(/^0(?![\dx])/i)&&(le=!0),le)return K.eat(/L/i),"number"}if(K.match(E)){var xe=K.current().toLowerCase().indexOf("f")!==-1;return xe?(X.tokenize=q(K.current(),X.tokenize),X.tokenize(K,X)):(X.tokenize=O(K.current(),X.tokenize),X.tokenize(K,X))}for(var F=0;F=0;)K=K.substr(1);var I=K.length==1,H="string";function le(F){return function(L,de){var ze=re(L,de,!0);return ze=="punctuation"&&(L.current()=="{"?de.tokenize=le(F+1):L.current()=="}"&&(F>1?de.tokenize=le(F-1):de.tokenize=xe)),ze}}function xe(F,L){for(;!F.eol();)if(F.eatWhile(/[^'"\{\}\\]/),F.eat("\\")){if(F.next(),I&&F.eol())return H}else{if(F.match(K))return L.tokenize=X,H;if(F.match("{{"))return H;if(F.match("{",!1))return L.tokenize=le(0),F.current()?H:L.tokenize(F,L);if(F.match("}}"))return H;if(F.match("}"))return T;F.eat(/['"]/)}if(I){if(g.singleLineStringErrors)return T;L.tokenize=X}return H}return xe.isString=!0,xe}function O(K,X){for(;"rubf".indexOf(K.charAt(0).toLowerCase())>=0;)K=K.substr(1);var I=K.length==1,H="string";function le(xe,F){for(;!xe.eol();)if(xe.eatWhile(/[^'"\\]/),xe.eat("\\")){if(xe.next(),I&&xe.eol())return H}else{if(xe.match(K))return F.tokenize=X,H;xe.eat(/['"]/)}if(I){if(g.singleLineStringErrors)return T;F.tokenize=X}return H}return le.isString=!0,le}function D(K){for(;S(K).type!="py";)K.scopes.pop();K.scopes.push({offset:S(K).offset+h.indentUnit,type:"py",align:null})}function Q(K,X,I){var H=K.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:K.column()+1;X.scopes.push({offset:X.indent+k,type:I,align:H})}function R(K,X){for(var I=K.indentation();X.scopes.length>1&&S(X).offset>I;){if(S(X).type!="py")return!0;X.scopes.pop()}return S(X).offset!=I}function V(K,X){K.sol()&&(X.beginningOfLine=!0,X.dedent=!1);var I=X.tokenize(K,X),H=K.current();if(X.beginningOfLine&&H=="@")return K.match(W,!1)?"meta":w?"operator":T;if(/\S/.test(H)&&(X.beginningOfLine=!1),(I=="variable"||I=="builtin")&&X.lastToken=="meta"&&(I="meta"),(H=="pass"||H=="return")&&(X.dedent=!0),H=="lambda"&&(X.lambda=!0),H==":"&&!X.lambda&&S(X).type=="py"&&K.match(/^\s*(?:#|$)/,!1)&&D(X),H.length==1&&!/string|comment/.test(I)){var le="[({".indexOf(H);if(le!=-1&&Q(K,X,"])}".slice(le,le+1)),le="])}".indexOf(H),le!=-1)if(S(X).type==H)X.indent=X.scopes.pop().offset-k;else return T}return X.dedent&&K.eol()&&S(X).type=="py"&&X.scopes.length>1&&X.scopes.pop(),I}var x={startState:function(K){return{tokenize:J,scopes:[{offset:K||0,type:"py",align:null}],indent:K||0,lastToken:null,lambda:!1,dedent:0}},token:function(K,X){var I=X.errorToken;I&&(X.errorToken=!1);var H=V(K,X);return H&&H!="comment"&&(X.lastToken=H=="keyword"||H=="punctuation"?K.current():H),H=="punctuation"&&(H=null),K.eol()&&X.lambda&&(X.lambda=!1),I?H+" "+T:H},indent:function(K,X){if(K.tokenize!=J)return K.tokenize.isString?o.Pass:0;var I=S(K),H=I.type==X.charAt(0)||I.type=="py"&&!K.dedent&&/^(else:|elif |except |finally:)/.test(X);return I.align!=null?I.align-(H?1:0):I.offset-(H?k:0)},electricInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,closeBrackets:{triples:`'"`},lineComment:"#",fold:"indent"};return x}),o.defineMIME("text/x-python","python");var s=function(h){return h.split(" ")};o.defineMIME("text/x-cython",{name:"python",extra_keywords:s("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})})});var qu=Ke((Au,Du)=>{(function(o){typeof Au=="object"&&typeof Du=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";function p(g){for(var T={},y=0,c=g.length;y]/)?(E.eat(/[\<\>]/),"atom"):E.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":E.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(E.eatWhile(/[\w$\xa1-\uffff]/),E.eat(/[\?\!\=]/),"atom"):"operator";if(G=="@"&&E.match(/^@?[a-zA-Z_\xa1-\uffff]/))return E.eat("@"),E.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if(G=="$")return E.eat(/[a-zA-Z_]/)?E.eatWhile(/[\w]/):E.eat(/\d/)?E.eat(/\d/):E.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(G))return E.eatWhile(/[\w\xa1-\uffff]/),E.eat(/[\?\!]/),E.eat(":")?"atom":"ident";if(G=="|"&&(N.varList||N.lastTok=="{"||N.lastTok=="do"))return T="|",null;if(/[\(\)\[\]{}\\;]/.test(G))return T=G,null;if(G=="-"&&E.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(G)){var D=E.eatWhile(/[=+\-\/*:\.^%<>~|]/);return G=="."&&!D&&(T="."),"operator"}else return null}}}function d(E){for(var N=E.pos,G=0,J,re=!1,q=!1;(J=E.next())!=null;)if(q)q=!1;else{if("[{(".indexOf(J)>-1)G++;else if("]})".indexOf(J)>-1){if(G--,G<0)break}else if(J=="/"&&G==0){re=!0;break}q=J=="\\"}return E.backUp(E.pos-N),re}function k(E){return E||(E=1),function(N,G){if(N.peek()=="}"){if(E==1)return G.tokenize.pop(),G.tokenize[G.tokenize.length-1](N,G);G.tokenize[G.tokenize.length-1]=k(E-1)}else N.peek()=="{"&&(G.tokenize[G.tokenize.length-1]=k(E+1));return c(N,G)}}function z(){var E=!1;return function(N,G){return E?(G.tokenize.pop(),G.tokenize[G.tokenize.length-1](N,G)):(E=!0,c(N,G))}}function M(E,N,G,J){return function(re,q){var O=!1,D;for(q.context.type==="read-quoted-paused"&&(q.context=q.context.prev,re.eat("}"));(D=re.next())!=null;){if(D==E&&(J||!O)){q.tokenize.pop();break}if(G&&D=="#"&&!O){if(re.eat("{")){E=="}"&&(q.context={prev:q.context,type:"read-quoted-paused"}),q.tokenize.push(k());break}else if(/[@\$]/.test(re.peek())){q.tokenize.push(z());break}}O=!O&&D=="\\"}return N}}function w(E,N){return function(G,J){return N&&G.eatSpace(),G.match(E)?J.tokenize.pop():G.skipToEnd(),"string"}}function W(E,N){return E.sol()&&E.match("=end")&&E.eol()&&N.tokenize.pop(),E.skipToEnd(),"comment"}return{startState:function(){return{tokenize:[c],indented:0,context:{type:"top",indented:-g.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(E,N){T=null,E.sol()&&(N.indented=E.indentation());var G=N.tokenize[N.tokenize.length-1](E,N),J,re=T;if(G=="ident"){var q=E.current();G=N.lastTok=="."?"property":C.propertyIsEnumerable(E.current())?"keyword":/^[A-Z]/.test(q)?"tag":N.lastTok=="def"||N.lastTok=="class"||N.varList?"def":"variable",G=="keyword"&&(re=q,b.propertyIsEnumerable(q)?J="indent":S.propertyIsEnumerable(q)?J="dedent":((q=="if"||q=="unless")&&E.column()==E.indentation()||q=="do"&&N.context.indented{(function(o){typeof Fu=="object"&&typeof Iu=="object"?o(We(),Di()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],o):o(CodeMirror)})(function(o){"use strict";o.defineSimpleMode("rust",{start:[{regex:/b?"/,token:"string",next:"string"},{regex:/b?r"/,token:"string",next:"string_raw"},{regex:/b?r#+"/,token:"string",next:"string_raw_hash"},{regex:/'(?:[^'\\]|\\(?:[nrt0'"]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\}))'/,token:"string-2"},{regex:/b'(?:[^']|\\(?:['\\nrt0]|x[\da-fA-F]{2}))'/,token:"string-2"},{regex:/(?:(?:[0-9][0-9_]*)(?:(?:[Ee][+-]?[0-9_]+)|\.[0-9_]+(?:[Ee][+-]?[0-9_]+)?)(?:f32|f64)?)|(?:0(?:b[01_]+|(?:o[0-7_]+)|(?:x[0-9a-fA-F_]+))|(?:[0-9][0-9_]*))(?:u8|u16|u32|u64|i8|i16|i32|i64|isize|usize)?/,token:"number"},{regex:/(let(?:\s+mut)?|fn|enum|mod|struct|type|union)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/,token:["keyword",null,"def"]},{regex:/(?:abstract|alignof|as|async|await|box|break|continue|const|crate|do|dyn|else|enum|extern|fn|for|final|if|impl|in|loop|macro|match|mod|move|offsetof|override|priv|proc|pub|pure|ref|return|self|sizeof|static|struct|super|trait|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,token:"keyword"},{regex:/\b(?:Self|isize|usize|char|bool|u8|u16|u32|u64|f16|f32|f64|i8|i16|i32|i64|str|Option)\b/,token:"atom"},{regex:/\b(?:true|false|Some|None|Ok|Err)\b/,token:"builtin"},{regex:/\b(fn)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/,token:["keyword",null,"def"]},{regex:/#!?\[.*\]/,token:"meta"},{regex:/\/\/.*/,token:"comment"},{regex:/\/\*/,token:"comment",next:"comment"},{regex:/[-+\/*=<>!]+/,token:"operator"},{regex:/[a-zA-Z_]\w*!/,token:"variable-3"},{regex:/[a-zA-Z_]\w*/,token:"variable"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0}],string:[{regex:/"/,token:"string",next:"start"},{regex:/(?:[^\\"]|\\(?:.|$))*/,token:"string"}],string_raw:[{regex:/"/,token:"string",next:"start"},{regex:/[^"]*/,token:"string"}],string_raw_hash:[{regex:/"#+/,token:"string",next:"start"},{regex:/(?:[^"]|"(?!#))*/,token:"string"}],comment:[{regex:/.*?\*\//,token:"comment",next:"start"},{regex:/.*/,token:"comment"}],meta:{dontIndentStates:["comment"],electricInput:/^\s*\}$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),o.defineMIME("text/x-rustsrc","rust"),o.defineMIME("text/rust","rust")})});var ea=Ke((Ou,Pu)=>{(function(o){typeof Ou=="object"&&typeof Pu=="object"?o(We(),gn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../css/css"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("sass",function(p){var v=o.mimeModes["text/css"],C=v.propertyKeywords||{},b=v.colorKeywords||{},S=v.valueKeywords||{},s=v.fontProperties||{};function h(q){return new RegExp("^"+q.join("|"))}var g=["true","false","null","auto"],T=new RegExp("^"+g.join("|")),y=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],c=h(y),d=/^::?[a-zA-Z_][\w\-]*/,k;function z(q){return!q.peek()||q.match(/\s+$/,!1)}function M(q,O){var D=q.peek();return D===")"?(q.next(),O.tokenizer=J,"operator"):D==="("?(q.next(),q.eatSpace(),"operator"):D==="'"||D==='"'?(O.tokenizer=W(q.next()),"string"):(O.tokenizer=W(")",!1),"string")}function w(q,O){return function(D,Q){return D.sol()&&D.indentation()<=q?(Q.tokenizer=J,J(D,Q)):(O&&D.skipTo("*/")?(D.next(),D.next(),Q.tokenizer=J):D.skipToEnd(),"comment")}}function W(q,O){O==null&&(O=!0);function D(Q,R){var V=Q.next(),x=Q.peek(),K=Q.string.charAt(Q.pos-2),X=V!=="\\"&&x===q||V===q&&K!=="\\";return X?(V!==q&&O&&Q.next(),z(Q)&&(R.cursorHalf=0),R.tokenizer=J,"string"):V==="#"&&x==="{"?(R.tokenizer=E(D),Q.next(),"operator"):"string"}return D}function E(q){return function(O,D){return O.peek()==="}"?(O.next(),D.tokenizer=q,"operator"):J(O,D)}}function N(q){if(q.indentCount==0){q.indentCount++;var O=q.scopes[0].offset,D=O+p.indentUnit;q.scopes.unshift({offset:D})}}function G(q){q.scopes.length!=1&&q.scopes.shift()}function J(q,O){var D=q.peek();if(q.match("/*"))return O.tokenizer=w(q.indentation(),!0),O.tokenizer(q,O);if(q.match("//"))return O.tokenizer=w(q.indentation(),!1),O.tokenizer(q,O);if(q.match("#{"))return O.tokenizer=E(J),"operator";if(D==='"'||D==="'")return q.next(),O.tokenizer=W(D),"string";if(O.cursorHalf){if(D==="#"&&(q.next(),q.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/))||q.match(/^-?[0-9\.]+/))return z(q)&&(O.cursorHalf=0),"number";if(q.match(/^(px|em|in)\b/))return z(q)&&(O.cursorHalf=0),"unit";if(q.match(T))return z(q)&&(O.cursorHalf=0),"keyword";if(q.match(/^url/)&&q.peek()==="(")return O.tokenizer=M,z(q)&&(O.cursorHalf=0),"atom";if(D==="$")return q.next(),q.eatWhile(/[\w-]/),z(q)&&(O.cursorHalf=0),"variable-2";if(D==="!")return q.next(),O.cursorHalf=0,q.match(/^[\w]+/)?"keyword":"operator";if(q.match(c))return z(q)&&(O.cursorHalf=0),"operator";if(q.eatWhile(/[\w-]/))return z(q)&&(O.cursorHalf=0),k=q.current().toLowerCase(),S.hasOwnProperty(k)?"atom":b.hasOwnProperty(k)?"keyword":C.hasOwnProperty(k)?(O.prevProp=q.current().toLowerCase(),"property"):"tag";if(z(q))return O.cursorHalf=0,null}else{if(D==="-"&&q.match(/^-\w+-/))return"meta";if(D==="."){if(q.next(),q.match(/^[\w-]+/))return N(O),"qualifier";if(q.peek()==="#")return N(O),"tag"}if(D==="#"){if(q.next(),q.match(/^[\w-]+/))return N(O),"builtin";if(q.peek()==="#")return N(O),"tag"}if(D==="$")return q.next(),q.eatWhile(/[\w-]/),"variable-2";if(q.match(/^-?[0-9\.]+/))return"number";if(q.match(/^(px|em|in)\b/))return"unit";if(q.match(T))return"keyword";if(q.match(/^url/)&&q.peek()==="(")return O.tokenizer=M,"atom";if(D==="="&&q.match(/^=[\w-]+/))return N(O),"meta";if(D==="+"&&q.match(/^\+[\w-]+/))return"variable-3";if(D==="@"&&q.match("@extend")&&(q.match(/\s*[\w]/)||G(O)),q.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return N(O),"def";if(D==="@")return q.next(),q.eatWhile(/[\w-]/),"def";if(q.eatWhile(/[\w-]/))if(q.match(/ *: *[\w-\+\$#!\("']/,!1)){k=q.current().toLowerCase();var Q=O.prevProp+"-"+k;return C.hasOwnProperty(Q)?"property":C.hasOwnProperty(k)?(O.prevProp=k,"property"):s.hasOwnProperty(k)?"property":"tag"}else return q.match(/ *:/,!1)?(N(O),O.cursorHalf=1,O.prevProp=q.current().toLowerCase(),"property"):(q.match(/ *,/,!1)||N(O),"tag");if(D===":")return q.match(d)?"variable-3":(q.next(),O.cursorHalf=1,"operator")}return q.match(c)?"operator":(q.next(),null)}function re(q,O){q.sol()&&(O.indentCount=0);var D=O.tokenizer(q,O),Q=q.current();if((Q==="@return"||Q==="}")&&G(O),D!==null){for(var R=q.pos-Q.length,V=R+p.indentUnit*O.indentCount,x=[],K=0;K{(function(o){typeof ju=="object"&&typeof Ru=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("shell",function(){var p={};function v(d,k){for(var z=0;z1&&d.eat("$");var z=d.next();return/['"({]/.test(z)?(k.tokens[0]=h(z,z=="("?"quote":z=="{"?"def":"string"),c(d,k)):(/\d/.test(z)||d.eatWhile(/\w/),k.tokens.shift(),"def")};function y(d){return function(k,z){return k.sol()&&k.string==d&&z.tokens.shift(),k.skipToEnd(),"string-2"}}function c(d,k){return(k.tokens[0]||s)(d,k)}return{startState:function(){return{tokens:[]}},token:function(d,k){return c(d,k)},closeBrackets:"()[]{}''\"\"``",lineComment:"#",fold:"brace"}}),o.defineMIME("text/x-sh","shell"),o.defineMIME("application/x-sh","shell")})});var Uu=Ke((Bu,Wu)=>{(function(o){typeof Bu=="object"&&typeof Wu=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("sql",function(g,T){var y=T.client||{},c=T.atoms||{false:!0,true:!0,null:!0},d=T.builtin||s(h),k=T.keywords||s(S),z=T.operatorChars||/^[*+\-%<>!=&|~^\/]/,M=T.support||{},w=T.hooks||{},W=T.dateSQL||{date:!0,time:!0,timestamp:!0},E=T.backslashStringEscapes!==!1,N=T.brackets||/^[\{}\(\)\[\]]/,G=T.punctuation||/^[;.,:]/;function J(Q,R){var V=Q.next();if(w[V]){var x=w[V](Q,R);if(x!==!1)return x}if(M.hexNumber&&(V=="0"&&Q.match(/^[xX][0-9a-fA-F]+/)||(V=="x"||V=="X")&&Q.match(/^'[0-9a-fA-F]*'/)))return"number";if(M.binaryNumber&&((V=="b"||V=="B")&&Q.match(/^'[01]*'/)||V=="0"&&Q.match(/^b[01]+/)))return"number";if(V.charCodeAt(0)>47&&V.charCodeAt(0)<58)return Q.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/),M.decimallessFloat&&Q.match(/^\.(?!\.)/),"number";if(V=="?"&&(Q.eatSpace()||Q.eol()||Q.eat(";")))return"variable-3";if(V=="'"||V=='"'&&M.doubleQuote)return R.tokenize=re(V),R.tokenize(Q,R);if((M.nCharCast&&(V=="n"||V=="N")||M.charsetCast&&V=="_"&&Q.match(/[a-z][a-z0-9]*/i))&&(Q.peek()=="'"||Q.peek()=='"'))return"keyword";if(M.escapeConstant&&(V=="e"||V=="E")&&(Q.peek()=="'"||Q.peek()=='"'&&M.doubleQuote))return R.tokenize=function(X,I){return(I.tokenize=re(X.next(),!0))(X,I)},"keyword";if(M.commentSlashSlash&&V=="/"&&Q.eat("/"))return Q.skipToEnd(),"comment";if(M.commentHash&&V=="#"||V=="-"&&Q.eat("-")&&(!M.commentSpaceRequired||Q.eat(" ")))return Q.skipToEnd(),"comment";if(V=="/"&&Q.eat("*"))return R.tokenize=q(1),R.tokenize(Q,R);if(V=="."){if(M.zerolessFloat&&Q.match(/^(?:\d+(?:e[+-]?\d+)?)/i))return"number";if(Q.match(/^\.+/))return null;if(Q.match(/^[\w\d_$#]+/))return"variable-2"}else{if(z.test(V))return Q.eatWhile(z),"operator";if(N.test(V))return"bracket";if(G.test(V))return Q.eatWhile(G),"punctuation";if(V=="{"&&(Q.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||Q.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";Q.eatWhile(/^[_\w\d]/);var K=Q.current().toLowerCase();return W.hasOwnProperty(K)&&(Q.match(/^( )+'[^']*'/)||Q.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(K)?"atom":d.hasOwnProperty(K)?"type":k.hasOwnProperty(K)?"keyword":y.hasOwnProperty(K)?"builtin":null}}function re(Q,R){return function(V,x){for(var K=!1,X;(X=V.next())!=null;){if(X==Q&&!K){x.tokenize=J;break}K=(E||R)&&!K&&X=="\\"}return"string"}}function q(Q){return function(R,V){var x=R.match(/^.*?(\/\*|\*\/)/);return x?x[1]=="/*"?V.tokenize=q(Q+1):Q>1?V.tokenize=q(Q-1):V.tokenize=J:R.skipToEnd(),"comment"}}function O(Q,R,V){R.context={prev:R.context,indent:Q.indentation(),col:Q.column(),type:V}}function D(Q){Q.indent=Q.context.indent,Q.context=Q.context.prev}return{startState:function(){return{tokenize:J,context:null}},token:function(Q,R){if(Q.sol()&&R.context&&R.context.align==null&&(R.context.align=!1),R.tokenize==J&&Q.eatSpace())return null;var V=R.tokenize(Q,R);if(V=="comment")return V;R.context&&R.context.align==null&&(R.context.align=!0);var x=Q.current();return x=="("?O(Q,R,")"):x=="["?O(Q,R,"]"):R.context&&R.context.type==x&&D(R),V},indent:function(Q,R){var V=Q.context;if(!V)return o.Pass;var x=R.charAt(0)==V.type;return V.align?V.col+(x?0:1):V.indent+(x?0:g.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:M.commentSlashSlash?"//":M.commentHash?"#":"--",closeBrackets:"()[]{}''\"\"``",config:T}});function p(g){for(var T;(T=g.next())!=null;)if(T=="`"&&!g.eat("`"))return"variable-2";return g.backUp(g.current().length-1),g.eatWhile(/\w/)?"variable-2":null}function v(g){for(var T;(T=g.next())!=null;)if(T=='"'&&!g.eat('"'))return"variable-2";return g.backUp(g.current().length-1),g.eatWhile(/\w/)?"variable-2":null}function C(g){return g.eat("@")&&(g.match("session."),g.match("local."),g.match("global.")),g.eat("'")?(g.match(/^.*'/),"variable-2"):g.eat('"')?(g.match(/^.*"/),"variable-2"):g.eat("`")?(g.match(/^.*`/),"variable-2"):g.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function b(g){return g.eat("N")?"atom":g.match(/^[a-zA-Z.#!?]/)?"variable-2":null}var S="alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ";function s(g){for(var T={},y=g.split(" "),c=0;c!=^\&|\/]/,brackets:/^[\{}\(\)]/,punctuation:/^[;.,:/]/,backslashStringEscapes:!1,dateSQL:s("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":C}}),o.defineMIME("text/x-mysql",{name:"sql",client:s("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:s(S+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:s("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:s("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:s("date time timestamp"),support:s("decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":C,"`":p,"\\":b}}),o.defineMIME("text/x-mariadb",{name:"sql",client:s("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:s(S+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group group_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:s("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:s("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:s("date time timestamp"),support:s("decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":C,"`":p,"\\":b}}),o.defineMIME("text/x-sqlite",{name:"sql",client:s("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:s(S+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:s("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:s("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|/~]/,dateSQL:s("date time timestamp datetime"),support:s("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":C,":":C,"?":C,$:C,'"':v,"`":p}}),o.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:s("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:s("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:s("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:s("commentSlashSlash decimallessFloat"),hooks:{}}),o.defineMIME("text/x-plsql",{name:"sql",client:s("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:s("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:s("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*\/+\-%<>!=~]/,dateSQL:s("date time timestamp"),support:s("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),o.defineMIME("text/x-hive",{name:"sql",keywords:s("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with admin authorization char compact compactions conf cube current current_date current_timestamp day decimal defined dependency directories elem_type exchange file following for grouping hour ignore inner interval jar less logical macro minute month more none noscan over owner partialscan preceding pretty principals protection reload rewrite role roles rollup rows second server sets skewed transactions truncate unbounded unset uri user values window year"),builtin:s("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype key_type utctimestamp value_type varchar"),atoms:s("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:s("date timestamp"),support:s("doubleQuote binaryNumber hexNumber")}),o.defineMIME("text/x-pgsql",{name:"sql",client:s("source"),keywords:s(S+"a abort abs absent absolute access according action ada add admin after aggregate alias all allocate also alter always analyse analyze and any are array array_agg array_max_cardinality as asc asensitive assert assertion assignment asymmetric at atomic attach attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli between bigint binary bit bit_length blob blocked bom boolean both breadth by c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain char char_length character character_length character_set_catalog character_set_name character_set_schema characteristics characters check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column column_name columns command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constant constraint constraint_catalog constraint_name constraint_schema constraints constructor contains content continue control conversion convert copy corr corresponding cost count covar_pop covar_samp create cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datatype date datetime_interval_code datetime_interval_precision day db deallocate debug dec decimal declare default defaults deferrable deferred defined definer degree delete delimiter delimiters dense_rank depends depth deref derived desc describe descriptor detach detail deterministic diagnostics dictionary disable discard disconnect dispatch distinct dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain double drop dump dynamic dynamic_function dynamic_function_code each element else elseif elsif empty enable encoding encrypted end end_frame end_partition endexec enforced enum equals errcode error escape event every except exception exclude excluding exclusive exec execute exists exit exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreach foreign fortran forward found frame_row free freeze from fs full function functions fusion g general generated get global go goto grant granted greatest group grouping groups handler having header hex hierarchy hint hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import in include including increment indent index indexes indicator info inherit inherits initially inline inner inout input insensitive insert instance instantiable instead int integer integrity intersect intersection interval into invoker is isnull isolation join k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like like_regex limit link listen ln load local localtime localtimestamp location locator lock locked log logged loop lower m map mapping match matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized not nothing notice notify notnull nowait nth_value ntile null nullable nullif nulls number numeric object occurrences_regex octet_length octets of off offset oids old on only open operator option options or order ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password path percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding precision prepare prepared preserve primary print_strict_params prior privileges procedural procedure procedures program public publication query quote raise range rank read reads real reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result result_oid return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns reverse revoke right role rollback rollup routine routine_catalog routine_name routine_schema routines row row_count row_number rows rowtype rule savepoint scale schema schema_name schemas scope scope_catalog scope_name scope_schema scroll search second section security select selective self sensitive sequence sequences serializable server server_name session session_user set setof sets share show similar simple size skip slice smallint snapshot some source space specific specific_name specifictype sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable stacked standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time system_user t table table_name tables tablesample tablespace temp template temporary text then ties time timestamp timezone_hour timezone_minute to token top_level_count trailing transaction transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted union unique unknown unlink unlisten unlogged unnamed unnest until untyped update upper uri usage use_column use_variable user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of values var_pop var_samp varbinary varchar variable_conflict variadic varying verbose version versioning view views volatile warning when whenever where while whitespace width_bucket window with within without work wrapper write xml xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes zone"),builtin:s("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time zone timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:s("false true null unknown"),operatorChars:/^[*\/+\-%<>!=&|^\/#@?~]/,backslashStringEscapes:!1,dateSQL:s("date time timestamp"),support:s("decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast escapeConstant")}),o.defineMIME("text/x-gql",{name:"sql",keywords:s("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:s("false true"),builtin:s("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),o.defineMIME("text/x-gpsql",{name:"sql",client:s("source"),keywords:s("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),builtin:s("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:s("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:s("date time timestamp"),support:s("decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),o.defineMIME("text/x-sparksql",{name:"sql",keywords:s("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases data dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),builtin:s("abs acos acosh add_months aggregate and any approx_count_distinct approx_percentile array array_contains array_distinct array_except array_intersect array_join array_max array_min array_position array_remove array_repeat array_sort array_union arrays_overlap arrays_zip ascii asin asinh assert_true atan atan2 atanh avg base64 between bigint bin binary bit_and bit_count bit_get bit_length bit_or bit_xor bool_and bool_or boolean bround btrim cardinality case cast cbrt ceil ceiling char char_length character_length chr coalesce collect_list collect_set concat concat_ws conv corr cos cosh cot count count_if count_min_sketch covar_pop covar_samp crc32 cume_dist current_catalog current_database current_date current_timestamp current_timezone current_user date date_add date_format date_from_unix_date date_part date_sub date_trunc datediff day dayofmonth dayofweek dayofyear decimal decode degrees delimited dense_rank div double e element_at elt encode every exists exp explode explode_outer expm1 extract factorial filter find_in_set first first_value flatten float floor forall format_number format_string from_csv from_json from_unixtime from_utc_timestamp get_json_object getbit greatest grouping grouping_id hash hex hour hypot if ifnull in initcap inline inline_outer input_file_block_length input_file_block_start input_file_name inputformat instr int isnan isnotnull isnull java_method json_array_length json_object_keys json_tuple kurtosis lag last last_day last_value lcase lead least left length levenshtein like ln locate log log10 log1p log2 lower lpad ltrim make_date make_dt_interval make_interval make_timestamp make_ym_interval map map_concat map_entries map_filter map_from_arrays map_from_entries map_keys map_values map_zip_with max max_by md5 mean min min_by minute mod monotonically_increasing_id month months_between named_struct nanvl negative next_day not now nth_value ntile nullif nvl nvl2 octet_length or outputformat overlay parse_url percent_rank percentile percentile_approx pi pmod posexplode posexplode_outer position positive pow power printf quarter radians raise_error rand randn random rank rcfile reflect regexp regexp_extract regexp_extract_all regexp_like regexp_replace repeat replace reverse right rint rlike round row_number rpad rtrim schema_of_csv schema_of_json second sentences sequence sequencefile serde session_window sha sha1 sha2 shiftleft shiftright shiftrightunsigned shuffle sign signum sin sinh size skewness slice smallint some sort_array soundex space spark_partition_id split sqrt stack std stddev stddev_pop stddev_samp str_to_map string struct substr substring substring_index sum tan tanh textfile timestamp timestamp_micros timestamp_millis timestamp_seconds tinyint to_csv to_date to_json to_timestamp to_unix_timestamp to_utc_timestamp transform transform_keys transform_values translate trim trunc try_add try_divide typeof ucase unbase64 unhex uniontype unix_date unix_micros unix_millis unix_seconds unix_timestamp upper uuid var_pop var_samp variance version weekday weekofyear when width_bucket window xpath xpath_boolean xpath_double xpath_float xpath_int xpath_long xpath_number xpath_short xpath_string xxhash64 year zip_with"),atoms:s("false true null"),operatorChars:/^[*\/+\-%<>!=~&|^]/,dateSQL:s("date time timestamp"),support:s("doubleQuote zerolessFloat")}),o.defineMIME("text/x-esper",{name:"sql",client:s("source"),keywords:s("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),builtin:{},atoms:s("false true null"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:s("time"),support:s("decimallessFloat zerolessFloat binaryNumber hexNumber")}),o.defineMIME("text/x-trino",{name:"sql",keywords:s("abs absent acos add admin after all all_match alter analyze and any any_match approx_distinct approx_most_frequent approx_percentile approx_set arbitrary array_agg array_distinct array_except array_intersect array_join array_max array_min array_position array_remove array_sort array_union arrays_overlap as asc asin at at_timezone atan atan2 authorization avg bar bernoulli beta_cdf between bing_tile bing_tile_at bing_tile_coordinates bing_tile_polygon bing_tile_quadkey bing_tile_zoom_level bing_tiles_around bit_count bitwise_and bitwise_and_agg bitwise_left_shift bitwise_not bitwise_or bitwise_or_agg bitwise_right_shift bitwise_right_shift_arithmetic bitwise_xor bool_and bool_or both by call cardinality cascade case cast catalogs cbrt ceil ceiling char2hexint checksum chr classify coalesce codepoint column columns combinations comment commit committed concat concat_ws conditional constraint contains contains_sequence convex_hull_agg copartition corr cos cosh cosine_similarity count count_if covar_pop covar_samp crc32 create cross cube cume_dist current current_catalog current_date current_groups current_path current_role current_schema current_time current_timestamp current_timezone current_user data date_add date_diff date_format date_parse date_trunc day day_of_month day_of_week day_of_year deallocate default define definer degrees delete dense_rank deny desc describe descriptor distinct distributed dow doy drop e element_at else empty empty_approx_set encoding end error escape evaluate_classifier_predictions every except excluding execute exists exp explain extract false features fetch filter final first first_value flatten floor following for format format_datetime format_number from from_base from_base32 from_base64 from_base64url from_big_endian_32 from_big_endian_64 from_encoded_polyline from_geojson_geometry from_hex from_ieee754_32 from_ieee754_64 from_iso8601_date from_iso8601_timestamp from_iso8601_timestamp_nanos from_unixtime from_unixtime_nanos from_utf8 full functions geometric_mean geometry_from_hadoop_shape geometry_invalid_reason geometry_nearest_points geometry_to_bing_tiles geometry_union geometry_union_agg grant granted grants graphviz great_circle_distance greatest group grouping groups hamming_distance hash_counts having histogram hmac_md5 hmac_sha1 hmac_sha256 hmac_sha512 hour human_readable_seconds if ignore in including index infinity initial inner input insert intersect intersection_cardinality into inverse_beta_cdf inverse_normal_cdf invoker io is is_finite is_infinite is_json_scalar is_nan isolation jaccard_index join json_array json_array_contains json_array_get json_array_length json_exists json_extract json_extract_scalar json_format json_object json_parse json_query json_size json_value keep key keys kurtosis lag last last_day_of_month last_value lateral lead leading learn_classifier learn_libsvm_classifier learn_libsvm_regressor learn_regressor least left length level levenshtein_distance like limit line_interpolate_point line_interpolate_points line_locate_point listagg ln local localtime localtimestamp log log10 log2 logical lower lpad ltrim luhn_check make_set_digest map_agg map_concat map_entries map_filter map_from_entries map_keys map_union map_values map_zip_with match match_recognize matched matches materialized max max_by md5 measures merge merge_set_digest millisecond min min_by minute mod month multimap_agg multimap_from_entries murmur3 nan natural next nfc nfd nfkc nfkd ngrams no none none_match normal_cdf normalize not now nth_value ntile null nullif nulls numeric_histogram object objectid_timestamp of offset omit on one only option or order ordinality outer output over overflow parse_data_size parse_datetime parse_duration partition partitions passing past path pattern per percent_rank permute pi position pow power preceding prepare privileges properties prune qdigest_agg quarter quotes radians rand random range rank read recursive reduce reduce_agg refresh regexp_count regexp_extract regexp_extract_all regexp_like regexp_position regexp_replace regexp_split regr_intercept regr_slope regress rename render repeat repeatable replace reset respect restrict returning reverse revoke rgb right role roles rollback rollup round row_number rows rpad rtrim running scalar schema schemas second security seek select sequence serializable session set sets sha1 sha256 sha512 show shuffle sign simplify_geometry sin skewness skip slice some soundex spatial_partitioning spatial_partitions split split_part split_to_map split_to_multimap spooky_hash_v2_32 spooky_hash_v2_64 sqrt st_area st_asbinary st_astext st_boundary st_buffer st_centroid st_contains st_convexhull st_coorddim st_crosses st_difference st_dimension st_disjoint st_distance st_endpoint st_envelope st_envelopeaspts st_equals st_exteriorring st_geometries st_geometryfromtext st_geometryn st_geometrytype st_geomfrombinary st_interiorringn st_interiorrings st_intersection st_intersects st_isclosed st_isempty st_isring st_issimple st_isvalid st_length st_linefromtext st_linestring st_multipoint st_numgeometries st_numinteriorring st_numpoints st_overlaps st_point st_pointn st_points st_polygon st_relate st_startpoint st_symdifference st_touches st_union st_within st_x st_xmax st_xmin st_y st_ymax st_ymin start starts_with stats stddev stddev_pop stddev_samp string strpos subset substr substring sum system table tables tablesample tan tanh tdigest_agg text then ties timestamp_objectid timezone_hour timezone_minute to to_base to_base32 to_base64 to_base64url to_big_endian_32 to_big_endian_64 to_char to_date to_encoded_polyline to_geojson_geometry to_geometry to_hex to_ieee754_32 to_ieee754_64 to_iso8601 to_milliseconds to_spherical_geography to_timestamp to_unixtime to_utf8 trailing transaction transform transform_keys transform_values translate trim trim_array true truncate try try_cast type typeof uescape unbounded uncommitted unconditional union unique unknown unmatched unnest update upper url_decode url_encode url_extract_fragment url_extract_host url_extract_parameter url_extract_path url_extract_port url_extract_protocol url_extract_query use user using utf16 utf32 utf8 validate value value_at_quantile values values_at_quantiles var_pop var_samp variance verbose version view week week_of_year when where width_bucket wilson_interval_lower wilson_interval_upper window with with_timezone within without word_stem work wrapper write xxhash64 year year_of_week yow zip zip_with"),builtin:s("array bigint bingtile boolean char codepoints color date decimal double function geometry hyperloglog int integer interval ipaddress joniregexp json json2016 jsonpath kdbtree likepattern map model objectid p4hyperloglog precision qdigest re2jregexp real regressor row setdigest smallint sphericalgeography tdigest time timestamp tinyint uuid varbinary varchar zone"),atoms:s("false true null unknown"),operatorChars:/^[[\]|<>=!\-+*/%]/,dateSQL:s("date time timestamp zone"),support:s("decimallessFloat zerolessFloat hexNumber")})})});var ta=Ke(($u,Ku)=>{(function(o){typeof $u=="object"&&typeof Ku=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("stylus",function(E){for(var N=E.indentUnit,G="",J=w(p),re=/^(a|b|i|s|col|em)$/i,q=w(S),O=w(s),D=w(T),Q=w(g),R=w(v),V=M(v),x=w(b),K=w(C),X=w(h),I=/^\s*([.]{2,3}|&&|\|\||\*\*|[?!=:]?=|[-+*\/%<>]=?|\?:|\~)/,H=M(y),le=w(c),xe=new RegExp(/^\-(moz|ms|o|webkit)-/i),F=w(d),L="",de={},ze,pe,Ee,ge;G.length|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/),B.context.line.firstWord=L?L[0].replace(/^\s*/,""):"",B.context.line.indent=$.indentation(),ze=$.peek(),$.match("//"))return $.skipToEnd(),["comment","comment"];if($.match("/*"))return B.tokenize=qe,qe($,B);if(ze=='"'||ze=="'")return $.next(),B.tokenize=Se(ze),B.tokenize($,B);if(ze=="@")return $.next(),$.eatWhile(/[\w\\-]/),["def",$.current()];if(ze=="#"){if($.next(),$.match(/^[0-9a-f]{3}([0-9a-f]([0-9a-f]{2}){0,2})?\b(?!-)/i))return["atom","atom"];if($.match(/^[a-z][\w-]*/i))return["builtin","hash"]}return $.match(xe)?["meta","vendor-prefixes"]:$.match(/^-?[0-9]?\.?[0-9]/)?($.eatWhile(/[a-z%]/i),["number","unit"]):ze=="!"?($.next(),[$.match(/^(important|optional)/i)?"keyword":"operator","important"]):ze=="."&&$.match(/^\.[a-z][\w-]*/i)?["qualifier","qualifier"]:$.match(V)?($.peek()=="("&&(B.tokenize=je),["property","word"]):$.match(/^[a-z][\w-]*\(/i)?($.backUp(1),["keyword","mixin"]):$.match(/^(\+|-)[a-z][\w-]*\(/i)?($.backUp(1),["keyword","block-mixin"]):$.string.match(/^\s*&/)&&$.match(/^[-_]+[a-z][\w-]*/)?["qualifier","qualifier"]:$.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)?($.backUp(1),["variable-3","reference"]):$.match(/^&{1}\s*$/)?["variable-3","reference"]:$.match(H)?["operator","operator"]:$.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)?$.match(/^(\.|\[)[\w-\'\"\]]+/i,!1)&&!U($.current())?($.match("."),["variable-2","variable-name"]):["variable-2","word"]:$.match(I)?["operator",$.current()]:/[:;,{}\[\]\(\)]/.test(ze)?($.next(),[null,ze]):($.next(),[null,null])}function qe($,B){for(var se=!1,De;(De=$.next())!=null;){if(se&&De=="/"){B.tokenize=null;break}se=De=="*"}return["comment","comment"]}function Se($){return function(B,se){for(var De=!1,nt;(nt=B.next())!=null;){if(nt==$&&!De){$==")"&&B.backUp(1);break}De=!De&&nt=="\\"}return(nt==$||!De&&$!=")")&&(se.tokenize=null),["string","string"]}}function je($,B){return $.next(),$.match(/\s*[\"\')]/,!1)?B.tokenize=null:B.tokenize=Se(")"),[null,"("]}function Ze($,B,se,De){this.type=$,this.indent=B,this.prev=se,this.line=De||{firstWord:"",indent:0}}function ke($,B,se,De){return De=De>=0?De:N,$.context=new Ze(se,B.indentation()+De,$.context),se}function Je($,B){var se=$.context.indent-N;return B=B||!1,$.context=$.context.prev,B&&($.context.indent=se),$.context.type}function He($,B,se){return de[se.context.type]($,B,se)}function Ge($,B,se,De){for(var nt=De||1;nt>0;nt--)se.context=se.context.prev;return He($,B,se)}function U($){return $.toLowerCase()in J}function Z($){return $=$.toLowerCase(),$ in q||$ in X}function ce($){return $.toLowerCase()in le}function Be($){return $.toLowerCase().match(xe)}function te($){var B=$.toLowerCase(),se="variable-2";return U($)?se="tag":ce($)?se="block-keyword":Z($)?se="property":B in D||B in F?se="atom":B=="return"||B in Q?se="keyword":$.match(/^[A-Z]/)&&(se="string"),se}function fe($,B){return Me(B)&&($=="{"||$=="]"||$=="hash"||$=="qualifier")||$=="block-mixin"}function oe($,B){return $=="{"&&B.match(/^\s*\$?[\w-]+/i,!1)}function Ue($,B){return $==":"&&B.match(/^[a-z-]+/,!1)}function we($){return $.sol()||$.string.match(new RegExp("^\\s*"+W($.current())))}function Me($){return $.eol()||$.match(/^\s*$/,!1)}function Le($){var B=/^\s*[-_]*[a-z0-9]+[\w-]*/i,se=typeof $=="string"?$.match(B):$.string.match(B);return se?se[0].replace(/^\s*/,""):""}return de.block=function($,B,se){if($=="comment"&&we(B)||$==","&&Me(B)||$=="mixin")return ke(se,B,"block",0);if(oe($,B))return ke(se,B,"interpolation");if(Me(B)&&$=="]"&&!/^\s*(\.|#|:|\[|\*|&)/.test(B.string)&&!U(Le(B)))return ke(se,B,"block",0);if(fe($,B))return ke(se,B,"block");if($=="}"&&Me(B))return ke(se,B,"block",0);if($=="variable-name")return B.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)||ce(Le(B))?ke(se,B,"variableName"):ke(se,B,"variableName",0);if($=="=")return!Me(B)&&!ce(Le(B))?ke(se,B,"block",0):ke(se,B,"block");if($=="*"&&(Me(B)||B.match(/\s*(,|\.|#|\[|:|{)/,!1)))return ge="tag",ke(se,B,"block");if(Ue($,B))return ke(se,B,"pseudo");if(/@(font-face|media|supports|(-moz-)?document)/.test($))return ke(se,B,Me(B)?"block":"atBlock");if(/@(-(moz|ms|o|webkit)-)?keyframes$/.test($))return ke(se,B,"keyframes");if(/@extends?/.test($))return ke(se,B,"extend",0);if($&&$.charAt(0)=="@")return B.indentation()>0&&Z(B.current().slice(1))?(ge="variable-2","block"):/(@import|@require|@charset)/.test($)?ke(se,B,"block",0):ke(se,B,"block");if($=="reference"&&Me(B))return ke(se,B,"block");if($=="(")return ke(se,B,"parens");if($=="vendor-prefixes")return ke(se,B,"vendorPrefixes");if($=="word"){var De=B.current();if(ge=te(De),ge=="property")return we(B)?ke(se,B,"block",0):(ge="atom","block");if(ge=="tag"){if(/embed|menu|pre|progress|sub|table/.test(De)&&Z(Le(B))||B.string.match(new RegExp("\\[\\s*"+De+"|"+De+"\\s*\\]")))return ge="atom","block";if(re.test(De)&&(we(B)&&B.string.match(/=/)||!we(B)&&!B.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/)&&!U(Le(B))))return ge="variable-2",ce(Le(B))?"block":ke(se,B,"block",0);if(Me(B))return ke(se,B,"block")}if(ge=="block-keyword")return ge="keyword",B.current(/(if|unless)/)&&!we(B)?"block":ke(se,B,"block");if(De=="return")return ke(se,B,"block",0);if(ge=="variable-2"&&B.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/))return ke(se,B,"block")}return se.context.type},de.parens=function($,B,se){if($=="(")return ke(se,B,"parens");if($==")")return se.context.prev.type=="parens"?Je(se):B.string.match(/^[a-z][\w-]*\(/i)&&Me(B)||ce(Le(B))||/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(Le(B))||!B.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/)&&U(Le(B))?ke(se,B,"block"):B.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/)||B.string.match(/^\s*(\(|\)|[0-9])/)||B.string.match(/^\s+[a-z][\w-]*\(/i)||B.string.match(/^\s+[\$-]?[a-z]/i)?ke(se,B,"block",0):Me(B)?ke(se,B,"block"):ke(se,B,"block",0);if($&&$.charAt(0)=="@"&&Z(B.current().slice(1))&&(ge="variable-2"),$=="word"){var De=B.current();ge=te(De),ge=="tag"&&re.test(De)&&(ge="variable-2"),(ge=="property"||De=="to")&&(ge="atom")}return $=="variable-name"?ke(se,B,"variableName"):Ue($,B)?ke(se,B,"pseudo"):se.context.type},de.vendorPrefixes=function($,B,se){return $=="word"?(ge="property",ke(se,B,"block",0)):Je(se)},de.pseudo=function($,B,se){return Z(Le(B.string))?Ge($,B,se):(B.match(/^[a-z-]+/),ge="variable-3",Me(B)?ke(se,B,"block"):Je(se))},de.atBlock=function($,B,se){if($=="(")return ke(se,B,"atBlock_parens");if(fe($,B))return ke(se,B,"block");if(oe($,B))return ke(se,B,"interpolation");if($=="word"){var De=B.current().toLowerCase();if(/^(only|not|and|or)$/.test(De)?ge="keyword":R.hasOwnProperty(De)?ge="tag":K.hasOwnProperty(De)?ge="attribute":x.hasOwnProperty(De)?ge="property":O.hasOwnProperty(De)?ge="string-2":ge=te(B.current()),ge=="tag"&&Me(B))return ke(se,B,"block")}return $=="operator"&&/^(not|and|or)$/.test(B.current())&&(ge="keyword"),se.context.type},de.atBlock_parens=function($,B,se){if($=="{"||$=="}")return se.context.type;if($==")")return Me(B)?ke(se,B,"block"):ke(se,B,"atBlock");if($=="word"){var De=B.current().toLowerCase();return ge=te(De),/^(max|min)/.test(De)&&(ge="property"),ge=="tag"&&(re.test(De)?ge="variable-2":ge="atom"),se.context.type}return de.atBlock($,B,se)},de.keyframes=function($,B,se){return B.indentation()=="0"&&($=="}"&&we(B)||$=="]"||$=="hash"||$=="qualifier"||U(B.current()))?Ge($,B,se):$=="{"?ke(se,B,"keyframes"):$=="}"?we(B)?Je(se,!0):ke(se,B,"keyframes"):$=="unit"&&/^[0-9]+\%$/.test(B.current())?ke(se,B,"keyframes"):$=="word"&&(ge=te(B.current()),ge=="block-keyword")?(ge="keyword",ke(se,B,"keyframes")):/@(font-face|media|supports|(-moz-)?document)/.test($)?ke(se,B,Me(B)?"block":"atBlock"):$=="mixin"?ke(se,B,"block",0):se.context.type},de.interpolation=function($,B,se){return $=="{"&&Je(se)&&ke(se,B,"block"),$=="}"?B.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i)||B.string.match(/^\s*[a-z]/i)&&U(Le(B))?ke(se,B,"block"):!B.string.match(/^(\{|\s*\&)/)||B.match(/\s*[\w-]/,!1)?ke(se,B,"block",0):ke(se,B,"block"):$=="variable-name"?ke(se,B,"variableName",0):($=="word"&&(ge=te(B.current()),ge=="tag"&&(ge="atom")),se.context.type)},de.extend=function($,B,se){return $=="["||$=="="?"extend":$=="]"?Je(se):$=="word"?(ge=te(B.current()),"extend"):Je(se)},de.variableName=function($,B,se){return $=="string"||$=="["||$=="]"||B.current().match(/^(\.|\$)/)?(B.current().match(/^\.[\w-]+/i)&&(ge="variable-2"),"variableName"):Ge($,B,se)},{startState:function($){return{tokenize:null,state:"block",context:new Ze("block",$||0,null)}},token:function($,B){return!B.tokenize&&$.eatSpace()?null:(pe=(B.tokenize||Oe)($,B),pe&&typeof pe=="object"&&(Ee=pe[1],pe=pe[0]),ge=pe,B.state=de[B.state](Ee,$,B),ge)},indent:function($,B,se){var De=$.context,nt=B&&B.charAt(0),dt=De.indent,Pt=Le(B),Ft=se.match(/^\s*/)[0].replace(/\t/g,G).length,Pe=$.context.prev?$.context.prev.line.firstWord:"",xt=$.context.prev?$.context.prev.line.indent:Ft;return De.prev&&(nt=="}"&&(De.type=="block"||De.type=="atBlock"||De.type=="keyframes")||nt==")"&&(De.type=="parens"||De.type=="atBlock_parens")||nt=="{"&&De.type=="at")?dt=De.indent-N:/(\})/.test(nt)||(/@|\$|\d/.test(nt)||/^\{/.test(B)||/^\s*\/(\/|\*)/.test(B)||/^\s*\/\*/.test(Pe)||/^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(B)||/^(\+|-)?[a-z][\w-]*\(/i.test(B)||/^return/.test(B)||ce(Pt)?dt=Ft:/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(nt)||U(Pt)?/\,\s*$/.test(Pe)?dt=xt:/^\s+/.test(se)&&(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(Pe)||U(Pe))?dt=Ft<=xt?xt:xt+N:dt=Ft:!/,\s*$/.test(se)&&(Be(Pt)||Z(Pt))&&(ce(Pe)?dt=Ft<=xt?xt:xt+N:/^\{/.test(Pe)?dt=Ft<=xt?Ft:xt+N:Be(Pe)||Z(Pe)?dt=Ft>=xt?xt:Ft:/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(Pe)||/=\s*$/.test(Pe)||U(Pe)||/^\$[\w-\.\[\]\'\"]/.test(Pe)?dt=xt+N:dt=Ft)),dt},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"indent"}});var p=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video"],v=["domain","regexp","url-prefix","url"],C=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],b=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","dynamic-range","video-dynamic-range"],S=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"],s=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],h=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],T=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","high","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","standard","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale","row","row-reverse","wrap","wrap-reverse","column-reverse","flex-start","flex-end","space-between","space-around","unset"],y=["in","and","or","not","is not","is a","is","isnt","defined","if unless"],c=["for","if","else","unless","from","to"],d=["null","true","false","href","title","type","not-allowed","readonly","disabled"],k=["@font-face","@keyframes","@media","@viewport","@page","@host","@supports","@block","@css"],z=p.concat(v,C,b,S,s,g,T,h,y,c,d,k);function M(E){return E=E.sort(function(N,G){return G>N}),new RegExp("^(("+E.join(")|(")+"))\\b")}function w(E){for(var N={},G=0;G{(function(o){typeof Gu=="object"&&typeof Zu=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";function p(q){for(var O={},D=0;D~^?!",h=":;,.(){}[]",g=/^\-?0b[01][01_]*/,T=/^\-?0o[0-7][0-7_]*/,y=/^\-?0x[\dA-Fa-f][\dA-Fa-f_]*(?:(?:\.[\dA-Fa-f][\dA-Fa-f_]*)?[Pp]\-?\d[\d_]*)?/,c=/^\-?\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee]\-?\d[\d_]*)?/,d=/^\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1/,k=/^\.(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/,z=/^\#[A-Za-z]+/,M=/^@(?:\$\d+|(`?)[_A-Za-z][_A-Za-z$0-9]*\1)/;function w(q,O,D){if(q.sol()&&(O.indented=q.indentation()),q.eatSpace())return null;var Q=q.peek();if(Q=="/"){if(q.match("//"))return q.skipToEnd(),"comment";if(q.match("/*"))return O.tokenize.push(N),N(q,O)}if(q.match(z))return"builtin";if(q.match(M))return"attribute";if(q.match(g)||q.match(T)||q.match(y)||q.match(c))return"number";if(q.match(k))return"property";if(s.indexOf(Q)>-1)return q.next(),"operator";if(h.indexOf(Q)>-1)return q.next(),q.match(".."),"punctuation";var R;if(R=q.match(/("""|"|')/)){var V=E.bind(null,R[0]);return O.tokenize.push(V),V(q,O)}if(q.match(d)){var x=q.current();return S.hasOwnProperty(x)?"variable-2":b.hasOwnProperty(x)?"atom":v.hasOwnProperty(x)?(C.hasOwnProperty(x)&&(O.prev="define"),"keyword"):D=="define"?"def":"variable"}return q.next(),null}function W(){var q=0;return function(O,D,Q){var R=w(O,D,Q);if(R=="punctuation"){if(O.current()=="(")++q;else if(O.current()==")"){if(q==0)return O.backUp(1),D.tokenize.pop(),D.tokenize[D.tokenize.length-1](O,D);--q}}return R}}function E(q,O,D){for(var Q=q.length==1,R,V=!1;R=O.peek();)if(V){if(O.next(),R=="(")return D.tokenize.push(W()),"string";V=!1}else{if(O.match(q))return D.tokenize.pop(),"string";O.next(),V=R=="\\"}return Q&&D.tokenize.pop(),"string"}function N(q,O){for(var D;D=q.next();)if(D==="/"&&q.eat("*"))O.tokenize.push(N);else if(D==="*"&&q.eat("/")){O.tokenize.pop();break}return"comment"}function G(q,O,D){this.prev=q,this.align=O,this.indented=D}function J(q,O){var D=O.match(/^\s*($|\/[\/\*])/,!1)?null:O.column()+1;q.context=new G(q.context,D,q.indented)}function re(q){q.context&&(q.indented=q.context.indented,q.context=q.context.prev)}o.defineMode("swift",function(q){return{startState:function(){return{prev:null,context:null,indented:0,tokenize:[]}},token:function(O,D){var Q=D.prev;D.prev=null;var R=D.tokenize[D.tokenize.length-1]||w,V=R(O,D,Q);if(!V||V=="comment"?D.prev=Q:D.prev||(D.prev=V),V=="punctuation"){var x=/[\(\[\{]|([\]\)\}])/.exec(O.current());x&&(x[1]?re:J)(D,O)}return V},indent:function(O,D){var Q=O.context;if(!Q)return 0;var R=/^[\]\}\)]/.test(D);return Q.align!=null?Q.align-(R?1:0):Q.indented+(R?0:q.indentUnit)},electricInput:/^\s*[\)\}\]]$/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace",closeBrackets:"()[]{}''\"\"``"}}),o.defineMIME("text/x-swift","swift")})});var Vu=Ke((Yu,Qu)=>{(function(o){typeof Yu=="object"&&typeof Qu=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("coffeescript",function(p,v){var C="error";function b(O){return new RegExp("^(("+O.join(")|(")+"))\\b")}var S=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,s=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,h=/^[_A-Za-z$][_A-Za-z$0-9]*/,g=/^@[_A-Za-z$][_A-Za-z$0-9]*/,T=b(["and","or","not","is","isnt","in","instanceof","typeof"]),y=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],c=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],d=b(y.concat(c));y=b(y);var k=/^('{3}|\"{3}|['\"])/,z=/^(\/{3}|\/)/,M=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],w=b(M);function W(O,D){if(O.sol()){D.scope.align===null&&(D.scope.align=!1);var Q=D.scope.offset;if(O.eatSpace()){var R=O.indentation();return R>Q&&D.scope.type=="coffee"?"indent":R0&&J(O,D)}if(O.eatSpace())return null;var V=O.peek();if(O.match("####"))return O.skipToEnd(),"comment";if(O.match("###"))return D.tokenize=N,D.tokenize(O,D);if(V==="#")return O.skipToEnd(),"comment";if(O.match(/^-?[0-9\.]/,!1)){var x=!1;if(O.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(x=!0),O.match(/^-?\d+\.\d*/)&&(x=!0),O.match(/^-?\.\d+/)&&(x=!0),x)return O.peek()=="."&&O.backUp(1),"number";var K=!1;if(O.match(/^-?0x[0-9a-f]+/i)&&(K=!0),O.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(K=!0),O.match(/^-?0(?![\dx])/i)&&(K=!0),K)return"number"}if(O.match(k))return D.tokenize=E(O.current(),!1,"string"),D.tokenize(O,D);if(O.match(z)){if(O.current()!="/"||O.match(/^.*\//,!1))return D.tokenize=E(O.current(),!0,"string-2"),D.tokenize(O,D);O.backUp(1)}return O.match(S)||O.match(T)?"operator":O.match(s)?"punctuation":O.match(w)?"atom":O.match(g)||D.prop&&O.match(h)?"property":O.match(d)?"keyword":O.match(h)?"variable":(O.next(),C)}function E(O,D,Q){return function(R,V){for(;!R.eol();)if(R.eatWhile(/[^'"\/\\]/),R.eat("\\")){if(R.next(),D&&R.eol())return Q}else{if(R.match(O))return V.tokenize=W,Q;R.eat(/['"\/]/)}return D&&(v.singleLineStringErrors?Q=C:V.tokenize=W),Q}}function N(O,D){for(;!O.eol();){if(O.eatWhile(/[^#]/),O.match("###")){D.tokenize=W;break}O.eatWhile("#")}return"comment"}function G(O,D,Q){Q=Q||"coffee";for(var R=0,V=!1,x=null,K=D.scope;K;K=K.prev)if(K.type==="coffee"||K.type=="}"){R=K.offset+p.indentUnit;break}Q!=="coffee"?(V=null,x=O.column()+O.current().length):D.scope.align&&(D.scope.align=!1),D.scope={offset:R,type:Q,prev:D.scope,align:V,alignOffset:x}}function J(O,D){if(D.scope.prev)if(D.scope.type==="coffee"){for(var Q=O.indentation(),R=!1,V=D.scope;V;V=V.prev)if(Q===V.offset){R=!0;break}if(!R)return!0;for(;D.scope.prev&&D.scope.offset!==Q;)D.scope=D.scope.prev;return!1}else return D.scope=D.scope.prev,!1}function re(O,D){var Q=D.tokenize(O,D),R=O.current();R==="return"&&(D.dedent=!0),((R==="->"||R==="=>")&&O.eol()||Q==="indent")&&G(O,D);var V="[({".indexOf(R);if(V!==-1&&G(O,D,"])}".slice(V,V+1)),y.exec(R)&&G(O,D),R=="then"&&J(O,D),Q==="dedent"&&J(O,D))return C;if(V="])}".indexOf(R),V!==-1){for(;D.scope.type=="coffee"&&D.scope.prev;)D.scope=D.scope.prev;D.scope.type==R&&(D.scope=D.scope.prev)}return D.dedent&&O.eol()&&(D.scope.type=="coffee"&&D.scope.prev&&(D.scope=D.scope.prev),D.dedent=!1),Q}var q={startState:function(O){return{tokenize:W,scope:{offset:O||0,type:"coffee",prev:null,align:!1},prop:!1,dedent:0}},token:function(O,D){var Q=D.scope.align===null&&D.scope;Q&&O.sol()&&(Q.align=!1);var R=re(O,D);return R&&R!="comment"&&(Q&&(Q.align=!0),D.prop=R=="punctuation"&&O.current()=="."),R},indent:function(O,D){if(O.tokenize!=W)return 0;var Q=O.scope,R=D&&"])}".indexOf(D.charAt(0))>-1;if(R)for(;Q.type=="coffee"&&Q.prev;)Q=Q.prev;var V=R&&Q.type===D.charAt(0);return Q.align?Q.alignOffset-(V?1:0):(V?Q.prev:Q).offset},lineComment:"#",fold:"indent"};return q}),o.defineMIME("application/vnd.coffeescript","coffeescript"),o.defineMIME("text/x-coffeescript","coffeescript"),o.defineMIME("text/coffeescript","coffeescript")})});var tc=Ke((Ju,ec)=>{(function(o){typeof Ju=="object"&&typeof ec=="object"?o(We(),vn(),gn(),Qn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("pug",function(p){var v="keyword",C="meta",b="builtin",S="qualifier",s={"{":"}","(":")","[":"]"},h=o.getMode(p,"javascript");function g(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=o.startState(h),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}g.prototype.copy=function(){var U=new g;return U.javaScriptLine=this.javaScriptLine,U.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,U.javaScriptArguments=this.javaScriptArguments,U.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,U.isInterpolating=this.isInterpolating,U.interpolationNesting=this.interpolationNesting,U.jsState=o.copyState(h,this.jsState),U.innerMode=this.innerMode,this.innerMode&&this.innerState&&(U.innerState=o.copyState(this.innerMode,this.innerState)),U.restOfLine=this.restOfLine,U.isIncludeFiltered=this.isIncludeFiltered,U.isEach=this.isEach,U.lastTag=this.lastTag,U.scriptType=this.scriptType,U.isAttrs=this.isAttrs,U.attrsNest=this.attrsNest.slice(),U.inAttributeName=this.inAttributeName,U.attributeIsType=this.attributeIsType,U.attrValue=this.attrValue,U.indentOf=this.indentOf,U.indentToken=this.indentToken,U.innerModeForLine=this.innerModeForLine,U};function T(U,Z){if(U.sol()&&(Z.javaScriptLine=!1,Z.javaScriptLineExcludesColon=!1),Z.javaScriptLine){if(Z.javaScriptLineExcludesColon&&U.peek()===":"){Z.javaScriptLine=!1,Z.javaScriptLineExcludesColon=!1;return}var ce=h.token(U,Z.jsState);return U.eol()&&(Z.javaScriptLine=!1),ce||!0}}function y(U,Z){if(Z.javaScriptArguments){if(Z.javaScriptArgumentsDepth===0&&U.peek()!=="("){Z.javaScriptArguments=!1;return}if(U.peek()==="("?Z.javaScriptArgumentsDepth++:U.peek()===")"&&Z.javaScriptArgumentsDepth--,Z.javaScriptArgumentsDepth===0){Z.javaScriptArguments=!1;return}var ce=h.token(U,Z.jsState);return ce||!0}}function c(U){if(U.match(/^yield\b/))return"keyword"}function d(U){if(U.match(/^(?:doctype) *([^\n]+)?/))return C}function k(U,Z){if(U.match("#{"))return Z.isInterpolating=!0,Z.interpolationNesting=0,"punctuation"}function z(U,Z){if(Z.isInterpolating){if(U.peek()==="}"){if(Z.interpolationNesting--,Z.interpolationNesting<0)return U.next(),Z.isInterpolating=!1,"punctuation"}else U.peek()==="{"&&Z.interpolationNesting++;return h.token(U,Z.jsState)||!0}}function M(U,Z){if(U.match(/^case\b/))return Z.javaScriptLine=!0,v}function w(U,Z){if(U.match(/^when\b/))return Z.javaScriptLine=!0,Z.javaScriptLineExcludesColon=!0,v}function W(U){if(U.match(/^default\b/))return v}function E(U,Z){if(U.match(/^extends?\b/))return Z.restOfLine="string",v}function N(U,Z){if(U.match(/^append\b/))return Z.restOfLine="variable",v}function G(U,Z){if(U.match(/^prepend\b/))return Z.restOfLine="variable",v}function J(U,Z){if(U.match(/^block\b *(?:(prepend|append)\b)?/))return Z.restOfLine="variable",v}function re(U,Z){if(U.match(/^include\b/))return Z.restOfLine="string",v}function q(U,Z){if(U.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&U.match("include"))return Z.isIncludeFiltered=!0,v}function O(U,Z){if(Z.isIncludeFiltered){var ce=H(U,Z);return Z.isIncludeFiltered=!1,Z.restOfLine="string",ce}}function D(U,Z){if(U.match(/^mixin\b/))return Z.javaScriptLine=!0,v}function Q(U,Z){if(U.match(/^\+([-\w]+)/))return U.match(/^\( *[-\w]+ *=/,!1)||(Z.javaScriptArguments=!0,Z.javaScriptArgumentsDepth=0),"variable";if(U.match("+#{",!1))return U.next(),Z.mixinCallAfter=!0,k(U,Z)}function R(U,Z){if(Z.mixinCallAfter)return Z.mixinCallAfter=!1,U.match(/^\( *[-\w]+ *=/,!1)||(Z.javaScriptArguments=!0,Z.javaScriptArgumentsDepth=0),!0}function V(U,Z){if(U.match(/^(if|unless|else if|else)\b/))return Z.javaScriptLine=!0,v}function x(U,Z){if(U.match(/^(- *)?(each|for)\b/))return Z.isEach=!0,v}function K(U,Z){if(Z.isEach){if(U.match(/^ in\b/))return Z.javaScriptLine=!0,Z.isEach=!1,v;if(U.sol()||U.eol())Z.isEach=!1;else if(U.next()){for(;!U.match(/^ in\b/,!1)&&U.next(););return"variable"}}}function X(U,Z){if(U.match(/^while\b/))return Z.javaScriptLine=!0,v}function I(U,Z){var ce;if(ce=U.match(/^(\w(?:[-:\w]*\w)?)\/?/))return Z.lastTag=ce[1].toLowerCase(),Z.lastTag==="script"&&(Z.scriptType="application/javascript"),"tag"}function H(U,Z){if(U.match(/^:([\w\-]+)/)){var ce;return p&&p.innerModes&&(ce=p.innerModes(U.current().substring(1))),ce||(ce=U.current().substring(1)),typeof ce=="string"&&(ce=o.getMode(p,ce)),je(U,Z,ce),"atom"}}function le(U,Z){if(U.match(/^(!?=|-)/))return Z.javaScriptLine=!0,"punctuation"}function xe(U){if(U.match(/^#([\w-]+)/))return b}function F(U){if(U.match(/^\.([\w-]+)/))return S}function L(U,Z){if(U.peek()=="(")return U.next(),Z.isAttrs=!0,Z.attrsNest=[],Z.inAttributeName=!0,Z.attrValue="",Z.attributeIsType=!1,"punctuation"}function de(U,Z){if(Z.isAttrs){if(s[U.peek()]&&Z.attrsNest.push(s[U.peek()]),Z.attrsNest[Z.attrsNest.length-1]===U.peek())Z.attrsNest.pop();else if(U.eat(")"))return Z.isAttrs=!1,"punctuation";if(Z.inAttributeName&&U.match(/^[^=,\)!]+/))return(U.peek()==="="||U.peek()==="!")&&(Z.inAttributeName=!1,Z.jsState=o.startState(h),Z.lastTag==="script"&&U.current().trim().toLowerCase()==="type"?Z.attributeIsType=!0:Z.attributeIsType=!1),"attribute";var ce=h.token(U,Z.jsState);if(Z.attributeIsType&&ce==="string"&&(Z.scriptType=U.current().toString()),Z.attrsNest.length===0&&(ce==="string"||ce==="variable"||ce==="keyword"))try{return Function("","var x "+Z.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),Z.inAttributeName=!0,Z.attrValue="",U.backUp(U.current().length),de(U,Z)}catch{}return Z.attrValue+=U.current(),ce||!0}}function ze(U,Z){if(U.match(/^&attributes\b/))return Z.javaScriptArguments=!0,Z.javaScriptArgumentsDepth=0,"keyword"}function pe(U){if(U.sol()&&U.eatSpace())return"indent"}function Ee(U,Z){if(U.match(/^ *\/\/(-)?([^\n]*)/))return Z.indentOf=U.indentation(),Z.indentToken="comment","comment"}function ge(U){if(U.match(/^: */))return"colon"}function Oe(U,Z){if(U.match(/^(?:\| ?| )([^\n]+)/))return"string";if(U.match(/^(<[^\n]*)/,!1))return je(U,Z,"htmlmixed"),Z.innerModeForLine=!0,Ze(U,Z,!0)}function qe(U,Z){if(U.eat(".")){var ce=null;return Z.lastTag==="script"&&Z.scriptType.toLowerCase().indexOf("javascript")!=-1?ce=Z.scriptType.toLowerCase().replace(/"|'/g,""):Z.lastTag==="style"&&(ce="css"),je(U,Z,ce),"dot"}}function Se(U){return U.next(),null}function je(U,Z,ce){ce=o.mimeModes[ce]||ce,ce=p.innerModes&&p.innerModes(ce)||ce,ce=o.mimeModes[ce]||ce,ce=o.getMode(p,ce),Z.indentOf=U.indentation(),ce&&ce.name!=="null"?Z.innerMode=ce:Z.indentToken="string"}function Ze(U,Z,ce){if(U.indentation()>Z.indentOf||Z.innerModeForLine&&!U.sol()||ce)return Z.innerMode?(Z.innerState||(Z.innerState=Z.innerMode.startState?o.startState(Z.innerMode,U.indentation()):{}),U.hideFirstChars(Z.indentOf+2,function(){return Z.innerMode.token(U,Z.innerState)||!0})):(U.skipToEnd(),Z.indentToken);U.sol()&&(Z.indentOf=1/0,Z.indentToken=null,Z.innerMode=null,Z.innerState=null)}function ke(U,Z){if(U.sol()&&(Z.restOfLine=""),Z.restOfLine){U.skipToEnd();var ce=Z.restOfLine;return Z.restOfLine="",ce}}function Je(){return new g}function He(U){return U.copy()}function Ge(U,Z){var ce=Ze(U,Z)||ke(U,Z)||z(U,Z)||O(U,Z)||K(U,Z)||de(U,Z)||T(U,Z)||y(U,Z)||R(U,Z)||c(U)||d(U)||k(U,Z)||M(U,Z)||w(U,Z)||W(U)||E(U,Z)||N(U,Z)||G(U,Z)||J(U,Z)||re(U,Z)||q(U,Z)||D(U,Z)||Q(U,Z)||V(U,Z)||x(U,Z)||X(U,Z)||I(U,Z)||H(U,Z)||le(U,Z)||xe(U)||F(U)||L(U,Z)||ze(U,Z)||pe(U)||Oe(U,Z)||Ee(U,Z)||ge(U)||qe(U,Z)||Se(U);return ce===!0?null:ce}return{startState:Je,copyState:He,token:Ge}},"javascript","css","htmlmixed"),o.defineMIME("text/x-pug","pug"),o.defineMIME("text/x-jade","pug")})});var ic=Ke((rc,nc)=>{(function(o){typeof rc=="object"&&typeof nc=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.multiplexingMode=function(p){var v=Array.prototype.slice.call(arguments,1);function C(b,S,s,h){if(typeof S=="string"){var g=b.indexOf(S,s);return h&&g>-1?g+S.length:g}var T=S.exec(s?b.slice(s):b);return T?T.index+s+(h?T[0].length:0):-1}return{startState:function(){return{outer:o.startState(p),innerActive:null,inner:null,startingInner:!1}},copyState:function(b){return{outer:o.copyState(p,b.outer),innerActive:b.innerActive,inner:b.innerActive&&o.copyState(b.innerActive.mode,b.inner),startingInner:b.startingInner}},token:function(b,S){if(S.innerActive){var z=S.innerActive,h=b.string;if(!z.close&&b.sol())return S.innerActive=S.inner=null,this.token(b,S);var y=z.close&&!S.startingInner?C(h,z.close,b.pos,z.parseDelimiters):-1;if(y==b.pos&&!z.parseDelimiters)return b.match(z.close),S.innerActive=S.inner=null,z.delimStyle&&z.delimStyle+" "+z.delimStyle+"-close";y>-1&&(b.string=h.slice(0,y));var M=z.mode.token(b,S.inner);return y>-1?b.string=h:b.pos>b.start&&(S.startingInner=!1),y==b.pos&&z.parseDelimiters&&(S.innerActive=S.inner=null),z.innerStyle&&(M?M=M+" "+z.innerStyle:M=z.innerStyle),M}else{for(var s=1/0,h=b.string,g=0;g{(function(o){typeof oc=="object"&&typeof ac=="object"?o(We(),Di(),ic()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple","../../addon/mode/multiplex"],o):o(CodeMirror)})(function(o){"use strict";o.defineSimpleMode("handlebars-tags",{start:[{regex:/\{\{\{/,push:"handlebars_raw",token:"tag"},{regex:/\{\{!--/,push:"dash_comment",token:"comment"},{regex:/\{\{!/,push:"comment",token:"comment"},{regex:/\{\{/,push:"handlebars",token:"tag"}],handlebars_raw:[{regex:/\}\}\}/,pop:!0,token:"tag"}],handlebars:[{regex:/\}\}/,pop:!0,token:"tag"},{regex:/"(?:[^\\"]|\\.)*"?/,token:"string"},{regex:/'(?:[^\\']|\\.)*'?/,token:"string"},{regex:/>|[#\/]([A-Za-z_]\w*)/,token:"keyword"},{regex:/(?:else|this)\b/,token:"keyword"},{regex:/\d+/i,token:"number"},{regex:/=|~|@|true|false/,token:"atom"},{regex:/(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/,token:"variable-2"}],dash_comment:[{regex:/--\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],comment:[{regex:/\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],meta:{blockCommentStart:"{{--",blockCommentEnd:"--}}"}}),o.defineMode("handlebars",function(p,v){var C=o.getMode(p,"handlebars-tags");return!v||!v.base?C:o.multiplexingMode(o.getMode(p,v.base),{open:"{{",close:/\}\}\}?/,mode:C,parseDelimiters:!0})}),o.defineMIME("text/x-handlebars-template","handlebars")})});var cc=Ke((sc,uc)=>{(function(o){"use strict";typeof sc=="object"&&typeof uc=="object"?o(We(),Yn(),mn(),vn(),Vu(),gn(),ea(),ta(),tc(),lc()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../../addon/mode/overlay","../xml/xml","../javascript/javascript","../coffeescript/coffeescript","../css/css","../sass/sass","../stylus/stylus","../pug/pug","../handlebars/handlebars"],o):o(CodeMirror)})(function(o){var p={script:[["lang",/coffee(script)?/,"coffeescript"],["type",/^(?:text|application)\/(?:x-)?coffee(?:script)?$/,"coffeescript"],["lang",/^babel$/,"javascript"],["type",/^text\/babel$/,"javascript"],["type",/^text\/ecmascript-\d+$/,"javascript"]],style:[["lang",/^stylus$/i,"stylus"],["lang",/^sass$/i,"sass"],["lang",/^less$/i,"text/x-less"],["lang",/^scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?styl(us)?$/i,"stylus"],["type",/^text\/sass/i,"sass"],["type",/^(text\/)?(x-)?scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?less$/i,"text/x-less"]],template:[["lang",/^vue-template$/i,"vue"],["lang",/^pug$/i,"pug"],["lang",/^handlebars$/i,"handlebars"],["type",/^(text\/)?(x-)?pug$/i,"pug"],["type",/^text\/x-handlebars-template$/i,"handlebars"],[null,null,"vue-template"]]};o.defineMode("vue-template",function(v,C){var b={token:function(S){if(S.match(/^\{\{.*?\}\}/))return"meta mustache";for(;S.next()&&!S.match("{{",!1););return null}};return o.overlayMode(o.getMode(v,C.backdrop||"text/html"),b)}),o.defineMode("vue",function(v){return o.getMode(v,{name:"htmlmixed",tags:p})},"htmlmixed","xml","javascript","coffeescript","css","sass","stylus","pug","handlebars"),o.defineMIME("script/x-vue","vue"),o.defineMIME("text/x-vue","vue")})});var pc=Ke((fc,dc)=>{(function(o){typeof fc=="object"&&typeof dc=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("yaml",function(){var p=["true","false","on","off","yes","no"],v=new RegExp("\\b(("+p.join(")|(")+"))$","i");return{token:function(C,b){var S=C.peek(),s=b.escaped;if(b.escaped=!1,S=="#"&&(C.pos==0||/\s/.test(C.string.charAt(C.pos-1))))return C.skipToEnd(),"comment";if(C.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(b.literal&&C.indentation()>b.keyCol)return C.skipToEnd(),"string";if(b.literal&&(b.literal=!1),C.sol()){if(b.keyCol=0,b.pair=!1,b.pairStart=!1,C.match("---")||C.match("..."))return"def";if(C.match(/\s*-\s+/))return"meta"}if(C.match(/^(\{|\}|\[|\])/))return S=="{"?b.inlinePairs++:S=="}"?b.inlinePairs--:S=="["?b.inlineList++:b.inlineList--,"meta";if(b.inlineList>0&&!s&&S==",")return C.next(),"meta";if(b.inlinePairs>0&&!s&&S==",")return b.keyCol=0,b.pair=!1,b.pairStart=!1,C.next(),"meta";if(b.pairStart){if(C.match(/^\s*(\||\>)\s*/))return b.literal=!0,"meta";if(C.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(b.inlinePairs==0&&C.match(/^\s*-?[0-9\.\,]+\s?$/)||b.inlinePairs>0&&C.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(C.match(v))return"keyword"}return!b.pair&&C.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^\s,\[\]{}#&*!|>'"%@`])[^#:]*(?=:($|\s))/)?(b.pair=!0,b.keyCol=C.indentation(),"atom"):b.pair&&C.match(/^:\s*/)?(b.pairStart=!0,"meta"):(b.pairStart=!1,b.escaped=S=="\\",C.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},lineComment:"#",fold:"indent"}}),o.defineMIME("text/x-yaml","yaml"),o.defineMIME("text/yaml","yaml")})});var $d={};function qd(o){for(var p;(p=Md.exec(o))!==null;){var v=p[0];if(v.indexOf("target=")===-1){var C=v.replace(/>$/,' target="_blank">');o=o.replace(v,C)}}return o}function Fd(o){for(var p=new DOMParser,v=p.parseFromString(o,"text/html"),C=v.getElementsByTagName("li"),b=0;b0){for(var d=document.createElement("i"),k=0;k=0&&(y=s.getLineHandle(d),!v(y));d--);var W=s.getTokenAt({line:d,ch:1}),E=C(W).fencedChars,N,G,J,re;v(s.getLineHandle(h.line))?(N="",G=h.line):v(s.getLineHandle(h.line-1))?(N="",G=h.line-1):(N=E+` +`,G=h.line),v(s.getLineHandle(g.line))?(J="",re=g.line,g.ch===0&&(re+=1)):g.ch!==0&&v(s.getLineHandle(g.line+1))?(J="",re=g.line+1):(J=E+` +`,re=g.line+1),g.ch===0&&(re-=1),s.operation(function(){s.replaceRange(J,{line:re,ch:0},{line:re+(J?0:1),ch:0}),s.replaceRange(N,{line:G,ch:0},{line:G+(N?0:1),ch:0})}),s.setSelection({line:G+(N?1:0),ch:0},{line:re+(N?1:-1),ch:0}),s.focus()}else{var q=h.line;if(v(s.getLineHandle(h.line))&&(b(s,h.line+1)==="fenced"?(d=h.line,q=h.line+1):(k=h.line,q=h.line-1)),d===void 0)for(d=q;d>=0&&(y=s.getLineHandle(d),!v(y));d--);if(k===void 0)for(z=s.lineCount(),k=q;k=0;d--)if(y=s.getLineHandle(d),!y.text.match(/^\s*$/)&&b(s,d,y)!=="indented"){d+=1;break}for(z=s.lineCount(),k=h.line;k\s+/,"unordered-list":C,"ordered-list":C},T=function(z,M){var w={quote:">","unordered-list":v,"ordered-list":"%%i."};return w[z].replace("%%i",M)},y=function(z,M){var w={quote:">","unordered-list":"\\"+v,"ordered-list":"\\d+."},W=new RegExp(w[z]);return M&&W.test(M)},c=function(z,M,w){var W=C.exec(M),E=T(z,d);return W!==null?(y(z,W[2])&&(E=""),M=W[1]+E+W[3]+M.replace(b,"").replace(g[z],"$1")):w==!1&&(M=E+" "+M),M},d=1,k=s.line;k<=h.line;k++)(function(z){var M=o.getLine(z);S[p]?M=M.replace(g[p],"$1"):(p=="unordered-list"&&(M=c("ordered-list",M,!0)),M=c(p,M,!1),d+=1),o.replaceRange(M,{line:z,ch:0},{line:z,ch:99999999999999})})(k);o.focus()}}function xc(o,p,v,C){if(!(!o.codemirror||o.isPreviewActive())){var b=o.codemirror,S=Tr(b),s=S[p];if(!s){Rr(b,s,v,C);return}var h=b.getCursor("start"),g=b.getCursor("end"),T=b.getLine(h.line),y=T.slice(0,h.ch),c=T.slice(h.ch);p=="link"?y=y.replace(/(.*)[^!]\[/,"$1"):p=="image"&&(y=y.replace(/(.*)!\[$/,"$1")),c=c.replace(/]\(.*?\)/,""),b.replaceRange(y+c,{line:h.line,ch:0},{line:h.line,ch:99999999999999}),h.ch-=v[0].length,h!==g&&(g.ch-=v[0].length),b.setSelection(h,g),b.focus()}}function sa(o,p,v,C){if(!(!o.codemirror||o.isPreviewActive())){C=typeof C>"u"?v:C;var b=o.codemirror,S=Tr(b),s,h=v,g=C,T=b.getCursor("start"),y=b.getCursor("end");S[p]?(s=b.getLine(T.line),h=s.slice(0,T.ch),g=s.slice(T.ch),p=="bold"?(h=h.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),g=g.replace(/(\*\*|__)/,"")):p=="italic"?(h=h.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),g=g.replace(/(\*|_)/,"")):p=="strikethrough"&&(h=h.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),g=g.replace(/(\*\*|~~)/,"")),b.replaceRange(h+g,{line:T.line,ch:0},{line:T.line,ch:99999999999999}),p=="bold"||p=="strikethrough"?(T.ch-=2,T!==y&&(y.ch-=2)):p=="italic"&&(T.ch-=1,T!==y&&(y.ch-=1))):(s=b.getSelection(),p=="bold"?(s=s.split("**").join(""),s=s.split("__").join("")):p=="italic"?(s=s.split("*").join(""),s=s.split("_").join("")):p=="strikethrough"&&(s=s.split("~~").join("")),b.replaceSelection(h+s+g),T.ch+=v.length,y.ch=T.ch+s.length),b.setSelection(T,y),b.focus()}}function Pd(o){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active"))for(var p=o.getCursor("start"),v=o.getCursor("end"),C,b=p.line;b<=v.line;b++)C=o.getLine(b),C=C.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),o.replaceRange(C,{line:b,ch:0},{line:b,ch:99999999999999})}function Fi(o,p){if(Math.abs(o)<1024)return""+o+p[0];var v=0;do o/=1024,++v;while(Math.abs(o)>=1024&&v=19968?C+=v[b].length:C+=1;return C}function Te(o){o=o||{},o.parent=this;var p=!0;if(o.autoDownloadFontAwesome===!1&&(p=!1),o.autoDownloadFontAwesome!==!0)for(var v=document.styleSheets,C=0;C-1&&(p=!1);if(p){var b=document.createElement("link");b.rel="stylesheet",b.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(b)}if(o.element)this.element=o.element;else if(o.element===null){console.log("EasyMDE: Error. No element was found.");return}if(o.toolbar===void 0){o.toolbar=[];for(var S in Pr)Object.prototype.hasOwnProperty.call(Pr,S)&&(S.indexOf("separator-")!=-1&&o.toolbar.push("|"),(Pr[S].default===!0||o.showIcons&&o.showIcons.constructor===Array&&o.showIcons.indexOf(S)!=-1)&&o.toolbar.push(S))}if(Object.prototype.hasOwnProperty.call(o,"previewClass")||(o.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(o,"status")||(o.status=["autosave","lines","words","cursor"],o.uploadImage&&o.status.unshift("upload-image")),o.previewRender||(o.previewRender=function(h){return this.parent.markdown(h)}),o.parsingConfig=fr({highlightFormatting:!0},o.parsingConfig||{}),o.insertTexts=fr({},jd,o.insertTexts||{}),o.promptTexts=fr({},Rd,o.promptTexts||{}),o.blockStyles=fr({},Bd,o.blockStyles||{}),o.autosave!=null&&(o.autosave.timeFormat=fr({},Hd,o.autosave.timeFormat||{})),o.iconClassMap=fr({},et,o.iconClassMap||{}),o.shortcuts=fr({},Ad,o.shortcuts||{}),o.maxHeight=o.maxHeight||void 0,o.direction=o.direction||"ltr",typeof o.maxHeight<"u"?o.minHeight=o.maxHeight:o.minHeight=o.minHeight||"300px",o.errorCallback=o.errorCallback||function(h){alert(h)},o.uploadImage=o.uploadImage||!1,o.imageMaxSize=o.imageMaxSize||2097152,o.imageAccept=o.imageAccept||"image/png, image/jpeg, image/gif, image/avif",o.imageTexts=fr({},Wd,o.imageTexts||{}),o.errorMessages=fr({},Ud,o.errorMessages||{}),o.imagePathAbsolute=o.imagePathAbsolute||!1,o.imageCSRFName=o.imageCSRFName||"csrfmiddlewaretoken",o.imageCSRFHeader=o.imageCSRFHeader||!1,o.autosave!=null&&o.autosave.unique_id!=null&&o.autosave.unique_id!=""&&(o.autosave.uniqueId=o.autosave.unique_id),o.overlayMode&&o.overlayMode.combine===void 0&&(o.overlayMode.combine=!0),this.options=o,this.render(),o.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(o.initialValue),o.uploadImage){var s=this;this.codemirror.on("dragenter",function(h,g){s.updateStatusBar("upload-image",s.options.imageTexts.sbOnDragEnter),g.stopPropagation(),g.preventDefault()}),this.codemirror.on("dragend",function(h,g){s.updateStatusBar("upload-image",s.options.imageTexts.sbInit),g.stopPropagation(),g.preventDefault()}),this.codemirror.on("dragleave",function(h,g){s.updateStatusBar("upload-image",s.options.imageTexts.sbInit),g.stopPropagation(),g.preventDefault()}),this.codemirror.on("dragover",function(h,g){s.updateStatusBar("upload-image",s.options.imageTexts.sbOnDragEnter),g.stopPropagation(),g.preventDefault()}),this.codemirror.on("drop",function(h,g){g.stopPropagation(),g.preventDefault(),o.imageUploadFunction?s.uploadImagesUsingCustomFunction(o.imageUploadFunction,g.dataTransfer.files):s.uploadImages(g.dataTransfer.files)}),this.codemirror.on("paste",function(h,g){o.imageUploadFunction?s.uploadImagesUsingCustomFunction(o.imageUploadFunction,g.clipboardData.files):s.uploadImages(g.clipboardData.files)})}}function kc(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}var mc,Md,Vn,Ad,Dd,ra,hc,et,Pr,jd,Rd,Hd,Bd,Wd,Ud,wc=Cd(()=>{mc=/Mac/.test(navigator.platform),Md=new RegExp(/()+?/g),Vn={toggleBold:Ii,toggleItalic:Ni,drawLink:Gi,toggleHeadingSmaller:Jn,toggleHeadingBigger:Ri,drawImage:Zi,toggleBlockquote:ji,toggleOrderedList:$i,toggleUnorderedList:Ui,toggleCodeBlock:Pi,togglePreview:Ji,toggleStrikethrough:Oi,toggleHeading1:Hi,toggleHeading2:Bi,toggleHeading3:Wi,toggleHeading4:na,toggleHeading5:ia,toggleHeading6:oa,cleanBlock:Ki,drawTable:Xi,drawHorizontalRule:Yi,undo:Qi,redo:Vi,toggleSideBySide:bn,toggleFullScreen:jr},Ad={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",toggleHeading1:"Ctrl+Alt+1",toggleHeading2:"Ctrl+Alt+2",toggleHeading3:"Ctrl+Alt+3",toggleHeading4:"Ctrl+Alt+4",toggleHeading5:"Ctrl+Alt+5",toggleHeading6:"Ctrl+Alt+6",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},Dd=function(o){for(var p in Vn)if(Vn[p]===o)return p;return null},ra=function(){var o=!1;return function(p){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(p)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(p.substr(0,4)))&&(o=!0)}(navigator.userAgent||navigator.vendor||window.opera),o};hc="";et={bold:"fa fa-bold",italic:"fa fa-italic",strikethrough:"fa fa-strikethrough",heading:"fa fa-header fa-heading","heading-smaller":"fa fa-header fa-heading header-smaller","heading-bigger":"fa fa-header fa-heading header-bigger","heading-1":"fa fa-header fa-heading header-1","heading-2":"fa fa-header fa-heading header-2","heading-3":"fa fa-header fa-heading header-3",code:"fa fa-code",quote:"fa fa-quote-left","ordered-list":"fa fa-list-ol","unordered-list":"fa fa-list-ul","clean-block":"fa fa-eraser",link:"fa fa-link",image:"fa fa-image","upload-image":"fa fa-image",table:"fa fa-table","horizontal-rule":"fa fa-minus",preview:"fa fa-eye","side-by-side":"fa fa-columns",fullscreen:"fa fa-arrows-alt",guide:"fa fa-question-circle",undo:"fa fa-undo",redo:"fa fa-repeat fa-redo"},Pr={bold:{name:"bold",action:Ii,className:et.bold,title:"Bold",default:!0},italic:{name:"italic",action:Ni,className:et.italic,title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:Oi,className:et.strikethrough,title:"Strikethrough"},heading:{name:"heading",action:Jn,className:et.heading,title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:Jn,className:et["heading-smaller"],title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:Ri,className:et["heading-bigger"],title:"Bigger Heading"},"heading-1":{name:"heading-1",action:Hi,className:et["heading-1"],title:"Big Heading"},"heading-2":{name:"heading-2",action:Bi,className:et["heading-2"],title:"Medium Heading"},"heading-3":{name:"heading-3",action:Wi,className:et["heading-3"],title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:Pi,className:et.code,title:"Code"},quote:{name:"quote",action:ji,className:et.quote,title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:Ui,className:et["unordered-list"],title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:$i,className:et["ordered-list"],title:"Numbered List",default:!0},"clean-block":{name:"clean-block",action:Ki,className:et["clean-block"],title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:Gi,className:et.link,title:"Create Link",default:!0},image:{name:"image",action:Zi,className:et.image,title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:aa,className:et["upload-image"],title:"Import an image"},table:{name:"table",action:Xi,className:et.table,title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:Yi,className:et["horizontal-rule"],title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:Ji,className:et.preview,noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:bn,className:et["side-by-side"],noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:jr,className:et.fullscreen,noDisable:!0,noMobile:!0,title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://www.markdownguide.org/basic-syntax/",className:et.guide,noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:Qi,className:et.undo,noDisable:!0,title:"Undo"},redo:{name:"redo",action:Vi,className:et.redo,noDisable:!0,title:"Redo"}},jd={link:["[","](#url#)"],image:["![","](#url#)"],uploadedImage:["![](#url#)",""],table:["",` + +| Column 1 | Column 2 | Column 3 | +| -------- | -------- | -------- | +| Text | Text | Text | + +`],horizontalRule:["",` + +----- + +`]},Rd={link:"URL for the link:",image:"URL of the image:"},Hd={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Bd={bold:"**",code:"```",italic:"*"},Wd={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},Ud={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#). +Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};Te.prototype.uploadImages=function(o,p,v){if(o.length!==0){for(var C=[],b=0;b=0;re--){let q=G[re];if(q&&q.tagName==="INPUT"&&!q.closest(".editor-toolbar")){q.focus();break}}}}for(var s in p.shortcuts)p.shortcuts[s]!==null&&Vn[s]!==null&&function(E){C[vc(p.shortcuts[E])]=function(){var N=Vn[E];typeof N=="function"?N(v):typeof N=="string"&&window.open(N,"_blank")}}(s);C.Enter="newlineAndIndentContinueMarkdownList",C.Tab=E=>{let N=E.getSelection();N&&N.length>0?E.execCommand("indentMore"):b(E)},C["Shift-Tab"]=E=>{let N=E.getSelection();N&&N.length>0?E.execCommand("indentLess"):S(E)},C.Esc=function(E){E.getOption("fullScreen")&&jr(v)},this.documentOnKeyDown=function(E){E=E||window.event,E.keyCode==27&&v.codemirror.getOption("fullScreen")&&jr(v)},document.addEventListener("keydown",this.documentOnKeyDown,!1);var h,g;p.overlayMode?(CodeMirror.defineMode("overlay-mode",function(E){return CodeMirror.overlayMode(CodeMirror.getMode(E,p.spellChecker!==!1?"spell-checker":"gfm"),p.overlayMode.mode,p.overlayMode.combine)}),h="overlay-mode",g=p.parsingConfig,g.gitHubSpice=!1):(h=p.parsingConfig,h.name="gfm",h.gitHubSpice=!1),p.spellChecker!==!1&&(h="spell-checker",g=p.parsingConfig,g.name="gfm",g.gitHubSpice=!1,typeof p.spellChecker=="function"?p.spellChecker({codeMirrorInstance:CodeMirror}):CodeMirrorSpellChecker({codeMirrorInstance:CodeMirror}));function T(E,N,G){return{addNew:!1}}if(CodeMirror.getMode("php").mime="text/x-php",this.codemirror=CodeMirror.fromTextArea(o,{mode:h,backdrop:g,theme:p.theme!=null?p.theme:"easymde",tabSize:p.tabSize!=null?p.tabSize:2,indentUnit:p.tabSize!=null?p.tabSize:2,indentWithTabs:p.indentWithTabs!==!1,lineNumbers:p.lineNumbers===!0,autofocus:p.autofocus===!0,extraKeys:C,direction:p.direction,lineWrapping:p.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:p.placeholder||o.getAttribute("placeholder")||"",styleSelectedText:p.styleSelectedText!=null?p.styleSelectedText:!ra(),scrollbarStyle:p.scrollbarStyle!=null?p.scrollbarStyle:"native",configureMouse:T,inputStyle:p.inputStyle!=null?p.inputStyle:ra()?"contenteditable":"textarea",spellcheck:p.nativeSpellcheck!=null?p.nativeSpellcheck:!0,autoRefresh:p.autoRefresh!=null?p.autoRefresh:!1}),this.codemirror.getScrollerElement().style.minHeight=p.minHeight,typeof p.maxHeight<"u"&&(this.codemirror.getScrollerElement().style.height=p.maxHeight),p.forceSync===!0){var y=this.codemirror;y.on("change",function(){y.save()})}this.gui={};var c=document.createElement("div");c.classList.add("EasyMDEContainer"),c.setAttribute("role","application");var d=this.codemirror.getWrapperElement();d.parentNode.insertBefore(c,d),c.appendChild(d),p.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),p.status!==!1&&(this.gui.statusbar=this.createStatusbar()),p.autosave!=null&&p.autosave.enabled===!0&&(this.autosave(),this.codemirror.on("change",function(){clearTimeout(v._autosave_timeout),v._autosave_timeout=setTimeout(function(){v.autosave()},v.options.autosave.submit_delay||v.options.autosave.delay||1e3)}));function k(E,N){var G,J=window.getComputedStyle(document.querySelector(".CodeMirror-sizer")).width.replace("px","");return E=2){var J=G[1];if(p.imagesPreviewHandler){var re=p.imagesPreviewHandler(G[1]);typeof re=="string"&&(J=re)}if(window.EMDEimagesCache[J])M(N,window.EMDEimagesCache[J]);else{var q=document.createElement("img");q.onload=function(){window.EMDEimagesCache[J]={naturalWidth:q.naturalWidth,naturalHeight:q.naturalHeight,url:J},M(N,window.EMDEimagesCache[J])},q.src=J}}}})}this.codemirror.on("update",function(){w()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(p.autofocus===!0||o.autofocus)&&this.codemirror.focus();var W=this.codemirror;setTimeout(function(){W.refresh()}.bind(W),0)};Te.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};Te.prototype.autosave=function(){if(kc()){var o=this;if(this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to use the autosave feature");return}this.options.autosave.binded!==!0&&(o.element.form!=null&&o.element.form!=null&&o.element.form.addEventListener("submit",function(){clearTimeout(o.autosaveTimeoutId),o.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+o.options.autosave.uniqueId)}),this.options.autosave.binded=!0),this.options.autosave.loaded!==!0&&(typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)=="string"&&localStorage.getItem("smde_"+this.options.autosave.uniqueId)!=""&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var p=o.value();p!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,p):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var v=document.getElementById("autosaved");if(v!=null&&v!=null&&v!=""){var C=new Date,b=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(C),S=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;v.innerHTML=S+b}}else console.log("EasyMDE: localStorage not available, cannot autosave")};Te.prototype.clearAutosavedValue=function(){if(kc()){if(this.options.autosave==null||this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to clear the autosave value");return}localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")};Te.prototype.openBrowseFileWindow=function(o,p){var v=this,C=this.gui.toolbar.getElementsByClassName("imageInput")[0];C.click();function b(S){v.options.imageUploadFunction?v.uploadImagesUsingCustomFunction(v.options.imageUploadFunction,S.target.files):v.uploadImages(S.target.files,o,p),C.removeEventListener("change",b)}C.addEventListener("change",b)};Te.prototype.uploadImage=function(o,p,v){var C=this;p=p||function(T){yc(C,T)};function b(g){C.updateStatusBar("upload-image",g),setTimeout(function(){C.updateStatusBar("upload-image",C.options.imageTexts.sbInit)},1e4),v&&typeof v=="function"&&v(g),C.options.errorCallback(g)}function S(g){var T=C.options.imageTexts.sizeUnits.split(",");return g.replace("#image_name#",o.name).replace("#image_size#",Fi(o.size,T)).replace("#image_max_size#",Fi(C.options.imageMaxSize,T))}if(o.size>this.options.imageMaxSize){b(S(this.options.errorMessages.fileTooLarge));return}var s=new FormData;s.append("image",o),C.options.imageCSRFToken&&!C.options.imageCSRFHeader&&s.append(C.options.imageCSRFName,C.options.imageCSRFToken);var h=new XMLHttpRequest;h.upload.onprogress=function(g){if(g.lengthComputable){var T=""+Math.round(g.loaded*100/g.total);C.updateStatusBar("upload-image",C.options.imageTexts.sbProgress.replace("#file_name#",o.name).replace("#progress#",T))}},h.open("POST",this.options.imageUploadEndpoint),C.options.imageCSRFToken&&C.options.imageCSRFHeader&&h.setRequestHeader(C.options.imageCSRFName,C.options.imageCSRFToken),h.onload=function(){try{var g=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),b(S(C.options.errorMessages.importError));return}this.status===200&&g&&!g.error&&g.data&&g.data.filePath?p((C.options.imagePathAbsolute?"":window.location.origin+"/")+g.data.filePath):g.error&&g.error in C.options.errorMessages?b(S(C.options.errorMessages[g.error])):g.error?b(S(g.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),b(S(C.options.errorMessages.importError)))},h.onerror=function(g){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+g.target.status+" ("+g.target.statusText+")"),b(C.options.errorMessages.importError)},h.send(s)};Te.prototype.uploadImageUsingCustomFunction=function(o,p){var v=this;function C(s){yc(v,s)}function b(s){var h=S(s);v.updateStatusBar("upload-image",h),setTimeout(function(){v.updateStatusBar("upload-image",v.options.imageTexts.sbInit)},1e4),v.options.errorCallback(h)}function S(s){var h=v.options.imageTexts.sizeUnits.split(",");return s.replace("#image_name#",p.name).replace("#image_size#",Fi(p.size,h)).replace("#image_max_size#",Fi(v.options.imageMaxSize,h))}o.apply(this,[p,C,b])};Te.prototype.setPreviewMaxHeight=function(){var o=this.codemirror,p=o.getWrapperElement(),v=p.nextSibling,C=parseInt(window.getComputedStyle(p).paddingTop),b=parseInt(window.getComputedStyle(p).borderTopWidth),S=parseInt(this.options.maxHeight),s=S+C*2+b*2,h=s.toString()+"px";v.style.height=h};Te.prototype.createSideBySide=function(){var o=this.codemirror,p=o.getWrapperElement(),v=p.nextSibling;if(!v||!v.classList.contains("editor-preview-side")){if(v=document.createElement("div"),v.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var C=0;C{try{let z=k[k.length-1];if(z.origin==="+input"){let M="(https://)",w=z.text[z.text.length-1];if(w.endsWith(M)&&w!=="[]"+M){let W=z.from,E=z.to,G=z.text.length>1?0:W.ch;setTimeout(()=>{d.setSelection({line:E.line,ch:G+w.lastIndexOf("(")+1},{line:E.line,ch:G+w.lastIndexOf(")")})},25)}}}catch{}}),this.editor.codemirror.on("change",Alpine.debounce(()=>{this.editor&&(this.state=this.editor.value(),p&&this.$wire.call("$refresh"))},C??300)),v&&this.editor.codemirror.on("blur",()=>this.$wire.call("$refresh")),this.$watch("state",()=>{this.editor&&(this.editor.codemirror.hasFocus()||Alpine.raw(this.editor).value(this.state??""))}),h&&h(this)},destroy:function(){this.editor.cleanup(),this.editor=null},getToolbar:function(){let d=[];return y.includes("bold")&&d.push({name:"bold",action:EasyMDE.toggleBold,title:T.toolbar_buttons?.bold}),y.includes("italic")&&d.push({name:"italic",action:EasyMDE.toggleItalic,title:T.toolbar_buttons?.italic}),y.includes("strike")&&d.push({name:"strikethrough",action:EasyMDE.toggleStrikethrough,title:T.toolbar_buttons?.strike}),y.includes("link")&&d.push({name:"link",action:EasyMDE.drawLink,title:T.toolbar_buttons?.link}),["bold","italic","strike","link"].some(k=>y.includes(k))&&["heading"].some(k=>y.includes(k))&&d.push("|"),y.includes("heading")&&d.push({name:"heading",action:EasyMDE.toggleHeadingSmaller,title:T.toolbar_buttons?.heading}),["heading"].some(k=>y.includes(k))&&["blockquote","codeBlock","bulletList","orderedList"].some(k=>y.includes(k))&&d.push("|"),y.includes("blockquote")&&d.push({name:"quote",action:EasyMDE.toggleBlockquote,title:T.toolbar_buttons?.blockquote}),y.includes("codeBlock")&&d.push({name:"code",action:EasyMDE.toggleCodeBlock,title:T.toolbar_buttons?.code_block}),y.includes("bulletList")&&d.push({name:"unordered-list",action:EasyMDE.toggleUnorderedList,title:T.toolbar_buttons?.bullet_list}),y.includes("orderedList")&&d.push({name:"ordered-list",action:EasyMDE.toggleOrderedList,title:T.toolbar_buttons?.ordered_list}),["blockquote","codeBlock","bulletList","orderedList"].some(k=>y.includes(k))&&["table","attachFiles"].some(k=>y.includes(k))&&d.push("|"),y.includes("table")&&d.push({name:"table",action:EasyMDE.drawTable,title:T.toolbar_buttons?.table}),y.includes("attachFiles")&&d.push({name:"upload-image",action:EasyMDE.drawUploadedImage,title:T.toolbar_buttons?.attach_files}),["table","attachFiles"].some(k=>y.includes(k))&&["undo","redo"].some(k=>y.includes(k))&&d.push("|"),y.includes("undo")&&d.push({name:"undo",action:EasyMDE.undo,title:T.toolbar_buttons?.undo}),y.includes("redo")&&d.push({name:"redo",action:EasyMDE.redo,title:T.toolbar_buttons?.redo}),d}}}export{Kd as default}; diff --git a/public/js/filament/forms/components/rich-editor.js b/public/js/filament/forms/components/rich-editor.js new file mode 100644 index 00000000..01ad26f2 --- /dev/null +++ b/public/js/filament/forms/components/rich-editor.js @@ -0,0 +1,150 @@ +var po="2.1.12",Rt="[data-trix-attachment]",mi={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},W={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,htmlAttributes:["language"],text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(i){return Gi(i.parentNode)===W[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(i){return Gi(i.parentNode)===W[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},Gi=i=>{var t;return i==null||(t=i.tagName)===null||t===void 0?void 0:t.toLowerCase()},$i=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),Sn=$i&&parseInt($i[1]),xe={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:Sn&&Sn>12,samsungAndroid:Sn&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:typeof InputEvent<"u"&&["data","getTargetRanges","inputType"].every(i=>i in InputEvent.prototype)},Lr={ADD_ATTR:["language"],SAFE_FOR_XML:!1,RETURN_DOM:!0},m={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption\u2026",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL\u2026",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"},fo=[m.bytes,m.KB,m.MB,m.GB,m.TB,m.PB],Dr={prefix:"IEC",precision:2,formatter(i){switch(i){case 0:return"0 ".concat(m.bytes);case 1:return"1 ".concat(m.byte);default:let t;this.prefix==="SI"?t=1e3:this.prefix==="IEC"&&(t=1024);let e=Math.floor(Math.log(i)/Math.log(t)),n=(i/Math.pow(t,e)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(n," ").concat(fo[e])}}},ln="\uFEFF",ft="\xA0",Nr=function(i){for(let t in i){let e=i[t];this[t]=e}return this},pi=document.documentElement,bo=pi.matches,S=function(i){let{onElement:t,matchingSelector:e,withCallback:n,inPhase:r,preventDefault:o,times:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=t||pi,c=e,u=r==="capturing",d=function(C){s!=null&&--s==0&&d.destroy();let T=vt(C.target,{matchingSelector:c});T!=null&&(n?.call(T,C,T),o&&C.preventDefault())};return d.destroy=()=>l.removeEventListener(i,d,u),l.addEventListener(i,d,u),d},he=function(i){let{onElement:t,bubbles:e,cancelable:n,attributes:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=t??pi;e=e!==!1,n=n!==!1;let s=document.createEvent("Events");return s.initEvent(i,e,n),r!=null&&Nr.call(s,r),o.dispatchEvent(s)},Ir=function(i,t){if(i?.nodeType===1)return bo.call(i,t)},vt=function(i){let{matchingSelector:t,untilNode:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(;i&&i.nodeType!==Node.ELEMENT_NODE;)i=i.parentNode;if(i!=null){if(t==null)return i;if(i.closest&&e==null)return i.closest(t);for(;i&&i!==e;){if(Ir(i,t))return i;i=i.parentNode}}},fi=i=>document.activeElement!==i&&kt(i,document.activeElement),kt=function(i,t){if(i&&t)for(;t;){if(t===i)return!0;t=t.parentNode}},kn=function(i){var t;if((t=i)===null||t===void 0||!t.parentNode)return;let e=0;for(i=i.previousSibling;i;)e++,i=i.previousSibling;return e},At=i=>{var t;return i==null||(t=i.parentNode)===null||t===void 0?void 0:t.removeChild(i)},je=function(i){let{onlyNodesOfType:t,usingFilter:e,expandEntityReferences:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(()=>{switch(t){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(i,r,e??null,n===!0)},j=i=>{var t;return i==null||(t=i.tagName)===null||t===void 0?void 0:t.toLowerCase()},p=function(i){let t,e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof i=="object"?(n=i,i=n.tagName):n={attributes:n};let r=document.createElement(i);if(n.editable!=null&&(n.attributes==null&&(n.attributes={}),n.attributes.contenteditable=n.editable),n.attributes)for(t in n.attributes)e=n.attributes[t],r.setAttribute(t,e);if(n.style)for(t in n.style)e=n.style[t],r.style[t]=e;if(n.data)for(t in n.data)e=n.data[t],r.dataset[t]=e;return n.className&&n.className.split(" ").forEach(o=>{r.classList.add(o)}),n.textContent&&(r.textContent=n.textContent),n.childNodes&&[].concat(n.childNodes).forEach(o=>{r.appendChild(o)}),r},ie,de=function(){if(ie!=null)return ie;ie=[];for(let i in W){let t=W[i];t.tagName&&ie.push(t.tagName)}return ie},Rn=i=>Vt(i?.firstChild),Yi=function(i){let{strict:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{strict:!0};return t?Vt(i):Vt(i)||!Vt(i.firstChild)&&function(e){return de().includes(j(e))&&!de().includes(j(e.firstChild))}(i)},Vt=i=>vo(i)&&i?.data==="block",vo=i=>i?.nodeType===Node.COMMENT_NODE,zt=function(i){let{name:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i)return ge(i)?i.data===ln?!t||i.parentNode.dataset.trixCursorTarget===t:void 0:zt(i.firstChild)},Tt=i=>Ir(i,Rt),Or=i=>ge(i)&&i?.data==="",ge=i=>i?.nodeType===Node.TEXT_NODE,bi={level2Enabled:!0,getLevel(){return this.level2Enabled&&xe.supportsInputEvents?2:0},pickFiles(i){let t=p("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});t.addEventListener("change",()=>{i(t.files),At(t)}),At(document.getElementById(this.fileInputId)),document.body.appendChild(t),t.click()}},Me={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:` +`},Dt={bold:{tagName:"strong",inheritable:!0,parser(i){let t=window.getComputedStyle(i);return t.fontWeight==="bold"||t.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:i=>window.getComputedStyle(i).fontStyle==="italic"},href:{groupTagName:"a",parser(i){let t="a:not(".concat(Rt,")"),e=i.closest(t);if(e)return e.getAttribute("href")}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}},Fr={getDefaultHTML:()=>`
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
`)},Yn={interval:5e3},Ce=Object.freeze({__proto__:null,attachments:mi,blockAttributes:W,browser:xe,css:{attachment:"attachment",attachmentCaption:"attachment__caption",attachmentCaptionEditor:"attachment__caption-editor",attachmentMetadata:"attachment__metadata",attachmentMetadataContainer:"attachment__metadata-container",attachmentName:"attachment__name",attachmentProgress:"attachment__progress",attachmentSize:"attachment__size",attachmentToolbar:"attachment__toolbar",attachmentGallery:"attachment-gallery"},dompurify:Lr,fileSize:Dr,input:bi,keyNames:{8:"backspace",9:"tab",13:"return",27:"escape",37:"left",39:"right",46:"delete",68:"d",72:"h",79:"o"},lang:m,parser:Me,textAttributes:Dt,toolbar:Fr,undo:Yn}),R=class{static proxyMethod(t){let{name:e,toMethod:n,toProperty:r,optional:o}=Ao(t);this.prototype[e]=function(){let s,l;var c,u;return n?l=o?(c=this[n])===null||c===void 0?void 0:c.call(this):this[n]():r&&(l=this[r]),o?(s=(u=l)===null||u===void 0?void 0:u[e],s?Xi.call(s,l,arguments):void 0):(s=l[e],Xi.call(s,l,arguments))}}},Ao=function(i){let t=i.match(yo);if(!t)throw new Error("can't parse @proxyMethod expression: ".concat(i));let e={name:t[4]};return t[2]!=null?e.toMethod=t[1]:e.toProperty=t[1],t[3]!=null&&(e.optional=!0),e},{apply:Xi}=Function.prototype,yo=new RegExp("^(.+?)(\\(\\))?(\\?)?\\.(.+?)$"),Tn,wn,Ln,Nt=class extends R{static box(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t instanceof this?t:this.fromUCS2String(t?.toString())}static fromUCS2String(t){return new this(t,Xn(t))}static fromCodepoints(t){return new this(Zn(t),t)}constructor(t,e){super(...arguments),this.ucs2String=t,this.codepoints=e,this.length=this.codepoints.length,this.ucs2Length=this.ucs2String.length}offsetToUCS2Offset(t){return Zn(this.codepoints.slice(0,Math.max(0,t))).length}offsetFromUCS2Offset(t){return Xn(this.ucs2String.slice(0,Math.max(0,t))).length}slice(){return this.constructor.fromCodepoints(this.codepoints.slice(...arguments))}charAt(t){return this.slice(t,t+1)}isEqualTo(t){return this.constructor.box(t).ucs2String===this.ucs2String}toJSON(){return this.ucs2String}getCacheKey(){return this.ucs2String}toString(){return this.ucs2String}},xo=((Tn=Array.from)===null||Tn===void 0?void 0:Tn.call(Array,"\u{1F47C}").length)===1,Co=((wn=" ".codePointAt)===null||wn===void 0?void 0:wn.call(" ",0))!=null,Eo=((Ln=String.fromCodePoint)===null||Ln===void 0?void 0:Ln.call(String,32,128124))===" \u{1F47C}",Xn,Zn;Xn=xo&&Co?i=>Array.from(i).map(t=>t.codePointAt(0)):function(i){let t=[],e=0,{length:n}=i;for(;eString.fromCodePoint(...Array.from(i||[])):function(i){return(()=>{let t=[];return Array.from(i).forEach(e=>{let n="";e>65535&&(e-=65536,n+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t.push(n+String.fromCharCode(e))}),t})().join("")};var So=0,ht=class extends R{static fromJSONString(t){return this.fromJSON(JSON.parse(t))}constructor(){super(...arguments),this.id=++So}hasSameConstructorAs(t){return this.constructor===t?.constructor}isEqualTo(t){return this===t}inspect(){let t=[],e=this.contentsForInspection()||{};for(let n in e){let r=e[n];t.push("".concat(n,"=").concat(r))}return"#<".concat(this.constructor.name,":").concat(this.id).concat(t.length?" ".concat(t.join(", ")):"",">")}contentsForInspection(){}toJSONString(){return JSON.stringify(this)}toUTF16String(){return Nt.box(this)}getCacheKey(){return this.id.toString()}},It=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(i.length!==t.length)return!1;for(let e=0;e1?e-1:0),r=1;r(Dn||(Dn=wo().concat(To())),Dn),L=i=>W[i],To=()=>(Nn||(Nn=Object.keys(W)),Nn),ti=i=>Dt[i],wo=()=>(In||(In=Object.keys(Dt)),In),Pr=function(i,t){Lo(i).textContent=t.replace(/%t/g,i)},Lo=function(i){let t=document.createElement("style");t.setAttribute("type","text/css"),t.setAttribute("data-tag-name",i.toLowerCase());let e=Do();return e&&t.setAttribute("nonce",e),document.head.insertBefore(t,document.head.firstChild),t},Do=function(){let i=Zi("trix-csp-nonce")||Zi("csp-nonce");if(i){let{nonce:t,content:e}=i;return t==""?e:t}},Zi=i=>document.head.querySelector("meta[name=".concat(i,"]")),Qi={"application/x-trix-feature-detection":"test"},Mr=function(i){let t=i.getData("text/plain"),e=i.getData("text/html");if(!t||!e)return t?.length;{let{body:n}=new DOMParser().parseFromString(e,"text/html");if(n.textContent===t)return!n.querySelector("*")}},Br=/Mac|^iP/.test(navigator.platform)?i=>i.metaKey:i=>i.ctrlKey,Ai=i=>setTimeout(i,1),_r=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={};for(let e in i){let n=i[e];t[e]=n}return t},Xt=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Object.keys(i).length!==Object.keys(t).length)return!1;for(let e in i)if(i[e]!==t[e])return!1;return!0},y=function(i){if(i!=null)return Array.isArray(i)||(i=[i,i]),[tr(i[0]),tr(i[1]!=null?i[1]:i[0])]},ut=function(i){if(i==null)return;let[t,e]=y(i);return ei(t,e)},We=function(i,t){if(i==null||t==null)return;let[e,n]=y(i),[r,o]=y(t);return ei(e,r)&&ei(n,o)},tr=function(i){return typeof i=="number"?i:_r(i)},ei=function(i,t){return typeof i=="number"?i===t:Xt(i,t)},Ue=class extends R{constructor(){super(...arguments),this.update=this.update.bind(this),this.selectionManagers=[]}start(){this.started||(this.started=!0,document.addEventListener("selectionchange",this.update,!0))}stop(){if(this.started)return this.started=!1,document.removeEventListener("selectionchange",this.update,!0)}registerSelectionManager(t){if(!this.selectionManagers.includes(t))return this.selectionManagers.push(t),this.start()}unregisterSelectionManager(t){if(this.selectionManagers=this.selectionManagers.filter(e=>e!==t),this.selectionManagers.length===0)return this.stop()}notifySelectionManagersOfSelectionChange(){return this.selectionManagers.map(t=>t.selectionDidChange())}update(){this.notifySelectionManagersOfSelectionChange()}reset(){this.update()}},Ot=new Ue,jr=function(){let i=window.getSelection();if(i.rangeCount>0)return i},me=function(){var i;let t=(i=jr())===null||i===void 0?void 0:i.getRangeAt(0);if(t&&!No(t))return t},Wr=function(i){let t=window.getSelection();return t.removeAllRanges(),t.addRange(i),Ot.update()},No=i=>er(i.startContainer)||er(i.endContainer),er=i=>!Object.getPrototypeOf(i),ue=i=>i.replace(new RegExp("".concat(ln),"g"),"").replace(new RegExp("".concat(ft),"g")," "),yi=new RegExp("[^\\S".concat(ft,"]")),xi=i=>i.replace(new RegExp("".concat(yi.source),"g")," ").replace(/\ {2,}/g," "),nr=function(i,t){if(i.isEqualTo(t))return["",""];let e=On(i,t),{length:n}=e.utf16String,r;if(n){let{offset:o}=e,s=i.codepoints.slice(0,o).concat(i.codepoints.slice(o+n));r=On(t,Nt.fromCodepoints(s))}else r=On(t,i);return[e.utf16String.toString(),r.utf16String.toString()]},On=function(i,t){let e=0,n=i.length,r=t.length;for(;ee+1&&i.charAt(n-1).isEqualTo(t.charAt(r-1));)n--,r--;return{utf16String:i.slice(e,n),offset:e}},X=class i extends ht{static fromCommonAttributesOfObjects(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(!t.length)return new this;let e=re(t[0]),n=e.getKeys();return t.slice(1).forEach(r=>{n=e.getKeysCommonToHash(re(r)),e=e.slice(n)}),e}static box(t){return re(t)}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(...arguments),this.values=Be(t)}add(t,e){return this.merge(Io(t,e))}remove(t){return new i(Be(this.values,t))}get(t){return this.values[t]}has(t){return t in this.values}merge(t){return new i(Oo(this.values,Fo(t)))}slice(t){let e={};return Array.from(t).forEach(n=>{this.has(n)&&(e[n]=this.values[n])}),new i(e)}getKeys(){return Object.keys(this.values)}getKeysCommonToHash(t){return t=re(t),this.getKeys().filter(e=>this.values[e]===t.values[e])}isEqualTo(t){return It(this.toArray(),re(t).toArray())}isEmpty(){return this.getKeys().length===0}toArray(){if(!this.array){let t=[];for(let e in this.values){let n=this.values[e];t.push(t.push(e,n))}this.array=t.slice(0)}return this.array}toObject(){return Be(this.values)}toJSON(){return this.toObject()}contentsForInspection(){return{values:JSON.stringify(this.values)}}},Io=function(i,t){let e={};return e[i]=t,e},Oo=function(i,t){let e=Be(i);for(let n in t){let r=t[n];e[n]=r}return e},Be=function(i,t){let e={};return Object.keys(i).sort().forEach(n=>{n!==t&&(e[n]=i[n])}),e},re=function(i){return i instanceof X?i:new X(i)},Fo=function(i){return i instanceof X?i.values:i},fe=class{static groupObjects(){let t,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{depth:n,asTree:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r&&n==null&&(n=0);let o=[];return Array.from(e).forEach(s=>{var l;if(t){var c,u,d;if((c=s.canBeGrouped)!==null&&c!==void 0&&c.call(s,n)&&(u=(d=t[t.length-1]).canBeGroupedWith)!==null&&u!==void 0&&u.call(d,s,n))return void t.push(s);o.push(new this(t,{depth:n,asTree:r})),t=null}(l=s.canBeGrouped)!==null&&l!==void 0&&l.call(s,n)?t=[s]:o.push(s)}),t&&o.push(new this(t,{depth:n,asTree:r})),o}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{depth:e,asTree:n}=arguments.length>1?arguments[1]:void 0;this.objects=t,n&&(this.depth=e,this.objects=this.constructor.groupObjects(this.objects,{asTree:n,depth:this.depth+1}))}getObjects(){return this.objects}getDepth(){return this.depth}getCacheKey(){let t=["objectGroup"];return Array.from(this.getObjects()).forEach(e=>{t.push(e.getCacheKey())}),t.join("/")}},ni=class extends R{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects={},Array.from(t).forEach(e=>{let n=JSON.stringify(e);this.objects[n]==null&&(this.objects[n]=e)})}find(t){let e=JSON.stringify(t);return this.objects[e]}},ii=class{constructor(t){this.reset(t)}add(t){let e=ir(t);this.elements[e]=t}remove(t){let e=ir(t),n=this.elements[e];if(n)return delete this.elements[e],n}reset(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return this.elements={},Array.from(t).forEach(e=>{this.add(e)}),t}},ir=i=>i.dataset.trixStoreKey,Ht=class extends R{isPerforming(){return this.performing===!0}hasPerformed(){return this.performed===!0}hasSucceeded(){return this.performed&&this.succeeded}hasFailed(){return this.performed&&!this.succeeded}getPromise(){return this.promise||(this.promise=new Promise((t,e)=>(this.performing=!0,this.perform((n,r)=>{this.succeeded=n,this.performing=!1,this.performed=!0,this.succeeded?t(r):e(r)})))),this.promise}perform(t){return t(!1)}release(){var t,e;(t=this.promise)===null||t===void 0||(e=t.cancel)===null||e===void 0||e.call(t),this.promise=null,this.performing=null,this.performed=null,this.succeeded=null}};Ht.proxyMethod("getPromise().then"),Ht.proxyMethod("getPromise().catch");var dt=class extends R{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.object=t,this.options=e,this.childViews=[],this.rootView=this}getNodes(){return this.nodes||(this.nodes=this.createNodes()),this.nodes.map(t=>t.cloneNode(!0))}invalidate(){var t;return this.nodes=null,this.childViews=[],(t=this.parentView)===null||t===void 0?void 0:t.invalidate()}invalidateViewForObject(t){var e;return(e=this.findViewForObject(t))===null||e===void 0?void 0:e.invalidate()}findOrCreateCachedChildView(t,e,n){let r=this.getCachedViewForObject(e);return r?this.recordChildView(r):(r=this.createChildView(...arguments),this.cacheViewForObject(r,e)),r}createChildView(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};e instanceof fe&&(n.viewClass=t,t=ri);let r=new t(e,n);return this.recordChildView(r)}recordChildView(t){return t.parentView=this,t.rootView=this.rootView,this.childViews.push(t),t}getAllChildViews(){let t=[];return this.childViews.forEach(e=>{t.push(e),t=t.concat(e.getAllChildViews())}),t}findElement(){return this.findElementForObject(this.object)}findElementForObject(t){let e=t?.id;if(e)return this.rootView.element.querySelector("[data-trix-id='".concat(e,"']"))}findViewForObject(t){for(let e of this.getAllChildViews())if(e.object===t)return e}getViewCache(){return this.rootView!==this?this.rootView.getViewCache():this.isViewCachingEnabled()?(this.viewCache||(this.viewCache={}),this.viewCache):void 0}isViewCachingEnabled(){return this.shouldCacheViews!==!1}enableViewCaching(){this.shouldCacheViews=!0}disableViewCaching(){this.shouldCacheViews=!1}getCachedViewForObject(t){var e;return(e=this.getViewCache())===null||e===void 0?void 0:e[t.getCacheKey()]}cacheViewForObject(t,e){let n=this.getViewCache();n&&(n[e.getCacheKey()]=t)}garbageCollectCachedViews(){let t=this.getViewCache();if(t){let e=this.getAllChildViews().concat(this).map(n=>n.object.getCacheKey());for(let n in t)e.includes(n)||delete t[n]}}},ri=class extends dt{constructor(){super(...arguments),this.objectGroup=this.object,this.viewClass=this.options.viewClass,delete this.options.viewClass}getChildViews(){return this.childViews.length||Array.from(this.objectGroup.getObjects()).forEach(t=>{this.findOrCreateCachedChildView(this.viewClass,t,this.options)}),this.childViews}createNodes(){let t=this.createContainerElement();return this.getChildViews().forEach(e=>{Array.from(e.getNodes()).forEach(n=>{t.appendChild(n)})}),[t]}createContainerElement(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.objectGroup.getDepth();return this.getChildViews()[0].createContainerElement(t)}};var{entries:Ur,setPrototypeOf:rr,isFrozen:Po,getPrototypeOf:Mo,getOwnPropertyDescriptor:Bo}=Object,{freeze:U,seal:G,create:Vr}=Object,{apply:oi,construct:si}=typeof Reflect<"u"&&Reflect;U||(U=function(i){return i}),G||(G=function(i){return i}),oi||(oi=function(i,t,e){return i.apply(t,e)}),si||(si=function(i,t){return new i(...t)});var Ne=K(Array.prototype.forEach),or=K(Array.prototype.pop),oe=K(Array.prototype.push),_e=K(String.prototype.toLowerCase),Fn=K(String.prototype.toString),sr=K(String.prototype.match),se=K(String.prototype.replace),_o=K(String.prototype.indexOf),jo=K(String.prototype.trim),$=K(Object.prototype.hasOwnProperty),_=K(RegExp.prototype.test),ae=(ar=TypeError,function(){for(var i=arguments.length,t=new Array(i),e=0;e1?e-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:_e;rr&&rr(i,null);let n=t.length;for(;n--;){let r=t[n];if(typeof r=="string"){let o=e(r);o!==r&&(Po(t)||(t[n]=o),r=o)}i[r]=!0}return i}function Wo(i){for(let t=0;t/gm),qo=G(/\$\{[\w\W]*}/gm),Jo=G(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ko=G(/^aria-[\-\w]+$/),zr=G(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Go=G(/^(?:\w+script|data):/i),$o=G(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hr=G(/^html$/i),Yo=G(/^[a-z][.\w]*(-[.\w]+)+$/i),dr=Object.freeze({__proto__:null,ARIA_ATTR:Ko,ATTR_WHITESPACE:$o,CUSTOM_ELEMENT:Yo,DATA_ATTR:Jo,DOCTYPE_NAME:Hr,ERB_EXPR:Ho,IS_ALLOWED_URI:zr,IS_SCRIPT_OR_DATA:Go,MUSTACHE_EXPR:zo,TMPLIT_EXPR:qo}),Xo=1,Zo=3,Qo=7,ts=8,es=9,ns=function(){return typeof window>"u"?null:window},Ve=function i(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ns(),e=a=>i(a);if(e.version="3.2.3",e.removed=[],!t||!t.document||t.document.nodeType!==es)return e.isSupported=!1,e;let{document:n}=t,r=n,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:c,Element:u,NodeFilter:d,NamedNodeMap:C=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:T,DOMParser:H,trustedTypes:Q}=t,M=u.prototype,mt=le(M,"cloneNode"),yt=le(M,"remove"),Zt=le(M,"nextSibling"),Qt=le(M,"childNodes"),F=le(M,"parentNode");if(typeof l=="function"){let a=n.createElement("template");a.content&&a.content.ownerDocument&&(n=a.content.ownerDocument)}let k,rt="",{implementation:xt,createNodeIterator:eo,createDocumentFragment:no,getElementsByTagName:io}=n,{importNode:ro}=r,q={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};e.isSupported=typeof Ur=="function"&&typeof F=="function"&&xt&&xt.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:un,ERB_EXPR:hn,TMPLIT_EXPR:dn,DATA_ATTR:oo,ARIA_ATTR:so,IS_SCRIPT_OR_DATA:ao,ATTR_WHITESPACE:Ei,CUSTOM_ELEMENT:lo}=dr,{IS_ALLOWED_URI:Si}=dr,N=null,ki=b({},[...lr,...Pn,...Mn,...Bn,...cr]),O=null,Ri=b({},[...ur,..._n,...hr,...Ie]),w=Object.seal(Vr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),te=null,gn=null,Ti=!0,mn=!0,wi=!1,Li=!0,Pt=!1,pn=!0,Ct=!1,fn=!1,bn=!1,Mt=!1,Ee=!1,Se=!1,Di=!0,Ni=!1,vn=!0,ee=!1,Bt={},_t=null,Ii=b({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Oi=null,Fi=b({},["audio","video","img","source","image","track"]),An=null,Pi=b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ke="http://www.w3.org/1998/Math/MathML",Re="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml",jt=ot,yn=!1,xn=null,co=b({},[ke,Re,ot],Fn),Te=b({},["mi","mo","mn","ms","mtext"]),we=b({},["annotation-xml"]),uo=b({},["title","style","font","a","script"]),ne=null,ho=["application/xhtml+xml","text/html"],I=null,Wt=null,go=n.createElement("form"),Mi=function(a){return a instanceof RegExp||a instanceof Function},Cn=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!Wt||Wt!==a){if(a&&typeof a=="object"||(a={}),a=St(a),ne=ho.indexOf(a.PARSER_MEDIA_TYPE)===-1?"text/html":a.PARSER_MEDIA_TYPE,I=ne==="application/xhtml+xml"?Fn:_e,N=$(a,"ALLOWED_TAGS")?b({},a.ALLOWED_TAGS,I):ki,O=$(a,"ALLOWED_ATTR")?b({},a.ALLOWED_ATTR,I):Ri,xn=$(a,"ALLOWED_NAMESPACES")?b({},a.ALLOWED_NAMESPACES,Fn):co,An=$(a,"ADD_URI_SAFE_ATTR")?b(St(Pi),a.ADD_URI_SAFE_ATTR,I):Pi,Oi=$(a,"ADD_DATA_URI_TAGS")?b(St(Fi),a.ADD_DATA_URI_TAGS,I):Fi,_t=$(a,"FORBID_CONTENTS")?b({},a.FORBID_CONTENTS,I):Ii,te=$(a,"FORBID_TAGS")?b({},a.FORBID_TAGS,I):{},gn=$(a,"FORBID_ATTR")?b({},a.FORBID_ATTR,I):{},Bt=!!$(a,"USE_PROFILES")&&a.USE_PROFILES,Ti=a.ALLOW_ARIA_ATTR!==!1,mn=a.ALLOW_DATA_ATTR!==!1,wi=a.ALLOW_UNKNOWN_PROTOCOLS||!1,Li=a.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pt=a.SAFE_FOR_TEMPLATES||!1,pn=a.SAFE_FOR_XML!==!1,Ct=a.WHOLE_DOCUMENT||!1,Mt=a.RETURN_DOM||!1,Ee=a.RETURN_DOM_FRAGMENT||!1,Se=a.RETURN_TRUSTED_TYPE||!1,bn=a.FORCE_BODY||!1,Di=a.SANITIZE_DOM!==!1,Ni=a.SANITIZE_NAMED_PROPS||!1,vn=a.KEEP_CONTENT!==!1,ee=a.IN_PLACE||!1,Si=a.ALLOWED_URI_REGEXP||zr,jt=a.NAMESPACE||ot,Te=a.MATHML_TEXT_INTEGRATION_POINTS||Te,we=a.HTML_INTEGRATION_POINTS||we,w=a.CUSTOM_ELEMENT_HANDLING||{},a.CUSTOM_ELEMENT_HANDLING&&Mi(a.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(w.tagNameCheck=a.CUSTOM_ELEMENT_HANDLING.tagNameCheck),a.CUSTOM_ELEMENT_HANDLING&&Mi(a.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(w.attributeNameCheck=a.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),a.CUSTOM_ELEMENT_HANDLING&&typeof a.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(w.allowCustomizedBuiltInElements=a.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pt&&(mn=!1),Ee&&(Mt=!0),Bt&&(N=b({},cr),O=[],Bt.html===!0&&(b(N,lr),b(O,ur)),Bt.svg===!0&&(b(N,Pn),b(O,_n),b(O,Ie)),Bt.svgFilters===!0&&(b(N,Mn),b(O,_n),b(O,Ie)),Bt.mathMl===!0&&(b(N,Bn),b(O,hr),b(O,Ie))),a.ADD_TAGS&&(N===ki&&(N=St(N)),b(N,a.ADD_TAGS,I)),a.ADD_ATTR&&(O===Ri&&(O=St(O)),b(O,a.ADD_ATTR,I)),a.ADD_URI_SAFE_ATTR&&b(An,a.ADD_URI_SAFE_ATTR,I),a.FORBID_CONTENTS&&(_t===Ii&&(_t=St(_t)),b(_t,a.FORBID_CONTENTS,I)),vn&&(N["#text"]=!0),Ct&&b(N,["html","head","body"]),N.table&&(b(N,["tbody"]),delete te.tbody),a.TRUSTED_TYPES_POLICY){if(typeof a.TRUSTED_TYPES_POLICY.createHTML!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof a.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=a.TRUSTED_TYPES_POLICY,rt=k.createHTML("")}else k===void 0&&(k=function(g,h){if(typeof g!="object"||typeof g.createPolicy!="function")return null;let v=null,A="data-tt-policy-suffix";h&&h.hasAttribute(A)&&(v=h.getAttribute(A));let f="dompurify"+(v?"#"+v:"");try{return g.createPolicy(f,{createHTML:D=>D,createScriptURL:D=>D})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}}(Q,o)),k!==null&&typeof rt=="string"&&(rt=k.createHTML(""));U&&U(a),Wt=a}},Bi=b({},[...Pn,...Mn,...Uo]),_i=b({},[...Bn,...Vo]),tt=function(a){oe(e.removed,{element:a});try{F(a).removeChild(a)}catch{yt(a)}},Le=function(a,g){try{oe(e.removed,{attribute:g.getAttributeNode(a),from:g})}catch{oe(e.removed,{attribute:null,from:g})}if(g.removeAttribute(a),a==="is")if(Mt||Ee)try{tt(g)}catch{}else try{g.setAttribute(a,"")}catch{}},ji=function(a){let g=null,h=null;if(bn)a=""+a;else{let f=sr(a,/^[\r\n\t ]+/);h=f&&f[0]}ne==="application/xhtml+xml"&&jt===ot&&(a=''+a+"");let v=k?k.createHTML(a):a;if(jt===ot)try{g=new H().parseFromString(v,ne)}catch{}if(!g||!g.documentElement){g=xt.createDocument(jt,"template",null);try{g.documentElement.innerHTML=yn?rt:v}catch{}}let A=g.body||g.documentElement;return a&&h&&A.insertBefore(n.createTextNode(h),A.childNodes[0]||null),jt===ot?io.call(g,Ct?"html":"body")[0]:Ct?g.documentElement:A},Wi=function(a){return eo.call(a.ownerDocument||a,a,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},En=function(a){return a instanceof T&&(typeof a.nodeName!="string"||typeof a.textContent!="string"||typeof a.removeChild!="function"||!(a.attributes instanceof C)||typeof a.removeAttribute!="function"||typeof a.setAttribute!="function"||typeof a.namespaceURI!="string"||typeof a.insertBefore!="function"||typeof a.hasChildNodes!="function")},Ui=function(a){return typeof c=="function"&&a instanceof c};function st(a,g,h){Ne(a,v=>{v.call(e,g,h,Wt)})}let Vi=function(a){let g=null;if(st(q.beforeSanitizeElements,a,null),En(a))return tt(a),!0;let h=I(a.nodeName);if(st(q.uponSanitizeElement,a,{tagName:h,allowedTags:N}),a.hasChildNodes()&&!Ui(a.firstElementChild)&&_(/<[/\w]/g,a.innerHTML)&&_(/<[/\w]/g,a.textContent)||a.nodeType===Qo||pn&&a.nodeType===ts&&_(/<[/\w]/g,a.data))return tt(a),!0;if(!N[h]||te[h]){if(!te[h]&&Hi(h)&&(w.tagNameCheck instanceof RegExp&&_(w.tagNameCheck,h)||w.tagNameCheck instanceof Function&&w.tagNameCheck(h)))return!1;if(vn&&!_t[h]){let v=F(a)||a.parentNode,A=Qt(a)||a.childNodes;if(A&&v)for(let f=A.length-1;f>=0;--f){let D=mt(A[f],!0);D.__removalCount=(a.__removalCount||0)+1,v.insertBefore(D,Zt(a))}}return tt(a),!0}return a instanceof u&&!function(v){let A=F(v);A&&A.tagName||(A={namespaceURI:jt,tagName:"template"});let f=_e(v.tagName),D=_e(A.tagName);return!!xn[v.namespaceURI]&&(v.namespaceURI===Re?A.namespaceURI===ot?f==="svg":A.namespaceURI===ke?f==="svg"&&(D==="annotation-xml"||Te[D]):!!Bi[f]:v.namespaceURI===ke?A.namespaceURI===ot?f==="math":A.namespaceURI===Re?f==="math"&&we[D]:!!_i[f]:v.namespaceURI===ot?!(A.namespaceURI===Re&&!we[D])&&!(A.namespaceURI===ke&&!Te[D])&&!_i[f]&&(uo[f]||!Bi[f]):!(ne!=="application/xhtml+xml"||!xn[v.namespaceURI]))}(a)?(tt(a),!0):h!=="noscript"&&h!=="noembed"&&h!=="noframes"||!_(/<\/no(script|embed|frames)/i,a.innerHTML)?(Pt&&a.nodeType===Zo&&(g=a.textContent,Ne([un,hn,dn],v=>{g=se(g,v," ")}),a.textContent!==g&&(oe(e.removed,{element:a.cloneNode()}),a.textContent=g)),st(q.afterSanitizeElements,a,null),!1):(tt(a),!0)},zi=function(a,g,h){if(Di&&(g==="id"||g==="name")&&(h in n||h in go))return!1;if(!(mn&&!gn[g]&&_(oo,g))){if(!(Ti&&_(so,g))){if(!O[g]||gn[g]){if(!(Hi(a)&&(w.tagNameCheck instanceof RegExp&&_(w.tagNameCheck,a)||w.tagNameCheck instanceof Function&&w.tagNameCheck(a))&&(w.attributeNameCheck instanceof RegExp&&_(w.attributeNameCheck,g)||w.attributeNameCheck instanceof Function&&w.attributeNameCheck(g))||g==="is"&&w.allowCustomizedBuiltInElements&&(w.tagNameCheck instanceof RegExp&&_(w.tagNameCheck,h)||w.tagNameCheck instanceof Function&&w.tagNameCheck(h))))return!1}else if(!An[g]){if(!_(Si,se(h,Ei,""))){if((g!=="src"&&g!=="xlink:href"&&g!=="href"||a==="script"||_o(h,"data:")!==0||!Oi[a])&&!(wi&&!_(ao,se(h,Ei,"")))){if(h)return!1}}}}}return!0},Hi=function(a){return a!=="annotation-xml"&&sr(a,lo)},qi=function(a){st(q.beforeSanitizeAttributes,a,null);let{attributes:g}=a;if(!g||En(a))return;let h={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0},v=g.length;for(;v--;){let A=g[v],{name:f,namespaceURI:D,value:at}=A,et=I(f),B=f==="value"?at:jo(at);if(h.attrName=et,h.attrValue=B,h.keepAttr=!0,h.forceKeepAttr=void 0,st(q.uponSanitizeAttribute,a,h),B=h.attrValue,!Ni||et!=="id"&&et!=="name"||(Le(f,a),B="user-content-"+B),pn&&_(/((--!?|])>)|<\/(style|title)/i,B)){Le(f,a);continue}if(h.forceKeepAttr||(Le(f,a),!h.keepAttr))continue;if(!Li&&_(/\/>/i,B)){Le(f,a);continue}Pt&&Ne([un,hn,dn],Ki=>{B=se(B,Ki," ")});let Ji=I(a.nodeName);if(zi(Ji,et,B)){if(k&&typeof Q=="object"&&typeof Q.getAttributeType=="function"&&!D)switch(Q.getAttributeType(Ji,et)){case"TrustedHTML":B=k.createHTML(B);break;case"TrustedScriptURL":B=k.createScriptURL(B)}try{D?a.setAttributeNS(D,f,B):a.setAttribute(f,B),En(a)?tt(a):or(e.removed)}catch{}}}st(q.afterSanitizeAttributes,a,null)},mo=function a(g){let h=null,v=Wi(g);for(st(q.beforeSanitizeShadowDOM,g,null);h=v.nextNode();)st(q.uponSanitizeShadowNode,h,null),Vi(h),qi(h),h.content instanceof s&&a(h.content);st(q.afterSanitizeShadowDOM,g,null)};return e.sanitize=function(a){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=null,v=null,A=null,f=null;if(yn=!a,yn&&(a=""),typeof a!="string"&&!Ui(a)){if(typeof a.toString!="function")throw ae("toString is not a function");if(typeof(a=a.toString())!="string")throw ae("dirty is not a string, aborting")}if(!e.isSupported)return a;if(fn||Cn(g),e.removed=[],typeof a=="string"&&(ee=!1),ee){if(a.nodeName){let et=I(a.nodeName);if(!N[et]||te[et])throw ae("root node is forbidden and cannot be sanitized in-place")}}else if(a instanceof c)h=ji(""),v=h.ownerDocument.importNode(a,!0),v.nodeType===Xo&&v.nodeName==="BODY"||v.nodeName==="HTML"?h=v:h.appendChild(v);else{if(!Mt&&!Pt&&!Ct&&a.indexOf("<")===-1)return k&&Se?k.createHTML(a):a;if(h=ji(a),!h)return Mt?null:Se?rt:""}h&&bn&&tt(h.firstChild);let D=Wi(ee?a:h);for(;A=D.nextNode();)Vi(A),qi(A),A.content instanceof s&&mo(A.content);if(ee)return a;if(Mt){if(Ee)for(f=no.call(h.ownerDocument);h.firstChild;)f.appendChild(h.firstChild);else f=h;return(O.shadowroot||O.shadowrootmode)&&(f=ro.call(r,f,!0)),f}let at=Ct?h.outerHTML:h.innerHTML;return Ct&&N["!doctype"]&&h.ownerDocument&&h.ownerDocument.doctype&&h.ownerDocument.doctype.name&&_(Hr,h.ownerDocument.doctype.name)&&(at=" +`+at),Pt&&Ne([un,hn,dn],et=>{at=se(at,et," ")}),k&&Se?k.createHTML(at):at},e.setConfig=function(){Cn(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),fn=!0},e.clearConfig=function(){Wt=null,fn=!1},e.isValidAttribute=function(a,g,h){Wt||Cn({});let v=I(a),A=I(g);return zi(v,A,h)},e.addHook=function(a,g){typeof g=="function"&&oe(q[a],g)},e.removeHook=function(a){return or(q[a])},e.removeHooks=function(a){q[a]=[]},e.removeAllHooks=function(){q={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},e}();Ve.addHook("uponSanitizeAttribute",function(i,t){/^data-trix-/.test(t.attrName)&&(t.forceKeepAttr=!0)});var is="style href src width height language class".split(" "),rs="javascript:".split(" "),os="script iframe form noscript".split(" "),qt=class extends R{static setHTML(t,e){let n=new this(e).sanitize(),r=n.getHTML?n.getHTML():n.outerHTML;t.innerHTML=r}static sanitize(t,e){let n=new this(t,e);return n.sanitize(),n}constructor(t){let{allowedAttributes:e,forbiddenProtocols:n,forbiddenElements:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.allowedAttributes=e||is,this.forbiddenProtocols=n||rs,this.forbiddenElements=r||os,this.body=ss(t)}sanitize(){return this.sanitizeElements(),this.normalizeListElementNesting(),Ve.setConfig(Lr),this.body=Ve.sanitize(this.body),this.body}getHTML(){return this.body.innerHTML}getBody(){return this.body}sanitizeElements(){let t=je(this.body),e=[];for(;t.nextNode();){let n=t.currentNode;switch(n.nodeType){case Node.ELEMENT_NODE:this.elementIsRemovable(n)?e.push(n):this.sanitizeElement(n);break;case Node.COMMENT_NODE:e.push(n)}}return e.forEach(n=>At(n)),this.body}sanitizeElement(t){return t.hasAttribute("href")&&this.forbiddenProtocols.includes(t.protocol)&&t.removeAttribute("href"),Array.from(t.attributes).forEach(e=>{let{name:n}=e;this.allowedAttributes.includes(n)||n.indexOf("data-trix")===0||t.removeAttribute(n)}),t}normalizeListElementNesting(){return Array.from(this.body.querySelectorAll("ul,ol")).forEach(t=>{let e=t.previousElementSibling;e&&j(e)==="li"&&e.appendChild(t)}),this.body}elementIsRemovable(t){if(t?.nodeType===Node.ELEMENT_NODE)return this.elementIsForbidden(t)||this.elementIsntSerializable(t)}elementIsForbidden(t){return this.forbiddenElements.includes(j(t))}elementIsntSerializable(t){return t.getAttribute("data-trix-serialize")==="false"&&!Tt(t)}},ss=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";i=i.replace(/<\/html[^>]*>[^]*$/i,"");let t=document.implementation.createHTMLDocument("");return t.documentElement.innerHTML=i,Array.from(t.head.querySelectorAll("style")).forEach(e=>{t.body.appendChild(e)}),t.body},{css:pt}=Ce,be=class extends dt{constructor(){super(...arguments),this.attachment=this.object,this.attachment.uploadProgressDelegate=this,this.attachmentPiece=this.options.piece}createContentNodes(){return[]}createNodes(){let t,e=t=p({tagName:"figure",className:this.getClassName(),data:this.getData(),editable:!1}),n=this.getHref();return n&&(t=p({tagName:"a",editable:!1,attributes:{href:n,tabindex:-1}}),e.appendChild(t)),this.attachment.hasContent()?qt.setHTML(t,this.attachment.getContent()):this.createContentNodes().forEach(r=>{t.appendChild(r)}),t.appendChild(this.createCaptionElement()),this.attachment.isPending()&&(this.progressElement=p({tagName:"progress",attributes:{class:pt.attachmentProgress,value:this.attachment.getUploadProgress(),max:100},data:{trixMutable:!0,trixStoreKey:["progressElement",this.attachment.id].join("/")}}),e.appendChild(this.progressElement)),[gr("left"),e,gr("right")]}createCaptionElement(){let t=p({tagName:"figcaption",className:pt.attachmentCaption}),e=this.attachmentPiece.getCaption();if(e)t.classList.add("".concat(pt.attachmentCaption,"--edited")),t.textContent=e;else{let n,r,o=this.getCaptionConfig();if(o.name&&(n=this.attachment.getFilename()),o.size&&(r=this.attachment.getFormattedFilesize()),n){let s=p({tagName:"span",className:pt.attachmentName,textContent:n});t.appendChild(s)}if(r){n&&t.appendChild(document.createTextNode(" "));let s=p({tagName:"span",className:pt.attachmentSize,textContent:r});t.appendChild(s)}}return t}getClassName(){let t=[pt.attachment,"".concat(pt.attachment,"--").concat(this.attachment.getType())],e=this.attachment.getExtension();return e&&t.push("".concat(pt.attachment,"--").concat(e)),t.join(" ")}getData(){let t={trixAttachment:JSON.stringify(this.attachment),trixContentType:this.attachment.getContentType(),trixId:this.attachment.id},{attributes:e}=this.attachmentPiece;return e.isEmpty()||(t.trixAttributes=JSON.stringify(e)),this.attachment.isPending()&&(t.trixSerialize=!1),t}getHref(){if(!as(this.attachment.getContent(),"a"))return this.attachment.getHref()}getCaptionConfig(){var t;let e=this.attachment.getType(),n=_r((t=mi[e])===null||t===void 0?void 0:t.caption);return e==="file"&&(n.name=!0),n}findProgressElement(){var t;return(t=this.findElement())===null||t===void 0?void 0:t.querySelector("progress")}attachmentDidChangeUploadProgress(){let t=this.attachment.getUploadProgress(),e=this.findProgressElement();e&&(e.value=t)}},gr=i=>p({tagName:"span",textContent:ln,data:{trixCursorTarget:i,trixSerialize:!1}}),as=function(i,t){let e=p("div");return qt.setHTML(e,i||""),e.querySelector(t)},ze=class extends be{constructor(){super(...arguments),this.attachment.previewDelegate=this}createContentNodes(){return this.image=p({tagName:"img",attributes:{src:""},data:{trixMutable:!0}}),this.refresh(this.image),[this.image]}createCaptionElement(){let t=super.createCaptionElement(...arguments);return t.textContent||t.setAttribute("data-trix-placeholder",m.captionPlaceholder),t}refresh(t){var e;if(t||(t=(e=this.findElement())===null||e===void 0?void 0:e.querySelector("img")),t)return this.updateAttributesForImage(t)}updateAttributesForImage(t){let e=this.attachment.getURL(),n=this.attachment.getPreviewURL();if(t.src=n||e,n===e)t.removeAttribute("data-trix-serialized-attributes");else{let l=JSON.stringify({src:e});t.setAttribute("data-trix-serialized-attributes",l)}let r=this.attachment.getWidth(),o=this.attachment.getHeight();r!=null&&(t.width=r),o!=null&&(t.height=o);let s=["imageElement",this.attachment.id,t.src,t.width,t.height].join("/");t.dataset.trixStoreKey=s}attachmentDidChangeAttributes(){return this.refresh(this.image),this.refresh()}},He=class extends dt{constructor(){super(...arguments),this.piece=this.object,this.attributes=this.piece.getAttributes(),this.textConfig=this.options.textConfig,this.context=this.options.context,this.piece.attachment?this.attachment=this.piece.attachment:this.string=this.piece.toString()}createNodes(){let t=this.attachment?this.createAttachmentNodes():this.createStringNodes(),e=this.createElement();if(e){let n=function(r){for(;(o=r)!==null&&o!==void 0&&o.firstElementChild;){var o;r=r.firstElementChild}return r}(e);Array.from(t).forEach(r=>{n.appendChild(r)}),t=[e]}return t}createAttachmentNodes(){let t=this.attachment.isPreviewable()?ze:be;return this.createChildView(t,this.piece.attachment,{piece:this.piece}).getNodes()}createStringNodes(){var t;if((t=this.textConfig)!==null&&t!==void 0&&t.plaintext)return[document.createTextNode(this.string)];{let e=[],n=this.string.split(` +`);for(let r=0;r0){let s=p("br");e.push(s)}if(o.length){let s=document.createTextNode(this.preserveSpaces(o));e.push(s)}}return e}}createElement(){let t,e,n,r={};for(e in this.attributes){n=this.attributes[e];let s=ti(e);if(s){if(s.tagName){var o;let l=p(s.tagName);o?(o.appendChild(l),o=l):t=o=l}if(s.styleProperty&&(r[s.styleProperty]=n),s.style)for(e in s.style)n=s.style[e],r[e]=n}}if(Object.keys(r).length)for(e in t||(t=p("span")),r)n=r[e],t.style[e]=n;return t}createContainerElement(){for(let t in this.attributes){let e=this.attributes[t],n=ti(t);if(n&&n.groupTagName){let r={};return r[t]=e,p(n.groupTagName,r)}}}preserveSpaces(t){return this.context.isLast&&(t=t.replace(/\ $/,ft)),t=t.replace(/(\S)\ {3}(\S)/g,"$1 ".concat(ft," $2")).replace(/\ {2}/g,"".concat(ft," ")).replace(/\ {2}/g," ".concat(ft)),(this.context.isFirst||this.context.followsWhitespace)&&(t=t.replace(/^\ /,ft)),t}},qe=class extends dt{constructor(){super(...arguments),this.text=this.object,this.textConfig=this.options.textConfig}createNodes(){let t=[],e=fe.groupObjects(this.getPieces()),n=e.length-1;for(let o=0;o!t.hasAttribute("blockBreak"))}},ls=i=>/\s$/.test(i?.toString()),{css:mr}=Ce,Je=class extends dt{constructor(){super(...arguments),this.block=this.object,this.attributes=this.block.getAttributes()}createNodes(){let t=[document.createComment("block")];if(this.block.isEmpty())t.push(p("br"));else{var e;let n=(e=L(this.block.getLastAttribute()))===null||e===void 0?void 0:e.text,r=this.findOrCreateCachedChildView(qe,this.block.text,{textConfig:n});t.push(...Array.from(r.getNodes()||[])),this.shouldAddExtraNewlineElement()&&t.push(p("br"))}if(this.attributes.length)return t;{let n,{tagName:r}=W.default;this.block.isRTL()&&(n={dir:"rtl"});let o=p({tagName:r,attributes:n});return t.forEach(s=>o.appendChild(s)),[o]}}createContainerElement(t){let e={},n,r=this.attributes[t],{tagName:o,htmlAttributes:s=[]}=L(r);if(t===0&&this.block.isRTL()&&Object.assign(e,{dir:"rtl"}),r==="attachmentGallery"){let l=this.block.getBlockBreakPosition();n="".concat(mr.attachmentGallery," ").concat(mr.attachmentGallery,"--").concat(l)}return Object.entries(this.block.htmlAttributes).forEach(l=>{let[c,u]=l;s.includes(c)&&(e[c]=u)}),p({tagName:o,className:n,attributes:e})}shouldAddExtraNewlineElement(){return/\n\n$/.test(this.block.toString())}},Jt=class extends dt{static render(t){let e=p("div"),n=new this(t,{element:e});return n.render(),n.sync(),e}constructor(){super(...arguments),this.element=this.options.element,this.elementStore=new ii,this.setDocument(this.object)}setDocument(t){t.isEqualTo(this.document)||(this.document=this.object=t)}render(){if(this.childViews=[],this.shadowElement=p("div"),!this.document.isEmpty()){let t=fe.groupObjects(this.document.getBlocks(),{asTree:!0});Array.from(t).forEach(e=>{let n=this.findOrCreateCachedChildView(Je,e);Array.from(n.getNodes()).map(r=>this.shadowElement.appendChild(r))})}}isSynced(){return cs(this.shadowElement,this.element)}sync(){let t=this.createDocumentFragmentForSync();for(;this.element.lastChild;)this.element.removeChild(this.element.lastChild);return this.element.appendChild(t),this.didSync()}didSync(){return this.elementStore.reset(pr(this.element)),Ai(()=>this.garbageCollectCachedViews())}createDocumentFragmentForSync(){let t=document.createDocumentFragment();return Array.from(this.shadowElement.childNodes).forEach(e=>{t.appendChild(e.cloneNode(!0))}),Array.from(pr(t)).forEach(e=>{let n=this.elementStore.remove(e);n&&e.parentNode.replaceChild(n,e)}),t}},pr=i=>i.querySelectorAll("[data-trix-store-key]"),cs=(i,t)=>fr(i.innerHTML)===fr(t.innerHTML),fr=i=>i.replace(/ /g," ");function Oe(i){var t,e;function n(o,s){try{var l=i[o](s),c=l.value,u=c instanceof us;Promise.resolve(u?c.v:c).then(function(d){if(u){var C=o==="return"?"return":"next";if(!c.k||d.done)return n(C,d);d=i[C](d).value}r(l.done?"return":"normal",d)},function(d){n("throw",d)})}catch(d){r("throw",d)}}function r(o,s){switch(o){case"return":t.resolve({value:s,done:!0});break;case"throw":t.reject(s);break;default:t.resolve({value:s,done:!1})}(t=t.next)?n(t.key,t.arg):e=null}this._invoke=function(o,s){return new Promise(function(l,c){var u={key:o,arg:s,resolve:l,reject:c,next:null};e?e=e.next=u:(t=e=u,n(o,s))})},typeof i.return!="function"&&(this.return=void 0)}function us(i,t){this.v=i,this.k=t}function z(i,t,e){return(t=hs(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function hs(i){var t=function(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,n||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(i,"string");return typeof t=="symbol"?t:String(t)}Oe.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Oe.prototype.next=function(i){return this._invoke("next",i)},Oe.prototype.throw=function(i){return this._invoke("throw",i)},Oe.prototype.return=function(i){return this._invoke("return",i)};function x(i,t){return ds(i,qr(i,t,"get"))}function Ci(i,t,e){return gs(i,qr(i,t,"set"),e),e}function qr(i,t,e){if(!t.has(i))throw new TypeError("attempted to "+e+" private field on non-instance");return t.get(i)}function ds(i,t){return t.get?t.get.call(i):t.value}function gs(i,t,e){if(t.set)t.set.call(i,e);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=e}}function Fe(i,t,e){if(!t.has(i))throw new TypeError("attempted to get private field on non-instance");return e}function Jr(i,t){if(t.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pe(i,t,e){Jr(i,t),t.set(i,e)}var gt=class extends ht{static registerType(t,e){e.type=t,this.types[t]=e}static fromJSON(t){let e=this.types[t.type];if(e)return e.fromJSON(t)}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.attributes=X.box(e)}copyWithAttributes(t){return new this.constructor(this.getValue(),t)}copyWithAdditionalAttributes(t){return this.copyWithAttributes(this.attributes.merge(t))}copyWithoutAttribute(t){return this.copyWithAttributes(this.attributes.remove(t))}copy(){return this.copyWithAttributes(this.attributes)}getAttribute(t){return this.attributes.get(t)}getAttributesHash(){return this.attributes}getAttributes(){return this.attributes.toObject()}hasAttribute(t){return this.attributes.has(t)}hasSameStringValueAsPiece(t){return t&&this.toString()===t.toString()}hasSameAttributesAsPiece(t){return t&&(this.attributes===t.attributes||this.attributes.isEqualTo(t.attributes))}isBlockBreak(){return!1}isEqualTo(t){return super.isEqualTo(...arguments)||this.hasSameConstructorAs(t)&&this.hasSameStringValueAsPiece(t)&&this.hasSameAttributesAsPiece(t)}isEmpty(){return this.length===0}isSerializable(){return!0}toJSON(){return{type:this.constructor.type,attributes:this.getAttributes()}}contentsForInspection(){return{type:this.constructor.type,attributes:this.attributes.inspect()}}canBeGrouped(){return this.hasAttribute("href")}canBeGroupedWith(t){return this.getAttribute("href")===t.getAttribute("href")}getLength(){return this.length}canBeConsolidatedWith(t){return!1}};z(gt,"types",{});var Ke=class extends Ht{constructor(t){super(...arguments),this.url=t}perform(t){let e=new Image;e.onload=()=>(e.width=this.width=e.naturalWidth,e.height=this.height=e.naturalHeight,t(!0,e)),e.onerror=()=>t(!1),e.src=this.url}},Kt=class i extends ht{static attachmentForFile(t){let e=new this(this.attributesForFile(t));return e.setFile(t),e}static attributesForFile(t){return new X({filename:t.name,filesize:t.size,contentType:t.type})}static fromJSON(t){return new this(t)}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(t),this.releaseFile=this.releaseFile.bind(this),this.attributes=X.box(t),this.didChangeAttributes()}getAttribute(t){return this.attributes.get(t)}hasAttribute(t){return this.attributes.has(t)}getAttributes(){return this.attributes.toObject()}setAttributes(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this.attributes.merge(t);var n,r,o,s;if(!this.attributes.isEqualTo(e))return this.attributes=e,this.didChangeAttributes(),(n=this.previewDelegate)===null||n===void 0||(r=n.attachmentDidChangeAttributes)===null||r===void 0||r.call(n,this),(o=this.delegate)===null||o===void 0||(s=o.attachmentDidChangeAttributes)===null||s===void 0?void 0:s.call(o,this)}didChangeAttributes(){if(this.isPreviewable())return this.preloadURL()}isPending(){return this.file!=null&&!(this.getURL()||this.getHref())}isPreviewable(){return this.attributes.has("previewable")?this.attributes.get("previewable"):i.previewablePattern.test(this.getContentType())}getType(){return this.hasContent()?"content":this.isPreviewable()?"preview":"file"}getURL(){return this.attributes.get("url")}getHref(){return this.attributes.get("href")}getFilename(){return this.attributes.get("filename")||""}getFilesize(){return this.attributes.get("filesize")}getFormattedFilesize(){let t=this.attributes.get("filesize");return typeof t=="number"?Dr.formatter(t):""}getExtension(){var t;return(t=this.getFilename().match(/\.(\w+)$/))===null||t===void 0?void 0:t[1].toLowerCase()}getContentType(){return this.attributes.get("contentType")}hasContent(){return this.attributes.has("content")}getContent(){return this.attributes.get("content")}getWidth(){return this.attributes.get("width")}getHeight(){return this.attributes.get("height")}getFile(){return this.file}setFile(t){if(this.file=t,this.isPreviewable())return this.preloadFile()}releaseFile(){this.releasePreloadedFile(),this.file=null}getUploadProgress(){return this.uploadProgress!=null?this.uploadProgress:0}setUploadProgress(t){var e,n;if(this.uploadProgress!==t)return this.uploadProgress=t,(e=this.uploadProgressDelegate)===null||e===void 0||(n=e.attachmentDidChangeUploadProgress)===null||n===void 0?void 0:n.call(e,this)}toJSON(){return this.getAttributes()}getCacheKey(){return[super.getCacheKey(...arguments),this.attributes.getCacheKey(),this.getPreviewURL()].join("/")}getPreviewURL(){return this.previewURL||this.preloadingURL}setPreviewURL(t){var e,n,r,o;if(t!==this.getPreviewURL())return this.previewURL=t,(e=this.previewDelegate)===null||e===void 0||(n=e.attachmentDidChangeAttributes)===null||n===void 0||n.call(e,this),(r=this.delegate)===null||r===void 0||(o=r.attachmentDidChangePreviewURL)===null||o===void 0?void 0:o.call(r,this)}preloadURL(){return this.preload(this.getURL(),this.releaseFile)}preloadFile(){if(this.file)return this.fileObjectURL=URL.createObjectURL(this.file),this.preload(this.fileObjectURL)}releasePreloadedFile(){this.fileObjectURL&&(URL.revokeObjectURL(this.fileObjectURL),this.fileObjectURL=null)}preload(t,e){if(t&&t!==this.getPreviewURL())return this.preloadingURL=t,new Ke(t).then(n=>{let{width:r,height:o}=n;return this.getWidth()&&this.getHeight()||this.setAttributes({width:r,height:o}),this.preloadingURL=null,this.setPreviewURL(t),e?.()}).catch(()=>(this.preloadingURL=null,e?.()))}};z(Kt,"previewablePattern",/^image(\/(gif|png|webp|jpe?g)|$)/);var Gt=class i extends gt{static fromJSON(t){return new this(Kt.fromJSON(t.attachment),t.attributes)}constructor(t){super(...arguments),this.attachment=t,this.length=1,this.ensureAttachmentExclusivelyHasAttribute("href"),this.attachment.hasContent()||this.removeProhibitedAttributes()}ensureAttachmentExclusivelyHasAttribute(t){this.hasAttribute(t)&&(this.attachment.hasAttribute(t)||this.attachment.setAttributes(this.attributes.slice([t])),this.attributes=this.attributes.remove(t))}removeProhibitedAttributes(){let t=this.attributes.slice(i.permittedAttributes);t.isEqualTo(this.attributes)||(this.attributes=t)}getValue(){return this.attachment}isSerializable(){return!this.attachment.isPending()}getCaption(){return this.attributes.get("caption")||""}isEqualTo(t){var e;return super.isEqualTo(t)&&this.attachment.id===(t==null||(e=t.attachment)===null||e===void 0?void 0:e.id)}toString(){return"\uFFFC"}toJSON(){let t=super.toJSON(...arguments);return t.attachment=this.attachment,t}getCacheKey(){return[super.getCacheKey(...arguments),this.attachment.getCacheKey()].join("/")}toConsole(){return JSON.stringify(this.toString())}};z(Gt,"permittedAttributes",["caption","presentation"]),gt.registerType("attachment",Gt);var ve=class extends gt{static fromJSON(t){return new this(t.string,t.attributes)}constructor(t){super(...arguments),this.string=(e=>e.replace(/\r\n?/g,` +`))(t),this.length=this.string.length}getValue(){return this.string}toString(){return this.string.toString()}isBlockBreak(){return this.toString()===` +`&&this.getAttribute("blockBreak")===!0}toJSON(){let t=super.toJSON(...arguments);return t.string=this.string,t}canBeConsolidatedWith(t){return t&&this.hasSameConstructorAs(t)&&this.hasSameAttributesAsPiece(t)}consolidateWith(t){return new this.constructor(this.toString()+t.toString(),this.attributes)}splitAtOffset(t){let e,n;return t===0?(e=null,n=this):t===this.length?(e=this,n=null):(e=new this.constructor(this.string.slice(0,t),this.attributes),n=new this.constructor(this.string.slice(t),this.attributes)),[e,n]}toConsole(){let{string:t}=this;return t.length>15&&(t=t.slice(0,14)+"\u2026"),JSON.stringify(t.toString())}};gt.registerType("string",ve);var $t=class extends ht{static box(t){return t instanceof this?t:new this(t)}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects=t.slice(0),this.length=this.objects.length}indexOf(t){return this.objects.indexOf(t)}splice(){for(var t=arguments.length,e=new Array(t),n=0;nt(e,n))}insertObjectAtIndex(t,e){return this.splice(e,0,t)}insertSplittableListAtIndex(t,e){return this.splice(e,0,...t.objects)}insertSplittableListAtPosition(t,e){let[n,r]=this.splitObjectAtPosition(e);return new this.constructor(n).insertSplittableListAtIndex(t,r)}editObjectAtIndex(t,e){return this.replaceObjectAtIndex(e(this.objects[t]),t)}replaceObjectAtIndex(t,e){return this.splice(e,1,t)}removeObjectAtIndex(t){return this.splice(t,1)}getObjectAtIndex(t){return this.objects[t]}getSplittableListInRange(t){let[e,n,r]=this.splitObjectsAtRange(t);return new this.constructor(e.slice(n,r+1))}selectSplittableList(t){let e=this.objects.filter(n=>t(n));return new this.constructor(e)}removeObjectsInRange(t){let[e,n,r]=this.splitObjectsAtRange(t);return new this.constructor(e).splice(n,r-n+1)}transformObjectsInRange(t,e){let[n,r,o]=this.splitObjectsAtRange(t),s=n.map((l,c)=>r<=c&&c<=o?e(l):l);return new this.constructor(s)}splitObjectsAtRange(t){let e,[n,r,o]=this.splitObjectAtPosition(ps(t));return[n,e]=new this.constructor(n).splitObjectAtPosition(fs(t)+o),[n,r,e-1]}getObjectAtPosition(t){let{index:e}=this.findIndexAndOffsetAtPosition(t);return this.objects[e]}splitObjectAtPosition(t){let e,n,{index:r,offset:o}=this.findIndexAndOffsetAtPosition(t),s=this.objects.slice(0);if(r!=null)if(o===0)e=r,n=0;else{let l=this.getObjectAtIndex(r),[c,u]=l.splitAtOffset(o);s.splice(r,1,c,u),e=r+1,n=c.getLength()-o}else e=s.length,n=0;return[s,e,n]}consolidate(){let t=[],e=this.objects[0];return this.objects.slice(1).forEach(n=>{var r,o;(r=(o=e).canBeConsolidatedWith)!==null&&r!==void 0&&r.call(o,n)?e=e.consolidateWith(n):(t.push(e),e=n)}),e&&t.push(e),new this.constructor(t)}consolidateFromIndexToIndex(t,e){let n=this.objects.slice(0).slice(t,e+1),r=new this.constructor(n).consolidate().toArray();return this.splice(t,n.length,...r)}findIndexAndOffsetAtPosition(t){let e,n=0;for(e=0;ethis.endPosition+=t.getLength())),this.endPosition}toString(){return this.objects.join("")}toArray(){return this.objects.slice(0)}toJSON(){return this.toArray()}isEqualTo(t){return super.isEqualTo(...arguments)||ms(this.objects,t?.objects)}contentsForInspection(){return{objects:"[".concat(this.objects.map(t=>t.inspect()).join(", "),"]")}}},ms=function(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(i.length!==t.length)return!1;let e=!0;for(let n=0;ni[0],fs=i=>i[1],J=class extends ht{static textForAttachmentWithAttributes(t,e){return new this([new Gt(t,e)])}static textForStringWithAttributes(t,e){return new this([new ve(t,e)])}static fromJSON(t){return new this(Array.from(t).map(e=>gt.fromJSON(e)))}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments);let e=t.filter(n=>!n.isEmpty());this.pieceList=new $t(e)}copy(){return this.copyWithPieceList(this.pieceList)}copyWithPieceList(t){return new this.constructor(t.consolidate().toArray())}copyUsingObjectMap(t){let e=this.getPieces().map(n=>t.find(n)||n);return new this.constructor(e)}appendText(t){return this.insertTextAtPosition(t,this.getLength())}insertTextAtPosition(t,e){return this.copyWithPieceList(this.pieceList.insertSplittableListAtPosition(t.pieceList,e))}removeTextAtRange(t){return this.copyWithPieceList(this.pieceList.removeObjectsInRange(t))}replaceTextAtRange(t,e){return this.removeTextAtRange(e).insertTextAtPosition(t,e[0])}moveTextFromRangeToPosition(t,e){if(t[0]<=e&&e<=t[1])return;let n=this.getTextAtRange(t),r=n.getLength();return t[0]n.copyWithAdditionalAttributes(t)))}removeAttributeAtRange(t,e){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e,n=>n.copyWithoutAttribute(t)))}setAttributesAtRange(t,e){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e,n=>n.copyWithAttributes(t)))}getAttributesAtPosition(t){var e;return((e=this.pieceList.getObjectAtPosition(t))===null||e===void 0?void 0:e.getAttributes())||{}}getCommonAttributes(){let t=Array.from(this.pieceList.toArray()).map(e=>e.getAttributes());return X.fromCommonAttributesOfObjects(t).toObject()}getCommonAttributesAtRange(t){return this.getTextAtRange(t).getCommonAttributes()||{}}getExpandedRangeForAttributeAtOffset(t,e){let n,r=n=e,o=this.getLength();for(;r>0&&this.getCommonAttributesAtRange([r-1,n])[t];)r--;for(;n!!t.attachment)}getAttachments(){return this.getAttachmentPieces().map(t=>t.attachment)}getAttachmentAndPositionById(t){let e=0;for(let r of this.pieceList.toArray()){var n;if(((n=r.attachment)===null||n===void 0?void 0:n.id)===t)return{attachment:r.attachment,position:e};e+=r.length}return{attachment:null,position:null}}getAttachmentById(t){let{attachment:e}=this.getAttachmentAndPositionById(t);return e}getRangeOfAttachment(t){let e=this.getAttachmentAndPositionById(t.id),n=e.position;if(t=e.attachment)return[n,n+1]}updateAttributesForAttachment(t,e){let n=this.getRangeOfAttachment(e);return n?this.addAttributesAtRange(t,n):this}getLength(){return this.pieceList.getEndPosition()}isEmpty(){return this.getLength()===0}isEqualTo(t){var e;return super.isEqualTo(t)||(t==null||(e=t.pieceList)===null||e===void 0?void 0:e.isEqualTo(this.pieceList))}isBlockBreak(){return this.getLength()===1&&this.pieceList.getObjectAtIndex(0).isBlockBreak()}eachPiece(t){return this.pieceList.eachObject(t)}getPieces(){return this.pieceList.toArray()}getPieceAtPosition(t){return this.pieceList.getObjectAtPosition(t)}contentsForInspection(){return{pieceList:this.pieceList.inspect()}}toSerializableText(){let t=this.pieceList.selectSplittableList(e=>e.isSerializable());return this.copyWithPieceList(t)}toString(){return this.pieceList.toString()}toJSON(){return this.pieceList.toJSON()}toConsole(){return JSON.stringify(this.pieceList.toArray().map(t=>JSON.parse(t.toConsole())))}getDirection(){return Ro(this.toString())}isRTL(){return this.getDirection()==="rtl"}},bt=class i extends ht{static fromJSON(t){return new this(J.fromJSON(t.text),t.attributes,t.htmlAttributes)}constructor(t,e,n){super(...arguments),this.text=bs(t||new J),this.attributes=e||[],this.htmlAttributes=n||{}}isEmpty(){return this.text.isBlockBreak()}isEqualTo(t){return!!super.isEqualTo(t)||this.text.isEqualTo(t?.text)&&It(this.attributes,t?.attributes)&&Xt(this.htmlAttributes,t?.htmlAttributes)}copyWithText(t){return new i(t,this.attributes,this.htmlAttributes)}copyWithoutText(){return this.copyWithText(null)}copyWithAttributes(t){return new i(this.text,t,this.htmlAttributes)}copyWithoutAttributes(){return this.copyWithAttributes(null)}copyUsingObjectMap(t){let e=t.find(this.text);return e?this.copyWithText(e):this.copyWithText(this.text.copyUsingObjectMap(t))}addAttribute(t){let e=this.attributes.concat(br(t));return this.copyWithAttributes(e)}addHTMLAttribute(t,e){let n=Object.assign({},this.htmlAttributes,{[t]:e});return new i(this.text,this.attributes,n)}removeAttribute(t){let{listAttribute:e}=L(t),n=Ar(Ar(this.attributes,t),e);return this.copyWithAttributes(n)}removeLastAttribute(){return this.removeAttribute(this.getLastAttribute())}getLastAttribute(){return vr(this.attributes)}getAttributes(){return this.attributes.slice(0)}getAttributeLevel(){return this.attributes.length}getAttributeAtLevel(t){return this.attributes[t-1]}hasAttribute(t){return this.attributes.includes(t)}hasAttributes(){return this.getAttributeLevel()>0}getLastNestableAttribute(){return vr(this.getNestableAttributes())}getNestableAttributes(){return this.attributes.filter(t=>L(t).nestable)}getNestingLevel(){return this.getNestableAttributes().length}decreaseNestingLevel(){let t=this.getLastNestableAttribute();return t?this.removeAttribute(t):this}increaseNestingLevel(){let t=this.getLastNestableAttribute();if(t){let e=this.attributes.lastIndexOf(t),n=vi(this.attributes,e+1,0,...br(t));return this.copyWithAttributes(n)}return this}getListItemAttributes(){return this.attributes.filter(t=>L(t).listAttribute)}isListItem(){var t;return(t=L(this.getLastAttribute()))===null||t===void 0?void 0:t.listAttribute}isTerminalBlock(){var t;return(t=L(this.getLastAttribute()))===null||t===void 0?void 0:t.terminal}breaksOnReturn(){var t;return(t=L(this.getLastAttribute()))===null||t===void 0?void 0:t.breakOnReturn}findLineBreakInDirectionFromPosition(t,e){let n=this.toString(),r;switch(t){case"forward":r=n.indexOf(` +`,e);break;case"backward":r=n.slice(0,e).lastIndexOf(` +`)}if(r!==-1)return r}contentsForInspection(){return{text:this.text.inspect(),attributes:this.attributes}}toString(){return this.text.toString()}toJSON(){return{text:this.text,attributes:this.attributes,htmlAttributes:this.htmlAttributes}}getDirection(){return this.text.getDirection()}isRTL(){return this.text.isRTL()}getLength(){return this.text.getLength()}canBeConsolidatedWith(t){return!this.hasAttributes()&&!t.hasAttributes()&&this.getDirection()===t.getDirection()}consolidateWith(t){let e=J.textForStringWithAttributes(` +`),n=this.getTextWithoutBlockBreak().appendText(e);return this.copyWithText(n.appendText(t.text))}splitAtOffset(t){let e,n;return t===0?(e=null,n=this):t===this.getLength()?(e=this,n=null):(e=this.copyWithText(this.text.getTextAtRange([0,t])),n=this.copyWithText(this.text.getTextAtRange([t,this.getLength()]))),[e,n]}getBlockBreakPosition(){return this.text.getLength()-1}getTextWithoutBlockBreak(){return Kr(this.text)?this.text.getTextAtRange([0,this.getBlockBreakPosition()]):this.text.copy()}canBeGrouped(t){return this.attributes[t]}canBeGroupedWith(t,e){let n=t.getAttributes(),r=n[e],o=this.attributes[e];return o===r&&!(L(o).group===!1&&!(()=>{if(!De){De=[];for(let s in W){let{listAttribute:l}=W[s];l!=null&&De.push(l)}}return De})().includes(n[e+1]))&&(this.getDirection()===t.getDirection()||t.isEmpty())}},bs=function(i){return i=vs(i),i=ys(i)},vs=function(i){let t=!1,e=i.getPieces(),n=e.slice(0,e.length-1),r=e[e.length-1];return r?(n=n.map(o=>o.isBlockBreak()?(t=!0,xs(o)):o),t?new J([...n,r]):i):i},As=J.textForStringWithAttributes(` +`,{blockBreak:!0}),ys=function(i){return Kr(i)?i:i.appendText(As)},Kr=function(i){let t=i.getLength();return t===0?!1:i.getTextAtRange([t-1,t]).isBlockBreak()},xs=i=>i.copyWithoutAttribute("blockBreak"),br=function(i){let{listAttribute:t}=L(i);return t?[t,i]:[i]},vr=i=>i.slice(-1)[0],Ar=function(i,t){let e=i.lastIndexOf(t);return e===-1?i:vi(i,e,1)},V=class extends ht{static fromJSON(t){return new this(Array.from(t).map(e=>bt.fromJSON(e)))}static fromString(t,e){let n=J.textForStringWithAttributes(t,e);return new this([new bt(n)])}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),t.length===0&&(t=[new bt]),this.blockList=$t.box(t)}isEmpty(){let t=this.getBlockAtIndex(0);return this.blockList.length===1&&t.isEmpty()&&!t.hasAttributes()}copy(){let t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).consolidateBlocks?this.blockList.consolidate().toArray():this.blockList.toArray();return new this.constructor(t)}copyUsingObjectsFromDocument(t){let e=new ni(t.getObjects());return this.copyUsingObjectMap(e)}copyUsingObjectMap(t){let e=this.getBlocks().map(n=>t.find(n)||n.copyUsingObjectMap(t));return new this.constructor(e)}copyWithBaseBlockAttributes(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=this.getBlocks().map(n=>{let r=t.concat(n.getAttributes());return n.copyWithAttributes(r)});return new this.constructor(e)}replaceBlock(t,e){let n=this.blockList.indexOf(t);return n===-1?this:new this.constructor(this.blockList.replaceObjectAtIndex(e,n))}insertDocumentAtRange(t,e){let{blockList:n}=t;e=y(e);let[r]=e,{index:o,offset:s}=this.locationFromPosition(r),l=this,c=this.getBlockAtPosition(r);return ut(e)&&c.isEmpty()&&!c.hasAttributes()?l=new this.constructor(l.blockList.removeObjectAtIndex(o)):c.getBlockBreakPosition()===s&&r++,l=l.removeTextAtRange(e),new this.constructor(l.blockList.insertSplittableListAtPosition(n,r))}mergeDocumentAtRange(t,e){let n,r;e=y(e);let[o]=e,s=this.locationFromPosition(o),l=this.getBlockAtIndex(s.index).getAttributes(),c=t.getBaseBlockAttributes(),u=l.slice(-c.length);if(It(c,u)){let T=l.slice(0,-c.length);n=t.copyWithBaseBlockAttributes(T)}else n=t.copy({consolidateBlocks:!0}).copyWithBaseBlockAttributes(l);let d=n.getBlockCount(),C=n.getBlockAtIndex(0);if(It(l,C.getAttributes())){let T=C.getTextWithoutBlockBreak();if(r=this.insertTextAtRange(T,e),d>1){n=new this.constructor(n.getBlocks().slice(1));let H=o+T.getLength();r=r.insertDocumentAtRange(n,H)}}else r=this.insertDocumentAtRange(n,e);return r}insertTextAtRange(t,e){e=y(e);let[n]=e,{index:r,offset:o}=this.locationFromPosition(n),s=this.removeTextAtRange(e);return new this.constructor(s.blockList.editObjectAtIndex(r,l=>l.copyWithText(l.text.insertTextAtPosition(t,o))))}removeTextAtRange(t){let e;t=y(t);let[n,r]=t;if(ut(t))return this;let[o,s]=Array.from(this.locationRangeFromRange(t)),l=o.index,c=o.offset,u=this.getBlockAtIndex(l),d=s.index,C=s.offset,T=this.getBlockAtIndex(d);if(r-n==1&&u.getBlockBreakPosition()===c&&T.getBlockBreakPosition()!==C&&T.text.getStringAtPosition(C)===` +`)e=this.blockList.editObjectAtIndex(d,H=>H.copyWithText(H.text.removeTextAtRange([C,C+1])));else{let H,Q=u.text.getTextAtRange([0,c]),M=T.text.getTextAtRange([C,T.getLength()]),mt=Q.appendText(M);H=l!==d&&c===0&&u.getAttributeLevel()>=T.getAttributeLevel()?T.copyWithText(mt):u.copyWithText(mt);let yt=d+1-l;e=this.blockList.splice(l,yt,H)}return new this.constructor(e)}moveTextFromRangeToPosition(t,e){let n;t=y(t);let[r,o]=t;if(r<=e&&e<=o)return this;let s=this.getDocumentAtRange(t),l=this.removeTextAtRange(t),c=rr=r.editObjectAtIndex(l,function(){return L(t)?o.addAttribute(t,e):s[0]===s[1]?o:o.copyWithText(o.text.addAttributeAtRange(t,e,s))})),new this.constructor(r)}addAttribute(t,e){let{blockList:n}=this;return this.eachBlock((r,o)=>n=n.editObjectAtIndex(o,()=>r.addAttribute(t,e))),new this.constructor(n)}removeAttributeAtRange(t,e){let{blockList:n}=this;return this.eachBlockAtRange(e,function(r,o,s){L(t)?n=n.editObjectAtIndex(s,()=>r.removeAttribute(t)):o[0]!==o[1]&&(n=n.editObjectAtIndex(s,()=>r.copyWithText(r.text.removeAttributeAtRange(t,o))))}),new this.constructor(n)}updateAttributesForAttachment(t,e){let n=this.getRangeOfAttachment(e),[r]=Array.from(n),{index:o}=this.locationFromPosition(r),s=this.getTextAtIndex(o);return new this.constructor(this.blockList.editObjectAtIndex(o,l=>l.copyWithText(s.updateAttributesForAttachment(t,e))))}removeAttributeForAttachment(t,e){let n=this.getRangeOfAttachment(e);return this.removeAttributeAtRange(t,n)}setHTMLAttributeAtPosition(t,e,n){let r=this.getBlockAtPosition(t),o=r.addHTMLAttribute(e,n);return this.replaceBlock(r,o)}insertBlockBreakAtRange(t){let e;t=y(t);let[n]=t,{offset:r}=this.locationFromPosition(n),o=this.removeTextAtRange(t);return r===0&&(e=[new bt]),new this.constructor(o.blockList.insertSplittableListAtPosition(new $t(e),n))}applyBlockAttributeAtRange(t,e,n){let r=this.expandRangeToLineBreaksAndSplitBlocks(n),o=r.document;n=r.range;let s=L(t);if(s.listAttribute){o=o.removeLastListAttributeAtRange(n,{exceptAttributeName:t});let l=o.convertLineBreaksToBlockBreaksInRange(n);o=l.document,n=l.range}else o=s.exclusive?o.removeBlockAttributesAtRange(n):s.terminal?o.removeLastTerminalAttributeAtRange(n):o.consolidateBlocksAtRange(n);return o.addAttributeAtRange(t,e,n)}removeLastListAttributeAtRange(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{blockList:n}=this;return this.eachBlockAtRange(t,function(r,o,s){let l=r.getLastAttribute();l&&L(l).listAttribute&&l!==e.exceptAttributeName&&(n=n.editObjectAtIndex(s,()=>r.removeAttribute(l)))}),new this.constructor(n)}removeLastTerminalAttributeAtRange(t){let{blockList:e}=this;return this.eachBlockAtRange(t,function(n,r,o){let s=n.getLastAttribute();s&&L(s).terminal&&(e=e.editObjectAtIndex(o,()=>n.removeAttribute(s)))}),new this.constructor(e)}removeBlockAttributesAtRange(t){let{blockList:e}=this;return this.eachBlockAtRange(t,function(n,r,o){n.hasAttributes()&&(e=e.editObjectAtIndex(o,()=>n.copyWithoutAttributes()))}),new this.constructor(e)}expandRangeToLineBreaksAndSplitBlocks(t){let e;t=y(t);let[n,r]=t,o=this.locationFromPosition(n),s=this.locationFromPosition(r),l=this,c=l.getBlockAtIndex(o.index);if(o.offset=c.findLineBreakInDirectionFromPosition("backward",o.offset),o.offset!=null&&(e=l.positionFromLocation(o),l=l.insertBlockBreakAtRange([e,e+1]),s.index+=1,s.offset-=l.getBlockAtIndex(o.index).getLength(),o.index+=1),o.offset=0,s.offset===0&&s.index>o.index)s.index-=1,s.offset=l.getBlockAtIndex(s.index).getBlockBreakPosition();else{let u=l.getBlockAtIndex(s.index);u.text.getStringAtRange([s.offset-1,s.offset])===` +`?s.offset-=1:s.offset=u.findLineBreakInDirectionFromPosition("forward",s.offset),s.offset!==u.getBlockBreakPosition()&&(e=l.positionFromLocation(s),l=l.insertBlockBreakAtRange([e,e+1]))}return n=l.positionFromLocation(o),r=l.positionFromLocation(s),{document:l,range:t=y([n,r])}}convertLineBreaksToBlockBreaksInRange(t){t=y(t);let[e]=t,n=this.getStringAtRange(t).slice(0,-1),r=this;return n.replace(/.*?\n/g,function(o){e+=o.length,r=r.insertBlockBreakAtRange([e-1,e])}),{document:r,range:t}}consolidateBlocksAtRange(t){t=y(t);let[e,n]=t,r=this.locationFromPosition(e).index,o=this.locationFromPosition(n).index;return new this.constructor(this.blockList.consolidateFromIndexToIndex(r,o))}getDocumentAtRange(t){t=y(t);let e=this.blockList.getSplittableListInRange(t).toArray();return new this.constructor(e)}getStringAtRange(t){let e,n=t=y(t);return n[n.length-1]!==this.getLength()&&(e=-1),this.getDocumentAtRange(t).toString().slice(0,e)}getBlockAtIndex(t){return this.blockList.getObjectAtIndex(t)}getBlockAtPosition(t){let{index:e}=this.locationFromPosition(t);return this.getBlockAtIndex(e)}getTextAtIndex(t){var e;return(e=this.getBlockAtIndex(t))===null||e===void 0?void 0:e.text}getTextAtPosition(t){let{index:e}=this.locationFromPosition(t);return this.getTextAtIndex(e)}getPieceAtPosition(t){let{index:e,offset:n}=this.locationFromPosition(t);return this.getTextAtIndex(e).getPieceAtPosition(n)}getCharacterAtPosition(t){let{index:e,offset:n}=this.locationFromPosition(t);return this.getTextAtIndex(e).getStringAtRange([n,n+1])}getLength(){return this.blockList.getEndPosition()}getBlocks(){return this.blockList.toArray()}getBlockCount(){return this.blockList.length}getEditCount(){return this.editCount}eachBlock(t){return this.blockList.eachObject(t)}eachBlockAtRange(t,e){let n,r;t=y(t);let[o,s]=t,l=this.locationFromPosition(o),c=this.locationFromPosition(s);if(l.index===c.index)return n=this.getBlockAtIndex(l.index),r=[l.offset,c.offset],e(n,r,l.index);for(let u=l.index;u<=c.index;u++)if(n=this.getBlockAtIndex(u),n){switch(u){case l.index:r=[l.offset,n.text.getLength()];break;case c.index:r=[0,c.offset];break;default:r=[0,n.text.getLength()]}e(n,r,u)}}getCommonAttributesAtRange(t){t=y(t);let[e]=t;if(ut(t))return this.getCommonAttributesAtPosition(e);{let n=[],r=[];return this.eachBlockAtRange(t,function(o,s){if(s[0]!==s[1])return n.push(o.text.getCommonAttributesAtRange(s)),r.push(yr(o))}),X.fromCommonAttributesOfObjects(n).merge(X.fromCommonAttributesOfObjects(r)).toObject()}}getCommonAttributesAtPosition(t){let e,n,{index:r,offset:o}=this.locationFromPosition(t),s=this.getBlockAtIndex(r);if(!s)return{};let l=yr(s),c=s.text.getAttributesAtPosition(o),u=s.text.getAttributesAtPosition(o-1),d=Object.keys(Dt).filter(C=>Dt[C].inheritable);for(e in u)n=u[e],(n===c[e]||d.includes(e))&&(l[e]=n);return l}getRangeOfCommonAttributeAtPosition(t,e){let{index:n,offset:r}=this.locationFromPosition(e),o=this.getTextAtIndex(n),[s,l]=Array.from(o.getExpandedRangeForAttributeAtOffset(t,r)),c=this.positionFromLocation({index:n,offset:s}),u=this.positionFromLocation({index:n,offset:l});return y([c,u])}getBaseBlockAttributes(){let t=this.getBlockAtIndex(0).getAttributes();for(let e=1;e{let o=[];for(let s=0;s{let{text:n}=e;return t=t.concat(n.getAttachmentPieces())}),t}getAttachments(){return this.getAttachmentPieces().map(t=>t.attachment)}getRangeOfAttachment(t){let e=0,n=this.blockList.toArray();for(let r=0;r{let o=r.getLength();r.hasAttribute(t)&&n.push([e,e+o]),e+=o}),n}findRangesForTextAttribute(t){let{withValue:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=0,r=[],o=[];return this.getPieces().forEach(s=>{let l=s.getLength();(function(c){return e?c.getAttribute(t)===e:c.hasAttribute(t)})(s)&&(r[1]===n?r[1]=n+l:o.push(r=[n,n+l])),n+=l}),o}locationFromPosition(t){let e=this.blockList.findIndexAndOffsetAtPosition(Math.max(0,t));if(e.index!=null)return e;{let n=this.getBlocks();return{index:n.length-1,offset:n[n.length-1].getLength()}}}positionFromLocation(t){return this.blockList.findPositionAtIndexAndOffset(t.index,t.offset)}locationRangeFromPosition(t){return y(this.locationFromPosition(t))}locationRangeFromRange(t){if(!(t=y(t)))return;let[e,n]=Array.from(t),r=this.locationFromPosition(e),o=this.locationFromPosition(n);return y([r,o])}rangeFromLocationRange(t){let e;t=y(t);let n=this.positionFromLocation(t[0]);return ut(t)||(e=this.positionFromLocation(t[1])),y([n,e])}isEqualTo(t){return this.blockList.isEqualTo(t?.blockList)}getTexts(){return this.getBlocks().map(t=>t.text)}getPieces(){let t=[];return Array.from(this.getTexts()).forEach(e=>{t.push(...Array.from(e.getPieces()||[]))}),t}getObjects(){return this.getBlocks().concat(this.getTexts()).concat(this.getPieces())}toSerializableDocument(){let t=[];return this.blockList.eachObject(e=>t.push(e.copyWithText(e.text.toSerializableText()))),new this.constructor(t)}toString(){return this.blockList.toString()}toJSON(){return this.blockList.toJSON()}toConsole(){return JSON.stringify(this.blockList.toArray().map(t=>JSON.parse(t.text.toConsole())))}},yr=function(i){let t={},e=i.getLastAttribute();return e&&(t[e]=!0),t},jn=function(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{string:i=ue(i),attributes:t,type:"string"}},xr=(i,t)=>{try{return JSON.parse(i.getAttribute("data-trix-".concat(t)))}catch{return{}}},Ft=class extends R{static parse(t,e){let n=new this(t,e);return n.parse(),n}constructor(t){let{referenceElement:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.html=t,this.referenceElement=e,this.blocks=[],this.blockElements=[],this.processedElements=[]}getDocument(){return V.fromJSON(this.blocks)}parse(){try{this.createHiddenContainer(),qt.setHTML(this.containerElement,this.html);let t=je(this.containerElement,{usingFilter:Es});for(;t.nextNode();)this.processNode(t.currentNode);return this.translateBlockElementMarginsToNewlines()}finally{this.removeHiddenContainer()}}createHiddenContainer(){return this.referenceElement?(this.containerElement=this.referenceElement.cloneNode(!1),this.containerElement.removeAttribute("id"),this.containerElement.setAttribute("data-trix-internal",""),this.containerElement.style.display="none",this.referenceElement.parentNode.insertBefore(this.containerElement,this.referenceElement.nextSibling)):(this.containerElement=p({tagName:"div",style:{display:"none"}}),document.body.appendChild(this.containerElement))}removeHiddenContainer(){return At(this.containerElement)}processNode(t){switch(t.nodeType){case Node.TEXT_NODE:if(!this.isInsignificantTextNode(t))return this.appendBlockForTextNode(t),this.processTextNode(t);break;case Node.ELEMENT_NODE:return this.appendBlockForElement(t),this.processElement(t)}}appendBlockForTextNode(t){let e=t.parentNode;if(e===this.currentBlockElement&&this.isBlockElement(t.previousSibling))return this.appendStringWithAttributes(` +`);if(e===this.containerElement||this.isBlockElement(e)){var n;let r=this.getBlockAttributes(e),o=this.getBlockHTMLAttributes(e);It(r,(n=this.currentBlock)===null||n===void 0?void 0:n.attributes)||(this.currentBlock=this.appendBlockForAttributesWithElement(r,e,o),this.currentBlockElement=e)}}appendBlockForElement(t){let e=this.isBlockElement(t),n=kt(this.currentBlockElement,t);if(e&&!this.isBlockElement(t.firstChild)){if(!this.isInsignificantTextNode(t.firstChild)||!this.isBlockElement(t.firstElementChild)){let r=this.getBlockAttributes(t),o=this.getBlockHTMLAttributes(t);if(t.firstChild){if(n&&It(r,this.currentBlock.attributes))return this.appendStringWithAttributes(` +`);this.currentBlock=this.appendBlockForAttributesWithElement(r,t,o),this.currentBlockElement=t}}}else if(this.currentBlockElement&&!n&&!e){let r=this.findParentBlockElement(t);if(r)return this.appendBlockForElement(r);this.currentBlock=this.appendEmptyBlock(),this.currentBlockElement=null}}findParentBlockElement(t){let{parentElement:e}=t;for(;e&&e!==this.containerElement;){if(this.isBlockElement(e)&&this.blockElements.includes(e))return e;e=e.parentElement}return null}processTextNode(t){let e=t.data;var n;return Cr(t.parentNode)||(e=xi(e),Gr((n=t.previousSibling)===null||n===void 0?void 0:n.textContent)&&(e=Ss(e))),this.appendStringWithAttributes(e,this.getTextAttributes(t.parentNode))}processElement(t){let e;if(Tt(t)){if(e=xr(t,"attachment"),Object.keys(e).length){let n=this.getTextAttributes(t);this.appendAttachmentWithAttributes(e,n),t.innerHTML=""}return this.processedElements.push(t)}switch(j(t)){case"br":return this.isExtraBR(t)||this.isBlockElement(t.nextSibling)||this.appendStringWithAttributes(` +`,this.getTextAttributes(t)),this.processedElements.push(t);case"img":e={url:t.getAttribute("src"),contentType:"image"};let n=(r=>{let o=r.getAttribute("width"),s=r.getAttribute("height"),l={};return o&&(l.width=parseInt(o,10)),s&&(l.height=parseInt(s,10)),l})(t);for(let r in n){let o=n[r];e[r]=o}return this.appendAttachmentWithAttributes(e,this.getTextAttributes(t)),this.processedElements.push(t);case"tr":if(this.needsTableSeparator(t))return this.appendStringWithAttributes(Me.tableRowSeparator);break;case"td":if(this.needsTableSeparator(t))return this.appendStringWithAttributes(Me.tableCellSeparator)}}appendBlockForAttributesWithElement(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.blockElements.push(e);let r=function(){return{text:[],attributes:arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},htmlAttributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}}}(t,n);return this.blocks.push(r),r}appendEmptyBlock(){return this.appendBlockForAttributesWithElement([],null)}appendStringWithAttributes(t,e){return this.appendPiece(jn(t,e))}appendAttachmentWithAttributes(t,e){return this.appendPiece(function(n){return{attachment:n,attributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},type:"attachment"}}(t,e))}appendPiece(t){return this.blocks.length===0&&this.appendEmptyBlock(),this.blocks[this.blocks.length-1].text.push(t)}appendStringToTextAtIndex(t,e){let{text:n}=this.blocks[e],r=n[n.length-1];if(r?.type!=="string")return n.push(jn(t));r.string+=t}prependStringToTextAtIndex(t,e){let{text:n}=this.blocks[e],r=n[0];if(r?.type!=="string")return n.unshift(jn(t));r.string=t+r.string}getTextAttributes(t){let e,n={};for(let r in Dt){let o=Dt[r];if(o.tagName&&vt(t,{matchingSelector:o.tagName,untilNode:this.containerElement}))n[r]=!0;else if(o.parser){if(e=o.parser(t),e){let s=!1;for(let l of this.findBlockElementAncestors(t))if(o.parser(l)===e){s=!0;break}s||(n[r]=e)}}else o.styleProperty&&(e=t.style[o.styleProperty],e&&(n[r]=e))}if(Tt(t)){let r=xr(t,"attributes");for(let o in r)e=r[o],n[o]=e}return n}getBlockAttributes(t){let e=[];for(;t&&t!==this.containerElement;){for(let r in W){let o=W[r];var n;o.parse!==!1&&j(t)===o.tagName&&((n=o.test)!==null&&n!==void 0&&n.call(o,t)||!o.test)&&(e.push(r),o.listAttribute&&e.push(o.listAttribute))}t=t.parentNode}return e.reverse()}getBlockHTMLAttributes(t){let e={},n=Object.values(W).find(r=>r.tagName===j(t));return(n?.htmlAttributes||[]).forEach(r=>{t.hasAttribute(r)&&(e[r]=t.getAttribute(r))}),e}findBlockElementAncestors(t){let e=[];for(;t&&t!==this.containerElement;){let n=j(t);de().includes(n)&&e.push(t),t=t.parentNode}return e}isBlockElement(t){if(t?.nodeType===Node.ELEMENT_NODE&&!Tt(t)&&!vt(t,{matchingSelector:"td",untilNode:this.containerElement}))return de().includes(j(t))||window.getComputedStyle(t).display==="block"}isInsignificantTextNode(t){if(t?.nodeType!==Node.TEXT_NODE||!ks(t.data))return;let{parentNode:e,previousSibling:n,nextSibling:r}=t;return Cs(e.previousSibling)&&!this.isBlockElement(e.previousSibling)||Cr(e)?void 0:!n||this.isBlockElement(n)||!r||this.isBlockElement(r)}isExtraBR(t){return j(t)==="br"&&this.isBlockElement(t.parentNode)&&t.parentNode.lastChild===t}needsTableSeparator(t){if(Me.removeBlankTableCells){var e;let n=(e=t.previousSibling)===null||e===void 0?void 0:e.textContent;return n&&/\S/.test(n)}return t.previousSibling}translateBlockElementMarginsToNewlines(){let t=this.getMarginOfDefaultBlockElement();for(let e=0;e2*t.top&&this.prependStringToTextAtIndex(` +`,e),n.bottom>2*t.bottom&&this.appendStringToTextAtIndex(` +`,e))}}getMarginOfBlockElementAtIndex(t){let e=this.blockElements[t];if(e&&e.textContent&&!de().includes(j(e))&&!this.processedElements.includes(e))return Er(e)}getMarginOfDefaultBlockElement(){let t=p(W.default.tagName);return this.containerElement.appendChild(t),Er(t)}},Cr=function(i){let{whiteSpace:t}=window.getComputedStyle(i);return["pre","pre-wrap","pre-line"].includes(t)},Cs=i=>i&&!Gr(i.textContent),Er=function(i){let t=window.getComputedStyle(i);if(t.display==="block")return{top:parseInt(t.marginTop),bottom:parseInt(t.marginBottom)}},Es=function(i){return j(i)==="style"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},Ss=i=>i.replace(new RegExp("^".concat(yi.source,"+")),""),ks=i=>new RegExp("^".concat(yi.source,"*$")).test(i),Gr=i=>/\s$/.test(i),Rs=["contenteditable","data-trix-id","data-trix-store-key","data-trix-mutable","data-trix-placeholder","tabindex"],ai="data-trix-serialized-attributes",Ts="[".concat(ai,"]"),ws=new RegExp("","g"),Ls={"application/json":function(i){let t;if(i instanceof V)t=i;else{if(!(i instanceof HTMLElement))throw new Error("unserializable object");t=Ft.parse(i.innerHTML).getDocument()}return t.toSerializableDocument().toJSONString()},"text/html":function(i){let t;if(i instanceof V)t=Jt.render(i);else{if(!(i instanceof HTMLElement))throw new Error("unserializable object");t=i.cloneNode(!0)}return Array.from(t.querySelectorAll("[data-trix-serialize=false]")).forEach(e=>{At(e)}),Rs.forEach(e=>{Array.from(t.querySelectorAll("[".concat(e,"]"))).forEach(n=>{n.removeAttribute(e)})}),Array.from(t.querySelectorAll(Ts)).forEach(e=>{try{let n=JSON.parse(e.getAttribute(ai));e.removeAttribute(ai);for(let r in n){let o=n[r];e.setAttribute(r,o)}}catch{}}),t.innerHTML.replace(ws,"")}},Ds=Object.freeze({__proto__:null}),E=class extends R{constructor(t,e){super(...arguments),this.attachmentManager=t,this.attachment=e,this.id=this.attachment.id,this.file=this.attachment.file}remove(){return this.attachmentManager.requestRemovalOfAttachment(this.attachment)}};E.proxyMethod("attachment.getAttribute"),E.proxyMethod("attachment.hasAttribute"),E.proxyMethod("attachment.setAttribute"),E.proxyMethod("attachment.getAttributes"),E.proxyMethod("attachment.setAttributes"),E.proxyMethod("attachment.isPending"),E.proxyMethod("attachment.isPreviewable"),E.proxyMethod("attachment.getURL"),E.proxyMethod("attachment.getHref"),E.proxyMethod("attachment.getFilename"),E.proxyMethod("attachment.getFilesize"),E.proxyMethod("attachment.getFormattedFilesize"),E.proxyMethod("attachment.getExtension"),E.proxyMethod("attachment.getContentType"),E.proxyMethod("attachment.getFile"),E.proxyMethod("attachment.setFile"),E.proxyMethod("attachment.releaseFile"),E.proxyMethod("attachment.getUploadProgress"),E.proxyMethod("attachment.setUploadProgress");var Ge=class extends R{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.managedAttachments={},Array.from(t).forEach(e=>{this.manageAttachment(e)})}getAttachments(){let t=[];for(let e in this.managedAttachments){let n=this.managedAttachments[e];t.push(n)}return t}manageAttachment(t){return this.managedAttachments[t.id]||(this.managedAttachments[t.id]=new E(this,t)),this.managedAttachments[t.id]}attachmentIsManaged(t){return t.id in this.managedAttachments}requestRemovalOfAttachment(t){var e,n;if(this.attachmentIsManaged(t))return(e=this.delegate)===null||e===void 0||(n=e.attachmentManagerDidRequestRemovalOfAttachment)===null||n===void 0?void 0:n.call(e,t)}unmanageAttachment(t){let e=this.managedAttachments[t.id];return delete this.managedAttachments[t.id],e}},$e=class{constructor(t){this.composition=t,this.document=this.composition.document;let e=this.composition.getSelectedRange();this.startPosition=e[0],this.endPosition=e[1],this.startLocation=this.document.locationFromPosition(this.startPosition),this.endLocation=this.document.locationFromPosition(this.endPosition),this.block=this.document.getBlockAtIndex(this.endLocation.index),this.breaksOnReturn=this.block.breaksOnReturn(),this.previousCharacter=this.block.text.getStringAtPosition(this.endLocation.offset-1),this.nextCharacter=this.block.text.getStringAtPosition(this.endLocation.offset)}shouldInsertBlockBreak(){return this.block.hasAttributes()&&this.block.isListItem()&&!this.block.isEmpty()?this.startLocation.offset!==0:this.breaksOnReturn&&this.nextCharacter!==` +`}shouldBreakFormattedBlock(){return this.block.hasAttributes()&&!this.block.isListItem()&&(this.breaksOnReturn&&this.nextCharacter===` +`||this.previousCharacter===` +`)}shouldDecreaseListLevel(){return this.block.hasAttributes()&&this.block.isListItem()&&this.block.isEmpty()}shouldPrependListItem(){return this.block.isListItem()&&this.startLocation.offset===0&&!this.block.isEmpty()}shouldRemoveLastBlockAttribute(){return this.block.hasAttributes()&&!this.block.isListItem()&&this.block.isEmpty()}},it=class extends R{constructor(){super(...arguments),this.document=new V,this.attachments=[],this.currentAttributes={},this.revision=0}setDocument(t){var e,n;if(!t.isEqualTo(this.document))return this.document=t,this.refreshAttachments(),this.revision++,(e=this.delegate)===null||e===void 0||(n=e.compositionDidChangeDocument)===null||n===void 0?void 0:n.call(e,t)}getSnapshot(){return{document:this.document,selectedRange:this.getSelectedRange()}}loadSnapshot(t){var e,n,r,o;let{document:s,selectedRange:l}=t;return(e=this.delegate)===null||e===void 0||(n=e.compositionWillLoadSnapshot)===null||n===void 0||n.call(e),this.setDocument(s??new V),this.setSelection(l??[0,0]),(r=this.delegate)===null||r===void 0||(o=r.compositionDidLoadSnapshot)===null||o===void 0?void 0:o.call(r)}insertText(t){let{updatePosition:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{updatePosition:!0},n=this.getSelectedRange();this.setDocument(this.document.insertTextAtRange(t,n));let r=n[0],o=r+t.getLength();return e&&this.setSelection(o),this.notifyDelegateOfInsertionAtRange([r,o])}insertBlock(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new bt,e=new V([t]);return this.insertDocument(e)}insertDocument(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new V,e=this.getSelectedRange();this.setDocument(this.document.insertDocumentAtRange(t,e));let n=e[0],r=n+t.getLength();return this.setSelection(r),this.notifyDelegateOfInsertionAtRange([n,r])}insertString(t,e){let n=this.getCurrentTextAttributes(),r=J.textForStringWithAttributes(t,n);return this.insertText(r,e)}insertBlockBreak(){let t=this.getSelectedRange();this.setDocument(this.document.insertBlockBreakAtRange(t));let e=t[0],n=e+1;return this.setSelection(n),this.notifyDelegateOfInsertionAtRange([e,n])}insertLineBreak(){let t=new $e(this);if(t.shouldDecreaseListLevel())return this.decreaseListLevel(),this.setSelection(t.startPosition);if(t.shouldPrependListItem()){let e=new V([t.block.copyWithoutText()]);return this.insertDocument(e)}return t.shouldInsertBlockBreak()?this.insertBlockBreak():t.shouldRemoveLastBlockAttribute()?this.removeLastBlockAttribute():t.shouldBreakFormattedBlock()?this.breakFormattedBlock(t):this.insertString(` +`)}insertHTML(t){let e=Ft.parse(t).getDocument(),n=this.getSelectedRange();this.setDocument(this.document.mergeDocumentAtRange(e,n));let r=n[0],o=r+e.getLength()-1;return this.setSelection(o),this.notifyDelegateOfInsertionAtRange([r,o])}replaceHTML(t){let e=Ft.parse(t).getDocument().copyUsingObjectsFromDocument(this.document),n=this.getLocationRange({strict:!1}),r=this.document.rangeFromLocationRange(n);return this.setDocument(e),this.setSelection(r)}insertFile(t){return this.insertFiles([t])}insertFiles(t){let e=[];return Array.from(t).forEach(n=>{var r;if((r=this.delegate)!==null&&r!==void 0&&r.compositionShouldAcceptFile(n)){let o=Kt.attachmentForFile(n);e.push(o)}}),this.insertAttachments(e)}insertAttachment(t){return this.insertAttachments([t])}insertAttachments(t){let e=new J;return Array.from(t).forEach(n=>{var r;let o=n.getType(),s=(r=mi[o])===null||r===void 0?void 0:r.presentation,l=this.getCurrentTextAttributes();s&&(l.presentation=s);let c=J.textForAttachmentWithAttributes(n,l);e=e.appendText(c)}),this.insertText(e)}shouldManageDeletingInDirection(t){let e=this.getLocationRange();if(ut(e)){if(t==="backward"&&e[0].offset===0||this.shouldManageMovingCursorInDirection(t))return!0}else if(e[0].index!==e[1].index)return!0;return!1}deleteInDirection(t){let e,n,r,{length:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this.getLocationRange(),l=this.getSelectedRange(),c=ut(l);if(c?n=t==="backward"&&s[0].offset===0:r=s[0].index!==s[1].index,n&&this.canDecreaseBlockAttributeLevel()){let u=this.getBlock();if(u.isListItem()?this.decreaseListLevel():this.decreaseBlockAttributeLevel(),this.setSelection(l[0]),u.isEmpty())return!1}return c&&(l=this.getExpandedRangeInDirection(t,{length:o}),t==="backward"&&(e=this.getAttachmentAtRange(l))),e?(this.editAttachment(e),!1):(this.setDocument(this.document.removeTextAtRange(l)),this.setSelection(l[0]),!n&&!r&&void 0)}moveTextFromRange(t){let[e]=Array.from(this.getSelectedRange());return this.setDocument(this.document.moveTextFromRangeToPosition(t,e)),this.setSelection(e)}removeAttachment(t){let e=this.document.getRangeOfAttachment(t);if(e)return this.stopEditingAttachment(),this.setDocument(this.document.removeTextAtRange(e)),this.setSelection(e[0])}removeLastBlockAttribute(){let[t,e]=Array.from(this.getSelectedRange()),n=this.document.getBlockAtPosition(e);return this.removeCurrentAttribute(n.getLastAttribute()),this.setSelection(t)}insertPlaceholder(){return this.placeholderPosition=this.getPosition(),this.insertString(" ")}selectPlaceholder(){if(this.placeholderPosition!=null)return this.setSelectedRange([this.placeholderPosition,this.placeholderPosition+1]),this.getSelectedRange()}forgetPlaceholder(){this.placeholderPosition=null}hasCurrentAttribute(t){let e=this.currentAttributes[t];return e!=null&&e!==!1}toggleCurrentAttribute(t){let e=!this.currentAttributes[t];return e?this.setCurrentAttribute(t,e):this.removeCurrentAttribute(t)}canSetCurrentAttribute(t){return L(t)?this.canSetCurrentBlockAttribute(t):this.canSetCurrentTextAttribute(t)}canSetCurrentTextAttribute(t){let e=this.getSelectedDocument();if(e){for(let n of Array.from(e.getAttachments()))if(!n.hasContent())return!1;return!0}}canSetCurrentBlockAttribute(t){let e=this.getBlock();if(e)return!e.isTerminalBlock()}setCurrentAttribute(t,e){return L(t)?this.setBlockAttribute(t,e):(this.setTextAttribute(t,e),this.currentAttributes[t]=e,this.notifyDelegateOfCurrentAttributesChange())}setHTMLAtributeAtPosition(t,e,n){var r;let o=this.document.getBlockAtPosition(t),s=(r=L(o.getLastAttribute()))===null||r===void 0?void 0:r.htmlAttributes;if(o&&s!=null&&s.includes(e)){let l=this.document.setHTMLAttributeAtPosition(t,e,n);this.setDocument(l)}}setTextAttribute(t,e){let n=this.getSelectedRange();if(!n)return;let[r,o]=Array.from(n);if(r!==o)return this.setDocument(this.document.addAttributeAtRange(t,e,n));if(t==="href"){let s=J.textForStringWithAttributes(e,{href:e});return this.insertText(s)}}setBlockAttribute(t,e){let n=this.getSelectedRange();if(this.canSetCurrentAttribute(t))return this.setDocument(this.document.applyBlockAttributeAtRange(t,e,n)),this.setSelection(n)}removeCurrentAttribute(t){return L(t)?(this.removeBlockAttribute(t),this.updateCurrentAttributes()):(this.removeTextAttribute(t),delete this.currentAttributes[t],this.notifyDelegateOfCurrentAttributesChange())}removeTextAttribute(t){let e=this.getSelectedRange();if(e)return this.setDocument(this.document.removeAttributeAtRange(t,e))}removeBlockAttribute(t){let e=this.getSelectedRange();if(e)return this.setDocument(this.document.removeAttributeAtRange(t,e))}canDecreaseNestingLevel(){var t;return((t=this.getBlock())===null||t===void 0?void 0:t.getNestingLevel())>0}canIncreaseNestingLevel(){var t;let e=this.getBlock();if(e){if((t=L(e.getLastNestableAttribute()))===null||t===void 0||!t.listAttribute)return e.getNestingLevel()>0;{let n=this.getPreviousBlock();if(n)return function(){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return It((arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).slice(0,r.length),r)}(n.getListItemAttributes(),e.getListItemAttributes())}}}decreaseNestingLevel(){let t=this.getBlock();if(t)return this.setDocument(this.document.replaceBlock(t,t.decreaseNestingLevel()))}increaseNestingLevel(){let t=this.getBlock();if(t)return this.setDocument(this.document.replaceBlock(t,t.increaseNestingLevel()))}canDecreaseBlockAttributeLevel(){var t;return((t=this.getBlock())===null||t===void 0?void 0:t.getAttributeLevel())>0}decreaseBlockAttributeLevel(){var t;let e=(t=this.getBlock())===null||t===void 0?void 0:t.getLastAttribute();if(e)return this.removeCurrentAttribute(e)}decreaseListLevel(){let[t]=Array.from(this.getSelectedRange()),{index:e}=this.document.locationFromPosition(t),n=e,r=this.getBlock().getAttributeLevel(),o=this.document.getBlockAtIndex(n+1);for(;o&&o.isListItem()&&!(o.getAttributeLevel()<=r);)n++,o=this.document.getBlockAtIndex(n+1);t=this.document.positionFromLocation({index:e,offset:0});let s=this.document.positionFromLocation({index:n,offset:0});return this.setDocument(this.document.removeLastListAttributeAtRange([t,s]))}updateCurrentAttributes(){let t=this.getSelectedRange({ignoreLock:!0});if(t){let e=this.document.getCommonAttributesAtRange(t);if(Array.from(Qn()).forEach(n=>{e[n]||this.canSetCurrentAttribute(n)||(e[n]=!1)}),!Xt(e,this.currentAttributes))return this.currentAttributes=e,this.notifyDelegateOfCurrentAttributesChange()}}getCurrentAttributes(){return Nr.call({},this.currentAttributes)}getCurrentTextAttributes(){let t={};for(let e in this.currentAttributes){let n=this.currentAttributes[e];n!==!1&&ti(e)&&(t[e]=n)}return t}freezeSelection(){return this.setCurrentAttribute("frozen",!0)}thawSelection(){return this.removeCurrentAttribute("frozen")}hasFrozenSelection(){return this.hasCurrentAttribute("frozen")}setSelection(t){var e;let n=this.document.locationRangeFromRange(t);return(e=this.delegate)===null||e===void 0?void 0:e.compositionDidRequestChangingSelectionToLocationRange(n)}getSelectedRange(){let t=this.getLocationRange();if(t)return this.document.rangeFromLocationRange(t)}setSelectedRange(t){let e=this.document.locationRangeFromRange(t);return this.getSelectionManager().setLocationRange(e)}getPosition(){let t=this.getLocationRange();if(t)return this.document.positionFromLocation(t[0])}getLocationRange(t){return this.targetLocationRange?this.targetLocationRange:this.getSelectionManager().getLocationRange(t)||y({index:0,offset:0})}withTargetLocationRange(t,e){let n;this.targetLocationRange=t;try{n=e()}finally{this.targetLocationRange=null}return n}withTargetRange(t,e){let n=this.document.locationRangeFromRange(t);return this.withTargetLocationRange(n,e)}withTargetDOMRange(t,e){let n=this.createLocationRangeFromDOMRange(t,{strict:!1});return this.withTargetLocationRange(n,e)}getExpandedRangeInDirection(t){let{length:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},[n,r]=Array.from(this.getSelectedRange());return t==="backward"?e?n-=e:n=this.translateUTF16PositionFromOffset(n,-1):e?r+=e:r=this.translateUTF16PositionFromOffset(r,1),y([n,r])}shouldManageMovingCursorInDirection(t){if(this.editingAttachment)return!0;let e=this.getExpandedRangeInDirection(t);return this.getAttachmentAtRange(e)!=null}moveCursorInDirection(t){let e,n;if(this.editingAttachment)n=this.document.getRangeOfAttachment(this.editingAttachment);else{let r=this.getSelectedRange();n=this.getExpandedRangeInDirection(t),e=!We(r,n)}if(t==="backward"?this.setSelectedRange(n[0]):this.setSelectedRange(n[1]),e){let r=this.getAttachmentAtRange(n);if(r)return this.editAttachment(r)}}expandSelectionInDirection(t){let{length:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getExpandedRangeInDirection(t,{length:e});return this.setSelectedRange(n)}expandSelectionForEditing(){if(this.hasCurrentAttribute("href"))return this.expandSelectionAroundCommonAttribute("href")}expandSelectionAroundCommonAttribute(t){let e=this.getPosition(),n=this.document.getRangeOfCommonAttributeAtPosition(t,e);return this.setSelectedRange(n)}selectionContainsAttachments(){var t;return((t=this.getSelectedAttachments())===null||t===void 0?void 0:t.length)>0}selectionIsInCursorTarget(){return this.editingAttachment||this.positionIsCursorTarget(this.getPosition())}positionIsCursorTarget(t){let e=this.document.locationFromPosition(t);if(e)return this.locationIsCursorTarget(e)}positionIsBlockBreak(t){var e;return(e=this.document.getPieceAtPosition(t))===null||e===void 0?void 0:e.isBlockBreak()}getSelectedDocument(){let t=this.getSelectedRange();if(t)return this.document.getDocumentAtRange(t)}getSelectedAttachments(){var t;return(t=this.getSelectedDocument())===null||t===void 0?void 0:t.getAttachments()}getAttachments(){return this.attachments.slice(0)}refreshAttachments(){let t=this.document.getAttachments(),{added:e,removed:n}=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=[],l=[],c=new Set;r.forEach(d=>{c.add(d)});let u=new Set;return o.forEach(d=>{u.add(d),c.has(d)||s.push(d)}),r.forEach(d=>{u.has(d)||l.push(d)}),{added:s,removed:l}}(this.attachments,t);return this.attachments=t,Array.from(n).forEach(r=>{var o,s;r.delegate=null,(o=this.delegate)===null||o===void 0||(s=o.compositionDidRemoveAttachment)===null||s===void 0||s.call(o,r)}),(()=>{let r=[];return Array.from(e).forEach(o=>{var s,l;o.delegate=this,r.push((s=this.delegate)===null||s===void 0||(l=s.compositionDidAddAttachment)===null||l===void 0?void 0:l.call(s,o))}),r})()}attachmentDidChangeAttributes(t){var e,n;return this.revision++,(e=this.delegate)===null||e===void 0||(n=e.compositionDidEditAttachment)===null||n===void 0?void 0:n.call(e,t)}attachmentDidChangePreviewURL(t){var e,n;return this.revision++,(e=this.delegate)===null||e===void 0||(n=e.compositionDidChangeAttachmentPreviewURL)===null||n===void 0?void 0:n.call(e,t)}editAttachment(t,e){var n,r;if(t!==this.editingAttachment)return this.stopEditingAttachment(),this.editingAttachment=t,(n=this.delegate)===null||n===void 0||(r=n.compositionDidStartEditingAttachment)===null||r===void 0?void 0:r.call(n,this.editingAttachment,e)}stopEditingAttachment(){var t,e;this.editingAttachment&&((t=this.delegate)===null||t===void 0||(e=t.compositionDidStopEditingAttachment)===null||e===void 0||e.call(t,this.editingAttachment),this.editingAttachment=null)}updateAttributesForAttachment(t,e){return this.setDocument(this.document.updateAttributesForAttachment(t,e))}removeAttributeForAttachment(t,e){return this.setDocument(this.document.removeAttributeForAttachment(t,e))}breakFormattedBlock(t){let{document:e}=t,{block:n}=t,r=t.startPosition,o=[r-1,r];n.getBlockBreakPosition()===t.startLocation.offset?(n.breaksOnReturn()&&t.nextCharacter===` +`?r+=1:e=e.removeTextAtRange(o),o=[r,r]):t.nextCharacter===` +`?t.previousCharacter===` +`?o=[r-1,r+1]:(o=[r,r+1],r+=1):t.startLocation.offset-1!=0&&(r+=1);let s=new V([n.removeLastAttribute().copyWithoutText()]);return this.setDocument(e.insertDocumentAtRange(s,o)),this.setSelection(r)}getPreviousBlock(){let t=this.getLocationRange();if(t){let{index:e}=t[0];if(e>0)return this.document.getBlockAtIndex(e-1)}}getBlock(){let t=this.getLocationRange();if(t)return this.document.getBlockAtIndex(t[0].index)}getAttachmentAtRange(t){let e=this.document.getDocumentAtRange(t);if(e.toString()==="".concat("\uFFFC",` +`))return e.getAttachments()[0]}notifyDelegateOfCurrentAttributesChange(){var t,e;return(t=this.delegate)===null||t===void 0||(e=t.compositionDidChangeCurrentAttributes)===null||e===void 0?void 0:e.call(t,this.currentAttributes)}notifyDelegateOfInsertionAtRange(t){var e,n;return(e=this.delegate)===null||e===void 0||(n=e.compositionDidPerformInsertionAtRange)===null||n===void 0?void 0:n.call(e,t)}translateUTF16PositionFromOffset(t,e){let n=this.document.toUTF16String(),r=n.offsetFromUCS2Offset(t);return n.offsetToUCS2Offset(r+e)}};it.proxyMethod("getSelectionManager().getPointRange"),it.proxyMethod("getSelectionManager().setLocationRangeFromPointRange"),it.proxyMethod("getSelectionManager().createLocationRangeFromDOMRange"),it.proxyMethod("getSelectionManager().locationIsCursorTarget"),it.proxyMethod("getSelectionManager().selectionIsExpanded"),it.proxyMethod("delegate?.getSelectionManager");var Ae=class extends R{constructor(t){super(...arguments),this.composition=t,this.undoEntries=[],this.redoEntries=[]}recordUndoEntry(t){let{context:e,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.undoEntries.slice(-1)[0];if(!n||!Ns(r,t,e)){let o=this.createEntry({description:t,context:e});this.undoEntries.push(o),this.redoEntries=[]}}undo(){let t=this.undoEntries.pop();if(t){let e=this.createEntry(t);return this.redoEntries.push(e),this.composition.loadSnapshot(t.snapshot)}}redo(){let t=this.redoEntries.pop();if(t){let e=this.createEntry(t);return this.undoEntries.push(e),this.composition.loadSnapshot(t.snapshot)}}canUndo(){return this.undoEntries.length>0}canRedo(){return this.redoEntries.length>0}createEntry(){let{description:t,context:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{description:t?.toString(),context:JSON.stringify(e),snapshot:this.composition.getSnapshot()}}},Ns=(i,t,e)=>i?.description===t?.toString()&&i?.context===JSON.stringify(e),Wn="attachmentGallery",Ye=class{constructor(t){this.document=t.document,this.selectedRange=t.selectedRange}perform(){return this.removeBlockAttribute(),this.applyBlockAttribute()}getSnapshot(){return{document:this.document,selectedRange:this.selectedRange}}removeBlockAttribute(){return this.findRangesOfBlocks().map(t=>this.document=this.document.removeAttributeAtRange(Wn,t))}applyBlockAttribute(){let t=0;this.findRangesOfPieces().forEach(e=>{e[1]-e[0]>1&&(e[0]+=t,e[1]+=t,this.document.getCharacterAtPosition(e[1])!==` +`&&(this.document=this.document.insertBlockBreakAtRange(e[1]),e[1]0&&arguments[0]!==void 0?arguments[0]:"",e=Ft.parse(t,{referenceElement:this.element}).getDocument();return this.loadDocument(e)}loadJSON(t){let{document:e,selectedRange:n}=t;return e=V.fromJSON(e),this.loadSnapshot({document:e,selectedRange:n})}loadSnapshot(t){return this.undoManager=new Ae(this.composition),this.composition.loadSnapshot(t)}getDocument(){return this.composition.document}getSelectedDocument(){return this.composition.getSelectedDocument()}getSnapshot(){return this.composition.getSnapshot()}toJSON(){return this.getSnapshot()}deleteInDirection(t){return this.composition.deleteInDirection(t)}insertAttachment(t){return this.composition.insertAttachment(t)}insertAttachments(t){return this.composition.insertAttachments(t)}insertDocument(t){return this.composition.insertDocument(t)}insertFile(t){return this.composition.insertFile(t)}insertFiles(t){return this.composition.insertFiles(t)}insertHTML(t){return this.composition.insertHTML(t)}insertString(t){return this.composition.insertString(t)}insertText(t){return this.composition.insertText(t)}insertLineBreak(){return this.composition.insertLineBreak()}getSelectedRange(){return this.composition.getSelectedRange()}getPosition(){return this.composition.getPosition()}getClientRectAtPosition(t){let e=this.getDocument().locationRangeFromRange([t,t+1]);return this.selectionManager.getClientRectAtLocationRange(e)}expandSelectionInDirection(t){return this.composition.expandSelectionInDirection(t)}moveCursorInDirection(t){return this.composition.moveCursorInDirection(t)}setSelectedRange(t){return this.composition.setSelectedRange(t)}activateAttribute(t){let e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this.composition.setCurrentAttribute(t,e)}attributeIsActive(t){return this.composition.hasCurrentAttribute(t)}canActivateAttribute(t){return this.composition.canSetCurrentAttribute(t)}deactivateAttribute(t){return this.composition.removeCurrentAttribute(t)}setHTMLAtributeAtPosition(t,e,n){this.composition.setHTMLAtributeAtPosition(t,e,n)}canDecreaseNestingLevel(){return this.composition.canDecreaseNestingLevel()}canIncreaseNestingLevel(){return this.composition.canIncreaseNestingLevel()}decreaseNestingLevel(){if(this.canDecreaseNestingLevel())return this.composition.decreaseNestingLevel()}increaseNestingLevel(){if(this.canIncreaseNestingLevel())return this.composition.increaseNestingLevel()}canRedo(){return this.undoManager.canRedo()}canUndo(){return this.undoManager.canUndo()}recordUndoEntry(t){let{context:e,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.undoManager.recordUndoEntry(t,{context:e,consolidatable:n})}redo(){if(this.canRedo())return this.undoManager.redo()}undo(){if(this.canUndo())return this.undoManager.undo()}},Ze=class{constructor(t){this.element=t}findLocationFromContainerAndOffset(t,e){let{strict:n}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{strict:!0},r=0,o=!1,s={index:0,offset:0},l=this.findAttachmentElementParentForNode(t);l&&(t=l.parentNode,e=kn(l));let c=je(this.element,{usingFilter:Yr});for(;c.nextNode();){let u=c.currentNode;if(u===t&&ge(t)){zt(u)||(s.offset+=e);break}if(u.parentNode===t){if(r++===e)break}else if(!kt(t,u)&&r>0)break;Yi(u,{strict:n})?(o&&s.index++,s.offset=0,o=!0):s.offset+=Un(u)}return s}findContainerAndOffsetFromLocation(t){let e,n;if(t.index===0&&t.offset===0){for(e=this.element,n=0;e.firstChild;)if(e=e.firstChild,Rn(e)){n=1;break}return[e,n]}let[r,o]=this.findNodeAndOffsetFromLocation(t);if(r){if(ge(r))Un(r)===0?(e=r.parentNode.parentNode,n=kn(r.parentNode),zt(r,{name:"right"})&&n++):(e=r,n=t.offset-o);else{if(e=r.parentNode,!Yi(r.previousSibling)&&!Rn(e))for(;r===e.lastChild&&(r=e,e=e.parentNode,!Rn(e)););n=kn(r),t.offset!==0&&n++}return[e,n]}}findNodeAndOffsetFromLocation(t){let e,n,r=0;for(let o of this.getSignificantNodesForIndex(t.index)){let s=Un(o);if(t.offset<=r+s)if(ge(o)){if(e=o,n=r,t.offset===n&&zt(e))break}else e||(e=o,n=r);if(r+=s,r>t.offset)break}return[e,n]}findAttachmentElementParentForNode(t){for(;t&&t!==this.element;){if(Tt(t))return t;t=t.parentNode}}getSignificantNodesForIndex(t){let e=[],n=je(this.element,{usingFilter:Os}),r=!1;for(;n.nextNode();){let s=n.currentNode;var o;if(Vt(s)){if(o!=null?o++:o=0,o===t)r=!0;else if(r)break}else r&&e.push(s)}return e}},Un=function(i){return i.nodeType===Node.TEXT_NODE?zt(i)?0:i.textContent.length:j(i)==="br"||Tt(i)?1:0},Os=function(i){return Fs(i)===NodeFilter.FILTER_ACCEPT?Yr(i):NodeFilter.FILTER_REJECT},Fs=function(i){return Or(i)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},Yr=function(i){return Tt(i.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},Qe=class{createDOMRangeFromPoint(t){let e,{x:n,y:r}=t;if(document.caretPositionFromPoint){let{offsetNode:o,offset:s}=document.caretPositionFromPoint(n,r);return e=document.createRange(),e.setStart(o,s),e}if(document.caretRangeFromPoint)return document.caretRangeFromPoint(n,r);if(document.body.createTextRange){let o=me();try{let s=document.body.createTextRange();s.moveToPoint(n,r),s.select()}catch{}return e=me(),Wr(o),e}}getClientRectsForDOMRange(t){let e=Array.from(t.getClientRects());return[e[0],e[e.length-1]]}},ct=class extends R{constructor(t){super(...arguments),this.didMouseDown=this.didMouseDown.bind(this),this.selectionDidChange=this.selectionDidChange.bind(this),this.element=t,this.locationMapper=new Ze(this.element),this.pointMapper=new Qe,this.lockCount=0,S("mousedown",{onElement:this.element,withCallback:this.didMouseDown})}getLocationRange(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return t.strict===!1?this.createLocationRangeFromDOMRange(me()):t.ignoreLock?this.currentLocationRange:this.lockedLocationRange?this.lockedLocationRange:this.currentLocationRange}setLocationRange(t){if(this.lockedLocationRange)return;t=y(t);let e=this.createDOMRangeFromLocationRange(t);e&&(Wr(e),this.updateCurrentLocationRange(t))}setLocationRangeFromPointRange(t){t=y(t);let e=this.getLocationAtPoint(t[0]),n=this.getLocationAtPoint(t[1]);this.setLocationRange([e,n])}getClientRectAtLocationRange(t){let e=this.createDOMRangeFromLocationRange(t);if(e)return this.getClientRectsForDOMRange(e)[1]}locationIsCursorTarget(t){let e=Array.from(this.findNodeAndOffsetFromLocation(t))[0];return zt(e)}lock(){this.lockCount++==0&&(this.updateCurrentLocationRange(),this.lockedLocationRange=this.getLocationRange())}unlock(){if(--this.lockCount==0){let{lockedLocationRange:t}=this;if(this.lockedLocationRange=null,t!=null)return this.setLocationRange(t)}}clearSelection(){var t;return(t=jr())===null||t===void 0?void 0:t.removeAllRanges()}selectionIsCollapsed(){var t;return((t=me())===null||t===void 0?void 0:t.collapsed)===!0}selectionIsExpanded(){return!this.selectionIsCollapsed()}createLocationRangeFromDOMRange(t,e){if(t==null||!this.domRangeWithinElement(t))return;let n=this.findLocationFromContainerAndOffset(t.startContainer,t.startOffset,e);if(!n)return;let r=t.collapsed?void 0:this.findLocationFromContainerAndOffset(t.endContainer,t.endOffset,e);return y([n,r])}didMouseDown(){return this.pauseTemporarily()}pauseTemporarily(){let t;this.paused=!0;let e=()=>{if(this.paused=!1,clearTimeout(n),Array.from(t).forEach(r=>{r.destroy()}),kt(document,this.element))return this.selectionDidChange()},n=setTimeout(e,200);t=["mousemove","keydown"].map(r=>S(r,{onElement:document,withCallback:e}))}selectionDidChange(){if(!this.paused&&!fi(this.element))return this.updateCurrentLocationRange()}updateCurrentLocationRange(t){var e,n;if((t??(t=this.createLocationRangeFromDOMRange(me())))&&!We(t,this.currentLocationRange))return this.currentLocationRange=t,(e=this.delegate)===null||e===void 0||(n=e.locationRangeDidChange)===null||n===void 0?void 0:n.call(e,this.currentLocationRange.slice(0))}createDOMRangeFromLocationRange(t){let e=this.findContainerAndOffsetFromLocation(t[0]),n=ut(t)?e:this.findContainerAndOffsetFromLocation(t[1])||e;if(e!=null&&n!=null){let r=document.createRange();return r.setStart(...Array.from(e||[])),r.setEnd(...Array.from(n||[])),r}}getLocationAtPoint(t){let e=this.createDOMRangeFromPoint(t);var n;if(e)return(n=this.createLocationRangeFromDOMRange(e))===null||n===void 0?void 0:n[0]}domRangeWithinElement(t){return t.collapsed?kt(this.element,t.startContainer):kt(this.element,t.startContainer)&&kt(this.element,t.endContainer)}};ct.proxyMethod("locationMapper.findLocationFromContainerAndOffset"),ct.proxyMethod("locationMapper.findContainerAndOffsetFromLocation"),ct.proxyMethod("locationMapper.findNodeAndOffsetFromLocation"),ct.proxyMethod("pointMapper.createDOMRangeFromPoint"),ct.proxyMethod("pointMapper.getClientRectsForDOMRange");var Xr=Object.freeze({__proto__:null,Attachment:Kt,AttachmentManager:Ge,AttachmentPiece:Gt,Block:bt,Composition:it,Document:V,Editor:Xe,HTMLParser:Ft,HTMLSanitizer:qt,LineBreakInsertion:$e,LocationMapper:Ze,ManagedAttachment:E,Piece:gt,PointMapper:Qe,SelectionManager:ct,SplittableList:$t,StringPiece:ve,Text:J,UndoManager:Ae}),Ps=Object.freeze({__proto__:null,ObjectView:dt,AttachmentView:be,BlockView:Je,DocumentView:Jt,PieceView:He,PreviewableAttachmentView:ze,TextView:qe}),{lang:Vn,css:Et,keyNames:Ms}=Ce,zn=function(i){return function(){let t=i.apply(this,arguments);t.do(),this.undos||(this.undos=[]),this.undos.push(t.undo)}},tn=class extends R{constructor(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(...arguments),z(this,"makeElementMutable",zn(()=>({do:()=>{this.element.dataset.trixMutable=!0},undo:()=>delete this.element.dataset.trixMutable}))),z(this,"addToolbar",zn(()=>{let o=p({tagName:"div",className:Et.attachmentToolbar,data:{trixMutable:!0},childNodes:p({tagName:"div",className:"trix-button-row",childNodes:p({tagName:"span",className:"trix-button-group trix-button-group--actions",childNodes:p({tagName:"button",className:"trix-button trix-button--remove",textContent:Vn.remove,attributes:{title:Vn.remove},data:{trixAction:"remove"}})})})});return this.attachment.isPreviewable()&&o.appendChild(p({tagName:"div",className:Et.attachmentMetadataContainer,childNodes:p({tagName:"span",className:Et.attachmentMetadata,childNodes:[p({tagName:"span",className:Et.attachmentName,textContent:this.attachment.getFilename(),attributes:{title:this.attachment.getFilename()}}),p({tagName:"span",className:Et.attachmentSize,textContent:this.attachment.getFormattedFilesize()})]})})),S("click",{onElement:o,withCallback:this.didClickToolbar}),S("click",{onElement:o,matchingSelector:"[data-trix-action]",withCallback:this.didClickActionButton}),he("trix-attachment-before-toolbar",{onElement:this.element,attributes:{toolbar:o,attachment:this.attachment}}),{do:()=>this.element.appendChild(o),undo:()=>At(o)}})),z(this,"installCaptionEditor",zn(()=>{let o=p({tagName:"textarea",className:Et.attachmentCaptionEditor,attributes:{placeholder:Vn.captionPlaceholder},data:{trixMutable:!0}});o.value=this.attachmentPiece.getCaption();let s=o.cloneNode();s.classList.add("trix-autoresize-clone"),s.tabIndex=-1;let l=function(){s.value=o.value,o.style.height=s.scrollHeight+"px"};S("input",{onElement:o,withCallback:l}),S("input",{onElement:o,withCallback:this.didInputCaption}),S("keydown",{onElement:o,withCallback:this.didKeyDownCaption}),S("change",{onElement:o,withCallback:this.didChangeCaption}),S("blur",{onElement:o,withCallback:this.didBlurCaption});let c=this.element.querySelector("figcaption"),u=c.cloneNode();return{do:()=>{if(c.style.display="none",u.appendChild(o),u.appendChild(s),u.classList.add("".concat(Et.attachmentCaption,"--editing")),c.parentElement.insertBefore(u,c),l(),this.options.editCaption)return Ai(()=>o.focus())},undo(){At(u),c.style.display=null}}})),this.didClickToolbar=this.didClickToolbar.bind(this),this.didClickActionButton=this.didClickActionButton.bind(this),this.didKeyDownCaption=this.didKeyDownCaption.bind(this),this.didInputCaption=this.didInputCaption.bind(this),this.didChangeCaption=this.didChangeCaption.bind(this),this.didBlurCaption=this.didBlurCaption.bind(this),this.attachmentPiece=t,this.element=e,this.container=n,this.options=r,this.attachment=this.attachmentPiece.attachment,j(this.element)==="a"&&(this.element=this.element.firstChild),this.install()}install(){this.makeElementMutable(),this.addToolbar(),this.attachment.isPreviewable()&&this.installCaptionEditor()}uninstall(){var t;let e=this.undos.pop();for(this.savePendingCaption();e;)e(),e=this.undos.pop();(t=this.delegate)===null||t===void 0||t.didUninstallAttachmentEditor(this)}savePendingCaption(){if(this.pendingCaption!=null){let o=this.pendingCaption;var t,e,n,r;this.pendingCaption=null,o?(t=this.delegate)===null||t===void 0||(e=t.attachmentEditorDidRequestUpdatingAttributesForAttachment)===null||e===void 0||e.call(t,{caption:o},this.attachment):(n=this.delegate)===null||n===void 0||(r=n.attachmentEditorDidRequestRemovingAttributeForAttachment)===null||r===void 0||r.call(n,"caption",this.attachment)}}didClickToolbar(t){return t.preventDefault(),t.stopPropagation()}didClickActionButton(t){var e;if(t.target.getAttribute("data-trix-action")==="remove")return(e=this.delegate)===null||e===void 0?void 0:e.attachmentEditorDidRequestRemovalOfAttachment(this.attachment)}didKeyDownCaption(t){var e,n;if(Ms[t.keyCode]==="return")return t.preventDefault(),this.savePendingCaption(),(e=this.delegate)===null||e===void 0||(n=e.attachmentEditorDidRequestDeselectingAttachment)===null||n===void 0?void 0:n.call(e,this.attachment)}didInputCaption(t){this.pendingCaption=t.target.value.replace(/\s/g," ").trim()}didChangeCaption(t){return this.savePendingCaption()}didBlurCaption(t){return this.savePendingCaption()}},en=class extends R{constructor(t,e){super(...arguments),this.didFocus=this.didFocus.bind(this),this.didBlur=this.didBlur.bind(this),this.didClickAttachment=this.didClickAttachment.bind(this),this.element=t,this.composition=e,this.documentView=new Jt(this.composition.document,{element:this.element}),S("focus",{onElement:this.element,withCallback:this.didFocus}),S("blur",{onElement:this.element,withCallback:this.didBlur}),S("click",{onElement:this.element,matchingSelector:"a[contenteditable=false]",preventDefault:!0}),S("mousedown",{onElement:this.element,matchingSelector:Rt,withCallback:this.didClickAttachment}),S("click",{onElement:this.element,matchingSelector:"a".concat(Rt),preventDefault:!0})}didFocus(t){var e;let n=()=>{var r,o;if(!this.focused)return this.focused=!0,(r=this.delegate)===null||r===void 0||(o=r.compositionControllerDidFocus)===null||o===void 0?void 0:o.call(r)};return((e=this.blurPromise)===null||e===void 0?void 0:e.then(n))||n()}didBlur(t){this.blurPromise=new Promise(e=>Ai(()=>{var n,r;return fi(this.element)||(this.focused=null,(n=this.delegate)===null||n===void 0||(r=n.compositionControllerDidBlur)===null||r===void 0||r.call(n)),this.blurPromise=null,e()}))}didClickAttachment(t,e){var n,r;let o=this.findAttachmentForElement(e),s=!!vt(t.target,{matchingSelector:"figcaption"});return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerDidSelectAttachment)===null||r===void 0?void 0:r.call(n,o,{editCaption:s})}getSerializableElement(){return this.isEditingAttachment()?this.documentView.shadowElement:this.element}render(){var t,e,n,r,o,s;return this.revision!==this.composition.revision&&(this.documentView.setDocument(this.composition.document),this.documentView.render(),this.revision=this.composition.revision),this.canSyncDocumentView()&&!this.documentView.isSynced()&&((n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillSyncDocumentView)===null||r===void 0||r.call(n),this.documentView.sync(),(o=this.delegate)===null||o===void 0||(s=o.compositionControllerDidSyncDocumentView)===null||s===void 0||s.call(o)),(t=this.delegate)===null||t===void 0||(e=t.compositionControllerDidRender)===null||e===void 0?void 0:e.call(t)}rerenderViewForObject(t){return this.invalidateViewForObject(t),this.render()}invalidateViewForObject(t){return this.documentView.invalidateViewForObject(t)}isViewCachingEnabled(){return this.documentView.isViewCachingEnabled()}enableViewCaching(){return this.documentView.enableViewCaching()}disableViewCaching(){return this.documentView.disableViewCaching()}refreshViewCache(){return this.documentView.garbageCollectCachedViews()}isEditingAttachment(){return!!this.attachmentEditor}installAttachmentEditorForAttachment(t,e){var n;if(((n=this.attachmentEditor)===null||n===void 0?void 0:n.attachment)===t)return;let r=this.documentView.findElementForObject(t);if(!r)return;this.uninstallAttachmentEditor();let o=this.composition.document.getAttachmentPieceForAttachment(t);this.attachmentEditor=new tn(o,r,this.element,e),this.attachmentEditor.delegate=this}uninstallAttachmentEditor(){var t;return(t=this.attachmentEditor)===null||t===void 0?void 0:t.uninstall()}didUninstallAttachmentEditor(){return this.attachmentEditor=null,this.render()}attachmentEditorDidRequestUpdatingAttributesForAttachment(t,e){var n,r;return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillUpdateAttachment)===null||r===void 0||r.call(n,e),this.composition.updateAttributesForAttachment(t,e)}attachmentEditorDidRequestRemovingAttributeForAttachment(t,e){var n,r;return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillUpdateAttachment)===null||r===void 0||r.call(n,e),this.composition.removeAttributeForAttachment(t,e)}attachmentEditorDidRequestRemovalOfAttachment(t){var e,n;return(e=this.delegate)===null||e===void 0||(n=e.compositionControllerDidRequestRemovalOfAttachment)===null||n===void 0?void 0:n.call(e,t)}attachmentEditorDidRequestDeselectingAttachment(t){var e,n;return(e=this.delegate)===null||e===void 0||(n=e.compositionControllerDidRequestDeselectingAttachment)===null||n===void 0?void 0:n.call(e,t)}canSyncDocumentView(){return!this.isEditingAttachment()}findAttachmentForElement(t){return this.composition.document.getAttachmentById(parseInt(t.dataset.trixId,10))}},nn=class extends R{},Zr="data-trix-mutable",Bs="[".concat(Zr,"]"),_s={attributes:!0,childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},rn=class extends R{constructor(t){super(t),this.didMutate=this.didMutate.bind(this),this.element=t,this.observer=new window.MutationObserver(this.didMutate),this.start()}start(){return this.reset(),this.observer.observe(this.element,_s)}stop(){return this.observer.disconnect()}didMutate(t){var e,n;if(this.mutations.push(...Array.from(this.findSignificantMutations(t)||[])),this.mutations.length)return(e=this.delegate)===null||e===void 0||(n=e.elementDidMutate)===null||n===void 0||n.call(e,this.getMutationSummary()),this.reset()}reset(){this.mutations=[]}findSignificantMutations(t){return t.filter(e=>this.mutationIsSignificant(e))}mutationIsSignificant(t){if(this.nodeIsMutable(t.target))return!1;for(let e of Array.from(this.nodesModifiedByMutation(t)))if(this.nodeIsSignificant(e))return!0;return!1}nodeIsSignificant(t){return t!==this.element&&!this.nodeIsMutable(t)&&!Or(t)}nodeIsMutable(t){return vt(t,{matchingSelector:Bs})}nodesModifiedByMutation(t){let e=[];switch(t.type){case"attributes":t.attributeName!==Zr&&e.push(t.target);break;case"characterData":e.push(t.target.parentNode),e.push(t.target);break;case"childList":e.push(...Array.from(t.addedNodes||[])),e.push(...Array.from(t.removedNodes||[]))}return e}getMutationSummary(){return this.getTextMutationSummary()}getTextMutationSummary(){let{additions:t,deletions:e}=this.getTextChangesFromCharacterData(),n=this.getTextChangesFromChildList();Array.from(n.additions).forEach(l=>{Array.from(t).includes(l)||t.push(l)}),e.push(...Array.from(n.deletions||[]));let r={},o=t.join("");o&&(r.textAdded=o);let s=e.join("");return s&&(r.textDeleted=s),r}getMutationsByType(t){return Array.from(this.mutations).filter(e=>e.type===t)}getTextChangesFromChildList(){let t,e,n=[],r=[];Array.from(this.getMutationsByType("childList")).forEach(l=>{n.push(...Array.from(l.addedNodes||[])),r.push(...Array.from(l.removedNodes||[]))}),n.length===0&&r.length===1&&Vt(r[0])?(t=[],e=[` +`]):(t=li(n),e=li(r));let o=t.filter((l,c)=>l!==e[c]).map(ue),s=e.filter((l,c)=>l!==t[c]).map(ue);return{additions:o,deletions:s}}getTextChangesFromCharacterData(){let t,e,n=this.getMutationsByType("characterData");if(n.length){let r=n[0],o=n[n.length-1],s=function(l,c){let u,d;return l=Nt.box(l),(c=Nt.box(c)).length0&&arguments[0]!==void 0?arguments[0]:[],t=[];for(let e of Array.from(i))switch(e.nodeType){case Node.TEXT_NODE:t.push(e.data);break;case Node.ELEMENT_NODE:j(e)==="br"?t.push(` +`):t.push(...Array.from(li(e.childNodes)||[]))}return t},on=class extends Ht{constructor(t){super(...arguments),this.file=t}perform(t){let e=new FileReader;return e.onerror=()=>t(!1),e.onload=()=>{e.onerror=null;try{e.abort()}catch{}return t(!0,this.file)},e.readAsArrayBuffer(this.file)}},ci=class{constructor(t){this.element=t}shouldIgnore(t){return!!xe.samsungAndroid&&(this.previousEvent=this.event,this.event=t,this.checkSamsungKeyboardBuggyModeStart(),this.checkSamsungKeyboardBuggyModeEnd(),this.buggyMode)}checkSamsungKeyboardBuggyModeStart(){this.insertingLongTextAfterUnidentifiedChar()&&js(this.element.innerText,this.event.data)&&(this.buggyMode=!0,this.event.preventDefault())}checkSamsungKeyboardBuggyModeEnd(){this.buggyMode&&this.event.inputType!=="insertText"&&(this.buggyMode=!1)}insertingLongTextAfterUnidentifiedChar(){var t;return this.isBeforeInputInsertText()&&this.previousEventWasUnidentifiedKeydown()&&((t=this.event.data)===null||t===void 0?void 0:t.length)>50}isBeforeInputInsertText(){return this.event.type==="beforeinput"&&this.event.inputType==="insertText"}previousEventWasUnidentifiedKeydown(){var t,e;return((t=this.previousEvent)===null||t===void 0?void 0:t.type)==="keydown"&&((e=this.previousEvent)===null||e===void 0?void 0:e.key)==="Unidentified"}},js=(i,t)=>Sr(i)===Sr(t),Ws=new RegExp("(".concat("\uFFFC","|").concat(ln,"|").concat(ft,"|\\s)+"),"g"),Sr=i=>i.replace(Ws," ").trim(),Yt=class extends R{constructor(t){super(...arguments),this.element=t,this.mutationObserver=new rn(this.element),this.mutationObserver.delegate=this,this.flakyKeyboardDetector=new ci(this.element);for(let e in this.constructor.events)S(e,{onElement:this.element,withCallback:this.handlerFor(e)})}elementDidMutate(t){}editorWillSyncDocumentView(){return this.mutationObserver.stop()}editorDidSyncDocumentView(){return this.mutationObserver.start()}requestRender(){var t,e;return(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidRequestRender)===null||e===void 0?void 0:e.call(t)}requestReparse(){var t,e;return(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidRequestReparse)===null||e===void 0||e.call(t),this.requestRender()}attachFiles(t){let e=Array.from(t).map(n=>new on(n));return Promise.all(e).then(n=>{this.handleInput(function(){var r,o;return(r=this.delegate)===null||r===void 0||r.inputControllerWillAttachFiles(),(o=this.responder)===null||o===void 0||o.insertFiles(n),this.requestRender()})})}handlerFor(t){return e=>{e.defaultPrevented||this.handleInput(()=>{if(!fi(this.element)){if(this.flakyKeyboardDetector.shouldIgnore(e))return;this.eventName=t,this.constructor.events[t].call(this,e)}})}}handleInput(t){try{var e;(e=this.delegate)===null||e===void 0||e.inputControllerWillHandleInput(),t.call(this)}finally{var n;(n=this.delegate)===null||n===void 0||n.inputControllerDidHandleInput()}}createLinkHTML(t,e){let n=document.createElement("a");return n.href=t,n.textContent=e||t,n.outerHTML}},Hn;z(Yt,"events",{});var{browser:Us,keyNames:Qr}=Ce,Vs=0,Y=class extends Yt{constructor(){super(...arguments),this.resetInputSummary()}setInputSummary(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.inputSummary.eventName=this.eventName;for(let e in t){let n=t[e];this.inputSummary[e]=n}return this.inputSummary}resetInputSummary(){this.inputSummary={}}reset(){return this.resetInputSummary(),Ot.reset()}elementDidMutate(t){var e,n;return this.isComposing()?(e=this.delegate)===null||e===void 0||(n=e.inputControllerDidAllowUnhandledInput)===null||n===void 0?void 0:n.call(e):this.handleInput(function(){return this.mutationIsSignificant(t)&&(this.mutationIsExpected(t)?this.requestRender():this.requestReparse()),this.reset()})}mutationIsExpected(t){let{textAdded:e,textDeleted:n}=t;if(this.inputSummary.preferDocument)return!0;let r=e!=null?e===this.inputSummary.textAdded:!this.inputSummary.textAdded,o=n!=null?this.inputSummary.didDelete:!this.inputSummary.didDelete,s=[` +`,` +`].includes(e)&&!r,l=n===` +`&&!o;if(s&&!l||l&&!s){let u=this.getSelectedRange();if(u){var c;let d=s?e.replace(/\n$/,"").length||-1:e?.length||1;if((c=this.responder)!==null&&c!==void 0&&c.positionIsBlockBreak(u[1]+d))return!0}}return r&&o}mutationIsSignificant(t){var e;let n=Object.keys(t).length>0,r=((e=this.compositionInput)===null||e===void 0?void 0:e.getEndData())==="";return n||!r}getCompositionInput(){if(this.isComposing())return this.compositionInput;this.compositionInput=new nt(this)}isComposing(){return this.compositionInput&&!this.compositionInput.isEnded()}deleteInDirection(t,e){var n;return((n=this.responder)===null||n===void 0?void 0:n.deleteInDirection(t))!==!1?this.setInputSummary({didDelete:!0}):e?(e.preventDefault(),this.requestRender()):void 0}serializeSelectionToDataTransfer(t){var e;if(!function(r){if(r==null||!r.setData)return!1;for(let o in Qi){let s=Qi[o];try{if(r.setData(o,s),!r.getData(o)===s)return!1}catch{return!1}}return!0}(t))return;let n=(e=this.responder)===null||e===void 0?void 0:e.getSelectedDocument().toSerializableDocument();return t.setData("application/x-trix-document",JSON.stringify(n)),t.setData("text/html",Jt.render(n).innerHTML),t.setData("text/plain",n.toString().replace(/\n$/,"")),!0}canAcceptDataTransfer(t){let e={};return Array.from(t?.types||[]).forEach(n=>{e[n]=!0}),e.Files||e["application/x-trix-document"]||e["text/html"]||e["text/plain"]}getPastedHTMLUsingHiddenElement(t){let e=this.getSelectedRange(),n={position:"absolute",left:"".concat(window.pageXOffset,"px"),top:"".concat(window.pageYOffset,"px"),opacity:0},r=p({style:n,tagName:"div",editable:!0});return document.body.appendChild(r),r.focus(),requestAnimationFrame(()=>{let o=r.innerHTML;return At(r),this.setSelectedRange(e),t(o)})}};z(Y,"events",{keydown(i){this.isComposing()||this.resetInputSummary(),this.inputSummary.didInput=!0;let t=Qr[i.keyCode];if(t){var e;let r=this.keys;["ctrl","alt","shift","meta"].forEach(o=>{var s;i["".concat(o,"Key")]&&(o==="ctrl"&&(o="control"),r=(s=r)===null||s===void 0?void 0:s[o])}),((e=r)===null||e===void 0?void 0:e[t])!=null&&(this.setInputSummary({keyName:t}),Ot.reset(),r[t].call(this,i))}if(Br(i)){let r=String.fromCharCode(i.keyCode).toLowerCase();if(r){var n;let o=["alt","shift"].map(s=>{if(i["".concat(s,"Key")])return s}).filter(s=>s);o.push(r),(n=this.delegate)!==null&&n!==void 0&&n.inputControllerDidReceiveKeyboardCommand(o)&&i.preventDefault()}}},keypress(i){if(this.inputSummary.eventName!=null||i.metaKey||i.ctrlKey&&!i.altKey)return;let t=qs(i);var e,n;return t?((e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.insertString(t),this.setInputSummary({textAdded:t,didDelete:this.selectionIsExpanded()})):void 0},textInput(i){let{data:t}=i,{textAdded:e}=this.inputSummary;if(e&&e!==t&&e.toUpperCase()===t){var n;let r=this.getSelectedRange();return this.setSelectedRange([r[0],r[1]+e.length]),(n=this.responder)===null||n===void 0||n.insertString(t),this.setInputSummary({textAdded:t}),this.setSelectedRange(r)}},dragenter(i){i.preventDefault()},dragstart(i){var t,e;return this.serializeSelectionToDataTransfer(i.dataTransfer),this.draggedRange=this.getSelectedRange(),(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidStartDrag)===null||e===void 0?void 0:e.call(t)},dragover(i){if(this.draggedRange||this.canAcceptDataTransfer(i.dataTransfer)){i.preventDefault();let n={x:i.clientX,y:i.clientY};var t,e;if(!Xt(n,this.draggingPoint))return this.draggingPoint=n,(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidReceiveDragOverPoint)===null||e===void 0?void 0:e.call(t,this.draggingPoint)}},dragend(i){var t,e;(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidCancelDrag)===null||e===void 0||e.call(t),this.draggedRange=null,this.draggingPoint=null},drop(i){var t,e;i.preventDefault();let n=(t=i.dataTransfer)===null||t===void 0?void 0:t.files,r=i.dataTransfer.getData("application/x-trix-document"),o={x:i.clientX,y:i.clientY};if((e=this.responder)===null||e===void 0||e.setLocationRangeFromPointRange(o),n!=null&&n.length)this.attachFiles(n);else if(this.draggedRange){var s,l;(s=this.delegate)===null||s===void 0||s.inputControllerWillMoveText(),(l=this.responder)===null||l===void 0||l.moveTextFromRange(this.draggedRange),this.draggedRange=null,this.requestRender()}else if(r){var c;let u=V.fromJSONString(r);(c=this.responder)===null||c===void 0||c.insertDocument(u),this.requestRender()}this.draggedRange=null,this.draggingPoint=null},cut(i){var t,e;if((t=this.responder)!==null&&t!==void 0&&t.selectionIsExpanded()&&(this.serializeSelectionToDataTransfer(i.clipboardData)&&i.preventDefault(),(e=this.delegate)===null||e===void 0||e.inputControllerWillCutText(),this.deleteInDirection("backward"),i.defaultPrevented))return this.requestRender()},copy(i){var t;(t=this.responder)!==null&&t!==void 0&&t.selectionIsExpanded()&&this.serializeSelectionToDataTransfer(i.clipboardData)&&i.preventDefault()},paste(i){let t=i.clipboardData||i.testClipboardData,e={clipboard:t};if(!t||Js(i))return void this.getPastedHTMLUsingHiddenElement(F=>{var k,rt,xt;return e.type="text/html",e.html=F,(k=this.delegate)===null||k===void 0||k.inputControllerWillPaste(e),(rt=this.responder)===null||rt===void 0||rt.insertHTML(e.html),this.requestRender(),(xt=this.delegate)===null||xt===void 0?void 0:xt.inputControllerDidPaste(e)});let n=t.getData("URL"),r=t.getData("text/html"),o=t.getData("public.url-name");if(n){var s,l,c;let F;e.type="text/html",F=o?xi(o).trim():n,e.html=this.createLinkHTML(n,F),(s=this.delegate)===null||s===void 0||s.inputControllerWillPaste(e),this.setInputSummary({textAdded:F,didDelete:this.selectionIsExpanded()}),(l=this.responder)===null||l===void 0||l.insertHTML(e.html),this.requestRender(),(c=this.delegate)===null||c===void 0||c.inputControllerDidPaste(e)}else if(Mr(t)){var u,d,C;e.type="text/plain",e.string=t.getData("text/plain"),(u=this.delegate)===null||u===void 0||u.inputControllerWillPaste(e),this.setInputSummary({textAdded:e.string,didDelete:this.selectionIsExpanded()}),(d=this.responder)===null||d===void 0||d.insertString(e.string),this.requestRender(),(C=this.delegate)===null||C===void 0||C.inputControllerDidPaste(e)}else if(r){var T,H,Q;e.type="text/html",e.html=r,(T=this.delegate)===null||T===void 0||T.inputControllerWillPaste(e),(H=this.responder)===null||H===void 0||H.insertHTML(e.html),this.requestRender(),(Q=this.delegate)===null||Q===void 0||Q.inputControllerDidPaste(e)}else if(Array.from(t.types).includes("Files")){var M,mt;let F=(M=t.items)===null||M===void 0||(M=M[0])===null||M===void 0||(mt=M.getAsFile)===null||mt===void 0?void 0:mt.call(M);if(F){var yt,Zt,Qt;let k=zs(F);!F.name&&k&&(F.name="pasted-file-".concat(++Vs,".").concat(k)),e.type="File",e.file=F,(yt=this.delegate)===null||yt===void 0||yt.inputControllerWillAttachFiles(),(Zt=this.responder)===null||Zt===void 0||Zt.insertFile(e.file),this.requestRender(),(Qt=this.delegate)===null||Qt===void 0||Qt.inputControllerDidPaste(e)}}i.preventDefault()},compositionstart(i){return this.getCompositionInput().start(i.data)},compositionupdate(i){return this.getCompositionInput().update(i.data)},compositionend(i){return this.getCompositionInput().end(i.data)},beforeinput(i){this.inputSummary.didInput=!0},input(i){return this.inputSummary.didInput=!0,i.stopPropagation()}}),z(Y,"keys",{backspace(i){var t;return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),this.deleteInDirection("backward",i)},delete(i){var t;return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),this.deleteInDirection("forward",i)},return(i){var t,e;return this.setInputSummary({preferDocument:!0}),(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(e=this.responder)===null||e===void 0?void 0:e.insertLineBreak()},tab(i){var t,e;(t=this.responder)!==null&&t!==void 0&&t.canIncreaseNestingLevel()&&((e=this.responder)===null||e===void 0||e.increaseNestingLevel(),this.requestRender(),i.preventDefault())},left(i){var t;if(this.selectionIsInCursorTarget())return i.preventDefault(),(t=this.responder)===null||t===void 0?void 0:t.moveCursorInDirection("backward")},right(i){var t;if(this.selectionIsInCursorTarget())return i.preventDefault(),(t=this.responder)===null||t===void 0?void 0:t.moveCursorInDirection("forward")},control:{d(i){var t;return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),this.deleteInDirection("forward",i)},h(i){var t;return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),this.deleteInDirection("backward",i)},o(i){var t,e;return i.preventDefault(),(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(e=this.responder)===null||e===void 0||e.insertString(` +`,{updatePosition:!1}),this.requestRender()}},shift:{return(i){var t,e;(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(e=this.responder)===null||e===void 0||e.insertString(` +`),this.requestRender(),i.preventDefault()},tab(i){var t,e;(t=this.responder)!==null&&t!==void 0&&t.canDecreaseNestingLevel()&&((e=this.responder)===null||e===void 0||e.decreaseNestingLevel(),this.requestRender(),i.preventDefault())},left(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection("backward")},right(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection("forward")}},alt:{backspace(i){var t;return this.setInputSummary({preferDocument:!1}),(t=this.delegate)===null||t===void 0?void 0:t.inputControllerWillPerformTyping()}},meta:{backspace(i){var t;return this.setInputSummary({preferDocument:!1}),(t=this.delegate)===null||t===void 0?void 0:t.inputControllerWillPerformTyping()}}}),Y.proxyMethod("responder?.getSelectedRange"),Y.proxyMethod("responder?.setSelectedRange"),Y.proxyMethod("responder?.expandSelectionInDirection"),Y.proxyMethod("responder?.selectionIsInCursorTarget"),Y.proxyMethod("responder?.selectionIsExpanded");var zs=i=>{var t;return(t=i.type)===null||t===void 0||(t=t.match(/\/(\w+)$/))===null||t===void 0?void 0:t[1]},Hs=!((Hn=" ".codePointAt)===null||Hn===void 0||!Hn.call(" ",0)),qs=function(i){if(i.key&&Hs&&i.key.codePointAt(0)===i.keyCode)return i.key;{let t;if(i.which===null?t=i.keyCode:i.which!==0&&i.charCode!==0&&(t=i.charCode),t!=null&&Qr[t]!=="escape")return Nt.fromCodepoints([t]).toString()}},Js=function(i){let t=i.clipboardData;if(t){if(t.types.includes("text/html")){for(let e of t.types){let n=/^CorePasteboardFlavorType/.test(e),r=/^dyn\./.test(e)&&t.getData(e);if(n||r)return!0}return!1}{let e=t.types.includes("com.apple.webarchive"),n=t.types.includes("com.apple.flat-rtfd");return e||n}}},nt=class extends R{constructor(t){super(...arguments),this.inputController=t,this.responder=this.inputController.responder,this.delegate=this.inputController.delegate,this.inputSummary=this.inputController.inputSummary,this.data={}}start(t){if(this.data.start=t,this.isSignificant()){var e,n;this.inputSummary.eventName==="keypress"&&this.inputSummary.textAdded&&((n=this.responder)===null||n===void 0||n.deleteInDirection("left")),this.selectionIsExpanded()||(this.insertPlaceholder(),this.requestRender()),this.range=(e=this.responder)===null||e===void 0?void 0:e.getSelectedRange()}}update(t){if(this.data.update=t,this.isSignificant()){let e=this.selectPlaceholder();e&&(this.forgetPlaceholder(),this.range=e)}}end(t){return this.data.end=t,this.isSignificant()?(this.forgetPlaceholder(),this.canApplyToDocument()?(this.setInputSummary({preferDocument:!0,didInput:!1}),(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.setSelectedRange(this.range),(r=this.responder)===null||r===void 0||r.insertString(this.data.end),(o=this.responder)===null||o===void 0?void 0:o.setSelectedRange(this.range[0]+this.data.end.length)):this.data.start!=null||this.data.update!=null?(this.requestReparse(),this.inputController.reset()):void 0):this.inputController.reset();var e,n,r,o}getEndData(){return this.data.end}isEnded(){return this.getEndData()!=null}isSignificant(){return!Us.composesExistingText||this.inputSummary.didInput}canApplyToDocument(){var t,e;return((t=this.data.start)===null||t===void 0?void 0:t.length)===0&&((e=this.data.end)===null||e===void 0?void 0:e.length)>0&&this.range}};nt.proxyMethod("inputController.setInputSummary"),nt.proxyMethod("inputController.requestRender"),nt.proxyMethod("inputController.requestReparse"),nt.proxyMethod("responder?.selectionIsExpanded"),nt.proxyMethod("responder?.insertPlaceholder"),nt.proxyMethod("responder?.selectPlaceholder"),nt.proxyMethod("responder?.forgetPlaceholder");var wt=class extends Yt{constructor(){super(...arguments),this.render=this.render.bind(this)}elementDidMutate(){return this.scheduledRender?this.composing?(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidAllowUnhandledInput)===null||e===void 0?void 0:e.call(t):void 0:this.reparse();var t,e}scheduleRender(){return this.scheduledRender?this.scheduledRender:this.scheduledRender=requestAnimationFrame(this.render)}render(){var t,e;cancelAnimationFrame(this.scheduledRender),this.scheduledRender=null,this.composing||(e=this.delegate)===null||e===void 0||e.render(),(t=this.afterRender)===null||t===void 0||t.call(this),this.afterRender=null}reparse(){var t;return(t=this.delegate)===null||t===void 0?void 0:t.reparse()}insertString(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var r;return(r=this.responder)===null||r===void 0?void 0:r.insertString(e,n)})}toggleAttributeIfSupported(t){var e;if(Qn().includes(t))return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformFormatting(t),this.withTargetDOMRange(function(){var n;return(n=this.responder)===null||n===void 0?void 0:n.toggleCurrentAttribute(t)})}activateAttributeIfSupported(t,e){var n;if(Qn().includes(t))return(n=this.delegate)===null||n===void 0||n.inputControllerWillPerformFormatting(t),this.withTargetDOMRange(function(){var r;return(r=this.responder)===null||r===void 0?void 0:r.setCurrentAttribute(t,e)})}deleteInDirection(t){let{recordUndoEntry:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{recordUndoEntry:!0};var n;e&&((n=this.delegate)===null||n===void 0||n.inputControllerWillPerformTyping());let r=()=>{var s;return(s=this.responder)===null||s===void 0?void 0:s.deleteInDirection(t)},o=this.getTargetDOMRange({minLength:this.composing?1:2});return o?this.withTargetDOMRange(o,r):r()}withTargetDOMRange(t,e){var n;return typeof t=="function"&&(e=t,t=this.getTargetDOMRange()),t?(n=this.responder)===null||n===void 0?void 0:n.withTargetDOMRange(t,e.bind(this)):(Ot.reset(),e.call(this))}getTargetDOMRange(){var t,e;let{minLength:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{minLength:0},r=(t=(e=this.event).getTargetRanges)===null||t===void 0?void 0:t.call(e);if(r&&r.length){let o=Ks(r[0]);if(n===0||o.toString().length>=n)return o}}withEvent(t,e){let n;this.event=t;try{n=e.call(this)}finally{this.event=null}return n}};z(wt,"events",{keydown(i){if(Br(i)){var t;let e=Ys(i);(t=this.delegate)!==null&&t!==void 0&&t.inputControllerDidReceiveKeyboardCommand(e)&&i.preventDefault()}else{let e=i.key;i.altKey&&(e+="+Alt"),i.shiftKey&&(e+="+Shift");let n=this.constructor.keys[e];if(n)return this.withEvent(i,n)}},paste(i){var t;let e,n=(t=i.clipboardData)===null||t===void 0?void 0:t.getData("URL");return to(i)?(i.preventDefault(),this.attachFiles(i.clipboardData.files)):$s(i)?(i.preventDefault(),e={type:"text/plain",string:i.clipboardData.getData("text/plain")},(r=this.delegate)===null||r===void 0||r.inputControllerWillPaste(e),(o=this.responder)===null||o===void 0||o.insertString(e.string),this.render(),(s=this.delegate)===null||s===void 0?void 0:s.inputControllerDidPaste(e)):n?(i.preventDefault(),e={type:"text/html",html:this.createLinkHTML(n)},(l=this.delegate)===null||l===void 0||l.inputControllerWillPaste(e),(c=this.responder)===null||c===void 0||c.insertHTML(e.html),this.render(),(u=this.delegate)===null||u===void 0?void 0:u.inputControllerDidPaste(e)):void 0;var r,o,s,l,c,u},beforeinput(i){let t=this.constructor.inputTypes[i.inputType],e=(n=i,!(!/iPhone|iPad/.test(navigator.userAgent)||n.inputType&&n.inputType!=="insertParagraph"));var n;t&&(this.withEvent(i,t),e||this.scheduleRender()),e&&this.render()},input(i){Ot.reset()},dragstart(i){var t,e;(t=this.responder)!==null&&t!==void 0&&t.selectionContainsAttachments()&&(i.dataTransfer.setData("application/x-trix-dragging",!0),this.dragging={range:(e=this.responder)===null||e===void 0?void 0:e.getSelectedRange(),point:Jn(i)})},dragenter(i){qn(i)&&i.preventDefault()},dragover(i){if(this.dragging){i.preventDefault();let e=Jn(i);var t;if(!Xt(e,this.dragging.point))return this.dragging.point=e,(t=this.responder)===null||t===void 0?void 0:t.setLocationRangeFromPointRange(e)}else qn(i)&&i.preventDefault()},drop(i){var t,e;if(this.dragging)return i.preventDefault(),(t=this.delegate)===null||t===void 0||t.inputControllerWillMoveText(),(e=this.responder)===null||e===void 0||e.moveTextFromRange(this.dragging.range),this.dragging=null,this.scheduleRender();if(qn(i)){var n;i.preventDefault();let r=Jn(i);return(n=this.responder)===null||n===void 0||n.setLocationRangeFromPointRange(r),this.attachFiles(i.dataTransfer.files)}},dragend(){var i;this.dragging&&((i=this.responder)===null||i===void 0||i.setSelectedRange(this.dragging.range),this.dragging=null)},compositionend(i){this.composing&&(this.composing=!1,xe.recentAndroid||this.scheduleRender())}}),z(wt,"keys",{ArrowLeft(){var i,t;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageMovingCursorInDirection("backward"))return this.event.preventDefault(),(t=this.responder)===null||t===void 0?void 0:t.moveCursorInDirection("backward")},ArrowRight(){var i,t;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageMovingCursorInDirection("forward"))return this.event.preventDefault(),(t=this.responder)===null||t===void 0?void 0:t.moveCursorInDirection("forward")},Backspace(){var i,t,e;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageDeletingInDirection("backward"))return this.event.preventDefault(),(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(e=this.responder)===null||e===void 0||e.deleteInDirection("backward"),this.render()},Tab(){var i,t;if((i=this.responder)!==null&&i!==void 0&&i.canIncreaseNestingLevel())return this.event.preventDefault(),(t=this.responder)===null||t===void 0||t.increaseNestingLevel(),this.render()},"Tab+Shift"(){var i,t;if((i=this.responder)!==null&&i!==void 0&&i.canDecreaseNestingLevel())return this.event.preventDefault(),(t=this.responder)===null||t===void 0||t.decreaseNestingLevel(),this.render()}}),z(wt,"inputTypes",{deleteByComposition(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteByCut(){return this.deleteInDirection("backward")},deleteByDrag(){return this.event.preventDefault(),this.withTargetDOMRange(function(){var i;this.deleteByDragRange=(i=this.responder)===null||i===void 0?void 0:i.getSelectedRange()})},deleteCompositionText(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteContent(){return this.deleteInDirection("backward")},deleteContentBackward(){return this.deleteInDirection("backward")},deleteContentForward(){return this.deleteInDirection("forward")},deleteEntireSoftLine(){return this.deleteInDirection("forward")},deleteHardLineBackward(){return this.deleteInDirection("backward")},deleteHardLineForward(){return this.deleteInDirection("forward")},deleteSoftLineBackward(){return this.deleteInDirection("backward")},deleteSoftLineForward(){return this.deleteInDirection("forward")},deleteWordBackward(){return this.deleteInDirection("backward")},deleteWordForward(){return this.deleteInDirection("forward")},formatBackColor(){return this.activateAttributeIfSupported("backgroundColor",this.event.data)},formatBold(){return this.toggleAttributeIfSupported("bold")},formatFontColor(){return this.activateAttributeIfSupported("color",this.event.data)},formatFontName(){return this.activateAttributeIfSupported("font",this.event.data)},formatIndent(){var i;if((i=this.responder)!==null&&i!==void 0&&i.canIncreaseNestingLevel())return this.withTargetDOMRange(function(){var t;return(t=this.responder)===null||t===void 0?void 0:t.increaseNestingLevel()})},formatItalic(){return this.toggleAttributeIfSupported("italic")},formatJustifyCenter(){return this.toggleAttributeIfSupported("justifyCenter")},formatJustifyFull(){return this.toggleAttributeIfSupported("justifyFull")},formatJustifyLeft(){return this.toggleAttributeIfSupported("justifyLeft")},formatJustifyRight(){return this.toggleAttributeIfSupported("justifyRight")},formatOutdent(){var i;if((i=this.responder)!==null&&i!==void 0&&i.canDecreaseNestingLevel())return this.withTargetDOMRange(function(){var t;return(t=this.responder)===null||t===void 0?void 0:t.decreaseNestingLevel()})},formatRemove(){this.withTargetDOMRange(function(){for(let e in(i=this.responder)===null||i===void 0?void 0:i.getCurrentAttributes()){var i,t;(t=this.responder)===null||t===void 0||t.removeCurrentAttribute(e)}})},formatSetBlockTextDirection(){return this.activateAttributeIfSupported("blockDir",this.event.data)},formatSetInlineTextDirection(){return this.activateAttributeIfSupported("textDir",this.event.data)},formatStrikeThrough(){return this.toggleAttributeIfSupported("strike")},formatSubscript(){return this.toggleAttributeIfSupported("sub")},formatSuperscript(){return this.toggleAttributeIfSupported("sup")},formatUnderline(){return this.toggleAttributeIfSupported("underline")},historyRedo(){var i;return(i=this.delegate)===null||i===void 0?void 0:i.inputControllerWillPerformRedo()},historyUndo(){var i;return(i=this.delegate)===null||i===void 0?void 0:i.inputControllerWillPerformUndo()},insertCompositionText(){return this.composing=!0,this.insertString(this.event.data)},insertFromComposition(){return this.composing=!1,this.insertString(this.event.data)},insertFromDrop(){let i=this.deleteByDragRange;var t;if(i)return this.deleteByDragRange=null,(t=this.delegate)===null||t===void 0||t.inputControllerWillMoveText(),this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.moveTextFromRange(i)})},insertFromPaste(){let{dataTransfer:i}=this.event,t={dataTransfer:i},e=i.getData("URL"),n=i.getData("text/html");if(e){var r;let c;this.event.preventDefault(),t.type="text/html";let u=i.getData("public.url-name");c=u?xi(u).trim():e,t.html=this.createLinkHTML(e,c),(r=this.delegate)===null||r===void 0||r.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var d;return(d=this.responder)===null||d===void 0?void 0:d.insertHTML(t.html)}),this.afterRender=()=>{var d;return(d=this.delegate)===null||d===void 0?void 0:d.inputControllerDidPaste(t)}}else if(Mr(i)){var o;t.type="text/plain",t.string=i.getData("text/plain"),(o=this.delegate)===null||o===void 0||o.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var c;return(c=this.responder)===null||c===void 0?void 0:c.insertString(t.string)}),this.afterRender=()=>{var c;return(c=this.delegate)===null||c===void 0?void 0:c.inputControllerDidPaste(t)}}else if(Gs(this.event)){var s;t.type="File",t.file=i.files[0],(s=this.delegate)===null||s===void 0||s.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var c;return(c=this.responder)===null||c===void 0?void 0:c.insertFile(t.file)}),this.afterRender=()=>{var c;return(c=this.delegate)===null||c===void 0?void 0:c.inputControllerDidPaste(t)}}else if(n){var l;this.event.preventDefault(),t.type="text/html",t.html=n,(l=this.delegate)===null||l===void 0||l.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var c;return(c=this.responder)===null||c===void 0?void 0:c.insertHTML(t.html)}),this.afterRender=()=>{var c;return(c=this.delegate)===null||c===void 0?void 0:c.inputControllerDidPaste(t)}}},insertFromYank(){return this.insertString(this.event.data)},insertLineBreak(){return this.insertString(` +`)},insertLink(){return this.activateAttributeIfSupported("href",this.event.data)},insertOrderedList(){return this.toggleAttributeIfSupported("number")},insertParagraph(){var i;return(i=this.delegate)===null||i===void 0||i.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var t;return(t=this.responder)===null||t===void 0?void 0:t.insertLineBreak()})},insertReplacementText(){let i=this.event.dataTransfer.getData("text/plain"),t=this.event.getTargetRanges()[0];this.withTargetDOMRange(t,()=>{this.insertString(i,{updatePosition:!1})})},insertText(){var i;return this.insertString(this.event.data||((i=this.event.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain")))},insertTranspose(){return this.insertString(this.event.data)},insertUnorderedList(){return this.toggleAttributeIfSupported("bullet")}});var Ks=function(i){let t=document.createRange();return t.setStart(i.startContainer,i.startOffset),t.setEnd(i.endContainer,i.endOffset),t},qn=i=>{var t;return Array.from(((t=i.dataTransfer)===null||t===void 0?void 0:t.types)||[]).includes("Files")},Gs=i=>{var t;return((t=i.dataTransfer.files)===null||t===void 0?void 0:t[0])&&!to(i)&&!(e=>{let{dataTransfer:n}=e;return n.types.includes("Files")&&n.types.includes("text/html")&&n.getData("text/html").includes("urn:schemas-microsoft-com:office:office")})(i)},to=function(i){let t=i.clipboardData;if(t)return Array.from(t.types).filter(e=>e.match(/file/i)).length===t.types.length&&t.files.length>=1},$s=function(i){let t=i.clipboardData;if(t)return t.types.includes("text/plain")&&t.types.length===1},Ys=function(i){let t=[];return i.altKey&&t.push("alt"),i.shiftKey&&t.push("shift"),t.push(i.key),t},Jn=i=>({x:i.clientX,y:i.clientY}),ui="[data-trix-attribute]",hi="[data-trix-action]",Xs="".concat(ui,", ").concat(hi),cn="[data-trix-dialog]",Zs="".concat(cn,"[data-trix-active]"),Qs="".concat(cn," [data-trix-method]"),kr="".concat(cn," [data-trix-input]"),Rr=(i,t)=>(t||(t=Ut(i)),i.querySelector("[data-trix-input][name='".concat(t,"']"))),Tr=i=>i.getAttribute("data-trix-action"),Ut=i=>i.getAttribute("data-trix-attribute")||i.getAttribute("data-trix-dialog-attribute"),sn=class extends R{constructor(t){super(t),this.didClickActionButton=this.didClickActionButton.bind(this),this.didClickAttributeButton=this.didClickAttributeButton.bind(this),this.didClickDialogButton=this.didClickDialogButton.bind(this),this.didKeyDownDialogInput=this.didKeyDownDialogInput.bind(this),this.element=t,this.attributes={},this.actions={},this.resetDialogInputs(),S("mousedown",{onElement:this.element,matchingSelector:hi,withCallback:this.didClickActionButton}),S("mousedown",{onElement:this.element,matchingSelector:ui,withCallback:this.didClickAttributeButton}),S("click",{onElement:this.element,matchingSelector:Xs,preventDefault:!0}),S("click",{onElement:this.element,matchingSelector:Qs,withCallback:this.didClickDialogButton}),S("keydown",{onElement:this.element,matchingSelector:kr,withCallback:this.didKeyDownDialogInput})}didClickActionButton(t,e){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),t.preventDefault();let r=Tr(e);return this.getDialog(r)?this.toggleDialog(r):(o=this.delegate)===null||o===void 0?void 0:o.toolbarDidInvokeAction(r,e);var o}didClickAttributeButton(t,e){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),t.preventDefault();let r=Ut(e);var o;return this.getDialog(r)?this.toggleDialog(r):(o=this.delegate)===null||o===void 0||o.toolbarDidToggleAttribute(r),this.refreshAttributeButtons()}didClickDialogButton(t,e){let n=vt(e,{matchingSelector:cn});return this[e.getAttribute("data-trix-method")].call(this,n)}didKeyDownDialogInput(t,e){if(t.keyCode===13){t.preventDefault();let n=e.getAttribute("name"),r=this.getDialog(n);this.setAttribute(r)}if(t.keyCode===27)return t.preventDefault(),this.hideDialog()}updateActions(t){return this.actions=t,this.refreshActionButtons()}refreshActionButtons(){return this.eachActionButton((t,e)=>{t.disabled=this.actions[e]===!1})}eachActionButton(t){return Array.from(this.element.querySelectorAll(hi)).map(e=>t(e,Tr(e)))}updateAttributes(t){return this.attributes=t,this.refreshAttributeButtons()}refreshAttributeButtons(){return this.eachAttributeButton((t,e)=>(t.disabled=this.attributes[e]===!1,this.attributes[e]||this.dialogIsVisible(e)?(t.setAttribute("data-trix-active",""),t.classList.add("trix-active")):(t.removeAttribute("data-trix-active"),t.classList.remove("trix-active"))))}eachAttributeButton(t){return Array.from(this.element.querySelectorAll(ui)).map(e=>t(e,Ut(e)))}applyKeyboardCommand(t){let e=JSON.stringify(t.sort());for(let n of Array.from(this.element.querySelectorAll("[data-trix-key]"))){let r=n.getAttribute("data-trix-key").split("+");if(JSON.stringify(r.sort())===e)return he("mousedown",{onElement:n}),!0}return!1}dialogIsVisible(t){let e=this.getDialog(t);if(e)return e.hasAttribute("data-trix-active")}toggleDialog(t){return this.dialogIsVisible(t)?this.hideDialog():this.showDialog(t)}showDialog(t){var e,n;this.hideDialog(),(e=this.delegate)===null||e===void 0||e.toolbarWillShowDialog();let r=this.getDialog(t);r.setAttribute("data-trix-active",""),r.classList.add("trix-active"),Array.from(r.querySelectorAll("input[disabled]")).forEach(s=>{s.removeAttribute("disabled")});let o=Ut(r);if(o){let s=Rr(r,t);s&&(s.value=this.attributes[o]||"",s.select())}return(n=this.delegate)===null||n===void 0?void 0:n.toolbarDidShowDialog(t)}setAttribute(t){var e;let n=Ut(t),r=Rr(t,n);return!r.willValidate||(r.setCustomValidity(""),r.checkValidity()&&this.isSafeAttribute(r))?((e=this.delegate)===null||e===void 0||e.toolbarDidUpdateAttribute(n,r.value),this.hideDialog()):(r.setCustomValidity("Invalid value"),r.setAttribute("data-trix-validate",""),r.classList.add("trix-validate"),r.focus())}isSafeAttribute(t){return!t.hasAttribute("data-trix-validate-href")||Ve.isValidAttribute("a","href",t.value)}removeAttribute(t){var e;let n=Ut(t);return(e=this.delegate)===null||e===void 0||e.toolbarDidRemoveAttribute(n),this.hideDialog()}hideDialog(){let t=this.element.querySelector(Zs);var e;if(t)return t.removeAttribute("data-trix-active"),t.classList.remove("trix-active"),this.resetDialogInputs(),(e=this.delegate)===null||e===void 0?void 0:e.toolbarDidHideDialog((n=>n.getAttribute("data-trix-dialog"))(t))}resetDialogInputs(){Array.from(this.element.querySelectorAll(kr)).forEach(t=>{t.setAttribute("disabled","disabled"),t.removeAttribute("data-trix-validate"),t.classList.remove("trix-validate")})}getDialog(t){return this.element.querySelector("[data-trix-dialog=".concat(t,"]"))}},Lt=class extends nn{constructor(t){let{editorElement:e,document:n,html:r}=t;super(...arguments),this.editorElement=e,this.selectionManager=new ct(this.editorElement),this.selectionManager.delegate=this,this.composition=new it,this.composition.delegate=this,this.attachmentManager=new Ge(this.composition.getAttachments()),this.attachmentManager.delegate=this,this.inputController=bi.getLevel()===2?new wt(this.editorElement):new Y(this.editorElement),this.inputController.delegate=this,this.inputController.responder=this.composition,this.compositionController=new en(this.editorElement,this.composition),this.compositionController.delegate=this,this.toolbarController=new sn(this.editorElement.toolbarElement),this.toolbarController.delegate=this,this.editor=new Xe(this.composition,this.selectionManager,this.editorElement),n?this.editor.loadDocument(n):this.editor.loadHTML(r)}registerSelectionManager(){return Ot.registerSelectionManager(this.selectionManager)}unregisterSelectionManager(){return Ot.unregisterSelectionManager(this.selectionManager)}render(){return this.compositionController.render()}reparse(){return this.composition.replaceHTML(this.editorElement.innerHTML)}compositionDidChangeDocument(t){if(this.notifyEditorElement("document-change"),!this.handlingInput)return this.render()}compositionDidChangeCurrentAttributes(t){return this.currentAttributes=t,this.toolbarController.updateAttributes(this.currentAttributes),this.updateCurrentActions(),this.notifyEditorElement("attributes-change",{attributes:this.currentAttributes})}compositionDidPerformInsertionAtRange(t){this.pasting&&(this.pastedRange=t)}compositionShouldAcceptFile(t){return this.notifyEditorElement("file-accept",{file:t})}compositionDidAddAttachment(t){let e=this.attachmentManager.manageAttachment(t);return this.notifyEditorElement("attachment-add",{attachment:e})}compositionDidEditAttachment(t){this.compositionController.rerenderViewForObject(t);let e=this.attachmentManager.manageAttachment(t);return this.notifyEditorElement("attachment-edit",{attachment:e}),this.notifyEditorElement("change")}compositionDidChangeAttachmentPreviewURL(t){return this.compositionController.invalidateViewForObject(t),this.notifyEditorElement("change")}compositionDidRemoveAttachment(t){let e=this.attachmentManager.unmanageAttachment(t);return this.notifyEditorElement("attachment-remove",{attachment:e})}compositionDidStartEditingAttachment(t,e){return this.attachmentLocationRange=this.composition.document.getLocationRangeOfAttachment(t),this.compositionController.installAttachmentEditorForAttachment(t,e),this.selectionManager.setLocationRange(this.attachmentLocationRange)}compositionDidStopEditingAttachment(t){this.compositionController.uninstallAttachmentEditor(),this.attachmentLocationRange=null}compositionDidRequestChangingSelectionToLocationRange(t){if(!this.loadingSnapshot||this.isFocused())return this.requestedLocationRange=t,this.compositionRevisionWhenLocationRangeRequested=this.composition.revision,this.handlingInput?void 0:this.render()}compositionWillLoadSnapshot(){this.loadingSnapshot=!0}compositionDidLoadSnapshot(){this.compositionController.refreshViewCache(),this.render(),this.loadingSnapshot=!1}getSelectionManager(){return this.selectionManager}attachmentManagerDidRequestRemovalOfAttachment(t){return this.removeAttachment(t)}compositionControllerWillSyncDocumentView(){return this.inputController.editorWillSyncDocumentView(),this.selectionManager.lock(),this.selectionManager.clearSelection()}compositionControllerDidSyncDocumentView(){return this.inputController.editorDidSyncDocumentView(),this.selectionManager.unlock(),this.updateCurrentActions(),this.notifyEditorElement("sync")}compositionControllerDidRender(){this.requestedLocationRange&&(this.compositionRevisionWhenLocationRangeRequested===this.composition.revision&&this.selectionManager.setLocationRange(this.requestedLocationRange),this.requestedLocationRange=null,this.compositionRevisionWhenLocationRangeRequested=null),this.renderedCompositionRevision!==this.composition.revision&&(this.runEditorFilters(),this.composition.updateCurrentAttributes(),this.notifyEditorElement("render")),this.renderedCompositionRevision=this.composition.revision}compositionControllerDidFocus(){return this.isFocusedInvisibly()&&this.setLocationRange({index:0,offset:0}),this.toolbarController.hideDialog(),this.notifyEditorElement("focus")}compositionControllerDidBlur(){return this.notifyEditorElement("blur")}compositionControllerDidSelectAttachment(t,e){return this.toolbarController.hideDialog(),this.composition.editAttachment(t,e)}compositionControllerDidRequestDeselectingAttachment(t){let e=this.attachmentLocationRange||this.composition.document.getLocationRangeOfAttachment(t);return this.selectionManager.setLocationRange(e[1])}compositionControllerWillUpdateAttachment(t){return this.editor.recordUndoEntry("Edit Attachment",{context:t.id,consolidatable:!0})}compositionControllerDidRequestRemovalOfAttachment(t){return this.removeAttachment(t)}inputControllerWillHandleInput(){this.handlingInput=!0,this.requestedRender=!1}inputControllerDidRequestRender(){this.requestedRender=!0}inputControllerDidHandleInput(){if(this.handlingInput=!1,this.requestedRender)return this.requestedRender=!1,this.render()}inputControllerDidAllowUnhandledInput(){return this.notifyEditorElement("change")}inputControllerDidRequestReparse(){return this.reparse()}inputControllerWillPerformTyping(){return this.recordTypingUndoEntry()}inputControllerWillPerformFormatting(t){return this.recordFormattingUndoEntry(t)}inputControllerWillCutText(){return this.editor.recordUndoEntry("Cut")}inputControllerWillPaste(t){return this.editor.recordUndoEntry("Paste"),this.pasting=!0,this.notifyEditorElement("before-paste",{paste:t})}inputControllerDidPaste(t){return t.range=this.pastedRange,this.pastedRange=null,this.pasting=null,this.notifyEditorElement("paste",{paste:t})}inputControllerWillMoveText(){return this.editor.recordUndoEntry("Move")}inputControllerWillAttachFiles(){return this.editor.recordUndoEntry("Drop Files")}inputControllerWillPerformUndo(){return this.editor.undo()}inputControllerWillPerformRedo(){return this.editor.redo()}inputControllerDidReceiveKeyboardCommand(t){return this.toolbarController.applyKeyboardCommand(t)}inputControllerDidStartDrag(){this.locationRangeBeforeDrag=this.selectionManager.getLocationRange()}inputControllerDidReceiveDragOverPoint(t){return this.selectionManager.setLocationRangeFromPointRange(t)}inputControllerDidCancelDrag(){this.selectionManager.setLocationRange(this.locationRangeBeforeDrag),this.locationRangeBeforeDrag=null}locationRangeDidChange(t){return this.composition.updateCurrentAttributes(),this.updateCurrentActions(),this.attachmentLocationRange&&!We(this.attachmentLocationRange,t)&&this.composition.stopEditingAttachment(),this.notifyEditorElement("selection-change")}toolbarDidClickButton(){if(!this.getLocationRange())return this.setLocationRange({index:0,offset:0})}toolbarDidInvokeAction(t,e){return this.invokeAction(t,e)}toolbarDidToggleAttribute(t){if(this.recordFormattingUndoEntry(t),this.composition.toggleCurrentAttribute(t),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidUpdateAttribute(t,e){if(this.recordFormattingUndoEntry(t),this.composition.setCurrentAttribute(t,e),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidRemoveAttribute(t){if(this.recordFormattingUndoEntry(t),this.composition.removeCurrentAttribute(t),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarWillShowDialog(t){return this.composition.expandSelectionForEditing(),this.freezeSelection()}toolbarDidShowDialog(t){return this.notifyEditorElement("toolbar-dialog-show",{dialogName:t})}toolbarDidHideDialog(t){return this.thawSelection(),this.editorElement.focus(),this.notifyEditorElement("toolbar-dialog-hide",{dialogName:t})}freezeSelection(){if(!this.selectionFrozen)return this.selectionManager.lock(),this.composition.freezeSelection(),this.selectionFrozen=!0,this.render()}thawSelection(){if(this.selectionFrozen)return this.composition.thawSelection(),this.selectionManager.unlock(),this.selectionFrozen=!1,this.render()}canInvokeAction(t){return!!this.actionIsExternal(t)||!((e=this.actions[t])===null||e===void 0||(e=e.test)===null||e===void 0||!e.call(this));var e}invokeAction(t,e){return this.actionIsExternal(t)?this.notifyEditorElement("action-invoke",{actionName:t,invokingElement:e}):(n=this.actions[t])===null||n===void 0||(n=n.perform)===null||n===void 0?void 0:n.call(this);var n}actionIsExternal(t){return/^x-./.test(t)}getCurrentActions(){let t={};for(let e in this.actions)t[e]=this.canInvokeAction(e);return t}updateCurrentActions(){let t=this.getCurrentActions();if(!Xt(t,this.currentActions))return this.currentActions=t,this.toolbarController.updateActions(this.currentActions),this.notifyEditorElement("actions-change",{actions:this.currentActions})}runEditorFilters(){let t=this.composition.getSnapshot();if(Array.from(this.editor.filters).forEach(r=>{let{document:o,selectedRange:s}=t;t=r.call(this.editor,t)||{},t.document||(t.document=o),t.selectedRange||(t.selectedRange=s)}),e=t,n=this.composition.getSnapshot(),!We(e.selectedRange,n.selectedRange)||!e.document.isEqualTo(n.document))return this.composition.loadSnapshot(t);var e,n}updateInputElement(){let t=function(e,n){let r=Ls[n];if(r)return r(e);throw new Error("unknown content type: ".concat(n))}(this.compositionController.getSerializableElement(),"text/html");return this.editorElement.setFormValue(t)}notifyEditorElement(t,e){switch(t){case"document-change":this.documentChangedSinceLastRender=!0;break;case"render":this.documentChangedSinceLastRender&&(this.documentChangedSinceLastRender=!1,this.notifyEditorElement("change"));break;case"change":case"attachment-add":case"attachment-edit":case"attachment-remove":this.updateInputElement()}return this.editorElement.notify(t,e)}removeAttachment(t){return this.editor.recordUndoEntry("Delete Attachment"),this.composition.removeAttachment(t),this.render()}recordFormattingUndoEntry(t){let e=L(t),n=this.selectionManager.getLocationRange();if(e||!ut(n))return this.editor.recordUndoEntry("Formatting",{context:this.getUndoContext(),consolidatable:!0})}recordTypingUndoEntry(){return this.editor.recordUndoEntry("Typing",{context:this.getUndoContext(this.currentAttributes),consolidatable:!0})}getUndoContext(){for(var t=arguments.length,e=new Array(t),n=0;n0?Math.floor(new Date().getTime()/Yn.interval):0}isFocused(){var t;return this.editorElement===((t=this.editorElement.ownerDocument)===null||t===void 0?void 0:t.activeElement)}isFocusedInvisibly(){return this.isFocused()&&!this.getLocationRange()}get actions(){return this.constructor.actions}};z(Lt,"actions",{undo:{test(){return this.editor.canUndo()},perform(){return this.editor.undo()}},redo:{test(){return this.editor.canRedo()},perform(){return this.editor.redo()}},link:{test(){return this.editor.canActivateAttribute("href")}},increaseNestingLevel:{test(){return this.editor.canIncreaseNestingLevel()},perform(){return this.editor.increaseNestingLevel()&&this.render()}},decreaseNestingLevel:{test(){return this.editor.canDecreaseNestingLevel()},perform(){return this.editor.decreaseNestingLevel()&&this.render()}},attachFiles:{test:()=>!0,perform(){return bi.pickFiles(this.editor.insertFiles)}}}),Lt.proxyMethod("getSelectionManager().setLocationRange"),Lt.proxyMethod("getSelectionManager().getLocationRange");var ta=Object.freeze({__proto__:null,AttachmentEditorController:tn,CompositionController:en,Controller:nn,EditorController:Lt,InputController:Yt,Level0InputController:Y,Level2InputController:wt,ToolbarController:sn}),ea=Object.freeze({__proto__:null,MutationObserver:rn,SelectionChangeObserver:Ue}),na=Object.freeze({__proto__:null,FileVerificationOperation:on,ImagePreloadOperation:Ke});Pr("trix-toolbar",`%t { + display: block; +} + +%t { + white-space: nowrap; +} + +%t [data-trix-dialog] { + display: none; +} + +%t [data-trix-dialog][data-trix-active] { + display: block; +} + +%t [data-trix-dialog] [data-trix-validate]:invalid { + background-color: #ffdddd; +}`);var an=class extends HTMLElement{connectedCallback(){this.innerHTML===""&&(this.innerHTML=Fr.getDefaultHTML())}},ia=0,ra=function(i){if(!i.hasAttribute("contenteditable"))return i.setAttribute("contenteditable",""),function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.times=1,S(t,e)}("focus",{onElement:i,withCallback:()=>oa(i)})},oa=function(i){return sa(i),aa(i)},sa=function(i){var t,e;if((t=(e=document).queryCommandSupported)!==null&&t!==void 0&&t.call(e,"enableObjectResizing"))return document.execCommand("enableObjectResizing",!1,!1),S("mscontrolselect",{onElement:i,preventDefault:!0})},aa=function(i){var t,e;if((t=(e=document).queryCommandSupported)!==null&&t!==void 0&&t.call(e,"DefaultParagraphSeparator")){let{tagName:n}=W.default;if(["div","p"].includes(n))return document.execCommand("DefaultParagraphSeparator",!1,n)}},wr=xe.forcesObjectResizing?{display:"inline",width:"auto"}:{display:"inline-block",width:"1px"};Pr("trix-editor",`%t { + display: block; +} + +%t:empty::before { + content: attr(placeholder); + color: graytext; + cursor: text; + pointer-events: none; + white-space: pre-line; +} + +%t a[contenteditable=false] { + cursor: text; +} + +%t img { + max-width: 100%; + height: auto; +} + +%t `.concat(Rt,` figcaption textarea { + resize: none; +} + +%t `).concat(Rt,` figcaption textarea.trix-autoresize-clone { + position: absolute; + left: -9999px; + max-height: 0px; +} + +%t `).concat(Rt,` figcaption[data-trix-placeholder]:empty::before { + content: attr(data-trix-placeholder); + color: graytext; +} + +%t [data-trix-cursor-target] { + display: `).concat(wr.display,` !important; + width: `).concat(wr.width,` !important; + padding: 0 !important; + margin: 0 !important; + border: none !important; +} + +%t [data-trix-cursor-target=left] { + vertical-align: top !important; + margin-left: -1px !important; +} + +%t [data-trix-cursor-target=right] { + vertical-align: bottom !important; + margin-right: -1px !important; +}`));var lt=new WeakMap,ce=new WeakSet,di=class{constructor(t){var e,n;Jr(e=this,n=ce),n.add(e),pe(this,lt,{writable:!0,value:void 0}),this.element=t,Ci(this,lt,t.attachInternals())}connectedCallback(){Fe(this,ce,Pe).call(this)}disconnectedCallback(){}get labels(){return x(this,lt).labels}get disabled(){var t;return(t=this.element.inputElement)===null||t===void 0?void 0:t.disabled}set disabled(t){this.element.toggleAttribute("disabled",t)}get required(){return this.element.hasAttribute("required")}set required(t){this.element.toggleAttribute("required",t),Fe(this,ce,Pe).call(this)}get validity(){return x(this,lt).validity}get validationMessage(){return x(this,lt).validationMessage}get willValidate(){return x(this,lt).willValidate}setFormValue(t){Fe(this,ce,Pe).call(this)}checkValidity(){return x(this,lt).checkValidity()}reportValidity(){return x(this,lt).reportValidity()}setCustomValidity(t){Fe(this,ce,Pe).call(this,t)}};function Pe(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",{required:t,value:e}=this.element,n=t&&!e,r=!!i,o=p("input",{required:t}),s=i||o.validationMessage;x(this,lt).setValidity({valueMissing:n,customError:r},s)}var Kn=new WeakMap,Gn=new WeakMap,$n=new WeakMap,gi=class{constructor(t){pe(this,Kn,{writable:!0,value:void 0}),pe(this,Gn,{writable:!0,value:e=>{e.defaultPrevented||e.target===this.element.form&&this.element.reset()}}),pe(this,$n,{writable:!0,value:e=>{if(e.defaultPrevented||this.element.contains(e.target))return;let n=vt(e.target,{matchingSelector:"label"});n&&Array.from(this.labels).includes(n)&&this.element.focus()}}),this.element=t}connectedCallback(){Ci(this,Kn,function(t){if(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby"))return;let e=function(){let n=Array.from(t.labels).map(o=>{if(!o.contains(t))return o.textContent}).filter(o=>o),r=n.join(" ");return r?t.setAttribute("aria-label",r):t.removeAttribute("aria-label")};return e(),S("focus",{onElement:t,withCallback:e})}(this.element)),window.addEventListener("reset",x(this,Gn),!1),window.addEventListener("click",x(this,$n),!1)}disconnectedCallback(){var t;(t=x(this,Kn))===null||t===void 0||t.destroy(),window.removeEventListener("reset",x(this,Gn),!1),window.removeEventListener("click",x(this,$n),!1)}get labels(){let t=[];this.element.id&&this.element.ownerDocument&&t.push(...Array.from(this.element.ownerDocument.querySelectorAll("label[for='".concat(this.element.id,"']"))||[]));let e=vt(this.element,{matchingSelector:"label"});return e&&[this.element,null].includes(e.control)&&t.push(e),t}get disabled(){return console.warn("This browser does not support the [disabled] attribute for trix-editor elements."),!1}set disabled(t){console.warn("This browser does not support the [disabled] attribute for trix-editor elements.")}get required(){return console.warn("This browser does not support the [required] attribute for trix-editor elements."),!1}set required(t){console.warn("This browser does not support the [required] attribute for trix-editor elements.")}get validity(){return console.warn("This browser does not support the validity property for trix-editor elements."),null}get validationMessage(){return console.warn("This browser does not support the validationMessage property for trix-editor elements."),""}get willValidate(){return console.warn("This browser does not support the willValidate property for trix-editor elements."),!1}setFormValue(t){}checkValidity(){return console.warn("This browser does not support checkValidity() for trix-editor elements."),!0}reportValidity(){return console.warn("This browser does not support reportValidity() for trix-editor elements."),!0}setCustomValidity(t){console.warn("This browser does not support setCustomValidity(validationMessage) for trix-editor elements.")}},P=new WeakMap,ye=class extends HTMLElement{constructor(){super(),pe(this,P,{writable:!0,value:void 0}),Ci(this,P,this.constructor.formAssociated?new di(this):new gi(this))}get trixId(){return this.hasAttribute("trix-id")?this.getAttribute("trix-id"):(this.setAttribute("trix-id",++ia),this.trixId)}get labels(){return x(this,P).labels}get disabled(){return x(this,P).disabled}set disabled(t){x(this,P).disabled=t}get required(){return x(this,P).required}set required(t){x(this,P).required=t}get validity(){return x(this,P).validity}get validationMessage(){return x(this,P).validationMessage}get willValidate(){return x(this,P).willValidate}get type(){return this.localName}get toolbarElement(){var t;if(this.hasAttribute("toolbar"))return(t=this.ownerDocument)===null||t===void 0?void 0:t.getElementById(this.getAttribute("toolbar"));if(this.parentNode){let e="trix-toolbar-".concat(this.trixId);this.setAttribute("toolbar",e);let n=p("trix-toolbar",{id:e});return this.parentNode.insertBefore(n,this),n}}get form(){var t;return(t=this.inputElement)===null||t===void 0?void 0:t.form}get inputElement(){var t;if(this.hasAttribute("input"))return(t=this.ownerDocument)===null||t===void 0?void 0:t.getElementById(this.getAttribute("input"));if(this.parentNode){let e="trix-input-".concat(this.trixId);this.setAttribute("input",e);let n=p("input",{type:"hidden",id:e});return this.parentNode.insertBefore(n,this.nextElementSibling),n}}get editor(){var t;return(t=this.editorController)===null||t===void 0?void 0:t.editor}get name(){var t;return(t=this.inputElement)===null||t===void 0?void 0:t.name}get value(){var t;return(t=this.inputElement)===null||t===void 0?void 0:t.value}set value(t){var e;this.defaultValue=t,(e=this.editor)===null||e===void 0||e.loadHTML(this.defaultValue)}notify(t,e){if(this.editorController)return he("trix-".concat(t),{onElement:this,attributes:e})}setFormValue(t){this.inputElement&&(this.inputElement.value=t,x(this,P).setFormValue(t))}connectedCallback(){this.hasAttribute("data-trix-internal")||(ra(this),function(t){t.hasAttribute("role")||t.setAttribute("role","textbox")}(this),this.editorController||(he("trix-before-initialize",{onElement:this}),this.editorController=new Lt({editorElement:this,html:this.defaultValue=this.value}),requestAnimationFrame(()=>he("trix-initialize",{onElement:this}))),this.editorController.registerSelectionManager(),x(this,P).connectedCallback(),function(t){!document.querySelector(":focus")&&t.hasAttribute("autofocus")&&document.querySelector("[autofocus]")===t&&t.focus()}(this))}disconnectedCallback(){var t;(t=this.editorController)===null||t===void 0||t.unregisterSelectionManager(),x(this,P).disconnectedCallback()}checkValidity(){return x(this,P).checkValidity()}reportValidity(){return x(this,P).reportValidity()}setCustomValidity(t){x(this,P).setCustomValidity(t)}formDisabledCallback(t){this.inputElement&&(this.inputElement.disabled=t),this.toggleAttribute("contenteditable",!t)}formResetCallback(){this.reset()}reset(){this.value=this.defaultValue}};z(ye,"formAssociated","ElementInternals"in window);var Z={VERSION:po,config:Ce,core:Ds,models:Xr,views:Ps,controllers:ta,observers:ea,operations:na,elements:Object.freeze({__proto__:null,TrixEditorElement:ye,TrixToolbarElement:an}),filters:Object.freeze({__proto__:null,Filter:Ye,attachmentGalleryFilter:$r})};Object.assign(Z,Xr),window.Trix=Z,setTimeout(function(){customElements.get("trix-toolbar")||customElements.define("trix-toolbar",an),customElements.get("trix-editor")||customElements.define("trix-editor",ye)},0);Z.config.blockAttributes.default.tagName="p";Z.config.blockAttributes.default.breakOnReturn=!0;Z.config.blockAttributes.heading={tagName:"h2",terminal:!0,breakOnReturn:!0,group:!1};Z.config.blockAttributes.subHeading={tagName:"h3",terminal:!0,breakOnReturn:!0,group:!1};Z.config.textAttributes.underline={style:{textDecoration:"underline"},inheritable:!0,parser:i=>window.getComputedStyle(i).textDecoration.includes("underline")};Z.Block.prototype.breaksOnReturn=function(){let i=this.getLastAttribute();return Z.config.blockAttributes[i||"default"]?.breakOnReturn??!1};Z.LineBreakInsertion.prototype.shouldInsertBlockBreak=function(){return this.block.hasAttributes()&&this.block.isListItem()&&!this.block.isEmpty()?this.startLocation.offset>0:this.shouldBreakFormattedBlock()?!1:this.breaksOnReturn};function la({state:i}){return{state:i,init:function(){this.$refs.trixValue.value=this.state,this.$refs.trix.editor?.loadHTML(this.state??""),this.$watch("state",()=>{document.activeElement!==this.$refs.trix&&(this.$refs.trixValue.value=this.state,this.$refs.trix.editor?.loadHTML(this.state??""))})}}}export{la as default}; +/*! Bundled license information: + +trix/dist/trix.esm.min.js: + (*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE *) +*/ diff --git a/public/js/filament/forms/components/select.js b/public/js/filament/forms/components/select.js new file mode 100644 index 00000000..fdea5da1 --- /dev/null +++ b/public/js/filament/forms/components/select.js @@ -0,0 +1,6 @@ +var lt=Object.create;var Ge=Object.defineProperty;var ct=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var ht=Object.getPrototypeOf,dt=Object.prototype.hasOwnProperty;var ft=(se,ie)=>()=>(ie||se((ie={exports:{}}).exports,ie),ie.exports);var pt=(se,ie,X,me)=>{if(ie&&typeof ie=="object"||typeof ie=="function")for(let j of ut(ie))!dt.call(se,j)&&j!==X&&Ge(se,j,{get:()=>ie[j],enumerable:!(me=ct(ie,j))||me.enumerable});return se};var mt=(se,ie,X)=>(X=se!=null?lt(ht(se)):{},pt(ie||!se||!se.__esModule?Ge(X,"default",{value:se,enumerable:!0}):X,se));var $e=ft((Ae,Ye)=>{(function(ie,X){typeof Ae=="object"&&typeof Ye=="object"?Ye.exports=X():typeof define=="function"&&define.amd?define([],X):typeof Ae=="object"?Ae.Choices=X():ie.Choices=X()})(window,function(){return function(){"use strict";var se={282:function(j,i,b){Object.defineProperty(i,"__esModule",{value:!0}),i.clearChoices=i.activateChoices=i.filterChoices=i.addChoice=void 0;var _=b(883),h=function(c){var l=c.value,O=c.label,L=c.id,y=c.groupId,D=c.disabled,k=c.elementId,Q=c.customProperties,Z=c.placeholder,ne=c.keyCode;return{type:_.ACTION_TYPES.ADD_CHOICE,value:l,label:O,id:L,groupId:y,disabled:D,elementId:k,customProperties:Q,placeholder:Z,keyCode:ne}};i.addChoice=h;var d=function(c){return{type:_.ACTION_TYPES.FILTER_CHOICES,results:c}};i.filterChoices=d;var a=function(c){return c===void 0&&(c=!0),{type:_.ACTION_TYPES.ACTIVATE_CHOICES,active:c}};i.activateChoices=a;var r=function(){return{type:_.ACTION_TYPES.CLEAR_CHOICES}};i.clearChoices=r},783:function(j,i,b){Object.defineProperty(i,"__esModule",{value:!0}),i.addGroup=void 0;var _=b(883),h=function(d){var a=d.value,r=d.id,c=d.active,l=d.disabled;return{type:_.ACTION_TYPES.ADD_GROUP,value:a,id:r,active:c,disabled:l}};i.addGroup=h},464:function(j,i,b){Object.defineProperty(i,"__esModule",{value:!0}),i.highlightItem=i.removeItem=i.addItem=void 0;var _=b(883),h=function(r){var c=r.value,l=r.label,O=r.id,L=r.choiceId,y=r.groupId,D=r.customProperties,k=r.placeholder,Q=r.keyCode;return{type:_.ACTION_TYPES.ADD_ITEM,value:c,label:l,id:O,choiceId:L,groupId:y,customProperties:D,placeholder:k,keyCode:Q}};i.addItem=h;var d=function(r,c){return{type:_.ACTION_TYPES.REMOVE_ITEM,id:r,choiceId:c}};i.removeItem=d;var a=function(r,c){return{type:_.ACTION_TYPES.HIGHLIGHT_ITEM,id:r,highlighted:c}};i.highlightItem=a},137:function(j,i,b){Object.defineProperty(i,"__esModule",{value:!0}),i.setIsLoading=i.resetTo=i.clearAll=void 0;var _=b(883),h=function(){return{type:_.ACTION_TYPES.CLEAR_ALL}};i.clearAll=h;var d=function(r){return{type:_.ACTION_TYPES.RESET_TO,state:r}};i.resetTo=d;var a=function(r){return{type:_.ACTION_TYPES.SET_IS_LOADING,isLoading:r}};i.setIsLoading=a},373:function(j,i,b){var _=this&&this.__spreadArray||function(g,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,v;n=0?this._store.getGroupById(v):null;return this._store.dispatch((0,l.highlightItem)(n,!0)),t&&this.passedElement.triggerEvent(y.EVENTS.highlightItem,{id:n,value:M,label:f,groupValue:u&&u.value?u.value:null}),this},g.prototype.unhighlightItem=function(e){if(!e||!e.id)return this;var t=e.id,n=e.groupId,s=n===void 0?-1:n,v=e.value,P=v===void 0?"":v,M=e.label,K=M===void 0?"":M,f=s>=0?this._store.getGroupById(s):null;return this._store.dispatch((0,l.highlightItem)(t,!1)),this.passedElement.triggerEvent(y.EVENTS.highlightItem,{id:t,value:P,label:K,groupValue:f&&f.value?f.value:null}),this},g.prototype.highlightAll=function(){var e=this;return this._store.items.forEach(function(t){return e.highlightItem(t)}),this},g.prototype.unhighlightAll=function(){var e=this;return this._store.items.forEach(function(t){return e.unhighlightItem(t)}),this},g.prototype.removeActiveItemsByValue=function(e){var t=this;return this._store.activeItems.filter(function(n){return n.value===e}).forEach(function(n){return t._removeItem(n)}),this},g.prototype.removeActiveItems=function(e){var t=this;return this._store.activeItems.filter(function(n){var s=n.id;return s!==e}).forEach(function(n){return t._removeItem(n)}),this},g.prototype.removeHighlightedItems=function(e){var t=this;return e===void 0&&(e=!1),this._store.highlightedActiveItems.forEach(function(n){t._removeItem(n),e&&t._triggerChange(n.value)}),this},g.prototype.showDropdown=function(e){var t=this;return this.dropdown.isActive?this:(requestAnimationFrame(function(){t.dropdown.show(),t.containerOuter.open(t.dropdown.distanceFromTopWindow),!e&&t._canSearch&&t.input.focus(),t.passedElement.triggerEvent(y.EVENTS.showDropdown,{})}),this)},g.prototype.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame(function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(y.EVENTS.hideDropdown,{})}),this):this},g.prototype.getValue=function(e){e===void 0&&(e=!1);var t=this._store.activeItems.reduce(function(n,s){var v=e?s.value:s;return n.push(v),n},[]);return this._isSelectOneElement?t[0]:t},g.prototype.setValue=function(e){var t=this;return this.initialised?(e.forEach(function(n){return t._setChoiceOrItem(n)}),this):this},g.prototype.setChoiceByValue=function(e){var t=this;if(!this.initialised||this._isTextElement)return this;var n=Array.isArray(e)?e:[e];return n.forEach(function(s){return t._findAndSelectChoiceByValue(s)}),this},g.prototype.setChoices=function(e,t,n,s){var v=this;if(e===void 0&&(e=[]),t===void 0&&(t="value"),n===void 0&&(n="label"),s===void 0&&(s=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if(typeof t!="string"||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(s&&this.clearChoices(),typeof e=="function"){var P=e(this);if(typeof Promise=="function"&&P instanceof Promise)return new Promise(function(M){return requestAnimationFrame(M)}).then(function(){return v._handleLoadingState(!0)}).then(function(){return P}).then(function(M){return v.setChoices(M,t,n,s)}).catch(function(M){v.config.silent||console.error(M)}).then(function(){return v._handleLoadingState(!1)}).then(function(){return v});if(!Array.isArray(P))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof P));return this.setChoices(P,t,n,!1)}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),e.forEach(function(M){if(M.choices)v._addGroup({id:M.id?parseInt("".concat(M.id),10):null,group:M,valueKey:t,labelKey:n});else{var K=M;v._addChoice({value:K[t],label:K[n],isSelected:!!K.selected,isDisabled:!!K.disabled,placeholder:!!K.placeholder,customProperties:K.customProperties})}}),this._stopLoading(),this},g.prototype.clearChoices=function(){return this._store.dispatch((0,r.clearChoices)()),this},g.prototype.clearStore=function(){return this._store.dispatch((0,O.clearAll)()),this},g.prototype.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch((0,r.activateChoices)(!0))),this},g.prototype._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var e=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,t=this._isSelectElement,n=this._currentState.items!==this._prevState.items;e&&(t&&this._renderChoices(),n&&this._renderItems(),this._prevState=this._currentState)}},g.prototype._renderChoices=function(){var e=this,t=this._store,n=t.activeGroups,s=t.activeChoices,v=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame(function(){return e.choiceList.scrollToTop()}),n.length>=1&&!this._isSearching){var P=s.filter(function(C){return C.placeholder===!0&&C.groupId===-1});P.length>=1&&(v=this._createChoicesFragment(P,v)),v=this._createGroupsFragment(n,s,v)}else s.length>=1&&(v=this._createChoicesFragment(s,v));if(v.childNodes&&v.childNodes.length>0){var M=this._store.activeItems,K=this._canAddItem(M,this.input.value);if(K.response)this.choiceList.append(v),this._highlightChoice();else{var f=this._getTemplate("notice",K.notice);this.choiceList.append(f)}}else{var u=void 0,f=void 0;this._isSearching?(f=typeof this.config.noResultsText=="function"?this.config.noResultsText():this.config.noResultsText,u=this._getTemplate("notice",f,"no-results")):(f=typeof this.config.noChoicesText=="function"?this.config.noChoicesText():this.config.noChoicesText,u=this._getTemplate("notice",f,"no-choices")),this.choiceList.append(u)}},g.prototype._renderItems=function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)},g.prototype._createGroupsFragment=function(e,t,n){var s=this;n===void 0&&(n=document.createDocumentFragment());var v=function(P){return t.filter(function(M){return s._isSelectOneElement?M.groupId===P.id:M.groupId===P.id&&(s.config.renderSelectedChoices==="always"||!M.selected)})};return this.config.shouldSort&&e.sort(this.config.sorter),e.forEach(function(P){var M=v(P);if(M.length>=1){var K=s._getTemplate("choiceGroup",P);n.appendChild(K),s._createChoicesFragment(M,n,!0)}}),n},g.prototype._createChoicesFragment=function(e,t,n){var s=this;t===void 0&&(t=document.createDocumentFragment()),n===void 0&&(n=!1);var v=this.config,P=v.renderSelectedChoices,M=v.searchResultLimit,K=v.renderChoiceLimit,f=this._isSearching?k.sortByScore:this.config.sorter,u=function(z){var ee=P==="auto"?s._isSelectOneElement||!z.selected:!0;if(ee){var ae=s._getTemplate("choice",z,s.config.itemSelectText);t.appendChild(ae)}},C=e;P==="auto"&&!this._isSelectOneElement&&(C=e.filter(function(z){return!z.selected}));var Y=C.reduce(function(z,ee){return ee.placeholder?z.placeholderChoices.push(ee):z.normalChoices.push(ee),z},{placeholderChoices:[],normalChoices:[]}),V=Y.placeholderChoices,U=Y.normalChoices;(this.config.shouldSort||this._isSearching)&&U.sort(f);var $=C.length,W=this._isSelectOneElement?_(_([],V,!0),U,!0):U;this._isSearching?$=M:K&&K>0&&!n&&($=K);for(var J=0;J<$;J+=1)W[J]&&u(W[J]);return t},g.prototype._createItemsFragment=function(e,t){var n=this;t===void 0&&(t=document.createDocumentFragment());var s=this.config,v=s.shouldSortItems,P=s.sorter,M=s.removeItemButton;v&&!this._isSelectOneElement&&e.sort(P),this._isTextElement?this.passedElement.value=e.map(function(f){var u=f.value;return u}).join(this.config.delimiter):this.passedElement.options=e;var K=function(f){var u=n._getTemplate("item",f,M);t.appendChild(u)};return e.forEach(K),t},g.prototype._triggerChange=function(e){e!=null&&this.passedElement.triggerEvent(y.EVENTS.change,{value:e})},g.prototype._selectPlaceholderChoice=function(e){this._addItem({value:e.value,label:e.label,choiceId:e.id,groupId:e.groupId,placeholder:e.placeholder}),this._triggerChange(e.value)},g.prototype._handleButtonAction=function(e,t){if(!(!e||!t||!this.config.removeItems||!this.config.removeItemButton)){var n=t.parentNode&&t.parentNode.dataset.id,s=n&&e.find(function(v){return v.id===parseInt(n,10)});s&&(this._removeItem(s),this._triggerChange(s.value),this._isSelectOneElement&&this._store.placeholderChoice&&this._selectPlaceholderChoice(this._store.placeholderChoice))}},g.prototype._handleItemAction=function(e,t,n){var s=this;if(n===void 0&&(n=!1),!(!e||!t||!this.config.removeItems||this._isSelectOneElement)){var v=t.dataset.id;e.forEach(function(P){P.id===parseInt("".concat(v),10)&&!P.highlighted?s.highlightItem(P):!n&&P.highlighted&&s.unhighlightItem(P)}),this.input.focus()}},g.prototype._handleChoiceAction=function(e,t){if(!(!e||!t)){var n=t.dataset.id,s=n&&this._store.getChoiceById(n);if(s){var v=e[0]&&e[0].keyCode?e[0].keyCode:void 0,P=this.dropdown.isActive;if(s.keyCode=v,this.passedElement.triggerEvent(y.EVENTS.choice,{choice:s}),!s.selected&&!s.disabled){var M=this._canAddItem(e,s.value);M.response&&(this._addItem({value:s.value,label:s.label,choiceId:s.id,groupId:s.groupId,customProperties:s.customProperties,placeholder:s.placeholder,keyCode:s.keyCode}),this._triggerChange(s.value))}this.clearInput(),P&&this._isSelectOneElement&&(this.hideDropdown(!0),this.containerOuter.focus())}}},g.prototype._handleBackspace=function(e){if(!(!this.config.removeItems||!e)){var t=e[e.length-1],n=e.some(function(s){return s.highlighted});this.config.editItems&&!n&&t?(this.input.value=t.value,this.input.setWidth(),this._removeItem(t),this._triggerChange(t.value)):(n||this.highlightItem(t,!1),this.removeHighlightedItems(!0))}},g.prototype._startLoading=function(){this._store.dispatch((0,O.setIsLoading)(!0))},g.prototype._stopLoading=function(){this._store.dispatch((0,O.setIsLoading)(!1))},g.prototype._handleLoadingState=function(e){e===void 0&&(e=!0);var t=this.itemList.getChild(".".concat(this.config.classNames.placeholder));e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t?t.innerHTML=this.config.loadingText:(t=this._getTemplate("placeholder",this.config.loadingText),t&&this.itemList.append(t)):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?t&&(t.innerHTML=this._placeholderValue||""):this.input.placeholder=this._placeholderValue||"")},g.prototype._handleSearch=function(e){if(this.input.isFocussed){var t=this._store.choices,n=this.config,s=n.searchFloor,v=n.searchChoices,P=t.some(function(K){return!K.active});if(e!==null&&typeof e<"u"&&e.length>=s){var M=v?this._searchChoices(e):0;this.passedElement.triggerEvent(y.EVENTS.search,{value:e,resultCount:M})}else P&&(this._isSearching=!1,this._store.dispatch((0,r.activateChoices)(!0)))}},g.prototype._canAddItem=function(e,t){var n=!0,s=typeof this.config.addItemText=="function"?this.config.addItemText(t):this.config.addItemText;if(!this._isSelectOneElement){var v=(0,k.existsInArray)(e,t);this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(n=!1,s=typeof this.config.maxItemText=="function"?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&v&&n&&(n=!1,s=typeof this.config.uniqueItemText=="function"?this.config.uniqueItemText(t):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&n&&typeof this.config.addItemFilter=="function"&&!this.config.addItemFilter(t)&&(n=!1,s=typeof this.config.customAddItemText=="function"?this.config.customAddItemText(t):this.config.customAddItemText)}return{response:n,notice:s}},g.prototype._searchChoices=function(e){var t=typeof e=="string"?e.trim():e,n=typeof this._currentValue=="string"?this._currentValue.trim():this._currentValue;if(t.length<1&&t==="".concat(n," "))return 0;var s=this._store.searchableChoices,v=t,P=Object.assign(this.config.fuseOptions,{keys:_([],this.config.searchFields,!0),includeMatches:!0}),M=new a.default(s,P),K=M.search(v);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,r.filterChoices)(K)),K.length},g.prototype._addEventListeners=function(){var e=document.documentElement;e.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},g.prototype._removeEventListeners=function(){var e=document.documentElement;e.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},g.prototype._onKeyDown=function(e){var t=e.keyCode,n=this._store.activeItems,s=this.input.isFocussed,v=this.dropdown.isActive,P=this.itemList.hasChildren(),M=String.fromCharCode(t),K=/[^\x00-\x1F]/.test(M),f=y.KEY_CODES.BACK_KEY,u=y.KEY_CODES.DELETE_KEY,C=y.KEY_CODES.ENTER_KEY,Y=y.KEY_CODES.A_KEY,V=y.KEY_CODES.ESC_KEY,U=y.KEY_CODES.UP_KEY,$=y.KEY_CODES.DOWN_KEY,W=y.KEY_CODES.PAGE_UP_KEY,J=y.KEY_CODES.PAGE_DOWN_KEY;switch(!this._isTextElement&&!v&&K&&(this.showDropdown(),this.input.isFocussed||(this.input.value+=e.key.toLowerCase())),t){case Y:return this._onSelectKey(e,P);case C:return this._onEnterKey(e,n,v);case V:return this._onEscapeKey(v);case U:case W:case $:case J:return this._onDirectionKey(e,v);case u:case f:return this._onDeleteKey(e,n,s);default:}},g.prototype._onKeyUp=function(e){var t=e.target,n=e.keyCode,s=this.input.value,v=this._store.activeItems,P=this._canAddItem(v,s),M=y.KEY_CODES.BACK_KEY,K=y.KEY_CODES.DELETE_KEY;if(this._isTextElement){var f=P.notice&&s;if(f){var u=this._getTemplate("notice",P.notice);this.dropdown.element.innerHTML=u.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0)}else{var C=n===M||n===K,Y=C&&t&&!t.value,V=!this._isTextElement&&this._isSearching,U=this._canSearch&&P.response;Y&&V?(this._isSearching=!1,this._store.dispatch((0,r.activateChoices)(!0))):U&&this._handleSearch(this.input.rawValue)}this._canSearch=this.config.searchEnabled},g.prototype._onSelectKey=function(e,t){var n=e.ctrlKey,s=e.metaKey,v=n||s;if(v&&t){this._canSearch=!1;var P=this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement;P&&this.highlightAll()}},g.prototype._onEnterKey=function(e,t,n){var s=e.target,v=y.KEY_CODES.ENTER_KEY,P=s&&s.hasAttribute("data-button");if(this._isTextElement&&s&&s.value){var M=this.input.value,K=this._canAddItem(t,M);K.response&&(this.hideDropdown(!0),this._addItem({value:M}),this._triggerChange(M),this.clearInput())}if(P&&(this._handleButtonAction(t,s),e.preventDefault()),n){var f=this.dropdown.getChild(".".concat(this.config.classNames.highlightedState));f&&(t[0]&&(t[0].keyCode=v),this._handleChoiceAction(t,f)),e.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),e.preventDefault())},g.prototype._onEscapeKey=function(e){e&&(this.hideDropdown(!0),this.containerOuter.focus())},g.prototype._onDirectionKey=function(e,t){var n=e.keyCode,s=e.metaKey,v=y.KEY_CODES.DOWN_KEY,P=y.KEY_CODES.PAGE_UP_KEY,M=y.KEY_CODES.PAGE_DOWN_KEY;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var K=n===v||n===M?1:-1,f=s||n===M||n===P,u="[data-choice-selectable]",C=void 0;if(f)K>0?C=this.dropdown.element.querySelector("".concat(u,":last-of-type")):C=this.dropdown.element.querySelector(u);else{var Y=this.dropdown.element.querySelector(".".concat(this.config.classNames.highlightedState));Y?C=(0,k.getAdjacentEl)(Y,u,K):C=this.dropdown.element.querySelector(u)}C&&((0,k.isScrolledIntoView)(C,this.choiceList.element,K)||this.choiceList.scrollToChildElement(C,K),this._highlightChoice(C)),e.preventDefault()}},g.prototype._onDeleteKey=function(e,t,n){var s=e.target;!this._isSelectOneElement&&!s.value&&n&&(this._handleBackspace(t),e.preventDefault())},g.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},g.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target,n=this._wasTap&&this.containerOuter.element.contains(t);if(n){var s=t===this.containerOuter.element||t===this.containerInner.element;s&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()}this._wasTap=!0},g.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(E&&this.choiceList.element.contains(t)){var n=this.choiceList.element.firstElementChild,s=this._direction==="ltr"?e.offsetX>=n.offsetWidth:e.offsetX0;s&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0)}},g.prototype._onFocus=function(e){var t,n=this,s=e.target,v=s&&this.containerOuter.element.contains(s);if(v){var P=(t={},t[y.TEXT_TYPE]=function(){s===n.input.element&&n.containerOuter.addFocusState()},t[y.SELECT_ONE_TYPE]=function(){n.containerOuter.addFocusState(),s===n.input.element&&n.showDropdown(!0)},t[y.SELECT_MULTIPLE_TYPE]=function(){s===n.input.element&&(n.showDropdown(!0),n.containerOuter.addFocusState())},t);P[this.passedElement.element.type]()}},g.prototype._onBlur=function(e){var t,n=this,s=e.target,v=s&&this.containerOuter.element.contains(s);if(v&&!this._isScrollingOnIe){var P=this._store.activeItems,M=P.some(function(f){return f.highlighted}),K=(t={},t[y.TEXT_TYPE]=function(){s===n.input.element&&(n.containerOuter.removeFocusState(),M&&n.unhighlightAll(),n.hideDropdown(!0))},t[y.SELECT_ONE_TYPE]=function(){n.containerOuter.removeFocusState(),(s===n.input.element||s===n.containerOuter.element&&!n._canSearch)&&n.hideDropdown(!0)},t[y.SELECT_MULTIPLE_TYPE]=function(){s===n.input.element&&(n.containerOuter.removeFocusState(),n.hideDropdown(!0),M&&n.unhighlightAll())},t);K[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},g.prototype._onFormReset=function(){this._store.dispatch((0,O.resetTo)(this._initialState))},g.prototype._highlightChoice=function(e){var t=this;e===void 0&&(e=null);var n=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(n.length){var s=e,v=Array.from(this.dropdown.element.querySelectorAll(".".concat(this.config.classNames.highlightedState)));v.forEach(function(P){P.classList.remove(t.config.classNames.highlightedState),P.setAttribute("aria-selected","false")}),s?this._highlightPosition=n.indexOf(s):(n.length>this._highlightPosition?s=n[this._highlightPosition]:s=n[n.length-1],s||(s=n[0])),s.classList.add(this.config.classNames.highlightedState),s.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(y.EVENTS.highlightChoice,{el:s}),this.dropdown.isActive&&(this.input.setActiveDescendant(s.id),this.containerOuter.setActiveDescendant(s.id))}},g.prototype._addItem=function(e){var t=e.value,n=e.label,s=n===void 0?null:n,v=e.choiceId,P=v===void 0?-1:v,M=e.groupId,K=M===void 0?-1:M,f=e.customProperties,u=f===void 0?{}:f,C=e.placeholder,Y=C===void 0?!1:C,V=e.keyCode,U=V===void 0?-1:V,$=typeof t=="string"?t.trim():t,W=this._store.items,J=s||$,z=P||-1,ee=K>=0?this._store.getGroupById(K):null,ae=W?W.length+1:1;this.config.prependValue&&($=this.config.prependValue+$.toString()),this.config.appendValue&&($+=this.config.appendValue.toString()),this._store.dispatch((0,l.addItem)({value:$,label:J,id:ae,choiceId:z,groupId:K,customProperties:u,placeholder:Y,keyCode:U})),this._isSelectOneElement&&this.removeActiveItems(ae),this.passedElement.triggerEvent(y.EVENTS.addItem,{id:ae,value:$,label:J,customProperties:u,groupValue:ee&&ee.value?ee.value:null,keyCode:U})},g.prototype._removeItem=function(e){var t=e.id,n=e.value,s=e.label,v=e.customProperties,P=e.choiceId,M=e.groupId,K=M&&M>=0?this._store.getGroupById(M):null;!t||!P||(this._store.dispatch((0,l.removeItem)(t,P)),this.passedElement.triggerEvent(y.EVENTS.removeItem,{id:t,value:n,label:s,customProperties:v,groupValue:K&&K.value?K.value:null}))},g.prototype._addChoice=function(e){var t=e.value,n=e.label,s=n===void 0?null:n,v=e.isSelected,P=v===void 0?!1:v,M=e.isDisabled,K=M===void 0?!1:M,f=e.groupId,u=f===void 0?-1:f,C=e.customProperties,Y=C===void 0?{}:C,V=e.placeholder,U=V===void 0?!1:V,$=e.keyCode,W=$===void 0?-1:$;if(!(typeof t>"u"||t===null)){var J=this._store.choices,z=s||t,ee=J?J.length+1:1,ae="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(ee);this._store.dispatch((0,r.addChoice)({id:ee,groupId:u,elementId:ae,value:t,label:z,disabled:K,customProperties:Y,placeholder:U,keyCode:W})),P&&this._addItem({value:t,label:z,choiceId:ee,customProperties:Y,placeholder:U,keyCode:W})}},g.prototype._addGroup=function(e){var t=this,n=e.group,s=e.id,v=e.valueKey,P=v===void 0?"value":v,M=e.labelKey,K=M===void 0?"label":M,f=(0,k.isType)("Object",n)?n.choices:Array.from(n.getElementsByTagName("OPTION")),u=s||Math.floor(new Date().valueOf()*Math.random()),C=n.disabled?n.disabled:!1;if(f){this._store.dispatch((0,c.addGroup)({value:n.label,id:u,active:!0,disabled:C}));var Y=function(V){var U=V.disabled||V.parentNode&&V.parentNode.disabled;t._addChoice({value:V[P],label:(0,k.isType)("Object",V)?V[K]:V.innerHTML,isSelected:V.selected,isDisabled:U,groupId:u,customProperties:V.customProperties,placeholder:V.placeholder})};f.forEach(Y)}else this._store.dispatch((0,c.addGroup)({value:n.label,id:n.id,active:!1,disabled:n.disabled}))},g.prototype._getTemplate=function(e){for(var t,n=[],s=1;s0?this.element.scrollTop+y-O:a.offsetTop;requestAnimationFrame(function(){c._animateScroll(D,r)})}},d.prototype._scrollDown=function(a,r,c){var l=(c-a)/r,O=l>1?l:1;this.element.scrollTop=a+O},d.prototype._scrollUp=function(a,r,c){var l=(a-c)/r,O=l>1?l:1;this.element.scrollTop=a-O},d.prototype._animateScroll=function(a,r){var c=this,l=_.SCROLLING_SPEED,O=this.element.scrollTop,L=!1;r>0?(this._scrollDown(O,l,a),Oa&&(L=!0)),L&&requestAnimationFrame(function(){c._animateScroll(a,r)})},d}();i.default=h},730:function(j,i,b){Object.defineProperty(i,"__esModule",{value:!0});var _=b(799),h=function(){function d(a){var r=a.element,c=a.classNames;if(this.element=r,this.classNames=c,!(r instanceof HTMLInputElement)&&!(r instanceof HTMLSelectElement))throw new TypeError("Invalid element passed");this.isDisabled=!1}return Object.defineProperty(d.prototype,"isActive",{get:function(){return this.element.dataset.choice==="active"},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"value",{get:function(){return this.element.value},set:function(a){this.element.value=a},enumerable:!1,configurable:!0}),d.prototype.conceal=function(){this.element.classList.add(this.classNames.input),this.element.hidden=!0,this.element.tabIndex=-1;var a=this.element.getAttribute("style");a&&this.element.setAttribute("data-choice-orig-style",a),this.element.setAttribute("data-choice","active")},d.prototype.reveal=function(){this.element.classList.remove(this.classNames.input),this.element.hidden=!1,this.element.removeAttribute("tabindex");var a=this.element.getAttribute("data-choice-orig-style");a?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",a)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},d.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},d.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},d.prototype.triggerEvent=function(a,r){(0,_.dispatchEvent)(this.element,a,r)},d}();i.default=h},541:function(j,i,b){var _=this&&this.__extends||function(){var r=function(c,l){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,L){O.__proto__=L}||function(O,L){for(var y in L)Object.prototype.hasOwnProperty.call(L,y)&&(O[y]=L[y])},r(c,l)};return function(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");r(c,l);function O(){this.constructor=c}c.prototype=l===null?Object.create(l):(O.prototype=l.prototype,new O)}}(),h=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:!0});var d=h(b(730)),a=function(r){_(c,r);function c(l){var O=l.element,L=l.classNames,y=l.delimiter,D=r.call(this,{element:O,classNames:L})||this;return D.delimiter=y,D}return Object.defineProperty(c.prototype,"value",{get:function(){return this.element.value},set:function(l){this.element.setAttribute("value",l),this.element.value=l},enumerable:!1,configurable:!0}),c}(d.default);i.default=a},982:function(j,i,b){var _=this&&this.__extends||function(){var r=function(c,l){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,L){O.__proto__=L}||function(O,L){for(var y in L)Object.prototype.hasOwnProperty.call(L,y)&&(O[y]=L[y])},r(c,l)};return function(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");r(c,l);function O(){this.constructor=c}c.prototype=l===null?Object.create(l):(O.prototype=l.prototype,new O)}}(),h=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(i,"__esModule",{value:!0});var d=h(b(730)),a=function(r){_(c,r);function c(l){var O=l.element,L=l.classNames,y=l.template,D=r.call(this,{element:O,classNames:L})||this;return D.template=y,D}return Object.defineProperty(c.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"optionGroups",{get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"options",{get:function(){return Array.from(this.element.options)},set:function(l){var O=this,L=document.createDocumentFragment(),y=function(D){var k=O.template(D);L.appendChild(k)};l.forEach(function(D){return y(D)}),this.appendDocFragment(L)},enumerable:!1,configurable:!0}),c.prototype.appendDocFragment=function(l){this.element.innerHTML="",this.element.appendChild(l)},c}(d.default);i.default=a},883:function(j,i){Object.defineProperty(i,"__esModule",{value:!0}),i.SCROLLING_SPEED=i.SELECT_MULTIPLE_TYPE=i.SELECT_ONE_TYPE=i.TEXT_TYPE=i.KEY_CODES=i.ACTION_TYPES=i.EVENTS=void 0,i.EVENTS={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice",unhighlightItem:"unhighlightItem"},i.ACTION_TYPES={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL",RESET_TO:"RESET_TO",SET_IS_LOADING:"SET_IS_LOADING"},i.KEY_CODES={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},i.TEXT_TYPE="text",i.SELECT_ONE_TYPE="select-one",i.SELECT_MULTIPLE_TYPE="select-multiple",i.SCROLLING_SPEED=4},789:function(j,i,b){Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CONFIG=i.DEFAULT_CLASSNAMES=void 0;var _=b(799);i.DEFAULT_CLASSNAMES={containerOuter:"choices",containerInner:"choices__inner",input:"choices__input",inputCloned:"choices__input--cloned",list:"choices__list",listItems:"choices__list--multiple",listSingle:"choices__list--single",listDropdown:"choices__list--dropdown",item:"choices__item",itemSelectable:"choices__item--selectable",itemDisabled:"choices__item--disabled",itemChoice:"choices__item--choice",placeholder:"choices__placeholder",group:"choices__group",groupHeading:"choices__heading",button:"choices__button",activeState:"is-active",focusState:"is-focused",openState:"is-open",disabledState:"is-disabled",highlightedState:"is-highlighted",selectedState:"is-selected",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"},i.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,allowHTML:!0,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:_.sortByAlpha,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(h){return'Press Enter to add "'.concat((0,_.sanitise)(h),'"')},maxItemText:function(h){return"Only ".concat(h," values can be added")},valueComparer:function(h,d){return h===d},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:i.DEFAULT_CLASSNAMES}},18:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},978:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},948:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},359:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},285:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},533:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},187:function(j,i,b){var _=this&&this.__createBinding||(Object.create?function(d,a,r,c){c===void 0&&(c=r);var l=Object.getOwnPropertyDescriptor(a,r);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(d,c,l)}:function(d,a,r,c){c===void 0&&(c=r),d[c]=a[r]}),h=this&&this.__exportStar||function(d,a){for(var r in d)r!=="default"&&!Object.prototype.hasOwnProperty.call(a,r)&&_(a,d,r)};Object.defineProperty(i,"__esModule",{value:!0}),h(b(18),i),h(b(978),i),h(b(948),i),h(b(359),i),h(b(285),i),h(b(533),i),h(b(287),i),h(b(132),i),h(b(837),i),h(b(598),i),h(b(369),i),h(b(37),i),h(b(47),i),h(b(923),i),h(b(876),i)},287:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},132:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},837:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},598:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},37:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},369:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},47:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},923:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},876:function(j,i){Object.defineProperty(i,"__esModule",{value:!0})},799:function(j,i){Object.defineProperty(i,"__esModule",{value:!0}),i.parseCustomProperties=i.diff=i.cloneObject=i.existsInArray=i.dispatchEvent=i.sortByScore=i.sortByAlpha=i.strToEl=i.sanitise=i.isScrolledIntoView=i.getAdjacentEl=i.wrap=i.isType=i.getType=i.generateId=i.generateChars=i.getRandomNumber=void 0;var b=function(E,w){return Math.floor(Math.random()*(w-E)+E)};i.getRandomNumber=b;var _=function(E){return Array.from({length:E},function(){return(0,i.getRandomNumber)(0,36).toString(36)}).join("")};i.generateChars=_;var h=function(E,w){var N=E.id||E.name&&"".concat(E.name,"-").concat((0,i.generateChars)(2))||(0,i.generateChars)(4);return N=N.replace(/(:|\.|\[|\]|,)/g,""),N="".concat(w,"-").concat(N),N};i.generateId=h;var d=function(E){return Object.prototype.toString.call(E).slice(8,-1)};i.getType=d;var a=function(E,w){return w!=null&&(0,i.getType)(w)===E};i.isType=a;var r=function(E,w){return w===void 0&&(w=document.createElement("div")),E.parentNode&&(E.nextSibling?E.parentNode.insertBefore(w,E.nextSibling):E.parentNode.appendChild(w)),w.appendChild(E)};i.wrap=r;var c=function(E,w,N){N===void 0&&(N=1);for(var g="".concat(N>0?"next":"previous","ElementSibling"),e=E[g];e;){if(e.matches(w))return e;e=e[g]}return e};i.getAdjacentEl=c;var l=function(E,w,N){if(N===void 0&&(N=1),!E)return!1;var g;return N>0?g=w.scrollTop+w.offsetHeight>=E.offsetTop+E.offsetHeight:g=E.offsetTop>=w.scrollTop,g};i.isScrolledIntoView=l;var O=function(E){return typeof E!="string"?E:E.replace(/&/g,"&").replace(/>/g,">").replace(/-1?h.map(function(y){var D=y;return D.id===parseInt("".concat(c.choiceId),10)&&(D.selected=!0),D}):h}case"REMOVE_ITEM":{var l=d;return l.choiceId&&l.choiceId>-1?h.map(function(y){var D=y;return D.id===parseInt("".concat(l.choiceId),10)&&(D.selected=!1),D}):h}case"FILTER_CHOICES":{var O=d;return h.map(function(y){var D=y;return D.active=O.results.some(function(k){var Q=k.item,Z=k.score;return Q.id===D.id?(D.score=Z,!0):!1}),D})}case"ACTIVATE_CHOICES":{var L=d;return h.map(function(y){var D=y;return D.active=L.active,D})}case"CLEAR_CHOICES":return i.defaultState;default:return h}}i.default=_},871:function(j,i){var b=this&&this.__spreadArray||function(h,d,a){if(a||arguments.length===2)for(var r=0,c=d.length,l;r0?"treeitem":"option"),Object.assign(t.dataset,{choice:"",id:Q,value:Z,selectText:d}),N?(t.classList.add(D),t.dataset.choiceDisabled="",t.setAttribute("aria-disabled","true")):(t.classList.add(L),t.dataset.choiceSelectable=""),t},input:function(_,h){var d=_.classNames,a=d.input,r=d.inputCloned,c=Object.assign(document.createElement("input"),{type:"search",name:"search_terms",className:"".concat(a," ").concat(r),autocomplete:"off",autocapitalize:"off",spellcheck:!1});return c.setAttribute("role","textbox"),c.setAttribute("aria-autocomplete","list"),c.setAttribute("aria-label",h),c},dropdown:function(_){var h=_.classNames,d=h.list,a=h.listDropdown,r=document.createElement("div");return r.classList.add(d,a),r.setAttribute("aria-expanded","false"),r},notice:function(_,h,d){var a,r=_.allowHTML,c=_.classNames,l=c.item,O=c.itemChoice,L=c.noResults,y=c.noChoices;d===void 0&&(d="");var D=[l,O];return d==="no-choices"?D.push(y):d==="no-results"&&D.push(L),Object.assign(document.createElement("div"),(a={},a[r?"innerHTML":"innerText"]=h,a.className=D.join(" "),a))},option:function(_){var h=_.label,d=_.value,a=_.customProperties,r=_.active,c=_.disabled,l=new Option(h,d,!1,r);return a&&(l.dataset.customProperties="".concat(a)),l.disabled=!!c,l}};i.default=b},996:function(j){var i=function(w){return b(w)&&!_(w)};function b(E){return!!E&&typeof E=="object"}function _(E){var w=Object.prototype.toString.call(E);return w==="[object RegExp]"||w==="[object Date]"||a(E)}var h=typeof Symbol=="function"&&Symbol.for,d=h?Symbol.for("react.element"):60103;function a(E){return E.$$typeof===d}function r(E){return Array.isArray(E)?[]:{}}function c(E,w){return w.clone!==!1&&w.isMergeableObject(E)?Z(r(E),E,w):E}function l(E,w,N){return E.concat(w).map(function(g){return c(g,N)})}function O(E,w){if(!w.customMerge)return Z;var N=w.customMerge(E);return typeof N=="function"?N:Z}function L(E){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(E).filter(function(w){return E.propertyIsEnumerable(w)}):[]}function y(E){return Object.keys(E).concat(L(E))}function D(E,w){try{return w in E}catch{return!1}}function k(E,w){return D(E,w)&&!(Object.hasOwnProperty.call(E,w)&&Object.propertyIsEnumerable.call(E,w))}function Q(E,w,N){var g={};return N.isMergeableObject(E)&&y(E).forEach(function(e){g[e]=c(E[e],N)}),y(w).forEach(function(e){k(E,e)||(D(E,e)&&N.isMergeableObject(w[e])?g[e]=O(e,N)(E[e],w[e],N):g[e]=c(w[e],N))}),g}function Z(E,w,N){N=N||{},N.arrayMerge=N.arrayMerge||l,N.isMergeableObject=N.isMergeableObject||i,N.cloneUnlessOtherwiseSpecified=c;var g=Array.isArray(w),e=Array.isArray(E),t=g===e;return t?g?N.arrayMerge(E,w,N):Q(E,w,N):c(w,N)}Z.all=function(w,N){if(!Array.isArray(w))throw new Error("first argument should be an array");return w.reduce(function(g,e){return Z(g,e,N)},{})};var ne=Z;j.exports=ne},221:function(j,i,b){b.r(i),b.d(i,{default:function(){return Se}});function _(p){return Array.isArray?Array.isArray(p):k(p)==="[object Array]"}let h=1/0;function d(p){if(typeof p=="string")return p;let o=p+"";return o=="0"&&1/p==-h?"-0":o}function a(p){return p==null?"":d(p)}function r(p){return typeof p=="string"}function c(p){return typeof p=="number"}function l(p){return p===!0||p===!1||L(p)&&k(p)=="[object Boolean]"}function O(p){return typeof p=="object"}function L(p){return O(p)&&p!==null}function y(p){return p!=null}function D(p){return!p.trim().length}function k(p){return p==null?p===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(p)}let Q="Extended search is not available",Z="Incorrect 'index' type",ne=p=>`Invalid value for key ${p}`,E=p=>`Pattern length exceeds max of ${p}.`,w=p=>`Missing ${p} property in key`,N=p=>`Property 'weight' in key '${p}' must be a positive integer`,g=Object.prototype.hasOwnProperty;class e{constructor(o){this._keys=[],this._keyMap={};let m=0;o.forEach(S=>{let I=t(S);m+=I.weight,this._keys.push(I),this._keyMap[I.id]=I,m+=I.weight}),this._keys.forEach(S=>{S.weight/=m})}get(o){return this._keyMap[o]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function t(p){let o=null,m=null,S=null,I=1,T=null;if(r(p)||_(p))S=p,o=n(p),m=s(p);else{if(!g.call(p,"name"))throw new Error(w("name"));let A=p.name;if(S=A,g.call(p,"weight")&&(I=p.weight,I<=0))throw new Error(N(A));o=n(A),m=s(A),T=p.getFn}return{path:o,id:m,weight:I,src:S,getFn:T}}function n(p){return _(p)?p:p.split(".")}function s(p){return _(p)?p.join("."):p}function v(p,o){let m=[],S=!1,I=(T,A,R)=>{if(y(T))if(!A[R])m.push(T);else{let F=A[R],H=T[F];if(!y(H))return;if(R===A.length-1&&(r(H)||c(H)||l(H)))m.push(a(H));else if(_(H)){S=!0;for(let B=0,x=H.length;Bp.score===o.score?p.idx{this._keysMap[m.id]=S})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,r(this.docs[0])?this.docs.forEach((o,m)=>{this._addString(o,m)}):this.docs.forEach((o,m)=>{this._addObject(o,m)}),this.norm.clear())}add(o){let m=this.size();r(o)?this._addString(o,m):this._addObject(o,m)}removeAt(o){this.records.splice(o,1);for(let m=o,S=this.size();m{let A=I.getFn?I.getFn(o):this.getFn(o,I.path);if(y(A)){if(_(A)){let R=[],F=[{nestedArrIndex:-1,value:A}];for(;F.length;){let{nestedArrIndex:H,value:B}=F.pop();if(y(B))if(r(B)&&!D(B)){let x={v:B,i:H,n:this.norm.get(B)};R.push(x)}else _(B)&&B.forEach((x,G)=>{F.push({nestedArrIndex:G,value:x})})}S.$[T]=R}else if(r(A)&&!D(A)){let R={v:A,n:this.norm.get(A)};S.$[T]=R}}}),this.records.push(S)}toJSON(){return{keys:this.keys,records:this.records}}}function U(p,o,{getFn:m=u.getFn,fieldNormWeight:S=u.fieldNormWeight}={}){let I=new V({getFn:m,fieldNormWeight:S});return I.setKeys(p.map(t)),I.setSources(o),I.create(),I}function $(p,{getFn:o=u.getFn,fieldNormWeight:m=u.fieldNormWeight}={}){let{keys:S,records:I}=p,T=new V({getFn:o,fieldNormWeight:m});return T.setKeys(S),T.setIndexRecords(I),T}function W(p,{errors:o=0,currentLocation:m=0,expectedLocation:S=0,distance:I=u.distance,ignoreLocation:T=u.ignoreLocation}={}){let A=o/p.length;if(T)return A;let R=Math.abs(S-m);return I?A+R/I:R?1:A}function J(p=[],o=u.minMatchCharLength){let m=[],S=-1,I=-1,T=0;for(let A=p.length;T=o&&m.push([S,I]),S=-1)}return p[T-1]&&T-S>=o&&m.push([S,T-1]),m}let z=32;function ee(p,o,m,{location:S=u.location,distance:I=u.distance,threshold:T=u.threshold,findAllMatches:A=u.findAllMatches,minMatchCharLength:R=u.minMatchCharLength,includeMatches:F=u.includeMatches,ignoreLocation:H=u.ignoreLocation}={}){if(o.length>z)throw new Error(E(z));let B=o.length,x=p.length,G=Math.max(0,Math.min(S,x)),q=T,re=G,ue=R>1||F,Ee=ue?Array(x):[],ve;for(;(ve=p.indexOf(o,re))>-1;){let he=W(o,{currentLocation:ve,expectedLocation:G,distance:I,ignoreLocation:H});if(q=Math.min(he,q),re=ve+B,ue){let ge=0;for(;ge=Ue;fe-=1){let Le=fe-1,We=m[p.charAt(Le)];if(ue&&(Ee[Le]=+!!We),Oe[fe]=(Oe[fe+1]<<1|1)&We,he&&(Oe[fe]|=(Ie[fe+1]|Ie[fe])<<1|1|Ie[fe+1]),Oe[fe]&at&&(be=W(o,{errors:he,currentLocation:Le,expectedLocation:G,distance:I,ignoreLocation:H}),be<=q)){if(q=be,re=Le,re<=G)break;Ue=Math.max(1,2*G-re)}}if(W(o,{errors:he+1,currentLocation:G,expectedLocation:G,distance:I,ignoreLocation:H})>q)break;Ie=Oe}let Ke={isMatch:re>=0,score:Math.max(.001,be)};if(ue){let he=J(Ee,R);he.length?F&&(Ke.indices=he):Ke.isMatch=!1}return Ke}function ae(p){let o={};for(let m=0,S=p.length;m{this.chunks.push({pattern:G,alphabet:ae(G),startIndex:q})},x=this.pattern.length;if(x>z){let G=0,q=x%z,re=x-q;for(;G{let{isMatch:ve,score:Ie,indices:be}=ee(o,re,ue,{location:I+Ee,distance:T,threshold:A,findAllMatches:R,minMatchCharLength:F,includeMatches:S,ignoreLocation:H});ve&&(G=!0),x+=Ie,ve&&be&&(B=[...B,...be])});let q={isMatch:G,score:G?x/this.chunks.length:1};return G&&S&&(q.indices=B),q}}class le{constructor(o){this.pattern=o}static isMultiMatch(o){return _e(o,this.multiRegex)}static isSingleMatch(o){return _e(o,this.singleRegex)}search(){}}function _e(p,o){let m=p.match(o);return m?m[1]:null}class te extends le{constructor(o){super(o)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(o){let m=o===this.pattern;return{isMatch:m,score:m?0:1,indices:[0,this.pattern.length-1]}}}class de extends le{constructor(o){super(o)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(o){let S=o.indexOf(this.pattern)===-1;return{isMatch:S,score:S?0:1,indices:[0,o.length-1]}}}class pe extends le{constructor(o){super(o)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(o){let m=o.startsWith(this.pattern);return{isMatch:m,score:m?0:1,indices:[0,this.pattern.length-1]}}}class oe extends le{constructor(o){super(o)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(o){let m=!o.startsWith(this.pattern);return{isMatch:m,score:m?0:1,indices:[0,o.length-1]}}}class Te extends le{constructor(o){super(o)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(o){let m=o.endsWith(this.pattern);return{isMatch:m,score:m?0:1,indices:[o.length-this.pattern.length,o.length-1]}}}class Pe extends le{constructor(o){super(o)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(o){let m=!o.endsWith(this.pattern);return{isMatch:m,score:m?0:1,indices:[0,o.length-1]}}}class He extends le{constructor(o,{location:m=u.location,threshold:S=u.threshold,distance:I=u.distance,includeMatches:T=u.includeMatches,findAllMatches:A=u.findAllMatches,minMatchCharLength:R=u.minMatchCharLength,isCaseSensitive:F=u.isCaseSensitive,ignoreLocation:H=u.ignoreLocation}={}){super(o),this._bitapSearch=new ce(o,{location:m,threshold:S,distance:I,includeMatches:T,findAllMatches:A,minMatchCharLength:R,isCaseSensitive:F,ignoreLocation:H})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(o){return this._bitapSearch.searchIn(o)}}class Be extends le{constructor(o){super(o)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(o){let m=0,S,I=[],T=this.pattern.length;for(;(S=o.indexOf(this.pattern,m))>-1;)m=S+T,I.push([S,m-1]);let A=!!I.length;return{isMatch:A,score:A?0:1,indices:I}}}let Me=[te,Be,pe,oe,Pe,Te,de,He],Ve=Me.length,Xe=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Je="|";function Qe(p,o={}){return p.split(Je).map(m=>{let S=m.trim().split(Xe).filter(T=>T&&!!T.trim()),I=[];for(let T=0,A=S.length;T!!(p[Ce.AND]||p[Ce.OR]),tt=p=>!!p[je.PATH],it=p=>!_(p)&&O(p)&&!Re(p),ke=p=>({[Ce.AND]:Object.keys(p).map(o=>({[o]:p[o]}))});function xe(p,o,{auto:m=!0}={}){let S=I=>{let T=Object.keys(I),A=tt(I);if(!A&&T.length>1&&!Re(I))return S(ke(I));if(it(I)){let F=A?I[je.PATH]:T[0],H=A?I[je.PATTERN]:I[F];if(!r(H))throw new Error(ne(F));let B={keyId:s(F),pattern:H};return m&&(B.searcher=Ne(H,o)),B}let R={children:[],operator:T[0]};return T.forEach(F=>{let H=I[F];_(H)&&H.forEach(B=>{R.children.push(S(B))})}),R};return Re(p)||(p=ke(p)),S(p)}function nt(p,{ignoreFieldNorm:o=u.ignoreFieldNorm}){p.forEach(m=>{let S=1;m.matches.forEach(({key:I,norm:T,score:A})=>{let R=I?I.weight:null;S*=Math.pow(A===0&&R?Number.EPSILON:A,(R||1)*(o?1:T))}),m.score=S})}function rt(p,o){let m=p.matches;o.matches=[],y(m)&&m.forEach(S=>{if(!y(S.indices)||!S.indices.length)return;let{indices:I,value:T}=S,A={indices:I,value:T};S.key&&(A.key=S.key.src),S.idx>-1&&(A.refIndex=S.idx),o.matches.push(A)})}function st(p,o){o.score=p.score}function ot(p,o,{includeMatches:m=u.includeMatches,includeScore:S=u.includeScore}={}){let I=[];return m&&I.push(rt),S&&I.push(st),p.map(T=>{let{idx:A}=T,R={item:o[A],refIndex:A};return I.length&&I.forEach(F=>{F(T,R)}),R})}class Se{constructor(o,m={},S){this.options={...u,...m},this.options.useExtendedSearch,this._keyStore=new e(this.options.keys),this.setCollection(o,S)}setCollection(o,m){if(this._docs=o,m&&!(m instanceof V))throw new Error(Z);this._myIndex=m||U(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(o){y(o)&&(this._docs.push(o),this._myIndex.add(o))}remove(o=()=>!1){let m=[];for(let S=0,I=this._docs.length;S-1&&(F=F.slice(0,m)),ot(F,this._docs,{includeMatches:S,includeScore:I})}_searchStringList(o){let m=Ne(o,this.options),{records:S}=this._myIndex,I=[];return S.forEach(({v:T,i:A,n:R})=>{if(!y(T))return;let{isMatch:F,score:H,indices:B}=m.searchIn(T);F&&I.push({item:T,idx:A,matches:[{score:H,value:T,norm:R,indices:B}]})}),I}_searchLogical(o){let m=xe(o,this.options),S=(R,F,H)=>{if(!R.children){let{keyId:x,searcher:G}=R,q=this._findMatches({key:this._keyStore.get(x),value:this._myIndex.getValueForItemAtKeyId(F,x),searcher:G});return q&&q.length?[{idx:H,item:F,matches:q}]:[]}let B=[];for(let x=0,G=R.children.length;x{if(y(R)){let H=S(m,R,F);H.length&&(T[F]||(T[F]={idx:F,item:R,matches:[]},A.push(T[F])),H.forEach(({matches:B})=>{T[F].matches.push(...B)}))}}),A}_searchObjectList(o){let m=Ne(o,this.options),{keys:S,records:I}=this._myIndex,T=[];return I.forEach(({$:A,i:R})=>{if(!y(A))return;let F=[];S.forEach((H,B)=>{F.push(...this._findMatches({key:H,value:A[B],searcher:m}))}),F.length&&T.push({idx:R,item:A,matches:F})}),T}_findMatches({key:o,value:m,searcher:S}){if(!y(m))return[];let I=[];if(_(m))m.forEach(({v:T,i:A,n:R})=>{if(!y(T))return;let{isMatch:F,score:H,indices:B}=S.searchIn(T);F&&I.push({score:H,key:o,value:T,idx:A,norm:R,indices:B})});else{let{v:T,n:A}=m,{isMatch:R,score:F,indices:H}=S.searchIn(T);R&&I.push({score:F,key:o,value:T,norm:A,indices:H})}return I}}Se.version="6.6.2",Se.createIndex=U,Se.parseIndex=$,Se.config=u,Se.parseQuery=xe,et(qe)},791:function(j,i,b){b.r(i),b.d(i,{__DO_NOT_USE__ActionTypes:function(){return y},applyMiddleware:function(){return M},bindActionCreators:function(){return v},combineReducers:function(){return n},compose:function(){return P},createStore:function(){return w},legacy_createStore:function(){return N}});function _(f){"@babel/helpers - typeof";return _=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},_(f)}function h(f,u){if(_(f)!=="object"||f===null)return f;var C=f[Symbol.toPrimitive];if(C!==void 0){var Y=C.call(f,u||"default");if(_(Y)!=="object")return Y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(f)}function d(f){var u=h(f,"string");return _(u)==="symbol"?u:String(u)}function a(f,u,C){return u=d(u),u in f?Object.defineProperty(f,u,{value:C,enumerable:!0,configurable:!0,writable:!0}):f[u]=C,f}function r(f,u){var C=Object.keys(f);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(f);u&&(Y=Y.filter(function(V){return Object.getOwnPropertyDescriptor(f,V).enumerable})),C.push.apply(C,Y)}return C}function c(f){for(var u=1;u"u"&&(C=u,u=void 0),typeof C<"u"){if(typeof C!="function")throw new Error(l(1));return C(w)(f,u)}if(typeof f!="function")throw new Error(l(2));var V=f,U=u,$=[],W=$,J=!1;function z(){W===$&&(W=$.slice())}function ee(){if(J)throw new Error(l(3));return U}function ae(te){if(typeof te!="function")throw new Error(l(4));if(J)throw new Error(l(5));var de=!0;return z(),W.push(te),function(){if(de){if(J)throw new Error(l(6));de=!1,z();var oe=W.indexOf(te);W.splice(oe,1),$=null}}}function ce(te){if(!D(te))throw new Error(l(7));if(typeof te.type>"u")throw new Error(l(8));if(J)throw new Error(l(9));try{J=!0,U=V(U,te)}finally{J=!1}for(var de=$=W,pe=0;pe0)return"Unexpected "+($.length>1?"keys":"key")+" "+('"'+$.join('", "')+'" found in '+U+". ")+"Expected to find one of the known reducer keys instead: "+('"'+V.join('", "')+'". Unexpected keys will be ignored.')}function t(f){Object.keys(f).forEach(function(u){var C=f[u],Y=C(void 0,{type:y.INIT});if(typeof Y>"u")throw new Error(l(12));if(typeof C(void 0,{type:y.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(l(13))})}function n(f){for(var u=Object.keys(f),C={},Y=0;Y"u"){var Te=ee&&ee.type;throw new Error(l(14))}le[te]=oe,ce=ce||oe!==pe}return ce=ce||U.length!==Object.keys(z).length,ce?le:z}}function s(f,u){return function(){return u(f.apply(this,arguments))}}function v(f,u){if(typeof f=="function")return s(f,u);if(typeof f!="object"||f===null)throw new Error(l(16));var C={};for(var Y in f){var V=f[Y];typeof V=="function"&&(C[Y]=s(V,u))}return C}function P(){for(var f=arguments.length,u=new Array(f),C=0;Cwindow.pluralize(O,e,{count:e}),noChoicesText:E,noResultsText:L,placeholderValue:k,position:Q??"auto",removeItemButton:se,renderChoiceLimit:D,searchEnabled:h,searchFields:w??["label"],searchPlaceholderValue:E,searchResultLimit:D,shouldSort:!1,searchFloor:a?0:1}),await this.refreshChoices({withInitialOptions:!0}),[null,void 0,""].includes(this.state)||this.select.setChoiceByValue(this.formatState(this.state)),this.refreshPlaceholder(),b&&this.select.showDropdown(),this.$refs.input.addEventListener("change",()=>{this.refreshPlaceholder(),!this.isStateBeingUpdated&&(this.isStateBeingUpdated=!0,this.state=this.select.getValue(!0)??null,this.$nextTick(()=>this.isStateBeingUpdated=!1))}),d&&this.$refs.input.addEventListener("showDropdown",async()=>{this.select.clearChoices(),await this.select.setChoices([{label:c,value:"",disabled:!0}]),await this.refreshChoices()}),a&&(this.$refs.input.addEventListener("search",async e=>{let t=e.detail.value?.trim();this.isSearching=!0,this.select.clearChoices(),await this.select.setChoices([{label:[null,void 0,""].includes(t)?c:ne,value:"",disabled:!0}])}),this.$refs.input.addEventListener("search",Alpine.debounce(async e=>{await this.refreshChoices({search:e.detail.value?.trim()}),this.isSearching=!1},Z))),_||window.addEventListener("filament-forms::select.refreshSelectedOptionLabel",async e=>{e.detail.livewireId===r&&e.detail.statePath===g&&await this.refreshChoices({withInitialOptions:!1})}),this.$watch("state",async()=>{this.select&&(this.refreshPlaceholder(),!this.isStateBeingUpdated&&await this.refreshChoices({withInitialOptions:!d}))})},destroy:function(){this.select.destroy(),this.select=null},refreshChoices:async function(e={}){let t=await this.getChoices(e);this.select&&(this.select.clearStore(),this.refreshPlaceholder(),this.setChoices(t),[null,void 0,""].includes(this.state)||this.select.setChoiceByValue(this.formatState(this.state)))},setChoices:function(e){this.select.setChoices(e,"value","label",!0)},getChoices:async function(e={}){let t=await this.getExistingOptions(e);return t.concat(await this.getMissingOptions(t))},getExistingOptions:async function({search:e,withInitialOptions:t}){if(t)return y;let n=[];return e!==""&&e!==null&&e!==void 0?n=await i(e):n=await j(),n.map(s=>s.choices?(s.choices=s.choices.map(v=>(v.selected=Array.isArray(this.state)?this.state.includes(v.value):this.state===v.value,v)),s):(s.selected=Array.isArray(this.state)?this.state.includes(s.value):this.state===s.value,s))},refreshPlaceholder:function(){_||(this.select._renderItems(),[null,void 0,""].includes(this.state)&&(this.$el.querySelector(".choices__list--single").innerHTML=`
${k??""}
`))},formatState:function(e){return _?(e??[]).map(t=>t?.toString()):e?.toString()},getMissingOptions:async function(e){let t=this.formatState(this.state);if([null,void 0,"",[],{}].includes(t))return{};let n=new Set;return e.forEach(s=>{if(s.choices){s.choices.forEach(v=>n.add(v.value));return}n.add(s.value)}),_?t.every(s=>n.has(s))?{}:(await me()).filter(s=>!n.has(s.value)).map(s=>(s.selected=!0,s)):n.has(t)?n:[{label:await X(),value:t,selected:!0}]}}}export{vt as default}; +/*! Bundled license information: + +choices.js/public/assets/scripts/choices.js: + (*! choices.js v10.2.0 | © 2022 Josh Johnson | https://github.com/jshjohnson/Choices#readme *) +*/ diff --git a/public/js/filament/forms/components/tags-input.js b/public/js/filament/forms/components/tags-input.js new file mode 100644 index 00000000..6a2aa300 --- /dev/null +++ b/public/js/filament/forms/components/tags-input.js @@ -0,0 +1 @@ +function i({state:a,splitKeys:n}){return{newTag:"",state:a,createTag:function(){if(this.newTag=this.newTag.trim(),this.newTag!==""){if(this.state.includes(this.newTag)){this.newTag="";return}this.state.push(this.newTag),this.newTag=""}},deleteTag:function(t){this.state=this.state.filter(e=>e!==t)},reorderTags:function(t){let e=this.state.splice(t.oldIndex,1)[0];this.state.splice(t.newIndex,0,e),this.state=[...this.state]},input:{"x-on:blur":"createTag()","x-model":"newTag","x-on:keydown"(t){["Enter",...n].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.createTag())},"x-on:paste"(){this.$nextTick(()=>{if(n.length===0){this.createTag();return}let t=n.map(e=>e.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")).join("|");this.newTag.split(new RegExp(t,"g")).forEach(e=>{this.newTag=e,this.createTag()})})}}}}export{i as default}; diff --git a/public/js/filament/forms/components/textarea.js b/public/js/filament/forms/components/textarea.js new file mode 100644 index 00000000..4fda241a --- /dev/null +++ b/public/js/filament/forms/components/textarea.js @@ -0,0 +1 @@ +function r({initialHeight:t,shouldAutosize:i,state:s}){return{state:s,wrapperEl:null,init:function(){this.wrapperEl=this.$el.parentNode,this.setInitialHeight(),i?this.$watch("state",()=>{this.resize()}):this.setUpResizeObserver()},setInitialHeight:function(){this.$el.scrollHeight<=0||(this.wrapperEl.style.height=t+"rem")},resize:function(){if(this.setInitialHeight(),this.$el.scrollHeight<=0)return;let e=this.$el.scrollHeight+"px";this.wrapperEl.style.height!==e&&(this.wrapperEl.style.height=e)},setUpResizeObserver:function(){new ResizeObserver(()=>{this.wrapperEl.style.height=this.$el.style.height}).observe(this.$el)}}}export{r as default}; diff --git a/public/js/filament/notifications/notifications.js b/public/js/filament/notifications/notifications.js new file mode 100644 index 00000000..7ce30631 --- /dev/null +++ b/public/js/filament/notifications/notifications.js @@ -0,0 +1 @@ +(()=>{var O=Object.create;var N=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var d=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var j=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Y(t))!W.call(i,n)&&n!==e&&N(i,n,{get:()=>t[n],enumerable:!(s=V(t,n))||s.enumerable});return i};var J=(i,t,e)=>(e=i!=null?O(H(i)):{},j(t||!i||!i.__esModule?N(e,"default",{value:i,enumerable:!0}):e,i));var S=d((ut,_)=>{var v,g=typeof global<"u"&&(global.crypto||global.msCrypto);g&&g.getRandomValues&&(y=new Uint8Array(16),v=function(){return g.getRandomValues(y),y});var y;v||(T=new Array(16),v=function(){for(var i=0,t;i<16;i++)(i&3)===0&&(t=Math.random()*4294967296),T[i]=t>>>((i&3)<<3)&255;return T});var T;_.exports=v});var C=d((ct,U)=>{var P=[];for(f=0;f<256;++f)P[f]=(f+256).toString(16).substr(1);var f;function K(i,t){var e=t||0,s=P;return s[i[e++]]+s[i[e++]]+s[i[e++]]+s[i[e++]]+"-"+s[i[e++]]+s[i[e++]]+"-"+s[i[e++]]+s[i[e++]]+"-"+s[i[e++]]+s[i[e++]]+"-"+s[i[e++]]+s[i[e++]]+s[i[e++]]+s[i[e++]]+s[i[e++]]+s[i[e++]]}U.exports=K});var R=d((lt,b)=>{var Q=S(),X=C(),a=Q(),Z=[a[0]|1,a[1],a[2],a[3],a[4],a[5]],F=(a[6]<<8|a[7])&16383,D=0,A=0;function tt(i,t,e){var s=t&&e||0,n=t||[];i=i||{};var r=i.clockseq!==void 0?i.clockseq:F,o=i.msecs!==void 0?i.msecs:new Date().getTime(),h=i.nsecs!==void 0?i.nsecs:A+1,l=o-D+(h-A)/1e4;if(l<0&&i.clockseq===void 0&&(r=r+1&16383),(l<0||o>D)&&i.nsecs===void 0&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");D=o,A=h,F=r,o+=122192928e5;var c=((o&268435455)*1e4+h)%4294967296;n[s++]=c>>>24&255,n[s++]=c>>>16&255,n[s++]=c>>>8&255,n[s++]=c&255;var u=o/4294967296*1e4&268435455;n[s++]=u>>>8&255,n[s++]=u&255,n[s++]=u>>>24&15|16,n[s++]=u>>>16&255,n[s++]=r>>>8|128,n[s++]=r&255;for(var $=i.node||Z,m=0;m<6;++m)n[s+m]=$[m];return t||X(n)}b.exports=tt});var I=d((dt,G)=>{var it=S(),et=C();function st(i,t,e){var s=t&&e||0;typeof i=="string"&&(t=i=="binary"?new Array(16):null,i=null),i=i||{};var n=i.random||(i.rng||it)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t)for(var r=0;r<16;++r)t[s+r]=n[r];return t||et(n)}G.exports=st});var z=d((ft,M)=>{var nt=R(),L=I(),E=L;E.v1=nt;E.v4=L;M.exports=E});function k(i,t=()=>{}){let e=!1;return function(){e?t.apply(this,arguments):(e=!0,i.apply(this,arguments))}}var q=i=>{i.data("notificationComponent",({notification:t})=>({isShown:!1,computedStyle:null,transitionDuration:null,transitionEasing:null,init:function(){this.computedStyle=window.getComputedStyle(this.$el),this.transitionDuration=parseFloat(this.computedStyle.transitionDuration)*1e3,this.transitionEasing=this.computedStyle.transitionTimingFunction,this.configureTransitions(),this.configureAnimations(),t.duration&&t.duration!=="persistent"&&setTimeout(()=>{if(!this.$el.matches(":hover")){this.close();return}this.$el.addEventListener("mouseleave",()=>this.close())},t.duration),this.isShown=!0},configureTransitions:function(){let e=this.computedStyle.display,s=()=>{i.mutateDom(()=>{this.$el.style.setProperty("display",e),this.$el.style.setProperty("visibility","visible")}),this.$el._x_isShown=!0},n=()=>{i.mutateDom(()=>{this.$el._x_isShown?this.$el.style.setProperty("visibility","hidden"):this.$el.style.setProperty("display","none")})},r=k(o=>o?s():n(),o=>{this.$el._x_toggleAndCascadeWithTransitions(this.$el,o,s,n)});i.effect(()=>r(this.isShown))},configureAnimations:function(){let e;Livewire.hook("commit",({component:s,commit:n,succeed:r,fail:o,respond:h})=>{s.snapshot.data.isFilamentNotificationsComponent&&requestAnimationFrame(()=>{let l=()=>this.$el.getBoundingClientRect().top,c=l();h(()=>{e=()=>{this.isShown&&this.$el.animate([{transform:`translateY(${c-l()}px)`},{transform:"translateY(0px)"}],{duration:this.transitionDuration,easing:this.transitionEasing})},this.$el.getAnimations().forEach(u=>u.finish())}),r(({snapshot:u,effect:$})=>{e()})})})},close:function(){this.isShown=!1,setTimeout(()=>window.dispatchEvent(new CustomEvent("notificationClosed",{detail:{id:t.id}})),this.transitionDuration)},markAsRead:function(){window.dispatchEvent(new CustomEvent("markedNotificationAsRead",{detail:{id:t.id}}))},markAsUnread:function(){window.dispatchEvent(new CustomEvent("markedNotificationAsUnread",{detail:{id:t.id}}))}}))};var B=J(z(),1),p=class{constructor(){return this.id((0,B.v4)()),this}id(t){return this.id=t,this}title(t){return this.title=t,this}body(t){return this.body=t,this}actions(t){return this.actions=t,this}status(t){return this.status=t,this}color(t){return this.color=t,this}icon(t){return this.icon=t,this}iconColor(t){return this.iconColor=t,this}duration(t){return this.duration=t,this}seconds(t){return this.duration(t*1e3),this}persistent(){return this.duration("persistent"),this}danger(){return this.status("danger"),this}info(){return this.status("info"),this}success(){return this.status("success"),this}warning(){return this.status("warning"),this}view(t){return this.view=t,this}viewData(t){return this.viewData=t,this}send(){return window.dispatchEvent(new CustomEvent("notificationSent",{detail:{notification:this}})),this}},w=class{constructor(t){return this.name(t),this}name(t){return this.name=t,this}color(t){return this.color=t,this}dispatch(t,e){return this.event(t),this.eventData(e),this}dispatchSelf(t,e){return this.dispatch(t,e),this.dispatchDirection="self",this}dispatchTo(t,e,s){return this.dispatch(e,s),this.dispatchDirection="to",this.dispatchToComponent=t,this}emit(t,e){return this.dispatch(t,e),this}emitSelf(t,e){return this.dispatchSelf(t,e),this}emitTo(t,e,s){return this.dispatchTo(t,e,s),this}dispatchDirection(t){return this.dispatchDirection=t,this}dispatchToComponent(t){return this.dispatchToComponent=t,this}event(t){return this.event=t,this}eventData(t){return this.eventData=t,this}extraAttributes(t){return this.extraAttributes=t,this}icon(t){return this.icon=t,this}iconPosition(t){return this.iconPosition=t,this}outlined(t=!0){return this.isOutlined=t,this}disabled(t=!0){return this.isDisabled=t,this}label(t){return this.label=t,this}close(t=!0){return this.shouldClose=t,this}openUrlInNewTab(t=!0){return this.shouldOpenUrlInNewTab=t,this}size(t){return this.size=t,this}url(t){return this.url=t,this}view(t){return this.view=t,this}button(){return this.view("filament-actions::button-action"),this}grouped(){return this.view("filament-actions::grouped-action"),this}link(){return this.view("filament-actions::link-action"),this}},x=class{constructor(t){return this.actions(t),this}actions(t){return this.actions=t.map(e=>e.grouped()),this}color(t){return this.color=t,this}icon(t){return this.icon=t,this}iconPosition(t){return this.iconPosition=t,this}label(t){return this.label=t,this}tooltip(t){return this.tooltip=t,this}};window.FilamentNotificationAction=w;window.FilamentNotificationActionGroup=x;window.FilamentNotification=p;document.addEventListener("alpine:init",()=>{window.Alpine.plugin(q)});})(); diff --git a/public/js/filament/support/support.js b/public/js/filament/support/support.js new file mode 100644 index 00000000..9b2b2dce --- /dev/null +++ b/public/js/filament/support/support.js @@ -0,0 +1,46 @@ +(()=>{var Vo=Object.create;var Pi=Object.defineProperty;var Yo=Object.getOwnPropertyDescriptor;var Xo=Object.getOwnPropertyNames;var qo=Object.getPrototypeOf,Go=Object.prototype.hasOwnProperty;var Jr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ko=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Xo(e))!Go.call(t,i)&&i!==r&&Pi(t,i,{get:()=>e[i],enumerable:!(n=Yo(e,i))||n.enumerable});return t};var Jo=(t,e,r)=>(r=t!=null?Vo(qo(t)):{},Ko(e||!t||!t.__esModule?Pi(r,"default",{value:t,enumerable:!0}):r,t));var po=Jr(()=>{});var ho=Jr(()=>{});var vo=Jr((js,yr)=>{(function(){"use strict";var t="input is invalid type",e="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_MD5_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",o=!n.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?n=global:i&&(n=self);var a=!n.JS_MD5_NO_COMMON_JS&&typeof yr=="object"&&yr.exports,d=typeof define=="function"&&define.amd,f=!n.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),w=[128,32768,8388608,-2147483648],m=[0,8,16,24],E=["hex","array","digest","buffer","arrayBuffer","base64"],O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),S=[],M;if(f){var I=new ArrayBuffer(68);M=new Uint8Array(I),S=new Uint32Array(I)}var $=Array.isArray;(n.JS_MD5_NO_NODE_JS||!$)&&($=function(l){return Object.prototype.toString.call(l)==="[object Array]"});var A=ArrayBuffer.isView;f&&(n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!A)&&(A=function(l){return typeof l=="object"&&l.buffer&&l.buffer.constructor===ArrayBuffer});var k=function(l){var h=typeof l;if(h==="string")return[l,!0];if(h!=="object"||l===null)throw new Error(t);if(f&&l.constructor===ArrayBuffer)return[new Uint8Array(l),!1];if(!$(l)&&!A(l))throw new Error(t);return[l,!1]},Y=function(l){return function(h){return new X(!0).update(h)[l]()}},nt=function(){var l=Y("hex");o&&(l=J(l)),l.create=function(){return new X},l.update=function(p){return l.create().update(p)};for(var h=0;h>>6,Vt[P++]=128|p&63):p<55296||p>=57344?(Vt[P++]=224|p>>>12,Vt[P++]=128|p>>>6&63,Vt[P++]=128|p&63):(p=65536+((p&1023)<<10|l.charCodeAt(++j)&1023),Vt[P++]=240|p>>>18,Vt[P++]=128|p>>>12&63,Vt[P++]=128|p>>>6&63,Vt[P++]=128|p&63);else for(P=this.start;j>>2]|=p<>>2]|=(192|p>>>6)<>>2]|=(128|p&63)<=57344?(Q[P>>>2]|=(224|p>>>12)<>>2]|=(128|p>>>6&63)<>>2]|=(128|p&63)<>>2]|=(240|p>>>18)<>>2]|=(128|p>>>12&63)<>>2]|=(128|p>>>6&63)<>>2]|=(128|p&63)<>>2]|=l[j]<=64?(this.start=P-64,this.hash(),this.hashed=!0):this.start=P}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},X.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var l=this.blocks,h=this.lastByteIndex;l[h>>>2]|=w[h&3],h>=56&&(this.hashed||this.hash(),l[0]=l[16],l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),l[14]=this.bytes<<3,l[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},X.prototype.hash=function(){var l,h,v,p,j,P,R=this.blocks;this.first?(l=R[0]-680876937,l=(l<<7|l>>>25)-271733879<<0,p=(-1732584194^l&2004318071)+R[1]-117830708,p=(p<<12|p>>>20)+l<<0,v=(-271733879^p&(l^-271733879))+R[2]-1126478375,v=(v<<17|v>>>15)+p<<0,h=(l^v&(p^l))+R[3]-1316259209,h=(h<<22|h>>>10)+v<<0):(l=this.h0,h=this.h1,v=this.h2,p=this.h3,l+=(p^h&(v^p))+R[0]-680876936,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[1]-389564586,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[2]+606105819,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[3]-1044525330,h=(h<<22|h>>>10)+v<<0),l+=(p^h&(v^p))+R[4]-176418897,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[5]+1200080426,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[6]-1473231341,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[7]-45705983,h=(h<<22|h>>>10)+v<<0,l+=(p^h&(v^p))+R[8]+1770035416,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[9]-1958414417,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[10]-42063,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[11]-1990404162,h=(h<<22|h>>>10)+v<<0,l+=(p^h&(v^p))+R[12]+1804603682,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[13]-40341101,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[14]-1502002290,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[15]+1236535329,h=(h<<22|h>>>10)+v<<0,l+=(v^p&(h^v))+R[1]-165796510,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[6]-1069501632,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[11]+643717713,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[0]-373897302,h=(h<<20|h>>>12)+v<<0,l+=(v^p&(h^v))+R[5]-701558691,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[10]+38016083,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[15]-660478335,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[4]-405537848,h=(h<<20|h>>>12)+v<<0,l+=(v^p&(h^v))+R[9]+568446438,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[14]-1019803690,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[3]-187363961,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[8]+1163531501,h=(h<<20|h>>>12)+v<<0,l+=(v^p&(h^v))+R[13]-1444681467,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[2]-51403784,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[7]+1735328473,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[12]-1926607734,h=(h<<20|h>>>12)+v<<0,j=h^v,l+=(j^p)+R[5]-378558,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[8]-2022574463,p=(p<<11|p>>>21)+l<<0,P=p^l,v+=(P^h)+R[11]+1839030562,v=(v<<16|v>>>16)+p<<0,h+=(P^v)+R[14]-35309556,h=(h<<23|h>>>9)+v<<0,j=h^v,l+=(j^p)+R[1]-1530992060,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[4]+1272893353,p=(p<<11|p>>>21)+l<<0,P=p^l,v+=(P^h)+R[7]-155497632,v=(v<<16|v>>>16)+p<<0,h+=(P^v)+R[10]-1094730640,h=(h<<23|h>>>9)+v<<0,j=h^v,l+=(j^p)+R[13]+681279174,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[0]-358537222,p=(p<<11|p>>>21)+l<<0,P=p^l,v+=(P^h)+R[3]-722521979,v=(v<<16|v>>>16)+p<<0,h+=(P^v)+R[6]+76029189,h=(h<<23|h>>>9)+v<<0,j=h^v,l+=(j^p)+R[9]-640364487,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[12]-421815835,p=(p<<11|p>>>21)+l<<0,P=p^l,v+=(P^h)+R[15]+530742520,v=(v<<16|v>>>16)+p<<0,h+=(P^v)+R[2]-995338651,h=(h<<23|h>>>9)+v<<0,l+=(v^(h|~p))+R[0]-198630844,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[7]+1126891415,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[14]-1416354905,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[5]-57434055,h=(h<<21|h>>>11)+v<<0,l+=(v^(h|~p))+R[12]+1700485571,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[3]-1894986606,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[10]-1051523,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[1]-2054922799,h=(h<<21|h>>>11)+v<<0,l+=(v^(h|~p))+R[8]+1873313359,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[15]-30611744,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[6]-1560198380,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[13]+1309151649,h=(h<<21|h>>>11)+v<<0,l+=(v^(h|~p))+R[4]-145523070,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[11]-1120210379,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[2]+718787259,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[9]-343485551,h=(h<<21|h>>>11)+v<<0,this.first?(this.h0=l+1732584193<<0,this.h1=h-271733879<<0,this.h2=v-1732584194<<0,this.h3=p+271733878<<0,this.first=!1):(this.h0=this.h0+l<<0,this.h1=this.h1+h<<0,this.h2=this.h2+v<<0,this.h3=this.h3+p<<0)},X.prototype.hex=function(){this.finalize();var l=this.h0,h=this.h1,v=this.h2,p=this.h3;return u[l>>>4&15]+u[l&15]+u[l>>>12&15]+u[l>>>8&15]+u[l>>>20&15]+u[l>>>16&15]+u[l>>>28&15]+u[l>>>24&15]+u[h>>>4&15]+u[h&15]+u[h>>>12&15]+u[h>>>8&15]+u[h>>>20&15]+u[h>>>16&15]+u[h>>>28&15]+u[h>>>24&15]+u[v>>>4&15]+u[v&15]+u[v>>>12&15]+u[v>>>8&15]+u[v>>>20&15]+u[v>>>16&15]+u[v>>>28&15]+u[v>>>24&15]+u[p>>>4&15]+u[p&15]+u[p>>>12&15]+u[p>>>8&15]+u[p>>>20&15]+u[p>>>16&15]+u[p>>>28&15]+u[p>>>24&15]},X.prototype.toString=X.prototype.hex,X.prototype.digest=function(){this.finalize();var l=this.h0,h=this.h1,v=this.h2,p=this.h3;return[l&255,l>>>8&255,l>>>16&255,l>>>24&255,h&255,h>>>8&255,h>>>16&255,h>>>24&255,v&255,v>>>8&255,v>>>16&255,v>>>24&255,p&255,p>>>8&255,p>>>16&255,p>>>24&255]},X.prototype.array=X.prototype.digest,X.prototype.arrayBuffer=function(){this.finalize();var l=new ArrayBuffer(16),h=new Uint32Array(l);return h[0]=this.h0,h[1]=this.h1,h[2]=this.h2,h[3]=this.h3,l},X.prototype.buffer=X.prototype.arrayBuffer,X.prototype.base64=function(){for(var l,h,v,p="",j=this.array(),P=0;P<15;)l=j[P++],h=j[P++],v=j[P++],p+=O[l>>>2]+O[(l<<4|h>>>4)&63]+O[(h<<2|v>>>6)&63]+O[v&63];return l=j[P],p+=O[l>>>2]+O[l<<4&63]+"==",p};function Z(l,h){var v,p=k(l);if(l=p[0],p[1]){var j=[],P=l.length,R=0,Q;for(v=0;v>>6,j[R++]=128|Q&63):Q<55296||Q>=57344?(j[R++]=224|Q>>>12,j[R++]=128|Q>>>6&63,j[R++]=128|Q&63):(Q=65536+((Q&1023)<<10|l.charCodeAt(++v)&1023),j[R++]=240|Q>>>18,j[R++]=128|Q>>>12&63,j[R++]=128|Q>>>6&63,j[R++]=128|Q&63);l=j}l.length>64&&(l=new X(!0).update(l).array());var Vt=[],Re=[];for(v=0;v<64;++v){var ze=l[v]||0;Vt[v]=92^ze,Re[v]=54^ze}X.call(this,h),this.update(Re),this.oKeyPad=Vt,this.inner=!0,this.sharedMemory=h}Z.prototype=new X,Z.prototype.finalize=function(){if(X.prototype.finalize.call(this),this.inner){this.inner=!1;var l=this.array();X.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(l),X.prototype.finalize.call(this)}};var mt=nt();mt.md5=mt,mt.md5.hmac=dt(),a?yr.exports=mt:(n.md5=mt,d&&define(function(){return mt}))})()});var $i=["top","right","bottom","left"],Mi=["start","end"],Ri=$i.reduce((t,e)=>t.concat(e,e+"-"+Mi[0],e+"-"+Mi[1]),[]),Ee=Math.min,ee=Math.max,hr=Math.round,pr=Math.floor,nn=t=>({x:t,y:t}),Zo={left:"right",right:"left",bottom:"top",top:"bottom"},Qo={start:"end",end:"start"};function Zr(t,e,r){return ee(t,Ee(e,r))}function je(t,e){return typeof t=="function"?t(e):t}function pe(t){return t.split("-")[0]}function xe(t){return t.split("-")[1]}function Wi(t){return t==="x"?"y":"x"}function Qr(t){return t==="y"?"height":"width"}function Pn(t){return["top","bottom"].includes(pe(t))?"y":"x"}function ti(t){return Wi(Pn(t))}function zi(t,e,r){r===void 0&&(r=!1);let n=xe(t),i=ti(t),o=Qr(i),a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=mr(a)),[a,mr(a)]}function ta(t){let e=mr(t);return[vr(t),e,vr(e)]}function vr(t){return t.replace(/start|end/g,e=>Qo[e])}function ea(t,e,r){let n=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?o:a;default:return[]}}function na(t,e,r,n){let i=xe(t),o=ea(pe(t),r==="start",n);return i&&(o=o.map(a=>a+"-"+i),e&&(o=o.concat(o.map(vr)))),o}function mr(t){return t.replace(/left|right|bottom|top/g,e=>Zo[e])}function ra(t){return{top:0,right:0,bottom:0,left:0,...t}}function ei(t){return typeof t!="number"?ra(t):{top:t,right:t,bottom:t,left:t}}function Cn(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Ii(t,e,r){let{reference:n,floating:i}=t,o=Pn(e),a=ti(e),d=Qr(a),f=pe(e),u=o==="y",w=n.x+n.width/2-i.width/2,m=n.y+n.height/2-i.height/2,E=n[d]/2-i[d]/2,O;switch(f){case"top":O={x:w,y:n.y-i.height};break;case"bottom":O={x:w,y:n.y+n.height};break;case"right":O={x:n.x+n.width,y:m};break;case"left":O={x:n.x-i.width,y:m};break;default:O={x:n.x,y:n.y}}switch(xe(e)){case"start":O[a]-=E*(r&&u?-1:1);break;case"end":O[a]+=E*(r&&u?-1:1);break}return O}var ia=async(t,e,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,d=o.filter(Boolean),f=await(a.isRTL==null?void 0:a.isRTL(e)),u=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:w,y:m}=Ii(u,n,f),E=n,O={},S=0;for(let M=0;M({name:"arrow",options:t,async fn(e){let{x:r,y:n,placement:i,rects:o,platform:a,elements:d,middlewareData:f}=e,{element:u,padding:w=0}=je(t,e)||{};if(u==null)return{};let m=ei(w),E={x:r,y:n},O=ti(i),S=Qr(O),M=await a.getDimensions(u),I=O==="y",$=I?"top":"left",A=I?"bottom":"right",k=I?"clientHeight":"clientWidth",Y=o.reference[S]+o.reference[O]-E[O]-o.floating[S],nt=E[O]-o.reference[O],J=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u)),U=J?J[k]:0;(!U||!await(a.isElement==null?void 0:a.isElement(J)))&&(U=d.floating[k]||o.floating[S]);let dt=Y/2-nt/2,X=U/2-M[S]/2-1,Z=Ee(m[$],X),mt=Ee(m[A],X),l=Z,h=U-M[S]-mt,v=U/2-M[S]/2+dt,p=Zr(l,v,h),j=!f.arrow&&xe(i)!=null&&v!==p&&o.reference[S]/2-(vxe(i)===t),...r.filter(i=>xe(i)!==t)]:r.filter(i=>pe(i)===i)).filter(i=>t?xe(i)===t||(e?vr(i)!==i:!1):!0)}var sa=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var r,n,i;let{rects:o,middlewareData:a,placement:d,platform:f,elements:u}=e,{crossAxis:w=!1,alignment:m,allowedPlacements:E=Ri,autoAlignment:O=!0,...S}=je(t,e),M=m!==void 0||E===Ri?aa(m||null,O,E):E,I=await _n(e,S),$=((r=a.autoPlacement)==null?void 0:r.index)||0,A=M[$];if(A==null)return{};let k=zi(A,o,await(f.isRTL==null?void 0:f.isRTL(u.floating)));if(d!==A)return{reset:{placement:M[0]}};let Y=[I[pe(A)],I[k[0]],I[k[1]]],nt=[...((n=a.autoPlacement)==null?void 0:n.overflows)||[],{placement:A,overflows:Y}],J=M[$+1];if(J)return{data:{index:$+1,overflows:nt},reset:{placement:J}};let U=nt.map(Z=>{let mt=xe(Z.placement);return[Z.placement,mt&&w?Z.overflows.slice(0,2).reduce((l,h)=>l+h,0):Z.overflows[0],Z.overflows]}).sort((Z,mt)=>Z[1]-mt[1]),X=((i=U.filter(Z=>Z[2].slice(0,xe(Z[0])?2:3).every(mt=>mt<=0))[0])==null?void 0:i[0])||U[0][0];return X!==d?{data:{index:$+1,overflows:nt},reset:{placement:X}}:{}}}},la=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;let{placement:i,middlewareData:o,rects:a,initialPlacement:d,platform:f,elements:u}=e,{mainAxis:w=!0,crossAxis:m=!0,fallbackPlacements:E,fallbackStrategy:O="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:M=!0,...I}=je(t,e);if((r=o.arrow)!=null&&r.alignmentOffset)return{};let $=pe(i),A=pe(d)===d,k=await(f.isRTL==null?void 0:f.isRTL(u.floating)),Y=E||(A||!M?[mr(d)]:ta(d));!E&&S!=="none"&&Y.push(...na(d,M,S,k));let nt=[d,...Y],J=await _n(e,I),U=[],dt=((n=o.flip)==null?void 0:n.overflows)||[];if(w&&U.push(J[$]),m){let l=zi(i,a,k);U.push(J[l[0]],J[l[1]])}if(dt=[...dt,{placement:i,overflows:U}],!U.every(l=>l<=0)){var X,Z;let l=(((X=o.flip)==null?void 0:X.index)||0)+1,h=nt[l];if(h)return{data:{index:l,overflows:dt},reset:{placement:h}};let v=(Z=dt.filter(p=>p.overflows[0]<=0).sort((p,j)=>p.overflows[1]-j.overflows[1])[0])==null?void 0:Z.placement;if(!v)switch(O){case"bestFit":{var mt;let p=(mt=dt.map(j=>[j.placement,j.overflows.filter(P=>P>0).reduce((P,R)=>P+R,0)]).sort((j,P)=>j[1]-P[1])[0])==null?void 0:mt[0];p&&(v=p);break}case"initialPlacement":v=d;break}if(i!==v)return{reset:{placement:v}}}return{}}}};function Fi(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Li(t){return $i.some(e=>t[e]>=0)}var ca=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:r}=e,{strategy:n="referenceHidden",...i}=je(t,e);switch(n){case"referenceHidden":{let o=await _n(e,{...i,elementContext:"reference"}),a=Fi(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Li(a)}}}case"escaped":{let o=await _n(e,{...i,altBoundary:!0}),a=Fi(o,r.floating);return{data:{escapedOffsets:a,escaped:Li(a)}}}default:return{}}}}};function Ui(t){let e=Ee(...t.map(o=>o.left)),r=Ee(...t.map(o=>o.top)),n=ee(...t.map(o=>o.right)),i=ee(...t.map(o=>o.bottom));return{x:e,y:r,width:n-e,height:i-r}}function fa(t){let e=t.slice().sort((i,o)=>i.y-o.y),r=[],n=null;for(let i=0;in.height/2?r.push([o]):r[r.length-1].push(o),n=o}return r.map(i=>Cn(Ui(i)))}var ua=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){let{placement:r,elements:n,rects:i,platform:o,strategy:a}=e,{padding:d=2,x:f,y:u}=je(t,e),w=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(n.reference))||[]),m=fa(w),E=Cn(Ui(w)),O=ei(d);function S(){if(m.length===2&&m[0].left>m[1].right&&f!=null&&u!=null)return m.find(I=>f>I.left-O.left&&fI.top-O.top&&u=2){if(Pn(r)==="y"){let Z=m[0],mt=m[m.length-1],l=pe(r)==="top",h=Z.top,v=mt.bottom,p=l?Z.left:mt.left,j=l?Z.right:mt.right,P=j-p,R=v-h;return{top:h,bottom:v,left:p,right:j,width:P,height:R,x:p,y:h}}let I=pe(r)==="left",$=ee(...m.map(Z=>Z.right)),A=Ee(...m.map(Z=>Z.left)),k=m.filter(Z=>I?Z.left===A:Z.right===$),Y=k[0].top,nt=k[k.length-1].bottom,J=A,U=$,dt=U-J,X=nt-Y;return{top:Y,bottom:nt,left:J,right:U,width:dt,height:X,x:J,y:Y}}return E}let M=await o.getElementRects({reference:{getBoundingClientRect:S},floating:n.floating,strategy:a});return i.reference.x!==M.reference.x||i.reference.y!==M.reference.y||i.reference.width!==M.reference.width||i.reference.height!==M.reference.height?{reset:{rects:M}}:{}}}};async function da(t,e){let{placement:r,platform:n,elements:i}=t,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),a=pe(r),d=xe(r),f=Pn(r)==="y",u=["left","top"].includes(a)?-1:1,w=o&&f?-1:1,m=je(e,t),{mainAxis:E,crossAxis:O,alignmentAxis:S}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return d&&typeof S=="number"&&(O=d==="end"?S*-1:S),f?{x:O*w,y:E*u}:{x:E*u,y:O*w}}var Vi=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;let{x:i,y:o,placement:a,middlewareData:d}=e,f=await da(e,t);return a===((r=d.offset)==null?void 0:r.placement)&&(n=d.arrow)!=null&&n.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:a}}}}},pa=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:r,y:n,placement:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:d={fn:I=>{let{x:$,y:A}=I;return{x:$,y:A}}},...f}=je(t,e),u={x:r,y:n},w=await _n(e,f),m=Pn(pe(i)),E=Wi(m),O=u[E],S=u[m];if(o){let I=E==="y"?"top":"left",$=E==="y"?"bottom":"right",A=O+w[I],k=O-w[$];O=Zr(A,O,k)}if(a){let I=m==="y"?"top":"left",$=m==="y"?"bottom":"right",A=S+w[I],k=S-w[$];S=Zr(A,S,k)}let M=d.fn({...e,[E]:O,[m]:S});return{...M,data:{x:M.x-r,y:M.y-n}}}}},ha=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){let{placement:r,rects:n,platform:i,elements:o}=e,{apply:a=()=>{},...d}=je(t,e),f=await _n(e,d),u=pe(r),w=xe(r),m=Pn(r)==="y",{width:E,height:O}=n.floating,S,M;u==="top"||u==="bottom"?(S=u,M=w===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(M=u,S=w==="end"?"top":"bottom");let I=O-f[S],$=E-f[M],A=!e.middlewareData.shift,k=I,Y=$;if(m){let J=E-f.left-f.right;Y=w||A?Ee($,J):J}else{let J=O-f.top-f.bottom;k=w||A?Ee(I,J):J}if(A&&!w){let J=ee(f.left,0),U=ee(f.right,0),dt=ee(f.top,0),X=ee(f.bottom,0);m?Y=E-2*(J!==0||U!==0?J+U:ee(f.left,f.right)):k=O-2*(dt!==0||X!==0?dt+X:ee(f.top,f.bottom))}await a({...e,availableWidth:Y,availableHeight:k});let nt=await i.getDimensions(o.floating);return E!==nt.width||O!==nt.height?{reset:{rects:!0}}:{}}}};function rn(t){return Yi(t)?(t.nodeName||"").toLowerCase():"#document"}function ce(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Be(t){var e;return(e=(Yi(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Yi(t){return t instanceof Node||t instanceof ce(t).Node}function ke(t){return t instanceof Element||t instanceof ce(t).Element}function Te(t){return t instanceof HTMLElement||t instanceof ce(t).HTMLElement}function Ni(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ce(t).ShadowRoot}function Vn(t){let{overflow:e,overflowX:r,overflowY:n,display:i}=he(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function va(t){return["table","td","th"].includes(rn(t))}function ni(t){let e=ri(),r=he(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function ma(t){let e=Tn(t);for(;Te(e)&&!gr(e);){if(ni(e))return e;e=Tn(e)}return null}function ri(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gr(t){return["html","body","#document"].includes(rn(t))}function he(t){return ce(t).getComputedStyle(t)}function br(t){return ke(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Tn(t){if(rn(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Ni(t)&&t.host||Be(t);return Ni(e)?e.host:e}function Xi(t){let e=Tn(t);return gr(e)?t.ownerDocument?t.ownerDocument.body:t.body:Te(e)&&Vn(e)?e:Xi(e)}function Un(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);let i=Xi(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),a=ce(i);return o?e.concat(a,a.visualViewport||[],Vn(i)?i:[],a.frameElement&&r?Un(a.frameElement):[]):e.concat(i,Un(i,[],r))}function qi(t){let e=he(t),r=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=Te(t),o=i?t.offsetWidth:r,a=i?t.offsetHeight:n,d=hr(r)!==o||hr(n)!==a;return d&&(r=o,n=a),{width:r,height:n,$:d}}function ii(t){return ke(t)?t:t.contextElement}function Dn(t){let e=ii(t);if(!Te(e))return nn(1);let r=e.getBoundingClientRect(),{width:n,height:i,$:o}=qi(e),a=(o?hr(r.width):r.width)/n,d=(o?hr(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!d||!Number.isFinite(d))&&(d=1),{x:a,y:d}}var ga=nn(0);function Gi(t){let e=ce(t);return!ri()||!e.visualViewport?ga:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ba(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==ce(t)?!1:e}function vn(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);let i=t.getBoundingClientRect(),o=ii(t),a=nn(1);e&&(n?ke(n)&&(a=Dn(n)):a=Dn(t));let d=ba(o,r,n)?Gi(o):nn(0),f=(i.left+d.x)/a.x,u=(i.top+d.y)/a.y,w=i.width/a.x,m=i.height/a.y;if(o){let E=ce(o),O=n&&ke(n)?ce(n):n,S=E,M=S.frameElement;for(;M&&n&&O!==S;){let I=Dn(M),$=M.getBoundingClientRect(),A=he(M),k=$.left+(M.clientLeft+parseFloat(A.paddingLeft))*I.x,Y=$.top+(M.clientTop+parseFloat(A.paddingTop))*I.y;f*=I.x,u*=I.y,w*=I.x,m*=I.y,f+=k,u+=Y,S=ce(M),M=S.frameElement}}return Cn({width:w,height:m,x:f,y:u})}var ya=[":popover-open",":modal"];function Ki(t){return ya.some(e=>{try{return t.matches(e)}catch{return!1}})}function wa(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t,o=i==="fixed",a=Be(n),d=e?Ki(e.floating):!1;if(n===a||d&&o)return r;let f={scrollLeft:0,scrollTop:0},u=nn(1),w=nn(0),m=Te(n);if((m||!m&&!o)&&((rn(n)!=="body"||Vn(a))&&(f=br(n)),Te(n))){let E=vn(n);u=Dn(n),w.x=E.x+n.clientLeft,w.y=E.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-f.scrollLeft*u.x+w.x,y:r.y*u.y-f.scrollTop*u.y+w.y}}function xa(t){return Array.from(t.getClientRects())}function Ji(t){return vn(Be(t)).left+br(t).scrollLeft}function Ea(t){let e=Be(t),r=br(t),n=t.ownerDocument.body,i=ee(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=ee(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+Ji(t),d=-r.scrollTop;return he(n).direction==="rtl"&&(a+=ee(e.clientWidth,n.clientWidth)-i),{width:i,height:o,x:a,y:d}}function Oa(t,e){let r=ce(t),n=Be(t),i=r.visualViewport,o=n.clientWidth,a=n.clientHeight,d=0,f=0;if(i){o=i.width,a=i.height;let u=ri();(!u||u&&e==="fixed")&&(d=i.offsetLeft,f=i.offsetTop)}return{width:o,height:a,x:d,y:f}}function Sa(t,e){let r=vn(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,o=Te(t)?Dn(t):nn(1),a=t.clientWidth*o.x,d=t.clientHeight*o.y,f=i*o.x,u=n*o.y;return{width:a,height:d,x:f,y:u}}function ki(t,e,r){let n;if(e==="viewport")n=Oa(t,r);else if(e==="document")n=Ea(Be(t));else if(ke(e))n=Sa(e,r);else{let i=Gi(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return Cn(n)}function Zi(t,e){let r=Tn(t);return r===e||!ke(r)||gr(r)?!1:he(r).position==="fixed"||Zi(r,e)}function Aa(t,e){let r=e.get(t);if(r)return r;let n=Un(t,[],!1).filter(d=>ke(d)&&rn(d)!=="body"),i=null,o=he(t).position==="fixed",a=o?Tn(t):t;for(;ke(a)&&!gr(a);){let d=he(a),f=ni(a);!f&&d.position==="fixed"&&(i=null),(o?!f&&!i:!f&&d.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Vn(a)&&!f&&Zi(t,a))?n=n.filter(w=>w!==a):i=d,a=Tn(a)}return e.set(t,n),n}function Da(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t,a=[...r==="clippingAncestors"?Aa(e,this._c):[].concat(r),n],d=a[0],f=a.reduce((u,w)=>{let m=ki(e,w,i);return u.top=ee(m.top,u.top),u.right=Ee(m.right,u.right),u.bottom=Ee(m.bottom,u.bottom),u.left=ee(m.left,u.left),u},ki(e,d,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Ca(t){let{width:e,height:r}=qi(t);return{width:e,height:r}}function _a(t,e,r){let n=Te(e),i=Be(e),o=r==="fixed",a=vn(t,!0,o,e),d={scrollLeft:0,scrollTop:0},f=nn(0);if(n||!n&&!o)if((rn(e)!=="body"||Vn(i))&&(d=br(e)),n){let m=vn(e,!0,o,e);f.x=m.x+e.clientLeft,f.y=m.y+e.clientTop}else i&&(f.x=Ji(i));let u=a.left+d.scrollLeft-f.x,w=a.top+d.scrollTop-f.y;return{x:u,y:w,width:a.width,height:a.height}}function ji(t,e){return!Te(t)||he(t).position==="fixed"?null:e?e(t):t.offsetParent}function Qi(t,e){let r=ce(t);if(!Te(t)||Ki(t))return r;let n=ji(t,e);for(;n&&va(n)&&he(n).position==="static";)n=ji(n,e);return n&&(rn(n)==="html"||rn(n)==="body"&&he(n).position==="static"&&!ni(n))?r:n||ma(t)||r}var Ta=async function(t){let e=this.getOffsetParent||Qi,r=this.getDimensions;return{reference:_a(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await r(t.floating)}}};function Pa(t){return he(t).direction==="rtl"}var Ma={convertOffsetParentRelativeRectToViewportRelativeRect:wa,getDocumentElement:Be,getClippingRect:Da,getOffsetParent:Qi,getElementRects:Ta,getClientRects:xa,getDimensions:Ca,getScale:Dn,isElement:ke,isRTL:Pa};function Ra(t,e){let r=null,n,i=Be(t);function o(){var d;clearTimeout(n),(d=r)==null||d.disconnect(),r=null}function a(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),o();let{left:u,top:w,width:m,height:E}=t.getBoundingClientRect();if(d||e(),!m||!E)return;let O=pr(w),S=pr(i.clientWidth-(u+m)),M=pr(i.clientHeight-(w+E)),I=pr(u),A={rootMargin:-O+"px "+-S+"px "+-M+"px "+-I+"px",threshold:ee(0,Ee(1,f))||1},k=!0;function Y(nt){let J=nt[0].intersectionRatio;if(J!==f){if(!k)return a();J?a(!1,J):n=setTimeout(()=>{a(!1,1e-7)},100)}k=!1}try{r=new IntersectionObserver(Y,{...A,root:i.ownerDocument})}catch{r=new IntersectionObserver(Y,A)}r.observe(t)}return a(!0),o}function Bi(t,e,r,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=n,u=ii(t),w=i||o?[...u?Un(u):[],...Un(e)]:[];w.forEach($=>{i&&$.addEventListener("scroll",r,{passive:!0}),o&&$.addEventListener("resize",r)});let m=u&&d?Ra(u,r):null,E=-1,O=null;a&&(O=new ResizeObserver($=>{let[A]=$;A&&A.target===u&&O&&(O.unobserve(e),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var k;(k=O)==null||k.observe(e)})),r()}),u&&!f&&O.observe(u),O.observe(e));let S,M=f?vn(t):null;f&&I();function I(){let $=vn(t);M&&($.x!==M.x||$.y!==M.y||$.width!==M.width||$.height!==M.height)&&r(),M=$,S=requestAnimationFrame(I)}return r(),()=>{var $;w.forEach(A=>{i&&A.removeEventListener("scroll",r),o&&A.removeEventListener("resize",r)}),m?.(),($=O)==null||$.disconnect(),O=null,f&&cancelAnimationFrame(S)}}var oi=sa,to=pa,eo=la,no=ha,ro=ca,io=oa,oo=ua,Hi=(t,e,r)=>{let n=new Map,i={platform:Ma,...r},o={...i.platform,_c:n};return ia(t,e,{...i,platform:o})},Ia=t=>{let e={placement:"bottom",strategy:"absolute",middleware:[]},r=Object.keys(t),n=i=>t[i];return r.includes("offset")&&e.middleware.push(Vi(n("offset"))),r.includes("teleport")&&(e.strategy="fixed"),r.includes("placement")&&(e.placement=n("placement")),r.includes("autoPlacement")&&!r.includes("flip")&&e.middleware.push(oi(n("autoPlacement"))),r.includes("flip")&&e.middleware.push(eo(n("flip"))),r.includes("shift")&&e.middleware.push(to(n("shift"))),r.includes("inline")&&e.middleware.push(oo(n("inline"))),r.includes("arrow")&&e.middleware.push(io(n("arrow"))),r.includes("hide")&&e.middleware.push(ro(n("hide"))),r.includes("size")&&e.middleware.push(no(n("size"))),e},Fa=(t,e)=>{let r={component:{trap:!1},float:{placement:"bottom",strategy:"absolute",middleware:[]}},n=i=>t[t.indexOf(i)+1];if(t.includes("trap")&&(r.component.trap=!0),t.includes("teleport")&&(r.float.strategy="fixed"),t.includes("offset")&&r.float.middleware.push(Vi(e.offset||10)),t.includes("placement")&&(r.float.placement=n("placement")),t.includes("autoPlacement")&&!t.includes("flip")&&r.float.middleware.push(oi(e.autoPlacement)),t.includes("flip")&&r.float.middleware.push(eo(e.flip)),t.includes("shift")&&r.float.middleware.push(to(e.shift)),t.includes("inline")&&r.float.middleware.push(oo(e.inline)),t.includes("arrow")&&r.float.middleware.push(io(e.arrow)),t.includes("hide")&&r.float.middleware.push(ro(e.hide)),t.includes("size")){let i=e.size?.availableWidth??null,o=e.size?.availableHeight??null;i&&delete e.size.availableWidth,o&&delete e.size.availableHeight,r.float.middleware.push(no({...e.size,apply({availableWidth:a,availableHeight:d,elements:f}){Object.assign(f.floating.style,{maxWidth:`${i??a}px`,maxHeight:`${o??d}px`})}}))}return r},La=t=>{var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),r="";t||(t=Math.floor(Math.random()*e.length));for(var n=0;n{}){let r=!1;return function(){r?e.apply(this,arguments):(r=!0,t.apply(this,arguments))}}function ka(t){let e={dismissable:!0,trap:!1};function r(n,i=null){if(n){if(n.hasAttribute("aria-expanded")||n.setAttribute("aria-expanded",!1),i.hasAttribute("id"))n.setAttribute("aria-controls",i.getAttribute("id"));else{let o=`panel-${La(8)}`;n.setAttribute("aria-controls",o),i.setAttribute("id",o)}i.setAttribute("aria-modal",!0),i.setAttribute("role","dialog")}}t.magic("float",n=>(i={},o={})=>{let a={...e,...o},d=Object.keys(i).length>0?Ia(i):{middleware:[oi()]},f=n,u=n.parentElement.closest("[x-data]"),w=u.querySelector('[x-ref="panel"]');r(f,w);function m(){return w.style.display=="block"}function E(){w.style.display="none",f.setAttribute("aria-expanded","false"),a.trap&&w.setAttribute("x-trap","false"),Bi(n,w,M)}function O(){w.style.display="block",f.setAttribute("aria-expanded","true"),a.trap&&w.setAttribute("x-trap","true"),M()}function S(){m()?E():O()}async function M(){return await Hi(n,w,d).then(({middlewareData:I,placement:$,x:A,y:k})=>{if(I.arrow){let Y=I.arrow?.x,nt=I.arrow?.y,J=d.middleware.filter(dt=>dt.name=="arrow")[0].options.element,U={top:"bottom",right:"left",bottom:"top",left:"right"}[$.split("-")[0]];Object.assign(J.style,{left:Y!=null?`${Y}px`:"",top:nt!=null?`${nt}px`:"",right:"",bottom:"",[U]:"-4px"})}if(I.hide){let{referenceHidden:Y}=I.hide;Object.assign(w.style,{visibility:Y?"hidden":"visible"})}Object.assign(w.style,{left:`${A}px`,top:`${k}px`})})}a.dismissable&&(window.addEventListener("click",I=>{!u.contains(I.target)&&m()&&S()}),window.addEventListener("keydown",I=>{I.key==="Escape"&&m()&&S()},!0)),S()}),t.directive("float",(n,{modifiers:i,expression:o},{evaluate:a,effect:d})=>{let f=o?a(o):{},u=i.length>0?Fa(i,f):{},w=null;u.float.strategy=="fixed"&&(n.style.position="fixed");let m=U=>n.parentElement&&!n.parentElement.closest("[x-data]").contains(U.target)?n.close():null,E=U=>U.key==="Escape"?n.close():null,O=n.getAttribute("x-ref"),S=n.parentElement.closest("[x-data]"),M=S.querySelectorAll(`[\\@click^="$refs.${O}"]`),I=S.querySelectorAll(`[x-on\\:click^="$refs.${O}"]`);n.style.setProperty("display","none"),r([...M,...I][0],n),n._x_isShown=!1,n.trigger=null,n._x_doHide||(n._x_doHide=()=>{n.style.setProperty("display","none",i.includes("important")?"important":void 0)}),n._x_doShow||(n._x_doShow=()=>{n.style.setProperty("display","block",i.includes("important")?"important":void 0)});let $=()=>{n._x_doHide(),n._x_isShown=!1},A=()=>{n._x_doShow(),n._x_isShown=!0},k=()=>setTimeout(A),Y=Na(U=>U?A():$(),U=>{typeof n._x_toggleAndCascadeWithTransitions=="function"?n._x_toggleAndCascadeWithTransitions(n,U,A,$):U?k():$()}),nt,J=!0;d(()=>a(U=>{!J&&U===nt||(i.includes("immediate")&&(U?k():$()),Y(U),nt=U,J=!1)})),n.open=async function(U){n.trigger=U.currentTarget?U.currentTarget:U,Y(!0),n.trigger.setAttribute("aria-expanded","true"),u.component.trap&&n.setAttribute("x-trap","true"),w=Bi(n.trigger,n,()=>{Hi(n.trigger,n,u.float).then(({middlewareData:dt,placement:X,x:Z,y:mt})=>{if(dt.arrow){let l=dt.arrow?.x,h=dt.arrow?.y,v=u.float.middleware.filter(j=>j.name=="arrow")[0].options.element,p={top:"bottom",right:"left",bottom:"top",left:"right"}[X.split("-")[0]];Object.assign(v.style,{left:l!=null?`${l}px`:"",top:h!=null?`${h}px`:"",right:"",bottom:"",[p]:"-4px"})}if(dt.hide){let{referenceHidden:l}=dt.hide;Object.assign(n.style,{visibility:l?"hidden":"visible"})}Object.assign(n.style,{left:`${Z}px`,top:`${mt}px`})})}),window.addEventListener("click",m),window.addEventListener("keydown",E,!0)},n.close=function(){if(!n._x_isShown)return!1;Y(!1),n.trigger.setAttribute("aria-expanded","false"),u.component.trap&&n.setAttribute("x-trap","false"),w(),window.removeEventListener("click",m),window.removeEventListener("keydown",E,!1)},n.toggle=function(U){n._x_isShown?n.close():n.open(U)}})}var ao=ka;function ja(t){t.store("lazyLoadedAssets",{loaded:new Set,check(a){return Array.isArray(a)?a.every(d=>this.loaded.has(d)):this.loaded.has(a)},markLoaded(a){Array.isArray(a)?a.forEach(d=>this.loaded.add(d)):this.loaded.add(a)}});let e=a=>new CustomEvent(a,{bubbles:!0,composed:!0,cancelable:!0}),r=(a,d={},f,u)=>{let w=document.createElement(a);return Object.entries(d).forEach(([m,E])=>w[m]=E),f&&(u?f.insertBefore(w,u):f.appendChild(w)),w},n=(a,d,f={},u=null,w=null)=>{let m=a==="link"?`link[href="${d}"]`:`script[src="${d}"]`;if(document.querySelector(m)||t.store("lazyLoadedAssets").check(d))return Promise.resolve();let E=a==="link"?{...f,href:d}:{...f,src:d},O=r(a,E,u,w);return new Promise((S,M)=>{O.onload=()=>{t.store("lazyLoadedAssets").markLoaded(d),S()},O.onerror=()=>{M(new Error(`Failed to load ${a}: ${d}`))}})},i=async(a,d,f=null,u=null)=>{let w={type:"text/css",rel:"stylesheet"};d&&(w.media=d);let m=document.head,E=null;if(f&&u){let O=document.querySelector(`link[href*="${u}"]`);O?(m=O.parentElement,E=f==="before"?O:O.nextSibling):(console.warn(`Target (${u}) not found for ${a}. Appending to head.`),m=document.head,E=null)}await n("link",a,w,m,E)},o=async(a,d,f=null,u=null,w=null)=>{let m=document.head,E=null;if(f&&u){let S=document.querySelector(`script[src*="${u}"]`);S?(m=S.parentElement,E=f==="before"?S:S.nextSibling):(console.warn(`Target (${u}) not found for ${a}. Falling back to head or body.`),m=document.head,E=null)}else(d.has("body-start")||d.has("body-end"))&&(m=document.body,d.has("body-start")&&(E=document.body.firstChild));let O={};w&&(O.type="module"),await n("script",a,O,m,E)};t.directive("load-css",(a,{expression:d},{evaluate:f})=>{let u=f(d),w=a.media,m=a.getAttribute("data-dispatch"),E=a.getAttribute("data-css-before")?"before":a.getAttribute("data-css-after")?"after":null,O=a.getAttribute("data-css-before")||a.getAttribute("data-css-after")||null;Promise.all(u.map(S=>i(S,w,E,O))).then(()=>{m&&window.dispatchEvent(e(`${m}-css`))}).catch(console.error)}),t.directive("load-js",(a,{expression:d,modifiers:f},{evaluate:u})=>{let w=u(d),m=new Set(f),E=a.getAttribute("data-js-before")?"before":a.getAttribute("data-js-after")?"after":null,O=a.getAttribute("data-js-before")||a.getAttribute("data-js-after")||null,S=a.getAttribute("data-js-as-module")||a.getAttribute("data-as-module")||!1,M=a.getAttribute("data-dispatch");Promise.all(w.map(I=>o(I,m,E,O,S))).then(()=>{M&&window.dispatchEvent(e(`${M}-js`))}).catch(console.error)})}var so=ja;function Ba(){return!0}function Ha({component:t,argument:e}){return new Promise(r=>{if(e)window.addEventListener(e,()=>r(),{once:!0});else{let n=i=>{i.detail.id===t.id&&(window.removeEventListener("async-alpine:load",n),r())};window.addEventListener("async-alpine:load",n)}})}function $a(){return new Promise(t=>{"requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t,200)})}function Wa({argument:t}){return new Promise(e=>{if(!t)return console.log("Async Alpine: media strategy requires a media query. Treating as 'eager'"),e();let r=window.matchMedia(`(${t})`);r.matches?e():r.addEventListener("change",e,{once:!0})})}function za({component:t,argument:e}){return new Promise(r=>{let n=e||"0px 0px 0px 0px",i=new IntersectionObserver(o=>{o[0].isIntersecting&&(i.disconnect(),r())},{rootMargin:n});i.observe(t.el)})}var lo={eager:Ba,event:Ha,idle:$a,media:Wa,visible:za};async function Ua(t){let e=Va(t.strategy);await ai(t,e)}async function ai(t,e){if(e.type==="expression"){if(e.operator==="&&")return Promise.all(e.parameters.map(r=>ai(t,r)));if(e.operator==="||")return Promise.any(e.parameters.map(r=>ai(t,r)))}return lo[e.method]?lo[e.method]({component:t,argument:e.argument}):!1}function Va(t){let e=Ya(t),r=fo(e);return r.type==="method"?{type:"expression",operator:"&&",parameters:[r]}:r}function Ya(t){let e=/\s*([()])\s*|\s*(\|\||&&|\|)\s*|\s*((?:[^()&|]+\([^()]+\))|[^()&|]+)\s*/g,r=[],n;for(;(n=e.exec(t))!==null;){let[i,o,a,d]=n;if(o!==void 0)r.push({type:"parenthesis",value:o});else if(a!==void 0)r.push({type:"operator",value:a==="|"?"&&":a});else{let f={type:"method",method:d.trim()};d.includes("(")&&(f.method=d.substring(0,d.indexOf("(")).trim(),f.argument=d.substring(d.indexOf("(")+1,d.indexOf(")"))),d.method==="immediate"&&(d.method="eager"),r.push(f)}}return r}function fo(t){let e=co(t);for(;t.length>0&&(t[0].value==="&&"||t[0].value==="|"||t[0].value==="||");){let r=t.shift().value,n=co(t);e.type==="expression"&&e.operator===r?e.parameters.push(n):e={type:"expression",operator:r,parameters:[e,n]}}return e}function co(t){if(t[0].value==="("){t.shift();let e=fo(t);return t[0].value===")"&&t.shift(),e}else return t.shift()}function uo(t){let e="load",r=t.prefixed("load-src"),n=t.prefixed("ignore"),i={defaultStrategy:"eager",keepRelativeURLs:!1},o=!1,a={},d=0;function f(){return d++}t.asyncOptions=A=>{i={...i,...A}},t.asyncData=(A,k=!1)=>{a[A]={loaded:!1,download:k}},t.asyncUrl=(A,k)=>{!A||!k||a[A]||(a[A]={loaded:!1,download:()=>import($(k))})},t.asyncAlias=A=>{o=A};let u=A=>{t.skipDuringClone(()=>{A._x_async||(A._x_async="init",A._x_ignore=!0,A.setAttribute(n,""))})()},w=async A=>{t.skipDuringClone(async()=>{if(A._x_async!=="init")return;A._x_async="await";let{name:k,strategy:Y}=m(A);await Ua({name:k,strategy:Y,el:A,id:A.id||f()}),A.isConnected&&(await E(k),A.isConnected&&(S(A),A._x_async="loaded"))})()};w.inline=u,t.directive(e,w).before("ignore");function m(A){let k=I(A.getAttribute(t.prefixed("data"))),Y=A.getAttribute(t.prefixed(e))||i.defaultStrategy,nt=A.getAttribute(r);return nt&&t.asyncUrl(k,nt),{name:k,strategy:Y}}async function E(A){if(A.startsWith("_x_async_")||(M(A),!a[A]||a[A].loaded))return;let k=await O(A);t.data(A,k),a[A].loaded=!0}async function O(A){if(!a[A])return;let k=await a[A].download(A);return typeof k=="function"?k:k[A]||k.default||Object.values(k)[0]||!1}function S(A){t.destroyTree(A),A._x_ignore=!1,A.removeAttribute(n),!A.closest(`[${n}]`)&&t.initTree(A)}function M(A){if(!(!o||a[A])){if(typeof o=="function"){t.asyncData(A,o);return}t.asyncUrl(A,o.replaceAll("[name]",A))}}function I(A){return(A||"").split(/[({]/g)[0]||`_x_async_${f()}`}function $(A){return i.keepRelativeURLs||new RegExp("^(?:[a-z+]+:)?//","i").test(A)?A:new URL(A,document.baseURI).href}}var Uo=Jo(vo(),1);function mo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Me(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function Ga(t,e){if(t==null)return{};var r=qa(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var Ka="1.15.6";function He(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var We=He(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),tr=He(/Edge/i),go=He(/firefox/i),Gn=He(/safari/i)&&!He(/chrome/i)&&!He(/android/i),wi=He(/iP(ad|od|hone)/i),Ao=He(/chrome/i)&&He(/android/i),Do={capture:!1,passive:!1};function Ot(t,e,r){t.addEventListener(e,r,!We&&Do)}function Et(t,e,r){t.removeEventListener(e,r,!We&&Do)}function Tr(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function Co(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Se(t,e,r,n){if(t){r=r||document;do{if(e!=null&&(e[0]===">"?t.parentNode===r&&Tr(t,e):Tr(t,e))||n&&t===r)return t;if(t===r)break}while(t=Co(t))}return null}var bo=/\s+/g;function fe(t,e,r){if(t&&e)if(t.classList)t.classList[r?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(bo," ").replace(" "+e+" "," ");t.className=(n+(r?" "+e:"")).replace(bo," ")}}function at(t,e,r){var n=t&&t.style;if(n){if(r===void 0)return document.defaultView&&document.defaultView.getComputedStyle?r=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(r=t.currentStyle),e===void 0?r:r[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=r+(typeof r=="string"?"":"px")}}function Ln(t,e){var r="";if(typeof t=="string")r=t;else do{var n=at(t,"transform");n&&n!=="none"&&(r=n+" "+r)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(r)}function _o(t,e,r){if(t){var n=t.getElementsByTagName(e),i=0,o=n.length;if(r)for(;i=o:a=i<=o,!a)return n;if(n===Pe())break;n=sn(n,!1)}return!1}function Nn(t,e,r,n){for(var i=0,o=0,a=t.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,o=Ga(n,is);er.pluginEvent.bind(st)(e,r,Me({dragEl:N,parentEl:Ut,ghostEl:ut,rootEl:kt,nextEl:bn,lastDownEl:Ar,cloneEl:Wt,cloneHidden:an,dragStarted:Yn,putSortable:Zt,activeSortable:st.active,originalEvent:i,oldIndex:Fn,oldDraggableIndex:Jn,newIndex:ue,newDraggableIndex:on,hideGhostForTarget:No,unhideGhostForTarget:ko,cloneNowHidden:function(){an=!0},cloneNowShown:function(){an=!1},dispatchSortableEvent:function(d){ie({sortable:r,name:d,originalEvent:i})}},o))};function ie(t){rs(Me({putSortable:Zt,cloneEl:Wt,targetEl:N,rootEl:kt,oldIndex:Fn,oldDraggableIndex:Jn,newIndex:ue,newDraggableIndex:on},t))}var N,Ut,ut,kt,bn,Ar,Wt,an,Fn,ue,Jn,on,wr,Zt,In=!1,Pr=!1,Mr=[],mn,Oe,ci,fi,xo,Eo,Yn,Rn,Zn,Qn=!1,xr=!1,Dr,ne,ui=[],mi=!1,Rr=[],Fr=typeof document<"u",Er=wi,Oo=tr||We?"cssFloat":"float",os=Fr&&!Ao&&!wi&&"draggable"in document.createElement("div"),Io=function(){if(Fr){if(We)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),Fo=function(e,r){var n=at(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Nn(e,0,r),a=Nn(e,1,r),d=o&&at(o),f=a&&at(a),u=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+qt(o).width,w=f&&parseInt(f.marginLeft)+parseInt(f.marginRight)+qt(a).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&d.float&&d.float!=="none"){var m=d.float==="left"?"left":"right";return a&&(f.clear==="both"||f.clear===m)?"vertical":"horizontal"}return o&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||u>=i&&n[Oo]==="none"||a&&n[Oo]==="none"&&u+w>i)?"vertical":"horizontal"},as=function(e,r,n){var i=n?e.left:e.top,o=n?e.right:e.bottom,a=n?e.width:e.height,d=n?r.left:r.top,f=n?r.right:r.bottom,u=n?r.width:r.height;return i===d||o===f||i+a/2===d+u/2},ss=function(e,r){var n;return Mr.some(function(i){var o=i[se].options.emptyInsertThreshold;if(!(!o||xi(i))){var a=qt(i),d=e>=a.left-o&&e<=a.right+o,f=r>=a.top-o&&r<=a.bottom+o;if(d&&f)return n=i}}),n},Lo=function(e){function r(o,a){return function(d,f,u,w){var m=d.options.group.name&&f.options.group.name&&d.options.group.name===f.options.group.name;if(o==null&&(a||m))return!0;if(o==null||o===!1)return!1;if(a&&o==="clone")return o;if(typeof o=="function")return r(o(d,f,u,w),a)(d,f,u,w);var E=(a?d:f).options.group.name;return o===!0||typeof o=="string"&&o===E||o.join&&o.indexOf(E)>-1}}var n={},i=e.group;(!i||Sr(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=r(i.pull,!0),n.checkPut=r(i.put),n.revertClone=i.revertClone,e.group=n},No=function(){!Io&&ut&&at(ut,"display","none")},ko=function(){!Io&&ut&&at(ut,"display","")};Fr&&!Ao&&document.addEventListener("click",function(t){if(Pr)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Pr=!1,!1},!0);var gn=function(e){if(N){e=e.touches?e.touches[0]:e;var r=ss(e.clientX,e.clientY);if(r){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=r,n.preventDefault=void 0,n.stopPropagation=void 0,r[se]._onDragOver(n)}}},ls=function(e){N&&N.parentNode[se]._isOutsideThisEl(e.target)};function st(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=$e({},e),t[se]=this;var r={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Fo(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,d){a.setData("Text",d.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:st.supportPointer!==!1&&"PointerEvent"in window&&(!Gn||wi),emptyInsertThreshold:5};er.initializePlugins(this,t,r);for(var n in r)!(n in e)&&(e[n]=r[n]);Lo(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:os,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Ot(t,"pointerdown",this._onTapStart):(Ot(t,"mousedown",this._onTapStart),Ot(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ot(t,"dragover",this),Ot(t,"dragenter",this)),Mr.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),$e(this,ts())}st.prototype={constructor:st,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Rn=null)},_getDirection:function(e,r){return typeof this.options.direction=="function"?this.options.direction.call(this,e,r,N):this.options.direction},_onTapStart:function(e){if(e.cancelable){var r=this,n=this.el,i=this.options,o=i.preventOnFilter,a=e.type,d=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,f=(d||e).target,u=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||f,w=i.filter;if(ms(n),!N&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Gn&&f&&f.tagName.toUpperCase()==="SELECT")&&(f=Se(f,i.draggable,n,!1),!(f&&f.animated)&&Ar!==f)){if(Fn=ve(f),Jn=ve(f,i.draggable),typeof w=="function"){if(w.call(this,e,f,this)){ie({sortable:r,rootEl:u,name:"filter",targetEl:f,toEl:n,fromEl:n}),ae("filter",r,{evt:e}),o&&e.preventDefault();return}}else if(w&&(w=w.split(",").some(function(m){if(m=Se(u,m.trim(),n,!1),m)return ie({sortable:r,rootEl:m,name:"filter",targetEl:f,fromEl:n,toEl:n}),ae("filter",r,{evt:e}),!0}),w)){o&&e.preventDefault();return}i.handle&&!Se(u,i.handle,n,!1)||this._prepareDragStart(e,d,f)}}},_prepareDragStart:function(e,r,n){var i=this,o=i.el,a=i.options,d=o.ownerDocument,f;if(n&&!N&&n.parentNode===o){var u=qt(n);if(kt=o,N=n,Ut=N.parentNode,bn=N.nextSibling,Ar=n,wr=a.group,st.dragged=N,mn={target:N,clientX:(r||e).clientX,clientY:(r||e).clientY},xo=mn.clientX-u.left,Eo=mn.clientY-u.top,this._lastX=(r||e).clientX,this._lastY=(r||e).clientY,N.style["will-change"]="all",f=function(){if(ae("delayEnded",i,{evt:e}),st.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!go&&i.nativeDraggable&&(N.draggable=!0),i._triggerDragStart(e,r),ie({sortable:i,name:"choose",originalEvent:e}),fe(N,a.chosenClass,!0)},a.ignore.split(",").forEach(function(w){_o(N,w.trim(),di)}),Ot(d,"dragover",gn),Ot(d,"mousemove",gn),Ot(d,"touchmove",gn),a.supportPointer?(Ot(d,"pointerup",i._onDrop),!this.nativeDraggable&&Ot(d,"pointercancel",i._onDrop)):(Ot(d,"mouseup",i._onDrop),Ot(d,"touchend",i._onDrop),Ot(d,"touchcancel",i._onDrop)),go&&this.nativeDraggable&&(this.options.touchStartThreshold=4,N.draggable=!0),ae("delayStart",this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||r)&&(!this.nativeDraggable||!(tr||We))){if(st.eventCanceled){this._onDrop();return}a.supportPointer?(Ot(d,"pointerup",i._disableDelayedDrag),Ot(d,"pointercancel",i._disableDelayedDrag)):(Ot(d,"mouseup",i._disableDelayedDrag),Ot(d,"touchend",i._disableDelayedDrag),Ot(d,"touchcancel",i._disableDelayedDrag)),Ot(d,"mousemove",i._delayedDragTouchMoveHandler),Ot(d,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&Ot(d,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(f,a.delay)}else f()}},_delayedDragTouchMoveHandler:function(e){var r=e.touches?e.touches[0]:e;Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){N&&di(N),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Et(e,"mouseup",this._disableDelayedDrag),Et(e,"touchend",this._disableDelayedDrag),Et(e,"touchcancel",this._disableDelayedDrag),Et(e,"pointerup",this._disableDelayedDrag),Et(e,"pointercancel",this._disableDelayedDrag),Et(e,"mousemove",this._delayedDragTouchMoveHandler),Et(e,"touchmove",this._delayedDragTouchMoveHandler),Et(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,r){r=r||e.pointerType=="touch"&&e,!this.nativeDraggable||r?this.options.supportPointer?Ot(document,"pointermove",this._onTouchMove):r?Ot(document,"touchmove",this._onTouchMove):Ot(document,"mousemove",this._onTouchMove):(Ot(N,"dragend",this),Ot(kt,"dragstart",this._onDragStart));try{document.selection?Cr(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,r){if(In=!1,kt&&N){ae("dragStarted",this,{evt:r}),this.nativeDraggable&&Ot(document,"dragover",ls);var n=this.options;!e&&fe(N,n.dragClass,!1),fe(N,n.ghostClass,!0),st.active=this,e&&this._appendGhost(),ie({sortable:this,name:"start",originalEvent:r})}else this._nulling()},_emulateDragOver:function(){if(Oe){this._lastX=Oe.clientX,this._lastY=Oe.clientY,No();for(var e=document.elementFromPoint(Oe.clientX,Oe.clientY),r=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Oe.clientX,Oe.clientY),e!==r);)r=e;if(N.parentNode[se]._isOutsideThisEl(e),r)do{if(r[se]){var n=void 0;if(n=r[se]._onDragOver({clientX:Oe.clientX,clientY:Oe.clientY,target:e,rootEl:r}),n&&!this.options.dragoverBubble)break}e=r}while(r=Co(r));ko()}},_onTouchMove:function(e){if(mn){var r=this.options,n=r.fallbackTolerance,i=r.fallbackOffset,o=e.touches?e.touches[0]:e,a=ut&&Ln(ut,!0),d=ut&&a&&a.a,f=ut&&a&&a.d,u=Er&&ne&&wo(ne),w=(o.clientX-mn.clientX+i.x)/(d||1)+(u?u[0]-ui[0]:0)/(d||1),m=(o.clientY-mn.clientY+i.y)/(f||1)+(u?u[1]-ui[1]:0)/(f||1);if(!st.active&&!In){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(ie({rootEl:Ut,name:"add",toEl:Ut,fromEl:kt,originalEvent:e}),ie({sortable:this,name:"remove",toEl:Ut,originalEvent:e}),ie({rootEl:Ut,name:"sort",toEl:Ut,fromEl:kt,originalEvent:e}),ie({sortable:this,name:"sort",toEl:Ut,originalEvent:e})),Zt&&Zt.save()):ue!==Fn&&ue>=0&&(ie({sortable:this,name:"update",toEl:Ut,originalEvent:e}),ie({sortable:this,name:"sort",toEl:Ut,originalEvent:e})),st.active&&((ue==null||ue===-1)&&(ue=Fn,on=Jn),ie({sortable:this,name:"end",toEl:Ut,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){ae("nulling",this),kt=N=Ut=ut=bn=Wt=Ar=an=mn=Oe=Yn=ue=on=Fn=Jn=Rn=Zn=Zt=wr=st.dragged=st.ghost=st.clone=st.active=null,Rr.forEach(function(e){e.checked=!0}),Rr.length=ci=fi=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":N&&(this._onDragOver(e),cs(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],r,n=this.el.children,i=0,o=n.length,a=this.options;ii.right+o||t.clientY>n.bottom&&t.clientX>n.left:t.clientY>i.bottom+o||t.clientX>n.right&&t.clientY>n.top}function ps(t,e,r,n,i,o,a,d){var f=n?t.clientY:t.clientX,u=n?r.height:r.width,w=n?r.top:r.left,m=n?r.bottom:r.right,E=!1;if(!a){if(d&&Drw+u*o/2:fm-Dr)return-Zn}else if(f>w+u*(1-i)/2&&fm-u*o/2)?f>w+u/2?1:-1:0}function hs(t){return ve(N){t.directive("sortable",e=>{let r=parseInt(e.dataset?.sortableAnimationDuration);r!==0&&!r&&(r=300),e.sortable=Si.create(e,{group:e.getAttribute("x-sortable-group"),draggable:"[x-sortable-item]",handle:"[x-sortable-handle]",dataIdAttr:"x-sortable-item",animation:r,ghostClass:"fi-sortable-ghost"})})};var bs=Object.create,Ci=Object.defineProperty,ys=Object.getPrototypeOf,ws=Object.prototype.hasOwnProperty,xs=Object.getOwnPropertyNames,Es=Object.getOwnPropertyDescriptor,Os=t=>Ci(t,"__esModule",{value:!0}),Ho=(t,e)=>()=>(e||(e={exports:{}},t(e.exports,e)),e.exports),Ss=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xs(e))!ws.call(t,n)&&n!=="default"&&Ci(t,n,{get:()=>e[n],enumerable:!(r=Es(e,n))||r.enumerable});return t},$o=t=>Ss(Os(Ci(t!=null?bs(ys(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),As=Ho(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(c){var s=c.getBoundingClientRect();return{width:s.width,height:s.height,top:s.top,right:s.right,bottom:s.bottom,left:s.left,x:s.left,y:s.top}}function r(c){if(c==null)return window;if(c.toString()!=="[object Window]"){var s=c.ownerDocument;return s&&s.defaultView||window}return c}function n(c){var s=r(c),b=s.pageXOffset,_=s.pageYOffset;return{scrollLeft:b,scrollTop:_}}function i(c){var s=r(c).Element;return c instanceof s||c instanceof Element}function o(c){var s=r(c).HTMLElement;return c instanceof s||c instanceof HTMLElement}function a(c){if(typeof ShadowRoot>"u")return!1;var s=r(c).ShadowRoot;return c instanceof s||c instanceof ShadowRoot}function d(c){return{scrollLeft:c.scrollLeft,scrollTop:c.scrollTop}}function f(c){return c===r(c)||!o(c)?n(c):d(c)}function u(c){return c?(c.nodeName||"").toLowerCase():null}function w(c){return((i(c)?c.ownerDocument:c.document)||window.document).documentElement}function m(c){return e(w(c)).left+n(c).scrollLeft}function E(c){return r(c).getComputedStyle(c)}function O(c){var s=E(c),b=s.overflow,_=s.overflowX,T=s.overflowY;return/auto|scroll|overlay|hidden/.test(b+T+_)}function S(c,s,b){b===void 0&&(b=!1);var _=w(s),T=e(c),L=o(s),z={scrollLeft:0,scrollTop:0},H={x:0,y:0};return(L||!L&&!b)&&((u(s)!=="body"||O(_))&&(z=f(s)),o(s)?(H=e(s),H.x+=s.clientLeft,H.y+=s.clientTop):_&&(H.x=m(_))),{x:T.left+z.scrollLeft-H.x,y:T.top+z.scrollTop-H.y,width:T.width,height:T.height}}function M(c){var s=e(c),b=c.offsetWidth,_=c.offsetHeight;return Math.abs(s.width-b)<=1&&(b=s.width),Math.abs(s.height-_)<=1&&(_=s.height),{x:c.offsetLeft,y:c.offsetTop,width:b,height:_}}function I(c){return u(c)==="html"?c:c.assignedSlot||c.parentNode||(a(c)?c.host:null)||w(c)}function $(c){return["html","body","#document"].indexOf(u(c))>=0?c.ownerDocument.body:o(c)&&O(c)?c:$(I(c))}function A(c,s){var b;s===void 0&&(s=[]);var _=$(c),T=_===((b=c.ownerDocument)==null?void 0:b.body),L=r(_),z=T?[L].concat(L.visualViewport||[],O(_)?_:[]):_,H=s.concat(z);return T?H:H.concat(A(I(z)))}function k(c){return["table","td","th"].indexOf(u(c))>=0}function Y(c){return!o(c)||E(c).position==="fixed"?null:c.offsetParent}function nt(c){var s=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,b=navigator.userAgent.indexOf("Trident")!==-1;if(b&&o(c)){var _=E(c);if(_.position==="fixed")return null}for(var T=I(c);o(T)&&["html","body"].indexOf(u(T))<0;){var L=E(T);if(L.transform!=="none"||L.perspective!=="none"||L.contain==="paint"||["transform","perspective"].indexOf(L.willChange)!==-1||s&&L.willChange==="filter"||s&&L.filter&&L.filter!=="none")return T;T=T.parentNode}return null}function J(c){for(var s=r(c),b=Y(c);b&&k(b)&&E(b).position==="static";)b=Y(b);return b&&(u(b)==="html"||u(b)==="body"&&E(b).position==="static")?s:b||nt(c)||s}var U="top",dt="bottom",X="right",Z="left",mt="auto",l=[U,dt,X,Z],h="start",v="end",p="clippingParents",j="viewport",P="popper",R="reference",Q=l.reduce(function(c,s){return c.concat([s+"-"+h,s+"-"+v])},[]),Vt=[].concat(l,[mt]).reduce(function(c,s){return c.concat([s,s+"-"+h,s+"-"+v])},[]),Re="beforeRead",ze="read",Nr="afterRead",kr="beforeMain",jr="main",Ue="afterMain",nr="beforeWrite",Br="write",rr="afterWrite",Ie=[Re,ze,Nr,kr,jr,Ue,nr,Br,rr];function Hr(c){var s=new Map,b=new Set,_=[];c.forEach(function(L){s.set(L.name,L)});function T(L){b.add(L.name);var z=[].concat(L.requires||[],L.requiresIfExists||[]);z.forEach(function(H){if(!b.has(H)){var G=s.get(H);G&&T(G)}}),_.push(L)}return c.forEach(function(L){b.has(L.name)||T(L)}),_}function me(c){var s=Hr(c);return Ie.reduce(function(b,_){return b.concat(s.filter(function(T){return T.phase===_}))},[])}function Ve(c){var s;return function(){return s||(s=new Promise(function(b){Promise.resolve().then(function(){s=void 0,b(c())})})),s}}function Ae(c){for(var s=arguments.length,b=new Array(s>1?s-1:0),_=1;_=0,_=b&&o(c)?J(c):c;return i(_)?s.filter(function(T){return i(T)&&kn(T,_)&&u(T)!=="body"}):[]}function wn(c,s,b){var _=s==="clippingParents"?yn(c):[].concat(s),T=[].concat(_,[b]),L=T[0],z=T.reduce(function(H,G){var ot=sr(c,G);return H.top=ge(ot.top,H.top),H.right=ln(ot.right,H.right),H.bottom=ln(ot.bottom,H.bottom),H.left=ge(ot.left,H.left),H},sr(c,L));return z.width=z.right-z.left,z.height=z.bottom-z.top,z.x=z.left,z.y=z.top,z}function cn(c){return c.split("-")[1]}function de(c){return["top","bottom"].indexOf(c)>=0?"x":"y"}function lr(c){var s=c.reference,b=c.element,_=c.placement,T=_?oe(_):null,L=_?cn(_):null,z=s.x+s.width/2-b.width/2,H=s.y+s.height/2-b.height/2,G;switch(T){case U:G={x:z,y:s.y-b.height};break;case dt:G={x:z,y:s.y+s.height};break;case X:G={x:s.x+s.width,y:H};break;case Z:G={x:s.x-b.width,y:H};break;default:G={x:s.x,y:s.y}}var ot=T?de(T):null;if(ot!=null){var V=ot==="y"?"height":"width";switch(L){case h:G[ot]=G[ot]-(s[V]/2-b[V]/2);break;case v:G[ot]=G[ot]+(s[V]/2-b[V]/2);break}}return G}function cr(){return{top:0,right:0,bottom:0,left:0}}function fr(c){return Object.assign({},cr(),c)}function ur(c,s){return s.reduce(function(b,_){return b[_]=c,b},{})}function qe(c,s){s===void 0&&(s={});var b=s,_=b.placement,T=_===void 0?c.placement:_,L=b.boundary,z=L===void 0?p:L,H=b.rootBoundary,G=H===void 0?j:H,ot=b.elementContext,V=ot===void 0?P:ot,Ct=b.altBoundary,Lt=Ct===void 0?!1:Ct,Dt=b.padding,xt=Dt===void 0?0:Dt,Mt=fr(typeof xt!="number"?xt:ur(xt,l)),St=V===P?R:P,Bt=c.elements.reference,Rt=c.rects.popper,Ht=c.elements[Lt?St:V],ct=wn(i(Ht)?Ht:Ht.contextElement||w(c.elements.popper),z,G),Pt=e(Bt),_t=lr({reference:Pt,element:Rt,strategy:"absolute",placement:T}),Nt=Xe(Object.assign({},Rt,_t)),Ft=V===P?Nt:Pt,Yt={top:ct.top-Ft.top+Mt.top,bottom:Ft.bottom-ct.bottom+Mt.bottom,left:ct.left-Ft.left+Mt.left,right:Ft.right-ct.right+Mt.right},$t=c.modifiersData.offset;if(V===P&&$t){var zt=$t[T];Object.keys(Yt).forEach(function(we){var te=[X,dt].indexOf(we)>=0?1:-1,Le=[U,dt].indexOf(we)>=0?"y":"x";Yt[we]+=zt[Le]*te})}return Yt}var dr="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",Vr="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",xn={placement:"bottom",modifiers:[],strategy:"absolute"};function fn(){for(var c=arguments.length,s=new Array(c),b=0;b100){console.error(Vr);break}if(V.reset===!0){V.reset=!1,Pt=-1;continue}var _t=V.orderedModifiers[Pt],Nt=_t.fn,Ft=_t.options,Yt=Ft===void 0?{}:Ft,$t=_t.name;typeof Nt=="function"&&(V=Nt({state:V,options:Yt,name:$t,instance:Dt})||V)}}},update:Ve(function(){return new Promise(function(St){Dt.forceUpdate(),St(V)})}),destroy:function(){Mt(),Lt=!0}};if(!fn(H,G))return console.error(dr),Dt;Dt.setOptions(ot).then(function(St){!Lt&&ot.onFirstUpdate&&ot.onFirstUpdate(St)});function xt(){V.orderedModifiers.forEach(function(St){var Bt=St.name,Rt=St.options,Ht=Rt===void 0?{}:Rt,ct=St.effect;if(typeof ct=="function"){var Pt=ct({state:V,name:Bt,instance:Dt,options:Ht}),_t=function(){};Ct.push(Pt||_t)}})}function Mt(){Ct.forEach(function(St){return St()}),Ct=[]}return Dt}}var On={passive:!0};function Yr(c){var s=c.state,b=c.instance,_=c.options,T=_.scroll,L=T===void 0?!0:T,z=_.resize,H=z===void 0?!0:z,G=r(s.elements.popper),ot=[].concat(s.scrollParents.reference,s.scrollParents.popper);return L&&ot.forEach(function(V){V.addEventListener("scroll",b.update,On)}),H&&G.addEventListener("resize",b.update,On),function(){L&&ot.forEach(function(V){V.removeEventListener("scroll",b.update,On)}),H&&G.removeEventListener("resize",b.update,On)}}var jn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Yr,data:{}};function Xr(c){var s=c.state,b=c.name;s.modifiersData[b]=lr({reference:s.rects.reference,element:s.rects.popper,strategy:"absolute",placement:s.placement})}var Bn={name:"popperOffsets",enabled:!0,phase:"read",fn:Xr,data:{}},qr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Gr(c){var s=c.x,b=c.y,_=window,T=_.devicePixelRatio||1;return{x:Ye(Ye(s*T)/T)||0,y:Ye(Ye(b*T)/T)||0}}function Hn(c){var s,b=c.popper,_=c.popperRect,T=c.placement,L=c.offsets,z=c.position,H=c.gpuAcceleration,G=c.adaptive,ot=c.roundOffsets,V=ot===!0?Gr(L):typeof ot=="function"?ot(L):L,Ct=V.x,Lt=Ct===void 0?0:Ct,Dt=V.y,xt=Dt===void 0?0:Dt,Mt=L.hasOwnProperty("x"),St=L.hasOwnProperty("y"),Bt=Z,Rt=U,Ht=window;if(G){var ct=J(b),Pt="clientHeight",_t="clientWidth";ct===r(b)&&(ct=w(b),E(ct).position!=="static"&&(Pt="scrollHeight",_t="scrollWidth")),ct=ct,T===U&&(Rt=dt,xt-=ct[Pt]-_.height,xt*=H?1:-1),T===Z&&(Bt=X,Lt-=ct[_t]-_.width,Lt*=H?1:-1)}var Nt=Object.assign({position:z},G&&qr);if(H){var Ft;return Object.assign({},Nt,(Ft={},Ft[Rt]=St?"0":"",Ft[Bt]=Mt?"0":"",Ft.transform=(Ht.devicePixelRatio||1)<2?"translate("+Lt+"px, "+xt+"px)":"translate3d("+Lt+"px, "+xt+"px, 0)",Ft))}return Object.assign({},Nt,(s={},s[Rt]=St?xt+"px":"",s[Bt]=Mt?Lt+"px":"",s.transform="",s))}function g(c){var s=c.state,b=c.options,_=b.gpuAcceleration,T=_===void 0?!0:_,L=b.adaptive,z=L===void 0?!0:L,H=b.roundOffsets,G=H===void 0?!0:H,ot=E(s.elements.popper).transitionProperty||"";z&&["transform","top","right","bottom","left"].some(function(Ct){return ot.indexOf(Ct)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',` + +`,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",` + +`,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "));var V={placement:oe(s.placement),popper:s.elements.popper,popperRect:s.rects.popper,gpuAcceleration:T};s.modifiersData.popperOffsets!=null&&(s.styles.popper=Object.assign({},s.styles.popper,Hn(Object.assign({},V,{offsets:s.modifiersData.popperOffsets,position:s.options.strategy,adaptive:z,roundOffsets:G})))),s.modifiersData.arrow!=null&&(s.styles.arrow=Object.assign({},s.styles.arrow,Hn(Object.assign({},V,{offsets:s.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:G})))),s.attributes.popper=Object.assign({},s.attributes.popper,{"data-popper-placement":s.placement})}var y={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:g,data:{}};function D(c){var s=c.state;Object.keys(s.elements).forEach(function(b){var _=s.styles[b]||{},T=s.attributes[b]||{},L=s.elements[b];!o(L)||!u(L)||(Object.assign(L.style,_),Object.keys(T).forEach(function(z){var H=T[z];H===!1?L.removeAttribute(z):L.setAttribute(z,H===!0?"":H)}))})}function F(c){var s=c.state,b={popper:{position:s.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(s.elements.popper.style,b.popper),s.styles=b,s.elements.arrow&&Object.assign(s.elements.arrow.style,b.arrow),function(){Object.keys(s.elements).forEach(function(_){var T=s.elements[_],L=s.attributes[_]||{},z=Object.keys(s.styles.hasOwnProperty(_)?s.styles[_]:b[_]),H=z.reduce(function(G,ot){return G[ot]="",G},{});!o(T)||!u(T)||(Object.assign(T.style,H),Object.keys(L).forEach(function(G){T.removeAttribute(G)}))})}}var q={name:"applyStyles",enabled:!0,phase:"write",fn:D,effect:F,requires:["computeStyles"]};function W(c,s,b){var _=oe(c),T=[Z,U].indexOf(_)>=0?-1:1,L=typeof b=="function"?b(Object.assign({},s,{placement:c})):b,z=L[0],H=L[1];return z=z||0,H=(H||0)*T,[Z,X].indexOf(_)>=0?{x:H,y:z}:{x:z,y:H}}function B(c){var s=c.state,b=c.options,_=c.name,T=b.offset,L=T===void 0?[0,0]:T,z=Vt.reduce(function(V,Ct){return V[Ct]=W(Ct,s.rects,L),V},{}),H=z[s.placement],G=H.x,ot=H.y;s.modifiersData.popperOffsets!=null&&(s.modifiersData.popperOffsets.x+=G,s.modifiersData.popperOffsets.y+=ot),s.modifiersData[_]=z}var bt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:B},lt={left:"right",right:"left",bottom:"top",top:"bottom"};function pt(c){return c.replace(/left|right|bottom|top/g,function(s){return lt[s]})}var yt={start:"end",end:"start"};function Tt(c){return c.replace(/start|end/g,function(s){return yt[s]})}function jt(c,s){s===void 0&&(s={});var b=s,_=b.placement,T=b.boundary,L=b.rootBoundary,z=b.padding,H=b.flipVariations,G=b.allowedAutoPlacements,ot=G===void 0?Vt:G,V=cn(_),Ct=V?H?Q:Q.filter(function(xt){return cn(xt)===V}):l,Lt=Ct.filter(function(xt){return ot.indexOf(xt)>=0});Lt.length===0&&(Lt=Ct,console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var Dt=Lt.reduce(function(xt,Mt){return xt[Mt]=qe(c,{placement:Mt,boundary:T,rootBoundary:L,padding:z})[oe(Mt)],xt},{});return Object.keys(Dt).sort(function(xt,Mt){return Dt[xt]-Dt[Mt]})}function At(c){if(oe(c)===mt)return[];var s=pt(c);return[Tt(c),s,Tt(s)]}function It(c){var s=c.state,b=c.options,_=c.name;if(!s.modifiersData[_]._skip){for(var T=b.mainAxis,L=T===void 0?!0:T,z=b.altAxis,H=z===void 0?!0:z,G=b.fallbackPlacements,ot=b.padding,V=b.boundary,Ct=b.rootBoundary,Lt=b.altBoundary,Dt=b.flipVariations,xt=Dt===void 0?!0:Dt,Mt=b.allowedAutoPlacements,St=s.options.placement,Bt=oe(St),Rt=Bt===St,Ht=G||(Rt||!xt?[pt(St)]:At(St)),ct=[St].concat(Ht).reduce(function(et,gt){return et.concat(oe(gt)===mt?jt(s,{placement:gt,boundary:V,rootBoundary:Ct,padding:ot,flipVariations:xt,allowedAutoPlacements:Mt}):gt)},[]),Pt=s.rects.reference,_t=s.rects.popper,Nt=new Map,Ft=!0,Yt=ct[0],$t=0;$t=0,dn=Le?"width":"height",Ze=qe(s,{placement:zt,boundary:V,rootBoundary:Ct,altBoundary:Lt,padding:ot}),Ne=Le?te?X:Z:te?dt:U;Pt[dn]>_t[dn]&&(Ne=pt(Ne));var $n=pt(Ne),Qe=[];if(L&&Qe.push(Ze[we]<=0),H&&Qe.push(Ze[Ne]<=0,Ze[$n]<=0),Qe.every(function(et){return et})){Yt=zt,Ft=!1;break}Nt.set(zt,Qe)}if(Ft)for(var Sn=xt?3:1,Wn=function(gt){var wt=ct.find(function(Kt){var Jt=Nt.get(Kt);if(Jt)return Jt.slice(0,gt).every(function(Ce){return Ce})});if(wt)return Yt=wt,"break"},C=Sn;C>0;C--){var K=Wn(C);if(K==="break")break}s.placement!==Yt&&(s.modifiersData[_]._skip=!0,s.placement=Yt,s.reset=!0)}}var rt={name:"flip",enabled:!0,phase:"main",fn:It,requiresIfExists:["offset"],data:{_skip:!1}};function ht(c){return c==="x"?"y":"x"}function vt(c,s,b){return ge(c,ln(s,b))}function tt(c){var s=c.state,b=c.options,_=c.name,T=b.mainAxis,L=T===void 0?!0:T,z=b.altAxis,H=z===void 0?!1:z,G=b.boundary,ot=b.rootBoundary,V=b.altBoundary,Ct=b.padding,Lt=b.tether,Dt=Lt===void 0?!0:Lt,xt=b.tetherOffset,Mt=xt===void 0?0:xt,St=qe(s,{boundary:G,rootBoundary:ot,padding:Ct,altBoundary:V}),Bt=oe(s.placement),Rt=cn(s.placement),Ht=!Rt,ct=de(Bt),Pt=ht(ct),_t=s.modifiersData.popperOffsets,Nt=s.rects.reference,Ft=s.rects.popper,Yt=typeof Mt=="function"?Mt(Object.assign({},s.rects,{placement:s.placement})):Mt,$t={x:0,y:0};if(_t){if(L||H){var zt=ct==="y"?U:Z,we=ct==="y"?dt:X,te=ct==="y"?"height":"width",Le=_t[ct],dn=_t[ct]+St[zt],Ze=_t[ct]-St[we],Ne=Dt?-Ft[te]/2:0,$n=Rt===h?Nt[te]:Ft[te],Qe=Rt===h?-Ft[te]:-Nt[te],Sn=s.elements.arrow,Wn=Dt&&Sn?M(Sn):{width:0,height:0},C=s.modifiersData["arrow#persistent"]?s.modifiersData["arrow#persistent"].padding:cr(),K=C[zt],et=C[we],gt=vt(0,Nt[te],Wn[te]),wt=Ht?Nt[te]/2-Ne-gt-K-Yt:$n-gt-K-Yt,Kt=Ht?-Nt[te]/2+Ne+gt+et+Yt:Qe+gt+et+Yt,Jt=s.elements.arrow&&J(s.elements.arrow),Ce=Jt?ct==="y"?Jt.clientTop||0:Jt.clientLeft||0:0,zn=s.modifiersData.offset?s.modifiersData.offset[s.placement][ct]:0,_e=_t[ct]+wt-zn-Ce,An=_t[ct]+Kt-zn;if(L){var pn=vt(Dt?ln(dn,_e):dn,Le,Dt?ge(Ze,An):Ze);_t[ct]=pn,$t[ct]=pn-Le}if(H){var tn=ct==="x"?U:Z,Kr=ct==="x"?dt:X,en=_t[Pt],hn=en+St[tn],_i=en-St[Kr],Ti=vt(Dt?ln(hn,_e):hn,en,Dt?ge(_i,An):_i);_t[Pt]=Ti,$t[Pt]=Ti-en}}s.modifiersData[_]=$t}}var it={name:"preventOverflow",enabled:!0,phase:"main",fn:tt,requiresIfExists:["offset"]},x=function(s,b){return s=typeof s=="function"?s(Object.assign({},b.rects,{placement:b.placement})):s,fr(typeof s!="number"?s:ur(s,l))};function Gt(c){var s,b=c.state,_=c.name,T=c.options,L=b.elements.arrow,z=b.modifiersData.popperOffsets,H=oe(b.placement),G=de(H),ot=[Z,X].indexOf(H)>=0,V=ot?"height":"width";if(!(!L||!z)){var Ct=x(T.padding,b),Lt=M(L),Dt=G==="y"?U:Z,xt=G==="y"?dt:X,Mt=b.rects.reference[V]+b.rects.reference[G]-z[G]-b.rects.popper[V],St=z[G]-b.rects.reference[G],Bt=J(L),Rt=Bt?G==="y"?Bt.clientHeight||0:Bt.clientWidth||0:0,Ht=Mt/2-St/2,ct=Ct[Dt],Pt=Rt-Lt[V]-Ct[xt],_t=Rt/2-Lt[V]/2+Ht,Nt=vt(ct,_t,Pt),Ft=G;b.modifiersData[_]=(s={},s[Ft]=Nt,s.centerOffset=Nt-_t,s)}}function ft(c){var s=c.state,b=c.options,_=b.element,T=_===void 0?"[data-popper-arrow]":_;if(T!=null&&!(typeof T=="string"&&(T=s.elements.popper.querySelector(T),!T))){if(o(T)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" ")),!kn(s.elements.popper,T)){console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}s.elements.arrow=T}}var Fe={name:"arrow",enabled:!0,phase:"main",fn:Gt,effect:ft,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function be(c,s,b){return b===void 0&&(b={x:0,y:0}),{top:c.top-s.height-b.y,right:c.right-s.width+b.x,bottom:c.bottom-s.height+b.y,left:c.left-s.width-b.x}}function Ge(c){return[U,X,dt,Z].some(function(s){return c[s]>=0})}function Ke(c){var s=c.state,b=c.name,_=s.rects.reference,T=s.rects.popper,L=s.modifiersData.preventOverflow,z=qe(s,{elementContext:"reference"}),H=qe(s,{altBoundary:!0}),G=be(z,_),ot=be(H,T,L),V=Ge(G),Ct=Ge(ot);s.modifiersData[b]={referenceClippingOffsets:G,popperEscapeOffsets:ot,isReferenceHidden:V,hasPopperEscaped:Ct},s.attributes.popper=Object.assign({},s.attributes.popper,{"data-popper-reference-hidden":V,"data-popper-escaped":Ct})}var Je={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ke},re=[jn,Bn,y,q],le=En({defaultModifiers:re}),ye=[jn,Bn,y,q,bt,rt,it,Fe,Je],un=En({defaultModifiers:ye});t.applyStyles=q,t.arrow=Fe,t.computeStyles=y,t.createPopper=un,t.createPopperLite=le,t.defaultModifiers=ye,t.detectOverflow=qe,t.eventListeners=jn,t.flip=rt,t.hide=Je,t.offset=bt,t.popperGenerator=En,t.popperOffsets=Bn,t.preventOverflow=it}),Wo=Ho(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=As(),r='',n="tippy-box",i="tippy-content",o="tippy-backdrop",a="tippy-arrow",d="tippy-svg-arrow",f={passive:!0,capture:!0};function u(g,y){return{}.hasOwnProperty.call(g,y)}function w(g,y,D){if(Array.isArray(g)){var F=g[y];return F??(Array.isArray(D)?D[y]:D)}return g}function m(g,y){var D={}.toString.call(g);return D.indexOf("[object")===0&&D.indexOf(y+"]")>-1}function E(g,y){return typeof g=="function"?g.apply(void 0,y):g}function O(g,y){if(y===0)return g;var D;return function(F){clearTimeout(D),D=setTimeout(function(){g(F)},y)}}function S(g,y){var D=Object.assign({},g);return y.forEach(function(F){delete D[F]}),D}function M(g){return g.split(/\s+/).filter(Boolean)}function I(g){return[].concat(g)}function $(g,y){g.indexOf(y)===-1&&g.push(y)}function A(g){return g.filter(function(y,D){return g.indexOf(y)===D})}function k(g){return g.split("-")[0]}function Y(g){return[].slice.call(g)}function nt(g){return Object.keys(g).reduce(function(y,D){return g[D]!==void 0&&(y[D]=g[D]),y},{})}function J(){return document.createElement("div")}function U(g){return["Element","Fragment"].some(function(y){return m(g,y)})}function dt(g){return m(g,"NodeList")}function X(g){return m(g,"MouseEvent")}function Z(g){return!!(g&&g._tippy&&g._tippy.reference===g)}function mt(g){return U(g)?[g]:dt(g)?Y(g):Array.isArray(g)?g:Y(document.querySelectorAll(g))}function l(g,y){g.forEach(function(D){D&&(D.style.transitionDuration=y+"ms")})}function h(g,y){g.forEach(function(D){D&&D.setAttribute("data-state",y)})}function v(g){var y,D=I(g),F=D[0];return!(F==null||(y=F.ownerDocument)==null)&&y.body?F.ownerDocument:document}function p(g,y){var D=y.clientX,F=y.clientY;return g.every(function(q){var W=q.popperRect,B=q.popperState,bt=q.props,lt=bt.interactiveBorder,pt=k(B.placement),yt=B.modifiersData.offset;if(!yt)return!0;var Tt=pt==="bottom"?yt.top.y:0,jt=pt==="top"?yt.bottom.y:0,At=pt==="right"?yt.left.x:0,It=pt==="left"?yt.right.x:0,rt=W.top-F+Tt>lt,ht=F-W.bottom-jt>lt,vt=W.left-D+At>lt,tt=D-W.right-It>lt;return rt||ht||vt||tt})}function j(g,y,D){var F=y+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(q){g[F](q,D)})}var P={isTouch:!1},R=0;function Q(){P.isTouch||(P.isTouch=!0,window.performance&&document.addEventListener("mousemove",Vt))}function Vt(){var g=performance.now();g-R<20&&(P.isTouch=!1,document.removeEventListener("mousemove",Vt)),R=g}function Re(){var g=document.activeElement;if(Z(g)){var y=g._tippy;g.blur&&!y.state.isVisible&&g.blur()}}function ze(){document.addEventListener("touchstart",Q,f),window.addEventListener("blur",Re)}var Nr=typeof window<"u"&&typeof document<"u",kr=Nr?navigator.userAgent:"",jr=/MSIE |Trident\//.test(kr);function Ue(g){var y=g==="destroy"?"n already-":" ";return[g+"() was called on a"+y+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function nr(g){var y=/[ \t]{2,}/g,D=/^[ \t]*/gm;return g.replace(y," ").replace(D,"").trim()}function Br(g){return nr(` + %ctippy.js + + %c`+nr(g)+` + + %c\u{1F477}\u200D This is a development-only message. It will be removed in production. + `)}function rr(g){return[Br(g),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Ie;Hr();function Hr(){Ie=new Set}function me(g,y){if(g&&!Ie.has(y)){var D;Ie.add(y),(D=console).warn.apply(D,rr(y))}}function Ve(g,y){if(g&&!Ie.has(y)){var D;Ie.add(y),(D=console).error.apply(D,rr(y))}}function Ae(g){var y=!g,D=Object.prototype.toString.call(g)==="[object Object]"&&!g.addEventListener;Ve(y,["tippy() was passed","`"+String(g)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Ve(D,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var De={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},$r={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Qt=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},De,{},$r),Wr=Object.keys(Qt),zr=function(y){ge(y,[]);var D=Object.keys(y);D.forEach(function(F){Qt[F]=y[F]})};function oe(g){var y=g.plugins||[],D=y.reduce(function(F,q){var W=q.name,B=q.defaultValue;return W&&(F[W]=g[W]!==void 0?g[W]:B),F},{});return Object.assign({},g,{},D)}function Ur(g,y){var D=y?Object.keys(oe(Object.assign({},Qt,{plugins:y}))):Wr,F=D.reduce(function(q,W){var B=(g.getAttribute("data-tippy-"+W)||"").trim();if(!B)return q;if(W==="content")q[W]=B;else try{q[W]=JSON.parse(B)}catch{q[W]=B}return q},{});return F}function ir(g,y){var D=Object.assign({},y,{content:E(y.content,[g])},y.ignoreAttributes?{}:Ur(g,y.plugins));return D.aria=Object.assign({},Qt.aria,{},D.aria),D.aria={expanded:D.aria.expanded==="auto"?y.interactive:D.aria.expanded,content:D.aria.content==="auto"?y.interactive?null:"describedby":D.aria.content},D}function ge(g,y){g===void 0&&(g={}),y===void 0&&(y=[]);var D=Object.keys(g);D.forEach(function(F){var q=S(Qt,Object.keys(De)),W=!u(q,F);W&&(W=y.filter(function(B){return B.name===F}).length===0),me(W,["`"+F+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",` + +`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/ +`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var ln=function(){return"innerHTML"};function Ye(g,y){g[ln()]=y}function or(g){var y=J();return g===!0?y.className=a:(y.className=d,U(g)?y.appendChild(g):Ye(y,g)),y}function kn(g,y){U(y.content)?(Ye(g,""),g.appendChild(y.content)):typeof y.content!="function"&&(y.allowHTML?Ye(g,y.content):g.textContent=y.content)}function Xe(g){var y=g.firstElementChild,D=Y(y.children);return{box:y,content:D.find(function(F){return F.classList.contains(i)}),arrow:D.find(function(F){return F.classList.contains(a)||F.classList.contains(d)}),backdrop:D.find(function(F){return F.classList.contains(o)})}}function ar(g){var y=J(),D=J();D.className=n,D.setAttribute("data-state","hidden"),D.setAttribute("tabindex","-1");var F=J();F.className=i,F.setAttribute("data-state","hidden"),kn(F,g.props),y.appendChild(D),D.appendChild(F),q(g.props,g.props);function q(W,B){var bt=Xe(y),lt=bt.box,pt=bt.content,yt=bt.arrow;B.theme?lt.setAttribute("data-theme",B.theme):lt.removeAttribute("data-theme"),typeof B.animation=="string"?lt.setAttribute("data-animation",B.animation):lt.removeAttribute("data-animation"),B.inertia?lt.setAttribute("data-inertia",""):lt.removeAttribute("data-inertia"),lt.style.maxWidth=typeof B.maxWidth=="number"?B.maxWidth+"px":B.maxWidth,B.role?lt.setAttribute("role",B.role):lt.removeAttribute("role"),(W.content!==B.content||W.allowHTML!==B.allowHTML)&&kn(pt,g.props),B.arrow?yt?W.arrow!==B.arrow&&(lt.removeChild(yt),lt.appendChild(or(B.arrow))):lt.appendChild(or(B.arrow)):yt&<.removeChild(yt)}return{popper:y,onUpdate:q}}ar.$$tippy=!0;var sr=1,yn=[],wn=[];function cn(g,y){var D=ir(g,Object.assign({},Qt,{},oe(nt(y)))),F,q,W,B=!1,bt=!1,lt=!1,pt=!1,yt,Tt,jt,At=[],It=O(Rt,D.interactiveDebounce),rt,ht=sr++,vt=null,tt=A(D.plugins),it={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},x={id:ht,reference:g,popper:J(),popperInstance:vt,props:D,state:it,plugins:tt,clearDelayTimeouts:Le,setProps:dn,setContent:Ze,show:Ne,hide:$n,hideWithInteractivity:Qe,enable:we,disable:te,unmount:Sn,destroy:Wn};if(!D.render)return Ve(!0,"render() function has not been supplied."),x;var Gt=D.render(x),ft=Gt.popper,Fe=Gt.onUpdate;ft.setAttribute("data-tippy-root",""),ft.id="tippy-"+x.id,x.popper=ft,g._tippy=x,ft._tippy=x;var be=tt.map(function(C){return C.fn(x)}),Ge=g.hasAttribute("aria-expanded");return Mt(),T(),s(),b("onCreate",[x]),D.showOnCreate&&$t(),ft.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),ft.addEventListener("mouseleave",function(C){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&(ye().addEventListener("mousemove",It),It(C))}),x;function Ke(){var C=x.props.touch;return Array.isArray(C)?C:[C,0]}function Je(){return Ke()[0]==="hold"}function re(){var C;return!!((C=x.props.render)!=null&&C.$$tippy)}function le(){return rt||g}function ye(){var C=le().parentNode;return C?v(C):document}function un(){return Xe(ft)}function c(C){return x.state.isMounted&&!x.state.isVisible||P.isTouch||yt&&yt.type==="focus"?0:w(x.props.delay,C?0:1,Qt.delay)}function s(){ft.style.pointerEvents=x.props.interactive&&x.state.isVisible?"":"none",ft.style.zIndex=""+x.props.zIndex}function b(C,K,et){if(et===void 0&&(et=!0),be.forEach(function(wt){wt[C]&&wt[C].apply(void 0,K)}),et){var gt;(gt=x.props)[C].apply(gt,K)}}function _(){var C=x.props.aria;if(C.content){var K="aria-"+C.content,et=ft.id,gt=I(x.props.triggerTarget||g);gt.forEach(function(wt){var Kt=wt.getAttribute(K);if(x.state.isVisible)wt.setAttribute(K,Kt?Kt+" "+et:et);else{var Jt=Kt&&Kt.replace(et,"").trim();Jt?wt.setAttribute(K,Jt):wt.removeAttribute(K)}})}}function T(){if(!(Ge||!x.props.aria.expanded)){var C=I(x.props.triggerTarget||g);C.forEach(function(K){x.props.interactive?K.setAttribute("aria-expanded",x.state.isVisible&&K===le()?"true":"false"):K.removeAttribute("aria-expanded")})}}function L(){ye().removeEventListener("mousemove",It),yn=yn.filter(function(C){return C!==It})}function z(C){if(!(P.isTouch&&(lt||C.type==="mousedown"))&&!(x.props.interactive&&ft.contains(C.target))){if(le().contains(C.target)){if(P.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else b("onClickOutside",[x,C]);x.props.hideOnClick===!0&&(x.clearDelayTimeouts(),x.hide(),bt=!0,setTimeout(function(){bt=!1}),x.state.isMounted||V())}}function H(){lt=!0}function G(){lt=!1}function ot(){var C=ye();C.addEventListener("mousedown",z,!0),C.addEventListener("touchend",z,f),C.addEventListener("touchstart",G,f),C.addEventListener("touchmove",H,f)}function V(){var C=ye();C.removeEventListener("mousedown",z,!0),C.removeEventListener("touchend",z,f),C.removeEventListener("touchstart",G,f),C.removeEventListener("touchmove",H,f)}function Ct(C,K){Dt(C,function(){!x.state.isVisible&&ft.parentNode&&ft.parentNode.contains(ft)&&K()})}function Lt(C,K){Dt(C,K)}function Dt(C,K){var et=un().box;function gt(wt){wt.target===et&&(j(et,"remove",gt),K())}if(C===0)return K();j(et,"remove",Tt),j(et,"add",gt),Tt=gt}function xt(C,K,et){et===void 0&&(et=!1);var gt=I(x.props.triggerTarget||g);gt.forEach(function(wt){wt.addEventListener(C,K,et),At.push({node:wt,eventType:C,handler:K,options:et})})}function Mt(){Je()&&(xt("touchstart",Bt,{passive:!0}),xt("touchend",Ht,{passive:!0})),M(x.props.trigger).forEach(function(C){if(C!=="manual")switch(xt(C,Bt),C){case"mouseenter":xt("mouseleave",Ht);break;case"focus":xt(jr?"focusout":"blur",ct);break;case"focusin":xt("focusout",ct);break}})}function St(){At.forEach(function(C){var K=C.node,et=C.eventType,gt=C.handler,wt=C.options;K.removeEventListener(et,gt,wt)}),At=[]}function Bt(C){var K,et=!1;if(!(!x.state.isEnabled||Pt(C)||bt)){var gt=((K=yt)==null?void 0:K.type)==="focus";yt=C,rt=C.currentTarget,T(),!x.state.isVisible&&X(C)&&yn.forEach(function(wt){return wt(C)}),C.type==="click"&&(x.props.trigger.indexOf("mouseenter")<0||B)&&x.props.hideOnClick!==!1&&x.state.isVisible?et=!0:$t(C),C.type==="click"&&(B=!et),et&&!gt&&zt(C)}}function Rt(C){var K=C.target,et=le().contains(K)||ft.contains(K);if(!(C.type==="mousemove"&&et)){var gt=Yt().concat(ft).map(function(wt){var Kt,Jt=wt._tippy,Ce=(Kt=Jt.popperInstance)==null?void 0:Kt.state;return Ce?{popperRect:wt.getBoundingClientRect(),popperState:Ce,props:D}:null}).filter(Boolean);p(gt,C)&&(L(),zt(C))}}function Ht(C){var K=Pt(C)||x.props.trigger.indexOf("click")>=0&&B;if(!K){if(x.props.interactive){x.hideWithInteractivity(C);return}zt(C)}}function ct(C){x.props.trigger.indexOf("focusin")<0&&C.target!==le()||x.props.interactive&&C.relatedTarget&&ft.contains(C.relatedTarget)||zt(C)}function Pt(C){return P.isTouch?Je()!==C.type.indexOf("touch")>=0:!1}function _t(){Nt();var C=x.props,K=C.popperOptions,et=C.placement,gt=C.offset,wt=C.getReferenceClientRect,Kt=C.moveTransition,Jt=re()?Xe(ft).arrow:null,Ce=wt?{getBoundingClientRect:wt,contextElement:wt.contextElement||le()}:g,zn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(pn){var tn=pn.state;if(re()){var Kr=un(),en=Kr.box;["placement","reference-hidden","escaped"].forEach(function(hn){hn==="placement"?en.setAttribute("data-placement",tn.placement):tn.attributes.popper["data-popper-"+hn]?en.setAttribute("data-"+hn,""):en.removeAttribute("data-"+hn)}),tn.attributes.popper={}}}},_e=[{name:"offset",options:{offset:gt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Kt}},zn];re()&&Jt&&_e.push({name:"arrow",options:{element:Jt,padding:3}}),_e.push.apply(_e,K?.modifiers||[]),x.popperInstance=e.createPopper(Ce,ft,Object.assign({},K,{placement:et,onFirstUpdate:jt,modifiers:_e}))}function Nt(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function Ft(){var C=x.props.appendTo,K,et=le();x.props.interactive&&C===Qt.appendTo||C==="parent"?K=et.parentNode:K=E(C,[et]),K.contains(ft)||K.appendChild(ft),_t(),me(x.props.interactive&&C===Qt.appendTo&&et.nextElementSibling!==ft,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",` + +`,"Using a wrapper
or tag around the reference element","solves this by creating a new parentNode context.",` + +`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",` + +`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Yt(){return Y(ft.querySelectorAll("[data-tippy-root]"))}function $t(C){x.clearDelayTimeouts(),C&&b("onTrigger",[x,C]),ot();var K=c(!0),et=Ke(),gt=et[0],wt=et[1];P.isTouch&>==="hold"&&wt&&(K=wt),K?F=setTimeout(function(){x.show()},K):x.show()}function zt(C){if(x.clearDelayTimeouts(),b("onUntrigger",[x,C]),!x.state.isVisible){V();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(C.type)>=0&&B)){var K=c(!1);K?q=setTimeout(function(){x.state.isVisible&&x.hide()},K):W=requestAnimationFrame(function(){x.hide()})}}function we(){x.state.isEnabled=!0}function te(){x.hide(),x.state.isEnabled=!1}function Le(){clearTimeout(F),clearTimeout(q),cancelAnimationFrame(W)}function dn(C){if(me(x.state.isDestroyed,Ue("setProps")),!x.state.isDestroyed){b("onBeforeUpdate",[x,C]),St();var K=x.props,et=ir(g,Object.assign({},x.props,{},C,{ignoreAttributes:!0}));x.props=et,Mt(),K.interactiveDebounce!==et.interactiveDebounce&&(L(),It=O(Rt,et.interactiveDebounce)),K.triggerTarget&&!et.triggerTarget?I(K.triggerTarget).forEach(function(gt){gt.removeAttribute("aria-expanded")}):et.triggerTarget&&g.removeAttribute("aria-expanded"),T(),s(),Fe&&Fe(K,et),x.popperInstance&&(_t(),Yt().forEach(function(gt){requestAnimationFrame(gt._tippy.popperInstance.forceUpdate)})),b("onAfterUpdate",[x,C])}}function Ze(C){x.setProps({content:C})}function Ne(){me(x.state.isDestroyed,Ue("show"));var C=x.state.isVisible,K=x.state.isDestroyed,et=!x.state.isEnabled,gt=P.isTouch&&!x.props.touch,wt=w(x.props.duration,0,Qt.duration);if(!(C||K||et||gt)&&!le().hasAttribute("disabled")&&(b("onShow",[x],!1),x.props.onShow(x)!==!1)){if(x.state.isVisible=!0,re()&&(ft.style.visibility="visible"),s(),ot(),x.state.isMounted||(ft.style.transition="none"),re()){var Kt=un(),Jt=Kt.box,Ce=Kt.content;l([Jt,Ce],0)}jt=function(){var _e;if(!(!x.state.isVisible||pt)){if(pt=!0,ft.offsetHeight,ft.style.transition=x.props.moveTransition,re()&&x.props.animation){var An=un(),pn=An.box,tn=An.content;l([pn,tn],wt),h([pn,tn],"visible")}_(),T(),$(wn,x),(_e=x.popperInstance)==null||_e.forceUpdate(),x.state.isMounted=!0,b("onMount",[x]),x.props.animation&&re()&&Lt(wt,function(){x.state.isShown=!0,b("onShown",[x])})}},Ft()}}function $n(){me(x.state.isDestroyed,Ue("hide"));var C=!x.state.isVisible,K=x.state.isDestroyed,et=!x.state.isEnabled,gt=w(x.props.duration,1,Qt.duration);if(!(C||K||et)&&(b("onHide",[x],!1),x.props.onHide(x)!==!1)){if(x.state.isVisible=!1,x.state.isShown=!1,pt=!1,B=!1,re()&&(ft.style.visibility="hidden"),L(),V(),s(),re()){var wt=un(),Kt=wt.box,Jt=wt.content;x.props.animation&&(l([Kt,Jt],gt),h([Kt,Jt],"hidden"))}_(),T(),x.props.animation?re()&&Ct(gt,x.unmount):x.unmount()}}function Qe(C){me(x.state.isDestroyed,Ue("hideWithInteractivity")),ye().addEventListener("mousemove",It),$(yn,It),It(C)}function Sn(){me(x.state.isDestroyed,Ue("unmount")),x.state.isVisible&&x.hide(),x.state.isMounted&&(Nt(),Yt().forEach(function(C){C._tippy.unmount()}),ft.parentNode&&ft.parentNode.removeChild(ft),wn=wn.filter(function(C){return C!==x}),x.state.isMounted=!1,b("onHidden",[x]))}function Wn(){me(x.state.isDestroyed,Ue("destroy")),!x.state.isDestroyed&&(x.clearDelayTimeouts(),x.unmount(),St(),delete g._tippy,x.state.isDestroyed=!0,b("onDestroy",[x]))}}function de(g,y){y===void 0&&(y={});var D=Qt.plugins.concat(y.plugins||[]);Ae(g),ge(y,D),ze();var F=Object.assign({},y,{plugins:D}),q=mt(g),W=U(F.content),B=q.length>1;me(W&&B,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",` + +`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",` + +`,`1) content: element.innerHTML +`,"2) content: () => element.cloneNode(true)"].join(" "));var bt=q.reduce(function(lt,pt){var yt=pt&&cn(pt,F);return yt&<.push(yt),lt},[]);return U(g)?bt[0]:bt}de.defaultProps=Qt,de.setDefaultProps=zr,de.currentInput=P;var lr=function(y){var D=y===void 0?{}:y,F=D.exclude,q=D.duration;wn.forEach(function(W){var B=!1;if(F&&(B=Z(F)?W.reference===F:W.popper===F.popper),!B){var bt=W.props.duration;W.setProps({duration:q}),W.hide(),W.state.isDestroyed||W.setProps({duration:bt})}})},cr=Object.assign({},e.applyStyles,{effect:function(y){var D=y.state,F={popper:{position:D.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(D.elements.popper.style,F.popper),D.styles=F,D.elements.arrow&&Object.assign(D.elements.arrow.style,F.arrow)}}),fr=function(y,D){var F;D===void 0&&(D={}),Ve(!Array.isArray(y),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(y)].join(" "));var q=y,W=[],B,bt=D.overrides,lt=[],pt=!1;function yt(){W=q.map(function(tt){return tt.reference})}function Tt(tt){q.forEach(function(it){tt?it.enable():it.disable()})}function jt(tt){return q.map(function(it){var x=it.setProps;return it.setProps=function(Gt){x(Gt),it.reference===B&&tt.setProps(Gt)},function(){it.setProps=x}})}function At(tt,it){var x=W.indexOf(it);if(it!==B){B=it;var Gt=(bt||[]).concat("content").reduce(function(ft,Fe){return ft[Fe]=q[x].props[Fe],ft},{});tt.setProps(Object.assign({},Gt,{getReferenceClientRect:typeof Gt.getReferenceClientRect=="function"?Gt.getReferenceClientRect:function(){return it.getBoundingClientRect()}}))}}Tt(!1),yt();var It={fn:function(){return{onDestroy:function(){Tt(!0)},onHidden:function(){B=null},onClickOutside:function(x){x.props.showOnCreate&&!pt&&(pt=!0,B=null)},onShow:function(x){x.props.showOnCreate&&!pt&&(pt=!0,At(x,W[0]))},onTrigger:function(x,Gt){At(x,Gt.currentTarget)}}}},rt=de(J(),Object.assign({},S(D,["overrides"]),{plugins:[It].concat(D.plugins||[]),triggerTarget:W,popperOptions:Object.assign({},D.popperOptions,{modifiers:[].concat(((F=D.popperOptions)==null?void 0:F.modifiers)||[],[cr])})})),ht=rt.show;rt.show=function(tt){if(ht(),!B&&tt==null)return At(rt,W[0]);if(!(B&&tt==null)){if(typeof tt=="number")return W[tt]&&At(rt,W[tt]);if(q.includes(tt)){var it=tt.reference;return At(rt,it)}if(W.includes(tt))return At(rt,tt)}},rt.showNext=function(){var tt=W[0];if(!B)return rt.show(0);var it=W.indexOf(B);rt.show(W[it+1]||tt)},rt.showPrevious=function(){var tt=W[W.length-1];if(!B)return rt.show(tt);var it=W.indexOf(B),x=W[it-1]||tt;rt.show(x)};var vt=rt.setProps;return rt.setProps=function(tt){bt=tt.overrides||bt,vt(tt)},rt.setInstances=function(tt){Tt(!0),lt.forEach(function(it){return it()}),q=tt,Tt(!1),yt(),jt(rt),rt.setProps({triggerTarget:W})},lt=jt(rt),rt},ur={mouseover:"mouseenter",focusin:"focus",click:"click"};function qe(g,y){Ve(!(y&&y.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var D=[],F=[],q=!1,W=y.target,B=S(y,["target"]),bt=Object.assign({},B,{trigger:"manual",touch:!1}),lt=Object.assign({},B,{showOnCreate:!0}),pt=de(g,bt),yt=I(pt);function Tt(ht){if(!(!ht.target||q)){var vt=ht.target.closest(W);if(vt){var tt=vt.getAttribute("data-tippy-trigger")||y.trigger||Qt.trigger;if(!vt._tippy&&!(ht.type==="touchstart"&&typeof lt.touch=="boolean")&&!(ht.type!=="touchstart"&&tt.indexOf(ur[ht.type])<0)){var it=de(vt,lt);it&&(F=F.concat(it))}}}}function jt(ht,vt,tt,it){it===void 0&&(it=!1),ht.addEventListener(vt,tt,it),D.push({node:ht,eventType:vt,handler:tt,options:it})}function At(ht){var vt=ht.reference;jt(vt,"touchstart",Tt,f),jt(vt,"mouseover",Tt),jt(vt,"focusin",Tt),jt(vt,"click",Tt)}function It(){D.forEach(function(ht){var vt=ht.node,tt=ht.eventType,it=ht.handler,x=ht.options;vt.removeEventListener(tt,it,x)}),D=[]}function rt(ht){var vt=ht.destroy,tt=ht.enable,it=ht.disable;ht.destroy=function(x){x===void 0&&(x=!0),x&&F.forEach(function(Gt){Gt.destroy()}),F=[],It(),vt()},ht.enable=function(){tt(),F.forEach(function(x){return x.enable()}),q=!1},ht.disable=function(){it(),F.forEach(function(x){return x.disable()}),q=!0},At(ht)}return yt.forEach(rt),pt}var dr={name:"animateFill",defaultValue:!1,fn:function(y){var D;if(!((D=y.props.render)!=null&&D.$$tippy))return Ve(y.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var F=Xe(y.popper),q=F.box,W=F.content,B=y.props.animateFill?Vr():null;return{onCreate:function(){B&&(q.insertBefore(B,q.firstElementChild),q.setAttribute("data-animatefill",""),q.style.overflow="hidden",y.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(B){var lt=q.style.transitionDuration,pt=Number(lt.replace("ms",""));W.style.transitionDelay=Math.round(pt/10)+"ms",B.style.transitionDuration=lt,h([B],"visible")}},onShow:function(){B&&(B.style.transitionDuration="0ms")},onHide:function(){B&&h([B],"hidden")}}}};function Vr(){var g=J();return g.className=o,h([g],"hidden"),g}var xn={clientX:0,clientY:0},fn=[];function En(g){var y=g.clientX,D=g.clientY;xn={clientX:y,clientY:D}}function On(g){g.addEventListener("mousemove",En)}function Yr(g){g.removeEventListener("mousemove",En)}var jn={name:"followCursor",defaultValue:!1,fn:function(y){var D=y.reference,F=v(y.props.triggerTarget||D),q=!1,W=!1,B=!0,bt=y.props;function lt(){return y.props.followCursor==="initial"&&y.state.isVisible}function pt(){F.addEventListener("mousemove",jt)}function yt(){F.removeEventListener("mousemove",jt)}function Tt(){q=!0,y.setProps({getReferenceClientRect:null}),q=!1}function jt(rt){var ht=rt.target?D.contains(rt.target):!0,vt=y.props.followCursor,tt=rt.clientX,it=rt.clientY,x=D.getBoundingClientRect(),Gt=tt-x.left,ft=it-x.top;(ht||!y.props.interactive)&&y.setProps({getReferenceClientRect:function(){var be=D.getBoundingClientRect(),Ge=tt,Ke=it;vt==="initial"&&(Ge=be.left+Gt,Ke=be.top+ft);var Je=vt==="horizontal"?be.top:Ke,re=vt==="vertical"?be.right:Ge,le=vt==="horizontal"?be.bottom:Ke,ye=vt==="vertical"?be.left:Ge;return{width:re-ye,height:le-Je,top:Je,right:re,bottom:le,left:ye}}})}function At(){y.props.followCursor&&(fn.push({instance:y,doc:F}),On(F))}function It(){fn=fn.filter(function(rt){return rt.instance!==y}),fn.filter(function(rt){return rt.doc===F}).length===0&&Yr(F)}return{onCreate:At,onDestroy:It,onBeforeUpdate:function(){bt=y.props},onAfterUpdate:function(ht,vt){var tt=vt.followCursor;q||tt!==void 0&&bt.followCursor!==tt&&(It(),tt?(At(),y.state.isMounted&&!W&&!lt()&&pt()):(yt(),Tt()))},onMount:function(){y.props.followCursor&&!W&&(B&&(jt(xn),B=!1),lt()||pt())},onTrigger:function(ht,vt){X(vt)&&(xn={clientX:vt.clientX,clientY:vt.clientY}),W=vt.type==="focus"},onHidden:function(){y.props.followCursor&&(Tt(),yt(),B=!0)}}}};function Xr(g,y){var D;return{popperOptions:Object.assign({},g.popperOptions,{modifiers:[].concat((((D=g.popperOptions)==null?void 0:D.modifiers)||[]).filter(function(F){var q=F.name;return q!==y.name}),[y])})}}var Bn={name:"inlinePositioning",defaultValue:!1,fn:function(y){var D=y.reference;function F(){return!!y.props.inlinePositioning}var q,W=-1,B=!1,bt={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(jt){var At=jt.state;F()&&(q!==At.placement&&y.setProps({getReferenceClientRect:function(){return lt(At.placement)}}),q=At.placement)}};function lt(Tt){return qr(k(Tt),D.getBoundingClientRect(),Y(D.getClientRects()),W)}function pt(Tt){B=!0,y.setProps(Tt),B=!1}function yt(){B||pt(Xr(y.props,bt))}return{onCreate:yt,onAfterUpdate:yt,onTrigger:function(jt,At){if(X(At)){var It=Y(y.reference.getClientRects()),rt=It.find(function(ht){return ht.left-2<=At.clientX&&ht.right+2>=At.clientX&&ht.top-2<=At.clientY&&ht.bottom+2>=At.clientY});W=It.indexOf(rt)}},onUntrigger:function(){W=-1}}}};function qr(g,y,D,F){if(D.length<2||g===null)return y;if(D.length===2&&F>=0&&D[0].left>D[1].right)return D[F]||y;switch(g){case"top":case"bottom":{var q=D[0],W=D[D.length-1],B=g==="top",bt=q.top,lt=W.bottom,pt=B?q.left:W.left,yt=B?q.right:W.right,Tt=yt-pt,jt=lt-bt;return{top:bt,bottom:lt,left:pt,right:yt,width:Tt,height:jt}}case"left":case"right":{var At=Math.min.apply(Math,D.map(function(ft){return ft.left})),It=Math.max.apply(Math,D.map(function(ft){return ft.right})),rt=D.filter(function(ft){return g==="left"?ft.left===At:ft.right===It}),ht=rt[0].top,vt=rt[rt.length-1].bottom,tt=At,it=It,x=it-tt,Gt=vt-ht;return{top:ht,bottom:vt,left:tt,right:it,width:x,height:Gt}}default:return y}}var Gr={name:"sticky",defaultValue:!1,fn:function(y){var D=y.reference,F=y.popper;function q(){return y.popperInstance?y.popperInstance.state.elements.reference:D}function W(pt){return y.props.sticky===!0||y.props.sticky===pt}var B=null,bt=null;function lt(){var pt=W("reference")?q().getBoundingClientRect():null,yt=W("popper")?F.getBoundingClientRect():null;(pt&&Hn(B,pt)||yt&&Hn(bt,yt))&&y.popperInstance&&y.popperInstance.update(),B=pt,bt=yt,y.state.isMounted&&requestAnimationFrame(lt)}return{onMount:function(){y.props.sticky&<()}}}};function Hn(g,y){return g&&y?g.top!==y.top||g.right!==y.right||g.bottom!==y.bottom||g.left!==y.left:!0}de.setDefaultProps({render:ar}),t.animateFill=dr,t.createSingleton=fr,t.default=de,t.delegate=qe,t.followCursor=jn,t.hideAll=lr,t.inlinePositioning=Bn,t.roundArrow=r,t.sticky=Gr}),Ai=$o(Wo()),Ds=$o(Wo()),Cs=t=>{let e={plugins:[]},r=i=>t[t.indexOf(i)+1];if(t.includes("animation")&&(e.animation=r("animation")),t.includes("duration")&&(e.duration=parseInt(r("duration"))),t.includes("delay")){let i=r("delay");e.delay=i.includes("-")?i.split("-").map(o=>parseInt(o)):parseInt(i)}if(t.includes("cursor")){e.plugins.push(Ds.followCursor);let i=r("cursor");["x","initial"].includes(i)?e.followCursor=i==="x"?"horizontal":"initial":e.followCursor=!0}t.includes("on")&&(e.trigger=r("on")),t.includes("arrowless")&&(e.arrow=!1),t.includes("html")&&(e.allowHTML=!0),t.includes("interactive")&&(e.interactive=!0),t.includes("border")&&e.interactive&&(e.interactiveBorder=parseInt(r("border"))),t.includes("debounce")&&e.interactive&&(e.interactiveDebounce=parseInt(r("debounce"))),t.includes("max-width")&&(e.maxWidth=parseInt(r("max-width"))),t.includes("theme")&&(e.theme=r("theme")),t.includes("placement")&&(e.placement=r("placement"));let n={};return t.includes("no-flip")&&(n.modifiers||(n.modifiers=[]),n.modifiers.push({name:"flip",enabled:!1})),e.popperOptions=n,e};function Di(t){t.magic("tooltip",e=>(r,n={})=>{let i=n.timeout;delete n.timeout;let o=(0,Ai.default)(e,{content:r,trigger:"manual",...n});o.show(),setTimeout(()=>{o.hide(),setTimeout(()=>o.destroy(),n.duration||300)},i||2e3)}),t.directive("tooltip",(e,{modifiers:r,expression:n},{evaluateLater:i,effect:o,cleanup:a})=>{let d=r.length>0?Cs(r):{};e.__x_tippy||(e.__x_tippy=(0,Ai.default)(e,d)),a(()=>{e.__x_tippy&&(e.__x_tippy.destroy(),delete e.__x_tippy)});let f=()=>e.__x_tippy.enable(),u=()=>e.__x_tippy.disable(),w=m=>{m?(f(),e.__x_tippy.setContent(m)):u()};if(r.includes("raw"))w(n);else{let m=i(n);o(()=>{m(E=>{typeof E=="object"?(e.__x_tippy.setProps(E),f()):w(E)})})}})}Di.defaultProps=t=>(Ai.default.setDefaultProps(t),Di);var _s=Di,zo=_s;var Lr=()=>{document.querySelectorAll("[ax-load][x-ignore]").forEach(t=>{t.removeAttribute("x-ignore"),t.setAttribute("x-load",t.getAttribute("ax-load")),t.setAttribute("x-load-src",t.getAttribute("ax-load-src"))}),document.querySelectorAll("[ax-load]").forEach(t=>{t.setAttribute("x-load",t.getAttribute("ax-load")),t.setAttribute("x-load-src",t.getAttribute("ax-load-src"))})};document.body?(Lr(),new MutationObserver(Lr).observe(document.body,{childList:!0,subtree:!0})):document.addEventListener("DOMContentLoaded",()=>{Lr(),new MutationObserver(Lr).observe(document.body,{childList:!0,subtree:!0})});document.addEventListener("alpine:init",()=>{window.Alpine.plugin(ao),window.Alpine.plugin(so),window.Alpine.plugin(uo),window.Alpine.plugin(Bo),window.Alpine.plugin(zo)});var Ts=function(t,e,r){function n(w,m){for(let E of w){let O=i(E,m);if(O!==null)return O}}function i(w,m){let E=w.match(/^[\{\[]([^\[\]\{\}]*)[\}\]](.*)/s);if(E===null||E.length!==3)return null;let O=E[1],S=E[2];if(O.includes(",")){let[M,I]=O.split(",",2);if(I==="*"&&m>=M)return S;if(M==="*"&&m<=I)return S;if(m>=M&&m<=I)return S}return O==m?S:null}function o(w){return w.toString().charAt(0).toUpperCase()+w.toString().slice(1)}function a(w,m){if(m.length===0)return w;let E={};for(let[O,S]of Object.entries(m))E[":"+o(O??"")]=o(S??""),E[":"+O.toUpperCase()]=S.toString().toUpperCase(),E[":"+O]=S;return Object.entries(E).forEach(([O,S])=>{w=w.replaceAll(O,S)}),w}function d(w){return w.map(m=>m.replace(/^[\{\[]([^\[\]\{\}]*)[\}\]]/,""))}let f=t.split("|"),u=n(f,e);return u!=null?a(u.trim(),r):(f=d(f),a(f.length>1&&e>1?f[1]:f[0],r))};window.jsMd5=Uo.md5;window.pluralize=Ts;})(); +/*! Bundled license information: + +js-md5/src/md5.js: + (** + * [js-md5]{@link https://github.com/emn178/js-md5} + * + * @namespace md5 + * @version 0.8.3 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2023 + * @license MIT + *) + +sortablejs/modular/sortable.esm.js: + (**! + * Sortable 1.15.6 + * @author RubaXa + * @author owenm + * @license MIT + *) +*/ diff --git a/public/js/filament/tables/components/table.js b/public/js/filament/tables/components/table.js new file mode 100644 index 00000000..ea16d856 --- /dev/null +++ b/public/js/filament/tables/components/table.js @@ -0,0 +1 @@ +function n(){return{checkboxClickController:null,collapsedGroups:[],isLoading:!1,selectedRecords:[],shouldCheckUniqueSelection:!0,lastCheckedRecord:null,livewireId:null,init:function(){this.livewireId=this.$root.closest("[wire\\:id]").attributes["wire:id"].value,this.$wire.$on("deselectAllTableRecords",()=>this.deselectAllRecords()),this.$watch("selectedRecords",()=>{if(!this.shouldCheckUniqueSelection){this.shouldCheckUniqueSelection=!0;return}this.selectedRecords=[...new Set(this.selectedRecords)],this.shouldCheckUniqueSelection=!1}),this.$nextTick(()=>this.watchForCheckboxClicks()),Livewire.hook("element.init",({component:e})=>{e.id===this.livewireId&&this.watchForCheckboxClicks()})},mountAction:function(e,t=null){this.$wire.set("selectedTableRecords",this.selectedRecords,!1),this.$wire.mountTableAction(e,t)},mountBulkAction:function(e){this.$wire.set("selectedTableRecords",this.selectedRecords,!1),this.$wire.mountTableBulkAction(e)},toggleSelectRecordsOnPage:function(){let e=this.getRecordsOnPage();if(this.areRecordsSelected(e)){this.deselectRecords(e);return}this.selectRecords(e)},toggleSelectRecordsInGroup:async function(e){if(this.isLoading=!0,this.areRecordsSelected(this.getRecordsInGroupOnPage(e))){this.deselectRecords(await this.$wire.getGroupedSelectableTableRecordKeys(e));return}this.selectRecords(await this.$wire.getGroupedSelectableTableRecordKeys(e)),this.isLoading=!1},getRecordsInGroupOnPage:function(e){let t=[];for(let s of this.$root?.getElementsByClassName("fi-ta-record-checkbox")??[])s.dataset.group===e&&t.push(s.value);return t},getRecordsOnPage:function(){let e=[];for(let t of this.$root?.getElementsByClassName("fi-ta-record-checkbox")??[])e.push(t.value);return e},selectRecords:function(e){for(let t of e)this.isRecordSelected(t)||this.selectedRecords.push(t)},deselectRecords:function(e){for(let t of e){let s=this.selectedRecords.indexOf(t);s!==-1&&this.selectedRecords.splice(s,1)}},selectAllRecords:async function(){this.isLoading=!0,this.selectedRecords=await this.$wire.getAllSelectableTableRecordKeys(),this.isLoading=!1},deselectAllRecords:function(){this.selectedRecords=[]},isRecordSelected:function(e){return this.selectedRecords.includes(e)},areRecordsSelected:function(e){return e.every(t=>this.isRecordSelected(t))},toggleCollapseGroup:function(e){if(this.isGroupCollapsed(e)){this.collapsedGroups.splice(this.collapsedGroups.indexOf(e),1);return}this.collapsedGroups.push(e)},isGroupCollapsed:function(e){return this.collapsedGroups.includes(e)},resetCollapsedGroups:function(){this.collapsedGroups=[]},watchForCheckboxClicks:function(){this.checkboxClickController&&this.checkboxClickController.abort(),this.checkboxClickController=new AbortController;let{signal:e}=this.checkboxClickController;this.$root?.addEventListener("click",t=>t.target?.matches(".fi-ta-record-checkbox")&&this.handleCheckboxClick(t,t.target),{signal:e})},handleCheckboxClick:function(e,t){if(!this.lastChecked){this.lastChecked=t;return}if(e.shiftKey){let s=Array.from(this.$root?.getElementsByClassName("fi-ta-record-checkbox")??[]);if(!s.includes(this.lastChecked)){this.lastChecked=t;return}let o=s.indexOf(this.lastChecked),r=s.indexOf(t),l=[o,r].sort((i,d)=>i-d),c=[];for(let i=l[0];i<=l[1];i++)s[i].checked=t.checked,c.push(s[i].value);t.checked?this.selectRecords(c):this.deselectRecords(c)}this.lastChecked=t}}}export{n as default}; diff --git a/public/js/filament/widgets/components/chart.js b/public/js/filament/widgets/components/chart.js new file mode 100644 index 00000000..4d062d1f --- /dev/null +++ b/public/js/filament/widgets/components/chart.js @@ -0,0 +1,37 @@ +function Ft(){}var Do=function(){let i=0;return function(){return i++}}();function P(i){return i===null||typeof i>"u"}function B(i){if(Array.isArray&&Array.isArray(i))return!0;let t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function F(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}var q=i=>(typeof i=="number"||i instanceof Number)&&isFinite(+i);function ft(i,t){return q(i)?i:t}function E(i,t){return typeof i>"u"?t:i}var Eo=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:i/t,En=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function $(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function V(i,t,e,s){let n,r,o;if(B(i))if(r=i.length,s)for(n=r-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;ni,x:i=>i.x,y:i=>i.y};function Vt(i,t){return(mo[t]||(mo[t]=Ic(t)))(i)}function Ic(i){let t=Cc(i);return e=>{for(let s of t){if(s==="")break;e=e&&e[s]}return e}}function Cc(i){let t=i.split("."),e=[],s="";for(let n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function vs(i){return i.charAt(0).toUpperCase()+i.slice(1)}var dt=i=>typeof i<"u",zt=i=>typeof i=="function",In=(i,t)=>{if(i.size!==t.size)return!1;for(let e of i)if(!t.has(e))return!1;return!0};function Co(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}var j=Math.PI,H=2*j,Fc=H+j,ks=Number.POSITIVE_INFINITY,Ac=j/180,U=j/2,pi=j/4,go=j*2/3,mt=Math.log10,Mt=Math.sign;function Cn(i){let t=Math.round(i);i=Pe(i,t,i/1e3)?t:i;let e=Math.pow(10,Math.floor(mt(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function Fo(i){let t=[],e=Math.sqrt(i),s;for(s=1;sn-r).pop(),t}function ge(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Pe(i,t,e){return Math.abs(i-t)=i}function Fn(i,t,e){let s,n,r;for(s=0,n=i.length;sl&&c=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Ds(i,t,e){e=e||(o=>i[o]1;)r=n+s>>1,e(r)?n=r:s=r;return{lo:n,hi:s}}var Ct=(i,t,e,s)=>Ds(i,e,s?n=>i[n][t]<=e:n=>i[n][t]Ds(i,e,s=>i[s][t]>=e);function No(i,t,e){let s=0,n=i.length;for(;ss&&i[n-1]>e;)n--;return s>0||n{let s="_onData"+vs(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...r){let o=n.apply(this,r);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...r)}),o}})})}function Pn(i,t){let e=i._chartjs;if(!e)return;let s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Ro.forEach(r=>{delete i[r]}),delete i._chartjs)}function Nn(i){let t=new Set,e,s;for(e=0,s=i.length;e"u"?function(i){return i()}:window.requestAnimationFrame}();function Wn(i,t,e){let s=e||(o=>Array.prototype.slice.call(o)),n=!1,r=[];return function(...o){r=s(o),n||(n=!0,Rn.call(window,()=>{n=!1,i.apply(t,r)}))}}function zo(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}var Es=i=>i==="start"?"left":i==="end"?"right":"center",nt=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Vo=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function zn(i,t,e){let s=t.length,n=0,r=s;if(i._sorted){let{iScale:o,_parsed:a}=i,l=o.axis,{min:c,max:h,minDefined:u,maxDefined:d}=o.getUserBounds();u&&(n=tt(Math.min(Ct(a,o.axis,c).lo,e?s:Ct(t,l,o.getPixelForValue(c)).lo),0,s-1)),d?r=tt(Math.max(Ct(a,o.axis,h,!0).hi+1,e?0:Ct(t,l,o.getPixelForValue(h),!0).hi+1),n,s)-n:r=s-n}return{start:n,count:r}}function Vn(i){let{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;let r=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),r}var ys=i=>i===0||i===1,po=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*H/e)),yo=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*H/e)+1,Ie={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*U)+1,easeOutSine:i=>Math.sin(i*U),easeInOutSine:i=>-.5*(Math.cos(j*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>ys(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>ys(i)?i:po(i,.075,.3),easeOutElastic:i=>ys(i)?i:yo(i,.075,.3),easeInOutElastic(i){return ys(i)?i:i<.5?.5*po(i*2,.1125,.45):.5+.5*yo(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ie.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Ie.easeInBounce(i*2)*.5:Ie.easeOutBounce(i*2-1)*.5+.5};function wi(i){return i+.5|0}var Gt=(i,t,e)=>Math.max(Math.min(i,e),t);function yi(i){return Gt(wi(i*2.55),0,255)}function Xt(i){return Gt(wi(i*255),0,255)}function Wt(i){return Gt(wi(i/2.55)/100,0,1)}function bo(i){return Gt(wi(i*100),0,100)}var xt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},vn=[..."0123456789ABCDEF"],Pc=i=>vn[i&15],Nc=i=>vn[(i&240)>>4]+vn[i&15],bs=i=>(i&240)>>4===(i&15),Rc=i=>bs(i.r)&&bs(i.g)&&bs(i.b)&&bs(i.a);function Wc(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&xt[i[1]]*17,g:255&xt[i[2]]*17,b:255&xt[i[3]]*17,a:t===5?xt[i[4]]*17:255}:(t===7||t===9)&&(e={r:xt[i[1]]<<4|xt[i[2]],g:xt[i[3]]<<4|xt[i[4]],b:xt[i[5]]<<4|xt[i[6]],a:t===9?xt[i[7]]<<4|xt[i[8]]:255})),e}var zc=(i,t)=>i<255?t(i):"";function Vc(i){var t=Rc(i)?Pc:Nc;return i?"#"+t(i.r)+t(i.g)+t(i.b)+zc(i.a,t):void 0}var Hc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ho(i,t,e){let s=t*Math.min(e,1-e),n=(r,o=(r+i/30)%12)=>e-s*Math.max(Math.min(o-3,9-o,1),-1);return[n(0),n(8),n(4)]}function Bc(i,t,e){let s=(n,r=(n+i/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[s(5),s(3),s(1)]}function $c(i,t,e){let s=Ho(i,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function jc(i,t,e,s,n){return i===n?(t-e)/s+(t.5?h/(2-r-o):h/(r+o),l=jc(e,s,n,h,r),l=l*60+.5),[l|0,c||0,a]}function Bn(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(Xt)}function $n(i,t,e){return Bn(Ho,i,t,e)}function Uc(i,t,e){return Bn($c,i,t,e)}function Yc(i,t,e){return Bn(Bc,i,t,e)}function Bo(i){return(i%360+360)%360}function Zc(i){let t=Hc.exec(i),e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?yi(+t[5]):Xt(+t[5]));let n=Bo(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?s=Uc(n,r,o):t[1]==="hsv"?s=Yc(n,r,o):s=$n(n,r,o),{r:s[0],g:s[1],b:s[2],a:e}}function qc(i,t){var e=Hn(i);e[0]=Bo(e[0]+t),e=$n(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Gc(i){if(!i)return;let t=Hn(i),e=t[0],s=bo(t[1]),n=bo(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${Wt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}var xo={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},_o={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Xc(){let i={},t=Object.keys(_o),e=Object.keys(xo),s,n,r,o,a;for(s=0;s>16&255,r>>8&255,r&255]}return i}var xs;function Kc(i){xs||(xs=Xc(),xs.transparent=[0,0,0,0]);let t=xs[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Jc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Qc(i){let t=Jc.exec(i),e=255,s,n,r;if(t){if(t[7]!==s){let o=+t[7];e=t[8]?yi(o):Gt(o*255,0,255)}return s=+t[1],n=+t[3],r=+t[5],s=255&(t[2]?yi(s):Gt(s,0,255)),n=255&(t[4]?yi(n):Gt(n,0,255)),r=255&(t[6]?yi(r):Gt(r,0,255)),{r:s,g:n,b:r,a:e}}}function th(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Wt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}var Sn=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Ee=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function eh(i,t,e){let s=Ee(Wt(i.r)),n=Ee(Wt(i.g)),r=Ee(Wt(i.b));return{r:Xt(Sn(s+e*(Ee(Wt(t.r))-s))),g:Xt(Sn(n+e*(Ee(Wt(t.g))-n))),b:Xt(Sn(r+e*(Ee(Wt(t.b))-r))),a:i.a+e*(t.a-i.a)}}function _s(i,t,e){if(i){let s=Hn(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=$n(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function $o(i,t){return i&&Object.assign(t||{},i)}function wo(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Xt(i[3]))):(t=$o(i,{r:0,g:0,b:0,a:1}),t.a=Xt(t.a)),t}function ih(i){return i.charAt(0)==="r"?Qc(i):Zc(i)}var On=class i{constructor(t){if(t instanceof i)return t;let e=typeof t,s;e==="object"?s=wo(t):e==="string"&&(s=Wc(t)||Kc(t)||ih(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=$o(this._rgb);return t&&(t.a=Wt(t.a)),t}set rgb(t){this._rgb=wo(t)}rgbString(){return this._valid?th(this._rgb):void 0}hexString(){return this._valid?Vc(this._rgb):void 0}hslString(){return this._valid?Gc(this._rgb):void 0}mix(t,e){if(t){let s=this.rgb,n=t.rgb,r,o=e===r?.5:e,a=2*o-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,s.r=255&c*s.r+r*n.r+.5,s.g=255&c*s.g+r*n.g+.5,s.b=255&c*s.b+r*n.b+.5,s.a=o*s.a+(1-o)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=eh(this._rgb,t._rgb,e)),this}clone(){return new i(this.rgb)}alpha(t){return this._rgb.a=Xt(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=wi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return _s(this._rgb,2,t),this}darken(t){return _s(this._rgb,2,-t),this}saturate(t){return _s(this._rgb,1,t),this}desaturate(t){return _s(this._rgb,1,-t),this}rotate(t){return qc(this._rgb,t),this}};function jo(i){return new On(i)}function Uo(i){if(i&&typeof i=="object"){let t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function jn(i){return Uo(i)?i:jo(i)}function kn(i){return Uo(i)?i:jo(i).saturate(.5).darken(.1).hexString()}var Kt=Object.create(null),Is=Object.create(null);function bi(i,t){if(!t)return i;let e=t.split(".");for(let s=0,n=e.length;se.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,s)=>kn(s.backgroundColor),this.hoverBorderColor=(e,s)=>kn(s.borderColor),this.hoverColor=(e,s)=>kn(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return Mn(this,t,e)}get(t){return bi(this,t)}describe(t,e){return Mn(Is,t,e)}override(t,e){return Mn(Kt,t,e)}route(t,e,s,n){let r=bi(this,t),o=bi(this,s),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){let l=this[a],c=o[n];return F(l)?Object.assign({},c,l):E(l,c)},set(l){this[a]=l}}})}},A=new Dn({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function sh(i){return!i||P(i.size)||P(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function xi(i,t,e,s,n){let r=t[n];return r||(r=t[n]=i.measureText(n).width,e.push(n)),r>s&&(s=r),s}function Yo(i,t,e,s){s=s||{};let n=s.data=s.data||{},r=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},r=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let o=0,a=e.length,l,c,h,u,d;for(l=0;le.length){for(l=0;l0&&i.stroke()}}function Fe(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&r.strokeColor!=="",l,c;for(i.save(),i.font=n.string,nh(i,r),l=0;l+i||0;function Fs(i,t){let e={},s=F(t),n=s?Object.keys(t):t,r=F(i)?s?o=>E(i[o],i[t[o]]):o=>i[o]:()=>i;for(let o of n)e[o]=ch(r(o));return e}function Zn(i){return Fs(i,{top:"y",right:"x",bottom:"y",left:"x"})}function te(i){return Fs(i,["topLeft","topRight","bottomLeft","bottomRight"])}function rt(i){let t=Zn(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Q(i,t){i=i||{},t=t||A.font;let e=E(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=E(i.style,t.style);s&&!(""+s).match(ah)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");let n={family:E(i.family,t.family),lineHeight:lh(E(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:E(i.weight,t.weight),string:""};return n.string=sh(n),n}function We(i,t,e,s){let n=!0,r,o,a;for(r=0,o=i.length;re&&a===0?0:a+l;return{min:o(s,-Math.abs(r)),max:o(n,r)}}function Ht(i,t){return Object.assign(Object.create(i),t)}function As(i,t=[""],e=i,s,n=()=>i[0]){dt(s)||(s=Jo("_fallback",i));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:s,_getTarget:n,override:o=>As([o,...i],t,e,s)};return new Proxy(r,{deleteProperty(o,a){return delete o[a],delete o._keys,delete i[0][a],!0},get(o,a){return Xo(o,a,()=>yh(a,t,i,o))},getOwnPropertyDescriptor(o,a){return Reflect.getOwnPropertyDescriptor(o._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(o,a){return ko(o).includes(a)},ownKeys(o){return ko(o)},set(o,a,l){let c=o._storage||(o._storage=n());return o[a]=c[a]=l,delete o._keys,!0}})}function me(i,t,e,s){let n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:qn(i,s),setContext:r=>me(i,r,e,s),override:r=>me(i.override(r),t,e,s)};return new Proxy(n,{deleteProperty(r,o){return delete r[o],delete i[o],!0},get(r,o,a){return Xo(r,o,()=>uh(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(i,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,o)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(r,o){return Reflect.has(i,o)},ownKeys(){return Reflect.ownKeys(i)},set(r,o,a){return i[o]=a,delete r[o],!0}})}function qn(i,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:zt(e)?e:()=>e,isIndexable:zt(s)?s:()=>s}}var hh=(i,t)=>i?i+vs(t):t,Gn=(i,t)=>F(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Xo(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];let s=e();return i[t]=s,s}function uh(i,t,e){let{_proxy:s,_context:n,_subProxy:r,_descriptors:o}=i,a=s[t];return zt(a)&&o.isScriptable(t)&&(a=dh(t,a,i,e)),B(a)&&a.length&&(a=fh(t,a,i,o.isIndexable)),Gn(t,a)&&(a=me(a,n,r&&r[t],o)),a}function dh(i,t,e,s){let{_proxy:n,_context:r,_subProxy:o,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);return a.add(i),t=t(r,o||s),a.delete(i),Gn(i,t)&&(t=Xn(n._scopes,n,i,t)),t}function fh(i,t,e,s){let{_proxy:n,_context:r,_subProxy:o,_descriptors:a}=e;if(dt(r.index)&&s(i))t=t[r.index%t.length];else if(F(t[0])){let l=t,c=n._scopes.filter(h=>h!==l);t=[];for(let h of l){let u=Xn(c,n,i,h);t.push(me(u,r,o&&o[i],a))}}return t}function Ko(i,t,e){return zt(i)?i(t,e):i}var mh=(i,t)=>i===!0?t:typeof i=="string"?Vt(t,i):void 0;function gh(i,t,e,s,n){for(let r of t){let o=mh(e,r);if(o){i.add(o);let a=Ko(o._fallback,e,n);if(dt(a)&&a!==e&&a!==s)return a}else if(o===!1&&dt(s)&&e!==s)return null}return!1}function Xn(i,t,e,s){let n=t._rootScopes,r=Ko(t._fallback,e,s),o=[...i,...n],a=new Set;a.add(s);let l=So(a,o,e,r||e,s);return l===null||dt(r)&&r!==e&&(l=So(a,o,r,l,s),l===null)?!1:As(Array.from(a),[""],n,r,()=>ph(t,e,s))}function So(i,t,e,s,n){for(;e;)e=gh(i,t,e,s,n);return e}function ph(i,t,e){let s=i._getTarget();t in s||(s[t]={});let n=s[t];return B(n)&&F(e)?e:n}function yh(i,t,e,s){let n;for(let r of t)if(n=Jo(hh(r,i),e),dt(n))return Gn(i,n)?Xn(e,s,i,n):n}function Jo(i,t){for(let e of t){if(!e)continue;let s=e[i];if(dt(s))return s}}function ko(i){let t=i._keys;return t||(t=i._keys=bh(i._scopes)),t}function bh(i){let t=new Set;for(let e of i)for(let s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function Kn(i,t,e,s){let{iScale:n}=i,{key:r="r"}=this._parsing,o=new Array(s),a,l,c,h;for(a=0,l=s;ati==="x"?"y":"x";function _h(i,t,e,s){let n=i.skip?t:i,r=t,o=e.skip?t:e,a=Ms(r,n),l=Ms(o,r),c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let u=s*c,d=s*h;return{previous:{x:r.x-u*(o.x-n.x),y:r.y-u*(o.y-n.y)},next:{x:r.x+d*(o.x-n.x),y:r.y+d*(o.y-n.y)}}}function wh(i,t,e){let s=i.length,n,r,o,a,l,c=Ae(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")kh(i,n);else{let c=s?i[i.length-1]:i[0];for(r=0,o=i.length;rwindow.getComputedStyle(i,null);function Th(i,t){return Ps(i).getPropertyValue(t)}var vh=["top","right","bottom","left"];function fe(i,t,e){let s={};e=e?"-"+e:"";for(let n=0;n<4;n++){let r=vh[n];s[r]=parseFloat(i[t+"-"+r+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}var Oh=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Dh(i,t){let e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:r}=s,o=!1,a,l;if(Oh(n,r,i.target))a=n,l=r;else{let c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function ee(i,t){if("native"in i)return i;let{canvas:e,currentDevicePixelRatio:s}=t,n=Ps(e),r=n.boxSizing==="border-box",o=fe(n,"padding"),a=fe(n,"border","width"),{x:l,y:c,box:h}=Dh(i,e),u=o.left+(h&&a.left),d=o.top+(h&&a.top),{width:f,height:m}=t;return r&&(f-=o.width+a.width,m-=o.height+a.height),{x:Math.round((l-u)/f*e.width/s),y:Math.round((c-d)/m*e.height/s)}}function Eh(i,t,e){let s,n;if(t===void 0||e===void 0){let r=Ls(i);if(!r)t=i.clientWidth,e=i.clientHeight;else{let o=r.getBoundingClientRect(),a=Ps(r),l=fe(a,"border","width"),c=fe(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,s=Ts(a.maxWidth,r,"clientWidth"),n=Ts(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:s||ks,maxHeight:n||ks}}var Tn=i=>Math.round(i*10)/10;function ea(i,t,e,s){let n=Ps(i),r=fe(n,"margin"),o=Ts(n.maxWidth,i,"clientWidth")||ks,a=Ts(n.maxHeight,i,"clientHeight")||ks,l=Eh(i,t,e),{width:c,height:h}=l;if(n.boxSizing==="content-box"){let u=fe(n,"border","width"),d=fe(n,"padding");c-=d.width+u.width,h-=d.height+u.height}return c=Math.max(0,c-r.width),h=Math.max(0,s?Math.floor(c/s):h-r.height),c=Tn(Math.min(c,o,l.maxWidth)),h=Tn(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Tn(c/2)),{width:c,height:h}}function Qn(i,t,e){let s=t||1,n=Math.floor(i.height*s),r=Math.floor(i.width*s);i.height=n/s,i.width=r/s;let o=i.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${i.height}px`,o.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||o.height!==n||o.width!==r?(i.currentDevicePixelRatio=s,o.height=n,o.width=r,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}var ia=function(){let i=!1;try{let t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function tr(i,t){let e=Th(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function qt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function sa(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function na(i,t,e,s){let n={x:i.cp2x,y:i.cp2y},r={x:t.cp1x,y:t.cp1y},o=qt(i,n,e),a=qt(n,r,e),l=qt(r,t,e),c=qt(o,a,e),h=qt(a,l,e);return qt(c,h,e)}var Mo=new Map;function Ih(i,t){t=t||{};let e=i+JSON.stringify(t),s=Mo.get(e);return s||(s=new Intl.NumberFormat(i,t),Mo.set(e,s)),s}function ze(i,t,e){return Ih(t,e).format(i)}var Ch=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Fh=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function pe(i,t,e){return i?Ch(t,e):Fh()}function er(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function ir(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function ra(i){return i==="angle"?{between:Ne,compare:Lc,normalize:ct}:{between:At,compare:(t,e)=>t-e,normalize:t=>t}}function To({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Ah(i,t,e){let{property:s,start:n,end:r}=e,{between:o,normalize:a}=ra(s),l=t.length,{start:c,end:h,loop:u}=i,d,f;if(u){for(c+=l,h+=l,d=0,f=l;dl(n,_,y)&&a(n,_)!==0,x=()=>a(r,y)===0||l(r,_,y),S=()=>g||w(),k=()=>!g||x();for(let v=h,T=h;v<=u;++v)b=t[v%o],!b.skip&&(y=c(b[s]),y!==_&&(g=l(y,n,r),p===null&&S()&&(p=a(y,n)===0?v:T),p!==null&&k()&&(m.push(To({start:p,end:v,loop:d,count:o,style:f})),p=null),T=v,_=y));return p!==null&&m.push(To({start:p,end:u,loop:d,count:o,style:f})),m}function nr(i,t){let e=[],s=i.segments;for(let n=0;nn&&i[r%t].skip;)r--;return r%=t,{start:n,end:r}}function Ph(i,t,e,s){let n=i.length,r=[],o=t,a=i[t],l;for(l=t+1;l<=e;++l){let c=i[l%n];c.skip||c.stop?a.skip||(s=!1,r.push({start:t%n,end:(l-1)%n,loop:s}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%n,end:o%n,loop:s}),r}function oa(i,t){let e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];let r=!!i._loop,{start:o,end:a}=Lh(e,n,r,s);if(s===!0)return vo(i,[{start:o,end:a,loop:r}],e,t);let l=aa({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(s-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Rn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;let r=s.items,o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),r.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let s=e.items,n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},Bt=new mr,aa="transparent",Wh={boolean(i,t,e){return e>.5?t:i},color(i,t,e){let s=jn(i||aa),n=s.valid&&jn(t||aa);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}},gr=class{constructor(t,e,s,n){let r=e[s];n=We([t.to,n,r,t.from]);let o=We([t.from,r,n]);this._active=!0,this._fn=t.fn||Wh[t.type||typeof o],this._easing=Ie[t.easing]||Ie.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=o,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);let n=this._target[this._prop],r=s-this._start,o=this._duration-r;this._start=s,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=We([t.to,e,n,t.from]),this._from=We([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,s=this._duration,n=this._prop,r=this._from,o=this._loop,a=this._to,l;if(this._active=r!==a&&(o||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(r,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){let e=t?"res":"rej",s=this._promises||[];for(let n=0;ni!=="onProgress"&&i!=="onComplete"&&i!=="fn"});A.set("animations",{colors:{type:"color",properties:Vh},numbers:{type:"number",properties:zh}});A.describe("animations",{_fallback:"animation"});A.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:i=>i|0}}}});var $s=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!F(t))return;let e=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let n=t[s];if(!F(n))return;let r={};for(let o of Hh)r[o]=n[o];(B(n.properties)&&n.properties||[s]).forEach(o=>{(o===s||!e.has(o))&&e.set(o,r)})})}_animateOptions(t,e){let s=e.options,n=$h(t,s);if(!n)return[];let r=this._createAnimations(n,s);return s.$shared&&Bh(t.options.$animations,s).then(()=>{t.options=s},()=>{}),r}_createAnimations(t,e){let s=this._properties,n=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now(),l;for(l=o.length-1;l>=0;--l){let c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}let h=e[c],u=r[c],d=s.get(c);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[c]=h;continue}r[c]=u=new gr(d,t,c,h),n.push(u)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let s=this._createAnimations(t,e);if(s.length)return Bt.add(this._chart,s),!0}};function Bh(i,t){let e=[],s=Object.keys(t);for(let n=0;n0||!e&&r<0)return n.index}return null}function da(i,t){let{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=s,l=r.axis,c=o.axis,h=Zh(r,o,s),u=t.length,d;for(let f=0;fe[s].axis===t).shift()}function Xh(i,t){return Ht(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Kh(i,t,e){return Ht(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Mi(i,t){let e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(let n of t){let r=n._stacks;if(!r||r[s]===void 0||r[s][e]===void 0)return;delete r[s][e]}}}var or=i=>i==="reset"||i==="none",fa=(i,t)=>t?i:Object.assign({},i),Jh=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Ja(e,!0),values:null},gt=class{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ha(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Mi(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(u,d,f,m)=>u==="x"?d:u==="r"?m:f,r=e.xAxisID=E(s.xAxisID,rr(t,"x")),o=e.yAxisID=E(s.yAxisID,rr(t,"y")),a=e.rAxisID=E(s.rAxisID,rr(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,r,o,a),h=e.vAxisID=n(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Pn(this._data,this),t._stacked&&Mi(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(F(e))this._data=Yh(e);else if(s!==e){if(s){Pn(s,this);let n=this._cachedMeta;Mi(n),n._parsed=[]}e&&Object.isExtensible(e)&&Wo(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,s=this.getDataset(),n=!1;this._dataCheck();let r=e._stacked;e._stacked=ha(e.vScale,e),e.stack!==s.stack&&(n=!0,Mi(e),e.stack=s.stack),this._resyncElements(t),(n||r!==e._stacked)&&da(this,e._parsed)}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let{_cachedMeta:s,_data:n}=this,{iScale:r,_stacked:o}=s,a=r.axis,l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,u,d;if(this._parsing===!1)s._parsed=n,s._sorted=!0,d=n;else{B(n[t])?d=this.parseArrayData(s,n,t,e):F(n[t])?d=this.parseObjectData(s,n,t,e):d=this.parsePrimitiveData(s,n,t,e);let f=()=>u[a]===null||c&&u[a]g||u=0;--d)if(!m()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){let e=this._cachedMeta._parsed,s=[],n,r,o;for(n=0,r=e.length;n=0&&tthis.getContext(s,n),g=c.resolveNamedOptions(d,f,m,u);return g.$shared&&(g.$shared=l,r[o]=Object.freeze(fa(g,l))),g}_resolveAnimations(t,e,s){let n=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(n.options.animation!==!1){let h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(d,this.getContext(t,s,e))}let c=new $s(n,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||or(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(s),o=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,s),{sharedOptions:r,includeOptions:o}}updateElement(t,e,s,n){or(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!or(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;let r=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,s=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let n=s.length,r=e.length,o=Math.min(r,n);o&&this.parse(0,o),r>n?this._insertElements(n,r-n,t):r{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;an-r))}return i._cache.$bar}function tu(i){let t=i.iScale,e=Qh(t,i.type),s=t._length,n,r,o,a,l=()=>{o===32767||o===-32768||(dt(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(n=0,r=e.length;n0?n[i-1]:null,a=iMath.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:r,min:o,max:a}}function Qa(i,t,e,s){return B(i)?su(i,t,e,s):t[e.axis]=e.parse(i,s),t}function ma(i,t,e,s){let n=i.iScale,r=i.vScale,o=n.getLabels(),a=n===r,l=[],c,h,u,d;for(c=e,h=e+s;c=e?1:-1)}function ru(i){let t,e,s,n,r;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.basel.controller.options.grouped),r=s.options.stacked,o=[],a=l=>{let c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(P(h)||isNaN(h))return!0};for(let l of n)if(!(e!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){let n=this._getStacks(t,s),r=e!==void 0?n.indexOf(e):-1;return r===-1?n.length-1:r}_getRuler(){let t=this.options,e=this._cachedMeta,s=e.iScale,n=[],r,o;for(r=0,o=e.data.length;r=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,{xScale:s,yScale:n}=e,r=this.getParsed(t),o=s.getLabelForValue(r.x),a=n.getLabelForValue(r.y),l=r._custom;return{label:e.label,value:"("+o+", "+a+(l?", "+l:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,n){let r=n==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,n),h=o.axis,u=a.axis;for(let d=e;dNe(_,a,l,!0)?1:Math.max(w,w*e,x,x*e),m=(_,w,x)=>Ne(_,a,l,!0)?-1:Math.min(w,w*e,x,x*e),g=f(0,c,u),p=f(U,h,d),y=m(j,c,u),b=m(j+U,h,d);s=(g-y)/2,n=(p-b)/2,r=-(g+y)/2,o=-(p+b)/2}return{ratioX:s,ratioY:n,offsetX:r,offsetY:o}}var ne=class extends gt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let r=l=>+s[l];if(F(s[t])){let{key:l="value"}=this._parsing;r=c=>+Vt(s[c],l)}let o,a;for(o=t,a=t+e;o0&&!isNaN(t)?H*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,s=this.chart,n=s.data.labels||[],r=ze(e._parsed[t],s.options.locale);return{label:n[t]||"",value:r}}getMaxBorderWidth(t){let e=0,s=this.chart,n,r,o,a,l;if(!t){for(n=0,r=s.data.datasets.length;ni!=="spacing",_indexable:i=>i!=="spacing"};ne.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){let t=i.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((s,n)=>{let o=i.getDatasetMeta(0).controller.getStyle(n);return{text:s,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(n),index:n}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){let t=i.label,e=": "+i.formattedValue;return B(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};var je=class extends gt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:s,data:n=[],_dataset:r}=e,o=this.chart._animationsDisabled,{start:a,count:l}=zn(e,n,o);this._drawStart=a,this._drawCount=l,Vn(e)&&(a=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!r._decimated,s.points=n;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!o,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,s,n){let r=n==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,n),d=o.axis,f=a.axis,{spanGaps:m,segment:g}=this.options,p=ge(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||n==="none",b=e>0&&this.getParsed(e-1);for(let _=e;_0&&Math.abs(x[d]-b[d])>p,g&&(S.parsed=x,S.raw=c.data[_]),u&&(S.options=h||this.resolveDataElementOptions(_,w.active?"active":n)),y||this.updateElement(w,_,S,n),b=x}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;let r=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,r,o)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};je.id="line";je.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};je.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var Ue=class extends gt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,s=this.chart,n=s.data.labels||[],r=ze(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:r}}parseObjectData(t,e,s,n){return Kn.bind(this)(t,e,s,n)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{let r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(re.max&&(e.max=r))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),o=Math.max(s.cutoutPercentage?r/100*s.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,s,n){let r=n==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,d=c.getIndexAngle(0)-.5*j,f=d,m,g=360/this.countVisibleElements();for(m=0;m{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?_t(this.resolveDataElementOptions(t,e).angle||s):0}};Ue.id="polarArea";Ue.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ue.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){let t=i.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((s,n)=>{let o=i.getDatasetMeta(0).controller.getStyle(n);return{text:s,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(n),index:n}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){return i.chart.data.labels[i.dataIndex]+": "+i.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};var Ci=class extends ne{};Ci.id="pie";Ci.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var Ye=class extends gt{getLabelAndValue(t){let e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,n){return Kn.bind(this)(t,e,s,n)}update(t){let e=this._cachedMeta,s=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(s.points=n,t!=="resize"){let o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);let a={_loop:!0,_fullLoop:r.length===n.length,options:o};this.updateElement(s,void 0,a,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,s,n){let r=this._cachedMeta.rScale,o=n==="reset";for(let a=e;a{n[r]=s[r]&&s[r].active()?s[r]._to:this[r]}),n}};pt.defaults={};pt.defaultRoutes=void 0;var tl={values(i){return B(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";let s=this.chart.options.locale,n,r=i;if(e.length>1){let c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),r=hu(i,e)}let o=mt(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ze(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";let s=i/Math.pow(10,Math.floor(mt(i)));return s===1||s===2||s===5?tl.numeric.call(this,i,t,e):""}};function hu(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Gs={formatters:tl};A.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Gs.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});A.route("scale.ticks","color","","color");A.route("scale.grid","color","","borderColor");A.route("scale.grid","borderColor","","borderColor");A.route("scale.title","color","","color");A.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"});A.describe("scales",{_fallback:"scale"});A.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});function uu(i,t){let e=i.options.ticks,s=e.maxTicksLimit||du(i),n=e.major.enabled?mu(t):[],r=n.length,o=n[0],a=n[r-1],l=[];if(r>s)return gu(t,l,n,r/s),l;let c=fu(n,t,s);if(r>0){let h,u,d=r>1?Math.round((a-o)/(r-1)):null;for(Ns(t,l,c,P(d)?0:o-d,o),h=0,u=r-1;hn)return l}return Math.max(n,1)}function mu(i){let t=[],e,s;for(e=0,s=i.length;ei==="left"?"right":i==="right"?"left":i,ya=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e;function ba(i,t){let e=[],s=i.length/t,n=i.length,r=0;for(;ro+a)))return l}function xu(i,t){V(i,e=>{let s=e.gc,n=s.length/2,r;if(n>t){for(r=0;rs?s:e,s=n&&e>s?e:s,{min:ft(e,ft(s,e)),max:ft(s,ft(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){$(this.options.beforeUpdate,[this])}update(t,e,s){let{beginAtZero:n,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Go(this,r,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a=r||s<=1||!this.isHorizontal()){this.labelRotation=n;return}let h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=tt(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),u+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-Ti(t.grid)-e.padding-xa(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),o=Os(Math.min(Math.asin(tt((h.highest.height+6)/a,-1,1)),Math.asin(tt(l/c,-1,1))-Math.asin(tt(d/c,-1,1)))),o=Math.max(n,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){$(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){let l=xa(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ti(r)+l):(t.height=this.maxHeight,t.width=Ti(r)+l),s.display&&this.ticks.length){let{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=s.padding*2,m=_t(this.labelRotation),g=Math.cos(m),p=Math.sin(m);if(a){let y=s.mirror?0:p*u.width+g*d.height;t.height=Math.min(this.maxHeight,t.height+y+f)}else{let y=s.mirror?0:g*u.width+p*d.height;t.width=Math.min(this.maxWidth,t.width+y+f)}this._calculatePadding(c,h,p,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){let{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),d=0,f=0;l?c?(d=n*t.width,f=s*e.height):(d=s*t.height,f=n*e.width):r==="start"?f=e.width:r==="end"?d=t.width:r!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-h+o)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-u+o)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;r==="start"?(h=0,u=t.height):r==="end"&&(h=e.height,u=0),this.paddingTop=h+o,this.paddingBottom=u+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){$(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e({width:r[k]||0,height:o[k]||0});return{first:S(0),last:S(e-1),widest:S(w),highest:S(x),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return Lo(this._alignToPixels?Jt(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&ta*n?a/s:l/n:l*n0}_computeGridLineItems(t){let e=this.axis,s=this.chart,n=this.options,{grid:r,position:o}=n,a=r.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),u=Ti(r),d=[],f=r.setContext(this.getContext()),m=f.drawBorder?f.borderWidth:0,g=m/2,p=function(D){return Jt(s,D,m)},y,b,_,w,x,S,k,v,T,C,N,L;if(o==="top")y=p(this.bottom),S=this.bottom-u,v=y-g,C=p(t.top)+g,L=t.bottom;else if(o==="bottom")y=p(this.top),C=t.top,L=p(t.bottom)-g,S=y+g,v=this.top+u;else if(o==="left")y=p(this.right),x=this.right-u,k=y-g,T=p(t.left)+g,N=t.right;else if(o==="right")y=p(this.left),T=t.left,N=p(t.right)-g,x=y+g,k=this.left+u;else if(e==="x"){if(o==="center")y=p((t.top+t.bottom)/2+.5);else if(F(o)){let D=Object.keys(o)[0],J=o[D];y=p(this.chart.scales[D].getPixelForValue(J))}C=t.top,L=t.bottom,S=y+g,v=S+u}else if(e==="y"){if(o==="center")y=p((t.left+t.right)/2);else if(F(o)){let D=Object.keys(o)[0],J=o[D];y=p(this.chart.scales[D].getPixelForValue(J))}x=y-g,k=x-u,T=t.left,N=t.right}let K=E(n.ticks.maxTicksLimit,h),lt=Math.max(1,Math.ceil(h/K));for(b=0;br.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){let e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),r,o,a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(r=0,o=n.length;r{this.draw(n)}}]:[{z:s,draw:n=>{this.drawBackground(),this.drawGrid(n),this.drawTitle()}},{z:s+1,draw:()=>{this.drawBorder()}},{z:e,draw:n=>{this.drawLabels(n)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[],r,o;for(r=0,o=e.length;r{let s=e.split("."),n=s.pop(),r=[i].concat(s).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");A.route(r,n,l,a)})}function vu(i){return"id"in i&&"defaults"in i}var pr=class{constructor(){this.controllers=new He(gt,"datasets",!0),this.elements=new He(pt,"elements"),this.plugins=new He(Object,"plugins"),this.scales=new He(be,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{let r=s||this._getRegistryForType(n);s||r.isForType(n)||r===this.plugins&&n.id?this._exec(t,r,n):V(n,o=>{let a=s||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,s){let n=vs(t);$(s["before"+n],[],s),e[t](s),$(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let w=e;w0&&Math.abs(S[f]-_[f])>y,p&&(k.parsed=S,k.raw=c.data[w]),d&&(k.options=u||this.resolveDataElementOptions(w,x.active?"active":n)),b||this.updateElement(x,w,k,n),_=S}this.updateSharedOptions(u,n,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}let s=t.dataset,n=s.options&&s.options.borderWidth||0;if(!e.length)return n;let r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,r,o)/2}};Ze.id="scatter";Ze.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Ze.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(i){return"("+i.label+", "+i.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Ou=Object.freeze({__proto__:null,BarController:Be,BubbleController:$e,DoughnutController:ne,LineController:je,PolarAreaController:Ue,PieController:Ci,RadarController:Ye,ScatterController:Ze});function ye(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Fi=class{constructor(t){this.options=t||{}}init(t){}formats(){return ye()}parse(t,e){return ye()}format(t,e){return ye()}add(t,e,s){return ye()}diff(t,e,s){return ye()}startOf(t,e,s){return ye()}endOf(t,e){return ye()}};Fi.override=function(i){Object.assign(Fi.prototype,i)};var Or={_date:Fi};function Du(i,t,e,s){let{controller:n,data:r,_sorted:o}=i,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){let l=a._reversePixels?Po:Ct;if(s){if(n._sharedOptions){let c=r[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){let u=l(r,t,e-h),d=l(r,t,e+h);return{lo:u.lo,hi:d.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function zi(i,t,e,s,n){let r=i.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a{l[o](t[e],n)&&(r.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:r}var Fu={evaluateInteractionItems:zi,modes:{index(i,t,e,s){let n=ee(t,i),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?lr(i,n,r,s,o):cr(i,n,r,!1,s,o),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{let h=a[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){let n=ee(t,i),r=e.axis||"xy",o=e.includeInvisible||!1,a=e.intersect?lr(i,n,r,s,o):cr(i,n,r,!1,s,o);if(a.length>0){let l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function wa(i,t){return i.filter(e=>el.indexOf(e.pos)===-1&&e.box.axis===t)}function Oi(i,t){return i.sort((e,s)=>{let n=t?s:e,r=t?e:s;return n.weight===r.weight?n.index-r.index:n.weight-r.weight})}function Au(i){let t=[],e,s,n,r,o,a;for(e=0,s=(i||[]).length;ec.box.fullSize),!0),s=Oi(vi(t,"left"),!0),n=Oi(vi(t,"right")),r=Oi(vi(t,"top"),!0),o=Oi(vi(t,"bottom")),a=wa(t,"x"),l=wa(t,"y");return{fullSize:e,leftAndTop:s.concat(r),rightAndBottom:n.concat(l).concat(o).concat(a),chartArea:vi(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:r.concat(o).concat(a)}}function Sa(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function il(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Ru(i,t,e,s){let{pos:n,box:r}=e,o=i.maxPadding;if(!F(n)){e.size&&(i[n]-=e.size);let u=s[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?r.height:r.width),e.size=u.size/u.count,i[n]+=e.size}r.getPadding&&il(o,r.getPadding());let a=Math.max(0,t.outerWidth-Sa(o,i,"left","right")),l=Math.max(0,t.outerHeight-Sa(o,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Wu(i){let t=i.maxPadding;function e(s){let n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function zu(i,t){let e=t.maxPadding;function s(n){let r={left:0,top:0,right:0,bottom:0};return n.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return s(i?["left","right"]:["top","bottom"])}function Ei(i,t,e,s){let n=[],r,o,a,l,c,h;for(r=0,o=i.length,c=0;r{typeof g.beforeLayout=="function"&&g.beforeLayout()});let h=l.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/h,hBoxMaxHeight:o/2}),d=Object.assign({},n);il(d,rt(s));let f=Object.assign({maxPadding:d,w:r,h:o,x:n.left,y:n.top},n),m=Pu(l.concat(c),u);Ei(a.fullSize,f,u,m),Ei(l,f,u,m),Ei(c,f,u,m)&&Ei(l,f,u,m),Wu(f),ka(a.leftAndTop,f,u,m),f.x+=f.w,f.y+=f.h,ka(a.rightAndBottom,f,u,m),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},V(a.chartArea,g=>{let p=g.box;Object.assign(p,i.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},js=class{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}},yr=class extends js{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},Bs="$chartjs",Vu={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ma=i=>i===null||i==="";function Hu(i,t){let e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[Bs]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ma(n)){let r=tr(i,"width");r!==void 0&&(i.width=r)}if(Ma(s))if(i.style.height==="")i.height=i.width/(t||2);else{let r=tr(i,"height");r!==void 0&&(i.height=r)}return i}var sl=ia?{passive:!0}:!1;function Bu(i,t,e){i.addEventListener(t,e,sl)}function $u(i,t,e){i.canvas.removeEventListener(t,e,sl)}function ju(i,t){let e=Vu[i.type]||i.type,{x:s,y:n}=ee(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Us(i,t){for(let e of i)if(e===t||e.contains(t))return!0}function Uu(i,t,e){let s=i.canvas,n=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||Us(a.addedNodes,s),o=o&&!Us(a.removedNodes,s);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Yu(i,t,e){let s=i.canvas,n=new MutationObserver(r=>{let o=!1;for(let a of r)o=o||Us(a.removedNodes,s),o=o&&!Us(a.addedNodes,s);o&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}var Ai=new Map,Ta=0;function nl(){let i=window.devicePixelRatio;i!==Ta&&(Ta=i,Ai.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Zu(i,t){Ai.size||window.addEventListener("resize",nl),Ai.set(i,t)}function qu(i){Ai.delete(i),Ai.size||window.removeEventListener("resize",nl)}function Gu(i,t,e){let s=i.canvas,n=s&&Ls(s);if(!n)return;let r=Wn((a,l)=>{let c=n.clientWidth;e(a,l),c{let l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||r(c,h)});return o.observe(n),Zu(i,r),o}function hr(i,t,e){e&&e.disconnect(),t==="resize"&&qu(i)}function Xu(i,t,e){let s=i.canvas,n=Wn(r=>{i.ctx!==null&&e(ju(r,i))},i,r=>{let o=r[0];return[o,o.offsetX,o.offsetY]});return Bu(s,t,n),n}var br=class extends js{acquireContext(t,e){let s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Hu(t,e),s):null}releaseContext(t){let e=t.canvas;if(!e[Bs])return!1;let s=e[Bs].initial;["height","width"].forEach(r=>{let o=s[r];P(o)?e.removeAttribute(r):e.setAttribute(r,o)});let n=s.style||{};return Object.keys(n).forEach(r=>{e.style[r]=n[r]}),e.width=e.width,delete e[Bs],!0}addEventListener(t,e,s){this.removeEventListener(t,e);let n=t.$proxies||(t.$proxies={}),o={attach:Uu,detach:Yu,resize:Gu}[e]||Xu;n[e]=o(t,e,s)}removeEventListener(t,e){let s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:hr,detach:hr,resize:hr}[e]||$u)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return ea(t,e,s,n)}isAttached(t){let e=Ls(t);return!!(e&&e.isConnected)}};function Ku(i){return!Jn()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?yr:br}var xr=class{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let r=n?this._descriptors(t).filter(n):this._descriptors(t),o=this._notify(r,t,e,s);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,s,n){n=n||{};for(let r of t){let o=r.plugin,a=o[s],l=[e,n,r.options];if($(a,l,o)===!1&&n.cancelable)return!1}return!0}invalidate(){P(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let s=t&&t.config,n=E(s.options&&s.options.plugins,{}),r=Ju(s);return n===!1&&!e?[]:td(t,r,n,e)}_notifyStateChanges(t){let e=this._oldCache||[],s=this._cache,n=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}};function Ju(i){let t={},e=[],s=Object.keys(Pt.plugins.items);for(let r=0;r{let l=s[a];if(!F(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let c=wr(a,l),h=sd(c,n),u=e.scales||{};r[c]=r[c]||a,o[a]=Le(Object.create(null),[{axis:c},l,u[c],u[h]])}),i.data.datasets.forEach(a=>{let l=a.type||i.type,c=a.indexAxis||_r(l,t),u=(Kt[l]||{}).scales||{};Object.keys(u).forEach(d=>{let f=id(d,c),m=a[f+"AxisID"]||r[f]||f;o[m]=o[m]||Object.create(null),Le(o[m],[{axis:f},s[m],u[d]])})}),Object.keys(o).forEach(a=>{let l=o[a];Le(l,[A.scales[l.type],A.scale])}),o}function rl(i){let t=i.options||(i.options={});t.plugins=E(t.plugins,{}),t.scales=rd(i,t)}function ol(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function od(i){return i=i||{},i.data=ol(i.data),rl(i),i}var va=new Map,al=new Set;function Ws(i,t){let e=va.get(i);return e||(e=t(),va.set(i,e),al.add(e)),e}var Di=(i,t,e)=>{let s=Vt(t,e);s!==void 0&&i.add(s)},Sr=class{constructor(t){this._config=od(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=ol(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),rl(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ws(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ws(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ws(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,s=this.type;return Ws(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let s=this._scopeCache,n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){let{options:n,type:r}=this,o=this._cachedScopes(t,s),a=o.get(e);if(a)return a;let l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(u=>Di(l,t,u))),h.forEach(u=>Di(l,n,u)),h.forEach(u=>Di(l,Kt[r]||{},u)),h.forEach(u=>Di(l,A,u)),h.forEach(u=>Di(l,Is,u))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),al.has(e)&&o.set(e,c),c}chartOptionScopes(){let{options:t,type:e}=this;return[t,Kt[e]||{},A.datasets[e]||{},{type:e},A,Is]}resolveNamedOptions(t,e,s,n=[""]){let r={$shared:!0},{resolver:o,subPrefixes:a}=Oa(this._resolverCache,t,n),l=o;if(ld(o,e)){r.$shared=!1,s=zt(s)?s():s;let c=this.createResolver(t,s,a);l=me(o,s,c)}for(let c of e)r[c]=l[c];return r}createResolver(t,e,s=[""],n){let{resolver:r}=Oa(this._resolverCache,t,s);return F(e)?me(r,e,void 0,n):r}};function Oa(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));let n=e.join(),r=s.get(n);return r||(r={resolver:As(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,r)),r}var ad=i=>F(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||zt(i[e]),!1);function ld(i,t){let{isScriptable:e,isIndexable:s}=qn(i);for(let n of t){let r=e(n),o=s(n),a=(o||r)&&i[n];if(r&&(zt(a)||ad(a))||o&&B(a))return!0}return!1}var cd="3.9.1",hd=["top","bottom","left","right","chartArea"];function Da(i,t){return i==="top"||i==="bottom"||hd.indexOf(i)===-1&&t==="x"}function Ea(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Ia(i){let t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),$(e&&e.onComplete,[i],t)}function ud(i){let t=i.chart,e=t.options.animation;$(e&&e.onProgress,[i],t)}function ll(i){return Jn()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}var Ys={},cl=i=>{let t=ll(i);return Object.values(Ys).filter(e=>e.canvas===t).pop()};function dd(i,t,e){let s=Object.keys(i);for(let n of s){let r=+n;if(r>=t){let o=i[n];delete i[n],(e>0||r>t)&&(i[r+e]=o)}}}function fd(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}var xe=class{constructor(t,e){let s=this.config=new Sr(e),n=ll(t),r=cl(n);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");let o=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Ku(n)),this.platform.updateConfig(s);let a=this.platform.acquireContext(n,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Do(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new xr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=zo(u=>this.update(u),o.resizeDelay||0),this._dataChanges=[],Ys[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Bt.listen(this,"complete",Ia),Bt.listen(this,"progress",ud),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:r}=this;return P(t)?e&&r?r:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Qn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Un(this.canvas,this.ctx),this}stop(){return Bt.stop(this),this}resize(t,e){Bt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let s=this.options,n=this.canvas,r=s.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(n,t,e,r),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Qn(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),$(s.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let e=this.options.scales||{};V(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){let t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((o,a)=>(o[a]=!1,o),{}),r=[];e&&(r=r.concat(Object.keys(e).map(o=>{let a=e[o],l=wr(o,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),V(r,o=>{let a=o.options,l=a.id,c=wr(l,a),h=E(a.type,o.dtype);(a.position===void 0||Da(a.position,c)!==Da(o.dposition))&&(a.position=o.dposition),n[l]=!0;let u=null;if(l in s&&s[l].type===h)u=s[l];else{let d=Pt.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),s[u.id]=u}u.init(a,t)}),V(n,(o,a)=>{o||delete s[a]}),V(s,o=>{ot.configure(this,o,o.options),ot.addBox(this,o)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,r)=>n.index-r.index),s>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(r=>r===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let t=[],e=this.data.datasets,s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ea("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){V(this.scales,t=>{ot.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!In(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:s,start:n,count:r}of e){let o=s==="_removeElements"?-r:r;dd(t,n,o)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,s=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),n=s(0);for(let r=1;rr.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ot.update(this,this.width,this.height,t);let e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],V(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,r)=>{n._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,s=t._clip,n=!s.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(n&&Si(e,{left:s.left===!1?0:r.left-s.left,right:s.right===!1?this.width:r.right+s.right,top:s.top===!1?0:r.top-s.top,bottom:s.bottom===!1?this.height:r.bottom+s.bottom}),t.controller.draw(),n&&ki(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Fe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){let r=Fu.modes[e];return typeof r=="function"?r(this,t,s,n):[]}getDatasetMeta(t){let e=this.data.datasets[t],s=this._metasets,n=s.filter(r=>r&&r._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=Ht(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){let s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){let n=s?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,n);dt(e)?(r.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),o.update(r,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Bt.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,r,o),t[r]=o},n=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};V(this.options.events,r=>s(r,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)},o,a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",r),s("detach",o)};o=()=>{this.attached=!1,n("resize",r),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){V(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},V(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){let n=s?"set":"remove",r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a{let a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!_i(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}_updateHoverStyles(t,e,s){let n=this.options.hover,r=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),o=r(e,t),a=s?t:r(t,e);o.length&&this.updateHoverStyle(o,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){let s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;let r=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(r||s.changed)&&this.render(),this}_handleEvent(t,e,s){let{_active:n=[],options:r}=this,o=e,a=this._getActiveElements(t,n,s,o),l=Co(t),c=fd(t,this._lastEvent,s,l);s&&(this._lastEvent=null,$(r.onHover,[t,a,this],this),l&&$(r.onClick,[t,a,this],this));let h=!_i(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;let r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}},Ca=()=>V(xe.instances,i=>i._plugins.invalidate()),ie=!0;Object.defineProperties(xe,{defaults:{enumerable:ie,value:A},instances:{enumerable:ie,value:Ys},overrides:{enumerable:ie,value:Kt},registry:{enumerable:ie,value:Pt},version:{enumerable:ie,value:cd},getChart:{enumerable:ie,value:cl},register:{enumerable:ie,value:(...i)=>{Pt.add(...i),Ca()}},unregister:{enumerable:ie,value:(...i)=>{Pt.remove(...i),Ca()}}});function hl(i,t,e){let{startAngle:s,pixelMargin:n,x:r,y:o,outerRadius:a,innerRadius:l}=t,c=n/a;i.beginPath(),i.arc(r,o,a,s-c,e+c),l>n?(c=n/l,i.arc(r,o,l,e+c,s-c,!0)):i.arc(r,o,n,e+U,s-U),i.closePath(),i.clip()}function md(i){return Fs(i,["outerStart","outerEnd","innerStart","innerEnd"])}function gd(i,t,e,s){let n=md(i.options.borderRadius),r=(e-t)/2,o=Math.min(r,s*t/2),a=l=>{let c=(e-Math.min(r,l))*s/2;return tt(l,0,Math.min(r,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:tt(n.innerStart,0,o),innerEnd:tt(n.innerEnd,0,o)}}function Ve(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function kr(i,t,e,s,n,r){let{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+s+e-c,0),d=h>0?h+s+e+c:0,f=0,m=n-l;if(s){let D=h>0?h-s:0,J=u>0?u-s:0,X=(D+J)/2,de=X!==0?m*X/(X+s):m;f=(m-de)/2}let g=Math.max(.001,m*u-e/j)/u,p=(m-g)/2,y=l+p+f,b=n-p-f,{outerStart:_,outerEnd:w,innerStart:x,innerEnd:S}=gd(t,d,u,b-y),k=u-_,v=u-w,T=y+_/k,C=b-w/v,N=d+x,L=d+S,K=y+x/N,lt=b-S/L;if(i.beginPath(),r){if(i.arc(o,a,u,T,C),w>0){let X=Ve(v,C,o,a);i.arc(X.x,X.y,w,C,b+U)}let D=Ve(L,b,o,a);if(i.lineTo(D.x,D.y),S>0){let X=Ve(L,lt,o,a);i.arc(X.x,X.y,S,b+U,lt+Math.PI)}if(i.arc(o,a,d,b-S/d,y+x/d,!0),x>0){let X=Ve(N,K,o,a);i.arc(X.x,X.y,x,K+Math.PI,y-U)}let J=Ve(k,y,o,a);if(i.lineTo(J.x,J.y),_>0){let X=Ve(k,T,o,a);i.arc(X.x,X.y,_,y-U,T)}}else{i.moveTo(o,a);let D=Math.cos(T)*u+o,J=Math.sin(T)*u+a;i.lineTo(D,J);let X=Math.cos(C)*u+o,de=Math.sin(C)*u+a;i.lineTo(X,de)}i.closePath()}function pd(i,t,e,s,n){let{fullCircles:r,startAngle:o,circumference:a}=t,l=t.endAngle;if(r){kr(i,t,e,s,o+H,n);for(let c=0;c=H||Ne(r,a,l),g=At(o,c+d,h+d);return m&&g}getCenterPoint(t){let{x:e,y:s,startAngle:n,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(n+r)/2,u=(o+a+c+l)/2;return{x:e+Math.cos(h)*u,y:s+Math.sin(h)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:s}=this,n=(e.offset||0)/2,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=s>H?Math.floor(s/H):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(n){a=n/2;let c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=j&&(a=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;let l=pd(t,this,a,r,o);bd(t,this,a,r,l,o),t.restore()}};qe.id="arc";qe.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};qe.defaultRoutes={backgroundColor:"backgroundColor"};function ul(i,t,e=t){i.lineCap=E(e.borderCapStyle,t.borderCapStyle),i.setLineDash(E(e.borderDash,t.borderDash)),i.lineDashOffset=E(e.borderDashOffset,t.borderDashOffset),i.lineJoin=E(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=E(e.borderWidth,t.borderWidth),i.strokeStyle=E(e.borderColor,t.borderColor)}function xd(i,t,e){i.lineTo(e.x,e.y)}function _d(i){return i.stepped?Zo:i.tension||i.cubicInterpolationMode==="monotone"?qo:xd}function dl(i,t,e={}){let s=i.length,{start:n=0,end:r=s-1}=e,{start:o,end:a}=t,l=Math.max(n,o),c=Math.min(r,a),h=na&&r>a;return{count:s,start:l,loop:t.loop,ilen:c(o+(c?a-w:w))%r,_=()=>{g!==p&&(i.lineTo(h,p),i.lineTo(h,g),i.lineTo(h,y))};for(l&&(f=n[b(0)],i.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=n[b(d)],f.skip)continue;let w=f.x,x=f.y,S=w|0;S===m?(xp&&(p=x),h=(u*h+w)/++u):(_(),i.lineTo(w,x),m=S,u=0,g=p=x),y=x}_()}function Mr(i){let t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Sd:wd}function kd(i){return i.stepped?sa:i.tension||i.cubicInterpolationMode==="monotone"?na:qt}function Md(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),ul(i,t.options),i.stroke(n)}function Td(i,t,e,s){let{segments:n,options:r}=t,o=Mr(t);for(let a of n)ul(i,r,a.style),i.beginPath(),o(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}var vd=typeof Path2D=="function";function Od(i,t,e,s){vd&&!t.options.segment?Md(i,t,e,s):Td(i,t,e,s)}var Nt=class extends pt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){let s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){let n=s.spanGaps?this._loop:this._fullLoop;ta(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=oa(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){let s=this.options,n=t[e],r=this.points,o=nr(this,{property:e,start:n,end:n});if(!o.length)return;let a=[],l=kd(s),c,h;for(c=0,h=o.length;ci!=="borderDash"&&i!=="fill"};function Fa(i,t,e,s){let n=i.options,{[e]:r}=i.getProps([e],s);return Math.abs(t-r)=e)return i.slice(t,t+e);let o=[],a=(e-2)/(r-2),l=0,c=t+e-1,h=t,u,d,f,m,g;for(o[l++]=i[h],u=0;uf&&(f=m,d=i[b],g=b);o[l++]=d,h=g}return o[l++]=i[c],o}function Pd(i,t,e,s){let n=0,r=0,o,a,l,c,h,u,d,f,m,g,p=[],y=t+e-1,b=i[t].x,w=i[y].x-b;for(o=t;og&&(g=c,d=o),n=(r*n+a.x)/++r;else{let S=o-1;if(!P(u)&&!P(d)){let k=Math.min(u,d),v=Math.max(u,d);k!==f&&k!==S&&p.push({...i[k],x:n}),v!==f&&v!==S&&p.push({...i[v],x:n})}o>0&&S!==f&&p.push(i[S]),p.push(a),h=x,r=0,m=g=c,u=d=f=o}}return p}function ml(i){if(i._decimated){let t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{value:t})}}function Aa(i){i.data.datasets.forEach(t=>{ml(t)})}function Nd(i,t){let e=t.length,s=0,n,{iScale:r}=i,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(s=tt(Ct(t,r.axis,o).lo,0,e-1)),c?n=tt(Ct(t,r.axis,a).hi+1,s,e)-s:n=e-s,{start:s,count:n}}var Rd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){Aa(i);return}let s=i.width;i.data.datasets.forEach((n,r)=>{let{_data:o,indexAxis:a}=n,l=i.getDatasetMeta(r),c=o||n.data;if(We([a,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let h=i.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||i.options.parsing)return;let{start:u,count:d}=Nd(l,c),f=e.threshold||4*s;if(d<=f){ml(n);return}P(o)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(e.algorithm){case"lttb":m=Ld(c,u,d,s,e);break;case"min-max":m=Pd(c,u,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=m})},destroy(i){Aa(i)}};function Wd(i,t,e){let s=i.segments,n=i.points,r=t.points,o=[];for(let a of s){let{start:l,end:c}=a;c=Dr(l,c,n);let h=Tr(e,n[l],n[c],a.loop);if(!t.segments){o.push({source:a,target:h,start:n[l],end:n[c]});continue}let u=nr(t,h);for(let d of u){let f=Tr(e,r[d.start],r[d.end],d.loop),m=sr(a,n,f);for(let g of m)o.push({source:g,target:d,start:{[e]:La(h,f,"start",Math.max)},end:{[e]:La(h,f,"end",Math.min)}})}}return o}function Tr(i,t,e,s){if(s)return;let n=t[i],r=e[i];return i==="angle"&&(n=ct(n),r=ct(r)),{property:i,start:n,end:r}}function zd(i,t){let{x:e=null,y:s=null}=i||{},n=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=Dr(o,a,n);let l=n[o],c=n[a];s!==null?(r.push({x:l.x,y:s}),r.push({x:c.x,y:s})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function Dr(i,t,e){for(;t>i;t--){let s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function La(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function gl(i,t){let e=[],s=!1;return B(i)?(s=!0,e=i):e=zd(i,t),e.length?new Nt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Pa(i){return i&&i.fill!==!1}function Vd(i,t,e){let n=i[t].fill,r=[t],o;if(!e)return n;for(;n!==!1&&r.indexOf(n)===-1;){if(!q(n))return n;if(o=i[n],!o)return!1;if(o.visible)return n;r.push(n),n=o.fill}return!1}function Hd(i,t,e){let s=Ud(i);if(F(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return q(n)&&Math.floor(n)===n?Bd(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Bd(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function $d(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:F(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function jd(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:F(i)?s=i.value:s=t.getBaseValue(),s}function Ud(i){let t=i.options,e=t.fill,s=E(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function Yd(i){let{scale:t,index:e,line:s}=i,n=[],r=s.segments,o=s.points,a=Zd(t,e);a.push(gl({x:null,y:t.bottom},s));for(let l=0;l=0;--o){let a=n[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),s&&a.fill&&fr(i.ctx,a,r))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;let s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){let r=s[n].$filler;Pa(r)&&fr(i.ctx,r,i.chartArea)}},beforeDatasetDraw(i,t,e){let s=t.meta.$filler;!Pa(s)||e.drawTime!=="beforeDatasetDraw"||fr(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},za=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},rf=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index,qs=class extends pt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=$(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}let s=t.labels,n=Q(s.font),r=n.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=za(s,r),c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(o,r,a,l)+10):(h=this.maxHeight,c=this._fitCols(o,r,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){let{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a,u=t;r.textAlign="left",r.textBaseline="middle";let d=-1,f=-h;return this.legendItems.forEach((m,g)=>{let p=s+e/2+r.measureText(m.text).width;(g===0||c[c.length-1]+p+2*a>o)&&(u+=h,c[c.length-(g>0?0:1)]=0,f+=h,d++),l[g]={left:0,top:f,row:d,width:p,height:n},c[c.length-1]+=p+a}),u}_fitCols(t,e,s,n){let{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=o-t,u=a,d=0,f=0,m=0,g=0;return this.legendItems.forEach((p,y)=>{let b=s+e/2+r.measureText(p.text).width;y>0&&f+n+2*a>h&&(u+=d+a,c.push({width:d,height:f}),m+=d+a,g++,d=f=0),l[y]={left:m,top:f,col:g,width:b,height:n},d=Math.max(d,b),f+=n+a}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:r}}=this,o=pe(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=nt(s,this.left+n,this.right-this.lineWidths[a]);for(let c of e)a!==c.row&&(a=c.row,l=nt(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+n}else{let a=0,l=nt(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(let c of e)c.col!==a&&(a=c.col,l=nt(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;Si(t,this),this._draw(),ki(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:r,labels:o}=t,a=A.color,l=pe(t.rtl,this.left,this.width),c=Q(o.font),{color:h,padding:u}=o,d=c.size,f=d/2,m;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:g,boxHeight:p,itemHeight:y}=za(o,d),b=function(k,v,T){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;n.save();let C=E(T.lineWidth,1);if(n.fillStyle=E(T.fillStyle,a),n.lineCap=E(T.lineCap,"butt"),n.lineDashOffset=E(T.lineDashOffset,0),n.lineJoin=E(T.lineJoin,"miter"),n.lineWidth=C,n.strokeStyle=E(T.strokeStyle,a),n.setLineDash(E(T.lineDash,[])),o.usePointStyle){let N={radius:p*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:C},L=l.xPlus(k,g/2),K=v+f;Yn(n,N,L,K,o.pointStyleWidth&&g)}else{let N=v+Math.max((d-p)/2,0),L=l.leftForLtr(k,g),K=te(T.borderRadius);n.beginPath(),Object.values(K).some(lt=>lt!==0)?Re(n,{x:L,y:N,w:g,h:p,radius:K}):n.rect(L,N,g,p),n.fill(),C!==0&&n.stroke()}n.restore()},_=function(k,v,T){Qt(n,T.text,k,v+y/2,c,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},w=this.isHorizontal(),x=this._computeTitleHeight();w?m={x:nt(r,this.left+u,this.right-s[0]),y:this.top+u+x,line:0}:m={x:this.left+u,y:nt(r,this.top+x+u,this.bottom-e[0].height),line:0},er(this.ctx,t.textDirection);let S=y+u;this.legendItems.forEach((k,v)=>{n.strokeStyle=k.fontColor||h,n.fillStyle=k.fontColor||h;let T=n.measureText(k.text).width,C=l.textAlign(k.textAlign||(k.textAlign=o.textAlign)),N=g+f+T,L=m.x,K=m.y;l.setWidth(this.width),w?v>0&&L+N+u>this.right&&(K=m.y+=S,m.line++,L=m.x=nt(r,this.left+u,this.right-s[m.line])):v>0&&K+S>this.bottom&&(L=m.x=L+e[m.line].width+u,m.line++,K=m.y=nt(r,this.top+x+u,this.bottom-e[m.line].height));let lt=l.x(L);b(lt,K,k),L=Vo(C,L+g+f,w?L+N:this.right,t.rtl),_(l.x(L),K,k),w?m.x+=N+u:m.y+=S}),ir(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,s=Q(e.font),n=rt(e.padding);if(!e.display)return;let r=pe(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=s.size/2,c=n.top+l,h,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,u=nt(t.align,u,this.right-d);else{let m=this.columnSizes.reduce((g,p)=>Math.max(g,p.height),0);h=c+nt(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}let f=nt(a,u,u+d);o.textAlign=r.textAlign(Es(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=s.string,Qt(o,e.text,f,h,s)}_computeTitleHeight(){let t=this.options.title,e=Q(t.font),s=rt(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,r;if(At(t,this.left,this.right)&&At(e,this.top,this.bottom)){for(r=this.legendHitBoxes,s=0;si.chart.options.color,boxWidth:40,padding:10,generateLabels(i){let t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:r}}=i.legend.options;return i._getSortedDatasetMetas().map(o=>{let a=o.controller.getStyle(e?0:void 0),l=rt(a.borderWidth);return{text:t[o.index].label,fillStyle:a.backgroundColor,fontColor:r,hidden:!o.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:0,datasetIndex:o.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}},Li=class extends pt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){let s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;let n=B(s.text)?s.text.length:1;this._padding=rt(s.padding);let r=n*Q(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:s,bottom:n,right:r,options:o}=this,a=o.align,l=0,c,h,u;return this.isHorizontal()?(h=nt(a,s,r),u=e+t,c=r-s):(o.position==="left"?(h=s+t,u=nt(a,n,e),l=j*-.5):(h=r-t,u=nt(a,e,n),l=j*.5),c=n-e),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let s=Q(e.font),r=s.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Qt(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:Es(e.align),textBaseline:"middle",translation:[o,a]})}};function lf(i,t){let e=new Li({ctx:i.ctx,options:t,chart:i});ot.configure(i,e,t),ot.addBox(i,e),i.titleBlock=e}var cf={id:"title",_element:Li,start(i,t,e){lf(i,e)},stop(i){let t=i.titleBlock;ot.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){let s=i.titleBlock;ot.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},zs=new WeakMap,hf={id:"subtitle",start(i,t,e){let s=new Li({ctx:i.ctx,options:e,chart:i});ot.configure(i,s,e),ot.addBox(i,s),zs.set(i,s)},stop(i){ot.removeBox(i,zs.get(i)),zs.delete(i)},beforeUpdate(i,t,e){let s=zs.get(i);ot.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Ii={average(i){if(!i.length)return!1;let t,e,s=0,n=0,r=0;for(t=0,e=i.length;t-1?i.split(` +`):i}function uf(i,t){let{element:e,datasetIndex:s,index:n}=t,r=i.getDatasetMeta(s).controller,{label:o,value:a}=r.getLabelAndValue(n);return{chart:i,label:o,parsed:r.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:r.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Va(i,t){let e=i.chart.ctx,{body:s,footer:n,title:r}=i,{boxWidth:o,boxHeight:a}=t,l=Q(t.bodyFont),c=Q(t.titleFont),h=Q(t.footerFont),u=r.length,d=n.length,f=s.length,m=rt(t.padding),g=m.height,p=0,y=s.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(y+=i.beforeBody.length+i.afterBody.length,u&&(g+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),y){let w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*w+(y-f)*l.lineHeight+(y-1)*t.bodySpacing}d&&(g+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let b=0,_=function(w){p=Math.max(p,e.measureText(w).width+b)};return e.save(),e.font=c.string,V(i.title,_),e.font=l.string,V(i.beforeBody.concat(i.afterBody),_),b=t.displayColors?o+2+t.boxPadding:0,V(s,w=>{V(w.before,_),V(w.lines,_),V(w.after,_)}),b=0,e.font=h.string,V(i.footer,_),e.restore(),p+=m.width,{width:p,height:g}}function df(i,t){let{y:e,height:s}=t;return ei.height-s/2?"bottom":"center"}function ff(i,t,e,s){let{x:n,width:r}=s,o=e.caretSize+e.caretPadding;if(i==="left"&&n+r+o>t.width||i==="right"&&n-r-o<0)return!0}function mf(i,t,e,s){let{x:n,width:r}=e,{width:o,chartArea:{left:a,right:l}}=i,c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=r/2?c="left":n>=o-r/2&&(c="right"),ff(c,i,t,e)&&(c="center"),c}function Ha(i,t,e){let s=e.yAlign||t.yAlign||df(i,e);return{xAlign:e.xAlign||t.xAlign||mf(i,t,e,s),yAlign:s}}function gf(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function pf(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Ba(i,t,e,s){let{caretSize:n,caretPadding:r,cornerRadius:o}=i,{xAlign:a,yAlign:l}=e,c=n+r,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=te(o),m=gf(t,a),g=pf(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(h,d)+n:a==="right"&&(m+=Math.max(u,f)+n),{x:tt(m,0,s.width-t.width),y:tt(g,0,s.height-t.height)}}function Vs(i,t,e){let s=rt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function $a(i){return Lt([],$t(i))}function yf(i,t,e){return Ht(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ja(i,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}var Pi=class extends pt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,r=new $s(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=yf(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:s}=e,n=s.beforeTitle.apply(this,[t]),r=s.title.apply(this,[t]),o=s.afterTitle.apply(this,[t]),a=[];return a=Lt(a,$t(n)),a=Lt(a,$t(r)),a=Lt(a,$t(o)),a}getBeforeBody(t,e){return $a(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){let{callbacks:s}=e,n=[];return V(t,r=>{let o={before:[],lines:[],after:[]},a=ja(s,r);Lt(o.before,$t(a.beforeLabel.call(this,r))),Lt(o.lines,a.label.call(this,r)),Lt(o.after,$t(a.afterLabel.call(this,r))),n.push(o)}),n}getAfterBody(t,e){return $a(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){let{callbacks:s}=e,n=s.beforeFooter.apply(this,[t]),r=s.footer.apply(this,[t]),o=s.afterFooter.apply(this,[t]),a=[];return a=Lt(a,$t(n)),a=Lt(a,$t(r)),a=Lt(a,$t(o)),a}_createItems(t){let e=this._active,s=this.chart.data,n=[],r=[],o=[],a=[],l,c;for(l=0,c=e.length;lt.filter(h,u,d,s))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,s))),V(a,h=>{let u=ja(t.callbacks,h);n.push(u.labelColor.call(this,h)),r.push(u.labelPointStyle.call(this,h)),o.push(u.labelTextColor.call(this,h))}),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){let s=this.options.setContext(this.getContext()),n=this._active,r,o=[];if(!n.length)this.opacity!==0&&(r={opacity:0});else{let a=Ii[s.position].call(this,n,this._eventPosition);o=this._createItems(s),this.title=this.getTitle(o,s),this.beforeBody=this.getBeforeBody(o,s),this.body=this.getBody(o,s),this.afterBody=this.getAfterBody(o,s),this.footer=this.getFooter(o,s);let l=this._size=Va(this,s),c=Object.assign({},a,l),h=Ha(this.chart,s,c),u=Ba(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,r={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){let r=this.getCaretPosition(t,s,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,s){let{xAlign:n,yAlign:r}=this,{caretSize:o,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=te(a),{x:d,y:f}=t,{width:m,height:g}=e,p,y,b,_,w,x;return r==="center"?(w=f+g/2,n==="left"?(p=d,y=p-o,_=w+o,x=w-o):(p=d+m,y=p+o,_=w-o,x=w+o),b=p):(n==="left"?y=d+Math.max(l,h)+o:n==="right"?y=d+m-Math.max(c,u)-o:y=this.caretX,r==="top"?(_=f,w=_-o,p=y-o,b=y+o):(_=f+g,w=_+o,p=y+o,b=y-o),x=_),{x1:p,x2:y,x3:b,y1:_,y2:w,y3:x}}drawTitle(t,e,s){let n=this.title,r=n.length,o,a,l;if(r){let c=pe(s.rtl,this.x,this.width);for(t.x=Vs(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",o=Q(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=o.string,l=0;l_!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Re(t,{x:p,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Re(t,{x:y,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(y,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){let{body:n}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,u=Q(s.bodyFont),d=u.lineHeight,f=0,m=pe(s.rtl,this.x,this.width),g=function(v){e.fillText(v,m.x(t.x+f),t.y+d/2),t.y+=d+r},p=m.textAlign(o),y,b,_,w,x,S,k;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=Vs(this,p,s),e.fillStyle=s.bodyColor,V(this.beforeBody,g),f=a&&p!=="right"?o==="center"?c/2+h:c+2+h:0,w=0,S=n.length;w0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,s=this.$animations,n=s&&s.x,r=s&&s.y;if(n||r){let o=Ii[t.position].call(this,this._active,this._eventPosition);if(!o)return;let a=this._size=Va(this,t),l=Object.assign({},o,this._size),c=Ha(e,t,l),h=Ba(t,l,c,e);(n._to!==h.x||r._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),s=this.opacity;if(!s)return;this._updateAnimationTarget(e);let n={width:this.width,height:this.height},r={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;let o=rt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(r,t,n,e),er(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),ir(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let s=this._active,n=t.map(({datasetIndex:a,index:l})=>{let c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!_i(s,n),o=this._positionChanged(n,e);(r||o)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let n=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,s),a=this._positionChanged(o,t),l=e||!_i(o,r)||a;return l&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){let r=this.options;if(t.type==="mouseout")return[];if(!n)return e;let o=this.chart.getElementsAtEventForMode(t,r.mode,r,s);return r.reverse&&o.reverse(),o}_positionChanged(t,e){let{caretX:s,caretY:n,options:r}=this,o=Ii[r.position].call(this,t,e);return o!==!1&&(s!==o.x||n!==o.y)}};Pi.positioners=Ii;var bf={id:"tooltip",_element:Pi,positioners:Ii,afterInit(i,t,e){e&&(i.tooltip=new Pi({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){let t=i.tooltip;if(t&&t._willRender()){let e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",e)===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){let e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:Ft,title(i){if(i.length>0){let t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndexi!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},xf=Object.freeze({__proto__:null,Decimation:Rd,Filler:nf,Legend:af,SubTitle:hf,Title:cf,Tooltip:bf}),_f=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function wf(i,t,e,s){let n=i.indexOf(t);if(n===-1)return _f(i,t,e,s);let r=i.lastIndexOf(t);return n!==r?e:n}var Sf=(i,t)=>i===null?null:tt(Math.round(i),0,t),Ke=class extends be{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let s=this.getLabels();for(let{index:n,label:r}of e)s[n]===r&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(P(t))return null;let s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:wf(s,t,E(e,t),this._addedLabels),Sf(e,s.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){let t=this.min,e=this.max,s=this.options.offset,n=[],r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let o=t;o<=e;o++)n.push({value:o});return n}getLabelForValue(t){let e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};Ke.id="category";Ke.defaults={ticks:{callback:Ke.prototype.getLabelForValue}};function kf(i,t){let e=[],{bounds:n,step:r,min:o,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=i,f=r||1,m=h-1,{min:g,max:p}=t,y=!P(o),b=!P(a),_=!P(c),w=(p-g)/(u+1),x=Cn((p-g)/m/f)*f,S,k,v,T;if(x<1e-14&&!y&&!b)return[{value:g},{value:p}];T=Math.ceil(p/x)-Math.floor(g/x),T>m&&(x=Cn(T*x/m/f)*f),P(l)||(S=Math.pow(10,l),x=Math.ceil(x*S)/S),n==="ticks"?(k=Math.floor(g/x)*x,v=Math.ceil(p/x)*x):(k=g,v=p),y&&b&&r&&Ao((a-o)/r,x/1e3)?(T=Math.round(Math.min((a-o)/x,h)),x=(a-o)/T,k=o,v=a):_?(k=y?o:k,v=b?a:v,T=c-1,x=(v-k)/T):(T=(v-k)/x,Pe(T,Math.round(T),x/1e3)?T=Math.round(T):T=Math.ceil(T));let C=Math.max(An(x),An(k));S=Math.pow(10,P(l)?C:l),k=Math.round(k*S)/S,v=Math.round(v*S)/S;let N=0;for(y&&(d&&k!==o?(e.push({value:o}),kn=e?n:l,a=l=>r=s?r:l;if(t){let l=Mt(n),c=Mt(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(n===r){let l=1;(r>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(r*.05)),a(r+l),t||o(n-l)}this.min=n,this.max=r}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,s=this.getTickLimit();s=Math.max(2,s);let n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=kf(n,r);return t.bounds==="ticks"&&Fn(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){let t=this.ticks,e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){let n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return ze(t,this.chart.options.locale,this.options.ticks.format)}},Ni=class extends Je{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=q(t)?t:0,this.max=q(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,s=_t(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};Ni.id="linear";Ni.defaults={ticks:{callback:Gs.formatters.numeric}};function Ya(i){return i/Math.pow(10,Math.floor(mt(i)))===1}function Mf(i,t){let e=Math.floor(mt(t.max)),s=Math.ceil(t.max/Math.pow(10,e)),n=[],r=ft(i.min,Math.pow(10,Math.floor(mt(t.min)))),o=Math.floor(mt(r)),a=Math.floor(r/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do n.push({value:r,major:Ya(r)}),++a,a===10&&(a=1,++o,l=o>=0?1:l),r=Math.round(a*Math.pow(10,o)*l)/l;while(o0?s:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=q(t)?Math.max(0,t):null,this.max=q(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),s=this.min,n=this.max,r=l=>s=t?s:l,o=l=>n=e?n:l,a=(l,c)=>Math.pow(10,Math.floor(mt(l))+c);s===n&&(s<=0?(r(1),o(10)):(r(a(s,-1)),o(a(n,1)))),s<=0&&r(a(n,-1)),n<=0&&o(a(s,1)),this._zero&&this.min!==this._suggestedMin&&s===a(this.min,0)&&r(a(s,-1)),this.min=s,this.max=n}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},s=Mf(e,this);return t.bounds==="ticks"&&Fn(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":ze(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=mt(t),this._valueRange=mt(this.max)-mt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(mt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};Ri.id="logarithmic";Ri.defaults={ticks:{callback:Gs.formatters.logarithmic,major:{enabled:!0}}};function vr(i){let t=i.ticks;if(t.display&&i.display){let e=rt(t.backdropPadding);return E(t.font&&t.font.size,A.font.size)+e.height}return 0}function Tf(i,t,e){return e=B(e)?e:[e],{w:Yo(i,t.string,e),h:e.length*t.lineHeight}}function Za(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:in?{start:t-e,end:t}:{start:t,end:t+e}}function vf(i){let t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],r=i._pointLabels.length,o=i.options.pointLabels,a=o.centerPointLabels?j/r:0;for(let l=0;lt.r&&(a=(s.end-t.r)/r,i.r=Math.max(i.r,t.r+a)),n.startt.b&&(l=(n.end-t.b)/o,i.b=Math.max(i.b,t.b+l))}function Df(i,t,e){let s=[],n=i._pointLabels.length,r=i.options,o=vr(r)/2,a=i.drawingArea,l=r.pointLabels.centerPointLabels?j/n:0;for(let c=0;c270||e<90)&&(i-=t),i}function Ff(i,t){let{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){let r=s.setContext(i.getPointLabelContext(n)),o=Q(r.font),{x:a,y:l,textAlign:c,left:h,top:u,right:d,bottom:f}=i._pointLabelItems[n],{backdropColor:m}=r;if(!P(m)){let g=te(r.borderRadius),p=rt(r.backdropPadding);e.fillStyle=m;let y=h-p.left,b=u-p.top,_=d-h+p.width,w=f-u+p.height;Object.values(g).some(x=>x!==0)?(e.beginPath(),Re(e,{x:y,y:b,w:_,h:w,radius:g}),e.fill()):e.fillRect(y,b,_,w)}Qt(e,i._pointLabels[n],a,l+o.lineHeight/2,o,{color:r.color,textAlign:c,textBaseline:"middle"})}}function pl(i,t,e,s){let{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,H);else{let r=i.getPointPosition(0,t);n.moveTo(r.x,r.y);for(let o=1;o{let n=$(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){let t=this.options;t.display&&t.pointLabels.display?vf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){let e=H/(this._pointLabels.length||1),s=this.options.startAngle||0;return ct(t*e+_t(s))}getDistanceFromCenterForValue(t){if(P(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(P(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);let u=n.setContext(this.getContext(h-1));Af(this,u,a,r)}}),s.display){for(t.save(),o=r-1;o>=0;o--){let c=s.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:u}=c;!u||!h||(t.lineWidth=u,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;let n=this.getIndexAngle(0),r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;let c=s.setContext(this.getContext(l)),h=Q(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let u=rt(c.backdropPadding);t.fillRect(-o/2-u.left,-r-h.size/2-u.top,o+u.width,h.size+u.height)}Qt(t,a.label,0,-r,h,{color:c.color})}),t.restore()}drawTitle(){}};_e.id="radialLinear";_e.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Gs.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}};_e.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};_e.descriptors={angleLines:{_fallback:"grid"}};var Xs={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ht=Object.keys(Xs);function Pf(i,t){return i-t}function qa(i,t){if(P(t))return null;let e=i._adapter,{parser:s,round:n,isoWeekday:r}=i._parseOpts,o=t;return typeof s=="function"&&(o=s(o)),q(o)||(o=typeof s=="string"?e.parse(o,s):e.parse(o)),o===null?null:(n&&(o=n==="week"&&(ge(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,n)),+o)}function Ga(i,t,e,s){let n=ht.length;for(let r=ht.indexOf(i);r=ht.indexOf(e);r--){let o=ht[r];if(Xs[o].common&&i._adapter.diff(n,s,o)>=t-1)return o}return ht[e?ht.indexOf(e):0]}function Rf(i){for(let t=ht.indexOf(i)+1,e=ht.length;t=t?e[s]:e[n];i[r]=!0}}function Wf(i,t,e,s){let n=i._adapter,r=+n.startOf(t[0].value,s),o=t[t.length-1].value,a,l;for(a=r;a<=o;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function Ka(i,t,e){let s=[],n={},r=t.length,o,a;for(o=0;o+t.value))}initOffsets(t){let e=0,s=0,n,r;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?s=r:s=(r-this.getDecimalForValue(t[t.length-2]))/2);let o=t.length<3?.5:.25;e=tt(e,0,o),s=tt(s,0,o),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){let t=this._adapter,e=this.min,s=this.max,n=this.options,r=n.time,o=r.unit||Ga(r.minUnit,e,s,this._getLabelCapacity(e)),a=E(r.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=ge(l)||l===!0,h={},u=e,d,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":o),t.diff(s,e,o)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+o);let m=n.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;dg-p).map(g=>+g)}getLabelForValue(t){let e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}_tickFormatFunction(t,e,s,n){let r=this.options,o=r.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&o[a],h=l&&o[l],u=s[e],d=l&&h&&u&&u.major,f=this._adapter.format(t,n||(d?h:c)),m=r.ticks.callback;return m?$(m,[f,e,s],this):f}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;let n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=Ct(i,"pos",t)),{pos:r,time:a}=i[s],{pos:o,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=Ct(i,"time",t)),{time:r,pos:a}=i[s],{time:o,pos:l}=i[n]);let c=o-r;return c?a+(l-a)*(t-r)/c:a}var Wi=class extends we{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Hs(e,this.min),this._tableRange=Hs(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:e,max:s}=this,n=[],r=[],o,a,l,c,h;for(o=0,a=t.length;o=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(o=0,a=n.length;o=0?m:1e3+m,(d-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}};var bl={};function jf(i,t={}){let e=JSON.stringify([i,t]),s=bl[e];return s||(s=new Intl.ListFormat(i,t),bl[e]=s),s}var Fr={};function Ar(i,t={}){let e=JSON.stringify([i,t]),s=Fr[e];return s||(s=new Intl.DateTimeFormat(i,t),Fr[e]=s),s}var Lr={};function Uf(i,t={}){let e=JSON.stringify([i,t]),s=Lr[e];return s||(s=new Intl.NumberFormat(i,t),Lr[e]=s),s}var Pr={};function Yf(i,t={}){let{base:e,...s}=t,n=JSON.stringify([i,s]),r=Pr[n];return r||(r=new Intl.RelativeTimeFormat(i,t),Pr[n]=r),r}var rs=null;function Zf(){return rs||(rs=new Intl.DateTimeFormat().resolvedOptions().locale,rs)}var xl={};function qf(i){let t=xl[i];if(!t){let e=new Intl.Locale(i);t="getWeekInfo"in e?e.getWeekInfo():e.weekInfo,xl[i]=t}return t}function Gf(i){let t=i.indexOf("-x-");t!==-1&&(i=i.substring(0,t));let e=i.indexOf("-u-");if(e===-1)return[i];{let s,n;try{s=Ar(i).resolvedOptions(),n=i}catch{let l=i.substring(0,e);s=Ar(l).resolvedOptions(),n=l}let{numberingSystem:r,calendar:o}=s;return[n,r,o]}}function Xf(i,t,e){return(e||t)&&(i.includes("-u-")||(i+="-u"),e&&(i+=`-ca-${e}`),t&&(i+=`-nu-${t}`)),i}function Kf(i){let t=[];for(let e=1;e<=12;e++){let s=I.utc(2009,e,1);t.push(i(s))}return t}function Jf(i){let t=[];for(let e=1;e<=7;e++){let s=I.utc(2016,11,13+e);t.push(i(s))}return t}function rn(i,t,e,s){let n=i.listingMode();return n==="error"?null:n==="en"?e(t):s(t)}function Qf(i){return i.numberingSystem&&i.numberingSystem!=="latn"?!1:i.numberingSystem==="latn"||!i.locale||i.locale.startsWith("en")||new Intl.DateTimeFormat(i.intl).resolvedOptions().numberingSystem==="latn"}var Nr=class{constructor(t,e,s){this.padTo=s.padTo||0,this.floor=s.floor||!1;let{padTo:n,floor:r,...o}=s;if(!e||Object.keys(o).length>0){let a={useGrouping:!1,...s};s.padTo>0&&(a.minimumIntegerDigits=s.padTo),this.inf=Uf(t,a)}}format(t){if(this.inf){let e=this.floor?Math.floor(t):t;return this.inf.format(e)}else{let e=this.floor?Math.floor(t):ei(t,3);return Y(e,this.padTo)}}},Rr=class{constructor(t,e,s){this.opts=s,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){let o=-1*(t.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&at.create(a).valid?(n=a,this.dt=t):(n="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,n=t.zone.name):(n="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);let r={...this.opts};r.timeZone=r.timeZone||n,this.dtf=Ar(e,r)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(e=>{if(e.type==="timeZoneName"){let s=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:s}}else return e}):t}resolvedOptions(){return this.dtf.resolvedOptions()}},Wr=class{constructor(t,e,s){this.opts={style:"long",...s},!e&&on()&&(this.rtf=Yf(t,s))}format(t,e){return this.rtf?this.rtf.format(t,e):_l(e,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}},tm={firstDay:1,minimalDays:4,weekend:[6,7]},W=class i{static fromOpts(t){return i.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,s,n,r=!1){let o=t||R.defaultLocale,a=o||(r?"en-US":Zf()),l=e||R.defaultNumberingSystem,c=s||R.defaultOutputCalendar,h=os(n)||R.defaultWeekSettings;return new i(a,l,c,h,o)}static resetCache(){rs=null,Fr={},Lr={},Pr={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:s,weekSettings:n}={}){return i.create(t,e,s,n)}constructor(t,e,s,n,r){let[o,a,l]=Gf(t);this.locale=o,this.numberingSystem=e||a||null,this.outputCalendar=s||l||null,this.weekSettings=n,this.intl=Xf(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Qf(this)),this.fastNumbersCached}listingMode(){let t=this.isEnglish(),e=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&e?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:i.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,os(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1){return rn(this,t,zr,()=>{let s=e?{month:t,day:"numeric"}:{month:t},n=e?"format":"standalone";return this.monthsCache[n][t]||(this.monthsCache[n][t]=Kf(r=>this.extract(r,s,"month"))),this.monthsCache[n][t]})}weekdays(t,e=!1){return rn(this,t,Vr,()=>{let s=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},n=e?"format":"standalone";return this.weekdaysCache[n][t]||(this.weekdaysCache[n][t]=Jf(r=>this.extract(r,s,"weekday"))),this.weekdaysCache[n][t]})}meridiems(){return rn(this,void 0,()=>Hr,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[I.utc(2016,11,13,9),I.utc(2016,11,13,19)].map(e=>this.extract(e,t,"dayperiod"))}return this.meridiemCache})}eras(t){return rn(this,t,Br,()=>{let e={era:t};return this.eraCache[t]||(this.eraCache[t]=[I.utc(-40,1,1),I.utc(2017,1,1)].map(s=>this.extract(s,e,"era"))),this.eraCache[t]})}extract(t,e,s){let n=this.dtFormatter(t,e),r=n.formatToParts(),o=r.find(a=>a.type.toLowerCase()===s);return o?o.value:null}numberFormatter(t={}){return new Nr(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new Rr(t,this.intl,e)}relFormatter(t={}){return new Wr(this.intl,this.isEnglish(),t)}listFormatter(t={}){return jf(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:an()?qf(this.locale):tm}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}};var jr=null,et=class i extends ut{static get utcInstance(){return jr===null&&(jr=new i(0)),jr}static instance(t){return t===0?i.utcInstance:new i(t)}static parseSpecifier(t){if(t){let e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new i(Se(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ae(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ae(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return ae(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};var ii=class extends ut{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function Dt(i,t){let e;if(O(i)||i===null)return t;if(i instanceof ut)return i;if(wl(i)){let s=i.toLowerCase();return s==="default"?t:s==="local"||s==="system"?oe.instance:s==="utc"||s==="gmt"?et.utcInstance:et.parseSpecifier(s)||at.create(i)}else return Et(i)?et.instance(i):typeof i=="object"&&"offset"in i&&typeof i.offset=="function"?i:new ii(i)}var Ur={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},Sl={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},em=Ur.hanidec.replace(/[\[|\]]/g,"").split("");function kl(i){let t=parseInt(i,10);if(isNaN(t)){t="";for(let e=0;e=r&&s<=o&&(t+=s-r)}}return parseInt(t,10)}else return t}var si={};function Ml(){si={}}function wt({numberingSystem:i},t=""){let e=i||"latn";return si[e]||(si[e]={}),si[e][t]||(si[e][t]=new RegExp(`${Ur[e]}${t}`)),si[e][t]}var Tl=()=>Date.now(),vl="system",Ol=null,Dl=null,El=null,Il=60,Cl,Fl=null,R=class{static get now(){return Tl}static set now(t){Tl=t}static set defaultZone(t){vl=t}static get defaultZone(){return Dt(vl,oe.instance)}static get defaultLocale(){return Ol}static set defaultLocale(t){Ol=t}static get defaultNumberingSystem(){return Dl}static set defaultNumberingSystem(t){Dl=t}static get defaultOutputCalendar(){return El}static set defaultOutputCalendar(t){El=t}static get defaultWeekSettings(){return Fl}static set defaultWeekSettings(t){Fl=os(t)}static get twoDigitCutoffYear(){return Il}static set twoDigitCutoffYear(t){Il=t%100}static get throwOnInvalid(){return Cl}static set throwOnInvalid(t){Cl=t}static resetCaches(){W.resetCache(),at.resetCache(),I.resetCache(),Ml()}};var it=class{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}};var Al=[0,31,59,90,120,151,181,212,243,273,304,334],Ll=[0,31,60,91,121,152,182,213,244,274,305,335];function St(i,t){return new it("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${i}, which is invalid`)}function ln(i,t,e){let s=new Date(Date.UTC(i,t-1,e));i<100&&i>=0&&s.setUTCFullYear(s.getUTCFullYear()-1900);let n=s.getUTCDay();return n===0?7:n}function Pl(i,t,e){return e+(Me(i)?Ll:Al)[t-1]}function Nl(i,t){let e=Me(i)?Ll:Al,s=e.findIndex(r=>rke(s,t,e)?(c=s+1,l=1):c=s,{weekYear:c,weekNumber:l,weekday:a,...cs(i)}}function Yr(i,t=4,e=1){let{weekYear:s,weekNumber:n,weekday:r}=i,o=cn(ln(s,1,t),e),a=le(s),l=n*7+r-o-7+t,c;l<1?(c=s-1,l+=le(c)):l>a?(c=s+1,l-=le(s)):c=s;let{month:h,day:u}=Nl(c,l);return{year:c,month:h,day:u,...cs(i)}}function hn(i){let{year:t,month:e,day:s}=i,n=Pl(t,e,s);return{year:t,ordinal:n,...cs(i)}}function Zr(i){let{year:t,ordinal:e}=i,{month:s,day:n}=Nl(t,e);return{year:t,month:s,day:n,...cs(i)}}function qr(i,t){if(!O(i.localWeekday)||!O(i.localWeekNumber)||!O(i.localWeekYear)){if(!O(i.weekday)||!O(i.weekNumber)||!O(i.weekYear))throw new Tt("Cannot mix locale-based week fields with ISO-based week fields");return O(i.localWeekday)||(i.weekday=i.localWeekday),O(i.localWeekNumber)||(i.weekNumber=i.localWeekNumber),O(i.localWeekYear)||(i.weekYear=i.localWeekYear),delete i.localWeekday,delete i.localWeekNumber,delete i.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Rl(i,t=4,e=1){let s=ls(i.weekYear),n=bt(i.weekNumber,1,ke(i.weekYear,t,e)),r=bt(i.weekday,1,7);return s?n?r?!1:St("weekday",i.weekday):St("week",i.weekNumber):St("weekYear",i.weekYear)}function Wl(i){let t=ls(i.year),e=bt(i.ordinal,1,le(i.year));return t?e?!1:St("ordinal",i.ordinal):St("year",i.year)}function Gr(i){let t=ls(i.year),e=bt(i.month,1,12),s=bt(i.day,1,ni(i.year,i.month));return t?e?s?!1:St("day",i.day):St("month",i.month):St("year",i.year)}function Xr(i){let{hour:t,minute:e,second:s,millisecond:n}=i,r=bt(t,0,23)||t===24&&e===0&&s===0&&n===0,o=bt(e,0,59),a=bt(s,0,59),l=bt(n,0,999);return r?o?a?l?!1:St("millisecond",n):St("second",s):St("minute",e):St("hour",t)}function O(i){return typeof i>"u"}function Et(i){return typeof i=="number"}function ls(i){return typeof i=="number"&&i%1===0}function wl(i){return typeof i=="string"}function Vl(i){return Object.prototype.toString.call(i)==="[object Date]"}function on(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function an(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Hl(i){return Array.isArray(i)?i:[i]}function Kr(i,t,e){if(i.length!==0)return i.reduce((s,n)=>{let r=[t(n),n];return s&&e(s[0],r[0])===s[0]?s:r},null)[1]}function Bl(i,t){return t.reduce((e,s)=>(e[s]=i[s],e),{})}function ce(i,t){return Object.prototype.hasOwnProperty.call(i,t)}function os(i){if(i==null)return null;if(typeof i!="object")throw new G("Week settings must be an object");if(!bt(i.firstDay,1,7)||!bt(i.minimalDays,1,7)||!Array.isArray(i.weekend)||i.weekend.some(t=>!bt(t,1,7)))throw new G("Invalid week settings");return{firstDay:i.firstDay,minimalDays:i.minimalDays,weekend:Array.from(i.weekend)}}function bt(i,t,e){return ls(i)&&i>=t&&i<=e}function im(i,t){return i-t*Math.floor(i/t)}function Y(i,t=2){let e=i<0,s;return e?s="-"+(""+-i).padStart(t,"0"):s=(""+i).padStart(t,"0"),s}function Ut(i){if(!(O(i)||i===null||i===""))return parseInt(i,10)}function he(i){if(!(O(i)||i===null||i===""))return parseFloat(i)}function hs(i){if(!(O(i)||i===null||i==="")){let t=parseFloat("0."+i)*1e3;return Math.floor(t)}}function ei(i,t,e=!1){let s=10**t;return(e?Math.trunc:Math.round)(i*s)/s}function Me(i){return i%4===0&&(i%100!==0||i%400===0)}function le(i){return Me(i)?366:365}function ni(i,t){let e=im(t-1,12)+1,s=i+(t-e)/12;return e===2?Me(s)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][e-1]}function ti(i){let t=Date.UTC(i.year,i.month-1,i.day,i.hour,i.minute,i.second,i.millisecond);return i.year<100&&i.year>=0&&(t=new Date(t),t.setUTCFullYear(i.year,i.month-1,i.day)),+t}function zl(i,t,e){return-cn(ln(i,1,t),e)+t-1}function ke(i,t=4,e=1){let s=zl(i,t,e),n=zl(i+1,t,e);return(le(i)-s+n)/7}function us(i){return i>99?i:i>R.twoDigitCutoffYear?1900+i:2e3+i}function en(i,t,e,s=null){let n=new Date(i),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};s&&(r.timeZone=s);let o={timeZoneName:t,...r},a=new Intl.DateTimeFormat(e,o).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Se(i,t){let e=parseInt(i,10);Number.isNaN(e)&&(e=0);let s=parseInt(t,10)||0,n=e<0||Object.is(e,-0)?-s:s;return e*60+n}function Jr(i){let t=Number(i);if(typeof i=="boolean"||i===""||Number.isNaN(t))throw new G(`Invalid unit value ${i}`);return t}function ri(i,t){let e={};for(let s in i)if(ce(i,s)){let n=i[s];if(n==null)continue;e[t(s)]=Jr(n)}return e}function ae(i,t){let e=Math.trunc(Math.abs(i/60)),s=Math.trunc(Math.abs(i%60)),n=i>=0?"+":"-";switch(t){case"short":return`${n}${Y(e,2)}:${Y(s,2)}`;case"narrow":return`${n}${e}${s>0?`:${s}`:""}`;case"techie":return`${n}${Y(e,2)}${Y(s,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function cs(i){return Bl(i,["hour","minute","second","millisecond"])}var sm=["January","February","March","April","May","June","July","August","September","October","November","December"],Qr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],nm=["J","F","M","A","M","J","J","A","S","O","N","D"];function zr(i){switch(i){case"narrow":return[...nm];case"short":return[...Qr];case"long":return[...sm];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var to=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],eo=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],rm=["M","T","W","T","F","S","S"];function Vr(i){switch(i){case"narrow":return[...rm];case"short":return[...eo];case"long":return[...to];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Hr=["AM","PM"],om=["Before Christ","Anno Domini"],am=["BC","AD"],lm=["B","A"];function Br(i){switch(i){case"narrow":return[...lm];case"short":return[...am];case"long":return[...om];default:return null}}function $l(i){return Hr[i.hour<12?0:1]}function jl(i,t){return Vr(t)[i.weekday-1]}function Ul(i,t){return zr(t)[i.month-1]}function Yl(i,t){return Br(t)[i.year<0?0:1]}function _l(i,t,e="always",s=!1){let n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},r=["hours","minutes","seconds"].indexOf(i)===-1;if(e==="auto"&&r){let u=i==="days";switch(t){case 1:return u?"tomorrow":`next ${n[i][0]}`;case-1:return u?"yesterday":`last ${n[i][0]}`;case 0:return u?"today":`this ${n[i][0]}`;default:}}let o=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,c=n[i],h=s?l?c[1]:c[2]||c[1]:l?n[i][0]:i;return o?`${a} ${h} ago`:`in ${a} ${h}`}function Zl(i,t){let e="";for(let s of i)s.literal?e+=s.val:e+=t(s.val);return e}var cm={D:re,DD:Vi,DDD:Hi,DDDD:Bi,t:$i,tt:ji,ttt:Ui,tttt:Yi,T:Zi,TT:qi,TTT:Gi,TTTT:Xi,f:Ki,ff:Qi,fff:es,ffff:ss,F:Ji,FF:ts,FFF:is,FFFF:ns},st=class i{static create(t,e={}){return new i(t,e)}static parseFormat(t){let e=null,s="",n=!1,r=[];for(let o=0;o0&&r.push({literal:n||/^\s+$/.test(s),val:s}),e=null,s="",n=!n):n||a===e?s+=a:(s.length>0&&r.push({literal:/^\s+$/.test(s),val:s}),s=a,e=a)}return s.length>0&&r.push({literal:n||/^\s+$/.test(s),val:s}),r}static macroTokenToFormatOpts(t){return cm[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}dtFormatter(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e})}formatDateTime(t,e){return this.dtFormatter(t,e).format()}formatDateTimeParts(t,e){return this.dtFormatter(t,e).formatToParts()}formatInterval(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e){return this.dtFormatter(t,e).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return Y(t,e);let s={...this.opts};return e>0&&(s.padTo=e),this.loc.numberFormatter(s).format(t)}formatDateTimeFromString(t,e){let s=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",r=(f,m)=>this.loc.extract(t,f,m),o=f=>t.isOffsetFixed&&t.offset===0&&f.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,f.format):"",a=()=>s?$l(t):r({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(f,m)=>s?Ul(t,f):r(m?{month:f}:{month:f,day:"numeric"},"month"),c=(f,m)=>s?jl(t,f):r(m?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),h=f=>{let m=i.macroTokenToFormatOpts(f);return m?this.formatWithSystemDefault(t,m):f},u=f=>s?Yl(t,f):r({era:f},"era"),d=f=>{switch(f){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return n?r({day:"numeric"},"day"):this.num(t.day);case"dd":return n?r({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return n?r({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return n?r({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return n?r({month:"numeric"},"month"):this.num(t.month);case"MM":return n?r({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return n?r({year:"numeric"},"year"):this.num(t.year);case"yy":return n?r({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return n?r({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return n?r({year:"numeric"},"year"):this.num(t.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return h(f)}};return Zl(i.parseFormat(e),d)}formatDurationFromString(t,e){let s=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=l=>c=>{let h=s(c);return h?this.num(l.get(h),c.length):c},r=i.parseFormat(e),o=r.reduce((l,{literal:c,val:h})=>c?l:l.concat(h),[]),a=t.shiftTo(...o.map(s).filter(l=>l));return Zl(r,n(a))}};var Gl=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ai(...i){let t=i.reduce((e,s)=>e+s.source,"");return RegExp(`^${t}$`)}function li(...i){return t=>i.reduce(([e,s,n],r)=>{let[o,a,l]=r(t,n);return[{...e,...o},a||s,l]},[{},null,1]).slice(0,2)}function ci(i,...t){if(i==null)return[null,null];for(let[e,s]of t){let n=e.exec(i);if(n)return s(n)}return[null,null]}function Xl(...i){return(t,e)=>{let s={},n;for(n=0;nf!==void 0&&(m||f&&h)?-f:f;return[{years:d(he(e)),months:d(he(s)),weeks:d(he(n)),days:d(he(r)),hours:d(he(o)),minutes:d(he(a)),seconds:d(he(l),l==="-0"),milliseconds:d(hs(c),u)}]}var Sm={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function no(i,t,e,s,n,r,o){let a={year:t.length===2?us(Ut(t)):Ut(t),month:Qr.indexOf(e)+1,day:Ut(s),hour:Ut(n),minute:Ut(r)};return o&&(a.second=Ut(o)),i&&(a.weekday=i.length>3?to.indexOf(i)+1:eo.indexOf(i)+1),a}var km=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Mm(i){let[,t,e,s,n,r,o,a,l,c,h,u]=i,d=no(t,n,s,e,r,o,a),f;return l?f=Sm[l]:c?f=0:f=Se(h,u),[d,new et(f)]}function Tm(i){return i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var vm=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Om=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Dm=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function ql(i){let[,t,e,s,n,r,o,a]=i;return[no(t,n,s,e,r,o,a),et.utcInstance]}function Em(i){let[,t,e,s,n,r,o,a]=i;return[no(t,a,e,s,n,r,o),et.utcInstance]}var Im=ai(um,so),Cm=ai(dm,so),Fm=ai(fm,so),Am=ai(Jl),tc=li(bm,hi,ds,fs),Lm=li(mm,hi,ds,fs),Pm=li(gm,hi,ds,fs),Nm=li(hi,ds,fs);function ec(i){return ci(i,[Im,tc],[Cm,Lm],[Fm,Pm],[Am,Nm])}function ic(i){return ci(Tm(i),[km,Mm])}function sc(i){return ci(i,[vm,ql],[Om,ql],[Dm,Em])}function nc(i){return ci(i,[_m,wm])}var Rm=li(hi);function rc(i){return ci(i,[xm,Rm])}var Wm=ai(pm,ym),zm=ai(Ql),Vm=li(hi,ds,fs);function oc(i){return ci(i,[Wm,tc],[zm,Vm])}var ac="Invalid Duration",cc={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Hm={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...cc},kt=146097/400,ui=146097/4800,Bm={years:{quarters:4,months:12,weeks:kt/7,days:kt,hours:kt*24,minutes:kt*24*60,seconds:kt*24*60*60,milliseconds:kt*24*60*60*1e3},quarters:{months:3,weeks:kt/28,days:kt/4,hours:kt*24/4,minutes:kt*24*60/4,seconds:kt*24*60*60/4,milliseconds:kt*24*60*60*1e3/4},months:{weeks:ui/7,days:ui,hours:ui*24,minutes:ui*24*60,seconds:ui*24*60*60,milliseconds:ui*24*60*60*1e3},...cc},Te=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],$m=Te.slice(0).reverse();function ue(i,t,e=!1){let s={values:e?t.values:{...i.values,...t.values||{}},loc:i.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||i.conversionAccuracy,matrix:t.matrix||i.matrix};return new Z(s)}function hc(i,t){let e=t.milliseconds??0;for(let s of $m.slice(1))t[s]&&(e+=t[s]*i[s].milliseconds);return e}function lc(i,t){let e=hc(i,t)<0?-1:1;Te.reduceRight((s,n)=>{if(O(t[n]))return s;if(s){let r=t[s]*e,o=i[n][s],a=Math.floor(r/o);t[n]+=a*e,t[s]-=a*o*e}return n},null),Te.reduce((s,n)=>{if(O(t[n]))return s;if(s){let r=t[s]%1;t[s]-=r,t[n]+=r*i[s][n]}return n},null)}function jm(i){let t={};for(let[e,s]of Object.entries(i))s!==0&&(t[e]=s);return t}var Z=class i{constructor(t){let e=t.conversionAccuracy==="longterm"||!1,s=e?Bm:Hm;t.matrix&&(s=t.matrix),this.values=t.values,this.loc=t.loc||W.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=s,this.isLuxonDuration=!0}static fromMillis(t,e){return i.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(t==null||typeof t!="object")throw new G(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new i({values:ri(t,i.normalizeUnit),loc:W.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(Et(t))return i.fromMillis(t);if(i.isDuration(t))return t;if(typeof t=="object")return i.fromObject(t);throw new G(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){let[s]=nc(t);return s?i.fromObject(s,e):i.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){let[s]=rc(t);return s?i.fromObject(s,e):i.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new G("need to specify a reason the Duration is invalid");let s=t instanceof it?t:new it(t,e);if(R.throwOnInvalid)throw new Qs(s);return new i({invalid:s})}static normalizeUnit(t){let e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!e)throw new Qe(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){let s={...e,floor:e.round!==!1&&e.floor!==!1};return this.isValid?st.create(this.loc,s).formatDurationFromString(this,t):ac}toHuman(t={}){if(!this.isValid)return ac;let e=Te.map(s=>{let n=this.values[s];return O(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:s.slice(0,-1)}).format(n)}).filter(s=>s);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=ei(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;let e=this.toMillis();return e<0||e>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},I.fromMillis(e,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?hc(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let e=i.fromDurationLike(t),s={};for(let n of Te)(ce(e.values,n)||ce(this.values,n))&&(s[n]=e.get(n)+this.get(n));return ue(this,{values:s},!0)}minus(t){if(!this.isValid)return this;let e=i.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;let e={};for(let s of Object.keys(this.values))e[s]=Jr(t(this.values[s],s));return ue(this,{values:e},!0)}get(t){return this[i.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let e={...this.values,...ri(t,i.normalizeUnit)};return ue(this,{values:e})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:s,matrix:n}={}){let o={loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:n,conversionAccuracy:s};return ue(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return lc(this.matrix,t),ue(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=jm(this.normalize().shiftToAll().toObject());return ue(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>i.normalizeUnit(o));let e={},s={},n=this.toObject(),r;for(let o of Te)if(t.indexOf(o)>=0){r=o;let a=0;for(let c in s)a+=this.matrix[c][o]*s[c],s[c]=0;Et(n[o])&&(a+=n[o]);let l=Math.trunc(a);e[o]=l,s[o]=(a*1e3-l*1e3)/1e3}else Et(n[o])&&(s[o]=n[o]);for(let o in s)s[o]!==0&&(e[r]+=o===r?s[o]:s[o]/this.matrix[r][o]);return lc(this.matrix,e),ue(this,{values:e},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let t={};for(let e of Object.keys(this.values))t[e]=this.values[e]===0?0:-this.values[e];return ue(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function e(s,n){return s===void 0||s===0?n===void 0||n===0:s===n}for(let s of Te)if(!e(this.values[s],t.values[s]))return!1;return!0}};var di="Invalid Interval";function Um(i,t){return!i||!i.isValid?Yt.invalid("missing or invalid start"):!t||!t.isValid?Yt.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:e}={}){return this.isValid?i.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];let e=t.map(fi).filter(o=>this.contains(o)).sort((o,a)=>o.toMillis()-a.toMillis()),s=[],{s:n}=this,r=0;for(;n+this.e?this.e:o;s.push(i.fromDateTimes(n,a)),n=a,r+=1}return s}splitBy(t){let e=Z.fromDurationLike(t);if(!this.isValid||!e.isValid||e.as("milliseconds")===0)return[];let{s}=this,n=1,r,o=[];for(;sl*n));r=+a>+this.e?this.e:a,o.push(i.fromDateTimes(s,r)),s=r,n+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;let e=this.s>t.s?this.s:t.s,s=this.e=s?null:i.fromDateTimes(e,s)}union(t){if(!this.isValid)return this;let e=this.st.e?this.e:t.e;return i.fromDateTimes(e,s)}static merge(t){let[e,s]=t.sort((n,r)=>n.s-r.s).reduce(([n,r],o)=>r?r.overlaps(o)||r.abutsStart(o)?[n,r.union(o)]:[n.concat([r]),o]:[n,o],[[],null]);return s&&e.push(s),e}static xor(t){let e=null,s=0,n=[],r=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...r),a=o.sort((l,c)=>l.time-c.time);for(let l of a)s+=l.type==="s"?1:-1,s===1?e=l.time:(e&&+e!=+l.time&&n.push(i.fromDateTimes(e,l.time)),e=null);return i.merge(n)}difference(...t){return i.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:di}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=re,e={}){return this.isValid?st.create(this.s.loc.clone(e),t).formatInterval(this):di}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:di}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:di}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:di}toFormat(t,{separator:e=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:di}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):Z.invalid(this.invalidReason)}mapEndpoints(t){return i.fromDateTimes(t(this.s),t(this.e))}};var Zt=class{static hasDST(t=R.defaultZone){let e=I.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return at.isValidZone(t)}static normalizeZone(t){return Dt(t,R.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||W.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||W.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||W.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||W.create(e,s,r)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null,outputCalendar:r="gregory"}={}){return(n||W.create(e,s,r)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null}={}){return(n||W.create(e,s,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:s=null,locObj:n=null}={}){return(n||W.create(e,s,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return W.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return W.create(e,null,"gregory").eras(t)}static features(){return{relative:on(),localeWeek:an()}}};function uc(i,t){let e=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),s=e(t)-e(i);return Math.floor(Z.fromMillis(s).as("days"))}function Ym(i,t,e){let s=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{let h=uc(l,c);return(h-h%7)/7}],["days",uc]],n={},r=i,o,a;for(let[l,c]of s)e.indexOf(l)>=0&&(o=l,n[l]=c(i,t),a=r.plus(n),a>t?(n[l]--,i=r.plus(n),i>t&&(a=i,n[l]--,i=r.plus(n))):i=a);return[i,n,a,o]}function dc(i,t,e,s){let[n,r,o,a]=Ym(i,t,e),l=t-n,c=e.filter(u=>["hours","minutes","seconds","milliseconds"].indexOf(u)>=0);c.length===0&&(o0?Z.fromMillis(l,s).shiftTo(...c).plus(h):h}var Zm="missing Intl.DateTimeFormat.formatToParts support";function z(i,t=e=>e){return{regex:i,deser:([e])=>t(kl(e))}}var qm="\xA0",gc=`[ ${qm}]`,pc=new RegExp(gc,"g");function Gm(i){return i.replace(/\./g,"\\.?").replace(pc,gc)}function fc(i){return i.replace(/\./g,"").replace(pc," ").toLowerCase()}function It(i,t){return i===null?null:{regex:RegExp(i.map(Gm).join("|")),deser:([e])=>i.findIndex(s=>fc(e)===fc(s))+t}}function mc(i,t){return{regex:i,deser:([,e,s])=>Se(e,s),groups:t}}function un(i){return{regex:i,deser:([t])=>t}}function Xm(i){return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Km(i,t){let e=wt(t),s=wt(t,"{2}"),n=wt(t,"{3}"),r=wt(t,"{4}"),o=wt(t,"{6}"),a=wt(t,"{1,2}"),l=wt(t,"{1,3}"),c=wt(t,"{1,6}"),h=wt(t,"{1,9}"),u=wt(t,"{2,4}"),d=wt(t,"{4,6}"),f=p=>({regex:RegExp(Xm(p.val)),deser:([y])=>y,literal:!0}),g=(p=>{if(i.literal)return f(p);switch(p.val){case"G":return It(t.eras("short"),0);case"GG":return It(t.eras("long"),0);case"y":return z(c);case"yy":return z(u,us);case"yyyy":return z(r);case"yyyyy":return z(d);case"yyyyyy":return z(o);case"M":return z(a);case"MM":return z(s);case"MMM":return It(t.months("short",!0),1);case"MMMM":return It(t.months("long",!0),1);case"L":return z(a);case"LL":return z(s);case"LLL":return It(t.months("short",!1),1);case"LLLL":return It(t.months("long",!1),1);case"d":return z(a);case"dd":return z(s);case"o":return z(l);case"ooo":return z(n);case"HH":return z(s);case"H":return z(a);case"hh":return z(s);case"h":return z(a);case"mm":return z(s);case"m":return z(a);case"q":return z(a);case"qq":return z(s);case"s":return z(a);case"ss":return z(s);case"S":return z(l);case"SSS":return z(n);case"u":return un(h);case"uu":return un(a);case"uuu":return z(e);case"a":return It(t.meridiems(),0);case"kkkk":return z(r);case"kk":return z(u,us);case"W":return z(a);case"WW":return z(s);case"E":case"c":return z(e);case"EEE":return It(t.weekdays("short",!1),1);case"EEEE":return It(t.weekdays("long",!1),1);case"ccc":return It(t.weekdays("short",!0),1);case"cccc":return It(t.weekdays("long",!0),1);case"Z":case"ZZ":return mc(new RegExp(`([+-]${a.source})(?::(${s.source}))?`),2);case"ZZZ":return mc(new RegExp(`([+-]${a.source})(${s.source})?`),2);case"z":return un(/[a-z_+-/]{1,256}?/i);case" ":return un(/[^\S\n\r]/);default:return f(p)}})(i)||{invalidReason:Zm};return g.token=i,g}var Jm={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Qm(i,t,e){let{type:s,value:n}=i;if(s==="literal"){let l=/^\s+$/.test(n);return{literal:!l,val:l?" ":n}}let r=t[s],o=s;s==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=e.hour12?"hour12":"hour24");let a=Jm[o];if(typeof a=="object"&&(a=a[r]),a)return{literal:!1,val:a}}function tg(i){return[`^${i.map(e=>e.regex).reduce((e,s)=>`${e}(${s.source})`,"")}$`,i]}function eg(i,t,e){let s=i.match(t);if(s){let n={},r=1;for(let o in e)if(ce(e,o)){let a=e[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(n[a.token.val[0]]=a.deser(s.slice(r,r+l))),r+=l}return[s,n]}else return[s,{}]}function ig(i){let t=r=>{switch(r){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},e=null,s;return O(i.z)||(e=at.create(i.z)),O(i.Z)||(e||(e=new et(i.Z)),s=i.Z),O(i.q)||(i.M=(i.q-1)*3+1),O(i.h)||(i.h<12&&i.a===1?i.h+=12:i.h===12&&i.a===0&&(i.h=0)),i.G===0&&i.y&&(i.y=-i.y),O(i.u)||(i.S=hs(i.u)),[Object.keys(i).reduce((r,o)=>{let a=t(o);return a&&(r[a]=i[o]),r},{}),e,s]}var ro=null;function sg(){return ro||(ro=I.fromMillis(1555555555555)),ro}function ng(i,t){if(i.literal)return i;let e=st.macroTokenToFormatOpts(i.val),s=lo(e,t);return s==null||s.includes(void 0)?i:s}function oo(i,t){return Array.prototype.concat(...i.map(e=>ng(e,t)))}var ms=class{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=oo(st.parseFormat(e),t),this.units=this.tokens.map(s=>Km(s,t)),this.disqualifyingUnit=this.units.find(s=>s.invalidReason),!this.disqualifyingUnit){let[s,n]=tg(this.units);this.regex=RegExp(s,"i"),this.handlers=n}}explainFromTokens(t){if(this.isValid){let[e,s]=eg(t,this.regex,this.handlers),[n,r,o]=s?ig(s):[null,null,void 0];if(ce(s,"a")&&ce(s,"H"))throw new Tt("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:e,matches:s,result:n,zone:r,specificOffset:o}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function ao(i,t,e){return new ms(i,e).explainFromTokens(t)}function yc(i,t,e){let{result:s,zone:n,specificOffset:r,invalidReason:o}=ao(i,t,e);return[s,n,r,o]}function lo(i,t){if(!i)return null;let s=st.create(t,i).dtFormatter(sg()),n=s.formatToParts(),r=s.resolvedOptions();return n.map(o=>Qm(o,i,r))}var co="Invalid DateTime",bc=864e13;function gs(i){return new it("unsupported zone",`the zone "${i.name}" is not supported`)}function ho(i){return i.weekData===null&&(i.weekData=as(i.c)),i.weekData}function uo(i){return i.localWeekData===null&&(i.localWeekData=as(i.c,i.loc.getMinDaysInFirstWeek(),i.loc.getStartOfWeek())),i.localWeekData}function ve(i,t){let e={ts:i.ts,zone:i.zone,c:i.c,o:i.o,loc:i.loc,invalid:i.invalid};return new I({...e,...t,old:e})}function Tc(i,t,e){let s=i-t*60*1e3,n=e.offset(s);if(t===n)return[s,t];s-=(n-t)*60*1e3;let r=e.offset(s);return n===r?[s,n]:[i-Math.min(n,r)*60*1e3,Math.max(n,r)]}function dn(i,t){i+=t*60*1e3;let e=new Date(i);return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),millisecond:e.getUTCMilliseconds()}}function mn(i,t,e){return Tc(ti(i),t,e)}function xc(i,t){let e=i.o,s=i.c.year+Math.trunc(t.years),n=i.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,r={...i.c,year:s,month:n,day:Math.min(i.c.day,ni(s,n))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=Z.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=ti(r),[l,c]=Tc(a,e,i.zone);return o!==0&&(l+=o,c=i.zone.offset(l)),{ts:l,o:c}}function mi(i,t,e,s,n,r){let{setZone:o,zone:a}=e;if(i&&Object.keys(i).length!==0||t){let l=t||a,c=I.fromObject(i,{...e,zone:l,specificOffset:r});return o?c:c.setZone(a)}else return I.invalid(new it("unparsable",`the input "${n}" can't be parsed as ${s}`))}function fn(i,t,e=!0){return i.isValid?st.create(W.create("en-US"),{allowZ:e,forceSimple:!0}).formatDateTimeFromString(i,t):null}function fo(i,t){let e=i.c.year>9999||i.c.year<0,s="";return e&&i.c.year>=0&&(s+="+"),s+=Y(i.c.year,e?6:4),t?(s+="-",s+=Y(i.c.month),s+="-",s+=Y(i.c.day)):(s+=Y(i.c.month),s+=Y(i.c.day)),s}function _c(i,t,e,s,n,r){let o=Y(i.c.hour);return t?(o+=":",o+=Y(i.c.minute),(i.c.millisecond!==0||i.c.second!==0||!e)&&(o+=":")):o+=Y(i.c.minute),(i.c.millisecond!==0||i.c.second!==0||!e)&&(o+=Y(i.c.second),(i.c.millisecond!==0||!s)&&(o+=".",o+=Y(i.c.millisecond,3))),n&&(i.isOffsetFixed&&i.offset===0&&!r?o+="Z":i.o<0?(o+="-",o+=Y(Math.trunc(-i.o/60)),o+=":",o+=Y(Math.trunc(-i.o%60))):(o+="+",o+=Y(Math.trunc(i.o/60)),o+=":",o+=Y(Math.trunc(i.o%60)))),r&&(o+="["+i.zone.ianaName+"]"),o}var vc={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},rg={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},og={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Oc=["year","month","day","hour","minute","second","millisecond"],ag=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],lg=["year","ordinal","hour","minute","second","millisecond"];function cg(i){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[i.toLowerCase()];if(!t)throw new Qe(i);return t}function wc(i){switch(i.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return cg(i)}}function hg(i){return pn[i]||(gn===void 0&&(gn=R.now()),pn[i]=i.offset(gn)),pn[i]}function Sc(i,t){let e=Dt(t.zone,R.defaultZone);if(!e.isValid)return I.invalid(gs(e));let s=W.fromObject(t),n,r;if(O(i.year))n=R.now();else{for(let l of Oc)O(i[l])&&(i[l]=vc[l]);let o=Gr(i)||Xr(i);if(o)return I.invalid(o);let a=hg(e);[n,r]=mn(i,a,e)}return new I({ts:n,zone:e,loc:s,o:r})}function kc(i,t,e){let s=O(e.round)?!0:e.round,n=(o,a)=>(o=ei(o,s||e.calendary?0:2,!0),t.loc.clone(e).relFormatter(e).format(o,a)),r=o=>e.calendary?t.hasSame(i,o)?0:t.startOf(o).diff(i.startOf(o),o).get(o):t.diff(i,o).get(o);if(e.unit)return n(r(e.unit),e.unit);for(let o of e.units){let a=r(o);if(Math.abs(a)>=1)return n(a,o)}return n(i>t?-0:0,e.units[e.units.length-1])}function Mc(i){let t={},e;return i.length>0&&typeof i[i.length-1]=="object"?(t=i[i.length-1],e=Array.from(i).slice(0,i.length-1)):e=Array.from(i),[t,e]}var gn,pn={},I=class i{constructor(t){let e=t.zone||R.defaultZone,s=t.invalid||(Number.isNaN(t.ts)?new it("invalid input"):null)||(e.isValid?null:gs(e));this.ts=O(t.ts)?R.now():t.ts;let n=null,r=null;if(!s)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[n,r]=[t.old.c,t.old.o];else{let a=Et(t.o)&&!t.old?t.o:e.offset(this.ts);n=dn(this.ts,a),s=Number.isNaN(n.year)?new it("invalid input"):null,n=s?null:n,r=s?null:a}this._zone=e,this.loc=t.loc||W.create(),this.invalid=s,this.weekData=null,this.localWeekData=null,this.c=n,this.o=r,this.isLuxonDateTime=!0}static now(){return new i({})}static local(){let[t,e]=Mc(arguments),[s,n,r,o,a,l,c]=e;return Sc({year:s,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static utc(){let[t,e]=Mc(arguments),[s,n,r,o,a,l,c]=e;return t.zone=et.utcInstance,Sc({year:s,month:n,day:r,hour:o,minute:a,second:l,millisecond:c},t)}static fromJSDate(t,e={}){let s=Vl(t)?t.valueOf():NaN;if(Number.isNaN(s))return i.invalid("invalid input");let n=Dt(e.zone,R.defaultZone);return n.isValid?new i({ts:s,zone:n,loc:W.fromObject(e)}):i.invalid(gs(n))}static fromMillis(t,e={}){if(Et(t))return t<-bc||t>bc?i.invalid("Timestamp out of range"):new i({ts:t,zone:Dt(e.zone,R.defaultZone),loc:W.fromObject(e)});throw new G(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(Et(t))return new i({ts:t*1e3,zone:Dt(e.zone,R.defaultZone),loc:W.fromObject(e)});throw new G("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};let s=Dt(e.zone,R.defaultZone);if(!s.isValid)return i.invalid(gs(s));let n=W.fromObject(e),r=ri(t,wc),{minDaysInFirstWeek:o,startOfWeek:a}=qr(r,n),l=R.now(),c=O(e.specificOffset)?s.offset(l):e.specificOffset,h=!O(r.ordinal),u=!O(r.year),d=!O(r.month)||!O(r.day),f=u||d,m=r.weekYear||r.weekNumber;if((f||h)&&m)throw new Tt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&h)throw new Tt("Can't mix ordinal dates with month/day");let g=m||r.weekday&&!f,p,y,b=dn(l,c);g?(p=ag,y=rg,b=as(b,o,a)):h?(p=lg,y=og,b=hn(b)):(p=Oc,y=vc);let _=!1;for(let C of p){let N=r[C];O(N)?_?r[C]=y[C]:r[C]=b[C]:_=!0}let w=g?Rl(r,o,a):h?Wl(r):Gr(r),x=w||Xr(r);if(x)return i.invalid(x);let S=g?Yr(r,o,a):h?Zr(r):r,[k,v]=mn(S,c,s),T=new i({ts:k,zone:s,o:v,loc:n});return r.weekday&&f&&t.weekday!==T.weekday?i.invalid("mismatched weekday",`you can't specify both a weekday of ${r.weekday} and a date of ${T.toISO()}`):T.isValid?T:i.invalid(T.invalid)}static fromISO(t,e={}){let[s,n]=ec(t);return mi(s,n,e,"ISO 8601",t)}static fromRFC2822(t,e={}){let[s,n]=ic(t);return mi(s,n,e,"RFC 2822",t)}static fromHTTP(t,e={}){let[s,n]=sc(t);return mi(s,n,e,"HTTP",e)}static fromFormat(t,e,s={}){if(O(t)||O(e))throw new G("fromFormat requires an input string and a format");let{locale:n=null,numberingSystem:r=null}=s,o=W.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),[a,l,c,h]=yc(o,t,e);return h?i.invalid(h):mi(a,l,s,`format ${e}`,t,c)}static fromString(t,e,s={}){return i.fromFormat(t,e,s)}static fromSQL(t,e={}){let[s,n]=oc(t);return mi(s,n,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new G("need to specify a reason the DateTime is invalid");let s=t instanceof it?t:new it(t,e);if(R.throwOnInvalid)throw new Ks(s);return new i({invalid:s})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){let s=lo(t,W.fromObject(e));return s?s.map(n=>n?n.val:null).join(""):null}static expandFormat(t,e={}){return oo(st.parseFormat(t),W.fromObject(e)).map(n=>n.val).join("")}static resetCache(){gn=void 0,pn={}}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ho(this).weekYear:NaN}get weekNumber(){return this.isValid?ho(this).weekNumber:NaN}get weekday(){return this.isValid?ho(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?uo(this).weekday:NaN}get localWeekNumber(){return this.isValid?uo(this).weekNumber:NaN}get localWeekYear(){return this.isValid?uo(this).weekYear:NaN}get ordinal(){return this.isValid?hn(this.c).ordinal:NaN}get monthShort(){return this.isValid?Zt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Zt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Zt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Zt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let t=864e5,e=6e4,s=ti(this.c),n=this.zone.offset(s-t),r=this.zone.offset(s+t),o=this.zone.offset(s-n*e),a=this.zone.offset(s-r*e);if(o===a)return[this];let l=s-o*e,c=s-a*e,h=dn(l,o),u=dn(c,a);return h.hour===u.hour&&h.minute===u.minute&&h.second===u.second&&h.millisecond===u.millisecond?[ve(this,{ts:l}),ve(this,{ts:c})]:[this]}get isInLeapYear(){return Me(this.year)}get daysInMonth(){return ni(this.year,this.month)}get daysInYear(){return this.isValid?le(this.year):NaN}get weeksInWeekYear(){return this.isValid?ke(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ke(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){let{locale:e,numberingSystem:s,calendar:n}=st.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:s,outputCalendar:n}}toUTC(t=0,e={}){return this.setZone(et.instance(t),e)}toLocal(){return this.setZone(R.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:s=!1}={}){if(t=Dt(t,R.defaultZone),t.equals(this.zone))return this;if(t.isValid){let n=this.ts;if(e||s){let r=t.offset(this.ts),o=this.toObject();[n]=mn(o,r,t)}return ve(this,{ts:n,zone:t})}else return i.invalid(gs(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:s}={}){let n=this.loc.clone({locale:t,numberingSystem:e,outputCalendar:s});return ve(this,{loc:n})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let e=ri(t,wc),{minDaysInFirstWeek:s,startOfWeek:n}=qr(e,this.loc),r=!O(e.weekYear)||!O(e.weekNumber)||!O(e.weekday),o=!O(e.ordinal),a=!O(e.year),l=!O(e.month)||!O(e.day),c=a||l,h=e.weekYear||e.weekNumber;if((c||o)&&h)throw new Tt("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new Tt("Can't mix ordinal dates with month/day");let u;r?u=Yr({...as(this.c,s,n),...e},s,n):O(e.ordinal)?(u={...this.toObject(),...e},O(e.day)&&(u.day=Math.min(ni(u.year,u.month),u.day))):u=Zr({...hn(this.c),...e});let[d,f]=mn(u,this.o,this.zone);return ve(this,{ts:d,o:f})}plus(t){if(!this.isValid)return this;let e=Z.fromDurationLike(t);return ve(this,xc(this,e))}minus(t){if(!this.isValid)return this;let e=Z.fromDurationLike(t).negate();return ve(this,xc(this,e))}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;let s={},n=Z.normalizeUnit(t);switch(n){case"years":s.month=1;case"quarters":case"months":s.day=1;case"weeks":case"days":s.hour=0;case"hours":s.minute=0;case"minutes":s.second=0;case"seconds":s.millisecond=0;break;case"milliseconds":break}if(n==="weeks")if(e){let r=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),a=o?this:t,l=o?t:this,c=dc(a,l,r,n);return o?c.negate():c}diffNow(t="milliseconds",e={}){return this.diff(i.now(),t,e)}until(t){return this.isValid?Yt.fromDateTimes(this,t):this}hasSame(t,e,s){if(!this.isValid)return!1;let n=t.valueOf(),r=this.setZone(t.zone,{keepLocalTime:!0});return r.startOf(e,s)<=n&&n<=r.endOf(e,s)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;let e=t.base||i.fromObject({},{zone:this.zone}),s=t.padding?thise.valueOf(),Math.min)}static max(...t){if(!t.every(i.isDateTime))throw new G("max requires all arguments be DateTimes");return Kr(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(t,e,s={}){let{locale:n=null,numberingSystem:r=null}=s,o=W.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return ao(o,t,e)}static fromStringExplain(t,e,s={}){return i.fromFormatExplain(t,e,s)}static buildFormatParser(t,e={}){let{locale:s=null,numberingSystem:n=null}=e,r=W.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0});return new ms(r,t)}static fromFormatParser(t,e,s={}){if(O(t)||O(e))throw new G("fromFormatParser requires an input string and a format parser");let{locale:n=null,numberingSystem:r=null}=s,o=W.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});if(!o.equals(e.locale))throw new G(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${e.locale}`);let{result:a,zone:l,specificOffset:c,invalidReason:h}=e.explainFromTokens(t);return h?i.invalid(h):mi(a,l,s,`format ${e.format}`,t,c)}static get DATE_SHORT(){return re}static get DATE_MED(){return Vi}static get DATE_MED_WITH_WEEKDAY(){return Er}static get DATE_FULL(){return Hi}static get DATE_HUGE(){return Bi}static get TIME_SIMPLE(){return $i}static get TIME_WITH_SECONDS(){return ji}static get TIME_WITH_SHORT_OFFSET(){return Ui}static get TIME_WITH_LONG_OFFSET(){return Yi}static get TIME_24_SIMPLE(){return Zi}static get TIME_24_WITH_SECONDS(){return qi}static get TIME_24_WITH_SHORT_OFFSET(){return Gi}static get TIME_24_WITH_LONG_OFFSET(){return Xi}static get DATETIME_SHORT(){return Ki}static get DATETIME_SHORT_WITH_SECONDS(){return Ji}static get DATETIME_MED(){return Qi}static get DATETIME_MED_WITH_SECONDS(){return ts}static get DATETIME_MED_WITH_WEEKDAY(){return Ir}static get DATETIME_FULL(){return es}static get DATETIME_FULL_WITH_SECONDS(){return is}static get DATETIME_HUGE(){return ss}static get DATETIME_HUGE_WITH_SECONDS(){return ns}};function fi(i){if(I.isDateTime(i))return i;if(i&&i.valueOf&&Et(i.valueOf()))return I.fromJSDate(i);if(i&&typeof i=="object")return I.fromObject(i);throw new G(`Unknown datetime argument: ${i}, of type ${typeof i}`)}var ug={datetime:I.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:I.TIME_WITH_SECONDS,minute:I.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Or._date.override({_id:"luxon",_create:function(i){return I.fromMillis(i,this.options)},init(i){this.options.locale||(this.options.locale=i.locale)},formats:function(){return ug},parse:function(i,t){let e=this.options,s=typeof i;return i===null||s==="undefined"?null:(s==="number"?i=this._create(i):s==="string"?typeof t=="string"?i=I.fromFormat(i,t,e):i=I.fromISO(i,e):i instanceof Date?i=I.fromJSDate(i,e):s==="object"&&!(i instanceof I)&&(i=I.fromObject(i,e)),i.isValid?i.valueOf():null)},format:function(i,t){let e=this._create(i);return typeof t=="string"?e.toFormat(t):e.toLocaleString(t)},add:function(i,t,e){let s={};return s[e]=t,this._create(i).plus(s).valueOf()},diff:function(i,t,e){return this._create(i).diff(this._create(t)).as(e).valueOf()},startOf:function(i,t,e){if(t==="isoWeek"){e=Math.trunc(Math.min(Math.max(0,e),6));let s=this._create(i);return s.minus({days:(s.weekday-e+7)%7}).startOf("day").valueOf()}return t?this._create(i).startOf(t).valueOf():i},endOf:function(i,t){return this._create(i).endOf(t).valueOf()}});function yn({cachedData:i,options:t,type:e}){return{init:function(){this.initChart(),this.$wire.$on("updateChartData",({data:s})=>{yn=this.getChart(),yn.data=s,yn.update("resize")}),Alpine.effect(()=>{Alpine.store("theme"),this.$nextTick(()=>{this.getChart()&&(this.getChart().destroy(),this.initChart())})}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Alpine.store("theme")==="system"&&this.$nextTick(()=>{this.getChart().destroy(),this.initChart()})})},initChart:function(s=null){var o,a,l,c,h,u,d,f,m;if(!this.$refs.canvas||!this.$refs.backgroundColorElement||!this.$refs.borderColorElement||!this.$refs.textColorElement||!this.$refs.gridColorElement)return;Rt.defaults.animation.duration=0,Rt.defaults.backgroundColor=getComputedStyle(this.$refs.backgroundColorElement).color;let n=getComputedStyle(this.$refs.borderColorElement).color;Rt.defaults.borderColor=n,Rt.defaults.color=getComputedStyle(this.$refs.textColorElement).color,Rt.defaults.font.family=getComputedStyle(this.$el).fontFamily,Rt.defaults.plugins.legend.labels.boxWidth=12,Rt.defaults.plugins.legend.position="bottom";let r=getComputedStyle(this.$refs.gridColorElement).color;return t??(t={}),t.borderWidth??(t.borderWidth=2),t.pointBackgroundColor??(t.pointBackgroundColor=n),t.pointHitRadius??(t.pointHitRadius=4),t.pointRadius??(t.pointRadius=2),t.scales??(t.scales={}),(o=t.scales).x??(o.x={}),(a=t.scales.x).grid??(a.grid={}),(l=t.scales.x.grid).color??(l.color=r),(c=t.scales.x.grid).display??(c.display=!1),(h=t.scales.x.grid).drawBorder??(h.drawBorder=!1),(u=t.scales).y??(u.y={}),(d=t.scales.y).grid??(d.grid={}),(f=t.scales.y.grid).color??(f.color=r),(m=t.scales.y.grid).drawBorder??(m.drawBorder=!1),new Rt(this.$refs.canvas,{type:e,data:s??i,options:t,plugins:window.filamentChartJsPlugins??[]})},getChart:function(){return this.$refs.canvas?Rt.getChart(this.$refs.canvas):null}}}export{yn as default}; +/*! Bundled license information: + +chart.js/dist/chunks/helpers.segment.mjs: + (*! + * Chart.js v3.9.1 + * https://www.chartjs.org + * (c) 2022 Chart.js Contributors + * Released under the MIT License + *) + +chart.js/dist/chunks/helpers.segment.mjs: + (*! + * @kurkle/color v0.2.1 + * https://github.com/kurkle/color#readme + * (c) 2022 Jukka Kurkela + * Released under the MIT License + *) + +chart.js/dist/chart.mjs: + (*! + * Chart.js v3.9.1 + * https://www.chartjs.org + * (c) 2022 Chart.js Contributors + * Released under the MIT License + *) + +chartjs-adapter-luxon/dist/chartjs-adapter-luxon.esm.js: + (*! + * chartjs-adapter-luxon v1.3.1 + * https://www.chartjs.org + * (c) 2023 chartjs-adapter-luxon Contributors + * Released under the MIT license + *) +*/ diff --git a/public/js/filament/widgets/components/stats-overview/stat/chart.js b/public/js/filament/widgets/components/stats-overview/stat/chart.js new file mode 100644 index 00000000..b607cd18 --- /dev/null +++ b/public/js/filament/widgets/components/stats-overview/stat/chart.js @@ -0,0 +1,29 @@ +function rt(){}var Hs=function(){let i=0;return function(){return i++}}();function T(i){return i===null||typeof i>"u"}function I(i){if(Array.isArray&&Array.isArray(i))return!0;let t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function D(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}var W=i=>(typeof i=="number"||i instanceof Number)&&isFinite(+i);function Q(i,t){return W(i)?i:t}function C(i,t){return typeof i>"u"?t:i}var js=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:i/t,Di=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function z(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function E(i,t,e,s){let n,o,a;if(I(i))if(o=i.length,s)for(n=o-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;ni,x:i=>i.x,y:i=>i.y};function gt(i,t){return(Ds[t]||(Ds[t]=Io(t)))(i)}function Io(i){let t=zo(i);return e=>{for(let s of t){if(s==="")break;e=e&&e[s]}return e}}function zo(i){let t=i.split("."),e=[],s="";for(let n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function Xe(i){return i.charAt(0).toUpperCase()+i.slice(1)}var J=i=>typeof i<"u",ft=i=>typeof i=="function",Oi=(i,t)=>{if(i.size!==t.size)return!1;for(let e of i)if(!t.has(e))return!1;return!0};function Ys(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}var B=Math.PI,F=2*B,Bo=F+B,je=Number.POSITIVE_INFINITY,Vo=B/180,V=B/2,ue=B/4,Os=B*2/3,tt=Math.log10,ot=Math.sign;function Ai(i){let t=Math.round(i);i=Ut(i,t,i/1e3)?t:i;let e=Math.pow(10,Math.floor(tt(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function Xs(i){let t=[],e=Math.sqrt(i),s;for(s=1;sn-o).pop(),t}function Lt(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Ut(i,t,e){return Math.abs(i-t)=i}function Ti(i,t,e){let s,n,o;for(s=0,n=i.length;sl&&c=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Ke(i,t,e){e=e||(a=>i[a]1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}var at=(i,t,e,s)=>Ke(i,e,s?n=>i[n][t]<=e:n=>i[n][t]Ke(i,e,s=>i[s][t]>=e);function Gs(i,t,e){let s=0,n=i.length;for(;ss&&i[n-1]>e;)n--;return s>0||n{let s="_onData"+Xe(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){let a=n.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[s]=="function"&&r[s](...o)}),a}})})}function Ei(i,t){let e=i._chartjs;if(!e)return;let s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Zs.forEach(o=>{delete i[o]}),delete i._chartjs)}function Fi(i){let t=new Set,e,s;for(e=0,s=i.length;e"u"?function(i){return i()}:window.requestAnimationFrame}();function zi(i,t,e){let s=e||(a=>Array.prototype.slice.call(a)),n=!1,o=[];return function(...a){o=s(a),n||(n=!0,Ii.call(window,()=>{n=!1,i.apply(t,o)}))}}function Qs(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}var qe=i=>i==="start"?"left":i==="end"?"right":"center",X=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,tn=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function Bi(i,t,e){let s=t.length,n=0,o=s;if(i._sorted){let{iScale:a,_parsed:r}=i,l=a.axis,{min:c,max:h,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(n=Y(Math.min(at(r,a.axis,c).lo,e?s:at(t,l,a.getPixelForValue(c)).lo),0,s-1)),u?o=Y(Math.max(at(r,a.axis,h,!0).hi+1,e?0:at(t,l,a.getPixelForValue(h),!0).hi+1),n,s)-n:o=s-n}return{start:n,count:o}}function Vi(i){let{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;let o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}var ze=i=>i===0||i===1,As=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*F/e)),Ts=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*F/e)+1,Ht={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*V)+1,easeOutSine:i=>Math.sin(i*V),easeInOutSine:i=>-.5*(Math.cos(B*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>ze(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>ze(i)?i:As(i,.075,.3),easeOutElastic:i=>ze(i)?i:Ts(i,.075,.3),easeInOutElastic(i){return ze(i)?i:i<.5?.5*As(i*2,.1125,.45):.5+.5*Ts(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ht.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Ht.easeInBounce(i*2)*.5:Ht.easeOutBounce(i*2-1)*.5+.5};function be(i){return i+.5|0}var xt=(i,t,e)=>Math.max(Math.min(i,e),t);function fe(i){return xt(be(i*2.55),0,255)}function yt(i){return xt(be(i*255),0,255)}function ut(i){return xt(be(i/2.55)/100,0,1)}function Ls(i){return xt(be(i*100),0,100)}var st={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Si=[..."0123456789ABCDEF"],No=i=>Si[i&15],Ho=i=>Si[(i&240)>>4]+Si[i&15],Be=i=>(i&240)>>4===(i&15),jo=i=>Be(i.r)&&Be(i.g)&&Be(i.b)&&Be(i.a);function $o(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&st[i[1]]*17,g:255&st[i[2]]*17,b:255&st[i[3]]*17,a:t===5?st[i[4]]*17:255}:(t===7||t===9)&&(e={r:st[i[1]]<<4|st[i[2]],g:st[i[3]]<<4|st[i[4]],b:st[i[5]]<<4|st[i[6]],a:t===9?st[i[7]]<<4|st[i[8]]:255})),e}var Yo=(i,t)=>i<255?t(i):"";function Xo(i){var t=jo(i)?No:Ho;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Yo(i.a,t):void 0}var Uo=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function en(i,t,e){let s=t*Math.min(e,1-e),n=(o,a=(o+i/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function Ko(i,t,e){let s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function qo(i,t,e){let s=en(i,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Go(i,t,e,s,n){return i===n?(t-e)/s+(t.5?h/(2-o-a):h/(o+a),l=Go(e,s,n,h,o),l=l*60+.5),[l|0,c||0,r]}function Ni(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(yt)}function Hi(i,t,e){return Ni(en,i,t,e)}function Zo(i,t,e){return Ni(qo,i,t,e)}function Jo(i,t,e){return Ni(Ko,i,t,e)}function sn(i){return(i%360+360)%360}function Qo(i){let t=Uo.exec(i),e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?fe(+t[5]):yt(+t[5]));let n=sn(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=Zo(n,o,a):t[1]==="hsv"?s=Jo(n,o,a):s=Hi(n,o,a),{r:s[0],g:s[1],b:s[2],a:e}}function ta(i,t){var e=Wi(i);e[0]=sn(e[0]+t),e=Hi(e),i.r=e[0],i.g=e[1],i.b=e[2]}function ea(i){if(!i)return;let t=Wi(i),e=t[0],s=Ls(t[1]),n=Ls(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${ut(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}var Rs={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Es={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function ia(){let i={},t=Object.keys(Es),e=Object.keys(Rs),s,n,o,a,r;for(s=0;s>16&255,o>>8&255,o&255]}return i}var Ve;function sa(i){Ve||(Ve=ia(),Ve.transparent=[0,0,0,0]);let t=Ve[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var na=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function oa(i){let t=na.exec(i),e=255,s,n,o;if(t){if(t[7]!==s){let a=+t[7];e=t[8]?fe(a):xt(a*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?fe(s):xt(s,0,255)),n=255&(t[4]?fe(n):xt(n,0,255)),o=255&(t[6]?fe(o):xt(o,0,255)),{r:s,g:n,b:o,a:e}}}function aa(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${ut(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}var vi=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Nt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function ra(i,t,e){let s=Nt(ut(i.r)),n=Nt(ut(i.g)),o=Nt(ut(i.b));return{r:yt(vi(s+e*(Nt(ut(t.r))-s))),g:yt(vi(n+e*(Nt(ut(t.g))-n))),b:yt(vi(o+e*(Nt(ut(t.b))-o))),a:i.a+e*(t.a-i.a)}}function We(i,t,e){if(i){let s=Wi(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Hi(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function nn(i,t){return i&&Object.assign(t||{},i)}function Fs(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=yt(i[3]))):(t=nn(i,{r:0,g:0,b:0,a:1}),t.a=yt(t.a)),t}function la(i){return i.charAt(0)==="r"?oa(i):Qo(i)}var Pi=class i{constructor(t){if(t instanceof i)return t;let e=typeof t,s;e==="object"?s=Fs(t):e==="string"&&(s=$o(t)||sa(t)||la(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=nn(this._rgb);return t&&(t.a=ut(t.a)),t}set rgb(t){this._rgb=Fs(t)}rgbString(){return this._valid?aa(this._rgb):void 0}hexString(){return this._valid?Xo(this._rgb):void 0}hslString(){return this._valid?ea(this._rgb):void 0}mix(t,e){if(t){let s=this.rgb,n=t.rgb,o,a=e===o?.5:e,r=2*a-1,l=s.a-n.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=a*s.a+(1-a)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=ra(this._rgb,t._rgb,e)),this}clone(){return new i(this.rgb)}alpha(t){return this._rgb.a=yt(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=be(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return We(this._rgb,2,t),this}darken(t){return We(this._rgb,2,-t),this}saturate(t){return We(this._rgb,1,t),this}desaturate(t){return We(this._rgb,1,-t),this}rotate(t){return ta(this._rgb,t),this}};function on(i){return new Pi(i)}function an(i){if(i&&typeof i=="object"){let t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ji(i){return an(i)?i:on(i)}function Mi(i){return an(i)?i:on(i).saturate(.5).darken(.1).hexString()}var vt=Object.create(null),Ge=Object.create(null);function ge(i,t){if(!t)return i;let e=t.split(".");for(let s=0,n=e.length;se.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,s)=>Mi(s.backgroundColor),this.hoverBorderColor=(e,s)=>Mi(s.borderColor),this.hoverColor=(e,s)=>Mi(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return wi(this,t,e)}get(t){return ge(this,t)}describe(t,e){return wi(Ge,t,e)}override(t,e){return wi(vt,t,e)}route(t,e,s,n){let o=ge(this,t),a=ge(this,s),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){let l=this[r],c=a[n];return D(l)?Object.assign({},c,l):C(l,c)},set(l){this[r]=l}}})}},O=new Ci({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function ca(i){return!i||T(i.size)||T(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function pe(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function rn(i,t,e,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},o=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let a=0,r=e.length,l,c,h,d,u;for(l=0;le.length){for(l=0;l0&&i.stroke()}}function $t(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="",l,c;for(i.save(),i.font=n.string,ha(i,o),l=0;l+i||0;function Je(i,t){let e={},s=D(t),n=s?Object.keys(t):t,o=D(i)?s?a=>C(i[a],i[t[a]]):a=>i[a]:()=>i;for(let a of n)e[a]=pa(o(a));return e}function Xi(i){return Je(i,{top:"y",right:"x",bottom:"y",left:"x"})}function kt(i){return Je(i,["topLeft","topRight","bottomLeft","bottomRight"])}function U(i){let t=Xi(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function $(i,t){i=i||{},t=t||O.font;let e=C(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=C(i.style,t.style);s&&!(""+s).match(fa)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");let n={family:C(i.family,t.family),lineHeight:ga(C(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:C(i.weight,t.weight),string:""};return n.string=ca(n),n}function Gt(i,t,e,s){let n=!0,o,a,r;for(o=0,a=i.length;oe&&r===0?0:r+l;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function pt(i,t){return Object.assign(Object.create(i),t)}function Qe(i,t=[""],e=i,s,n=()=>i[0]){J(s)||(s=fn("_fallback",i));let o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:s,_getTarget:n,override:a=>Qe([a,...i],t,e,s)};return new Proxy(o,{deleteProperty(a,r){return delete a[r],delete a._keys,delete i[0][r],!0},get(a,r){return dn(a,r,()=>wa(r,t,i,a))},getOwnPropertyDescriptor(a,r){return Reflect.getOwnPropertyDescriptor(a._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,r){return zs(a).includes(r)},ownKeys(a){return zs(a)},set(a,r,l){let c=a._storage||(a._storage=n());return a[r]=c[r]=l,delete a._keys,!0}})}function Tt(i,t,e,s){let n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ui(i,s),setContext:o=>Tt(i,o,e,s),override:o=>Tt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return dn(o,a,()=>ba(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function Ui(i,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:ft(e)?e:()=>e,isIndexable:ft(s)?s:()=>s}}var ma=(i,t)=>i?i+Xe(t):t,Ki=(i,t)=>D(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function dn(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];let s=e();return i[t]=s,s}function ba(i,t,e){let{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=i,r=s[t];return ft(r)&&a.isScriptable(t)&&(r=_a(t,r,i,e)),I(r)&&r.length&&(r=xa(t,r,i,a.isIndexable)),Ki(t,r)&&(r=Tt(r,n,o&&o[t],a)),r}function _a(i,t,e,s){let{_proxy:n,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);return r.add(i),t=t(o,a||s),r.delete(i),Ki(i,t)&&(t=qi(n._scopes,n,i,t)),t}function xa(i,t,e,s){let{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=e;if(J(o.index)&&s(i))t=t[o.index%t.length];else if(D(t[0])){let l=t,c=n._scopes.filter(h=>h!==l);t=[];for(let h of l){let d=qi(c,n,i,h);t.push(Tt(d,o,a&&a[i],r))}}return t}function un(i,t,e){return ft(i)?i(t,e):i}var ya=(i,t)=>i===!0?t:typeof i=="string"?gt(t,i):void 0;function va(i,t,e,s,n){for(let o of t){let a=ya(e,o);if(a){i.add(a);let r=un(a._fallback,e,n);if(J(r)&&r!==e&&r!==s)return r}else if(a===!1&&J(s)&&e!==s)return null}return!1}function qi(i,t,e,s){let n=t._rootScopes,o=un(t._fallback,e,s),a=[...i,...n],r=new Set;r.add(s);let l=Is(r,a,e,o||e,s);return l===null||J(o)&&o!==e&&(l=Is(r,a,o,l,s),l===null)?!1:Qe(Array.from(r),[""],n,o,()=>Ma(t,e,s))}function Is(i,t,e,s,n){for(;e;)e=va(i,t,e,s,n);return e}function Ma(i,t,e){let s=i._getTarget();t in s||(s[t]={});let n=s[t];return I(n)&&D(e)?e:n}function wa(i,t,e,s){let n;for(let o of t)if(n=fn(ma(o,i),e),J(n))return Ki(i,n)?qi(e,s,i,n):n}function fn(i,t){for(let e of t){if(!e)continue;let s=e[i];if(J(s))return s}}function zs(i){let t=i._keys;return t||(t=i._keys=ka(i._scopes)),t}function ka(i){let t=new Set;for(let e of i)for(let s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function Gi(i,t,e,s){let{iScale:n}=i,{key:o="r"}=this._parsing,a=new Array(s),r,l,c,h;for(r=0,l=s;rti==="x"?"y":"x";function Pa(i,t,e,s){let n=i.skip?t:i,o=t,a=e.skip?t:e,r=$e(o,n),l=$e(a,o),c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let d=s*c,u=s*h;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function Ca(i,t,e){let s=i.length,n,o,a,r,l,c=Yt(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")Oa(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,a=i.length;owindow.getComputedStyle(i,null);function Ta(i,t){return ei(i).getPropertyValue(t)}var La=["top","right","bottom","left"];function At(i,t,e){let s={};e=e?"-"+e:"";for(let n=0;n<4;n++){let o=La[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}var Ra=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Ea(i,t){let e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s,a=!1,r,l;if(Ra(n,o,i.target))r=n,l=o;else{let c=t.getBoundingClientRect();r=s.clientX-c.left,l=s.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function St(i,t){if("native"in i)return i;let{canvas:e,currentDevicePixelRatio:s}=t,n=ei(e),o=n.boxSizing==="border-box",a=At(n,"padding"),r=At(n,"border","width"),{x:l,y:c,box:h}=Ea(i,e),d=a.left+(h&&r.left),u=a.top+(h&&r.top),{width:f,height:g}=t;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/g*e.height/s)}}function Fa(i,t,e){let s,n;if(t===void 0||e===void 0){let o=ti(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{let a=o.getBoundingClientRect(),r=ei(o),l=At(r,"border","width"),c=At(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,s=Ye(r.maxWidth,o,"clientWidth"),n=Ye(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||je,maxHeight:n||je}}var ki=i=>Math.round(i*10)/10;function mn(i,t,e,s){let n=ei(i),o=At(n,"margin"),a=Ye(n.maxWidth,i,"clientWidth")||je,r=Ye(n.maxHeight,i,"clientHeight")||je,l=Fa(i,t,e),{width:c,height:h}=l;if(n.boxSizing==="content-box"){let d=At(n,"border","width"),u=At(n,"padding");c-=u.width+d.width,h-=u.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?Math.floor(c/s):h-o.height),c=ki(Math.min(c,a,l.maxWidth)),h=ki(Math.min(h,r,l.maxHeight)),c&&!h&&(h=ki(c/2)),{width:c,height:h}}function Ji(i,t,e){let s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=n/s,i.width=o/s;let a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||a.height!==n||a.width!==o?(i.currentDevicePixelRatio=s,a.height=n,a.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}var bn=function(){let i=!1;try{let t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function Qi(i,t){let e=Ta(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function _t(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function _n(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function xn(i,t,e,s){let n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=_t(i,n,e),r=_t(n,o,e),l=_t(o,t,e),c=_t(a,r,e),h=_t(r,l,e);return _t(c,h,e)}var Bs=new Map;function Ia(i,t){t=t||{};let e=i+JSON.stringify(t),s=Bs.get(e);return s||(s=new Intl.NumberFormat(i,t),Bs.set(e,s)),s}function Zt(i,t,e){return Ia(t,e).format(i)}var za=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Ba=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Rt(i,t,e){return i?za(t,e):Ba()}function ts(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function es(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function yn(i){return i==="angle"?{between:Kt,compare:Wo,normalize:G}:{between:lt,compare:(t,e)=>t-e,normalize:t=>t}}function Vs({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Va(i,t,e){let{property:s,start:n,end:o}=e,{between:a,normalize:r}=yn(s),l=t.length,{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;ul(n,v,b)&&r(n,v)!==0,x=()=>r(o,b)===0||l(o,v,b),M=()=>p||y(),w=()=>!p||x();for(let S=h,k=h;S<=d;++S)_=t[S%a],!_.skip&&(b=c(_[s]),b!==v&&(p=l(b,n,o),m===null&&M()&&(m=r(b,n)===0?S:k),m!==null&&w()&&(g.push(Vs({start:m,end:S,loop:u,count:a,style:f})),m=null),k=S,v=b));return m!==null&&g.push(Vs({start:m,end:d,loop:u,count:a,style:f})),g}function ss(i,t){let e=[],s=i.segments;for(let n=0;nn&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Na(i,t,e,s){let n=i.length,o=[],a=t,r=i[t],l;for(l=t+1;l<=e;++l){let c=i[l%n];c.skip||c.stop?r.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%n,end:a%n,loop:s}),o}function vn(i,t){let e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];let o=!!i._loop,{start:a,end:r}=Wa(e,n,o,s);if(s===!0)return Ws(i,[{start:a,end:r,loop:o}],e,t);let l=rr({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Ii.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;let o=s.items,a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let s=e.items,n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},mt=new fs,Mn="transparent",$a={boolean(i,t,e){return e>.5?t:i},color(i,t,e){let s=ji(i||Mn),n=s.valid&&ji(t||Mn);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}},gs=class{constructor(t,e,s,n){let o=e[s];n=Gt([t.to,n,o,t.from]);let a=Gt([t.from,o,n]);this._active=!0,this._fn=t.fn||$a[t.type||typeof a],this._easing=Ht[t.easing]||Ht.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);let n=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Gt([t.to,e,n,t.from]),this._from=Gt([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,s=this._duration,n=this._prop,o=this._from,a=this._loop,r=this._to,l;if(this._active=o!==r&&(a||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,r,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){let e=t?"res":"rej",s=this._promises||[];for(let n=0;ni!=="onProgress"&&i!=="onComplete"&&i!=="fn"});O.set("animations",{colors:{type:"color",properties:Xa},numbers:{type:"number",properties:Ya}});O.describe("animations",{_fallback:"animation"});O.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:i=>i|0}}}});var ci=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!D(t))return;let e=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let n=t[s];if(!D(n))return;let o={};for(let a of Ua)o[a]=n[a];(I(n.properties)&&n.properties||[s]).forEach(a=>{(a===s||!e.has(a))&&e.set(a,o)})})}_animateOptions(t,e){let s=e.options,n=qa(t,s);if(!n)return[];let o=this._createAnimations(n,s);return s.$shared&&Ka(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){let s=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now(),l;for(l=a.length-1;l>=0;--l){let c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}let h=e[c],d=o[c],u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,r);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new gs(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let s=this._createAnimations(t,e);if(s.length)return mt.add(this._chart,s),!0}};function Ka(i,t){let e=[],s=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function Cn(i,t){let{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,c=a.axis,h=Qa(o,a,s),d=t.length,u;for(let f=0;fe[s].axis===t).shift()}function ir(i,t){return pt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function sr(i,t,e){return pt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ye(i,t){let e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(let n of t){let o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e]}}}var os=i=>i==="reset"||i==="none",Dn=(i,t)=>t?i:Object.assign({},i),nr=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:go(e,!0),values:null},et=class{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Sn(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&ye(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,g)=>d==="x"?u:d==="r"?g:f,o=e.xAxisID=C(s.xAxisID,ns(t,"x")),a=e.yAxisID=C(s.yAxisID,ns(t,"y")),r=e.rAxisID=C(s.rAxisID,ns(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,a,r),h=e.vAxisID=n(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Ei(this._data,this),t._stacked&&ye(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(D(e))this._data=Ja(e);else if(s!==e){if(s){Ei(s,this);let n=this._cachedMeta;ye(n),n._parsed=[]}e&&Object.isExtensible(e)&&Js(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,s=this.getDataset(),n=!1;this._dataCheck();let o=e._stacked;e._stacked=Sn(e.vScale,e),e.stack!==s.stack&&(n=!0,ye(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&Cn(this,e._parsed)}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:a}=s,r=o.axis,l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{I(n[t])?u=this.parseArrayData(s,n,t,e):D(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);let f=()=>d[r]===null||c&&d[r]p||d=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){let e=this._cachedMeta._parsed,s=[],n,o,a;for(n=0,o=e.length;n=0&&tthis.getContext(s,n),p=c.resolveNamedOptions(u,f,g,d);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(Dn(p,l))),p}_resolveAnimations(t,e,s){let n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(n.options.animation!==!1){let h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}let c=new ci(n,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||os(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),a=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:a}}updateElement(t,e,s,n){os(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!os(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;let o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,s=this._cachedMeta.data;for(let[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];let n=s.length,o=e.length,a=Math.min(o,n);a&&this.parse(0,a),o>n?this._insertElements(n,o-n,t):o{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;rn-o))}return i._cache.$bar}function ar(i){let t=i.iScale,e=or(t,i.type),s=t._length,n,o,a,r,l=()=>{a===32767||a===-32768||(J(r)&&(s=Math.min(s,Math.abs(a-r)||s)),r=a)};for(n=0,o=e.length;n0?n[i-1]:null,r=iMath.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:a,max:r}}function po(i,t,e,s){return I(i)?cr(i,t,e,s):t[e.axis]=e.parse(i,s),t}function On(i,t,e,s){let n=i.iScale,o=i.vScale,a=n.getLabels(),r=n===o,l=[],c,h,d,u;for(c=e,h=e+s;c=e?1:-1)}function dr(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.basel.controller.options.grouped),o=s.options.stacked,a=[],r=l=>{let c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(T(h)||isNaN(h))return!0};for(let l of n)if(!(e!==void 0&&r(l))&&((o===!1||a.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&a.push(l.stack),l.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){let n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){let t=this.options,e=this._cachedMeta,s=e.iScale,n=[],o,a;for(o=0,a=e.data.length;o=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,{xScale:s,yScale:n}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),r=n.getLabelForValue(o.y),l=o._custom;return{label:e.label,value:"("+a+", "+r+(l?", "+l:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,n){let o=n==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,n),h=a.axis,d=r.axis;for(let u=e;uKt(v,r,l,!0)?1:Math.max(y,y*e,x,x*e),g=(v,y,x)=>Kt(v,r,l,!0)?-1:Math.min(y,y*e,x,x*e),p=f(0,c,d),m=f(V,h,u),b=g(B,c,d),_=g(B+V,h,u);s=(p-b)/2,n=(m-_)/2,o=-(p+b)/2,a=-(m+_)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}var Dt=class extends et{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=l=>+s[l];if(D(s[t])){let{key:l="value"}=this._parsing;o=c=>+gt(s[c],l)}let a,r;for(a=t,r=t+e;a0&&!isNaN(t)?F*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=Zt(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0,s=this.chart,n,o,a,r,l;if(!t){for(n=0,o=s.data.datasets.length;ni!=="spacing",_indexable:i=>i!=="spacing"};Dt.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){let t=i.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((s,n)=>{let a=i.getDatasetMeta(0).controller.getStyle(n);return{text:s,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(n),index:n}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){let t=i.label,e=": "+i.formattedValue;return I(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};var ie=class extends et{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,a=this.chart._animationsDisabled,{start:r,count:l}=Bi(e,n,a);this._drawStart=r,this._drawCount=l,Vi(e)&&(r=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:c},t),this.updateElements(n,r,l,t)}updateElements(t,e,s,n){let o=n==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),u=a.axis,f=r.axis,{spanGaps:g,segment:p}=this.options,m=Lt(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||n==="none",_=e>0&&this.getParsed(e-1);for(let v=e;v0&&Math.abs(x[u]-_[u])>m,p&&(M.parsed=x,M.raw=c.data[v]),d&&(M.options=h||this.resolveDataElementOptions(v,y.active?"active":n)),b||this.updateElement(y,v,M,n),_=x}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;let o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};ie.id="line";ie.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};ie.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var se=class extends et{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=Zt(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return Gi.bind(this)(t,e,s,n)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{let o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(oe.max&&(e.max=o))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),a=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,s,n){let o=n==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*B,f=u,g,p=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?nt(this.resolveDataElementOptions(t,e).angle||s):0}};se.id="polarArea";se.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};se.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){let t=i.data;if(t.labels.length&&t.datasets.length){let{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((s,n)=>{let a=i.getDatasetMeta(0).controller.getStyle(n);return{text:s,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(n),index:n}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){return i.chart.data.labels[i.dataIndex]+": "+i.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};var Ce=class extends Dt{};Ce.id="pie";Ce.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var ne=class extends et{getLabelAndValue(t){let e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,n){return Gi.bind(this)(t,e,s,n)}update(t){let e=this._cachedMeta,s=e.dataset,n=e.data||[],o=e.iScale.getLabels();if(s.points=n,t!=="resize"){let a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);let r={_loop:!0,_fullLoop:o.length===n.length,options:a};this.updateElement(s,void 0,r,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,s,n){let o=this._cachedMeta.rScale,a=n==="reset";for(let r=e;r{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}};it.defaults={};it.defaultRoutes=void 0;var mo={values(i){return I(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";let s=this.chart.options.locale,n,o=i;if(e.length>1){let c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=mr(i,e)}let a=tt(Math.abs(o)),r=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Zt(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";let s=i/Math.pow(10,Math.floor(tt(i)));return s===1||s===2||s===5?mo.numeric.call(this,i,t,e):""}};function mr(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var pi={formatters:mo};O.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:pi.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});O.route("scale.ticks","color","","color");O.route("scale.grid","color","","borderColor");O.route("scale.grid","borderColor","","borderColor");O.route("scale.title","color","","color");O.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"});O.describe("scales",{_fallback:"scale"});O.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});function br(i,t){let e=i.options.ticks,s=e.maxTicksLimit||_r(i),n=e.major.enabled?yr(t):[],o=n.length,a=n[0],r=n[o-1],l=[];if(o>s)return vr(t,l,n,o/s),l;let c=xr(n,t,s);if(o>0){let h,d,u=o>1?Math.round((r-a)/(o-1)):null;for(ii(t,l,c,T(u)?0:a-u,a),h=0,d=o-1;hn)return l}return Math.max(n,1)}function yr(i){let t=[],e,s;for(e=0,s=i.length;ei==="left"?"right":i==="right"?"left":i,Ln=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e;function Rn(i,t){let e=[],s=i.length/t,n=i.length,o=0;for(;oa+r)))return l}function Sr(i,t){E(i,e=>{let s=e.gc,n=s.length/2,o;if(n>t){for(o=0;os?s:e,s=n&&e>s?e:s,{min:Q(e,Q(s,e)),max:Q(s,Q(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){z(this.options.beforeUpdate,[this])}update(t,e,s){let{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=hn(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=r=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}let h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=Y(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/s:f/(s-1),d+6>r&&(r=f/(s-(t.offset?.5:1)),l=this.maxHeight-ve(t.grid)-e.padding-En(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),a=Ue(Math.min(Math.asin(Y((h.highest.height+6)/r,-1,1)),Math.asin(Y(l/c,-1,1))-Math.asin(Y(u/c,-1,1)))),a=Math.max(n,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){z(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){let l=En(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=ve(o)+l):(t.height=this.maxHeight,t.width=ve(o)+l),s.display&&this.ticks.length){let{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,g=nt(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(r){let b=s.mirror?0:m*d.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{let b=s.mirror?0:p*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,m,p)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){let{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),u=0,f=0;l?c?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+a)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+a,this.paddingBottom=d+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){z(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e({width:o[w]||0,height:a[w]||0});return{first:M(0),last:M(e-1),widest:M(y),highest:M(x),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return Ks(this._alignToPixels?Mt(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&tr*n?r/s:l/n:l*n0}_computeGridLineItems(t){let e=this.axis,s=this.chart,n=this.options,{grid:o,position:a}=n,r=o.offset,l=this.isHorizontal(),h=this.ticks.length+(r?1:0),d=ve(o),u=[],f=o.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,p=g/2,m=function(P){return Mt(s,P,g)},b,_,v,y,x,M,w,S,k,L,R,A;if(a==="top")b=m(this.bottom),M=this.bottom-d,S=b-p,L=m(t.top)+p,A=t.bottom;else if(a==="bottom")b=m(this.top),L=t.top,A=m(t.bottom)-p,M=b+p,S=this.top+d;else if(a==="left")b=m(this.right),x=this.right-d,w=b-p,k=m(t.left)+p,R=t.right;else if(a==="right")b=m(this.left),k=t.left,R=m(t.right)-p,x=b+p,w=this.left+d;else if(e==="x"){if(a==="center")b=m((t.top+t.bottom)/2+.5);else if(D(a)){let P=Object.keys(a)[0],j=a[P];b=m(this.chart.scales[P].getPixelForValue(j))}L=t.top,A=t.bottom,M=b+p,S=M+d}else if(e==="y"){if(a==="center")b=m((t.left+t.right)/2);else if(D(a)){let P=Object.keys(a)[0],j=a[P];b=m(this.chart.scales[P].getPixelForValue(j))}x=b-p,w=x-d,k=t.left,R=t.right}let H=C(n.ticks.maxTicksLimit,h),q=Math.max(1,Math.ceil(h/H));for(_=0;_o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){let e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,a,r=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,a=n.length;o{this.draw(n)}}]:[{z:s,draw:n=>{this.drawBackground(),this.drawGrid(n),this.drawTitle()}},{z:s+1,draw:()=>{this.drawBorder()}},{z:e,draw:n=>{this.drawLabels(n)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[],o,a;for(o=0,a=e.length;o{let s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");O.route(o,n,l,r)})}function Lr(i){return"id"in i&&"defaults"in i}var ps=class{constructor(){this.controllers=new Qt(et,"datasets",!0),this.elements=new Qt(it,"elements"),this.plugins=new Qt(Object,"plugins"),this.scales=new Qt(Ft,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{let o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):E(n,a=>{let r=s||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,s){let n=Xe(t);z(s["before"+n],[],s),e[t](s),z(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let y=e;y0&&Math.abs(M[f]-v[f])>b,m&&(w.parsed=M,w.raw=c.data[y]),u&&(w.options=d||this.resolveDataElementOptions(y,x.active?"active":n)),_||this.updateElement(x,y,w,n),v=M}this.updateSharedOptions(d,n,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let l=e.length-1;l>=0;--l)r=Math.max(r,e[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}let s=t.dataset,n=s.options&&s.options.borderWidth||0;if(!e.length)return n;let o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,o,a)/2}};oe.id="scatter";oe.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};oe.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(i){return"("+i.label+", "+i.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Rr=Object.freeze({__proto__:null,BarController:te,BubbleController:ee,DoughnutController:Dt,LineController:ie,PolarAreaController:se,PieController:Ce,RadarController:ne,ScatterController:oe});function Et(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var De=class{constructor(t){this.options=t||{}}init(t){}formats(){return Et()}parse(t,e){return Et()}format(t,e){return Et()}add(t,e,s){return Et()}diff(t,e,s){return Et()}startOf(t,e,s){return Et()}endOf(t,e){return Et()}};De.override=function(i){Object.assign(De.prototype,i)};var Er={_date:De};function Fr(i,t,e,s){let{controller:n,data:o,_sorted:a}=i,r=n._cachedMeta.iScale;if(r&&t===r.axis&&t!=="r"&&a&&o.length){let l=r._reversePixels?qs:at;if(s){if(n._sharedOptions){let c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){let d=l(o,t,e-h),u=l(o,t,e+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function Fe(i,t,e,s,n){let o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r{l[a](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(t.x,t.y,n))}),s&&!r?[]:o}var Vr={evaluateInteractionItems:Fe,modes:{index(i,t,e,s){let n=St(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?rs(i,n,o,s,a):ls(i,n,o,!1,s,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{let h=r[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){let n=St(t,i),o=e.axis||"xy",a=e.includeInvisible||!1,r=e.intersect?rs(i,n,o,s,a):ls(i,n,o,!1,s,a);if(r.length>0){let l=r[0].datasetIndex,c=i.getDatasetMeta(l).data;r=[];for(let h=0;he.pos===t)}function In(i,t){return i.filter(e=>bo.indexOf(e.pos)===-1&&e.box.axis===t)}function we(i,t){return i.sort((e,s)=>{let n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Wr(i){let t=[],e,s,n,o,a,r;for(e=0,s=(i||[]).length;ec.box.fullSize),!0),s=we(Me(t,"left"),!0),n=we(Me(t,"right")),o=we(Me(t,"top"),!0),a=we(Me(t,"bottom")),r=In(t,"x"),l=In(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:Me(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}function zn(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function _o(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function $r(i,t,e,s){let{pos:n,box:o}=e,a=i.maxPadding;if(!D(n)){e.size&&(i[n]-=e.size);let d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&_o(a,o.getPadding());let r=Math.max(0,t.outerWidth-zn(a,i,"left","right")),l=Math.max(0,t.outerHeight-zn(a,i,"top","bottom")),c=r!==i.w,h=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Yr(i){let t=i.maxPadding;function e(s){let n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Xr(i,t){let e=t.maxPadding;function s(n){let o={left:0,top:0,right:0,bottom:0};return n.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return s(i?["left","right"]:["top","bottom"])}function Se(i,t,e,s){let n=[],o,a,r,l,c,h;for(o=0,a=i.length,c=0;o{typeof p.beforeLayout=="function"&&p.beforeLayout()});let h=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},n);_o(u,U(s));let f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),g=Hr(l.concat(c),d);Se(r.fullSize,f,d,g),Se(l,f,d,g),Se(c,f,d,g)&&Se(l,f,d,g),Yr(f),Bn(r.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,Bn(r.rightAndBottom,f,d,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},E(r.chartArea,p=>{let m=p.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},hi=class{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}},ms=class extends hi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},li="$chartjs",Ur={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vn=i=>i===null||i==="";function Kr(i,t){let e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[li]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Vn(n)){let o=Qi(i,"width");o!==void 0&&(i.width=o)}if(Vn(s))if(i.style.height==="")i.height=i.width/(t||2);else{let o=Qi(i,"height");o!==void 0&&(i.height=o)}return i}var xo=bn?{passive:!0}:!1;function qr(i,t,e){i.addEventListener(t,e,xo)}function Gr(i,t,e){i.canvas.removeEventListener(t,e,xo)}function Zr(i,t){let e=Ur[i.type]||i.type,{x:s,y:n}=St(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function di(i,t){for(let e of i)if(e===t||e.contains(t))return!0}function Jr(i,t,e){let s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||di(r.addedNodes,s),a=a&&!di(r.removedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Qr(i,t,e){let s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||di(r.removedNodes,s),a=a&&!di(r.addedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}var Oe=new Map,Wn=0;function yo(){let i=window.devicePixelRatio;i!==Wn&&(Wn=i,Oe.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function tl(i,t){Oe.size||window.addEventListener("resize",yo),Oe.set(i,t)}function el(i){Oe.delete(i),Oe.size||window.removeEventListener("resize",yo)}function il(i,t,e){let s=i.canvas,n=s&&ti(s);if(!n)return;let o=zi((r,l)=>{let c=n.clientWidth;e(r,l),c{let l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return a.observe(n),tl(i,o),a}function cs(i,t,e){e&&e.disconnect(),t==="resize"&&el(i)}function sl(i,t,e){let s=i.canvas,n=zi(o=>{i.ctx!==null&&e(Zr(o,i))},i,o=>{let a=o[0];return[a,a.offsetX,a.offsetY]});return qr(s,t,n),n}var bs=class extends hi{acquireContext(t,e){let s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Kr(t,e),s):null}releaseContext(t){let e=t.canvas;if(!e[li])return!1;let s=e[li].initial;["height","width"].forEach(o=>{let a=s[o];T(a)?e.removeAttribute(o):e.setAttribute(o,a)});let n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[li],!0}addEventListener(t,e,s){this.removeEventListener(t,e);let n=t.$proxies||(t.$proxies={}),a={attach:Jr,detach:Qr,resize:il}[e]||sl;n[e]=a(t,e,s)}removeEventListener(t,e){let s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:cs,detach:cs,resize:cs}[e]||Gr)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return mn(t,e,s,n)}isAttached(t){let e=ti(t);return!!(e&&e.isConnected)}};function nl(i){return!Zi()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?ms:bs}var _s=class{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let o=n?this._descriptors(t).filter(n):this._descriptors(t),a=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,s,n){n=n||{};for(let o of t){let a=o.plugin,r=a[s],l=[e,n,o.options];if(z(r,l,a)===!1&&n.cancelable)return!1}return!0}invalidate(){T(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let s=t&&t.config,n=C(s.options&&s.options.plugins,{}),o=ol(s);return n===!1&&!e?[]:rl(t,o,n,e)}_notifyStateChanges(t){let e=this._oldCache||[],s=this._cache,n=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}};function ol(i){let t={},e=[],s=Object.keys(ht.plugins.items);for(let o=0;o{let l=s[r];if(!D(l))return console.error(`Invalid scale configuration for scale: ${r}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);let c=ys(r,l),h=hl(c,n),d=e.scales||{};o[c]=o[c]||r,a[r]=Xt(Object.create(null),[{axis:c},l,d[c],d[h]])}),i.data.datasets.forEach(r=>{let l=r.type||i.type,c=r.indexAxis||xs(l,t),d=(vt[l]||{}).scales||{};Object.keys(d).forEach(u=>{let f=cl(u,c),g=r[f+"AxisID"]||o[f]||f;a[g]=a[g]||Object.create(null),Xt(a[g],[{axis:f},s[g],d[u]])})}),Object.keys(a).forEach(r=>{let l=a[r];Xt(l,[O.scales[l.type],O.scale])}),a}function vo(i){let t=i.options||(i.options={});t.plugins=C(t.plugins,{}),t.scales=ul(i,t)}function Mo(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function fl(i){return i=i||{},i.data=Mo(i.data),vo(i),i}var Nn=new Map,wo=new Set;function ni(i,t){let e=Nn.get(i);return e||(e=t(),Nn.set(i,e),wo.add(e)),e}var ke=(i,t,e)=>{let s=gt(t,e);s!==void 0&&i.add(s)},vs=class{constructor(t){this._config=fl(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Mo(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),vo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ni(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ni(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ni(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,s=this.type;return ni(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let s=this._scopeCache,n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){let{options:n,type:o}=this,a=this._cachedScopes(t,s),r=a.get(e);if(r)return r;let l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>ke(l,t,d))),h.forEach(d=>ke(l,n,d)),h.forEach(d=>ke(l,vt[o]||{},d)),h.forEach(d=>ke(l,O,d)),h.forEach(d=>ke(l,Ge,d))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),wo.has(e)&&a.set(e,c),c}chartOptionScopes(){let{options:t,type:e}=this;return[t,vt[e]||{},O.datasets[e]||{},{type:e},O,Ge]}resolveNamedOptions(t,e,s,n=[""]){let o={$shared:!0},{resolver:a,subPrefixes:r}=Hn(this._resolverCache,t,n),l=a;if(pl(a,e)){o.$shared=!1,s=ft(s)?s():s;let c=this.createResolver(t,s,r);l=Tt(a,s,c)}for(let c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){let{resolver:o}=Hn(this._resolverCache,t,s);return D(e)?Tt(o,e,void 0,n):o}};function Hn(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));let n=e.join(),o=s.get(n);return o||(o={resolver:Qe(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},s.set(n,o)),o}var gl=i=>D(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||ft(i[e]),!1);function pl(i,t){let{isScriptable:e,isIndexable:s}=Ui(i);for(let n of t){let o=e(n),a=s(n),r=(a||o)&&i[n];if(o&&(ft(r)||gl(r))||a&&I(r))return!0}return!1}var ml="3.9.1",bl=["top","bottom","left","right","chartArea"];function jn(i,t){return i==="top"||i==="bottom"||bl.indexOf(i)===-1&&t==="x"}function $n(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Yn(i){let t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),z(e&&e.onComplete,[i],t)}function _l(i){let t=i.chart,e=t.options.animation;z(e&&e.onProgress,[i],t)}function ko(i){return Zi()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}var ui={},So=i=>{let t=ko(i);return Object.values(ui).filter(e=>e.canvas===t).pop()};function xl(i,t,e){let s=Object.keys(i);for(let n of s){let o=+n;if(o>=t){let a=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=a)}}}function yl(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}var It=class{constructor(t,e){let s=this.config=new vs(e),n=ko(t),o=So(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||nl(n)),this.platform.updateConfig(s);let r=this.platform.acquireContext(n,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Hs(),this.ctx=r,this.canvas=l,this.width=h,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new _s,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Qs(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],ui[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}mt.listen(this,"complete",Yn),mt.listen(this,"progress",_l),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return T(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ji(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return $i(this.canvas,this.ctx),this}stop(){return mt.stop(this),this}resize(t,e){mt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Ji(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),z(s.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let e=this.options.scales||{};E(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){let t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((a,r)=>(a[r]=!1,a),{}),o=[];e&&(o=o.concat(Object.keys(e).map(a=>{let r=e[a],l=ys(a,r),c=l==="r",h=l==="x";return{options:r,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),E(o,a=>{let r=a.options,l=r.id,c=ys(l,r),h=C(r.type,a.dtype);(r.position===void 0||jn(r.position,c)!==jn(a.dposition))&&(r.position=a.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{let u=ht.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(r,t)}),E(n,(a,r)=>{a||delete s[r]}),E(s,a=>{K.configure(this,a,a.options),K.addBox(this,a)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let t=[],e=this.data.datasets,s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort($n("z","_idx"));let{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){E(this.scales,t=>{K.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Oi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:s,start:n,count:o}of e){let a=s==="_removeElements"?-o:o;xl(t,n,a)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,s=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),n=s(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;K.update(this,this.width,this.height,t);let e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],E(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,s=t._clip,n=!s.disabled,o=this.chartArea,a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(n&&_e(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&xe(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return $t(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){let o=Vr.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){let e=this.data.datasets[t],s=this._metasets,n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=pt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){let s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){let n=s?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);J(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(o,{visible:s}),this.update(r=>r.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),mt.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,a),t[o]=a},n=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};E(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)},a,r=()=>{n("attach",r),this.attached=!0,this.resize(),s("resize",o),s("detach",a)};a=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){E(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},E(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){let n=s?"set":"remove",o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),r=0,l=t.length;r{let r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!me(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}_updateHoverStyles(t,e,s){let n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),a=o(e,t),r=s?t:o(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){let s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;let o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){let{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,s,a),l=Ys(t),c=yl(t,this._lastEvent,s,l);s&&(this._lastEvent=null,z(o.onHover,[t,r,this],this),l&&z(o.onClick,[t,r,this],this));let h=!me(r,n);return(h||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}},Xn=()=>E(It.instances,i=>i._plugins.invalidate()),Pt=!0;Object.defineProperties(It,{defaults:{enumerable:Pt,value:O},instances:{enumerable:Pt,value:ui},overrides:{enumerable:Pt,value:vt},registry:{enumerable:Pt,value:ht},version:{enumerable:Pt,value:ml},getChart:{enumerable:Pt,value:So},register:{enumerable:Pt,value:(...i)=>{ht.add(...i),Xn()}},unregister:{enumerable:Pt,value:(...i)=>{ht.remove(...i),Xn()}}});function Po(i,t,e){let{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:l}=t,c=n/r;i.beginPath(),i.arc(o,a,r,s-c,e+c),l>n?(c=n/l,i.arc(o,a,l,e+c,s-c,!0)):i.arc(o,a,n,e+V,s-V),i.closePath(),i.clip()}function vl(i){return Je(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Ml(i,t,e,s){let n=vl(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,s*t/2),r=l=>{let c=(e-Math.min(o,l))*s/2;return Y(l,0,Math.min(o,c))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:Y(n.innerStart,0,a),innerEnd:Y(n.innerEnd,0,a)}}function Jt(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function Ms(i,t,e,s,n,o){let{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),u=h>0?h+s+e+c:0,f=0,g=n-l;if(s){let P=h>0?h-s:0,j=d>0?d-s:0,N=(P+j)/2,Ot=N!==0?g*N/(N+s):g;f=(g-Ot)/2}let p=Math.max(.001,g*d-e/B)/d,m=(g-p)/2,b=l+m+f,_=n-m-f,{outerStart:v,outerEnd:y,innerStart:x,innerEnd:M}=Ml(t,u,d,_-b),w=d-v,S=d-y,k=b+v/w,L=_-y/S,R=u+x,A=u+M,H=b+x/R,q=_-M/A;if(i.beginPath(),o){if(i.arc(a,r,d,k,L),y>0){let N=Jt(S,L,a,r);i.arc(N.x,N.y,y,L,_+V)}let P=Jt(A,_,a,r);if(i.lineTo(P.x,P.y),M>0){let N=Jt(A,q,a,r);i.arc(N.x,N.y,M,_+V,q+Math.PI)}if(i.arc(a,r,u,_-M/u,b+x/u,!0),x>0){let N=Jt(R,H,a,r);i.arc(N.x,N.y,x,H+Math.PI,b-V)}let j=Jt(w,b,a,r);if(i.lineTo(j.x,j.y),v>0){let N=Jt(w,k,a,r);i.arc(N.x,N.y,v,b-V,k)}}else{i.moveTo(a,r);let P=Math.cos(k)*d+a,j=Math.sin(k)*d+r;i.lineTo(P,j);let N=Math.cos(L)*d+a,Ot=Math.sin(L)*d+r;i.lineTo(N,Ot)}i.closePath()}function wl(i,t,e,s,n){let{fullCircles:o,startAngle:a,circumference:r}=t,l=t.endAngle;if(o){Ms(i,t,e,s,a+F,n);for(let c=0;c=F||Kt(o,r,l),p=lt(a,c+u,h+u);return g&&p}getCenterPoint(t){let{x:e,y:s,startAngle:n,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(n+o)/2,d=(a+r+c+l)/2;return{x:e+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:s}=this,n=(e.offset||0)/2,o=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=s>F?Math.floor(s/F):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=0;if(n){r=n/2;let c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*r,Math.sin(c)*r),this.circumference>=B&&(r=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;let l=wl(t,this,r,o,a);Sl(t,this,r,o,l,a),t.restore()}};ae.id="arc";ae.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};ae.defaultRoutes={backgroundColor:"backgroundColor"};function Co(i,t,e=t){i.lineCap=C(e.borderCapStyle,t.borderCapStyle),i.setLineDash(C(e.borderDash,t.borderDash)),i.lineDashOffset=C(e.borderDashOffset,t.borderDashOffset),i.lineJoin=C(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=C(e.borderWidth,t.borderWidth),i.strokeStyle=C(e.borderColor,t.borderColor)}function Pl(i,t,e){i.lineTo(e.x,e.y)}function Cl(i){return i.stepped?ln:i.tension||i.cubicInterpolationMode==="monotone"?cn:Pl}function Do(i,t,e={}){let s=i.length,{start:n=0,end:o=s-1}=e,{start:a,end:r}=t,l=Math.max(n,a),c=Math.min(o,r),h=nr&&o>r;return{count:s,start:l,loop:t.loop,ilen:c(a+(c?r-y:y))%o,v=()=>{p!==m&&(i.lineTo(h,m),i.lineTo(h,p),i.lineTo(h,b))};for(l&&(f=n[_(0)],i.moveTo(f.x,f.y)),u=0;u<=r;++u){if(f=n[_(u)],f.skip)continue;let y=f.x,x=f.y,M=y|0;M===g?(xm&&(m=x),h=(d*h+y)/++d):(v(),i.lineTo(y,x),g=M,d=0,p=m=x),b=x}v()}function ws(i){let t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Ol:Dl}function Al(i){return i.stepped?_n:i.tension||i.cubicInterpolationMode==="monotone"?xn:_t}function Tl(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Co(i,t.options),i.stroke(n)}function Ll(i,t,e,s){let{segments:n,options:o}=t,a=ws(t);for(let r of n)Co(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}var Rl=typeof Path2D=="function";function El(i,t,e,s){Rl&&!t.options.segment?Tl(i,t,e,s):Ll(i,t,e,s)}var dt=class extends it{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){let s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){let n=s.spanGaps?this._loop:this._fullLoop;pn(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=vn(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){let s=this.options,n=t[e],o=this.points,a=ss(this,{property:e,start:n,end:n});if(!a.length)return;let r=[],l=Al(s),c,h;for(c=0,h=a.length;ci!=="borderDash"&&i!=="fill"};function Un(i,t,e,s){let n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)=e)return i.slice(t,t+e);let a=[],r=(e-2)/(o-2),l=0,c=t+e-1,h=t,d,u,f,g,p;for(a[l++]=i[h],d=0;df&&(f=g,u=i[_],p=_);a[l++]=u,h=p}return a[l++]=i[c],a}function Hl(i,t,e,s){let n=0,o=0,a,r,l,c,h,d,u,f,g,p,m=[],b=t+e-1,_=i[t].x,y=i[b].x-_;for(a=t;ap&&(p=c,u=a),n=(o*n+r.x)/++o;else{let M=a-1;if(!T(d)&&!T(u)){let w=Math.min(d,u),S=Math.max(d,u);w!==f&&w!==M&&m.push({...i[w],x:n}),S!==f&&S!==M&&m.push({...i[S],x:n})}a>0&&M!==f&&m.push(i[M]),m.push(r),h=x,o=0,g=p=c,d=u=f=a}}return m}function Ao(i){if(i._decimated){let t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{value:t})}}function Kn(i){i.data.datasets.forEach(t=>{Ao(t)})}function jl(i,t){let e=t.length,s=0,n,{iScale:o}=i,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=Y(at(t,o.axis,a).lo,0,e-1)),c?n=Y(at(t,o.axis,r).hi+1,s,e)-s:n=e-s,{start:s,count:n}}var $l={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){Kn(i);return}let s=i.width;i.data.datasets.forEach((n,o)=>{let{_data:a,indexAxis:r}=n,l=i.getDatasetMeta(o),c=a||n.data;if(Gt([r,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let h=i.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||i.options.parsing)return;let{start:d,count:u}=jl(l,c),f=e.threshold||4*s;if(u<=f){Ao(n);return}T(a)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let g;switch(e.algorithm){case"lttb":g=Nl(c,d,u,s,e);break;case"min-max":g=Hl(c,d,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=g})},destroy(i){Kn(i)}};function Yl(i,t,e){let s=i.segments,n=i.points,o=t.points,a=[];for(let r of s){let{start:l,end:c}=r;c=Ps(l,c,n);let h=ks(e,n[l],n[c],r.loop);if(!t.segments){a.push({source:r,target:h,start:n[l],end:n[c]});continue}let d=ss(t,h);for(let u of d){let f=ks(e,o[u.start],o[u.end],u.loop),g=is(r,n,f);for(let p of g)a.push({source:p,target:u,start:{[e]:qn(h,f,"start",Math.max)},end:{[e]:qn(h,f,"end",Math.min)}})}}return a}function ks(i,t,e,s){if(s)return;let n=t[i],o=e[i];return i==="angle"&&(n=G(n),o=G(o)),{property:i,start:n,end:o}}function Xl(i,t){let{x:e=null,y:s=null}=i||{},n=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=Ps(a,r,n);let l=n[a],c=n[r];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Ps(i,t,e){for(;t>i;t--){let s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function qn(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function To(i,t){let e=[],s=!1;return I(i)?(s=!0,e=i):e=Xl(i,t),e.length?new dt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Gn(i){return i&&i.fill!==!1}function Ul(i,t,e){let n=i[t].fill,o=[t],a;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!W(n))return n;if(a=i[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function Kl(i,t,e){let s=Jl(i);if(D(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return W(n)&&Math.floor(n)===n?ql(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function ql(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function Gl(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:D(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Zl(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:D(i)?s=i.value:s=t.getBaseValue(),s}function Jl(i){let t=i.options,e=t.fill,s=C(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function Ql(i){let{scale:t,index:e,line:s}=i,n=[],o=s.segments,a=s.points,r=tc(t,e);r.push(To({x:null,y:t.bottom},s));for(let l=0;l=0;--a){let r=n[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),s&&r.fill&&us(i.ctx,r,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;let s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){let o=s[n].$filler;Gn(o)&&us(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){let s=t.meta.$filler;!Gn(s)||e.drawTime!=="beforeDatasetDraw"||us(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},to=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},dc=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index,gi=class extends it{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=z(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}let s=t.labels,n=$(s.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=to(s,o),c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,o,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){let{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+r,d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,p)=>{let m=s+e/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*r>a)&&(d+=h,c[c.length-(p>0?0:1)]=0,f+=h,u++),l[p]={left:0,top:f,row:u,width:m,height:n},c[c.length-1]+=m+r}),d}_fitCols(t,e,s,n){let{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-t,d=r,u=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{let _=s+e/2+o.measureText(m.text).width;b>0&&f+n+2*r>h&&(d+=u+r,c.push({width:u,height:f}),g+=u+r,p++,u=f=0),l[b]={left:g,top:f,col:p,width:_,height:n},u=Math.max(u,_),f+=n+r}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,a=Rt(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=X(s,this.left+n,this.right-this.lineWidths[r]);for(let c of e)r!==c.row&&(r=c.row,l=X(s,this.left+n,this.right-this.lineWidths[r])),c.top+=this.top+t+n,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+n}else{let r=0,l=X(s,this.top+t+n,this.bottom-this.columnSizes[r].height);for(let c of e)c.col!==r&&(r=c.col,l=X(s,this.top+t+n,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+n,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;_e(t,this),this._draw(),xe(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:a}=t,r=O.color,l=Rt(t.rtl,this.left,this.width),c=$(a.font),{color:h,padding:d}=a,u=c.size,f=u/2,g;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:b}=to(a,u),_=function(w,S,k){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;n.save();let L=C(k.lineWidth,1);if(n.fillStyle=C(k.fillStyle,r),n.lineCap=C(k.lineCap,"butt"),n.lineDashOffset=C(k.lineDashOffset,0),n.lineJoin=C(k.lineJoin,"miter"),n.lineWidth=L,n.strokeStyle=C(k.strokeStyle,r),n.setLineDash(C(k.lineDash,[])),a.usePointStyle){let R={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:L},A=l.xPlus(w,p/2),H=S+f;Yi(n,R,A,H,a.pointStyleWidth&&p)}else{let R=S+Math.max((u-m)/2,0),A=l.leftForLtr(w,p),H=kt(k.borderRadius);n.beginPath(),Object.values(H).some(q=>q!==0)?qt(n,{x:A,y:R,w:p,h:m,radius:H}):n.rect(A,R,p,m),n.fill(),L!==0&&n.stroke()}n.restore()},v=function(w,S,k){wt(n,k.text,w,S+b/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},y=this.isHorizontal(),x=this._computeTitleHeight();y?g={x:X(o,this.left+d,this.right-s[0]),y:this.top+d+x,line:0}:g={x:this.left+d,y:X(o,this.top+x+d,this.bottom-e[0].height),line:0},ts(this.ctx,t.textDirection);let M=b+d;this.legendItems.forEach((w,S)=>{n.strokeStyle=w.fontColor||h,n.fillStyle=w.fontColor||h;let k=n.measureText(w.text).width,L=l.textAlign(w.textAlign||(w.textAlign=a.textAlign)),R=p+f+k,A=g.x,H=g.y;l.setWidth(this.width),y?S>0&&A+R+d>this.right&&(H=g.y+=M,g.line++,A=g.x=X(o,this.left+d,this.right-s[g.line])):S>0&&H+M>this.bottom&&(A=g.x=A+e[g.line].width+d,g.line++,H=g.y=X(o,this.top+x+d,this.bottom-e[g.line].height));let q=l.x(A);_(q,H,w),A=tn(L,A+p+f,y?A+R:this.right,t.rtl),v(l.x(A),H,w),y?g.x+=R+d:g.y+=M}),es(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,s=$(e.font),n=U(e.padding);if(!e.display)return;let o=Rt(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=s.size/2,c=n.top+l,h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=X(t.align,d,this.right-u);else{let g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+X(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}let f=X(r,d,d+u);a.textAlign=o.textAlign(qe(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,wt(a,e.text,f,h,s)}_computeTitleHeight(){let t=this.options.title,e=$(t.font),s=U(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(lt(t,this.left,this.right)&<(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;si.chart.options.color,boxWidth:40,padding:10,generateLabels(i){let t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o}}=i.legend.options;return i._getSortedDatasetMetas().map(a=>{let r=a.controller.getStyle(e?0:void 0),l=U(r.borderWidth);return{text:t[a.index].label,fillStyle:r.backgroundColor,fontColor:o,hidden:!a.visible,lineCap:r.borderCapStyle,lineDash:r.borderDash,lineDashOffset:r.borderDashOffset,lineJoin:r.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:r.borderColor,pointStyle:s||r.pointStyle,rotation:r.rotation,textAlign:n||r.textAlign,borderRadius:0,datasetIndex:a.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}},Ae=class extends it{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){let s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;let n=I(s.text)?s.text.length:1;this._padding=U(s.padding);let o=n*$(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:s,bottom:n,right:o,options:a}=this,r=a.align,l=0,c,h,d;return this.isHorizontal()?(h=X(r,s,o),d=e+t,c=o-s):(a.position==="left"?(h=s+t,d=X(r,n,e),l=B*-.5):(h=o-t,d=X(r,e,n),l=B*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let s=$(e.font),o=s.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);wt(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:qe(e.align),textBaseline:"middle",translation:[a,r]})}};function gc(i,t){let e=new Ae({ctx:i.ctx,options:t,chart:i});K.configure(i,e,t),K.addBox(i,e),i.titleBlock=e}var pc={id:"title",_element:Ae,start(i,t,e){gc(i,e)},stop(i){let t=i.titleBlock;K.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){let s=i.titleBlock;K.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},oi=new WeakMap,mc={id:"subtitle",start(i,t,e){let s=new Ae({ctx:i.ctx,options:e,chart:i});K.configure(i,s,e),K.addBox(i,s),oi.set(i,s)},stop(i){K.removeBox(i,oi.get(i)),oi.delete(i)},beforeUpdate(i,t,e){let s=oi.get(i);K.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Pe={average(i){if(!i.length)return!1;let t,e,s=0,n=0,o=0;for(t=0,e=i.length;t-1?i.split(` +`):i}function bc(i,t){let{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:i,label:a,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function eo(i,t){let e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=$(t.bodyFont),c=$(t.titleFont),h=$(t.footerFont),d=o.length,u=n.length,f=s.length,g=U(t.padding),p=g.height,m=0,b=s.reduce((y,x)=>y+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){let y=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;p+=f*y+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let _=0,v=function(y){m=Math.max(m,e.measureText(y).width+_)};return e.save(),e.font=c.string,E(i.title,v),e.font=l.string,E(i.beforeBody.concat(i.afterBody),v),_=t.displayColors?a+2+t.boxPadding:0,E(s,y=>{E(y.before,v),E(y.lines,v),E(y.after,v)}),_=0,e.font=h.string,E(i.footer,v),e.restore(),m+=g.width,{width:m,height:p}}function _c(i,t){let{y:e,height:s}=t;return ei.height-s/2?"bottom":"center"}function xc(i,t,e,s){let{x:n,width:o}=s,a=e.caretSize+e.caretPadding;if(i==="left"&&n+o+a>t.width||i==="right"&&n-o-a<0)return!0}function yc(i,t,e,s){let{x:n,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i,c="center";return s==="center"?c=n<=(r+l)/2?"left":"right":n<=o/2?c="left":n>=a-o/2&&(c="right"),xc(c,i,t,e)&&(c="center"),c}function io(i,t,e){let s=e.yAlign||t.yAlign||_c(i,e);return{xAlign:e.xAlign||t.xAlign||yc(i,t,e,s),yAlign:s}}function vc(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Mc(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function so(i,t,e,s){let{caretSize:n,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=kt(a),g=vc(t,r),p=Mc(t,l,c);return l==="center"?r==="left"?g+=c:r==="right"&&(g-=c):r==="left"?g-=Math.max(h,u)+n:r==="right"&&(g+=Math.max(d,f)+n),{x:Y(g,0,s.width-t.width),y:Y(p,0,s.height-t.height)}}function ai(i,t,e){let s=U(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function no(i){return ct([],bt(i))}function wc(i,t,e){return pt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function oo(i,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}var Te=class extends it{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new ci(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=wc(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:s}=e,n=s.beforeTitle.apply(this,[t]),o=s.title.apply(this,[t]),a=s.afterTitle.apply(this,[t]),r=[];return r=ct(r,bt(n)),r=ct(r,bt(o)),r=ct(r,bt(a)),r}getBeforeBody(t,e){return no(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){let{callbacks:s}=e,n=[];return E(t,o=>{let a={before:[],lines:[],after:[]},r=oo(s,o);ct(a.before,bt(r.beforeLabel.call(this,o))),ct(a.lines,r.label.call(this,o)),ct(a.after,bt(r.afterLabel.call(this,o))),n.push(a)}),n}getAfterBody(t,e){return no(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){let{callbacks:s}=e,n=s.beforeFooter.apply(this,[t]),o=s.footer.apply(this,[t]),a=s.afterFooter.apply(this,[t]),r=[];return r=ct(r,bt(n)),r=ct(r,bt(o)),r=ct(r,bt(a)),r}_createItems(t){let e=this._active,s=this.chart.data,n=[],o=[],a=[],r=[],l,c;for(l=0,c=e.length;lt.filter(h,d,u,s))),t.itemSort&&(r=r.sort((h,d)=>t.itemSort(h,d,s))),E(r,h=>{let d=oo(t.callbacks,h);n.push(d.labelColor.call(this,h)),o.push(d.labelPointStyle.call(this,h)),a.push(d.labelTextColor.call(this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){let s=this.options.setContext(this.getContext()),n=this._active,o,a=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{let r=Pe[s.position].call(this,n,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);let l=this._size=eo(this,s),c=Object.assign({},r,l),h=io(this.chart,s,c),d=so(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){let o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){let{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=kt(r),{x:u,y:f}=t,{width:g,height:p}=e,m,b,_,v,y,x;return o==="center"?(y=f+p/2,n==="left"?(m=u,b=m-a,v=y+a,x=y-a):(m=u+g,b=m+a,v=y-a,x=y+a),_=m):(n==="left"?b=u+Math.max(l,h)+a:n==="right"?b=u+g-Math.max(c,d)-a:b=this.caretX,o==="top"?(v=f,y=v-a,m=b-a,_=b+a):(v=f+p,y=v+a,m=b+a,_=b-a),x=v),{x1:m,x2:b,x3:_,y1:v,y2:y,y3:x}}drawTitle(t,e,s){let n=this.title,o=n.length,a,r,l;if(o){let c=Rt(s.rtl,this.x,this.width);for(t.x=ai(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",a=$(s.titleFont),r=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,l=0;lv!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,qt(t,{x:m,y:p,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),qt(t,{x:b,y:p+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){let{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=$(s.bodyFont),u=d.lineHeight,f=0,g=Rt(s.rtl,this.x,this.width),p=function(S){e.fillText(S,g.x(t.x+f),t.y+u/2),t.y+=u+o},m=g.textAlign(a),b,_,v,y,x,M,w;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=ai(this,m,s),e.fillStyle=s.bodyColor,E(this.beforeBody,p),f=r&&m!=="right"?a==="center"?c/2+h:c+2+h:0,y=0,M=n.length;y0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){let a=Pe[t.position].call(this,this._active,this._eventPosition);if(!a)return;let r=this._size=eo(this,t),l=Object.assign({},a,this._size),c=io(e,t,l),h=so(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),s=this.opacity;if(!s)return;this._updateAnimationTarget(e);let n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;let a=U(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),ts(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),es(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let s=this._active,n=t.map(({datasetIndex:r,index:l})=>{let c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!me(s,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,s),r=this._positionChanged(a,t),l=e||!me(a,o)||r;return l&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){let o=this.options;if(t.type==="mouseout")return[];if(!n)return e;let a=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&a.reverse(),a}_positionChanged(t,e){let{caretX:s,caretY:n,options:o}=this,a=Pe[o.position].call(this,t,e);return a!==!1&&(s!==a.x||n!==a.y)}};Te.positioners=Pe;var kc={id:"tooltip",_element:Te,positioners:Pe,afterInit(i,t,e){e&&(i.tooltip=new Te({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){let t=i.tooltip;if(t&&t._willRender()){let e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",e)===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){let e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:rt,title(i){if(i.length>0){let t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndexi!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Sc=Object.freeze({__proto__:null,Decimation:$l,Filler:hc,Legend:fc,SubTitle:mc,Title:pc,Tooltip:kc}),Pc=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Cc(i,t,e,s){let n=i.indexOf(t);if(n===-1)return Pc(i,t,e,s);let o=i.lastIndexOf(t);return n!==o?e:n}var Dc=(i,t)=>i===null?null:Y(Math.round(i),0,t),ce=class extends Ft{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let s=this.getLabels();for(let{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(T(t))return null;let s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Cc(s,t,C(e,t),this._addedLabels),Dc(e,s.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){let t=this.min,e=this.max,s=this.options.offset,n=[],o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=e;a++)n.push({value:a});return n}getLabelForValue(t){let e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};ce.id="category";ce.defaults={ticks:{callback:ce.prototype.getLabelForValue}};function Oc(i,t){let e=[],{bounds:n,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,g=h-1,{min:p,max:m}=t,b=!T(a),_=!T(r),v=!T(c),y=(m-p)/(d+1),x=Ai((m-p)/g/f)*f,M,w,S,k;if(x<1e-14&&!b&&!_)return[{value:p},{value:m}];k=Math.ceil(m/x)-Math.floor(p/x),k>g&&(x=Ai(k*x/g/f)*f),T(l)||(M=Math.pow(10,l),x=Math.ceil(x*M)/M),n==="ticks"?(w=Math.floor(p/x)*x,S=Math.ceil(m/x)*x):(w=p,S=m),b&&_&&o&&Us((r-a)/o,x/1e3)?(k=Math.round(Math.min((r-a)/x,h)),x=(r-a)/k,w=a,S=r):v?(w=b?a:w,S=_?r:S,k=c-1,x=(S-w)/k):(k=(S-w)/x,Ut(k,Math.round(k),x/1e3)?k=Math.round(k):k=Math.ceil(k));let L=Math.max(Li(x),Li(w));M=Math.pow(10,T(l)?L:l),w=Math.round(w*M)/M,S=Math.round(S*M)/M;let R=0;for(b&&(u&&w!==a?(e.push({value:a}),wn=e?n:l,r=l=>o=s?o:l;if(t){let l=ot(n),c=ot(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(n===o){let l=1;(o>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(o*.05)),r(o+l),t||a(n-l)}this.min=n,this.max=o}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,s=this.getTickLimit();s=Math.max(2,s);let n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=Oc(n,o);return t.bounds==="ticks"&&Ti(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){let t=this.ticks,e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){let n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return Zt(t,this.chart.options.locale,this.options.ticks.format)}},Le=class extends he{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?t:0,this.max=W(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,s=nt(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};Le.id="linear";Le.defaults={ticks:{callback:pi.formatters.numeric}};function ro(i){return i/Math.pow(10,Math.floor(tt(i)))===1}function Ac(i,t){let e=Math.floor(tt(t.max)),s=Math.ceil(t.max/Math.pow(10,e)),n=[],o=Q(i.min,Math.pow(10,Math.floor(tt(t.min)))),a=Math.floor(tt(o)),r=Math.floor(o/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do n.push({value:o,major:ro(o)}),++r,r===10&&(r=1,++a,l=a>=0?1:l),o=Math.round(r*Math.pow(10,a)*l)/l;while(a0?s:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?Math.max(0,t):null,this.max=W(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),s=this.min,n=this.max,o=l=>s=t?s:l,a=l=>n=e?n:l,r=(l,c)=>Math.pow(10,Math.floor(tt(l))+c);s===n&&(s<=0?(o(1),a(10)):(o(r(s,-1)),a(r(n,1)))),s<=0&&o(r(n,-1)),n<=0&&a(r(s,1)),this._zero&&this.min!==this._suggestedMin&&s===r(this.min,0)&&o(r(s,-1)),this.min=s,this.max=n}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},s=Ac(e,this);return t.bounds==="ticks"&&Ti(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":Zt(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=tt(t),this._valueRange=tt(this.max)-tt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(tt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};Re.id="logarithmic";Re.defaults={ticks:{callback:pi.formatters.logarithmic,major:{enabled:!0}}};function Ss(i){let t=i.ticks;if(t.display&&i.display){let e=U(t.backdropPadding);return C(t.font&&t.font.size,O.font.size)+e.height}return 0}function Tc(i,t,e){return e=I(e)?e:[e],{w:rn(i,t.string,e),h:e.length*t.lineHeight}}function lo(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:in?{start:t-e,end:t}:{start:t,end:t+e}}function Lc(i){let t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],o=i._pointLabels.length,a=i.options.pointLabels,r=a.centerPointLabels?B/o:0;for(let l=0;lt.r&&(r=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+r)),n.startt.b&&(l=(n.end-t.b)/a,i.b=Math.max(i.b,t.b+l))}function Ec(i,t,e){let s=[],n=i._pointLabels.length,o=i.options,a=Ss(o)/2,r=i.drawingArea,l=o.pointLabels.centerPointLabels?B/n:0;for(let c=0;c270||e<90)&&(i-=t),i}function Bc(i,t){let{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){let o=s.setContext(i.getPointLabelContext(n)),a=$(o.font),{x:r,y:l,textAlign:c,left:h,top:d,right:u,bottom:f}=i._pointLabelItems[n],{backdropColor:g}=o;if(!T(g)){let p=kt(o.borderRadius),m=U(o.backdropPadding);e.fillStyle=g;let b=h-m.left,_=d-m.top,v=u-h+m.width,y=f-d+m.height;Object.values(p).some(x=>x!==0)?(e.beginPath(),qt(e,{x:b,y:_,w:v,h:y,radius:p}),e.fill()):e.fillRect(b,_,v,y)}wt(e,i._pointLabels[n],r,l+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}function Lo(i,t,e,s){let{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,F);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let a=1;a{let n=z(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){let t=this.options;t.display&&t.pointLabels.display?Lc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){let e=F/(this._pointLabels.length||1),s=this.options.startAngle||0;return G(t*e+nt(s))}getDistanceFromCenterForValue(t){if(T(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(T(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t{if(h!==0){r=this.getDistanceFromCenterForValue(c.value);let d=n.setContext(this.getContext(h-1));Vc(this,d,r,o)}}),s.display){for(t.save(),a=o-1;a>=0;a--){let c=s.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:d}=c;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(a,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;let n=this.getIndexAngle(0),o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&!e.reverse)return;let c=s.setContext(this.getContext(l)),h=$(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;let d=U(c.backdropPadding);t.fillRect(-a/2-d.left,-o-h.size/2-d.top,a+d.width,h.size+d.height)}wt(t,r.label,0,-o,h,{color:c.color})}),t.restore()}drawTitle(){}};zt.id="radialLinear";zt.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:pi.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}};zt.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};zt.descriptors={angleLines:{_fallback:"grid"}};var mi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Z=Object.keys(mi);function Nc(i,t){return i-t}function co(i,t){if(T(t))return null;let e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts,a=t;return typeof s=="function"&&(a=s(a)),W(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(n&&(a=n==="week"&&(Lt(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,n)),+a)}function ho(i,t,e,s){let n=Z.length;for(let o=Z.indexOf(i);o=Z.indexOf(e);o--){let a=Z[o];if(mi[a].common&&i._adapter.diff(n,s,a)>=t-1)return a}return Z[e?Z.indexOf(e):0]}function jc(i){for(let t=Z.indexOf(i)+1,e=Z.length;t=t?e[s]:e[n];i[o]=!0}}function $c(i,t,e,s){let n=i._adapter,o=+n.startOf(t[0].value,s),a=t[t.length-1].value,r,l;for(r=o;r<=a;r=+n.add(r,1,s))l=e[r],l>=0&&(t[l].major=!0);return t}function fo(i,t,e){let s=[],n={},o=t.length,a,r;for(a=0;a+t.value))}initOffsets(t){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;e=Y(e,0,a),s=Y(s,0,a),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){let t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,a=o.unit||ho(o.minUnit,e,s,this._getLabelCapacity(e)),r=C(o.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Lt(l)||l===!0,h={},d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(s,e,a)>1e5*r)throw new Error(e+" and "+s+" are too far apart with stepSize of "+r+" "+a);let g=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;up-m).map(p=>+p)}getLabelForValue(t){let e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}_tickFormatFunction(t,e,s,n){let o=this.options,a=o.time.displayFormats,r=this._unit,l=this._majorUnit,c=r&&a[r],h=l&&a[l],d=s[e],u=l&&h&&d&&d.major,f=this._adapter.format(t,n||(u?h:c)),g=o.ticks.callback;return g?z(g,[f,e,s],this):f}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;let n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=at(i,"pos",t)),{pos:o,time:r}=i[s],{pos:a,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=at(i,"time",t)),{time:o,pos:r}=i[s],{time:a,pos:l}=i[n]);let c=a-o;return c?r+(l-r)*(t-o)/c:r}var Ee=class extends Bt{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ri(e,this.min),this._tableRange=ri(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:e,max:s}=this,n=[],o=[],a,r,l,c,h;for(a=0,r=t.length;a=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(a=0,r=n.length;a{Alpine.store("theme");let s=this.getChart();s&&s.destroy(),this.initChart()}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Alpine.store("theme")==="system"&&this.$nextTick(()=>{let s=this.getChart();s&&s.destroy(),this.initChart()})})},initChart:function(){if(!(!this.$refs.canvas||!this.$refs.backgroundColorElement||!this.$refs.borderColorElement))return new Cs(this.$refs.canvas,{type:"line",data:{labels:t,datasets:[{data:e,borderWidth:2,fill:"start",tension:.5,backgroundColor:getComputedStyle(this.$refs.backgroundColorElement).color,borderColor:getComputedStyle(this.$refs.borderColorElement).color}]},options:{animation:{duration:0},elements:{point:{radius:0}},maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{x:{display:!1},y:{display:!1}},tooltips:{enabled:!1}}})},getChart:function(){return this.$refs.canvas?Cs.getChart(this.$refs.canvas):null}}}export{Xc as default}; +/*! Bundled license information: + +chart.js/dist/chunks/helpers.segment.mjs: + (*! + * Chart.js v3.9.1 + * https://www.chartjs.org + * (c) 2022 Chart.js Contributors + * Released under the MIT License + *) + +chart.js/dist/chunks/helpers.segment.mjs: + (*! + * @kurkle/color v0.2.1 + * https://github.com/kurkle/color#readme + * (c) 2022 Jukka Kurkela + * Released under the MIT License + *) + +chart.js/dist/chart.mjs: + (*! + * Chart.js v3.9.1 + * https://www.chartjs.org + * (c) 2022 Chart.js Contributors + * Released under the MIT License + *) +*/ diff --git a/public/logo-dark.svg b/public/logo-dark.svg index e0cf79fb..9e1b33e5 100644 --- a/public/logo-dark.svg +++ b/public/logo-dark.svg @@ -1,6 +1,6 @@ - + diff --git a/public/logo.svg b/public/logo.svg index 4feba779..2b60ec2a 100644 --- a/public/logo.svg +++ b/public/logo.svg @@ -1,6 +1,6 @@ - + diff --git a/resources/assets/background-pattern-dark.svg b/resources/assets/background-pattern-dark.svg deleted file mode 100644 index 461b3bc4..00000000 --- a/resources/assets/background-pattern-dark.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/resources/assets/background-pattern.svg b/resources/assets/background-pattern.svg deleted file mode 100644 index 9f543b8f..00000000 --- a/resources/assets/background-pattern.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/resources/css/app.css b/resources/css/app.css index d2c3d212..acd32d21 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -2,81 +2,116 @@ @tailwind components; @tailwind utilities; -[x-cloak] { - display: none; +@layer base { + html { + -webkit-tap-highlight-color: transparent; + } } -/* Look cool on safari */ -.blur-background { - backdrop-filter: blur(20px); +@keyframes shine { + 0% { + background-position: 200% 50%; + } + 100% { + background-position: 0% 50%; + } } -.background-pattern { - background-image: url('../assets/background-pattern.svg'); +@keyframes spin { + to { + transform: rotate(360deg); + } } -@media(prefers-color-scheme: dark) { - .background-pattern { - background-image: url('../assets/background-pattern-dark.svg'); - } +/* Scrollbar width */ +::-webkit-scrollbar { + height: 8px; + width: 8px; +} + +/* Scrollbar track */ +::-webkit-scrollbar-track { + background: transparent; + border-radius: 4px; +} + +::-webkit-scrollbar-thumb { + background: transparent; +} + +/* Scrollbar thumb (the draggable part) */ +::-webkit-scrollbar-thumb { + border-radius: 999px; +} + +/* Light Theme */ +::-webkit-scrollbar-thumb { + @apply bg-gray-300/80; } +/* Scrollbar thumb on hover */ +::-webkit-scrollbar-thumb:hover { + @apply bg-gray-300; +} + +/* Dark Theme */ +.dark ::-webkit-scrollbar-thumb { + @apply bg-cloud/60; +} + +/* Scrollbar thumb on hover */ +.dark ::-webkit-scrollbar-thumb:hover { + @apply bg-cloud; +} /* Whole menu */ -nav ul { - @apply text-xl md:text-sm list-none; +nav.docs-navigation ul { + @apply list-none text-sm; } /* Categories */ -nav > ul > li { +nav.docs-navigation > ul > li { @apply mb-3; & > a { @apply font-semibold; - @apply no-underline px-3 py-1.5 mb-1.5; - @apply border rounded-lg dark:border-white/15; + @apply mb-1.5 px-3 py-2.5 no-underline; + @apply rounded-xl border dark:border-white/15; } } -nav > ul > li.active > a { - @apply text-[#00aaa6]; - /*@apply border-[#00aaa6] dark:border-[#00aaa6]/90;*/ +nav.docs-navigation > ul > li.active > a { + @apply text-black dark:text-white; & > svg { - @apply text-[#00aaa6]; + @apply text-violet-400; } } -nav > ul > li:hover > a { - @apply text-[#00aaa6]; - /*@apply border-[#00aaa6] dark:border-[#00aaa6]/90;*/ +nav.docs-navigation > ul > li > a { + @apply transition duration-200 will-change-transform; } -/* Sub menus */ -nav > ul > li > ul { - @apply mb-6; +nav.docs-navigation > ul > li:hover > a { + @apply translate-x-0.5 bg-gray-50 dark:bg-gray-900/50; +} +/* Sub menus */ +nav.docs-navigation > ul > li > ul { & > li { @apply font-normal; & a { - @apply w-full block; - @apply py-1.5; - @apply border-l pl-3 dark:border-white/10; - @apply ml-3; + @apply ml-3 block w-full border-l-[1.5px] py-1.5 pl-3 transition-all duration-200 dark:border-white/10; } &.exact-active a { - @apply text-[#00aaa6]; - @apply border-[#00aaa6] dark:border-[#00aaa6]/90; - /*@apply font-medium*/ + @apply border-violet-400 font-medium text-violet-800/80 dark:border-violet-400/90 dark:text-white; } &:hover a { - /*@apply text-[#00aaa6];*/ - @apply border-[#00aaa6] dark:border-[#00aaa6]/90; + @apply border-violet-400 dark:border-violet-400/90; } - } } @@ -97,7 +132,7 @@ nav > ul > li > ul { } .prose pre { - @apply p-6 shadow-lg rounded-xl; + @apply rounded-xl p-6 shadow-lg; } .prose pre code { @@ -117,7 +152,7 @@ nav > ul > li > ul { } .prose img { - @apply shadow-md rounded-xl; + @apply rounded-xl shadow-md; } .prose img.no-format { @@ -129,7 +164,7 @@ nav > ul > li > ul { overflow-x-auto is recommended. */ .prose pre { - @apply p-0 my-4 overflow-x-auto bg-transparent rounded-md; + @apply my-4 overflow-x-auto rounded-md bg-transparent p-0; } /* @@ -139,7 +174,7 @@ nav > ul > li > ul { colors extend edge to edge. */ .prose pre code.torchlight { - @apply block py-4 min-w-max; + @apply block min-w-max py-4; } /* @@ -157,63 +192,3 @@ nav > ul > li > ul { .prose pre code.torchlight .summary-caret { @apply mr-4; } - - - - - -:root { - --docsearch-container-background: rgba(0, 0, 0, 0.5); - --docsearch-primary-color: #00aaa6; -} - -[id=docsearch] { - width: 100%; - @apply md:w-auto; -} - -.DocSearch-Button { - @apply border border-solid border-gray-400/50 dark:border-white/10 dark:bg-black/10 flex items-center w-full rounded; -} - -.DocSearch-Button:hover { - box-shadow: none; - @apply text-gray-400 border-gray-400/70 bg-transparent dark:border-white/20; -} - -.DocSearch-Button .DocSearch-Search-Icon { - height: 0.87rem; - @apply text-gray-500 dark:text-white/60; -} - -.DocSearch-Button-Placeholder { - @apply dark:text-white/60 pr-44 text-xs; -} - -.DocSearch-Button-Keys { - display: flex; - min-width: auto; - - @apply mt-1 text-xs leading-none; -} - -.DocSearch-Button-Key { - background: none; - box-shadow: none; - width: auto; - - @apply font-sans mr-0.5; -} - -.DocSearch-Modal { - @apply text-black; -} - -.DocSearch-Screen-Icon { - display: none; -} - -.DocSearch-Input { - @apply focus-visible:outline-none; -} - diff --git a/resources/css/docsearch.css b/resources/css/docsearch.css new file mode 100644 index 00000000..fd54ccdb --- /dev/null +++ b/resources/css/docsearch.css @@ -0,0 +1,66 @@ +:root { + --docsearch-container-background: rgba(0, 0, 0, 0.5); + --docsearch-primary-color: #987af1; +} + +[id='docsearch'] { + width: 100%; + @apply md:w-auto; +} + +.DocSearch-Button { + @apply m-0 flex items-center rounded-lg bg-gray-50 font-normal ring-1 ring-gray-700/40 transition duration-300 ease-out dark:bg-black/30; +} + +.DocSearch-Button:hover { + box-shadow: none; + @apply bg-gray-100 ring-gray-300 dark:bg-black/50 dark:ring-gray-700/70; +} + +.DocSearch-Button:hover .DocSearch-Button-Placeholder { + @apply text-black dark:text-white; +} + +.DocSearch-Button .DocSearch-Search-Icon { + height: 0.87rem; + @apply text-gray-500 dark:text-white/60; +} + +@media (max-width: 768px) { + .DocSearch-Button-Keys, + .DocSearch-Button-Placeholder { + display: block; + } +} + +.DocSearch-Button-Placeholder { + @apply hidden pl-1 pr-1 text-sm text-black/60 min-[400px]:block min-[520px]:pr-20 dark:text-white/60; +} + +.DocSearch-Button-Keys { + @apply ml-1 mt-1 hidden min-w-[auto] text-sm leading-none min-[520px]:flex; +} + +.DocSearch-Button-Key { + background: none; + box-shadow: none; + width: auto; + + @apply mr-0.5 font-sans; +} + +.DocSearch-Modal { + @apply text-black; +} + +.DocSearch-Screen-Icon { + display: none; +} + +.DocSearch-Input { + @apply focus-visible:outline-none; +} + +.DocSearch-Form { + @apply rounded-lg; +} diff --git a/resources/images/marcel2023laraconus.webp b/resources/images/marcel2023laraconus.webp new file mode 100644 index 00000000..f4f00ece Binary files /dev/null and b/resources/images/marcel2023laraconus.webp differ diff --git a/resources/images/marcelpaciot_faded.webp b/resources/images/marcelpaciot_faded.webp new file mode 100644 index 00000000..7f5798b6 Binary files /dev/null and b/resources/images/marcelpaciot_faded.webp differ diff --git a/resources/images/mobile/android_phone_mockup.webp b/resources/images/mobile/android_phone_mockup.webp new file mode 100644 index 00000000..f2d766be Binary files /dev/null and b/resources/images/mobile/android_phone_mockup.webp differ diff --git a/resources/images/mobile/developer_holding_phone.webp b/resources/images/mobile/developer_holding_phone.webp new file mode 100644 index 00000000..63e2f7a3 Binary files /dev/null and b/resources/images/mobile/developer_holding_phone.webp differ diff --git a/resources/images/mobile/ios_phone_mockup.webp b/resources/images/mobile/ios_phone_mockup.webp new file mode 100644 index 00000000..9f109a35 Binary files /dev/null and b/resources/images/mobile/ios_phone_mockup.webp differ diff --git a/resources/images/mobile/macos_wallpaper.webp b/resources/images/mobile/macos_wallpaper.webp new file mode 100644 index 00000000..654ec5f7 Binary files /dev/null and b/resources/images/mobile/macos_wallpaper.webp differ diff --git a/resources/images/simon2025laraconeu.webp b/resources/images/simon2025laraconeu.webp new file mode 100644 index 00000000..7ee30aba Binary files /dev/null and b/resources/images/simon2025laraconeu.webp differ diff --git a/resources/images/simonhamp_faded.webp b/resources/images/simonhamp_faded.webp new file mode 100644 index 00000000..90900d0b Binary files /dev/null and b/resources/images/simonhamp_faded.webp differ diff --git a/resources/js/app.js b/resources/js/app.js index 8781af5c..5cb164dc 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1,8 +1,113 @@ -import './bootstrap'; -import Alpine from 'alpinejs' -import codeBlock from "./alpine/codeBlock.js"; +import './fonts' +import './bootstrap' +import 'number-flow' +import { + Livewire, + Alpine, +} from '../../vendor/livewire/livewire/dist/livewire.esm' +import codeBlock from './alpine/codeBlock.js' +import docsearch from '@docsearch/js' +import '@docsearch/css' -window.Alpine = Alpine; +import.meta.glob(['../images/**', '../svg/**']) +import { + animate, + hover, + inView, + easeIn, + easeOut, + easeInOut, + backIn, + backOut, + backInOut, + circIn, + circOut, + circInOut, + anticipate, + spring, + stagger, + cubicBezier, +} from 'motion' +// Motion +window.motion = { + animate: animate, + hover: hover, + inView: inView, + easeIn: easeIn, + easeOut: easeOut, + easeInOut: easeInOut, + backOut: backOut, + backIn: backIn, + backInOut: backInOut, + circIn: circIn, + circOut: circOut, + circInOut: circInOut, + anticipate: anticipate, + spring: spring, + stagger: stagger, + cubicBezier: cubicBezier, +} + +// Alpine Alpine.data('codeBlock', codeBlock) -Alpine.start() +Alpine.magic('refAll', (el) => { + return (refName) => { + return Array.from(el.querySelectorAll(`[x-ref="${refName}"]`)) + } +}) +Alpine.data('countdown', (iso) => ({ + flows: {}, + init() { + // Parse target date from ISO string and ensure it's treated as a specific point in time + this.targetDate = new Date(iso).getTime() + + // refs to the number-flow elements + this.flows = { + dd: this.$refs.dd, // days + hh: this.$refs.hh, // hours + mm: this.$refs.mm, // minutes + ss: this.$refs.ss, // seconds + } + + // limit the rolling wheels so 59 ➜ 00 animates smoothly + this.flows.hh.digits = { 1: { max: 2 }, 0: { max: 9 } } // hours 0-23 + this.flows.mm.digits = { 1: { max: 5 }, 0: { max: 9 } } // minutes 0-59 + this.flows.ss.digits = { 1: { max: 5 }, 0: { max: 9 } } // seconds 0-59 + + this.tick() // draw immediately + this.timer = setInterval(() => this.tick(), 1_000) + }, + tick() { + const now = Date.now() + const diff = Math.max(0, this.targetDate - now) + + if (diff === 0) clearInterval(this.timer) // stop at zero + + // Calculate days, hours, minutes, and seconds properly + const days = Math.floor(diff / (24 * 3600 * 1000)) + const hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)) + const minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)) + const seconds = Math.floor((diff % (60 * 1000)) / 1000) + + this.flows.dd.update(days) + this.flows.hh.update(hours) + this.flows.mm.update(minutes) + this.flows.ss.update(seconds) + }, + destroy() { + clearInterval(this.timer) + }, // tidy up +})) + +Livewire.start() + +// Docsearch +docsearch({ + appId: 'ZNII9QZ8WI', + apiKey: '9be495a1aaf367b47c873d30a8e7ccf5', + indexName: 'nativephp', + insights: true, + container: '#docsearch', + debug: false, +}) diff --git a/resources/js/fonts.js b/resources/js/fonts.js new file mode 100644 index 00000000..6b6da022 --- /dev/null +++ b/resources/js/fonts.js @@ -0,0 +1 @@ +import '@fontsource/poppins/latin.css' diff --git a/resources/views/article.blade.php b/resources/views/article.blade.php new file mode 100644 index 00000000..5f4c40c1 --- /dev/null +++ b/resources/views/article.blade.php @@ -0,0 +1,217 @@ + + {{-- Hero --}} + + diff --git a/resources/views/blog.blade.php b/resources/views/blog.blade.php new file mode 100644 index 00000000..a70b8bc9 --- /dev/null +++ b/resources/views/blog.blade.php @@ -0,0 +1,211 @@ + + {{-- Hero --}} +
+
+ {{-- Primary Heading --}} +

+ Blog +

+ + {{-- Introduction Description --}} +

+ Welcome to our blog! Here, we share insights, updates, and + stories from our community. Stay tuned for the latest news and + articles. +

+ + {{-- Blurred circle - Decorative --}} + + + {{-- Blurred circle - Decorative --}} + +
+
+ + {{-- Articles --}} +
+ {{-- Semantic heading for section (visually hidden) --}} +

+ Blog Articles +

+ + {{-- List --}} +
+ + 🎉 WE DID IT! We finally got to v1. I almost don't believe it! + This is an awesome milestone. For a project that started as just + an idea, to see it reach a truly stable place and support + building powerful apps across all major platforms is just + incredible. + + + Hey team, this is just a quick note about Laravel version + support. Per our Support Policy matrix, we will be dropping + Laravel 10 support for NativePHP for desktop v1. Laravel 10 + reached end of life back in February 2025. + + + Earlier this week I spoke at the Laravel Worldwide Meetup where + I unveiled: 🌐 A brand new nativephp.com, lovingly (and + painstakingly!) crafted by the incredible + @HassanZahirnia + +
+ + {{-- Pagination --}} + +
+
diff --git a/resources/views/components/alert-beta.blade.php b/resources/views/components/alert-beta.blade.php index 99d91a9a..9a22b52a 100644 --- a/resources/views/components/alert-beta.blade.php +++ b/resources/views/components/alert-beta.blade.php @@ -1,26 +1,52 @@ -
class(['rounded-lg flex items-center p-3 mt-8 space-x-6 border - text-orange-800 border-orange-300 bg-orange-50 - dark:text-orange-100 dark:bg-orange-900/20 dark:border-orange-900']) }}> - -
-

- NativePHP is currently in - +

+ + {{-- Icon --}} +
diff --git a/resources/views/components/alert-v1-announcement.blade.php b/resources/views/components/alert-v1-announcement.blade.php new file mode 100644 index 00000000..9217478f --- /dev/null +++ b/resources/views/components/alert-v1-announcement.blade.php @@ -0,0 +1,269 @@ + diff --git a/resources/views/components/alert.blade.php b/resources/views/components/alert.blade.php deleted file mode 100644 index 91ff09be..00000000 --- a/resources/views/components/alert.blade.php +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/resources/views/components/article-card.blade.php b/resources/views/components/article-card.blade.php new file mode 100644 index 00000000..3eea9265 --- /dev/null +++ b/resources/views/components/article-card.blade.php @@ -0,0 +1,59 @@ +@props([ + 'title' => '', + 'url' => '#', + 'date' => null, +]) + + +
+ {{-- Header --}} +
+ {{-- Title --}} +

+ {{ $title }} +

+ + {{-- Arrow --}} +
+ +
+ {{-- Date --}} + @if ($date) + @php + $dateObject = \Carbon\Carbon::parse($date); + $formattedDate = $dateObject->format('F j, Y'); + @endphp + + + @endif + + {{-- Content --}} +

+ {{ $slot }} +

+
+ + {{-- Blur decoration --}} +
+
+
diff --git a/resources/views/components/eap-banner.blade.php b/resources/views/components/eap-banner.blade.php new file mode 100644 index 00000000..79494a81 --- /dev/null +++ b/resources/views/components/eap-banner.blade.php @@ -0,0 +1,59 @@ + +
+ {{-- Text --}} +
+
+ Join our Mobile Early Access Program +
+
+ {{-- Arrow --}} + +
+ + {{-- Countdown --}} +
+
Ends in
+
+ +
d
+
+
:
+
+ +
h
+
+
:
+
+ +
m
+
+
:
+
+ +
s
+
+
+
diff --git a/resources/views/components/faq-card.blade.php b/resources/views/components/faq-card.blade.php new file mode 100644 index 00000000..cd999f0b --- /dev/null +++ b/resources/views/components/faq-card.blade.php @@ -0,0 +1,75 @@ +@props([ + 'question', +]) + +@php + global $count; +@endphp + +
+
+ {{-- Number --}} +
+ {{ str_pad(++$count, 2, 0, STR_PAD_LEFT) }} +
+ + {{-- Question --}} +
+ {{ $question }} +
+ + {{-- Arrow --}} +
+
+
+ + + + + + + + + + +
+
+
+ + {{-- Answer --}} +
+ {!! $slot !!} +
+
+
diff --git a/resources/views/components/footer.blade.php b/resources/views/components/footer.blade.php index d4fd7a5d..9b59e755 100644 --- a/resources/views/components/footer.blade.php +++ b/resources/views/components/footer.blade.php @@ -1,18 +1,271 @@ -
-
-

- © {{ date('Y') }} NativePHP. -

-

- NativePHP is a copyright of and maintained by
Marcel Pociot - and Simon Hamp. -

-

- Logo by Caneco. -

+ diff --git a/resources/views/components/header-banner.blade.php b/resources/views/components/header-banner.blade.php deleted file mode 100644 index 50a1c4d3..00000000 --- a/resources/views/components/header-banner.blade.php +++ /dev/null @@ -1,75 +0,0 @@ -@props(['hasMenu' => false]) -
- - - -
- - - - NativePHP - - -
-
- -
-
- - -
- @if($hasMenu) - - @else - - - - - @endif -
-
-
-
- -
diff --git a/resources/views/components/icons/alert-diamond.blade.php b/resources/views/components/icons/alert-diamond.blade.php new file mode 100644 index 00000000..e4d0eebc --- /dev/null +++ b/resources/views/components/icons/alert-diamond.blade.php @@ -0,0 +1,47 @@ + + + + + + + + + + diff --git a/resources/views/components/icons/checkmark.blade.php b/resources/views/components/icons/checkmark.blade.php new file mode 100644 index 00000000..e17d5d81 --- /dev/null +++ b/resources/views/components/icons/checkmark.blade.php @@ -0,0 +1,12 @@ + + + diff --git a/resources/views/components/icons/colored-confetti.blade.php b/resources/views/components/icons/colored-confetti.blade.php new file mode 100644 index 00000000..92f22525 --- /dev/null +++ b/resources/views/components/icons/colored-confetti.blade.php @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/views/components/icons/confetti.blade.php b/resources/views/components/icons/confetti.blade.php new file mode 100644 index 00000000..456c7822 --- /dev/null +++ b/resources/views/components/icons/confetti.blade.php @@ -0,0 +1,46 @@ + + + + + + + + + + diff --git a/resources/views/components/icons/date.blade.php b/resources/views/components/icons/date.blade.php new file mode 100644 index 00000000..c2fe28ee --- /dev/null +++ b/resources/views/components/icons/date.blade.php @@ -0,0 +1,73 @@ + + + + + + + + + + + + diff --git a/resources/views/components/icons/desktop-computer.blade.php b/resources/views/components/icons/desktop-computer.blade.php new file mode 100644 index 00000000..6e351b4c --- /dev/null +++ b/resources/views/components/icons/desktop-computer.blade.php @@ -0,0 +1,39 @@ + + + + + + + + + diff --git a/resources/views/components/icons/email-document.blade.php b/resources/views/components/icons/email-document.blade.php new file mode 100644 index 00000000..3b8d98c7 --- /dev/null +++ b/resources/views/components/icons/email-document.blade.php @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + diff --git a/resources/views/components/icons/heart.blade.php b/resources/views/components/icons/heart.blade.php new file mode 100644 index 00000000..82995c06 --- /dev/null +++ b/resources/views/components/icons/heart.blade.php @@ -0,0 +1,14 @@ + + + diff --git a/resources/views/components/icons/monitor-smartphone.blade.php b/resources/views/components/icons/monitor-smartphone.blade.php new file mode 100644 index 00000000..57c11860 --- /dev/null +++ b/resources/views/components/icons/monitor-smartphone.blade.php @@ -0,0 +1 @@ + diff --git a/resources/views/components/icons/pc.blade.php b/resources/views/components/icons/pc.blade.php new file mode 100644 index 00000000..a71220a0 --- /dev/null +++ b/resources/views/components/icons/pc.blade.php @@ -0,0 +1,14 @@ + + + diff --git a/resources/views/components/icons/pinkary.blade.php b/resources/views/components/icons/pinkary.blade.php index 4a810c2e..c36dcdf6 100644 --- a/resources/views/components/icons/pinkary.blade.php +++ b/resources/views/components/icons/pinkary.blade.php @@ -1,7 +1,16 @@ - - - + viewBox="0 0 1024 1024" + fill="none" +> + + diff --git a/resources/views/components/icons/play-button.blade.php b/resources/views/components/icons/play-button.blade.php new file mode 100644 index 00000000..760cf936 --- /dev/null +++ b/resources/views/components/icons/play-button.blade.php @@ -0,0 +1,13 @@ + + + diff --git a/resources/views/components/icons/right-arrow.blade.php b/resources/views/components/icons/right-arrow.blade.php new file mode 100644 index 00000000..57e1d87a --- /dev/null +++ b/resources/views/components/icons/right-arrow.blade.php @@ -0,0 +1,22 @@ + + + + + diff --git a/resources/views/components/icons/rocket.blade.php b/resources/views/components/icons/rocket.blade.php new file mode 100644 index 00000000..7484f2dd --- /dev/null +++ b/resources/views/components/icons/rocket.blade.php @@ -0,0 +1,15 @@ + + + + + + diff --git a/resources/views/components/icons/stacked-lines.blade.php b/resources/views/components/icons/stacked-lines.blade.php new file mode 100644 index 00000000..33d1ae6c --- /dev/null +++ b/resources/views/components/icons/stacked-lines.blade.php @@ -0,0 +1,20 @@ + + + + + + diff --git a/resources/views/components/icons/star-circle.blade.php b/resources/views/components/icons/star-circle.blade.php new file mode 100644 index 00000000..2e59ddf5 --- /dev/null +++ b/resources/views/components/icons/star-circle.blade.php @@ -0,0 +1,14 @@ + + + diff --git a/resources/views/components/icons/tablet-smartphone.blade.php b/resources/views/components/icons/tablet-smartphone.blade.php new file mode 100644 index 00000000..6856b5a7 --- /dev/null +++ b/resources/views/components/icons/tablet-smartphone.blade.php @@ -0,0 +1 @@ + diff --git a/resources/views/components/icons/twitter.blade.php b/resources/views/components/icons/twitter.blade.php new file mode 100644 index 00000000..824e2697 --- /dev/null +++ b/resources/views/components/icons/twitter.blade.php @@ -0,0 +1,10 @@ + + + diff --git a/resources/views/components/icons/upload-box.blade.php b/resources/views/components/icons/upload-box.blade.php new file mode 100644 index 00000000..ba8446a8 --- /dev/null +++ b/resources/views/components/icons/upload-box.blade.php @@ -0,0 +1,43 @@ + + + + + + + + diff --git a/resources/views/components/icons/user-single.blade.php b/resources/views/components/icons/user-single.blade.php new file mode 100644 index 00000000..07276637 --- /dev/null +++ b/resources/views/components/icons/user-single.blade.php @@ -0,0 +1,21 @@ + + + + + + diff --git a/resources/views/components/icons/warning.blade.php b/resources/views/components/icons/warning.blade.php new file mode 100644 index 00000000..1f6cb4fd --- /dev/null +++ b/resources/views/components/icons/warning.blade.php @@ -0,0 +1,15 @@ + + + + + diff --git a/resources/views/components/icons/xmark.blade.php b/resources/views/components/icons/xmark.blade.php new file mode 100644 index 00000000..5f9d162c --- /dev/null +++ b/resources/views/components/icons/xmark.blade.php @@ -0,0 +1,14 @@ + + + diff --git a/resources/views/components/icons/youtube.blade.php b/resources/views/components/icons/youtube.blade.php new file mode 100644 index 00000000..1b50cb80 --- /dev/null +++ b/resources/views/components/icons/youtube.blade.php @@ -0,0 +1,14 @@ + + + + diff --git a/resources/views/components/layout-three-columns.blade.php b/resources/views/components/layout-three-columns.blade.php index 496b7447..fa68ab25 100644 --- a/resources/views/components/layout-three-columns.blade.php +++ b/resources/views/components/layout-three-columns.blade.php @@ -1,31 +1,27 @@ -
+ {{-- Main container --}} +
+ {{-- Left sidebar --}} + @if (! empty($sidebarLeft)) + + {{ $sidebarLeft }} + + @endif -
-
+
+ {{-- Content --}} +
+ {{ $slot }} +
- @if(!empty($sidebarLeft)) - - {{ $sidebarLeft }} - - @endif - - -
-
- - @if(!empty($sidebarRight)) - - {{ $sidebarRight }} - - @endif - - {{ $slot }} - - -
-
-
+ {{-- Right sidebar --}} + @if (! empty($sidebarRight)) + + {{ $sidebarRight }} + + @endif
diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index 9a6fd679..9d43d946 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -1,47 +1,95 @@ - - - - - + + + + + + + - + NativePHP{{ isset($title) ? ' | ' . $title : '' }} - {!! SEOMeta::generate() !!} - {!! OpenGraph::generate() !!} - {!! Twitter::generate() !!} - - - - - - @vite(["resources/css/app.css", "resources/js/app.js"]) + {{-- Favicon --}} + - - - - - + {!! SEOMeta::generate() !!} + {!! OpenGraph::generate() !!} + {!! Twitter::generate() !!} + + + + - -{{ $slot }} - - - + {{-- Styles --}} + + @livewireStyles + @vite('resources/css/app.css') + + + + {{ $slot }} + + @livewireScriptConfig + @vite('resources/js/app.js') + @vite('resources/css/docsearch.css') + diff --git a/resources/views/components/link-button.blade.php b/resources/views/components/link-button.blade.php index 987b617a..ac4f0d1c 100644 --- a/resources/views/components/link-button.blade.php +++ b/resources/views/components/link-button.blade.php @@ -1,16 +1,6 @@ -class([' -inline-block -w-fit -font-medium -shadow-sm dark:shadow-white/10 -border border-gray-300 dark:border-transparent -bg-white dark:bg-gray-700 -rounded-lg -px-4 py-2 -text-black dark:text-gray-100 -hover:text-[#00aaa6] hover:border-[#00aaa6]/25 dark:hover:border-transparent -flex items-center gap-2 -text-sm -']) }}> + {{ $slot }} diff --git a/resources/views/components/link-subtle.blade.php b/resources/views/components/link-subtle.blade.php index 417ec8fb..2bf2a5c4 100644 --- a/resources/views/components/link-subtle.blade.php +++ b/resources/views/components/link-subtle.blade.php @@ -1,3 +1,6 @@ -class('tracking-wide underline underline-offset-4 text-sm text-gray-500 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-100')}}> - {{$slot}} + + {{ $slot }} diff --git a/resources/views/components/logo.blade.php b/resources/views/components/logo.blade.php new file mode 100644 index 00000000..25b6837d --- /dev/null +++ b/resources/views/components/logo.blade.php @@ -0,0 +1,26 @@ + + + + + + diff --git a/resources/views/components/navigation-bar.blade.php b/resources/views/components/navigation-bar.blade.php new file mode 100644 index 00000000..70bb440a --- /dev/null +++ b/resources/views/components/navigation-bar.blade.php @@ -0,0 +1,368 @@ +@props(['hasMenu' => false]) +
+ +
+ diff --git a/resources/views/components/platform-switcher.blade.php b/resources/views/components/platform-switcher.blade.php new file mode 100644 index 00000000..effb1867 --- /dev/null +++ b/resources/views/components/platform-switcher.blade.php @@ -0,0 +1,93 @@ +@php + $isMobile = request()->is('docs/mobile/*'); + $mobileHref = '/docs/mobile/1'; + $desktopHref = '/docs/desktop/1'; +@endphp + + diff --git a/resources/views/components/sidebar-left-navigation.blade.php b/resources/views/components/sidebar-left-navigation.blade.php index 4e06eb34..4d7082a7 100644 --- a/resources/views/components/sidebar-left-navigation.blade.php +++ b/resources/views/components/sidebar-left-navigation.blade.php @@ -1,36 +1,32 @@ - - - - +
diff --git a/resources/views/components/sidebar-right.blade.php b/resources/views/components/sidebar-right.blade.php index 0e9e0909..ab9ea57f 100644 --- a/resources/views/components/sidebar-right.blade.php +++ b/resources/views/components/sidebar-right.blade.php @@ -1,15 +1,5 @@ - + diff --git a/resources/views/components/sidebar-title.blade.php b/resources/views/components/sidebar-title.blade.php index d8d4389e..41042a25 100644 --- a/resources/views/components/sidebar-title.blade.php +++ b/resources/views/components/sidebar-title.blade.php @@ -1,3 +1,6 @@ -
class(['uppercase text-sm font-semibold pb-1 mb-2 text-gray-400 dark:text-gray-500 border-b dark:border-gray-800']) }}> +
{{ $slot }}
diff --git a/resources/views/components/social-networks-all.blade.php b/resources/views/components/social-networks-all.blade.php index 5fea9273..77bcc610 100644 --- a/resources/views/components/social-networks-all.blade.php +++ b/resources/views/components/social-networks-all.blade.php @@ -1,24 +1,95 @@ + - - - + - - - + - - - + - - - + - - - + - - - + + + diff --git a/resources/views/components/sponsors-corporate.blade.php b/resources/views/components/sponsors-corporate.blade.php deleted file mode 100644 index 67b3770e..00000000 --- a/resources/views/components/sponsors-corporate.blade.php +++ /dev/null @@ -1,23 +0,0 @@ -@props(['height' => 'h-12']) - - - - - - - - - -{{-- - - - ---}} - - - - - - - - diff --git a/resources/views/components/sponsors-featured.blade.php b/resources/views/components/sponsors-featured.blade.php deleted file mode 100644 index 132fa6b2..00000000 --- a/resources/views/components/sponsors-featured.blade.php +++ /dev/null @@ -1,9 +0,0 @@ -@props(['height' => 'h-24', 'sameHeight' => true]) - - - - - - - - diff --git a/resources/views/components/sponsors/borah.blade.php b/resources/views/components/sponsors/borah.blade.php deleted file mode 100644 index 37298c7e..00000000 --- a/resources/views/components/sponsors/borah.blade.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/resources/views/components/sponsors/kaashosting.blade.php b/resources/views/components/sponsors/kaashosting.blade.php deleted file mode 100644 index 70c89fe9..00000000 --- a/resources/views/components/sponsors/kaashosting.blade.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/resources/views/components/sponsors/laradir.blade.php b/resources/views/components/sponsors/laradir.blade.php deleted file mode 100644 index 9f239e45..00000000 --- a/resources/views/components/sponsors/laradir.blade.php +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/resources/views/components/sponsors/lists/docs/corporate-sponsors.blade.php b/resources/views/components/sponsors/lists/docs/corporate-sponsors.blade.php new file mode 100644 index 00000000..52cbc1de --- /dev/null +++ b/resources/views/components/sponsors/lists/docs/corporate-sponsors.blade.php @@ -0,0 +1,78 @@ +@php + $sponsors = [ + [ + 'url' => 'https://www.redgalaxy.co.uk/', + 'title' => 'Learn more about RedGalaxy', + 'label' => 'Visit RedGalaxy website', + 'component' => 'sponsors.logos.redgalaxy', + 'class' => 'h-auto max-h-8 max-w-full', + 'alt' => 'RedGalaxy logo', + 'name' => 'RedGalaxy', + ], + [ + 'url' => 'https://sevalla.com/?utm_source=nativephp&utm_medium=Referral&utm_campaign=homepage', + 'title' => 'Learn more about Sevalla', + 'label' => 'Visit Sevalla website', + 'component' => 'sponsors.logos.sevalla', + 'class' => 'h-auto max-h-8 max-w-full text-black dark:text-white', + 'alt' => 'Sevalla logo', + 'name' => 'Sevalla', + ], + [ + 'url' => 'https://www.kaashosting.nl/?lang=en', + 'title' => 'Learn more about KaasHosting', + 'label' => 'Visit KaasHosting website', + 'component' => 'sponsors.logos.kaashosting', + 'class' => 'block h-auto max-h-8 max-w-full fill-[#042340] dark:fill-white', + 'alt' => 'KaasHosting logo', + 'name' => 'KaasHosting', + ], + [ + 'url' => 'https://www.quantumweb.co/', + 'title' => 'Learn more about Quantumweb', + 'label' => 'Visit Quantumweb website', + 'component' => 'sponsors.logos.quantumweb', + 'class' => 'block h-auto max-h-8 max-w-full fill-[#042340] dark:fill-white', + 'alt' => 'Quantumweb logo', + 'name' => 'Quantumweb', + ], + // Uncomment these if you want to include the commented sponsors + /* + [ + 'url' => 'https://serverauth.com/', + 'title' => 'Learn more about ServerAuth', + 'label' => 'Visit ServerAuth website', + 'component' => 'sponsors.logos.serverauth', + 'class' => 'block h-auto max-h-8 max-w-full fill-[#042340] dark:fill-white', + 'alt' => 'ServerAuth logo', + 'name' => 'ServerAuth' + ], + [ + 'url' => 'https://borah.digital/', + 'title' => 'Learn more about Borah Digital Labs', + 'label' => 'Visit Borah Digital Labs website', + 'component' => 'sponsors.logos.borah', + 'class' => 'block h-auto max-h-8 max-w-full dark:brightness-125', + 'alt' => 'Borah Digital Labs logo', + 'name' => 'Borah Digital Labs' + ], + */ + ]; + + $randomSponsor = $sponsors[array_rand($sponsors)]; +@endphp + + + + {{ $randomSponsor['name'] }} + diff --git a/resources/views/components/sponsors/lists/docs/featured-sponsors.blade.php b/resources/views/components/sponsors/lists/docs/featured-sponsors.blade.php new file mode 100644 index 00000000..9602b551 --- /dev/null +++ b/resources/views/components/sponsors/lists/docs/featured-sponsors.blade.php @@ -0,0 +1,39 @@ + + BeyondCode company logo - featured sponsor + + BeyondCode + + + + diff --git a/resources/views/components/sponsors/lists/home/corporate-sponsors.blade.php b/resources/views/components/sponsors/lists/home/corporate-sponsors.blade.php new file mode 100644 index 00000000..d828a3c7 --- /dev/null +++ b/resources/views/components/sponsors/lists/home/corporate-sponsors.blade.php @@ -0,0 +1,118 @@ + + + + +{{-- + +--}} + + + + + +{{-- + +--}} diff --git a/resources/views/components/sponsors/lists/home/featured-sponsors.blade.php b/resources/views/components/sponsors/lists/home/featured-sponsors.blade.php new file mode 100644 index 00000000..96210ce8 --- /dev/null +++ b/resources/views/components/sponsors/lists/home/featured-sponsors.blade.php @@ -0,0 +1,49 @@ + + + diff --git a/resources/views/components/sponsors/logos/borah.blade.php b/resources/views/components/sponsors/logos/borah.blade.php new file mode 100644 index 00000000..d05b874b --- /dev/null +++ b/resources/views/components/sponsors/logos/borah.blade.php @@ -0,0 +1,6 @@ + diff --git a/resources/views/components/sponsors/logos/kaashosting.blade.php b/resources/views/components/sponsors/logos/kaashosting.blade.php new file mode 100644 index 00000000..f8d3653a --- /dev/null +++ b/resources/views/components/sponsors/logos/kaashosting.blade.php @@ -0,0 +1,50 @@ + + + + + + + + + diff --git a/resources/views/components/sponsors/logos/laradevs.blade.php b/resources/views/components/sponsors/logos/laradevs.blade.php new file mode 100644 index 00000000..7d5b4034 --- /dev/null +++ b/resources/views/components/sponsors/logos/laradevs.blade.php @@ -0,0 +1,22 @@ + + + + + diff --git a/resources/views/components/sponsors/logos/quantumweb.blade.php b/resources/views/components/sponsors/logos/quantumweb.blade.php new file mode 100644 index 00000000..7735e6c6 --- /dev/null +++ b/resources/views/components/sponsors/logos/quantumweb.blade.php @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + diff --git a/resources/views/components/sponsors/logos/redgalaxy.blade.php b/resources/views/components/sponsors/logos/redgalaxy.blade.php new file mode 100644 index 00000000..bf428e68 --- /dev/null +++ b/resources/views/components/sponsors/logos/redgalaxy.blade.php @@ -0,0 +1,38 @@ + + + + + + + diff --git a/resources/views/components/sponsors/serverauth.blade.php b/resources/views/components/sponsors/logos/serverauth.blade.php similarity index 100% rename from resources/views/components/sponsors/serverauth.blade.php rename to resources/views/components/sponsors/logos/serverauth.blade.php diff --git a/resources/views/components/sponsors/sevalla.blade.php b/resources/views/components/sponsors/logos/sevalla.blade.php similarity index 100% rename from resources/views/components/sponsors/sevalla.blade.php rename to resources/views/components/sponsors/logos/sevalla.blade.php diff --git a/resources/views/components/sponsors/redgalaxy.blade.php b/resources/views/components/sponsors/redgalaxy.blade.php deleted file mode 100644 index 16f03fd1..00000000 --- a/resources/views/components/sponsors/redgalaxy.blade.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/resources/views/components/testimonial.blade.php b/resources/views/components/testimonial.blade.php new file mode 100644 index 00000000..56b0300e --- /dev/null +++ b/resources/views/components/testimonial.blade.php @@ -0,0 +1,73 @@ +@props([ + 'quote', + 'author', + 'handle', + 'content', + 'avatar', +]) + +@php + // Define color palettes for light mode only + $lightColorPalettes = [ + ['bg' => 'bg-cyan-100', 'text' => 'text-cyan-800'], + ['bg' => 'bg-amber-100', 'text' => 'text-amber-800'], + ['bg' => 'bg-red-100', 'text' => 'text-red-800'], + ['bg' => 'bg-emerald-100', 'text' => 'text-emerald-800'], + ['bg' => 'bg-blue-100', 'text' => 'text-blue-800'], + ['bg' => 'bg-purple-100', 'text' => 'text-purple-800'], + ['bg' => 'bg-orange-100', 'text' => 'text-orange-800'], + ['bg' => 'bg-teal-100', 'text' => 'text-teal-800'], + ['bg' => 'bg-slate-100', 'text' => 'text-slate-800'], + ['bg' => 'bg-violet-100', 'text' => 'text-violet-800'], + ]; + + // Select a random light color palette + $randomLightPalette = $lightColorPalettes[array_rand($lightColorPalettes)]; + + // Define a single consistent dark mode color palette + $darkBg = 'dark:bg-indigo-900/20'; + $darkText = 'dark:text-indigo-200'; +@endphp + +
+ {{-- Highlight --}} +
+ "{{ $quote }}" +
+ + {{-- Author --}} +
+ {{-- Image --}} + {{ $author }} + + {{-- Information --}} +
+ {{-- Name --}} +
{{ $author }}
+ + @if ($handle) + {{-- Handle --}} +
+ {{ $handle }} +
+ @endif +
+
+ + {{-- Content --}} + @if ($content) +

+ {{ $content }} +

+ @endif +
diff --git a/resources/views/components/testimonials.blade.php b/resources/views/components/testimonials.blade.php new file mode 100644 index 00000000..edfd3997 --- /dev/null +++ b/resources/views/components/testimonials.blade.php @@ -0,0 +1,139 @@ +
+
+ {{-- Section Heading --}} +

+ +
Testimonials
+

+ + {{-- Section Description --}} +

+ Here's what folks are saying about NativePHP for mobile +

+
+ + {{-- Testimonial List --}} +
+ + + + + + + + + + + +
+
diff --git a/resources/views/components/theme-toggle.blade.php b/resources/views/components/theme-toggle.blade.php new file mode 100644 index 00000000..5187bb9b --- /dev/null +++ b/resources/views/components/theme-toggle.blade.php @@ -0,0 +1,242 @@ +
+ Toggle theme + + {{-- Moon --}} + + {{-- Mini star --}} + + {{-- Micro star --}} + + {{-- Sun ball --}} + + {{-- sunShine --}} + +
diff --git a/resources/views/components/toc-and-sponsors.blade.php b/resources/views/components/toc-and-sponsors.blade.php index 5282d18e..100a550f 100644 --- a/resources/views/components/toc-and-sponsors.blade.php +++ b/resources/views/components/toc-and-sponsors.blade.php @@ -1,26 +1,51 @@ +{{-- On this page --}} +

+ {{-- Icon --}} + - On this page - @if (count($tableOfContents) > 0) - - @endif +{{-- Table of contents --}} +@if (count($tableOfContents) > 0) + +@endif + +
+ {{-- Sponsors --}} +

+ {{-- Icon --}} + + + {{-- Label --}} +
Sponsors
+

- Featured sponsors -
- + {{-- List --}} +
+
- Corporate sponsors -
- + {{-- List --}} +
+
+
diff --git a/resources/views/docs/1/getting-started/status.md b/resources/views/docs/1/getting-started/status.md deleted file mode 100644 index 4c055bcf..00000000 --- a/resources/views/docs/1/getting-started/status.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: Roadmap -order: 099 ---- - -## Roadmap -We're currently focused on reaching v1. - -We've put together a basic [roadmap](https://github.com/orgs/NativePHP/projects/2/views/1) to help visualize our -current _estimated_ development timeline. - -## Current Status -NativePHP is currently in the `beta` stage. - -We need your help with testing and bug-hunting, so we want you to _build_ apps with NativePHP. - -As we're at the `beta` stage, NativePHP is almost ready for prime-time. This means we think it's ready for -you to distribute your apps to users. But you should be aware of a couple of issues: - -- The PHP source code inside your app can be seen _and modified_. We're actively working on a solution for this in time - for the `v1` release. -- Documentation around signing apps for Microsoft Windows and macOS are not yet available. - -**If you're planning to release an app, it may be useful to get in touch on [Discord](https://discord.gg/X62tWNStZK) so -we can run through any last minute checks to ensure your app is in the best shape.** - -The more parts of the whole process we can exercise to find bugs and fix them, the better. - -Be sure to share your findings through the [forum](https://github.com/orgs/nativephp/discussions), by -[raising issues](https://github.com/nativephp/laravel/issues/new/choose)/reporting bugs, and on -[Discord](https://discord.gg/X62tWNStZK). - - diff --git a/resources/views/docs/1/the-basics/notifications.md b/resources/views/docs/1/the-basics/notifications.md deleted file mode 100644 index f2406603..00000000 --- a/resources/views/docs/1/the-basics/notifications.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: Notifications -order: 500 ---- - -## Native Notifications - -NativePHP allows you to send system notifications using an elegant PHP API. These notifications are, unlike Laravel's built-in notifications, actual UI notifications displayed by your operating system. - -When used sparingly, notifications can be a great way to inform the user about events that are occurring in your application and to bring their attention back to it, especially if further input from them is required. - -Notifications are sent using the `Notification` facade. -```php -use Native\Laravel\Facades\Notification; -``` - -### Sending Notifications - -You may send a notification using the `Notification` facade. - -```php -Notification::title('Hello from NativePHP') - ->message('This is a detail message coming from your Laravel app.') - ->show(); -``` - -This will show a system-wide notification to the user with the given title and message. - -### Handling clicks on notifications - -You may register a custom event along with your NativePHP notification. -This event will be fired when a user clicks on the notification, so that you may add some custom logic within your application in this scenario. - -To attach an event to your notification, you may use the `event` method. The argument passed to this method is the class name of the event that should get dispatched upon clicking on the notification. - -```php -Notification::title('Hello from NativePHP') - ->message('This is a detail message coming from your Laravel app.') - ->event(\App\Events\MyNotificationEvent::class) - ->show(); -``` - -## Events - -### `NotificationClicked` -The `Native\Laravel\Events\Notifications\NotificationClicked` event is dispatched when a user clicks on a notification. - diff --git a/resources/views/docs/1/_index.md b/resources/views/docs/desktop/1/_index.md similarity index 100% rename from resources/views/docs/1/_index.md rename to resources/views/docs/desktop/1/_index.md diff --git a/resources/views/docs/1/digging-deeper/_index.md b/resources/views/docs/desktop/1/digging-deeper/_index.md similarity index 100% rename from resources/views/docs/1/digging-deeper/_index.md rename to resources/views/docs/desktop/1/digging-deeper/_index.md diff --git a/resources/views/docs/1/digging-deeper/broadcasting.md b/resources/views/docs/desktop/1/digging-deeper/broadcasting.md similarity index 96% rename from resources/views/docs/1/digging-deeper/broadcasting.md rename to resources/views/docs/desktop/1/digging-deeper/broadcasting.md index af1bc63c..2f0aebf1 100644 --- a/resources/views/docs/1/digging-deeper/broadcasting.md +++ b/resources/views/docs/desktop/1/digging-deeper/broadcasting.md @@ -7,7 +7,7 @@ order: 100 NativePHP facilitates event broadcasting of both [native events](#native-events) (emitted by Electron/Tauri) and [custom events](#custom-events) dispatched by your Laravel app. You can listen to all of these events in your -Laravel application as you normally would or in the [JavaSscript](#listening-with-javascript) on your pages. +Laravel application as you normally would or in the [JavaScript](#listening-with-javascript) on your pages. ## Native events diff --git a/resources/views/docs/1/digging-deeper/child-processes.md b/resources/views/docs/desktop/1/digging-deeper/child-processes.md similarity index 95% rename from resources/views/docs/1/digging-deeper/child-processes.md rename to resources/views/docs/desktop/1/digging-deeper/child-processes.md index c23a4c5b..a60a92af 100644 --- a/resources/views/docs/1/digging-deeper/child-processes.md +++ b/resources/views/docs/desktop/1/digging-deeper/child-processes.md @@ -189,7 +189,7 @@ ChildProcess::stop('tail'); This will attempt to stop the process gracefully. The [`ProcessExited`](#codeprocessexitedcode) event will be dispatched if the process exits. -Note that [persistent processes](/docs/1/digging-deeper/child-process#persistent-processes) will be permanently stopped and will only be restarted when the `start` method is called again. If you want to restart a persistent process, use the `restart` method instead. +Note that [persistent processes](/docs/desktop/1/digging-deeper/child-process#persistent-processes) will be permanently stopped and will only be restarted when the `start` method is called again. If you want to restart a persistent process, use the `restart` method instead. ## Restarting a Child Process @@ -271,11 +271,11 @@ A Child Process may send output via any of the following interfaces: - A custom interface, e.g. a network socket. - Broadcasting a Custom Event -`STDOUT`, `STDERR` & [Custom Events](/docs/1/digging-deeper/broadcasting#custom-events) are dispatched using +`STDOUT`, `STDERR` & [Custom Events](/docs/desktop/1/digging-deeper/broadcasting#custom-events) are dispatched using Laravel's event system. You may listen to these events by registering a listener in your app service provider, or on the front end -using the [Native helper](/docs/1/digging-deeper/broadcasting#listening-with-javascript). +using the [Native helper](/docs/desktop/1/digging-deeper/broadcasting#listening-with-javascript). Please see the [Events](#events) section for a full list of events. diff --git a/resources/views/docs/1/digging-deeper/databases.md b/resources/views/docs/desktop/1/digging-deeper/databases.md similarity index 86% rename from resources/views/docs/1/digging-deeper/databases.md rename to resources/views/docs/desktop/1/digging-deeper/databases.md index 215dca6b..1ab36a3b 100644 --- a/resources/views/docs/1/digging-deeper/databases.md +++ b/resources/views/docs/desktop/1/digging-deeper/databases.md @@ -30,18 +30,18 @@ keeping download & install size small. ### Configuration You do not need to do anything special to configure your application to use SQLite. NativePHP will automatically: -- Switch to using SQLite when building your application -- Create a database file for you in the `appdata` directory on the user's system -- Configure your application to use that database file -- Run your migrations each time your app starts, as needed +- Switch to using SQLite when building your application. +- Create a database file for you in the `appdata` directory on the user's system. +- Configure your application to use that database file. +- Run your migrations each time your app starts, as needed. ## Development -Remember that in [development](/docs/getting-started/development) your application's database is always going to be -the SQLite database created in the [`appdata`](/docs/getting-started/debugging#appdata) folder for your application. +In [development](/docs/getting-started/development), your application uses a database called `nativephp.sqlite` +which is created in the build directory. -This means that even if you've got different config in your `.env` file, your application will not be connecting to any -other database when it is running within the Electron/Tauri environment. +NativePHP forces your application to use this database when it is running within the Electron/Tauri environment so that +it doesn't modify any other SQLite databases you may already be using. ## Migrations @@ -53,7 +53,7 @@ upon foreign key constraints, [you need to enable SQLite support for them](https **It's important to test your migrations on prod builds before releasing updates!** You don't want to accidentally delete your user's data when they update your app. -### Running migrations +### In production In production builds of your app, NativePHP will check to see if the app version has changed and attempt to migrate the user's copy of your database in their `appdata` folder. diff --git a/resources/views/docs/1/digging-deeper/files.md b/resources/views/docs/desktop/1/digging-deeper/files.md similarity index 100% rename from resources/views/docs/1/digging-deeper/files.md rename to resources/views/docs/desktop/1/digging-deeper/files.md diff --git a/resources/views/docs/1/digging-deeper/php-binaries.md b/resources/views/docs/desktop/1/digging-deeper/php-binaries.md similarity index 100% rename from resources/views/docs/1/digging-deeper/php-binaries.md rename to resources/views/docs/desktop/1/digging-deeper/php-binaries.md diff --git a/resources/views/docs/1/digging-deeper/queues.md b/resources/views/docs/desktop/1/digging-deeper/queues.md similarity index 100% rename from resources/views/docs/1/digging-deeper/queues.md rename to resources/views/docs/desktop/1/digging-deeper/queues.md diff --git a/resources/views/docs/1/digging-deeper/security.md b/resources/views/docs/desktop/1/digging-deeper/security.md similarity index 90% rename from resources/views/docs/1/digging-deeper/security.md rename to resources/views/docs/desktop/1/digging-deeper/security.md index 8fa2ff13..8a3780e7 100644 --- a/resources/views/docs/1/digging-deeper/security.md +++ b/resources/views/docs/desktop/1/digging-deeper/security.md @@ -2,6 +2,7 @@ title: Security order: 400 --- + # Security When building desktop applications it's essential to take your application's security to the next level, both to @@ -16,6 +17,7 @@ application that allows users to manipulate data on their filesystem or other so A major consideration for NativePHP is how it can protect _your_ application. ### Secrets and .env + As your application is being installed on systems outside of your/your organisation's control, it is important to think of the environment that it's in as _potentially_ hostile, which is to say that any secrets, passwords or keys could fall into the hands of someone who might try to abuse them. @@ -28,6 +30,8 @@ application and any API use a robust and secure authentication protocol, such as distribute unique and expiring tokens (an expiration date less than 48 hours in the future is recommended) with a high level of entropy, as this makes them hard to guess and hard to abuse. +Always use HTTPS. + If your application allows users to connect _their own_ API keys for a service, you should treat these keys with great care. If you choose to store them anywhere (either in a [File](/docs/digging-deeper/files) or [Database](/docs/digging-deeper/databases)), make sure you store them @@ -69,27 +73,11 @@ but you should do all you can to prevent unwanted attack vectors from being made #### Prevent regular browser access -When you're ready, you should add the `PreventRegularBrowserAccess` middleware to your application's global middleware -stack, **especially before building your application for production release**. - -**This is NOT done for you.** +When you are running a build, the global `PreventRegularBrowserAccess` middleware will be applied to all your routes automatically. This ensures that only requests coming from the web view shell that booted your application can make requests into your application. -Append the middleware in your `bootstrap/app.php` file: - -```php -use Native\Laravel\Http\Middleware\PreventRegularBrowserAccess; - -return Application::configure(basePath: dirname(__DIR__)) - // ... - ->withMiddleware(function (Middleware $middleware) { - $middleware->append(PreventRegularBrowserAccess::class); - }) - // ... -``` - ## Protecting your users and their data Equally important is how your app protects users. NativePHP is a complex combination of powerful software and so there diff --git a/resources/views/docs/1/getting-started/_index.md b/resources/views/docs/desktop/1/getting-started/_index.md similarity index 100% rename from resources/views/docs/1/getting-started/_index.md rename to resources/views/docs/desktop/1/getting-started/_index.md diff --git a/resources/views/docs/1/getting-started/configuration.md b/resources/views/docs/desktop/1/getting-started/configuration.md similarity index 97% rename from resources/views/docs/1/getting-started/configuration.md rename to resources/views/docs/desktop/1/getting-started/configuration.md index 40bd67d2..4e6b09fa 100644 --- a/resources/views/docs/1/getting-started/configuration.md +++ b/resources/views/docs/desktop/1/getting-started/configuration.md @@ -40,6 +40,11 @@ return [ * The author of your application. */ 'author' => env('NATIVEPHP_APP_AUTHOR'), + + /** + * The copyright notice for your application. + */ + 'copyright' => env('NATIVEPHP_APP_COPYRIGHT'), /** * The default service provider for your application. This provider diff --git a/resources/views/docs/1/getting-started/debugging.md b/resources/views/docs/desktop/1/getting-started/debugging.md similarity index 100% rename from resources/views/docs/1/getting-started/debugging.md rename to resources/views/docs/desktop/1/getting-started/debugging.md diff --git a/resources/views/docs/1/getting-started/development.md b/resources/views/docs/desktop/1/getting-started/development.md similarity index 100% rename from resources/views/docs/1/getting-started/development.md rename to resources/views/docs/desktop/1/getting-started/development.md diff --git a/resources/views/docs/1/getting-started/env-files.md b/resources/views/docs/desktop/1/getting-started/env-files.md similarity index 100% rename from resources/views/docs/1/getting-started/env-files.md rename to resources/views/docs/desktop/1/getting-started/env-files.md diff --git a/resources/views/docs/1/getting-started/installation.md b/resources/views/docs/desktop/1/getting-started/installation.md similarity index 92% rename from resources/views/docs/1/getting-started/installation.md rename to resources/views/docs/desktop/1/getting-started/installation.md index d03a1e3e..513326a4 100644 --- a/resources/views/docs/1/getting-started/installation.md +++ b/resources/views/docs/desktop/1/getting-started/installation.md @@ -5,9 +5,9 @@ order: 100 ## Requirements -1. PHP 8.1+ -2. Laravel 10 or higher -3. Node 20+ +1. PHP 8.3+ +2. Laravel 11 or higher +3. Node 22+ 4. Windows 10+ / macOS 12+ / Linux ### PHP & Node @@ -31,7 +31,8 @@ NativePHP is built to work best with Laravel. You can install it into an existin composer require nativephp/electron ``` -The Tauri runtime is coming soon. +This package contains all the classes, commands, and interfaces that your application will need to work with the +Electron runtime. ## Run the NativePHP installer diff --git a/resources/views/docs/1/getting-started/introduction.md b/resources/views/docs/desktop/1/getting-started/introduction.md similarity index 61% rename from resources/views/docs/1/getting-started/introduction.md rename to resources/views/docs/desktop/1/getting-started/introduction.md index 2ac6b5eb..b28ae448 100644 --- a/resources/views/docs/1/getting-started/introduction.md +++ b/resources/views/docs/desktop/1/getting-started/introduction.md @@ -14,33 +14,41 @@ Whatever your path, we think you're going to be productive quickly. NativePHP is taking the world by storm, enabling PHP developers to create true cross-platform, native apps using the tools and technologies they already know: HTML, CSS, Javascript, and, of course, PHP. -And they said PHP was dead. +## Why PHP? + +**PHP is great.** It's a mature language that has been honed for 30 years in one of the most ruthless environments: +the web. + +Despite the odds, it remains one of the most used languages worldwide and continues to grow in usage every day. + +Its shared-nothing approach to memory safety makes it an unexpectedly productive candidate for building native +applications. + +Its focus on HTTP as a paradigm for building applications lends itself towards using the incredibly +accessible web technologies to build rich UIs that can feel at home on any platform. ## What exactly is NativePHP? Strictly speaking, NativePHP is a combination of elements: -1. A collection of easy-to-use classes - abstractions - to enable you to interact with a variety of host operating -system features. -2. A set of tools to enable building and bundling your native application using either the Electron or Tauri browser -environment. -3. A static PHP runtime that allows your app to run on any user's system with zero effort on their part. +1. A collection of easy-to-use classes to enable you to interact with a variety of host operating system features. +2. A set of tools to enable building and bundling your native application. +3. A static PHP runtime that allows your app to run on any user's device with zero effort on their part. ## What NativePHP isn't -NativePHP is **not an especially opinionated way to build native apps**. Right now, **we only support a Laravel driver**, -but we'd love for it to work whatever PHP framework you're using - and even if you're not using a framework at all. -Can you help? Please consider [contributing](https://github.com/NativePHP/laravel/blob/main/CONTRIBUTING.md). +NativePHP is **not a completely new framework that you need to learn**. It builds on top of the incredible affordances +and ecosystem that Laravel provides. Before using NativePHP, you'll want to be familiar with building web applications +using Laravel. NativePHP is **not a GUI framework**. We don't want to tell you how to build your app. You can choose whatever UI toolset -makes you and your team feel most productive. - -Building a React front-end? No problem. Vue? Sure. Livewire or Inertia? Doesn't matter! Plain old HTML and CSS? -You got it. Tailwind? Bootstrap? Material UI? Whatever you want. +makes you and your team feel most productive. Building a React front-end? No problem. Vue? Sure. Livewire or Inertia? +Doesn't matter! Plain old HTML and CSS? You got it. Tailwind, Bootstrap, Material UI: whatever you want. NativePHP is **not some new, custom fork of PHP**. This is the good new PHP you know and love. -It's also not an extension that you need to figure out and install into PHP. +It's also not an extension that you need to figure out and install into PHP. You're just a `composer require` away from +awesome. ## What's in the box? @@ -64,12 +72,14 @@ that puts cowboy hats on every smiley-face emoji it sees. (You should totally build that last one.) +Need some inspiration? [Check out our repository of awesome projects](https://github.com/NativePHP/awesome-nativephp) created by people like you! + ## What's next? Go read the docs! We've tried to make them as comprehensive as possible, but if you find something missing, please feel free to [contribute](https://github.com/nativephp/nativephp.com). -This site and all the NativePHP repositories are open source and available on [GitHub](https://github.com/nativephp). +This site and all the NativePHP for desktop repositories are open source and available on [GitHub](https://github.com/nativephp). Ready to jump in? [Let's get started](installation). diff --git a/resources/views/docs/desktop/1/getting-started/releasenotes.md b/resources/views/docs/desktop/1/getting-started/releasenotes.md new file mode 100644 index 00000000..3c9d6436 --- /dev/null +++ b/resources/views/docs/desktop/1/getting-started/releasenotes.md @@ -0,0 +1,40 @@ +--- +title: Release Notes +order: 1100 +--- + +## NativePHP/electron +@forelse (\App\Support\GitHub::electron()->releases()->take(10) as $release) +### {{ $release->name }} +**Released: {{ \Carbon\Carbon::parse($release->published_at)->format('F j, Y') }}** + +{{ $release->getBodyForMarkdown() }} +--- +@empty +## We couldn't show you the latest release notes at this time. +Not to worry, you can head over to GitHub to see the [latest release notes](https://github.com/NativePHP/electron/releases). +@endforelse + +## NativePHP/laravel +@forelse (\App\Support\GitHub::laravel()->releases()->take(10) as $release) +### {{ $release->name }} +**Released: {{ \Carbon\Carbon::parse($release->published_at)->format('F j, Y') }}** + +{{ $release->getBodyForMarkdown() }} +--- +@empty +## We couldn't show you the latest release notes at this time. +Not to worry, you can head over to GitHub to see the [latest release notes](https://github.com/NativePHP/electron/releases). +@endforelse + +## NativePHP/php-bin +@forelse (\App\Support\GitHub::phpBin()->releases()->take(10) as $release) +### {{ $release->name }} +**Released: {{ \Carbon\Carbon::parse($release->published_at)->format('F j, Y') }}** + +{{ $release->getBodyForMarkdown() }} +--- +@empty +## We couldn't show you the latest release notes at this time. +Not to worry, you can head over to GitHub to see the [latest release notes](https://github.com/NativePHP/electron/releases). +@endforelse diff --git a/resources/views/docs/1/getting-started/sponsoring.md b/resources/views/docs/desktop/1/getting-started/sponsoring.md similarity index 85% rename from resources/views/docs/1/getting-started/sponsoring.md rename to resources/views/docs/desktop/1/getting-started/sponsoring.md index 0162a5f9..ddaa55b1 100644 --- a/resources/views/docs/1/getting-started/sponsoring.md +++ b/resources/views/docs/desktop/1/getting-started/sponsoring.md @@ -26,10 +26,10 @@ goes a long way in defraying the expenses of working for free to keep this proje Together, we can continue to grow NativePHP and ensure it remains a valuable tool for the community. -## Early Access Program +## NativePHP for mobile -If you're interested in NativePHP for mobile, you can get access right now via the [Early Access Program](/ios). We are -already working on NativePHP for iOS and your support will help us speed up development. +If you're interested in NativePHP for mobile, you can get access right now via the [Early Access Program](/mobile). +NativePHP is already working on iOS and Android is in active development. Your support will help us continue. ## Corporate Partners @@ -37,4 +37,4 @@ If your organization is using NativePHP, we strongly encourage you to consider a support will provide your team with the added benefits of increased levels of support, hands-on help directly from the maintainers of NativePHP and promotion of your brand as a supporter of cutting-edge open source work. -For more details, please email [nativephp@simonhamp.me](mailto:nativephp@simonhamp.me?subject=Corporate%20Sponsorship). +For more details, please email [partners@nativephp.com](mailto:partners@nativephp.com?subject=Corporate%20Sponsorship). diff --git a/resources/views/docs/desktop/1/getting-started/status.md b/resources/views/docs/desktop/1/getting-started/status.md new file mode 100644 index 00000000..c9f76a7c --- /dev/null +++ b/resources/views/docs/desktop/1/getting-started/status.md @@ -0,0 +1,28 @@ +--- +title: Roadmap +order: 099 +--- + +## Roadmap + +We're currently focused on reaching the next minor release. + +## Current Status + +NativePHP for desktop is **production-ready**. So you should feel completely ready to build and distribute apps +with NativePHP. + +But we always need your help! If you spot any bugs or feel that there are any features missing, be sure to share +your ideas and questions through the [forum](https://github.com/orgs/nativephp/discussions), by +[raising issues](https://github.com/nativephp/laravel/issues/new/choose)/reporting bugs, and discussing on +[Discord](https://discord.gg/X62tWNStZK). + + diff --git a/resources/views/docs/desktop/1/getting-started/support-policy.md b/resources/views/docs/desktop/1/getting-started/support-policy.md new file mode 100644 index 00000000..d5ed95e3 --- /dev/null +++ b/resources/views/docs/desktop/1/getting-started/support-policy.md @@ -0,0 +1,37 @@ +--- +title: Support Policy +order: 500 +--- + +## Support Policy + +NativePHP for Desktop is an open-source project dedicated to providing robust and reliable releases. + +We are committed to supporting the two latest PHP versions, ensuring that our users benefit from the latest features, security updates, and performance improvements. + +__We do not remove support for a PHP version without a major version release.__ + +Additionally, we support each Laravel version until it reaches its official end of life (EOL), ensuring that your applications can remain up-to-date. + +Our support policy reflects our commitment to maintaining high standards of quality and security, providing our users with the confidence they need to build and deploy their applications using NativePHP for Desktop. + +### PHP Versions +| NativePHP Version | Supported PHP Versions | +|-------------------|------------------------| +| ^1.0 | 8.3, 8.4 | + +[PHP: Supported Versions](https://www.php.net/supported-versions.php) + +NativePHP provides methods of bundling your own static PHP binaries. Support is not provided for these. + +### Laravel Versions +| NativePHP Version | Supported Laravel Versions | +|-------------------|----------------------------| +| ^1.0 | 11.x, 12.x | + +[Laravel: Support Policy](https://laravel.com/docs/master/releases#support-policy) + +## Requesting Support +Support can be obtained by opening an issue on the [NativePHP/laravel]({{ $githubLink }}/laravel/issues) repository or by joining the [Discord]({{ $discordLink }}). + +When requesting support, it is requested that you are using a supported version. If you are not, you will be asked to upgrade to a supported version before any support is provided. diff --git a/resources/views/docs/1/publishing/_index.md b/resources/views/docs/desktop/1/publishing/_index.md similarity index 100% rename from resources/views/docs/1/publishing/_index.md rename to resources/views/docs/desktop/1/publishing/_index.md diff --git a/resources/views/docs/1/publishing/building.md b/resources/views/docs/desktop/1/publishing/building.md similarity index 86% rename from resources/views/docs/1/publishing/building.md rename to resources/views/docs/desktop/1/publishing/building.md index 18af3bdc..d18b166c 100644 --- a/resources/views/docs/1/publishing/building.md +++ b/resources/views/docs/desktop/1/publishing/building.md @@ -25,6 +25,25 @@ your app to provide automatic updates. You should build your application for each platform you intend to support and test it on each platform _before_ publishing to make sure that everything works as expected. +### Running commands before and after builds +Many applications rely on a tool such as [Vite](https://vitejs.dev/) or [Webpack](https://webpack.js.org/) to compile their CSS and JS assets before a production build. + +To facilitate this, NativePHP provides two hooks that you can use to run commands before and after the build process. + +To utilise these hooks, add the following to your `config/nativephp.php` file: + +```php +'prebuild' => [ + 'npm run build', // Run a command before the build + 'php artisan optimize', // Run another command before the build +], +'postbuild' => [ + 'npm run release', // Run a command after the build +], +``` + +These commands will be run in the root of your project directory and you can specify as many as required. + ## Versioning For every build you create, you should change the version of your application in your app's `config/nativephp.php` file. diff --git a/resources/views/docs/1/publishing/publishing.md b/resources/views/docs/desktop/1/publishing/publishing.md similarity index 55% rename from resources/views/docs/1/publishing/publishing.md rename to resources/views/docs/desktop/1/publishing/publishing.md index 27e6eea9..1a66662f 100644 --- a/resources/views/docs/1/publishing/publishing.md +++ b/resources/views/docs/desktop/1/publishing/publishing.md @@ -2,6 +2,7 @@ title: Publishing order: 200 --- + ## Publishing Your App Publishing your app is similar to building, but in addition NativePHP will upload the build artifacts to your chosen @@ -15,6 +16,8 @@ php artisan native:publish This will build for the platform and architecture where you are running the build. +**Make sure you've bumped your app version in your .env file before building** + ### Cross-compilation You can also specify a platform to build for by passing the `os` argument, so for example you could build for Windows @@ -27,3 +30,11 @@ php artisan native:publish win Possible options are: `mac`, `win`, `linux`. **Cross-compilation is not supported on all platforms.** + +### GitHub Releases + +If you use the GitHub [updater provider](/docs/publishing/updating), you'll need to create a draft release first. + +Set the "Tag version" to the value of `version` in your application `.env` file, and prefix it with v. "Release title" can be anything you want. + +Whenever you run `native:publish`, your build artifacts will be attached to your draft release. If you decide to rebuild before tagging the release, it will update the artifacts attached to your draft. diff --git a/resources/views/docs/1/publishing/updating.md b/resources/views/docs/desktop/1/publishing/updating.md similarity index 100% rename from resources/views/docs/1/publishing/updating.md rename to resources/views/docs/desktop/1/publishing/updating.md diff --git a/resources/views/docs/1/testing/_index.md b/resources/views/docs/desktop/1/testing/_index.md similarity index 100% rename from resources/views/docs/1/testing/_index.md rename to resources/views/docs/desktop/1/testing/_index.md diff --git a/resources/views/docs/1/testing/basics.md b/resources/views/docs/desktop/1/testing/basics.md similarity index 100% rename from resources/views/docs/1/testing/basics.md rename to resources/views/docs/desktop/1/testing/basics.md diff --git a/resources/views/docs/1/testing/child-process.md b/resources/views/docs/desktop/1/testing/child-process.md similarity index 100% rename from resources/views/docs/1/testing/child-process.md rename to resources/views/docs/desktop/1/testing/child-process.md diff --git a/resources/views/docs/1/testing/global-shortcut.md b/resources/views/docs/desktop/1/testing/global-shortcut.md similarity index 100% rename from resources/views/docs/1/testing/global-shortcut.md rename to resources/views/docs/desktop/1/testing/global-shortcut.md diff --git a/resources/views/docs/1/testing/power-monitor.md b/resources/views/docs/desktop/1/testing/power-monitor.md similarity index 100% rename from resources/views/docs/1/testing/power-monitor.md rename to resources/views/docs/desktop/1/testing/power-monitor.md diff --git a/resources/views/docs/1/testing/queue-worker.md b/resources/views/docs/desktop/1/testing/queue-worker.md similarity index 100% rename from resources/views/docs/1/testing/queue-worker.md rename to resources/views/docs/desktop/1/testing/queue-worker.md diff --git a/resources/views/docs/1/testing/windows.md b/resources/views/docs/desktop/1/testing/windows.md similarity index 100% rename from resources/views/docs/1/testing/windows.md rename to resources/views/docs/desktop/1/testing/windows.md diff --git a/resources/views/docs/1/the-basics/_index.md b/resources/views/docs/desktop/1/the-basics/_index.md similarity index 100% rename from resources/views/docs/1/the-basics/_index.md rename to resources/views/docs/desktop/1/the-basics/_index.md diff --git a/resources/views/docs/desktop/1/the-basics/alerts.md b/resources/views/docs/desktop/1/the-basics/alerts.md new file mode 100644 index 00000000..fa7d4b61 --- /dev/null +++ b/resources/views/docs/desktop/1/the-basics/alerts.md @@ -0,0 +1,118 @@ +--- +title: Alerts +order: 410 +--- + +## Native Alerts + +NativePHP allows you to show native alerts to the user. They can be used to display messages, ask for confirmation, or +report an error. + +Alerts are created using the `Alert` facade. + +```php +use Native\Laravel\Facades\Alert; +``` + +### Showing Alerts + +To show an alert, you may use the `Alert` class and its `show()` method. + +```php +Alert::new() + ->show('This is a simple alert'); +``` + +## Configuring Alerts + +### Alert Title + +You may set the title of the alert using the `title()` method. + +```php +Alert::new() + ->title('Pizza Order') + ->show('Your pizza has been ordered'); +``` + +### Alert Buttons + +You may configure the buttons of the alert using the `buttons()` method. +This method takes an array of button labels. + +The return value of the `show()` method is the index of the button that the user clicked. +Example: If the user clicks the "Yes" button, the `show()` method will return `0`. If the user clicks the "Maybe" +button, the `show()` method will return `2`. + +If no buttons are defined, the alert will only have an "OK" button. + +```php +Alert::new() + ->buttons(['Yes', 'No', 'Maybe']) + ->show('Do you like pizza?'); +``` + +### Alert Detail + +You may set the detail of the alert using the `detail()` method. +The detail is displayed below the message and provides additional information about the alert. + +```php +Alert::new() + ->detail('Fun facts: Pizza was first made in Naples in 1889') + ->show('Do you like pizza?'); +``` + +### Alert Type + +You may set the type of the alert using the `type()` method. +The type can be one of the following values: `none`, `info`, `warning`, `error`, `question`. On Windows, `question` +displays the same icon as `info`. On macOS, both `warning` and `error` display the same warning icon. + +```php +Alert::new() + ->type('error') + ->show('An error occurred'); +``` + +### Alert Default Button + +You may set the default button of the alert using the `defaultId()` method. +The default button is preselected when the alert appears. + +The default button can be set to the index of the button in the `buttons()` array. + +```php +Alert::new() + ->defaultId(0) + ->buttons(['Yes', 'No', 'Maybe']) + ->show('Do you like pizza?'); +``` + +### Alert Cancel Button + +You may set the cancel button of the alert using the `cancelId()` method. +The cancel button is the button that is selected when the user presses the "Escape" key. + +The cancel button can be set to the index of the button in the `buttons()` array. + +By default, this is assigned to the first button labeled 'Cancel' or 'No'. If no such buttons exist and this option is +not set, the return value will be `0`. + +```php +Alert::new() + ->cancelId(1) + ->buttons(['Yes', 'No', 'Maybe']) + ->show('Do you like pizza?'); +``` + +### Error Alerts + +You may use the `error()` method to display an error alert. + +The `error()` method takes two required parameters: the title of the error alert and the message of the error alert. + +```php +Alert::new() + ->error('An error occurred', 'The pizza oven is broken'); +``` diff --git a/resources/views/docs/1/the-basics/app-lifecycle.md b/resources/views/docs/desktop/1/the-basics/app-lifecycle.md similarity index 100% rename from resources/views/docs/1/the-basics/app-lifecycle.md rename to resources/views/docs/desktop/1/the-basics/app-lifecycle.md diff --git a/resources/views/docs/1/the-basics/application-menu.md b/resources/views/docs/desktop/1/the-basics/application-menu.md similarity index 100% rename from resources/views/docs/1/the-basics/application-menu.md rename to resources/views/docs/desktop/1/the-basics/application-menu.md diff --git a/resources/views/docs/desktop/1/the-basics/application.md b/resources/views/docs/desktop/1/the-basics/application.md new file mode 100644 index 00000000..c5c05df6 --- /dev/null +++ b/resources/views/docs/desktop/1/the-basics/application.md @@ -0,0 +1,128 @@ +--- +title: Application +order: 250 +--- + +## Application + +The `App` facade allows you to perform basic operations with the Electron app. + +Note: Some methods are only available on specific operating systems and are labeled as such. + +To use the `App` facade, add the following to the top of your file: + +```php +use Native\Laravel\Facades\App; +``` + +### Quit the app + +To quit the app, use the `quit` method: + +```php +App::quit(); +``` + +### Focus the app + +To focus the app, use the `focus` method. + +On Linux, it focuses on the first visible window. On macOS, it makes the application the active one. On Windows, it +focuses on the application's first window. + +```php +App::focus(); +``` + +### Hide the app +_Only available on macOS_ + +The `hide` method will hide all application windows without minimizing them. This method is only available on macOS. + +```php +App::hide(); +``` + +### Check if the app is hidden +_Only available on macOS_ + +To check if the app is hidden, use the `isHidden` method. This method is only available on macOS. + +Returns a boolean: `true` if the application—including all its windows—is hidden (e.g., with Command-H), `false` +otherwise. + +```php +$isHidden = App::isHidden(); +``` + +### Current Version + +To get the current app version, use the `version` method. The version is defined in the `config/nativephp.php` file. + +```php +$version = App::version(); +``` + +### App Badge Count +_Only available on macOS and Linux_ + +You can set the app's badge count. +On macOS, it shows on the dock icon. On Linux, it only works for Unity launcher. + +To set the badge count, use the `badgeCount` method: + +```php +App::badgeCount(5); +``` + +To remove the badge count, use the `badgeCount` method with `0` as the argument: + +```php +App::badgeCount(0); +``` + +To get the badge count, use the `badgeCount` method without any arguments: + +```php +$badgeCount = App::badgeCount(); +``` + +### Recent documents list +_Only available on macOS and Windows_ + +The recent documents list is a list of files that the user has recently opened. This list is available on macOS and +Windows. + +To add a document to the recent documents list, use the `addRecentDocument` method: + +```php +App::addRecentDocument('/path/to/document'); +``` + +To clear the recent documents list, use the `clearRecentDocuments` method: + +```php +App::clearRecentDocuments(); +``` + +### Open at login +_Only available on macOS and Windows_ + +To enable 'open at login', use the `openAtLogin` method: + +```php +App::openAtLogin(true); +``` + +To disable open at login, use the `openAtLogin` method with `false` as the argument: + +```php +App::openAtLogin(false); +``` + +To check if the app is set to open at login, use the `openAtLogin` method without any arguments: + +```php +$isOpenAtLogin = App::openAtLogin(); +``` + diff --git a/resources/views/docs/1/the-basics/clipboard.md b/resources/views/docs/desktop/1/the-basics/clipboard.md similarity index 100% rename from resources/views/docs/1/the-basics/clipboard.md rename to resources/views/docs/desktop/1/the-basics/clipboard.md diff --git a/resources/views/docs/1/the-basics/dialogs.md b/resources/views/docs/desktop/1/the-basics/dialogs.md similarity index 100% rename from resources/views/docs/1/the-basics/dialogs.md rename to resources/views/docs/desktop/1/the-basics/dialogs.md diff --git a/resources/views/docs/1/the-basics/global-hotkeys.md b/resources/views/docs/desktop/1/the-basics/global-hotkeys.md similarity index 100% rename from resources/views/docs/1/the-basics/global-hotkeys.md rename to resources/views/docs/desktop/1/the-basics/global-hotkeys.md diff --git a/resources/views/docs/1/the-basics/menu-bar.md b/resources/views/docs/desktop/1/the-basics/menu-bar.md similarity index 100% rename from resources/views/docs/1/the-basics/menu-bar.md rename to resources/views/docs/desktop/1/the-basics/menu-bar.md diff --git a/resources/views/docs/desktop/1/the-basics/notifications.md b/resources/views/docs/desktop/1/the-basics/notifications.md new file mode 100644 index 00000000..f3ecf303 --- /dev/null +++ b/resources/views/docs/desktop/1/the-basics/notifications.md @@ -0,0 +1,182 @@ +--- +title: Notifications +order: 500 +--- + +## Native Notifications + +NativePHP allows you to send system notifications using an elegant PHP API. These notifications are, unlike Laravel's built-in notifications, actual UI notifications displayed by your operating system. + +When used sparingly, notifications can be a great way to inform the user about events that are occurring in your application and to bring their attention back to it, especially if further input from them is required. + +Notifications are sent using the `Notification` facade. + +```php +use Native\Laravel\Facades\Notification; +``` + +### Sending Notifications + +You may send a notification using the `Notification` facade. + +```php +Notification::title('Hello from NativePHP') + ->message('This is a detail message coming from your Laravel app.') + ->show(); +``` + +This will show a system-wide notification to the user with the given title and message. + +### Handling clicks on notifications + +You may register a custom event along with your NativePHP notification. +This event will be fired when a user clicks on the notification, so that you may add some custom logic within your application in this scenario. + +To attach an event to your notification, you may use the `event` method. The argument passed to this method is the class name of the event that should get dispatched upon clicking on the notification. + +```php +Notification::title('Hello from NativePHP') + ->message('This is a detail message coming from your Laravel app.') + ->event(\App\Events\MyNotificationEvent::class) + ->show(); +``` + +### Notification References + +To keep track of different notifications, you may use the notification's `$reference` property. + +By default, a unique reference is generated for you, but you may manually set a reference by [chaining the `reference()`](#notification-reference) method when creating +the notification. + +## Configuring Notifications + +### Notification Title + +You may set the notification's title using the `title()` method. + +```php +Notification::title('Hello from NativePHP') + ->show(); +``` + +### Notification Reference + +You can access the `$reference` property of a notification after it has been created: + +```php +$notification = Notification::title('Hello from NativePHP')->show(); + +$notification->reference; +``` + +You may chain the `reference()` method to set a custom reference when creating a notification: + +```php +Notification::title('Hello from NativePHP') + ->reference(Str::uuid()) + ->show(); +``` + +The reference will be sent along with any event triggered by the notification and can be used to track which specific notification was clicked: + +```php +use App\Events\PostNotificationClicked; +use App\Models\Post; + +Post::recentlyCreated() + ->get() + ->each(function(Post $post) { + Notification::title('New post: ' . $post->title) + ->reference($post->id) + ->event(PostNotificationClicked::class) + ->show(); + }); + +Event::listen(PostNotificationClicked::class, function (PostNotificationClicked $event) { + $post = Post::findOrFail($event->reference); + + Window::open()->url($post->url); +}); +``` + +### Notification Message + +You may set the notification's message using the `message()` method. + +```php +Notification::title('Hello from NativePHP') + ->message('This is a detail message coming from your Laravel app.') + ->show(); +``` + +### Notification Reply + +On macOS, you can allow the user to reply to a notification using the `hasReply()` method. + +```php +Notification::title('Hello from NativePHP') + ->hasReply() + ->show(); +``` + +The `hasReply()` method accepts a placeholder reply message as an argument. + +```php +Notification::title('Hello from NativePHP') + ->hasReply('This is a placeholder') + ->show(); +``` + +### Notification Actions + +On macOS, you can add action buttons to a notification using the `addAction()` method. + +```php +Notification::title('Hello from NativePHP') + ->addAction('Click here') + ->show(); +``` + +You can call the `addAction()` method multiple times if you need to add multiple buttons. + +```php +Notification::title('Hello from NativePHP') + ->addAction('Button One') + ->addAction('Button Two') + ->show(); +``` + +When an action button is clicked, it will trigger the [`NotificationActionClicked`](#codenotificationactionclickedcode) event. + +This event contains an `$index` property, which refers to the index of the action button that was clicked. Action button indexes start at `0`: + +```php +use Native\Laravel\Events\Notifications\NotificationActionClicked; + +Notification::title('Do you accept?') + ->addAction('Accept') // This action will be $index = 0 + ->addAction('Decline') // This action will be $index = 1 + ->show(); + +Event::listen(NotificationActionClicked::class, function (NotificationActionClicked $event) { + if ($event->index === 0) { + // 'Accept' clicked + } elseif ($event->index === 1) { + // 'Decline' clicked + } +}); +``` + +## Events + +### `NotificationClicked` +The `Native\Laravel\Events\Notifications\NotificationClicked` event is dispatched when a user clicks on a notification. + +### `NotificationClosed` +The `Native\Laravel\Events\Notifications\NotificationClosed` event is dispatched when a user closes a notification. + +### `NotificationReply` +The `Native\Laravel\Events\Notifications\NotificationReply` event is dispatched when a user replies to a notification. + +### `NotificationActionClicked` +The `Native\Laravel\Events\Notifications\NotificationActionClicked` event is dispatched when a user clicks an action button on a notification. diff --git a/resources/views/docs/1/the-basics/power-monitor.md b/resources/views/docs/desktop/1/the-basics/power-monitor.md similarity index 100% rename from resources/views/docs/1/the-basics/power-monitor.md rename to resources/views/docs/desktop/1/the-basics/power-monitor.md diff --git a/resources/views/docs/1/the-basics/screens.md b/resources/views/docs/desktop/1/the-basics/screens.md similarity index 100% rename from resources/views/docs/1/the-basics/screens.md rename to resources/views/docs/desktop/1/the-basics/screens.md diff --git a/resources/views/docs/1/the-basics/settings.md b/resources/views/docs/desktop/1/the-basics/settings.md similarity index 100% rename from resources/views/docs/1/the-basics/settings.md rename to resources/views/docs/desktop/1/the-basics/settings.md diff --git a/resources/views/docs/1/the-basics/shell.md b/resources/views/docs/desktop/1/the-basics/shell.md similarity index 100% rename from resources/views/docs/1/the-basics/shell.md rename to resources/views/docs/desktop/1/the-basics/shell.md diff --git a/resources/views/docs/1/the-basics/system.md b/resources/views/docs/desktop/1/the-basics/system.md similarity index 84% rename from resources/views/docs/1/the-basics/system.md rename to resources/views/docs/desktop/1/the-basics/system.md index b1cbe022..38674211 100644 --- a/resources/views/docs/1/the-basics/system.md +++ b/resources/views/docs/desktop/1/the-basics/system.md @@ -2,10 +2,11 @@ title: System order: 800 --- + ## The System One of the main advantages of building a native application is having more direct access to system resources, such as -peripherals connected to the physical device and APIs that aren't typically accessible inside a browser's sandbox. +peripherals connected to the physical device and APIs that aren't typically accessible inside a browser's sandbox. NativePHP makes it trivial to access these resources and APIs. @@ -19,6 +20,7 @@ While some features are platform-specific, NativePHP gracefully handles this for about whether something is Linux-, Mac-, or Windows-only. Most of the system-related features are available through the `System` facade. + ```php use Native\Laravel\Facades\System; ``` @@ -123,7 +125,8 @@ You can also print directly to PDF: System::printToPDF('...'); ``` -This returns the PDF data in a `base64_encoded` binary string. So be sure to `base64_decode` it before storing it to disk: +This returns the PDF data in a `base64_encoded` binary string. So be sure to `base64_decode` it before storing it to +disk: ```php use Illuminate\Support\Facades\Storage; @@ -160,3 +163,25 @@ $timezone = System::timezone(); // $timezone => 'Europe/London' ``` + +## Theme + +NativePHP allows you to detect the current theme of the user's operating system. This is useful for applications that +want to adapt their UI to match the user's preferences. +You can use the `System::theme()` method to get the current theme of the user's operating system. + +```php +$theme = System::theme(); +// $theme => SystemThemesEnum::LIGHT, SystemThemesEnum::DARK or SystemThemesEnum::SYSTEM +``` + +You can also set the theme of your application using the `System::theme()` method. This will change the theme of your +application to the specified value. The available options are `SystemThemesEnum::LIGHT`, `SystemThemesEnum::DARK` and +`SystemThemesEnum::SYSTEM`. + +```php +System::theme(SystemThemesEnum::DARK); +``` + +Setting the theme to `SystemThemesEnum::SYSTEM` will remove the override and everything will be reset to the OS default. +By default themeSource is `SystemThemesEnum::SYSTEM`. diff --git a/resources/views/docs/1/the-basics/windows.md b/resources/views/docs/desktop/1/the-basics/windows.md similarity index 100% rename from resources/views/docs/1/the-basics/windows.md rename to resources/views/docs/desktop/1/the-basics/windows.md diff --git a/resources/views/docs/index.blade.php b/resources/views/docs/index.blade.php index 674ca1a2..93d8afc7 100644 --- a/resources/views/docs/index.blade.php +++ b/resources/views/docs/index.blade.php @@ -4,57 +4,99 @@ - + -

- {{$title}} +

+ {{ $title }}

- + - + - @if (count($tableOfContents) > 0) - - @endif + {{-- Table of contents --}} +
+

+ {{-- Icon --}} + + {{-- Label --}} +
On this page
+

+ @if (count($tableOfContents) > 0) + + @endif +
-
+
{!! $content !!}
- + + + @php + $linkAlign = $previousPage === null ? 'right' : 'between'; + @endphp - @php $linkAlign = $previousPage === null ? 'right' : 'between'; @endphp - - @if($previousPage !== null) + + @if ($previousPage !== null) - Previous page: - - {{ $previousPage['title'] }} +
+
+ +
Previous
+
+
{{ $previousPage['title'] }}
+
@endif - @if($nextPage !== null) + + @if ($nextPage !== null) - Next page: - {{ $nextPage['title'] }} - +
+
+
Next
+ +
+
{{ $nextPage['title'] }}
+
@endif
- - -
- +
+ Edit this page on GitHub
- diff --git a/resources/views/docs/mobile/1/_index.md b/resources/views/docs/mobile/1/_index.md new file mode 100644 index 00000000..e69de29b diff --git a/resources/views/docs/mobile/1/digging-deeper/_index.md b/resources/views/docs/mobile/1/digging-deeper/_index.md new file mode 100644 index 00000000..7d67168d --- /dev/null +++ b/resources/views/docs/mobile/1/digging-deeper/_index.md @@ -0,0 +1,4 @@ +--- +title: Digging Deeper +order: 3 +--- diff --git a/resources/views/docs/mobile/1/digging-deeper/databases.md b/resources/views/docs/mobile/1/digging-deeper/databases.md new file mode 100644 index 00000000..fdccaf8f --- /dev/null +++ b/resources/views/docs/mobile/1/digging-deeper/databases.md @@ -0,0 +1,33 @@ +--- +title: Databases +order: 200 +--- + +## Working with Databases + +You'll almost certainly want your application to persist structured data. For this, NativePHP supports +[SQLite](https://sqlite.org/), which works on both iOS and Android devices. + +You can interact with SQLite from PHP in whichever way you're used to. + +## Configuration + +You do not need to do anything special to configure your application to use SQLite. NativePHP will automatically: +- Switch to using SQLite when building your application. +- Create the database for you in the app container. +- Run your migrations each time your app starts, as needed. + +## Migrations + +When writing migrations, you need to consider any special recommendations for working with SQLite. + +For example, prior to Laravel 11, SQLite foreign key constraints are turned off by default. If your application relies +upon foreign key constraints, [you need to enable SQLite support for them](https://laravel.com/docs/database#configuration) before running your migrations. + +**It's important to test your migrations on prod builds before releasing updates!** You don't want to accidentally +delete your user's data when they update your app. + +## Things to note + +- As your app is installed on a separate device, you do not have remote access to the database. +- If a user deletes your application from their device, any databases are also deleted. diff --git a/resources/views/docs/mobile/1/digging-deeper/push-notifications.md b/resources/views/docs/mobile/1/digging-deeper/push-notifications.md new file mode 100644 index 00000000..a1b47a3a --- /dev/null +++ b/resources/views/docs/mobile/1/digging-deeper/push-notifications.md @@ -0,0 +1,96 @@ +--- +title: Push Notifications +order: 400 +--- + + +## Overview + +NativePHP for Mobile uses [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) to send push notifications to your users. + +## Setting up your app + +Once you create a Firebase account and create a project you will be offered to download a `google-services.json` file. + +This file contains the configuration for your app and is used by the Firebase SDK to retrieve tokens for each device using your app. + +Simply drag this file into the root of your Laravel project, enable `push_notifications` in the [config](/docs/mobile/1/getting-started/configuration) it will be used automatically. + +You will see more instructions on how to configure your app in the Firebase documentation, you can ignore all of those, NativePHP handles all of that for you. + +## Receiving Push Tokens + +To receive push notifications, you must register a listener for the event. For example, +take a look at how easy it is to listen for a `TokenGenerated` event in Livewire: + +```php +use Livewire\Attributes\On; +use Livewire\Component; +use Native\Mobile\Facades\System; +use Native\Mobile\Events\PushNotification\TokenGenerated; + +class PushNotifications extends Component +{ + public function render() + { + return view('livewire.system.push-notifications'); + } + + #[On('native:' . TokenGenerated::class)] + public function handlePushNotifications(string $token) + { + // Do something with the token... + } +} +``` + +Because of the nature of mobile applications you need an api server to handle these tokens. You can use Laravel's built-in `Http` facade to +`POST` the token to your server, on the server side you need to associate the token with the "user" that owns the device. + +We **strongly** recommend using [Sanctum](https://laravel.com/docs/12.x/sanctum#main-content) to handle this for you. + +## The flow + +Your app authenticates users against your own api server, when users create an account or login the server validates and authenticates the user and passes back a Sanctum token. + +The token is stored in your apps `session` and is used on subsequent requests to the api server. + +When a push notification is received, the token is sent to your api server and the server stores it for the user who sent it. + +> Optionally, you can have a `HasMany` relationship between your users and devices, +> this allows you to associate a device with a user and then use the device's token +> to send push notifications to that users devices. + +## Sending Push Notifications + +Once you have the token, you may use it from your server-based applications to trigger Push Notifications directly to +your user's device. We use a package like [google/apiclient](https://github.com/googleapis/google-api-php-client) to send the notifications. + +This is the exact code used by the NativePHP Kitchen Sink App (available soon on all app stores and GitHub): + +```php +Route::group(['middleware' => 'auth:sanctum'], function () { + Route::post('send-push-notification', PushNotificationController::class)->name('send-push-notification'); +}); +``` + +```php +namespace App\Http\Controllers; + +use App\Jobs\SendPushNotification; +use Illuminate\Http\Request; + +class PushNotificationController extends Controller +{ + public function __invoke(Request $request) + { + $token = $request->get('token'); + + $request->user()->update([ + 'push_token' => $token + ]); + + SendPushNotification::dispatch($token)->delay(now()->addMinutes(1)); + } +} +``` diff --git a/resources/views/docs/mobile/1/digging-deeper/security.md b/resources/views/docs/mobile/1/digging-deeper/security.md new file mode 100644 index 00000000..6b8254b3 --- /dev/null +++ b/resources/views/docs/mobile/1/digging-deeper/security.md @@ -0,0 +1,30 @@ +--- +title: Security +order: 400 +--- + +## Security + +Although NativePHP tries to make it as easy as possible to make your application secure, it is your responsibility to +protect your users. + +### Secrets and .env + +As your application is being installed on systems outside your/your organisation's control, it is important to think +of the environment that it's in as _potentially_ hostile, which is to say that any secrets, passwords or keys +could fall into the hands of someone who might try to abuse them. + +This means you should, where possible, use unique keys for each installation, preferring to generate these at first-run +or on every run rather than sharing the same key for every user across many installations. + +Especially if your application is communicating with any private APIs over the network, we highly recommend that your +application and any API use a robust and secure authentication protocol, such as OAuth2, that enables you to create and +distribute unique and expiring tokens (an expiration date less than 48 hours in the future is recommended) with a high +level of entropy, as this makes them hard to guess and hard to abuse. + +**Always use HTTPS.** + +If your application allows users to connect _their own_ API keys for a service, you should treat these keys with great +care. If you choose to store them anywhere (either in a [File](files) or +[Database](databases)), make sure you store them +[encrypted](../the-basics/system#encryption-decryption) and decrypt them only when needed. diff --git a/resources/views/docs/mobile/1/getting-started/_index.md b/resources/views/docs/mobile/1/getting-started/_index.md new file mode 100644 index 00000000..7f67f577 --- /dev/null +++ b/resources/views/docs/mobile/1/getting-started/_index.md @@ -0,0 +1,4 @@ +--- +title: Getting Started +order: 1 +--- diff --git a/resources/views/docs/mobile/1/getting-started/configuration.md b/resources/views/docs/mobile/1/getting-started/configuration.md new file mode 100644 index 00000000..c6cf39b2 --- /dev/null +++ b/resources/views/docs/mobile/1/getting-started/configuration.md @@ -0,0 +1,52 @@ +--- +title: Configuration +order: 200 +--- + +## Overview + +NativePHP for Mobile is designed so that most configuration happens **inside your Laravel application**, without requiring you to manually open Xcode or Android Studio. + +After installation, NativePHP sets up the necessary native scaffolding, but your primary interaction remains inside Laravel itself. + +This page explains the key configuration points you can control directly through Laravel. + +## The `nativephp.php` Config File + +The nativephp.php config file is where you can configure the native project for your application. + +NativePHP uses sensible defaults and makes several assumptions based on default installations for tools required to build and run apps from your computer. + +You can override these defaults by editing the `nativephp.php` config file in your Laravel project or changing environment variables. + +```dotenv +NATIVEPHP_APP_VERSION +NATIVEPHP_APP_VERSION_CODE +NATIVEPHP_APP_ID +NATIVEPHP_DEEPLINK_SCHEME +NATIVEPHP_DEEPLINK_HOST +NATIVEPHP_APP_AUTHOR +NATIVEPHP_GRADLE_PATH +NATIVEPHP_ANDROID_SDK_LOCATION +``` + +## Cleanup `env` keys + +The `cleanup_env_keys` array in the config file allows you to specify keys that should be removed from the `.env` file before bundling. +This is useful for removing sensitive information like API keys or other secrets. + +## Cleanup `exclude_files` + +The `cleanup_exclude_files` array in the config file allows you to specify files and folders that should be removed before bundling. +This is useful for removing files like logs or other temporary files. + +## Permissions +In general, the app stores don't want apps to request permissions that they don't need. +To enable some permissions your app needs you simply need to change their values in the permissions section. + +```dotenv +biometric +camera +nfc +push_notifications +``` diff --git a/resources/views/docs/mobile/1/getting-started/development.md b/resources/views/docs/mobile/1/getting-started/development.md new file mode 100644 index 00000000..0097512c --- /dev/null +++ b/resources/views/docs/mobile/1/getting-started/development.md @@ -0,0 +1,32 @@ +--- +title: Development +order: 300 +--- + + +## The `nativephp` Directory + +After running: `php artisan native:install` you’ll see a new `nativephp` directory at the root of your Laravel project as well as a `nativephp.php` config file in your config folder in the Laravel root. + +This folder contains all the native project files that NativePHP generates for you. + +You should not need to manually open or edit any native project files under normal circumstances. +NativePHP handles the heavy lifting for you. + +## NATIVEPHP_APP_VERSION + +The NATIVEPHP_APP_VERSION environment variable controls your app's versioning behavior. + +When building for Android, NativePHP first copies the relevant Laravel files into a temporary directory, zips them, and embeds the archive into the Android project. When the app boots, it checks the embedded version against the previously installed version. + +If the versions match, the app uses the existing files without re-extracting the archive. + +If the versions differ — or if the version is set to ***DEBUG*** — the app updates itself by re-extracting the new bundle. + +This mechanism ensures developers can iterate quickly during development, while providing a faster, more stable experience for end users once an app is published. + +> Rule of Thumb: +> During development, keep NATIVEPHP_APP_VERSION set to DEBUG to always refresh the app. +> When preparing a new release, update it to a semantic version (e.g., 1.2.3) to enable versioned updates for your users. + + diff --git a/resources/views/docs/mobile/1/getting-started/installation.md b/resources/views/docs/mobile/1/getting-started/installation.md new file mode 100644 index 00000000..8756d09b --- /dev/null +++ b/resources/views/docs/mobile/1/getting-started/installation.md @@ -0,0 +1,128 @@ +--- +title: Installation +order: 100 +--- + +## Requirements + +1. PHP 8.3+ +2. Laravel 10 or higher +3. An Apple Silicon Mac running macOS 12+ with Xcode 16+ +4. An active [Apple Developer account](https://developer.apple.com/) +5. [A NativePHP for mobile license](https://nativephp.com/mobile) +6. _Optional_ iOS device + + +#### For iOS +1. An Apple Mac (ideally Silicon) running macOS 12+ with Xcode 16+ +2. An active [Apple Developer account](https://developer.apple.com/) +3. You can download Xcode from the Mac App Store + +#### For Android +1. [Android Studio Giraffe (or later)](https://developer.android.com/studio) +2. The following environment variables set. +3. You should be able to successfully run `java -v` and `adb devices` from the terminal. +4. **Windows only**: You must have [7zip](https://www.7-zip.org/) installed. + +#### For macOS +```shell +export JAVA_HOME=$(/usr/libexec/java_home -v 17) // This isn't required if JAVA_HOME is already set in the Windows Env Variables +export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk +export PATH=$PATH:$JAVA_HOME/bin:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools +``` + +#### For Windows +```shell +set ANDROID_SDK_ROOT=C:\Users\yourname\AppData\Local\Android\Sdk +set PATH=%PATH%;%JAVA_HOME%\bin;%ANDROID_SDK_ROOT%\platform-tools + +# This isn't required if JAVA_HOME is already set in the Windows Env Variables +set JAVA_HOME=C:\Program Files\Microsoft\jdk-17.0.8.7-hotspot +``` + +> **Note** You cannot build iOS apps on Windows or Linux + +You don't _need_ a physical iOS/Android device to compile your application and test it for your app, as NativePHP for mobile supports +the iOS Simulator and Android emulators. However, we highly recommend that you test your application on a real device before submitting to the +App/Google Play Store. + +## Laravel + +NativePHP for mobile is built to work with Laravel. You can install it into an existing Laravel application, or +[start a new one](https://laravel.com/docs/installation). The most painless way to get PHP and Node up and running on your system is with +[Laravel Herd](https://herd.laravel.com). It's fast and free! + + +## Install NativePHP for mobile + +To make NativePHP for mobile a reality has taken a lot of work and will continue to require even more. For this reason, +it's not open source, and you are not free to distribute or modify its source code. + +Before you begin, you will need to purchase a license. +Licenses can be obtained [here](https://nativephp.com/mobile). + +Once you have your license, you will need to add the following to your `composer.json`: + +```json +"repositories": [ + { + "type": "composer", + "url": "https://nativephp.composer.sh" + } +], +``` + +Then run: +```shell +composer require nativephp/mobile +``` + +If this is the first time you're installing the package, you will be prompted to authenticate. Your username is the +email address you used when purchasing your license. Your password is your license key. + +This package contains all the libraries, classes, commands, and interfaces that your application will need to work with +iOS and Android. + +**Before** running the `install` command it is important to set the following variables in your `.env`: + +```shell +NATIVEPHP_APP_ID=com.nativephp.yourapp +NATIVEPHP_APP_VERSION="DEBUG" +NATIVEPHP_APP_VERSION_CODE="1" +``` + +## Run the NativePHP installer + +```shell +php artisan native:install +``` + +The NativePHP installer works similarly to NativePHP for desktop, taking care of setting up and configuring your Laravel +application to work with iOS and/or Android. + +## Start your app + +**Heads up!** Before starting your app in a native context, try running it in the browser. You may bump into exceptions +which need addressing before you can run your app natively, and may be trickier to spot when doing so. + +Once you're ready: + +```shell +php artisan native:run +``` + +This will start compiling your application and boot it on whichever device you select. + +### Running on a real device + +#### For iOS +If you want to run your app on a real mobile device, you need to make sure the device is in +[Developer Mode](https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device) +and that it's been added to your Apple Developer account as +[a registered device](https://developer.apple.com/account/resources/devices/list). + +#### For Android +On Android you need to [enable developer options](https://developer.android.com/studio/debug/dev-options#enable) +and have USB debugging (ADB) enabled. + +And that's it! You should now see your Laravel application running as a native app! 🎉 diff --git a/resources/views/docs/mobile/1/getting-started/introduction.md b/resources/views/docs/mobile/1/getting-started/introduction.md new file mode 100644 index 00000000..8217636c --- /dev/null +++ b/resources/views/docs/mobile/1/getting-started/introduction.md @@ -0,0 +1,53 @@ +--- +title: Introduction +order: 001 +--- + +## Welcome to the revolution! + +NativePHP for mobile is a first of its kind library that allows PHP developers to run PHP applications natively on +all sorts of mobile devices _without a web server_. + +We've combined the statically compiling PHP as an embeddable C library with the flexibility of Laravel and the rich +native APIs of each support platform, unlocking the power and convenience of Laravel for building performant, native +_mobile_ applications using PHP. + +**It's never been this easy to build beautiful, local-first apps for iOS and Android.** + +## Old tools, new tricks + +With NativePHP for mobile, you don't have to learn any new languages or ecosystems. Stop fighting with other package +managers and build tools. Stay in the comfort of PHP and Composer! + +PHP developers all over the world are building incredible mobile experiences with the skills they already possess. +In just a few hours you can build an app and have it submitted to the app stores for review. + +## How does it work? + +On the simplest level: + +1. A statically-compiled version of PHP is bundled with your code into a Swift/Kotlin shell application. +2. NativePHP's custom Swift/Kotlin bridges manage the PHP environment, running your PHP code directly. +3. A custom PHP extension is compiled into PHP, that exposes PHP interfaces to native functions. +4. Your app renders in a native web view, so you can continue developing your UI the way you're used to. + +You simply interact with an easy-to-use set of functions from PHP and everything just works! + +## Batteries included + +NativePHP for mobile is way more than just a web view wrapper for your server-based application. Your application lives +_on device_ and is shipped with each installation. + +Thanks to our custom PHP extension, you can interact with many native APIs today, with more coming each week, including: + +- Camera & Microphone +- Biometric ID +- Vibration +- Accelerometer, GPS and other sensors +- Push notifications, native alerts and other native UI elements + +You have the full power of PHP and Laravel at your fingertips... literally! And you're not sandboxed into the web view; +this goes way beyond what's possible with PWAs and WASM without any of the complexity... we've got full-cream PHP ready +to go! + +**What are you waiting for!? [Let's go!](installation)** diff --git a/resources/views/docs/mobile/1/getting-started/roadmap.md b/resources/views/docs/mobile/1/getting-started/roadmap.md new file mode 100644 index 00000000..42df0293 --- /dev/null +++ b/resources/views/docs/mobile/1/getting-started/roadmap.md @@ -0,0 +1,55 @@ +--- +title: Roadmap +order: 099 +--- + +## Current Status + +NativePHP for mobile v1 is here. While we're still in the process of adding more and more +native API's and other features we believe it's robust enough to build useful applications that can be +distributed to users. + +Presently, NativePHP for mobile offers the following "native" functionality: + +- Vibrate +- Show Toasts +- Show Alerts +- Share +- Camera +- Flashlight +- Biometric ID +- Push Notifications +- Deep Links +- NFC + +We're working on adding more and more features, including (in no particular order): + - Secure Storage + - Microphone access + - Location + - Bluetooth + - SMS (Android only) + - File picker + - Video camera access + - Document scanner + - Background tasks + - Geofencing + - Native image picker + - Calendar access + - Local notifications, scheduled notifications + - Clipboard API + - Contacts access + - App badges + - OTA Updates + - App review prompt + - Proximity sensor + - Gyroscope + - Accelerometer + - Screen brightness + - Haptic feedback + - Network info access + - Battery status + - CPU information + - Ads + - In-app billing + - Splash screen + diff --git a/resources/views/docs/mobile/1/the-basics/_index.md b/resources/views/docs/mobile/1/the-basics/_index.md new file mode 100644 index 00000000..e8a6458a --- /dev/null +++ b/resources/views/docs/mobile/1/the-basics/_index.md @@ -0,0 +1,4 @@ +--- +title: The Basics +order: 2 +--- diff --git a/resources/views/docs/mobile/1/the-basics/deep-links.md b/resources/views/docs/mobile/1/the-basics/deep-links.md new file mode 100644 index 00000000..7be701b6 --- /dev/null +++ b/resources/views/docs/mobile/1/the-basics/deep-links.md @@ -0,0 +1,109 @@ +--- +title: Deep, Universal, App Links and NFC +order: 900 +--- + +## Overview + +NativePHP for Mobile supports both **deep linking** and **web-based linking** into your mobile apps. + +There are two types of link integrations you can configure: + +- **Deep Links** (myapp://some/path) +- **Universal Links (iOS)** and **App Links (Android)** (https://example.net/some/path) + +Each method has its use case, and NativePHP allows you to configure and handle both easily. + +--- + +## Deep Links + +Deep links use a **custom URL scheme** to open your app. + +For example: + +``` +myapp://profile/123 +``` + + +When a user taps a deep link, the mobile operating system detects the custom scheme and opens your app directly. + +### Configuration + +To enable deep linking, you must define: + +- **Scheme**: The protocol (e.g., myapp) +- **Host**: An optional domain-like segment (e.g., open) + +These are configured in your .env: + +```dotenv +NATIVEPHP_DEEPLINK_SCHEME=myapp +NATIVEPHP_DEEPLINK_HOST=open +``` + +## Universal Links (iOS) and App Links (Android) + +Universal Links and App Links allow real HTTPS URLs to open your app instead of a web browser, if the app is installed. + +For example: +```dotenv +https://example.net/property/456 +``` + +When a user taps this link: + + - If your app is installed, it opens directly into the app. + - If not, it opens normally in the browser. + +This provides a seamless user experience without needing a custom scheme. + +### How It Works +1. You must prove to iOS and Android that you own the domain by hosting a special file: + - .well-known/apple-app-site-association (for iOS) + - .well-known/assetlinks.json (for Android) +2. The mobile OS reads these files to verify the link association. +3. Once verified, tapping a real URL will open your app instead of Safari or Chrome. + +NativePHP for Mobile handles all of this for you. + +### Configuration + +To enable Universal Links and App Links, you must define: + +- **Host**: The domain name (e.g., example.net) + +These are configured in your .env: + +```dotenv +NATIVEPHP_DEEPLINK_HOST=example.net +``` + +## Handling Universal/App Links + +Once you've configured your deep link settings, you can handle the link in your app. + +Simply set up a route in your web.php file and the deeplink will redirect to your route. + +```dotenv +https://example.net/profile/123 +``` + +```php +Route::get('/profile/{id}', function ($id) { + // Handle the deep link +}); +``` + +## NFC +NFC is a technology that allows you to read and write NFC tags. + +NativePHP handles NFC tag "bumping" just like a Universal/App Link. +You can use a tool like [NFC Tools](https://www.wakdev.com/en/) to test write NFC tags. + +Set the url to a Universal/App Link and the tag will be written to the NFC tag. +"Bumping" the tag will open the app. + + + diff --git a/resources/views/docs/mobile/1/the-basics/dialogs.md b/resources/views/docs/mobile/1/the-basics/dialogs.md new file mode 100644 index 00000000..a7e35836 --- /dev/null +++ b/resources/views/docs/mobile/1/the-basics/dialogs.md @@ -0,0 +1,39 @@ +--- +title: Dialogs +order: 400 +--- + +## Native Dialogs + +NativePHP allows you to trigger many native dialogs. + +Dialogs are created using the `Dialog` facade. + +```php +use Native\Mobile\Facades\Dialog; +``` + +### The Share Dialog + +You may open the native share dialog by using the `Dialog::share()` method. + +```php +Dialog::share('Title', 'Description', 'URL'); +``` + +### The Alert Dialog + +You may open a native alert dialog by using the `Dialog::alert()` method. + +```php +Dialog::alert('Title', 'Message'); +``` + +### The Toast Dialog + +You may open a native toast dialog by using the `Dialog::toast()` method. There is not a toast dialog on iOS, +on iOS we will simply show an Alert Dialog with just an `OK` button. + +```php +Dialog::toast('Message'); +``` diff --git a/resources/views/docs/mobile/1/the-basics/native-functions.md b/resources/views/docs/mobile/1/the-basics/native-functions.md new file mode 100644 index 00000000..00326253 --- /dev/null +++ b/resources/views/docs/mobile/1/the-basics/native-functions.md @@ -0,0 +1,70 @@ +--- +title: Native Functions +order: 1 +--- + +Nearly any basic Laravel app will work as a mobile app with NativePHP for mobile. However, what makes NativePHP +unique is that it allows you to call native functions from your PHP code. + +These functions are called from your PHP code using one of an ever-growing list of facades. + +Currently, there are two facades available: + +- `Native\Mobile\Facades\System` +- `Native\Mobile\Facades\Dialog` + +## System + +The `System` facade is used to call native functions that access system resources. + +For example, you may use the `System::camera()` method to request access to the device's camera. + + +## Synchronous vs. Asynchronous Methods + +It is important to understand the difference between synchronous and asynchronous methods. Some methods +like `flashlight` and `vibrate` are synchronous, meaning that they will block the current thread until the +operation is complete. + +Other methods like `camera` and `biometric` are asynchronous, meaning that they +will return immediately and the operation will be performed in the background. When the operation is +complete, the method will `broadcast an event` to your frontend via an injected javascript event as well +as a traditional [Laravel Event](https://laravel.com/docs/12.x/events#main-content) that you can listen for within your app. + +In order to receive these events, you must register a listener for the event. For example, +take a look at how easy it is to listen for a `PhotoTaken` event in Livewire: + +```php +use Livewire\Attributes\On; +use Livewire\Component; +use Native\Mobile\Facades\System; +use Native\Mobile\Events\Camera\PhotoTaken; + +class Camera extends Component +{ + public string $photoDataUrl = ''; + + public function camera() + { + System::camera(); + } + + #[On('native:' . PhotoTaken::class)] + public function handleCamera($path) + { + $data = base64_encode(file_get_contents($path)); + $mime = mime_content_type($path); + + $this->photoDataUrl = "data:$mime;base64,$data"; + } + + public function render() + { + return view('livewire.system.camera'); + } +} +``` + +All Livewire/front end events are prefixed with `native:` to avoid collisions with other events. +In the following pages we will highlight the available native functions, whether they are asynchronous or not +and which events they fire. diff --git a/resources/views/docs/mobile/1/the-basics/system.md b/resources/views/docs/mobile/1/the-basics/system.md new file mode 100644 index 00000000..cc3236d3 --- /dev/null +++ b/resources/views/docs/mobile/1/the-basics/system.md @@ -0,0 +1,134 @@ +--- +title: System +order: 800 +--- + +## Native System + +NativePHP allows you to trigger many native system functions. + +System functions are called using the `System` facade. + +```php +use Native\Mobile\Facades\System; +``` +--- + +# Synchronous Functions +--- + +### Vibration + +You may vibrate the user's device by calling the `vibrate` method: + +```php +System::vibrate() +``` +--- +### Flashlight + +You may toggle the device flashlight (on/off) by calling the `flashlight` method: + +```php +System::flashlight() +``` +--- + +# Asynchronous Functions +--- + +### Camera +```php +Front End Event: `native:Native\Mobile\Events\Camera\PhotoTaken` +Back End Event: `Native\Mobile\Events\Camera\PhotoTaken` +``` + +You may request the native camera interface to take a photograph by calling the `System::camera()` method: + +When the user takes a photograph the event is fired with a payload array that contains one item: `path` +which is a string containing the path to the photo. + +```php +use Native\Mobile\Events\Camera\PhotoTaken; + +System::camera(); + +// Later... +#[On('native:' . PhotoTaken::class)] +public function handlePhotoTaken($path) +{ + $data = base64_encode(file_get_contents($path)); + $mime = mime_content_type($path); + + $this->photoDataUrl = "data:$mime;base64,$data"; +} +``` + +**Note: The first time your application asks to use the camera, the user will be prompted to grant permission. If they +decline, triggering the camera API will silently fail.** + +--- + +### Push Notifications +```php +Front End Event: `native:Native\Mobile\Events\PushNotification\TokenGenerated` +Back End Event: `Native\Mobile\Events\PushNotification\TokenGenerated` +``` +Currently, NativePHP uses [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) to send push notifications to your users. + +Simply use the `enrollForPushNotifications` method to trigger enrolment. If this is the first time that your app tries +to enrol this device for push notifications, the user will be presented with a native alert, allowing them to opt-in. + +Then use the `getPushNotificationsToken` method to retrieve the token. If enrolment was unsuccessful for some reason, +this method will return `null`. + +```php +use Native\Mobile\Events\PushNotification\TokenGenerated; + +System::enrollForPushNotifications(); + +// Later... +#[On('native:' . TokenGenerated::class)] +public function handlePushNotifications(string $token) +{ + // Do something with the token... +} +``` +Once you have the token, you may use it from your server-based applications to trigger Push Notifications directly to +your user's device. + +> Learn more about [what to do with push tokens here](/docs/mobile/1/digging-deeper/push-notifications). + +--- + +### Biometric ID +```php +Front End Event: `native:Native\Mobile\Events\Biometric\Completed` +Back End Event: `Native\Mobile\Events\Biometric\Completed` +``` + +For devices that support some form of biometric identification, you can use this to protect and unlock various parts +of your application. + +```php +use Native\Mobile\Events\Biometric\Completed; + +System::promptForBiometricID() + +// Later... +#[On('native:' . Completed::class)] +public function handleBiometricAuth(boolean $success) +{ + if ($success) { + // Do your super secret activity here + } +} +``` + +Using this, you can gate certain parts of your app, allowing you to offer an extra layer of protection for your user's +data. + +**Note: Despite the name, Biometric identification only gives you *greater confidence* that the person using your app +is *someone* who has the capacity to unlock the device your app is installed on. It does not allow you to *identify* +that user or prove that they are willingly taking this action.** + diff --git a/resources/views/early-adopter.blade.php b/resources/views/early-adopter.blade.php index befa878e..62dfb148 100644 --- a/resources/views/early-adopter.blade.php +++ b/resources/views/early-adopter.blade.php @@ -1,159 +1,906 @@ - - - -
-
- -

- NativePHP for - iOS - and - Android - is coming! + + {{-- Hero Section --}} +
+
+ {{-- Primary Heading --}} +

+ NativePHP for mobile +

+ + {{-- Introduction Description --}} +

+ This changes everything! Now you can use the tools you already + know to build rich, native, + mobile + apps... right now!

-

- Development of NativePHP for iOS has already started
and you can get access right now!

- Join the Early Access Program by
becoming a sponsor at $250 (one-off) or above. +

+ + {{-- Platform Cards --}} +
+ {{-- iOS Card --}} +
+
+ {{-- Subtitle --}} +

Available now for

+ {{-- Title --}} +

+ iOS +

+ {{-- Text --}} +

+ Join the Early Access Program and start developing iOS + apps today. +

+ {{-- Mockup --}} +
+ iOS phone mockup displaying a NativePHP application +
+ {{-- White blurred circle - Decorative --}} + + {{-- Blue blurred circle - Decorative --}} + +
+ + {{-- Blurred circle - Decorative --}} + +
+ + {{-- Android Card --}} +
+
+ {{-- Subtitle --}} +

Available now for

+ {{-- Title --}} +

+ Android +

+ {{-- Text --}} +

+ Sign up and build apps for Android today! +

+ {{-- Mockup --}} +
+ Android phone mockup displaying a NativePHP application +
+ {{-- White blurred circle - Decorative --}} + + {{-- Center blurred circle - Decorative --}} + +
+ + {{-- Blurred circle - Decorative --}} + +
+
+
+ + {{-- Quick Instructions Section --}} +
+
+ {{-- Section Heading --}} +

+ Quick instructions +

+ + {{-- Section Description --}} +

+ Get your app up and running in minutes.

-
+ + {{-- Installation Steps --}} +
+ {{-- Step 1 --}} +
+ {{-- Step number --}} +

+ Step 1 +

+ {{-- Step description --}} +

+ Buy a license. +

+ {{-- Box --}} +
+
+ {{-- Checkmark --}} + + {{-- Success message --}} +
+
+ Payment successful! +
+
+ You've purchased a license. +
+
+
+
+
+ + {{-- Step 2 --}} +
+ {{-- Step number --}} +

+ Step 2 +

+ {{-- Step description --}} +

+ Install the private Composer package. +

+ {{-- Box --}} +
+ {{-- Terminal --}} +
+
+ + + +
+
+
+ ~/native-php-app +
+
+ composer require nativephp/mobile +
+
+
+ {{-- Background image - Decorative --}} + +
-

- Not ready to join the EAP?
- Sign up for the newsletter to keep up with the - latest developments. + {{-- Step 3 --}} +

+ {{-- Step number --}} +

+ Step 3 +

+ {{-- Step description --}} +

+ Build your app. +

+ {{-- Box --}} +
+ {{-- Background image --}} + Developer holding a phone with NativePHP application +
+
+
+
+ + {{-- Pricing Section --}} + + + {{-- Ultra Section --}} +
+
+ {{-- Plan Name --}} +

+ Ultra +

+ + {{-- Price --}} + {{--
--}} + {{--
$20,000
--}} + {{--
per year
--}} + {{--
--}} + +

+ A partnership program offering dedicated support, training, + license management, early access to build services, and other + enterprise-oriented services for businesses.

+
-

+ + + {{-- Testimonials Section --}} + {{-- --}} + + {{-- FAQ Section --}} +
+ {{-- Section Heading --}} +

+ Frequently Asked Questions +

- -
-
-
-

Why Join the Early Access Program?

+ {{-- FAQ List --}} +
+

- Up to now, NativePHP has focused on Windows, Mac, and Linux. But we believe that breaking the mobile - frontier is what makes the project truly compelling... and cross-platform. + We want to build an amazing tool and make it sustainable. A + lot of NativePHP is already fully open source. With + NativePHP for mobile, we need to take a different path to + ensure that the entire project continues to get the support + it deserves.

+
+ +

- With significant progress already made towards enabling - NativePHP on iOS, we are excited about the possibilities that lie ahead. + Yes! Once we've hit sustainability and can afford to + continue investing in this project indirectly, then a + version of it will be fully open source and made available + for free.

+
+ +

- However, to make this vision a reality for both iOS and Android, we need your support. + Yes, a single license will let you build apps for both iOS + and Android.

+
+ + +

It's READY! Sign up and build apps for Android today!

+
+ + +

The EAP will end May 31, 2025.

+
+ +

- As an EAP member, you will be supporting the continued development of all of NativePHP, but - especially of NativePHP for mobile. + Your license will renew at the price you originally paid, as + long as you renew before it expires. If you renew after it + expires, then you will have to pay the prices available at + that time.

+
+ +

- You'll have the opportunity to influence the direction of the project and provide critical - feedback right from an early stage. + Yes. Renewing your license entitles you to receive the + latest package updates but isn't required to build and + release apps.

+
+ + +

That's not currently possible.

+
+

- You'll get exclusive access to all the latest features first and special treatment for the life of - the NativePHP project, a project we plan to be working on for a long time to come! + Definitely. NativePHP for mobile apps are just like other + iOS and Android apps - they're as secure as you make them.

+
+ {{-- --}} + {{--

--}} + {{--

--}} + {{--
--}} +

- Please join us on this exciting journey to expand NativePHP onto mobile platforms. -

-

- We can't wait to see what you build! + Absolutely! You can use NativePHP for any kind of project, + including commercial ones. We can't wait to see what you + build!

+
+

- Simon & Marcel
- Creators of NativePHP + If you purchased after May 6, 2025, you should get an + invoice with your receipt via email.

-
-
-
- - -
-
-
-

Early Access Program

-

- Program Benefits +

+ For purchases made before this, you simply need to + + follow the instructions here + + to generate your invoice.

- {{--

Quis tellus eget adipiscing convallis sit sit eget aliquet quis. Suspendisse eget egestas a elementum pulvinar et feugiat blandit at. In mi viverra elit nunc.

--}} -
- -
- -
-

- - Get the code! -

-
-

- You'll get early access to the code, documentation and more, and watch closely as it - evolves and start to build your projects before anyone else. -

-
-
- -
-

- - Access to an exclusive Discord channel -

-
-

- Decide the direction of the project and what gets worked on next. Plus have a direct - line of with the creators of NativePHP and other EAP members. -

-
-
- -
-

- - A lifetime of rewards and discounts -

-
-

- The NativePHP ecosystem is about to explode! There will be premium tools and - packages, starter kits and more. As an EAP member, you'll get you exclusive discounts - not available to anyone else. -

-
-
- -
-

- - Your name in NativePHP's history -

-
-

- All EAP members will be immortalized across the NativePHP ecosystem, showing the - rest of the community the valuable part you've played in supporting this project's - creation and and ongoing development. -

-
-
-
- - +
-
+
- + {{-- Why Join Program Section --}} +
+
+

+ Why Join the Early Access Program? +

+

+ From the beginning, NativePHP has been focused on Windows, Mac, + and Linux. Until now! +

+

+ We believe that breaking the mobile frontier is what makes this + project truly compelling... and truly cross-platform. +

+

+ With + NativePHP for mobile + , we are excited about the possibilities that lie ahead. +

+

+ However, to make this vision a reality for both iOS and Android, + we need your support. +

+

+ As an EAP member, you will be supporting the continued + development of all of NativePHP, but especially of NativePHP for + mobile. +

+

+ You'll have the opportunity to influence the direction of the + project and provide critical feedback right from an early stage. +

+

+ You'll get exclusive access to all the latest features first and + special perks for the life of the NativePHP project... a project + we plan to be working on for a long time to come! +

+

+ Please join us on this exciting journey to expand NativePHP onto + mobile platforms. +

+

We can't wait to see what you build!

+

+ + Simon, Shane, & Marcel + +
+ Creators of NativePHP +

+
+
diff --git a/resources/views/livewire/mobile-pricing.blade.php b/resources/views/livewire/mobile-pricing.blade.php new file mode 100644 index 00000000..2a13e8c6 --- /dev/null +++ b/resources/views/livewire/mobile-pricing.blade.php @@ -0,0 +1,608 @@ +
+
+ {{-- Section Heading --}} +

+ Purchase a license +

+ + {{-- Section Description --}} +

+ Start your journey to become a mobile developer +

+
+ + {{-- Pricing Plans --}} +
+ {{-- Mini Plan --}} +
+ {{-- Plan Name --}} +

+ Mini +

+ + {{-- Price --}} +
+
+ ${{ number_format(50) }} +
+
per year
+
+ + {{-- Warning --}} +
+
+ + @auth + + @else + + @endauth + + {{-- Features --}} +
+
+
+
+
+
+
+
+ + {{-- Divider - Decorative --}} + + + {{-- Perks --}} +
+
+ +
Community Discord channel
+
+
+ +
+ Your name in NativePHP's history +
+
+
+ +
Repo access
+
+
+ +
Help decide feature priority
+
+
+ +
Business hours support (GMT)
+
+
+
+ + {{-- Pro Plan --}} +
+ {{-- Plan Name --}} +

+ Pro +

+ + {{-- Price --}} +
+
+ ${{ number_format(150) }} +
+
per year
+
+ + {{-- Warning --}} +
+
+ + @auth + + @else + + @endauth + + {{-- Features --}} +
+
+
+
+
+
+
+
+ + {{-- Divider - Decorative --}} + + + {{-- Perks --}} +
+
+ +
Community support via Discord
+
+
+ +
+ Your name in NativePHP's history +
+
+
+ +
Repo access
+
+
+ +
Help decide feature priority
+
+
+ +
Business hours support (GMT)
+
+
+
+ + {{-- Max Plan - Most Popular --}} +
+ {{-- Popular badge --}} +
+ Most Popular +
+ + {{-- Plan Name --}} +

+ Max +

+ + {{-- Price --}} +
+
+ ${{ number_format(250) }} +
+
per year
+
+ + {{-- Warning --}} +
+
+ + @auth + + @else + + @endauth + + {{-- Features --}} +
+
+
+
+
+
+
+
+ + {{-- Divider - Decorative --}} + + + {{-- Perks --}} +
+
+ +
+ Exclusive access to private Discord channels +
+
+
+ +
Repo access
+
+
+ +
Help decide feature priority
+
+
+ +
Business hours support (GMT)
+
+
+ +
+ Your name in NativePHP's history +
+
+
+
+
+ @guest + + @endguest +
diff --git a/resources/views/livewire/order-success.blade.php b/resources/views/livewire/order-success.blade.php new file mode 100644 index 00000000..44d79889 --- /dev/null +++ b/resources/views/livewire/order-success.blade.php @@ -0,0 +1,520 @@ +
+ {{-- Hero Section --}} +
+
+ {{-- Primary Heading --}} +

+ You're In! +

+ + {{-- Introduction Description --}} +

+ We're excited to have you join the NativePHP community! +

+
+ + {{-- Success Card --}} +
+
+
+ + +
+
+ Payment Successful! +
+
+ You've purchased a license. +
+
+
+ +
+ @if ($licenseKey) +

+ License key +

+
+
+ + +
+
{{ $licenseKey }}
+
+

+ Store this somewhere safe. You'll need it later. +

+ @if ($email) +

+ Email +

+
+
+ + +
+
{{ $email }}
+
+ @endif + @else +
+
+
+
+ + License registration in progress + +
+

+ Please + + check your email + + shortly for a copy of your license key. This page + will also update if your license key is ready. +

+ +

+ Once you receive your license key, you can start + building amazing mobile apps with NativePHP! +

+ @endif +
+ + +
+ + + + + View Installation Guide +
+
+ + @if ($subscription === \App\Enums\Subscription::Max) +
+
+
+ +
+
+

+ Repo Access +

+
+

+ As a Max subscriber, you have access to + the NativePHP/mobile repository. To + access it, please log in to + + AnyStack.sh + using the same email address you used + for your purchase. +

+
+
+
+
+ @endif +
+
+ + {{-- Next Steps --}} + +
+
diff --git a/resources/views/livewire/purchase-modal.blade.php b/resources/views/livewire/purchase-modal.blade.php new file mode 100644 index 00000000..47ad209c --- /dev/null +++ b/resources/views/livewire/purchase-modal.blade.php @@ -0,0 +1,94 @@ +
+
+ +
+ +
+
+
+

+ Get Started with NativePHP +

+

+ Enter your email to continue to checkout +

+
+ +
+
+ + + @error('email') +

+ {{ $message }} +

+ @enderror +
+ +
+ + +
+
+
+
+
+
diff --git a/resources/views/partners.blade.php b/resources/views/partners.blade.php new file mode 100644 index 00000000..1bca9637 --- /dev/null +++ b/resources/views/partners.blade.php @@ -0,0 +1,544 @@ + + {{-- Hero Section --}} +
+
+

+ Partner + with NativePHP +

+ +

+ We're looking for business partners to support the development + of NativePHP technology. Join us in shaping the future of PHP + mobile app development. +

+ +
+ {{-- Primary CTA - Email --}} + + + + + + Contact Us + + + {{-- Secondary CTA - Calendar --}} + + + + + + + + Schedule a Meeting + +
+
+
+ + {{-- Partnership Details Section --}} +
+
+ {{-- Card 1 --}} +
+
+ + + +
+

Dedicated Support

+

+ Get priority access to our development team with dedicated + support channels and faster response times. +

+
+ + {{-- Card 2 --}} +
+
+ + + +
+

+ Priority Roadmap Influence +

+

+ Have a direct line to our development team with priority + influence over feature development to ensure your business + needs are met. +

+
+ + {{-- Card 3 --}} +
+
+ + + +
+

Training & Onboarding

+

+ Comprehensive training and onboarding for your development + team to get up to speed quickly. +

+
+ + {{-- Card 4 --}} +
+
+ + + +
+

Ultra Licensing

+

+ Receive an Ultra license for: unlimited published + applications, unlimited developers, and team management + tools. +

+
+ + {{-- Card 5 --}} +
+
+ + + +
+

Zephpyr Early Access

+

+ Early access to Zephpyr, our service that helps you build, + secure, and distribute your NativePHP applications. +

+
+ + {{-- Card 6 --}} +
+
+ + + +
+

Strategic Partnership

+

+ Become a strategic partner in the NativePHP ecosystem with + co-marketing opportunities. +

+
+
+
+ + {{-- Ideal Partners Section --}} +
+
+

Who Should Partner With Us?

+ +
+
+
+ + + +
+
+

+ App Development Companies +

+

+ Businesses building mobile applications that want to + leverage PHP and Laravel expertise. +

+
+
+ +
+
+ + + +
+
+

Digital Agencies

+

+ Agencies looking to expand their service offerings + with native mobile app development. +

+
+
+ +
+
+ + + +
+
+

+ Freelance Developers +

+

+ PHP/Laravel freelancers who want to offer native + mobile app development to their clients. +

+
+
+
+
+
+ + {{-- Call to Action Section --}} +
+
+

Ready to Partner With Us?

+ +

+ Contact our team to discuss how a partnership with NativePHP can + benefit your business and help you deliver exceptional mobile + applications. +

+ +
+ {{-- Primary CTA - Email --}} + + + + + + Contact Us + + + {{-- Secondary CTA - Calendar --}} + + + + + + + + Schedule a Meeting + +
+
+
+
diff --git a/resources/views/privacy-policy.blade.php b/resources/views/privacy-policy.blade.php new file mode 100644 index 00000000..fd0dcf3a --- /dev/null +++ b/resources/views/privacy-policy.blade.php @@ -0,0 +1,384 @@ + + {{-- Hero --}} +
+
+ {{-- Blurred circle - Decorative --}} + + + {{-- Primary Heading --}} +

+ Privacy Policy +

+ + {{-- Date --}} +
+ Last updated +
+
+ + {{-- Divider --}} + + + {{-- Content --}} +
+

+ Bifrost Technology, LLC operates the nativephp.com website, + which provides the Service. +

+ +

+ This page is used to inform website visitors regarding our + policies with the collection, use, and disclosure of Personal + Information if anyone decided to use our Service, the NativePHP + website. +

+ +

+ If you choose to use our Service, then you agree to the + collection and use of information in relation with this policy. + The Personal Information that we collect are used for providing + and improving the Service. We will not use or share your + information with anyone except as described in this Privacy + Policy. +

+ +

+ The terms used in this Privacy Policy have the same meanings as + in our + Terms of Service + , unless otherwise defined in this Privacy Policy. +

+ +

Owner Of The Website

+ +

+ Bifrost Technology, LLC +
+ 1111B S Governors Ave STE 2838 +
+ Dover +
+ Delaware +
+ 19904 +

+ +

support@nativephp.com

+ +

Information Collection and Use

+ +

+ For a better experience while using our Service, we may require + you to provide us with certain personally identifiable + information, including but not limited to your name and email. + We only ask for the essential information we need to operate. +

+ +

Log Data

+

+ We want to inform you that whenever you visit our Service, we + collect information that your browser sends to us that is called + Log Data. This Log Data may include information such as your + computer’s Internet Protocol ("IP") address, browser version, + pages of our Service that you visit, the time and date of your + visit, the time spent on those pages, and other statistics. +

+ +

Cookies

+

+ Cookies are files with small amount of data that is commonly + used an anonymous unique identifier. These are sent to your + browser from the website that you visit and are stored on your + computer’s hard drive. +

+ +

+ Our website uses these "cookies" to collection information and + to improve our Service. You have the option to either accept or + refuse these cookies, and know when a cookie is being sent to + your computer. If you choose to refuse our cookies, you may not + be able to use some portions of our Service. +

+ +

+ For more general information on cookies, please read + + https://www.cookiesandyou.com + + . +

+ +

Service Providers

+

+ We may employ third-party companies and individuals due to the + following reasons: +

+ +
    +
  • To facilitate our Service;
  • +
  • To provide the Service on our behalf;
  • +
  • To perform Service-related services;
  • +
  • or To assist us in analyzing how our Service is used.
  • +
+ +

+ We want to inform our Service users that these third parties + have access to your Personal Information. The reason is to + perform the tasks assigned to them on our behalf. However, they + are obligated not to disclose or use the information for any + other purpose. +

+ +

+ For further information, you should consult the privacy policies + of these third-parties directly. +

+ +

Security

+

+ We value your trust in providing us your Personal Information, + thus we are striving to use commercially acceptable means of + protecting it. But remember that no method of transmission over + the internet, or method of electronic storage is 100% secure and + reliable, and we cannot guarantee its absolute security. +

+ +

Links to Other Sites

+

+ Our Service may contain links to other sites. If you click on a + third-party link, you will be directed to that site. Note that + these external sites are not operated by us. Therefore, we + strongly advise you to review the Privacy Policy of these + websites. We have no control over, and assume no responsibility + for the content, privacy policies, or practices of any + third-party sites or services. +

+ +

Children's Privacy

+

+ Our Services do not address anyone under the age of 13. We do + not knowingly collect personal identifiable information from + children under 13. In the case we discover that a child under 13 + has provided us with personal information, we immediately delete + this from our servers. If you are a parent or guardian and you + are aware that your child has provided us with personal + information, please contact us so that we will be able to take + the necessary actions. +

+ +

Changes to This Privacy Policy

+

+ We may update our Privacy Policy from time to time. Thus, we + advise you to review this page periodically for any changes. We + will notify you of any changes by posting the new Privacy Policy + on this page. These changes are effective immediately, after + they are posted on this page. +

+ +

Cookie Policy

+

+ Bifrost Technology, LLC ("us", "we", or "our") uses cookies on + nativephp.com (the "Service"). By using the Service, you consent + to the use of cookies. +

+ +

+ Our Cookie Policy explains what cookies are, how we use cookies, + how third-parties we may partner with may use cookies on the + Service, your choices regarding cookies and further information + about cookies. +

+ +

What Are Cookies

+

+ Cookies are small pieces of text sent to your web browser by a + website you visit. A cookie file is stored in your web browser + and allows the Service or a third-party to recognize your + browser and make your next visit easier and the Service more + useful to you. +

+ +

+ Cookies can be "persistent" - they are persisted between + browsing sessions - or "session" cookies, which are deleted by + your browser when you end your session or after a certain time + limit. +

+ +

+ Cookies are associated with the browser, not the person, so they + do not usually store sensitive information about you such as + credit cards or bank details, photographs or personal + information etc. The data they keep are of a technical nature, + statistics, personal preferences, personalization of contents + etc. +

+ +

How We Use Cookies

+

+ When you use and access the Service, we may place a number of + cookie files in your web browser. +

+ +

We use cookies for the following purposes:

+
    +
  • to enable certain functions of the Service,
  • +
  • to provide analytics,
  • +
  • to store your preferences,
  • +
  • to enable advertisements delivery.
  • +
+ +

+ We use both session and persistent cookies on the Service and we + use different types of cookies to run the Service: +

+ +
    +
  • + Essential/Technical Cookies +

    + These allow the proper functioning of the web features. + Allow the user to navigate through a web page, platform + or application and the use of different options or + services that exist in it, such as controlling traffic + and data communication, identifying the session, access + restricted access parts, remember the elements that make + up an order, perform the purchase process of an order, + make the request for registration or participation in an + event, use security elements during navigation, store + contents for dissemination of videos or sound or share + content through social networks. +

    +
  • +
  • + Analysis Cookies +

    + Those that are well treated by us or by third parties, + allow us to quantify the number of users and thus + perform the measurement and statistical analysis of the + use made by users of the service offered. For this, your + browsing on our website is analyzed in order to improve + the offer of products or services we offer. +

    +
  • +
  • + Third-party Cookies +

    + The Site may use third-party services that, on behalf of + Google, will collect information for statistical + purposes, the use of the site by the user and for the + provision of other services related to the website + activity and other services from Internet. +

    +
  • +
+ +

Manage And Reject

+

+ At any time, you can adapt the browser settings to manage, + disregard the use of Cookies and be notified before they are + downloaded. +

+ +

+ If you'd like to delete cookies or instruct your web browser to + delete or refuse cookies, please visit the help pages of your + web browser. +

+ +

+ Please note, however, that if you delete cookies or refuse to + accept them, you might not be able to use all of the features we + offer, you may not be able to store your preferences, and some + of our pages might not display properly. +

+
+
+
diff --git a/resources/views/terms-of-service.blade.php b/resources/views/terms-of-service.blade.php new file mode 100644 index 00000000..3a2a67af --- /dev/null +++ b/resources/views/terms-of-service.blade.php @@ -0,0 +1,321 @@ + + {{-- Hero --}} +
+
+ {{-- Blurred circle - Decorative --}} + + + {{-- Primary Heading --}} +

+ Terms of Service +

+ + {{-- Date --}} +
+ Last updated +
+
+ + {{-- Divider --}} + + + {{-- Content --}} +
+

+ Please read these Terms of Service ("Terms", "Terms and + Conditions", "Terms of Use") carefully before using the + nativephp.com website (the "Service", "Platform") operated by + Bifrost Technology, LLC ("us", "we", or "our"). +

+ +

+ Your access to and use of the Service is conditional, based on + your acceptance of and compliance with these Terms. These Terms + apply to all visitors, users and others who access or use the + Service. +

+ +

+ By accessing or using the Service you agree to be bound by these + Terms. If you disagree with any part of the terms, you may not + access the Service. You should not create an account and you + should leave this website. +

+ +

Code Of Conduct

+
    +
  • No illegal activities
  • +
  • No fraud
  • +
  • No spam and data mining
  • +
  • No advertising
  • +
  • No exploitation
  • +
  • No impersonation
  • +
  • No activities related to bots
  • +
  • No use other than the intended
  • +
+ +

+ Any violation to this basic and common sense rules means the + deletion of your account and associated data. +

+ +

+ Whether conduct violates our Code of Conduct will be determined + in our sole discretion. +

+ +

Age Restriction

+

+ The platform is available to persons 18 years old or older. If + you are between 13 and 18 years old, you may still use the + Platform, but you must have a parent's or guardian's permission. +

+ +

+ By using the Platform, you confirm that you are least 18 years + old, or 13 years old with the permission of your parents or + guardians and that you can provide proof of this permission on + request. +

+ +

+ If you are under 13 years old, you may not use our Platform in + any manner. +

+ +

Intellectual Property

+

+ The content on the Platform, including all information, + software, technology, data, logos, marks, designs, text, + graphics, pictures, audio and video files, other data or + copyrightable materials or content, and their selection and + arrangement, is referred to herein as "NativePHP Content", and + is and remains the sole property of Bifrost Technology, LLC. + NativePHP Content, including our trademarks, may not be modified + by you in any way. +

+ +

Account Ownership

+ +

+ We have the right to request additional information from You to + determine account ownership. +

+ +

+ The information that We may request to assist in resolving + ownership disputes includes, but is not limited to, the + following: +

+
    +
  • A copy of Your photo ID
  • +
  • Your billing information and details
  • +
  • Certified copies of your tax forms
  • +
+ +

+ We reserve the right to determine the account ownership in its + sole judgment, and the ability to transfer the account to the + rightful owner, unless otherwise prohibited by law. +

+ +

Refund Policy

+

+ Due to the nature of the Service, no returns are accepted. + Refunds are offered on a case-by-case basis at our sole + discretion. +

+ +

Publicity

+

+ You grant Us the right to include Your company's name and/or + logo as a customer on our website and other advertising and + promotional materials. You may retract this right by giving + written notice to + support@nativephp.com + . +

+ +

+ Within thirty business days after such notice, We will remove + Your company's name from nativephp.com and will no longer + include the name/logo in any of Our advertising or promotional + materials. +

+ +

Cancellation And Deletion

+ +

+ If You cancel a paid plan, the cancellation will become + effective at the end of the then-current billing cycle. When You + cancel a paid plan, Your account will revert to a free account + and We may disable access to features available only to paid + plan users. +

+ +

You may delete Your account at any time.

+ +

+ Accounts on paid plans will be considered active accounts unless + You explicitly ask us to delete Your account. +

+ +

+ If Your account is deleted, Your Content may no longer be + available and all licenses granted will terminate. +

+ +

+ We are not responsible for the loss of such content upon + deletion. +

+ +

+ We shall not be liable to any party in any way for the inability + to access Content arising from any cancellation or deletion, + including any claims of interference with business or + contractual relations. +

+ +

Warranties

+

+ nativephp.com is provided as-is. We cannot guarantee that + unexpected errors will not prevent normal use of the Service and + that the software wil be accessible 100% of the time, although + every effort is made to reduce the likelihood of such issues. +

+ +

+ We reserve the right to amend the Platform, and any service or + material we provide on the Platform, in our sole discretion + without notice. We will not be liable if for any reason all or + any part of the Platform is unavailable at any time or for any + period. +

+ +

Changes

+

+ We reserve the right, at our sole discretion, to modify or + replace these Terms at any time. If a revision is made we will + try to provide at least 30 days notice prior to any new terms + taking effect. What constitutes a material change will be + determined at our sole discretion. +

+ +

Waivers

+

+ No delay or failure to exercise any right or remedy provided for + in this Agreement will be deemed to be a waiver. +

+ +

Severability

+

+ If any provision of this Agreement is held invalid or + unenforceable, for any reason, by any arbitrator, court or + governmental agency, department, body or tribunal, the remaining + provisions will remain in effect. +

+ +

Governing Law

+

+ This Agreement will be governed by and construed in accordance + with the laws of the United States of America. +

+ +

Contact

+

+ If you have any questions regarding these or the practices of + this Site, please contact us at + support@nativephp.com + . +

+
+
+
diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 921b2aa0..cad433b2 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -1,67 +1,1322 @@ - - - - - - - NativePHP | Baking Delicious Native Apps - - - - - - @vite(["resources/css/app.css", "resources/js/app.js"]) - - - - - - - - -
-
- - -

NativePHP

-

- NativePHP is a new way to build native applications, - - using the tools you already know. -

-
- - Get started + + {{-- Hero --}} +
+ {{-- Header --}} +
+ {{-- Build --}} +

+ Build + Native PHP Apps +

+ {{-- Native --}} +
+ {{-- PHP Apps --}} +

+ PHP Apps +

+ + {{-- Shiny line --}} + +
+ + {{-- Simon talk for mobile --}} + + + {{-- Description --}} +

+ Bring your + + PHP + + & + + Laravel + + skills to the world of + + desktop & mobile apps + + . + + Build cross-platform applications effortlessly—no extra tools, just + the stack you love. +

+ + {{-- Call to Action Button --}} + +
+ + {{-- Collaborations --}} +
+

+ A collaboration between: +

+ + {{-- Cards --}} +
+ {{-- Simon card --}} +
+
+ {{-- Shape --}} + + + {{-- Name --}} +

+ Simon +
+ Hamp +

+ + {{-- Title --}} +
+ +

+ Developer & Artisan — + + LaraDevs + +

+
-
-

Featured Sponsors

+ {{-- Dashed line --}} + + + {{-- Image --}} + Simon Hamp - Creator of NativePHP and founder of LaraDevs
+ {{-- Marcel card --}} +
+ {{-- Image --}} + Marcel Pociot - Creator of NativePHP and CTO of BeyondCode + +
+ {{-- Shape --}} + + + {{-- Name --}} +

+ Marcel +
+ Pociot +

-

Corporate Sponsors

+ {{-- Title --}} +
+ +

+ CTO & Cofounder — + + BeyondCode + +

+
-
- + {{-- Dashed line --}} + +
+
+ +

+ + Many community contributors: +

- - Want your logo here? + {{-- Contributors List --}} + -
+ - -
+ {{-- Marcel talk --}} +
+
+ {{-- Left side --}} +
+
+ Laracon US Talk +
+

+ Where did this come from? +

- - +

+ Watch Marcel's original NativePHP talk from Laracon US 2023 + in Nashville. Minds were blown as he demonstrated how to use + Laravel to build cross-platform desktop applications. +

+
+ + {{-- Right side --}} + +
+
+ + {{-- Sponsors --}} +
+

+ NativePHP Sponsors +

+
+ {{-- Featured sponsors --}} +
+ +
+ +
+
+ {{-- Corporate sponsors --}} +
+

+ Corporate Sponsors +

+
+ +
+
+
+ +
+ diff --git a/routes/web.php b/routes/web.php index 1a185d10..5b2be5c1 100644 --- a/routes/web.php +++ b/routes/web.php @@ -19,10 +19,23 @@ Route::redirect('/sponsor', '/docs/1/getting-started/sponsoring'); Route::view('/', 'welcome')->name('welcome'); -Route::view('ios', 'early-adopter')->name('early-adopter'); +Route::view('/blog', 'blog')->name('blog'); +Route::view('/article', 'article')->name('article'); +Route::view('mobile', 'early-adopter')->name('early-adopter'); +Route::redirect('ios', 'mobile'); +Route::redirect('t-shirt', 'mobile'); +Route::redirect('tshirt', 'mobile'); +Route::view('privacy-policy', 'privacy-policy'); +Route::view('terms-of-service', 'terms-of-service'); +Route::view('partners', 'partners')->name('partners'); + +Route::redirect('/docs/{version}/{page?}', '/docs/desktop/{version}/{page?}') + ->where('page', '(.*)') + ->where('version', '[0-9]+'); -Route::get('/docs/{version}/{page?}', ShowDocumentationController::class) +Route::get('/docs/{platform}/{version}/{page?}', ShowDocumentationController::class) ->where('page', '(.*)') + ->where('platform', '[a-z]+') ->where('version', '[0-9]+'); // Forward unversioned requests to the latest version @@ -42,3 +55,5 @@ return redirect("/docs/{$version}/{$page}"); })->name('docs')->where('page', '.*'); + +Route::get('/order/{checkoutSessionId}', App\Livewire\OrderSuccess::class)->name('order.success'); diff --git a/tailwind.config.js b/tailwind.config.js index edee5462..f9636bf6 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,24 +1,34 @@ -import defaultTheme from "tailwindcss/defaultTheme"; - /** @type {import('tailwindcss').Config} */ +const { fontFamily } = require('tailwindcss/defaultTheme') + export default { + darkMode: 'selector', + content: [ - "./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php", - "./storage/framework/views/*.php", - "./resources/views/**/*.blade.php", - "./app/**/*.php", - // "./app/Extensions/**/*.php", + './resources/**/*.{js,blade.php}', + './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php', + './storage/framework/views/*.php', + './app/**/*.php', + './vendor/filament/**/*.blade.php', ], safelist: ['inline', 'text-red-600', 'mr-2', 'font-bold', 'no-underline'], theme: { + extend: { + colors: { + mirage: '#141624', + haiti: '#16182C', + cloud: '#2b2e53', + }, + fontFamily: { + poppins: "'Poppins', Verdana, sans-serif", + }, + }, container: { center: true, }, }, - plugins: [ - require('@tailwindcss/typography'), - ], -}; + plugins: [require('@tailwindcss/typography'), require('@tailwindcss/forms')], +} diff --git a/tests/Feature/Actions/Licenses/SuspendLicenseTest.php b/tests/Feature/Actions/Licenses/SuspendLicenseTest.php new file mode 100644 index 00000000..4f04c869 --- /dev/null +++ b/tests/Feature/Actions/Licenses/SuspendLicenseTest.php @@ -0,0 +1,67 @@ + Http::response([ + 'data' => [ + 'id' => 'license-123', + 'suspended' => true, + ], + ], 200), + ]); + + $license = License::factory()->create([ + 'anystack_id' => 'license-123', + 'policy_name' => 'max', + 'is_suspended' => false, + ]); + + $action = app(SuspendLicense::class); + $result = $action->handle($license); + + $this->assertTrue($license->fresh()->is_suspended); + + Http::assertSent(function ($request) use ($license) { + return str_contains($request->url(), '/products/') && + str_contains($request->url(), "/licenses/{$license->anystack_id}") && + $request->method() === 'PATCH' && + $request->data() === ['suspended' => true]; + }); + } + + #[Test] + public function it_fails_when_api_call_fails() + { + Http::fake([ + 'https://api.anystack.sh/v1/products/*/licenses/*' => Http::response([], 500), + ]); + + $license = License::factory()->create([ + 'anystack_id' => 'license-123', + 'policy_name' => 'max', + 'is_suspended' => false, + ]); + + $this->expectException(\Illuminate\Http\Client\RequestException::class); + + $action = app(SuspendLicense::class); + $result = $action->handle($license); + + $this->assertFalse($license->fresh()->is_suspended); + } +} diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php deleted file mode 100644 index 8364a84e..00000000 --- a/tests/Feature/ExampleTest.php +++ /dev/null @@ -1,19 +0,0 @@ -get('/'); - - $response->assertStatus(200); - } -} diff --git a/tests/Feature/Jobs/CreateAnystackLicenseJobTest.php b/tests/Feature/Jobs/CreateAnystackLicenseJobTest.php new file mode 100644 index 00000000..8a269cba --- /dev/null +++ b/tests/Feature/Jobs/CreateAnystackLicenseJobTest.php @@ -0,0 +1,248 @@ +now = now()->toImmutable(); + + Http::fake([ + 'https://api.anystack.sh/v1/contacts' => Http::response([ + 'data' => [ + 'id' => 'contact-123', + 'email' => 'test@example.com', + 'first_name' => 'John', + 'last_name' => 'Doe', + 'created_at' => $this->now->toIso8601String(), + 'updated_at' => $this->now->toIso8601String(), + ], + ], 201), + + 'https://api.anystack.sh/v1/products/*/licenses' => Http::response([ + 'data' => [ + 'id' => 'license-123', + 'key' => 'test-license-key-12345', + 'contact_id' => 'contact-123', + 'policy_id' => 'policy-123', + 'name' => null, + 'activations' => 0, + 'max_activations' => 10, + 'suspended' => false, + 'expires_at' => $this->now->addYear()->toIso8601String(), + 'created_at' => $this->now->toIso8601String(), + 'updated_at' => $this->now->toIso8601String(), + ], + ], 201), + ]); + + Notification::fake(); + } + + /** @test */ + public function it_creates_a_contact_and_license_on_anystack_via_api() + { + $user = User::factory()->create([ + 'email' => 'test@example.com', + 'name' => 'John Doe', + ]); + + $job = new CreateAnystackLicenseJob( + $user, + Subscription::Max, + null, + 'John', + 'Doe' + ); + + $job->handle(); + + Http::assertSent(function ($request) { + return $request->url() === 'https://api.anystack.sh/v1/contacts' && + $request->method() === 'POST' && + $request->data() === [ + 'first_name' => 'John', + 'last_name' => 'Doe', + 'email' => 'test@example.com', + ]; + }); + + $productId = Subscription::Max->anystackProductId(); + + Http::assertSent(function ($request) use ($productId) { + return $request->url() === "https://api.anystack.sh/v1/products/$productId/licenses" && + $request->method() === 'POST' && + $request->data() === [ + 'policy_id' => Subscription::Max->anystackPolicyId(), + 'contact_id' => 'contact-123', + ]; + }); + } + + /** @test */ + public function it_does_not_create_a_contact_when_the_user_already_has_a_contact_id() + { + $user = User::factory()->create([ + 'email' => 'test@example.com', + 'name' => 'John Doe', + 'anystack_contact_id' => 'contact-123', + ]); + + $job = new CreateAnystackLicenseJob( + $user, + Subscription::Max, + null, + 'John', + 'Doe' + ); + + $job->handle(); + + Http::assertNotSent(function ($request) { + return Str::contains($request->url(), 'https://api.anystack.sh/v1/contacts'); + }); + } + + /** @test */ + public function it_stores_the_license_key_in_database() + { + $user = User::factory()->create([ + 'email' => 'test@example.com', + 'name' => 'John Doe', + ]); + + $job = new CreateAnystackLicenseJob( + $user, + Subscription::Max, + null, + 'John', + 'Doe' + ); + + $job->handle(); + + $this->assertDatabaseHas('licenses', [ + 'anystack_id' => 'license-123', + 'user_id' => $user->id, + 'subscription_item_id' => null, + 'policy_name' => 'max', + 'key' => 'test-license-key-12345', + 'is_suspended' => false, + 'expires_at' => $this->now->addYear(), + 'created_at' => $this->now, + 'updated_at' => $this->now, + ]); + } + + /** @test */ + public function the_subscription_item_id_is_filled_when_provided() + { + $user = User::factory()->create([ + 'email' => 'test@example.com', + 'name' => 'John Doe', + ]); + + $job = new CreateAnystackLicenseJob( + $user, + Subscription::Max, + 123, + 'John', + 'Doe' + ); + + $job->handle(); + + $this->assertDatabaseHas('licenses', [ + 'user_id' => $user->id, + 'subscription_item_id' => 123, + 'policy_name' => 'max', + 'key' => 'test-license-key-12345', + 'is_suspended' => false, + 'expires_at' => $this->now->addYear(), + 'created_at' => $this->now, + 'updated_at' => $this->now, + ]); + } + + /** @test */ + public function it_sends_a_license_key_notification() + { + $user = User::factory()->create([ + 'email' => 'test@example.com', + 'name' => 'John Doe', + ]); + + $job = new CreateAnystackLicenseJob( + $user, + Subscription::Max, + null, + 'John', + 'Doe' + ); + + $job->handle(); + + Notification::assertSentTo( + $user, + function (LicenseKeyGenerated $notification, array $channels, object $notifiable) { + return $notification->licenseKey === 'test-license-key-12345' && + $notification->subscription === Subscription::Max && + $notification->firstName === 'John'; + } + ); + } + + /** @test */ + public function it_handles_missing_name_components() + { + $user = User::factory()->create([ + 'email' => 'test@example.com', + 'name' => null, + ]); + + // Create and run the job with missing name components + $job = new CreateAnystackLicenseJob( + $user, + Subscription::Max, + ); + + $job->handle(); + + // Assert HTTP request was made with correct data (no name components) + Http::assertSent(function ($request) { + return $request->url() === 'https://api.anystack.sh/v1/contacts' && + $request->method() === 'POST' && + $request->data() === [ + 'email' => 'test@example.com', + ]; + }); + + // Assert notification was sent with null firstName + Notification::assertSentTo( + $user, + function (LicenseKeyGenerated $notification, array $channels, object $notifiable) { + return $notification->licenseKey === 'test-license-key-12345' && + $notification->subscription === Subscription::Max && + $notification->firstName === null; + } + ); + } +} diff --git a/tests/Feature/Jobs/CreateUserFromStripeCustomerTest.php b/tests/Feature/Jobs/CreateUserFromStripeCustomerTest.php new file mode 100644 index 00000000..e2166db2 --- /dev/null +++ b/tests/Feature/Jobs/CreateUserFromStripeCustomerTest.php @@ -0,0 +1,118 @@ + 'cus_minimal123', + 'name' => 'Test User', + 'email' => 'test@example.com', + ]); + + $job = new CreateUserFromStripeCustomer($customer); + $job->handle(); + + $user = User::where('email', 'test@example.com')->first(); + + $this->assertNotNull($user); + $this->assertEquals('Test User', $user->name); + $this->assertEquals('test@example.com', $user->email); + $this->assertEquals('cus_minimal123', $user->stripe_id); + + $this->assertNotNull($user->password); + $this->assertTrue(Hash::isHashed($user->password)); + } + + /** @test */ + public function it_fails_when_a_user_with_the_same_stripe_id_already_exists() + { + $existingUser = User::factory()->create([ + 'stripe_id' => 'cus_existing123', + ]); + + $customer = Customer::constructFrom([ + 'id' => 'cus_existing123', + 'name' => 'Another User', + 'email' => 'another@example.com', + ]); + + $job = new CreateUserFromStripeCustomer($customer); + + $job->handle(); + + $this->assertDatabaseCount('users', 1); + $this->assertEquals($existingUser->id, User::first()->id); + } + + /** @test */ + public function it_fails_when_a_user_with_the_same_email_already_exists() + { + $existingUser = User::factory()->create([ + 'email' => 'existing@example.com', + ]); + + $customer = Customer::constructFrom([ + 'id' => 'cus_existing123', + 'name' => 'Another User', + 'email' => 'existing@example.com', + ]); + + $job = new CreateUserFromStripeCustomer($customer); + + $job->handle(); + + $this->assertDatabaseCount('users', 1); + $this->assertEquals($existingUser->id, User::first()->id); + } + + /** @test */ + public function it_handles_a_null_name_in_stripe_customer() + { + $customer = Customer::constructFrom([ + 'id' => 'cus_noname123', + 'name' => null, + 'email' => 'noname@example.com', + ]); + + $job = new CreateUserFromStripeCustomer($customer); + $job->handle(); + + $this->assertDatabaseHas('users', [ + 'name' => null, + 'email' => 'noname@example.com', + 'stripe_id' => 'cus_noname123', + ]); + } + + /** @test */ + public function it_fails_when_customer_has_no_email() + { + $customer = Customer::constructFrom([ + 'id' => 'cus_noemail123', + 'name' => 'No Email', + 'email' => '', + ]); + + $job = new CreateUserFromStripeCustomer($customer); + + $this->expectException(ValidationException::class); + + $job->handle(); + + $this->assertDatabaseCount('users', 0); + } +} diff --git a/tests/Feature/Jobs/HandleCustomerSubscriptionCreatedJobTest.php b/tests/Feature/Jobs/HandleCustomerSubscriptionCreatedJobTest.php new file mode 100644 index 00000000..f13e5d43 --- /dev/null +++ b/tests/Feature/Jobs/HandleCustomerSubscriptionCreatedJobTest.php @@ -0,0 +1,337 @@ +createTestData('John Doe'); + + Bus::fake(); + + $webhookCall = new WebhookHandled($this->getTestWebhookPayload()); + + $job = new HandleCustomerSubscriptionCreatedJob($webhookCall); + $job->handle(); + + Bus::assertDispatched(CreateAnystackLicenseJob::class, function (CreateAnystackLicenseJob $job) { + return $job->user instanceof User && + $job->user->email === 'test@example.com' && + $job->subscription === Subscription::Max && + $job->firstName === 'John' && + $job->lastName === 'Doe'; + }); + } + + /** + * @dataProvider customerNameProvider + * + * @test + */ + public function it_extracts_customer_name_parts_correctly($fullName, $expectedFirstName, $expectedLastName) + { + $this->createTestData($fullName); + + $webhookCall = new WebhookHandled($this->getTestWebhookPayload()); + + Bus::fake(); + + $job = new HandleCustomerSubscriptionCreatedJob($webhookCall); + $job->handle(); + + Bus::assertDispatched(CreateAnystackLicenseJob::class, function ($job) use ($expectedFirstName, $expectedLastName) { + return $job->firstName === $expectedFirstName && + $job->lastName === $expectedLastName; + }); + } + + /** + * Data provider for customer name tests + */ + public static function customerNameProvider() + { + return [ + 'Full name' => ['John Doe', 'John', 'Doe'], + 'First name only' => ['Jane', 'Jane', null], + 'Empty string' => ['', null, null], + 'Null value' => [null, null, null], + ]; + } + + /** @test */ + public function it_fails_when_customer_has_no_email() + { + $mockCustomer = Customer::constructFrom([ + 'id' => 'cus_S9dhoV2rJK2Auy', + 'email' => '', + 'name' => 'John Doe', + ]); + + $this->mockStripeClient($mockCustomer); + + User::factory()->create([ + 'stripe_id' => 'cus_S9dhoV2rJK2Auy', + 'name' => 'John Doe', + 'email' => '', + ]); + + Bus::fake(); + + $webhookCall = new WebhookHandled($this->getTestWebhookPayload()); + + $job = new HandleCustomerSubscriptionCreatedJob($webhookCall); + $job->handle(); + + Bus::assertNotDispatched(CreateAnystackLicenseJob::class); + } + + protected function createTestData(?string $customerName) + { + $mockCustomer = Customer::constructFrom([ + 'id' => $this->getTestWebhookPayload()['data']['object']['customer'], + 'email' => $email = 'test@example.com', + 'name' => $customerName, + ]); + + $this->mockStripeClient($mockCustomer); + + dispatch_sync(new CreateUserFromStripeCustomer($mockCustomer)); + + $user = User::query()->where('email', $email)->firstOrFail(); + + $subscription = \Laravel\Cashier\Subscription::factory() + ->for($user, 'user') + ->create([ + 'stripe_id' => $this->getTestWebhookPayload()['data']['object']['id'], + 'stripe_status' => 'active', + 'stripe_price' => $this->getTestWebhookPayload()['data']['object']['items']['data'][0]['price']['id'], + 'quantity' => 1, + ]); + $subscriptionItem = \Laravel\Cashier\SubscriptionItem::factory() + ->for($subscription, 'subscription') + ->create([ + 'stripe_id' => $this->getTestWebhookPayload()['data']['object']['items']['data'][0]['id'], + 'stripe_price' => $this->getTestWebhookPayload()['data']['object']['items']['data'][0]['price']['id'], + 'quantity' => 1, + ]); + } + + protected function getTestWebhookPayload(): array + { + return [ + 'type' => 'customer.subscription.created', + 'data' => [ + 'object' => [ + 'id' => 'sub_1RFKQDAyFo6rlwXq6Wuu642C', + 'object' => 'subscription', + 'application' => null, + 'application_fee_percent' => null, + 'automatic_tax' => [ + 'disabled_reason' => null, + 'enabled' => false, + 'liability' => null, + ], + 'billing_cycle_anchor' => 1745003875, + 'billing_cycle_anchor_config' => null, + 'billing_thresholds' => null, + 'cancel_at' => null, + 'cancel_at_period_end' => false, + 'canceled_at' => null, + 'cancellation_details' => [ + 'comment' => null, + 'feedback' => null, + 'reason' => null, + ], + 'collection_method' => 'charge_automatically', + 'created' => 1745003875, + 'currency' => 'usd', + 'current_period_end' => 1776539875, + 'current_period_start' => 1745003875, + 'customer' => 'cus_S9dhoV2rJK2Auy', + 'days_until_due' => null, + 'default_payment_method' => 'pm_1RFKQBAyFo6rlwXq0zprYwdm', + 'default_source' => null, + 'default_tax_rates' => [], + 'description' => null, + 'discount' => null, + 'discounts' => [], + 'ended_at' => null, + 'invoice_settings' => [ + 'account_tax_ids' => null, + 'issuer' => [ + 'type' => 'self', + ], + ], + 'items' => [ + 'object' => 'list', + 'data' => [ + [ + 'id' => 'si_S9dhjbP3rnMPYq', + 'object' => 'subscription_item', + 'billing_thresholds' => null, + 'created' => 1745003876, + 'current_period_end' => 1776539875, + 'current_period_start' => 1745003875, + 'discounts' => [], + 'metadata' => [], + 'plan' => [ + 'id' => Subscription::Max->stripePriceId(), + 'object' => 'plan', + 'active' => true, + 'aggregate_usage' => null, + 'amount' => 25000, + 'amount_decimal' => '25000', + 'billing_scheme' => 'per_unit', + 'created' => 1744986706, + 'currency' => 'usd', + 'interval' => 'year', + 'interval_count' => 1, + 'livemode' => false, + 'metadata' => [], + 'meter' => null, + 'nickname' => null, + 'product' => 'prod_S9Z5CgycbP7P4y', + 'tiers_mode' => null, + 'transform_usage' => null, + 'trial_period_days' => null, + 'usage_type' => 'licensed', + ], + 'price' => [ + 'id' => Subscription::Max->stripePriceId(), + 'object' => 'price', + 'active' => true, + 'billing_scheme' => 'per_unit', + 'created' => 1744986706, + 'currency' => 'usd', + 'custom_unit_amount' => null, + 'livemode' => false, + 'lookup_key' => null, + 'metadata' => [], + 'nickname' => null, + 'product' => 'prod_S9Z5CgycbP7P4y', + 'recurring' => [ + 'aggregate_usage' => null, + 'interval' => 'year', + 'interval_count' => 1, + 'meter' => null, + 'trial_period_days' => null, + 'usage_type' => 'licensed', + ], + 'tax_behavior' => 'unspecified', + 'tiers_mode' => null, + 'transform_quantity' => null, + 'type' => 'recurring', + 'unit_amount' => 25000, + 'unit_amount_decimal' => '25000', + ], + 'quantity' => 1, + 'subscription' => 'sub_1RFKQDAyFo6rlwXq6Wuu642C', + 'tax_rates' => [], + ], + ], + 'has_more' => false, + 'total_count' => 1, + 'url' => '/v1/subscription_items?subscription=sub_1RFKQDAyFo6rlwXq6Wuu642C', + ], + 'latest_invoice' => 'in_1RFKQEAyFo6rlwXqBa5IhGhF', + 'livemode' => false, + 'metadata' => [], + 'next_pending_invoice_item_invoice' => null, + 'on_behalf_of' => null, + 'pause_collection' => null, + 'payment_settings' => [ + 'payment_method_options' => [ + 'acss_debit' => null, + 'bancontact' => null, + 'card' => [ + 'network' => null, + 'request_three_d_secure' => 'automatic', + ], + 'customer_balance' => null, + 'konbini' => null, + 'sepa_debit' => null, + 'us_bank_account' => null, + ], + 'payment_method_types' => null, + 'save_default_payment_method' => 'off', + ], + 'pending_invoice_item_interval' => null, + 'pending_setup_intent' => null, + 'pending_update' => null, + 'plan' => [ + 'id' => Subscription::Max->stripePriceId(), + 'object' => 'plan', + 'active' => true, + 'aggregate_usage' => null, + 'amount' => 25000, + 'amount_decimal' => '25000', + 'billing_scheme' => 'per_unit', + 'created' => 1744986706, + 'currency' => 'usd', + 'interval' => 'year', + 'interval_count' => 1, + 'livemode' => false, + 'metadata' => [], + 'meter' => null, + 'nickname' => null, + 'product' => 'prod_S9Z5CgycbP7P4y', + 'tiers_mode' => null, + 'transform_usage' => null, + 'trial_period_days' => null, + 'usage_type' => 'licensed', + ], + 'quantity' => 1, + 'schedule' => null, + 'start_date' => 1745003875, + 'status' => 'active', + 'test_clock' => null, + 'transfer_data' => null, + 'trial_end' => null, + 'trial_settings' => [ + 'end_behavior' => [ + 'missing_payment_method' => 'create_invoice', + ], + ], + 'trial_start' => null, + ], + ], + ]; + } + + protected function mockStripeClient(Customer $mockCustomer): void + { + $mockStripeClient = $this->createMock(StripeClient::class); + $mockStripeClient->customers = new class($mockCustomer) + { + private $mockCustomer; + + public function __construct($mockCustomer) + { + $this->mockCustomer = $mockCustomer; + } + + public function retrieve() + { + return $this->mockCustomer; + } + }; + + $this->app->instance(StripeClient::class, $mockStripeClient); + } +} diff --git a/tests/Feature/Jobs/UpsertLicenseFromAnystackLicenseTest.php b/tests/Feature/Jobs/UpsertLicenseFromAnystackLicenseTest.php new file mode 100644 index 00000000..e916c408 --- /dev/null +++ b/tests/Feature/Jobs/UpsertLicenseFromAnystackLicenseTest.php @@ -0,0 +1,54 @@ +create([ + 'anystack_contact_id' => 'contact-123', + ]); + + $now = Date::now()->toImmutable(); + + $licenseData = [ + 'id' => 'license-123', + 'key' => 'test-license-key-12345', + 'contact_id' => 'contact-123', + 'policy_id' => Subscription::Mini->anystackPolicyId(), + 'name' => null, + 'activations' => 0, + 'max_activations' => 10, + 'suspended' => true, + 'expires_at' => $now->addYear()->toIso8601String(), + 'created_at' => $now->toIso8601String(), + 'updated_at' => $now->toIso8601String(), + ]; + + $job = new UpsertLicenseFromAnystackLicense($licenseData); + $job->handle(); + + $this->assertDatabaseHas('licenses', [ + 'anystack_id' => 'license-123', + 'user_id' => $user->id, + 'key' => 'test-license-key-12345', + 'policy_name' => Subscription::Mini->value, + 'is_suspended' => true, + 'expires_at' => $now->addYear(), + 'created_at' => $now, + 'updated_at' => $now, + ]); + } +} diff --git a/tests/Feature/Livewire/OrderSuccessTest.php b/tests/Feature/Livewire/OrderSuccessTest.php new file mode 100644 index 00000000..611120f7 --- /dev/null +++ b/tests/Feature/Livewire/OrderSuccessTest.php @@ -0,0 +1,207 @@ +mockStripeClient(); + } + + #[Test] + public function it_renders_successfully() + { + $response = $this->withoutVite()->get('/order/cs_test_123'); + + $response->assertStatus(200); + } + + #[Test] + public function it_displays_loading_state_when_no_license_key_is_available() + { + Session::flush(); + + Livewire::test(OrderSuccess::class, ['checkoutSessionId' => 'cs_test_123']) + ->assertSet('email', 'test@example.com') + ->assertSet('licenseKey', null) + ->assertSee('License registration in progress') + ->assertSee('check your email'); + } + + #[Test] + public function it_displays_license_key_when_available_in_database() + { + Session::flush(); + + $user = User::factory()->create([ + 'email' => 'test@example.com', + ]); + + License::factory()->create([ + 'user_id' => $user->id, + 'key' => 'db-license-key-12345', + 'policy_name' => 'max', + ]); + + Livewire::test(OrderSuccess::class, ['checkoutSessionId' => 'cs_test_123']) + ->assertSet('email', 'test@example.com') + ->assertSet('licenseKey', 'db-license-key-12345') + ->assertSee('db-license-key-12345') + ->assertSee('test@example.com') + ->assertDontSee('License registration in progress'); + } + + #[Test] + public function it_uses_session_data_when_available() + { + $checkoutSessionId = 'cs_test_123'; + + Session::put("$checkoutSessionId.email", 'session@example.com'); + Session::put("$checkoutSessionId.license_key", 'session-license-key'); + + Livewire::test(OrderSuccess::class, ['checkoutSessionId' => 'cs_test_123']) + ->assertSet('email', 'session@example.com') + ->assertSet('licenseKey', 'session-license-key') + ->assertSee('session-license-key') + ->assertSee('session@example.com'); + } + + #[Test] + public function it_polls_for_updates_from_database() + { + Session::flush(); + + $component = Livewire::test(OrderSuccess::class, ['checkoutSessionId' => 'cs_test_123']) + ->assertSet('licenseKey', null) + ->assertSee('License registration in progress') + ->assertSeeHtml('wire:poll.2s="loadData"'); + + $user = User::factory()->create([ + 'email' => 'test@example.com', + ]); + + License::factory()->create([ + 'user_id' => $user->id, + 'key' => 'db-polled-license-key', + 'policy_name' => 'max', + ]); + + $component->call('loadData') + ->assertSet('licenseKey', 'db-polled-license-key') + ->assertSee('db-polled-license-key') + ->assertDontSee('License registration in progress'); + } + + #[Test] + public function it_redirects_to_mobile_route_when_checkout_session_is_not_found() + { + $mockStripeClient = $this->createMock(StripeClient::class); + + $mockStripeClient->checkout = new class {}; + + $mockStripeClient->checkout->sessions = new class + { + public function retrieve() + { + throw new InvalidRequestException('No such checkout.session'); + } + + public function allLineItems() + { + throw new InvalidRequestException('No such checkout.session'); + } + }; + + $this->app->bind(StripeClient::class, function ($app, $parameters) use ($mockStripeClient) { + return $mockStripeClient; + }); + + Livewire::test(OrderSuccess::class, ['checkoutSessionId' => 'not_a_real_checkout_session']) + ->assertRedirect('/mobile'); + } + + private function mockStripeClient(): void + { + $mockCheckoutSession = CheckoutSession::constructFrom([ + 'id' => 'cs_test_123', + 'customer_details' => [ + 'email' => 'test@example.com', + ], + ]); + + $mockCheckoutSessionLineItems = Collection::constructFrom([ + 'object' => 'list', + 'data' => [ + LineItem::constructFrom([ + 'id' => 'li_1RFKPpAyFo6rlwXqAHI9wA95', + 'object' => 'item', + 'description' => 'Early Access Program (Max)', + 'price' => [ + 'id' => Subscription::Max->stripePriceId(), + 'object' => 'price', + 'product' => 'prod_S9Z5CgycbP7P4y', + ], + ]), + ], + ]); + + $mockStripeClient = $this->createMock(StripeClient::class); + + $mockStripeClient->checkout = new class($mockCheckoutSession) + { + private $mockCheckoutSession; + + public function __construct($mockCheckoutSession) + { + $this->mockCheckoutSession = $mockCheckoutSession; + } + }; + + $mockStripeClient->checkout->sessions = new class($mockCheckoutSession, $mockCheckoutSessionLineItems) + { + private $mockCheckoutSession; + + private $mockCheckoutSessionLineItems; + + public function __construct($mockCheckoutSession, $mockCheckoutSessionLineItems) + { + $this->mockCheckoutSession = $mockCheckoutSession; + $this->mockCheckoutSessionLineItems = $mockCheckoutSessionLineItems; + } + + public function retrieve() + { + return $this->mockCheckoutSession; + } + + public function allLineItems() + { + return $this->mockCheckoutSessionLineItems; + } + }; + + $this->app->bind(StripeClient::class, function ($app, $parameters) use ($mockStripeClient) { + return $mockStripeClient; + }); + } +} diff --git a/tests/Feature/Livewire/PurchaseModalTest.php b/tests/Feature/Livewire/PurchaseModalTest.php new file mode 100644 index 00000000..f1da549e --- /dev/null +++ b/tests/Feature/Livewire/PurchaseModalTest.php @@ -0,0 +1,73 @@ +call('setPlan', 'mini') + ->assertSet('selectedPlan', 'mini'); + } + + #[Test] + public function purchase_modal_can_be_closed() + { + Livewire::test(PurchaseModal::class) + ->set('showModal', true) + ->set('email', 'test@example.com') + ->set('selectedPlan', 'mini') + ->call('closeModal') + ->assertSet('showModal', false) + ->assertSet('email', '') + ->assertSet('selectedPlan', null); + } + + #[Test] + public function purchase_modal_validates_email() + { + Livewire::test(PurchaseModal::class) + ->set('email', 'invalid-email') + ->call('submit') + ->assertHasErrors(['email' => 'email']); + } + + #[Test] + public function purchase_modal_requires_email() + { + Livewire::test(PurchaseModal::class) + ->set('email', '') + ->call('submit') + ->assertHasErrors(['email' => 'required']); + } + + #[Test] + public function test_submit_action() + { + Livewire::test(PurchaseModal::class) + ->call('setPlan', 'mini') + ->set('email', 'valid@example.com') + ->call('submit') + ->assertDispatched('purchase-request-submitted', [ + 'email' => 'valid@example.com', + 'plan' => 'mini', + ]); + } + + #[Test] + public function purchase_modal_closes_after_emitting_event() + { + Livewire::test(PurchaseModal::class) + ->call('setPlan', 'mini') + ->set('email', 'valid@example.com') + ->call('submit') + ->assertSet('showModal', false); + } +} diff --git a/tests/Feature/MobilePricingTest.php b/tests/Feature/MobilePricingTest.php new file mode 100644 index 00000000..5deba73e --- /dev/null +++ b/tests/Feature/MobilePricingTest.php @@ -0,0 +1,63 @@ +create(); + Auth::login($user); + + $component = Livewire::test(MobilePricing::class); + $component->assertSeeHtml([ + 'wire:click="createCheckoutSession(\'mini\')"', + 'wire:click="createCheckoutSession(\'pro\')"', + 'wire:click="createCheckoutSession(\'max\')"', + ]); + $component->assertDontSeeHtml([ + '@click="$dispatch(\'open-purchase-modal\', { plan: \'mini\' })"', + '@click="$dispatch(\'open-purchase-modal\', { plan: \'pro\' })"', + '@click="$dispatch(\'open-purchase-modal\', { plan: \'max\' })"', + ]); + } + + #[Test] + public function guest_users_see_purchase_modal_component() + { + Auth::logout(); + + Livewire::test(MobilePricing::class) + ->assertSeeLivewire('purchase-modal') + ->assertSeeHtml([ + '@click="$dispatch(\'open-purchase-modal\', { plan: \'mini\' })"', + '@click="$dispatch(\'open-purchase-modal\', { plan: \'pro\' })"', + '@click="$dispatch(\'open-purchase-modal\', { plan: \'max\' })"', + ]) + ->assertDontSeeHtml([ + 'wire:click="createCheckoutSession(\'mini\')"', + 'wire:click="createCheckoutSession(\'pro\')"', + 'wire:click="createCheckoutSession(\'max\')"', + ]); + } + + #[Test] + public function authenticated_users_do_not_see_purchase_modal_component() + { + Auth::login(User::factory()->create()); + + Livewire::test(MobilePricing::class) + ->assertDontSeeLivewire('purchase-modal'); + } +} diff --git a/tests/Feature/MobileRouteTest.php b/tests/Feature/MobileRouteTest.php new file mode 100644 index 00000000..1c0b9bb4 --- /dev/null +++ b/tests/Feature/MobileRouteTest.php @@ -0,0 +1,27 @@ +withoutVite() + ->get(route('early-adopter')) + ->assertDontSee('buy.stripe.com'); + } + + #[Test] + public function mobile_route_includes_mobile_pricing_livewire_component() + { + $this + ->withoutVite() + ->get(route('early-adopter')) + ->assertSeeLivewire('mobile-pricing'); + } +} diff --git a/tests/Feature/Services/AnystackTest.php b/tests/Feature/Services/AnystackTest.php new file mode 100644 index 00000000..c90de971 --- /dev/null +++ b/tests/Feature/Services/AnystackTest.php @@ -0,0 +1,53 @@ + Http::response([ + 'data' => [ + 'id' => 'license-123', + 'suspended' => true, + ], + ], 200), + ]); + + $anystack = new Anystack; + $response = $anystack->suspendLicense('product-123', 'license-123'); + + $this->assertEquals(200, $response->status()); + $this->assertEquals('license-123', $response->json('data.id')); + $this->assertTrue($response->json('data.suspended')); + + Http::assertSent(function ($request) { + return str_contains($request->url(), '/products/product-123/licenses/license-123') && + $request->method() === 'PATCH' && + $request->data() === ['suspended' => true]; + }); + } + + #[Test] + public function it_throws_exception_when_api_call_fails() + { + Http::fake([ + 'https://api.anystack.sh/v1/products/*/licenses/*' => Http::response([], 500), + ]); + + $this->expectException(\Illuminate\Http\Client\RequestException::class); + + $anystack = new Anystack; + $anystack->suspendLicense('product-123', 'license-123'); + } +} diff --git a/tests/Feature/StripePurchaseHandlingTest.php b/tests/Feature/StripePurchaseHandlingTest.php new file mode 100644 index 00000000..bc486cca --- /dev/null +++ b/tests/Feature/StripePurchaseHandlingTest.php @@ -0,0 +1,215 @@ +set('cashier.webhook.secret', null); + + Http::fake([ + 'https://api.anystack.sh/v1/contacts' => Http::response(['data' => ['id' => 'contact-123']], 200), + 'https://api.anystack.sh/v1/products/*/licenses' => Http::response(['data' => ['key' => 'test-license-key-12345']], 200), + ]); + } + + #[Test] + public function a_user_is_not_created_when_a_stripe_customer_is_created() + { + Bus::fake(); + + $payload = [ + 'id' => 'evt_test_webhook', + 'type' => 'customer.created', + 'data' => [ + 'object' => [ + 'id' => 'cus_test123', + 'name' => 'Test Customer', + 'email' => 'test@example.com', + ], + ], + ]; + + $this->postJson('/stripe/webhook', $payload); + + Bus::assertNotDispatched(CreateUserFromStripeCustomer::class); + } + + #[Test] + public function a_user_is_created_when_a_stripe_customer_subscription_is_created_and_a_matching_user_doesnt_exist() + { + Bus::fake(); + + $this->mockStripeClient(); + + $payload = [ + 'id' => 'evt_test_webhook', + 'type' => 'customer.subscription.created', + 'data' => [ + 'object' => [ + 'id' => 'sub_test123', + 'customer' => 'cus_test123', + 'status' => 'active', + 'items' => [ + 'object' => 'list', + 'data' => [ + [ + 'id' => 'si_test', + 'price' => [ + 'id' => Subscription::Max->stripePriceId(), + 'product' => 'prod_test', + ], + 'quantity' => 1, + ], + ], + ], + ], + ], + ]; + + $this->postJson('/stripe/webhook', $payload); + + Bus::assertDispatched(CreateUserFromStripeCustomer::class); + } + + #[Test] + public function a_user_is_not_created_when_a_stripe_customer_subscription_is_created_if_a_matching_user_already_exists() + { + Bus::fake(); + + $user = User::factory()->create([ + 'stripe_id' => 'cus_test123', + 'name' => 'John Doe', + 'email' => 'john@example.com', + ]); + + $this->mockStripeClient($user); + + $payload = [ + 'id' => 'evt_test_webhook', + 'type' => 'customer.subscription.created', + 'data' => [ + 'object' => [ + 'id' => 'sub_test123', + 'customer' => $user->stripe_id, + 'status' => 'active', + 'items' => [ + 'object' => 'list', + 'data' => [ + [ + 'id' => 'si_test', + 'price' => [ + 'id' => Subscription::Max->stripePriceId(), + 'product' => 'prod_test', + ], + 'quantity' => 1, + ], + ], + ], + ], + ], + ]; + + $this->postJson('/stripe/webhook', $payload); + + Bus::assertNotDispatched(CreateUserFromStripeCustomer::class); + } + + #[Test] + public function a_license_is_created_when_a_stripe_subscription_is_created() + { + Bus::fake([CreateAnystackLicenseJob::class]); + + $user = User::factory()->create([ + 'stripe_id' => 'cus_test123', + 'name' => 'John Doe', + 'email' => 'john@example.com', + ]); + + $this->mockStripeClient($user); + + $payload = [ + 'id' => 'evt_test_webhook', + 'type' => 'customer.subscription.created', + 'data' => [ + 'object' => [ + 'id' => 'sub_test123', + 'customer' => 'cus_test123', + 'status' => 'active', + 'items' => [ + 'object' => 'list', + 'data' => [ + [ + 'id' => 'si_test', + 'price' => [ + 'id' => Subscription::Max->stripePriceId(), + 'product' => 'prod_test', + ], + 'quantity' => 1, + ], + ], + ], + ], + ], + ]; + + $this->postJson('/stripe/webhook', $payload); + + Bus::assertDispatched(CreateAnystackLicenseJob::class, function (CreateAnystackLicenseJob $job) { + return $job->user->email === 'john@example.com' && + $job->subscription === Subscription::Max && + $job->subscriptionItemId === $job->user->subscriptions->first()->items()->first()->id && + $job->firstName === 'John' && + $job->lastName === 'Doe'; + }); + + $user->refresh(); + + $this->assertNotEmpty($user->subscriptions); + $this->assertNotEmpty($user->subscriptions->first()->items); + } + + protected function mockStripeClient(?User $user = null): void + { + $mockStripeClient = $this->createMock(StripeClient::class); + $mockStripeClient->customers = new class($user) + { + private $user; + + public function __construct($user) + { + $this->user = $user; + } + + public function retrieve() + { + return Customer::constructFrom([ + 'id' => $this->user?->stripe_id ?: 'cus_test123', + 'name' => $this->user?->name ?: 'Test Customer', + 'email' => $this->user?->email ?: 'test@example.com', + ]); + } + }; + + $this->app->bind(StripeClient::class, function ($app, $parameters) use ($mockStripeClient) { + return $mockStripeClient; + }); + } +} diff --git a/tests/Feature/StripeWebhookRouteTest.php b/tests/Feature/StripeWebhookRouteTest.php new file mode 100644 index 00000000..9617b846 --- /dev/null +++ b/tests/Feature/StripeWebhookRouteTest.php @@ -0,0 +1,28 @@ +post('/stripe/webhook'); + + $this->assertNotEquals(404, $response->getStatusCode()); + } + + #[Test] + public function stripe_webhook_route_is_excluded_from_csrf_verification() + { + $reflection = new \ReflectionClass(VerifyCsrfToken::class); + $property = $reflection->getProperty('except'); + $exceptPaths = $property->getValue(app(VerifyCsrfToken::class)); + + $this->assertContains('stripe/webhook', $exceptPaths); + } +} diff --git a/vite.config.js b/vite.config.js index 67bdbe16..42ef1afb 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,20 +1,19 @@ -import {defineConfig} from 'vite'; -import laravel from 'laravel-vite-plugin'; +import { defineConfig } from 'vite' +import laravel from 'laravel-vite-plugin' export default defineConfig({ - server: { cors: { origin: [ /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/, - /^https?:\/\/.*\.test(:\d+)?$/, // Valet / Herd (SCHEME://*.test:PORT) + /^https?:\/\/.*\.test(:\d+)?$/, // Valet / Herd (SCHEME://*.test:PORT) ], }, }, plugins: [ laravel({ - input: ['resources/css/app.css', 'resources/js/app.js'], + input: ['resources/css/app.css', 'resources/js/app.js', 'resources/css/docsearch.css'], refresh: true, }), ], -}); +})

+
+ {{-- Blurred circle - Decorative --}} + + + {{-- Back button --}} +
+ + +
+ + {{-- Primary Heading --}} +

+ NativePHP for desktop v1 is finally here! +

+ + {{-- Date --}} +
+
+
+ + {{-- Divider --}} + + + {{-- Content --}} +
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Pariatur + facere dolore praesentium eius amet ex suscipit quam quibusdam + rerum, ratione, veritatis quidem, repudiandae ipsum in. Dolore + voluptatibus iusto saepe cum. Maiores tenetur nobis aliquid + recusandae hic, illo, aliquam laudantium aspernatur iste commodi + temporibus vero maxime, deserunt consequuntur fugiat animi dicta + debitis alias quos amet facere repellendus? Nesciunt, fugiat? Vel, + harum. Eos magnam, totam blanditiis nemo facilis culpa voluptate sed + dolores delectus alias velit, deleniti ex id quasi. Maiores + laboriosam repellendus vitae aliquam voluptas delectus deserunt + provident. Saepe, ullam. Error, ipsam. Facere dolore ullam + reprehenderit debitis et aperiam exercitationem numquam deserunt? + Temporibus asperiores exercitationem commodi vel? Autem, optio? + Tempora, dicta, pariatur dolores repudiandae corrupti beatae + voluptate dignissimos omnis consectetur ratione rerum. + Exercitationem eligendi, sint necessitatibus cumque voluptatum + corrupti incidunt inventore natus cupiditate, obcaecati nisi unde + nesciunt commodi! Eveniet itaque nihil ducimus repellendus et atque + laborum quos? Nostrum, aperiam aut. Ratione, earum! Voluptate + deleniti labore dolor quod nobis atque nam repellendus? Fugiat, + aliquam voluptatum quam cum, veniam mollitia, autem consequatur + officiis dolorem assumenda tempore. Distinctio officiis numquam + omnis quos aperiam minima voluptatibus? Magnam laborum nesciunt eos + qui sed repellendus tenetur harum, id, mollitia a provident + accusantium sint architecto, laudantium sit dolore quia. Vel impedit + quasi nam necessitatibus accusantium saepe praesentium laudantium + ut. Sit dolor voluptas dignissimos doloremque qui atque dolorum. + Aperiam eaque sapiente dicta nulla error laborum eius ex illum + harum, dolor quae illo praesentium ad hic at dolorem iusto + recusandae unde. Ipsa alias tenetur magni reprehenderit nam + consequuntur pariatur consequatur quas aspernatur cumque harum ullam + asperiores corporis distinctio consectetur dicta iusto, iure rem + quos nobis laboriosam eos nulla accusamus et. Similique. Consectetur + hic vel explicabo id assumenda, dolores quos neque asperiores ut, + aperiam a blanditiis est, ullam officia cum error eligendi delectus! + Cupiditate iusto est ad. Magni porro blanditiis quo delectus! + Possimus quis repellat aliquam, quia repudiandae deserunt ipsum + laudantium quaerat impedit veniam quibusdam rerum libero! Nam + laboriosam qui blanditiis nihil soluta, magnam ut fuga voluptatem + voluptatibus doloremque aut, aliquam velit? Soluta in esse dolorem + harum excepturi incidunt qui omnis quidem perferendis, alias culpa + ipsa quaerat delectus quam dolores nulla inventore dicta rerum enim + obcaecati. Officia esse nostrum voluptate mollitia corporis. Numquam + exercitationem fuga debitis soluta. Accusantium a voluptatum + reprehenderit, perferendis dolorum sequi ab consequatur molestiae + necessitatibus consequuntur asperiores expedita? Corporis vel fugiat + distinctio sint magnam eveniet facilis. Corrupti, quisquam + perferendis. Architecto recusandae dolores aspernatur eligendi + laborum iure libero sit vitae optio error cupiditate illo magnam + harum quam, porro debitis repellendus quis iusto nemo, atque nobis + aliquam consequatur? Quo, saepe repudiandae. Rem nostrum quos illo + eos cupiditate culpa eum dolorem debitis odit accusantium quibusdam + eligendi ea quisquam, nam beatae, nihil vitae mollitia totam laborum + necessitatibus veritatis porro error molestias. Exercitationem, + soluta. Eaque suscipit amet impedit illum hic rerum nesciunt. Totam + culpa, quia fuga at blanditiis dolorum rerum iusto ipsa quae + distinctio a placeat dolorem omnis praesentium libero obcaecati + molestiae porro aliquid. Accusantium itaque rerum nobis, quam, non + numquam animi qui cupiditate repellendus repellat veritatis pariatur + expedita debitis veniam beatae rem dicta vel vitae, eaque eos + placeat. Consequatur, facilis commodi. Soluta, incidunt. Beatae + nobis nesciunt quis reiciendis? Velit voluptatum et placeat + accusantium illo suscipit id dolorum cupiditate rem fugiat! Libero + esse, ad dolorum commodi officiis incidunt enim corrupti, fuga + beatae aspernatur expedita? Earum rerum laborum dolore architecto? + Culpa vitae at ipsum sapiente? Labore aliquid, dolor optio voluptas + mollitia recusandae quas sequi tempora corporis. Ipsa voluptate + fugiat omnis perferendis deserunt, itaque quos perspiciatis. + Asperiores explicabo dolore, molestiae, consequatur sint soluta + vitae quae iure reprehenderit hic officia aliquid omnis reiciendis + voluptatibus tempora provident veniam in magni eum et exercitationem + doloribus ullam. Neque, culpa temporibus. +
+