@prisma/cli 2.20.1 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +158 -0
- package/README.md +29 -28
- package/dist/adapters/config.js +74 -0
- package/dist/adapters/local-state.js +98 -0
- package/dist/adapters/mock-api.js +57 -0
- package/dist/adapters/token-storage.js +43 -0
- package/dist/cli.js +9 -0
- package/dist/cli2.js +59 -0
- package/dist/commands/app/index.js +223 -0
- package/dist/commands/auth/index.js +42 -0
- package/dist/commands/branch/index.js +51 -0
- package/dist/commands/project/index.js +45 -0
- package/dist/controllers/app.js +813 -0
- package/dist/controllers/auth.js +107 -0
- package/dist/controllers/branch.js +73 -0
- package/dist/controllers/project.js +214 -0
- package/dist/controllers/select-prompt-port.js +12 -0
- package/dist/lib/app/bun-project.js +39 -0
- package/dist/lib/app/env-vars.js +24 -0
- package/dist/lib/app/local-dev.js +149 -0
- package/dist/lib/app/preview-build.js +283 -0
- package/dist/lib/app/preview-interaction.js +38 -0
- package/dist/lib/app/preview-progress.js +139 -0
- package/dist/lib/app/preview-provider.js +232 -0
- package/dist/lib/auth/auth-ops.js +57 -0
- package/dist/lib/auth/client.js +22 -0
- package/dist/lib/auth/guard.js +34 -0
- package/dist/lib/auth/login.js +117 -0
- package/dist/output/patterns.js +93 -0
- package/dist/presenters/app.js +405 -0
- package/dist/presenters/auth.js +73 -0
- package/dist/presenters/branch.js +111 -0
- package/dist/presenters/project.js +84 -0
- package/dist/shell/command-meta.js +320 -0
- package/dist/shell/command-runner.js +33 -0
- package/dist/shell/errors.js +66 -0
- package/dist/shell/global-flags.js +25 -0
- package/dist/shell/help.js +78 -0
- package/dist/shell/output.js +54 -0
- package/dist/shell/prompt.js +31 -0
- package/dist/shell/runtime.js +51 -0
- package/dist/shell/ui.js +59 -0
- package/dist/use-cases/auth.js +70 -0
- package/dist/use-cases/branch.js +95 -0
- package/dist/use-cases/create-cli-gateways.js +93 -0
- package/dist/use-cases/project.js +75 -0
- package/package.json +49 -137
- package/build/child.js +0 -4110
- package/build/index.js +0 -104447
- package/build/public/.DS_Store +0 -0
- package/build/public/assets/alert.60ea9f84.svg +0 -5
- package/build/public/assets/array.1a36c222.svg +0 -4
- package/build/public/assets/boolean.9188b434.svg +0 -4
- package/build/public/assets/browser.21a575be.js +0 -1
- package/build/public/assets/browser.38b7fdb1.js +0 -1
- package/build/public/assets/browser.cdd2249a.js +0 -1
- package/build/public/assets/chevron-down.24f76e3c.svg +0 -3
- package/build/public/assets/cross.c2610cf5.svg +0 -11
- package/build/public/assets/datetime.a3bf710a.svg +0 -4
- package/build/public/assets/download.8d34b65a.svg +0 -4
- package/build/public/assets/ellipsis.a8c5a34a.svg +0 -10
- package/build/public/assets/enum.7ec0b64c.svg +0 -6
- package/build/public/assets/folder.d77b8eaf.svg +0 -6
- package/build/public/assets/hamburger.5fdadeac.svg +0 -4
- package/build/public/assets/logotype.a960b169.svg +0 -4
- package/build/public/assets/number.85ddf96b.svg +0 -7
- package/build/public/assets/object.0ba944a6.svg +0 -5
- package/build/public/assets/play.8811691e.svg +0 -6
- package/build/public/assets/plus.8fbf7ad3.svg +0 -4
- package/build/public/assets/read.79154521.svg +0 -1
- package/build/public/assets/refresh.d5448ccc.svg +0 -4
- package/build/public/assets/search.2ed766ce.svg +0 -7
- package/build/public/assets/settings.5ad25af2.svg +0 -8
- package/build/public/assets/string.ea615a24.svg +0 -4
- package/build/public/assets/tick-indeterminate.aec8a44d.svg +0 -3
- package/build/public/assets/tick.8cbb6a93.svg +0 -4
- package/build/public/assets/vendor.c4d0f081.js +0 -354
- package/build/public/demo.html +0 -17
- package/build/public/demoChunk.js +0 -2
- package/build/public/electron-darwin.html +0 -19
- package/build/public/electron-linux.html +0 -18
- package/build/public/electron-mac.html +0 -18
- package/build/public/electron-win.html +0 -17
- package/build/public/electron-win32.html +0 -18
- package/build/public/electron.html +0 -17
- package/build/public/electronBus.js +0 -2
- package/build/public/electronChunk.js +0 -2
- package/build/public/favicon/apple-touch-icon.png +0 -0
- package/build/public/favicon/favicon-16x16.png +0 -0
- package/build/public/favicon/favicon-32x32.png +0 -0
- package/build/public/favicon/prisma.png +0 -0
- package/build/public/favicon.svg +0 -5
- package/build/public/fonts/.DS_Store +0 -0
- package/build/public/fonts/Inter.ttf +0 -0
- package/build/public/fonts/RobotoMono.ttf +0 -0
- package/build/public/icons/.DS_Store +0 -0
- package/build/public/icons/alert.svg +0 -5
- package/build/public/icons/array.svg +0 -4
- package/build/public/icons/bin.svg +0 -37
- package/build/public/icons/boolean.svg +0 -4
- package/build/public/icons/check.svg +0 -3
- package/build/public/icons/chevron-down.svg +0 -3
- package/build/public/icons/code.svg +0 -4
- package/build/public/icons/cross.svg +0 -11
- package/build/public/icons/data-tool.svg +0 -5
- package/build/public/icons/database.svg +0 -4
- package/build/public/icons/datetime.svg +0 -4
- package/build/public/icons/double-arrow-right.svg +0 -4
- package/build/public/icons/download.svg +0 -4
- package/build/public/icons/ellipsis.svg +0 -10
- package/build/public/icons/enum.svg +0 -6
- package/build/public/icons/expand.svg +0 -4
- package/build/public/icons/eye.svg +0 -20
- package/build/public/icons/filters.svg +0 -5
- package/build/public/icons/folder.svg +0 -6
- package/build/public/icons/hamburger.svg +0 -4
- package/build/public/icons/icon.svg +0 -199
- package/build/public/icons/logo.svg +0 -199
- package/build/public/icons/logotype.svg +0 -4
- package/build/public/icons/number.svg +0 -7
- package/build/public/icons/object.svg +0 -5
- package/build/public/icons/play.svg +0 -6
- package/build/public/icons/plus.svg +0 -4
- package/build/public/icons/refresh.svg +0 -4
- package/build/public/icons/search.svg +0 -7
- package/build/public/icons/settings.svg +0 -8
- package/build/public/icons/string.svg +0 -4
- package/build/public/icons/tick-indeterminate.svg +0 -3
- package/build/public/icons/tick.svg +0 -4
- package/build/public/illustrations/.DS_Store +0 -0
- package/build/public/illustrations/empty.svg +0 -1
- package/build/public/illustrations/read.svg +0 -1
- package/build/public/illustrations/searching.svg +0 -1
- package/build/public/images/.DS_Store +0 -0
- package/build/public/images/icon-1024.png +0 -0
- package/build/public/index.css +0 -1
- package/build/public/index.html +0 -49
- package/build/public/index.js +0 -1
- package/build/public/main.31f688a6254e294d9128.css +0 -118
- package/build/public/main.31f688a6254e294d9128.css.map +0 -1
- package/build/public/main.364c712f32662ff0e43d.css +0 -116
- package/build/public/main.364c712f32662ff0e43d.css.map +0 -1
- package/build/public/main.42ef3fe7e97347765c91.css +0 -118
- package/build/public/main.42ef3fe7e97347765c91.css.map +0 -1
- package/build/public/main.503446defafe7aeca2f3.css +0 -116
- package/build/public/main.503446defafe7aeca2f3.css.map +0 -1
- package/build/public/main.c50a3b5980fe26f78b65.css +0 -118
- package/build/public/main.c50a3b5980fe26f78b65.css.map +0 -1
- package/build/public/main.cda25e5813776c2af295.css +0 -116
- package/build/public/main.cda25e5813776c2af295.css.map +0 -1
- package/build/public/main.dbac3b290f78404ff579.css +0 -116
- package/build/public/main.dbac3b290f78404ff579.css.map +0 -1
- package/build/public/main.f8ce44e122e5e2b8f778.css +0 -118
- package/build/public/main.f8ce44e122e5e2b8f778.css.map +0 -1
- package/build/public/main.fc9ea7521a4aecce1a77.css +0 -118
- package/build/public/main.fc9ea7521a4aecce1a77.css.map +0 -1
- package/build/public/main.js +0 -403
- package/build/public/main.js.map +0 -1
- package/build/public/mainChunk.0a84f3ba4d2ab481e877.css +0 -116
- package/build/public/mainChunk.1b327d58afbddc917bce.css +0 -118
- package/build/public/mainChunk.2cdf583b2bd51aa67587.css +0 -118
- package/build/public/mainChunk.544af00f7e9ffcbe782c.css +0 -118
- package/build/public/mainChunk.56f96a13868b2b4a53be.css +0 -118
- package/build/public/mainChunk.5cee429bfbf06e7ecb39.css +0 -118
- package/build/public/mainChunk.a862474ed4cdb421ffa2.css +0 -118
- package/build/public/mainChunk.ada34153c4911b5ac22b.css +0 -118
- package/build/public/mainChunk.c16a8d01b2c49b2f2751.css +0 -118
- package/build/public/mainChunk.ca4a878d5478b9320be8.css +0 -116
- package/build/public/mainChunk.e3adc8758b4395546cef.css +0 -116
- package/build/public/mainChunk.f2c59fcbfc455d8b9de5.css +0 -118
- package/build/public/mainChunk.js +0 -396
- package/build/public/manifest.json +0 -34
- package/build/public/preview.html +0 -16
- package/build/public/previewBus.js +0 -2
- package/build/public/previewChunk.js +0 -2
- package/build/public/projects.html +0 -86
- package/build/public/server.html +0 -16
- package/build/public/serverBus.js +0 -2
- package/build/public/serverChunk.js +0 -2
- package/build/public/splash.html +0 -17
- package/build/public/studioBundle.828f34b1781061528841.css +0 -118
- package/build/public/studioBundle.bfe9138b2e0293fcb7da.css +0 -118
- package/build/public/studioBundle.c5b256eede880e502aac.css +0 -118
- package/build/public/studioBundle.e43df511c8e2e368900a.css +0 -118
- package/build/public/studioBundle.e69382554c2a2942ae32.css +0 -118
- package/build/public/studioBundle.ee21aa56a3999a2b380b.css +0 -118
- package/build/public/studioBundle.js +0 -396
- package/build/public/vercel.html +0 -16
- package/build/public/vercelChunk.js +0 -2
- package/build/public/views/index.pug +0 -89
- package/build/xdg-open +0 -1066
- package/install/index.js +0 -5
- package/preinstall/index.js +0 -46
- package/prisma-client/README.md +0 -27
- package/prisma-client/generator-build/.DS_Store +0 -0
- package/prisma-client/generator-build/index.js +0 -79697
- package/prisma-client/index-browser.js +0 -3
- package/prisma-client/index.d.ts +0 -1
- package/prisma-client/index.js +0 -11
- package/prisma-client/package.json +0 -138
- package/prisma-client/runtime/index-browser.d.ts +0 -267
- package/prisma-client/runtime/index-browser.js +0 -2273
- package/prisma-client/runtime/index.d.ts +0 -1018
- package/prisma-client/runtime/index.js +0 -35028
- package/prisma-client/scripts/backup-index-browser.js +0 -3
- package/prisma-client/scripts/backup-index.d.ts +0 -1
- package/prisma-client/scripts/backup-index.js +0 -11
- package/prisma-client/scripts/colors.js +0 -180
- package/prisma-client/scripts/default-index-browser.js +0 -12
- package/prisma-client/scripts/default-index.d.ts +0 -47
- package/prisma-client/scripts/default-index.js +0 -12
- package/prisma-client/scripts/get-packed-client.js +0 -12
- package/prisma-client/scripts/mock-fs.js +0 -14
- package/prisma-client/scripts/postinstall.d.ts +0 -5
- package/prisma-client/scripts/postinstall.js +0 -398
- package/scripts/install-entry.js +0 -8
- package/scripts/preinstall-entry.js +0 -9
package/build/public/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=Object.prototype.hasOwnProperty,s=Object.getOwnPropertySymbols,i=Object.prototype.propertyIsEnumerable,a=(t,s,i)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[s]=i,n=(e,n)=>{for(var r in n||(n={}))t.call(n,r)&&a(e,r,n[r]);if(s)for(var r of s(n))i.call(n,r)&&a(e,r,n[r]);return e},r=(e,a)=>{var n={};for(var r in e)t.call(e,r)&&a.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&s)for(var r of s(e))a.indexOf(r)<0&&i.call(e,r)&&(n[r]=e[r]);return n};import{l,o,a as d,c,b as h,u as p,d as u,e as m,f as g,v as f,t as v,r as y,w as I,g as C,i as w,h as E,j as b,k as _,m as S,n as x,p as N,A as M,q as L,F as R}from"./assets/vendor.c4d0f081.js";!function(e=".",t="__import__"){try{self[t]=new Function("u","return import(u)")}catch(s){const i=new URL(e,location),a=e=>{URL.revokeObjectURL(e.src),e.remove()};self[t]=e=>new Promise(((s,n)=>{const r=new URL(e,i);if(self[t].moduleMap[r])return s(self[t].moduleMap[r]);const l=new Blob([`import * as m from '${r}';`,`${t}.moduleMap['${r}']=m;`],{type:"text/javascript"}),o=Object.assign(document.createElement("script"),{type:"module",src:URL.createObjectURL(l),onerror(){n(new Error(`Failed to import: ${e}`)),a(o)},onload(){s(self[t].moduleMap[r]),a(o)}});document.head.appendChild(o)})),self[t].moduleMap={}}}("/assets/");var A=Object.defineProperty,O=Object.getOwnPropertyDescriptor,D=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?O(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&A(t,s,n),n};class k{constructor(){this.transport="http",this.readonly=!1,this.updates=!1,this.headerLeftOffset=32,this.isBrowser=!0}async update(e){l.has(e,"transport")&&(this.transport=e.transport),l.has(e,"readonly")&&(this.readonly=e.readonly),l.has(e,"updates")&&(this.updates=e.updates),l.has(e,"headerLeftOffset")&&(this.headerLeftOffset=e.headerLeftOffset),l.has(e,"isBrowser")&&(this.isBrowser=e.isBrowser)}}D([o],k.prototype,"transport",2),D([o],k.prototype,"readonly",2),D([o],k.prototype,"updates",2),D([o],k.prototype,"headerLeftOffset",2),D([o],k.prototype,"isBrowser",2),D([d],k.prototype,"update",1);var T=new k;let P;const V={},j=function(e,t){if(!t)return e();if(void 0===P){const e=document.createElement("link").relList;P=e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(t.map((e=>{if(e in V)return;V[e]=!0;const t=e.endsWith(".css"),s=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${s}`))return;const i=document.createElement("link");return i.rel=t?"stylesheet":P,t||(i.as="script",i.crossOrigin=""),i.href=e,document.head.appendChild(i),t?new Promise(((e,t)=>{i.addEventListener("load",e),i.addEventListener("error",t)})):void 0}))).then((()=>e()))};class Z{constructor(e){this.path=e.path,this.code=e.code,this.type=e.type,this.message=e.message,this.stack=e.stack,this.context=e.context||null,this.nativeError=e.nativeError}}const B=({path:e,message:t,code:s,type:i,stack:a,context:n,nativeError:r})=>{const l=new Z({path:e,message:t,code:s,type:i,stack:a,context:n||null,nativeError:r});return console.error(`[${e}] ${t}`,n,r&&{nativeError:{message:r.message}}),c((l=>{l.setExtra("path",e),l.setExtra("code",s),l.setExtra("type",i),l.setExtra("message",t),l.setExtra("stack",a),l.setExtra("context",JSON.stringify(n)),l.setExtra("nativeError",r)})),h(l),l};class F{constructor(e,t){this.cursor=()=>this.db.transaction(this.storeName).store.openCursor(),this.transaction=e=>this.db.transaction(this.storeName,e),this.getAll=async({projectId:e}={})=>{const t=await this.db.getAllFromIndex(this.storeName,"createdAt");return e?t.filter((t=>t.projectId===e)):t},this.create=async e=>{try{await this.db.put(this.storeName,n(n({},e),{createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString()}))}catch(t){console.log("Error during PersistenceItem.create",t,this.storeName)}},this.update=async(e,t)=>{try{const t=await this.db.get(this.storeName,e);await this.db.put(this.storeName,n(n({},t),{updatedAt:(new Date).toISOString()}))}catch(s){console.log("Error during PersistenceItem.update",s,this.storeName)}},this.delete=async e=>{try{await this.db.delete(this.storeName,e)}catch(t){console.log("Error during PersistenceItem.delete",t,this.storeName)}},this.clear=async()=>{try{await this.db.clear(this.storeName)}catch(e){console.log("Error during PersistenceItem.clear",e,this.storeName)}},this.storeName=e,this.db=t}}const H=(e,t,s)=>{const i=a=>a===e.length?s&&s():t(e[a],(()=>i(a+1)));return i(0)};const q=[(e,t,s)=>(e.createObjectStore("projects",{keyPath:"id"}),e.createObjectStore("openTabs",{keyPath:"id"}),e.createObjectStore("sessions",{keyPath:"id"}),e.createObjectStore("scripts",{keyPath:"id"}),s()),(e,t,s)=>(e.createObjectStore("models",{keyPath:"id"}),e.createObjectStore("fields",{keyPath:"id"}),e.createObjectStore("enums",{keyPath:"id"}),s()),(e,t,s)=>{const i=t.objectStore("sessions"),a=t.objectStore("scripts"),r=i.getAll();r.onsuccess=()=>{const e=a.getAll();e.onsuccess=()=>{const t=r.result,l=e.result;H(t,((e,t)=>{const s=l.find((t=>t.id===e.scriptId));s?i.put(n(n({},e),{lastSavedHash:s.lastSavedHash||""})).onsuccess=t:e.lastSavedHash=""}),(()=>{H(l,((e,t)=>{delete e.lastSavedHash,a.put(e).onsuccess=t}),(()=>s()))}))}}},(e,t,s)=>{e.createObjectStore("tabs",{keyPath:"id"});const i=t.objectStore("openTabs"),a=t.objectStore("tabs"),n=i.getAll();n.onsuccess=()=>{const t=n.result;H(t,((e,t)=>{if(!e.sessionId)return t();e.preview=!1,a.put(e).onsuccess=t}),(()=>(e.deleteObjectStore("openTabs"),s())))}},(e,t,s)=>{const i=t.objectStore("tabs"),a=t.objectStore("projects"),n=i.getAll();n.onsuccess=()=>{const e=a.getAll();e.onsuccess=()=>{const t=n.result,i=e.result;H(i,((e,s)=>{e.tabOrder=t.filter((t=>t.projectId===e.id)).map((e=>e.id)),a.put(e).onsuccess=s}),(()=>s()))}}},(e,t,s)=>{const i=["tabs","sessions","scripts","models","fields","enums"],a={};H(i,((e,s)=>{const i=t.objectStore(e).getAll();i.onsuccess=()=>{a[e]=i.result,s()}}),(()=>{H(i,((s,i)=>{e.deleteObjectStore(s),e.createObjectStore(s,{keyPath:["id","projectId"]});const n=a[s];H(n,((e,i)=>{t.objectStore(s).put(e).onsuccess=i}),(()=>i()))}),(()=>(e.createObjectStore("actions",{keyPath:["id","projectId"]}),s())))}))},(e,t,s)=>{const i=t.objectStore("projects"),a=i.getAll();a.onsuccess=()=>{const e=a.result;H(e,((e,t)=>{e.theme="light",i.put(e).onsuccess=t}),(()=>s()))}},(e,t,s)=>{const i=t.objectStore("sessions"),a=t.objectStore("scripts"),n=i.getAll();n.onsuccess=()=>{const e=n.result;H(e,((e,t)=>{e.type=e.scriptId?"script":"fallback",i.put(e).onsuccess=t}),(()=>{const e=a.getAll();e.onsuccess=()=>{const t=e.result;H(t,((e,t)=>{e.generated=!1,a.put(e).onsuccess=t}),(()=>s()))}}))}},(e,t,s)=>{const i=t.objectStore("scripts"),a=i.getAll();a.onsuccess=()=>{const e=a.result;H(e,((e,t)=>{e.frozen=e.generated,delete e.generated,i.put(e).onsuccess=t}),(()=>s()))}},(e,t,s)=>(e.deleteObjectStore("models"),e.deleteObjectStore("fields"),e.deleteObjectStore("enums"),s()),(e,t,s)=>{const i=t.objectStore("projects");i.createIndex("createdAt","createdAt"),i.createIndex("updatedAt","updatedAt");const a=t.objectStore("actions");a.createIndex("createdAt","createdAt"),a.createIndex("updatedAt","updatedAt");const n=t.objectStore("scripts");n.createIndex("createdAt","createdAt"),n.createIndex("updatedAt","updatedAt");const r=t.objectStore("sessions");r.createIndex("createdAt","createdAt"),r.createIndex("updatedAt","updatedAt");const l=t.objectStore("tabs");l.createIndex("createdAt","createdAt"),l.createIndex("updatedAt","updatedAt");const o=i.getAll();return o.onsuccess=()=>{const e=o.result;H(e,((e,t)=>{delete e.tabOrder,e.createdAt=(new Date).toISOString(),e.updatedAt=(new Date).toISOString(),i.put(e).onsuccess=t}),(()=>{H([a,n,r,l],((e,t)=>{const s=e.getAll();s.onsuccess=()=>{const i=s.result;H(i,((t,s)=>{t.createdAt=(new Date).toISOString(),t.updatedAt=(new Date).toISOString(),e.put(t).onsuccess=s}),(()=>t()))}}),(()=>s()))}))},s()},(e,t,s)=>{const i=t.objectStore("projects");i.deleteIndex("createdAt"),i.createIndex("createdAt",["id","createdAt"]),i.deleteIndex("updatedAt"),i.createIndex("updatedAt",["id","updatedAt"]);const a=t.objectStore("actions");a.deleteIndex("createdAt"),a.createIndex("createdAt",["id","projectId","createdAt"]),a.deleteIndex("updatedAt"),a.createIndex("updatedAt",["id","projectId","updatedAt"]);const n=t.objectStore("scripts");n.deleteIndex("createdAt"),n.createIndex("createdAt",["id","projectId","createdAt"]),n.deleteIndex("updatedAt"),n.createIndex("updatedAt",["id","projectId","updatedAt"]);const r=t.objectStore("sessions");r.deleteIndex("createdAt"),r.createIndex("createdAt",["id","projectId","createdAt"]),r.deleteIndex("updatedAt"),r.createIndex("updatedAt",["id","projectId","updatedAt"]);const l=t.objectStore("tabs");return l.deleteIndex("createdAt"),l.createIndex("createdAt",["id","projectId","createdAt"]),l.deleteIndex("updatedAt"),l.createIndex("updatedAt",["id","projectId","updatedAt"]),s()},(e,t,s)=>{const i=t.objectStore("scripts"),a=i.getAll();a.onsuccess=()=>{const e=a.result;H(e,((e,t)=>{e.where=e.where.map((e=>(e.fieldIds=[e.fieldId],delete e.fieldId,e))),i.put(e).onsuccess=t}),(()=>s()))}}],U=(e,t,s,i)=>{console.log("------Starting IndexedDB migration------");const a=p(i);H(q.slice(t),((t,s)=>t(e,a,s)),(()=>console.log("------IndexedDB migration complete------")))};var z=new class{constructor(){this.databaseName="Prisma Studio",this.indexedDBVersion=13,this.databaseInstance=null,this.projectId="",this.ready=!1,this.init=async({projectId:e})=>{try{this.projectId=e,this.databaseInstance=await u(this.databaseName,this.indexedDBVersion,{upgrade:U}),this.projects=new F("projects",this.databaseInstance),this.tabs=new F("tabs",this.databaseInstance),this.sessions=new F("sessions",this.databaseInstance),this.scripts=new F("scripts",this.databaseInstance),this.actions=new F("actions",this.databaseInstance),this.ready=!0}catch(t){throw B({path:"PersistenceStore.init",message:"Unable to init PersistenceStore",nativeError:t})}},this.save=(e,t)=>new Promise((async(s,i)=>{if(!this.ready)throw B({path:"PersistenceStore.save",message:"PersistenceStore is not ready to receive `save` operations yet",context:{tableName:e,value:t}});try{switch(e){case"sessions":await this.sessions.create(t);break;case"scripts":await this.scripts.create(t);break;case"tabs":await this.tabs.create(t);break;case"projects":await this.projects.create(t);break;case"actions":await this.actions.create(t)}s()}catch(a){i(a)}})),this.load=async e=>new Promise((async(t,s)=>{if(!this.ready)throw B({path:"PersistenceStore.load",message:"PersistenceStore is not ready to receive `load` operations yet",context:{tableName:e}});try{switch(e){case"projects":return t(await this.projects.getAll());default:return t(await this[e].getAll({projectId:this.projectId}))}}catch(i){return s(i)}})),this.remove=async(e,t)=>new Promise((async(s,i)=>{if(!this.ready)throw B({path:"PersistenceStore.remove",message:"PersistenceStore is not ready to receive `remove` operations yet",context:{tableName:e,id:t}});try{switch(e){case"projects":return await this[e].delete(t),s();default:return await this[e].delete([t,this.projectId]),s()}}catch(a){return i(a)}})),this.clear=async e=>new Promise((async(t,s)=>{if(!this.ready)throw B({path:"PersistenceStore.clear",message:"PersistenceStore is not ready to receive `clear` operations yet",context:{tableName:e}});try{return await this[e].clear(),t()}catch(i){return s(i)}})),this.clearAll=async()=>{var e;null==(e=this.databaseInstance)||e.close(),await m(this.databaseName)}}},$=Object.defineProperty,J=Object.getOwnPropertyDescriptor,Y=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?J(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&$(t,s,n),n};class W{constructor(e,{idbTableName:t}={}){this.idbTableName=null,this.members={},this.restore=async()=>{if(this.idbTableName){(await z.load(this.idbTableName)).forEach((e=>{e?this.add(e,{skipPersist:!0}):console.warn("Attempt to restore a null member from IndexedDB, ignoring",{member:e,idbTableName:this.idbTableName})}))}return Promise.resolve()},this.type=e,this.idbTableName=null!=t?t:null}get values(){return this.members}get size(){return Object.keys(this.members).length}get(e){return e&&this.members[e]||null}add(e,{skipPersist:t=!1}={}){let s;if(e.id||(e.id=f()),this.members[e.id])s=this.members[e.id],s.update(e,{skipPersist:t});else{s=new(0,this.type)(e),s.idbTableName=this.idbTableName,this.members[e.id]=s,!t&&this.idbTableName&&z.save(this.idbTableName,s.serialize())}return s}remove(e){const t=this.members[e];return t&&delete this.members[e],this.idbTableName&&z.remove(this.idbTableName,e),t}clear(){this.members={},this.idbTableName&&z.clear(this.idbTableName)}toJS(){return v(this)}}Y([o],W.prototype,"type",2),Y([o],W.prototype,"idbTableName",2),Y([o],W.prototype,"members",2),Y([g],W.prototype,"values",1),Y([g],W.prototype,"size",1),Y([d],W.prototype,"restore",2),Y([d],W.prototype,"add",1),Y([d],W.prototype,"remove",1),Y([d],W.prototype,"clear",1),Y([d],W.prototype,"toJS",1);var K=Object.defineProperty,G=Object.getOwnPropertyDescriptor,Q=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?G(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&K(t,s,n),n};class X{constructor(e){this.forceUpdate=async()=>{await z.save(this.idbTableName,this.serialize())},this.id=e.id}update(e,{skipPersist:t=!1}={}){if(!t&&this.idbTableName){const t=this.serialize(),s=Object.keys(t),i=Object.keys(e);new Set([...s,...i]).size!==s.length+i.length&&this.forceUpdate()}}serialize(){}}Q([o],X.prototype,"id",2),Q([o],X.prototype,"idbTableName",2),Q([d],X.prototype,"update",1),Q([d],X.prototype,"forceUpdate",2);var ee=Object.defineProperty,te=Object.getOwnPropertyDescriptor,se=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?te(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&ee(t,s,n),n};class ie{constructor(){const e=window.matchMedia("(prefers-color-scheme: dark)");let t=localStorage.getItem("theme");this.theme=t||(e.matches?"dark":"light"),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(e=>this.apply(e.matches?"dark":"light")))}apply(e){this.theme=e;const t=window.matchMedia("(prefers-color-scheme: dark)");t.matches&&"light"===this.theme||!t.matches&&"dark"===this.theme?localStorage.setItem("theme",this.theme):localStorage.removeItem("theme")}hydrate(e){this.apply(e)}}se([o],ie.prototype,"theme",2),se([d],ie.prototype,"apply",1),se([d],ie.prototype,"hydrate",1);var ae=new ie;var ne=Object.defineProperty,re=Object.getOwnPropertyDescriptor,le=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?re(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&ne(t,s,n),n};class oe extends X{constructor(e){super(e),this.id=e.id,this.name=e.name,this.values=e.values}update(e,t={}){l.has(e,"name")&&(this.name=e.name),l.has(e,"values")&&(this.values=e.values),super.update(e,t)}}le([o],oe.prototype,"id",2),le([o],oe.prototype,"name",2),le([o],oe.prototype,"values",2),le([d],oe.prototype,"update",1);var de=Object.defineProperty,ce=Object.getOwnPropertyDescriptor;class he extends W{constructor(){super(oe),this.getByName=e=>this.get(e)}add(e,t={}){return super.add(n({id:e.name},e),t)}}((e,t,s,i)=>{for(var a,n=i>1?void 0:i?ce(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);i&&n&&de(t,s,n)})([d],he.prototype,"add",1);var pe=new he,ue=Object.defineProperty,me=Object.getOwnPropertyDescriptor,ge=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?me(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&ue(t,s,n),n};class fe extends X{constructor(e){if(super(e),this.id=e.id,this.modelId=e.modelId,this.name=e.name,this.type=e.type,this.kind=e.kind,"Json"===this.type&&"string"==typeof e.default)try{this.default=JSON.parse(e.default)}catch(t){this.default=e.default}else if("BigInt"===this.type&&"string"==typeof e.default)try{this.default=BigInt(e.default)}catch(t){this.default=e.default}else this.default=e.default;this.isId=e.isId,this.isUnique=e.isUnique,this.isRequired=e.isRequired,this.isList=e.isList,this.isReadOnly=e.isReadOnly,this.isUpdatedAt=e.isUpdatedAt,this.relationName=e.relationName,this.relationFromFieldNames=e.relationFromFieldNames,this.relationToFieldNames=e.relationToFieldNames}get model(){return Ne.get(this.modelId)}get isScalar(){return"scalar"===this.kind&&!this.isEnum}get isString(){return"String"===this.type}get isInt(){return"Int"===this.type}get isBigInt(){return"BigInt"===this.type}get isFloat(){return"Float"===this.type}get isDecimal(){return"Decimal"===this.type}get isBoolean(){return"Boolean"===this.type}get isDateTime(){return"DateTime"===this.type}get isJson(){return"Json"===this.type}get isBytes(){return"Bytes"===this.type}get isEnum(){return!!this.typeAsEnum}get isRelation(){return"object"===this.kind}get isPartOfRelation(){return null!==this.relationItIsPartOf}get relationItIsPartOf(){return this.model&&this.model.fields.find((e=>e.isRelation&&e.relationFromFieldNames.includes(this.name)))||null}get isSortable(){return this.isScalar&&!this.isList||this.isEnum&&!this.isList}get isFunctionDefault(){return"string"!=typeof this.default&&"number"!=typeof this.default&&"boolean"!=typeof this.default&&"bigint"!=typeof this.default&&!l.isArray(this.default)}get defaultAsString(){return this.isList?"[]":this.default?"string"==typeof this.default||"number"==typeof this.default||"boolean"==typeof this.default?`${this.default}`:"bigint"==typeof this.default||l.isArray(this.default)?this.default.toString():l.isObject(this.default)?`${this.default.name}()`:"":""}get placeholder(){return this.isList?"[]":this.isString?"Value":this.isInt||this.isFloat||this.isBigInt||this.isDecimal?"1337":this.isBoolean?"false":this.isDateTime?(new Date).toISOString():this.isJson?"{}":this.isEnum?this.typeAsEnum.values[0]:this.isRelation?"ID":"Value"}get typeAsModel(){return this.isRelation?Ne.getByName(this.type):null}get typeAsEnum(){return pe.getByName(this.type)}get typeAsLabel(){let e=this.type;const t=this.typeAsModel;return t&&(e=t.name),this.isList?e+="[]":this.isRequired||(e+="?"),e}get lowestValidValue(){if(this.isList)return[];if(!this.isRequired)return null;if(this.isString)return"";if(this.isInt||this.isFloat||this.isDecimal)return 0;if(this.isBigInt)return BigInt(0);if(this.isBoolean)return!1;if(this.isDateTime)return new Date(0).toISOString();if(this.isJson)return{};if(this.isEnum){if(!this.typeAsEnum)throw B({path:"Field.lowestValidValue",message:"Invalid type of field: enum",context:{fieldId:this.id,type:this.type}});return this.typeAsEnum.values[0]}return null}update(e,t={}){l.has(e,"default")&&(this.default=e.default),l.has(e,"isId")&&(this.isId=e.isId),l.has(e,"isUnique")&&(this.isUnique=e.isUnique),l.has(e,"isRequired")&&(this.isRequired=e.isRequired),l.has(e,"isList")&&(this.isList=e.isList),l.has(e,"isReadOnly")&&(this.isReadOnly=e.isReadOnly),l.has(e,"isUpdatedAt")&&(this.isUpdatedAt=e.isUpdatedAt),super.update(e,t)}}ge([o],fe.prototype,"id",2),ge([o],fe.prototype,"modelId",2),ge([o],fe.prototype,"name",2),ge([o],fe.prototype,"type",2),ge([o],fe.prototype,"kind",2),ge([o],fe.prototype,"default",2),ge([o],fe.prototype,"isId",2),ge([o],fe.prototype,"isUnique",2),ge([o],fe.prototype,"isRequired",2),ge([o],fe.prototype,"isList",2),ge([o],fe.prototype,"isReadOnly",2),ge([o],fe.prototype,"isUpdatedAt",2),ge([o],fe.prototype,"relationName",2),ge([o],fe.prototype,"relationFromFieldNames",2),ge([o],fe.prototype,"relationToFieldNames",2),ge([g],fe.prototype,"model",1),ge([g],fe.prototype,"isScalar",1),ge([g],fe.prototype,"isString",1),ge([g],fe.prototype,"isInt",1),ge([g],fe.prototype,"isBigInt",1),ge([g],fe.prototype,"isFloat",1),ge([g],fe.prototype,"isDecimal",1),ge([g],fe.prototype,"isBoolean",1),ge([g],fe.prototype,"isDateTime",1),ge([g],fe.prototype,"isJson",1),ge([g],fe.prototype,"isBytes",1),ge([g],fe.prototype,"isEnum",1),ge([g],fe.prototype,"isRelation",1),ge([g],fe.prototype,"isPartOfRelation",1),ge([g],fe.prototype,"relationItIsPartOf",1),ge([g],fe.prototype,"isSortable",1),ge([g],fe.prototype,"isFunctionDefault",1),ge([g],fe.prototype,"defaultAsString",1),ge([g],fe.prototype,"placeholder",1),ge([g],fe.prototype,"typeAsModel",1),ge([g],fe.prototype,"typeAsEnum",1),ge([g],fe.prototype,"typeAsLabel",1),ge([g],fe.prototype,"lowestValidValue",1),ge([d],fe.prototype,"update",1);const ve=(e,t)=>`${e}.${t}`;var ye=new class extends W{constructor(){super(fe)}getByName(e,t){return this.get(ve(t,e))}};const Ie=({modelId:e})=>{const t=Ne.get(e);if(!t)throw B({path:"getCountQuery",message:"Invalid modelId",context:{modelId:e}});return`prisma.${t.photonNamespace}.count()`};var Ce=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Ee=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?we(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&Ce(t,s,n),n};class be extends X{constructor(e){super(e),this.getFieldByName=e=>ye.getByName(e,this.id),this.runCountQuery=async()=>{try{const{error:e,data:t}=await window.transport.request({channel:"prisma",action:"clientRequest",payload:{data:{schemaHash:_i.activeProject.schemaHash,query:Ie({modelId:this.id})}}});if(e)throw e;const s=parseInt(t.response);this.update({count:s})}catch(e){console.log("Count request failed for model:",this.name,e),this.update({count:0})}},this.id=e.id,this.dbName=e.dbName,this.name=e.name,this.plural=e.plural,this.count=null,this.fieldIds=e.fieldIds||[],this.idFieldIds=e.idFieldIds||[],this.uniqueFieldIds=e.uniqueFieldIds||[]}get fields(){return this.fieldIds.map((e=>{const t=ye.get(e);if(!t)throw B({path:"Model.field",message:"Invalid fieldId",context:{fieldId:e}});return t}))}get uniqueIdentifiers(){if(this.idField)return[this.idField];if(this.compoundIdFields.length>0)return this.compoundIdFields;const e=this.uniqueFields&&this.uniqueFields[0];if(e)return[e];if(this.compoundUniqueFields.length>0)return this.compoundUniqueFields;throw B({path:"ModelStore.uniqueIdentifiers",message:"Unable to resolve unique identifiers for model",context:{modelId:this.id}})}get idField(){return this.fields.find((e=>e.isId))||null}get uniqueFields(){return this.fields.filter((e=>e.isUnique))}get compoundIdFields(){return this.idFieldIds.map((e=>{const t=ye.get(e);if(!t)throw B({path:"Model.compoundIdFields",message:"Invalid fieldId in idFieldIds",context:{fieldId:e}});return t}))}get compoundUniqueFields(){return this.uniqueFieldIds.map((e=>{const t=ye.get(e);if(!t)throw B({path:"Model.uniqueIdentifiers",message:"Invalid fieldId in uniqueFieldIds",context:{fieldId:e}});return t}))}get photonNamespace(){return this.name.charAt(0).toLowerCase()+this.name.slice(1)}update(e,t={}){l.has(e,"name")&&(this.name=e.name),l.has(e,"plural")&&(this.plural=e.plural),l.has(e,"count")&&(this.count=e.count),l.has(e,"fieldIds")&&(this.fieldIds=e.fieldIds),l.has(e,"idFieldIds")&&(this.idFieldIds=e.idFieldIds),l.has(e,"uniqueFieldIds")&&(this.uniqueFieldIds=e.uniqueFieldIds),super.update(e,t)}}Ee([o],be.prototype,"id",2),Ee([o],be.prototype,"dbName",2),Ee([o],be.prototype,"name",2),Ee([o],be.prototype,"plural",2),Ee([o],be.prototype,"count",2),Ee([o],be.prototype,"fieldIds",2),Ee([o],be.prototype,"idFieldIds",2),Ee([o],be.prototype,"uniqueFieldIds",2),Ee([g],be.prototype,"fields",1),Ee([g],be.prototype,"uniqueIdentifiers",1),Ee([g],be.prototype,"idField",1),Ee([g],be.prototype,"uniqueFields",1),Ee([g],be.prototype,"compoundIdFields",1),Ee([g],be.prototype,"compoundUniqueFields",1),Ee([g],be.prototype,"photonNamespace",1),Ee([d],be.prototype,"runCountQuery",2),Ee([d],be.prototype,"update",1);var _e=Object.defineProperty,Se=Object.getOwnPropertyDescriptor;class xe extends W{constructor(){super(be),this.getByName=e=>this.get(e)}add(e,t={}){const s=e.name;return super.add(n(n({},e),{id:s}),t)}}((e,t,s,i)=>{for(var a,n=i>1?void 0:i?Se(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);i&&n&&_e(t,s,n)})([d],xe.prototype,"add",1);var Ne=new xe;const Me=(e,t)=>{if(null==t)throw B({path:"getRecordId",message:"Invalid recordValue",context:{modelId:e,recordValue:t}});const s=Ne.get(e);if(!s)throw B({path:"getRecordId",message:"Invalid modelId",context:{modelId:e}});let i=`${e}::`;return i+=s.uniqueIdentifiers.map((e=>null===t[e.name]?"null":void 0===t[e.name]?"undefined":t[e.name])).join(","),i};var Le=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,Ae=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?Re(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&Le(t,s,n),n};class Oe{constructor(){this.updateError=(e={})=>{l.has(e,"visible")&&(this.error.visible=e.visible)},this.updateActions=(e={})=>{l.has(e,"visible")&&(this.actions.visible=e.visible)},this.error={visible:!1},this.actions={visible:!1}}}Ae([o],Oe.prototype,"error",2),Ae([o],Oe.prototype,"actions",2),Ae([d],Oe.prototype,"updateError",2),Ae([d],Oe.prototype,"updateActions",2);var De=new Oe,ke=Object.defineProperty,Te=Object.getOwnPropertyDescriptor;class Pe{send(e){window.transport.request({channel:"telemetry",action:"send",payload:{data:{command:e.command,commandDetails:JSON.stringify(e.commandDetails),commandContext:JSON.stringify({model_count:Ne.size})}}})}}((e,t,s,i)=>{for(var a,n=i>1?void 0:i?Te(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);i&&n&&ke(t,s,n)})([d],Pe.prototype,"send",1);var Ve=new Pe,je=Object.defineProperty,Ze=Object.getOwnPropertyDescriptor,Be=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?Ze(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&je(t,s,n),n};class Fe{constructor(){this.type="fatal",this.description=null,this.dump=null}update(e){this.type=e.type,this.description=e.description,this.dump=e.dump,Ve.send({command:"error_throw",commandDetails:{type:this.type,description:this.description}})}}Be([o],Fe.prototype,"type",2),Be([o],Fe.prototype,"description",2),Be([o],Fe.prototype,"dump",2),Be([d],Fe.prototype,"update",1);var He=new Fe,qe=[],Ue=[],ze="undefined"!=typeof Uint8Array?Uint8Array:Array,$e=!1;function Je(){$e=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,s=e.length;t<s;++t)qe[t]=e[t],Ue[e.charCodeAt(t)]=t;Ue["-".charCodeAt(0)]=62,Ue["_".charCodeAt(0)]=63}function Ye(e,t,s){for(var i,a,n=[],r=t;r<s;r+=3)i=(e[r]<<16)+(e[r+1]<<8)+e[r+2],n.push(qe[(a=i)>>18&63]+qe[a>>12&63]+qe[a>>6&63]+qe[63&a]);return n.join("")}function We(e){var t;$e||Je();for(var s=e.length,i=s%3,a="",n=[],r=16383,l=0,o=s-i;l<o;l+=r)n.push(Ye(e,l,l+r>o?o:l+r));return 1===i?(t=e[s-1],a+=qe[t>>2],a+=qe[t<<4&63],a+="=="):2===i&&(t=(e[s-2]<<8)+e[s-1],a+=qe[t>>10],a+=qe[t>>4&63],a+=qe[t<<2&63],a+="="),n.push(a),n.join("")}function Ke(e,t,s,i,a){var n,r,l=8*a-i-1,o=(1<<l)-1,d=o>>1,c=-7,h=s?a-1:0,p=s?-1:1,u=e[t+h];for(h+=p,n=u&(1<<-c)-1,u>>=-c,c+=l;c>0;n=256*n+e[t+h],h+=p,c-=8);for(r=n&(1<<-c)-1,n>>=-c,c+=i;c>0;r=256*r+e[t+h],h+=p,c-=8);if(0===n)n=1-d;else{if(n===o)return r?NaN:1/0*(u?-1:1);r+=Math.pow(2,i),n-=d}return(u?-1:1)*r*Math.pow(2,n-i)}function Ge(e,t,s,i,a,n){var r,l,o,d=8*n-a-1,c=(1<<d)-1,h=c>>1,p=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,u=i?0:n-1,m=i?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,r=c):(r=Math.floor(Math.log(t)/Math.LN2),t*(o=Math.pow(2,-r))<1&&(r--,o*=2),(t+=r+h>=1?p/o:p*Math.pow(2,1-h))*o>=2&&(r++,o/=2),r+h>=c?(l=0,r=c):r+h>=1?(l=(t*o-1)*Math.pow(2,a),r+=h):(l=t*Math.pow(2,h-1)*Math.pow(2,a),r=0));a>=8;e[s+u]=255&l,u+=m,l/=256,a-=8);for(r=r<<a|l,d+=a;d>0;e[s+u]=255&r,u+=m,r/=256,d-=8);e[s+u-m]|=128*g}var Qe={}.toString,Xe=Array.isArray||function(e){return"[object Array]"==Qe.call(e)};function et(){return st.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function tt(e,t){if(et()<t)throw new RangeError("Invalid typed array length");return st.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=st.prototype:(null===e&&(e=new st(t)),e.length=t),e}function st(e,t,s){if(!(st.TYPED_ARRAY_SUPPORT||this instanceof st))return new st(e,t,s);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return nt(this,e)}return it(this,e,t,s)}function it(e,t,s,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,s,i){if(t.byteLength,s<0||t.byteLength<s)throw new RangeError("'offset' is out of bounds");if(t.byteLength<s+(i||0))throw new RangeError("'length' is out of bounds");t=void 0===s&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,s):new Uint8Array(t,s,i);st.TYPED_ARRAY_SUPPORT?(e=t).__proto__=st.prototype:e=rt(e,t);return e}(e,t,s,i):"string"==typeof t?function(e,t,s){"string"==typeof s&&""!==s||(s="utf8");if(!st.isEncoding(s))throw new TypeError('"encoding" must be a valid string encoding');var i=0|dt(t,s),a=(e=tt(e,i)).write(t,s);a!==i&&(e=e.slice(0,a));return e}(e,t,s):function(e,t){if(ot(t)){var s=0|lt(t.length);return 0===(e=tt(e,s)).length||t.copy(e,0,0,s),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(i=t.length)!=i?tt(e,0):rt(e,t);if("Buffer"===t.type&&Xe(t.data))return rt(e,t.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function at(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function nt(e,t){if(at(t),e=tt(e,t<0?0:0|lt(t)),!st.TYPED_ARRAY_SUPPORT)for(var s=0;s<t;++s)e[s]=0;return e}function rt(e,t){var s=t.length<0?0:0|lt(t.length);e=tt(e,s);for(var i=0;i<s;i+=1)e[i]=255&t[i];return e}function lt(e){if(e>=et())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+et().toString(16)+" bytes");return 0|e}function ot(e){return!(null==e||!e._isBuffer)}function dt(e,t){if(ot(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var s=e.length;if(0===s)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return s;case"utf8":case"utf-8":case void 0:return Tt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*s;case"hex":return s>>>1;case"base64":return Pt(e).length;default:if(i)return Tt(e).length;t=(""+t).toLowerCase(),i=!0}}function ct(e,t,s){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===s||s>this.length)&&(s=this.length),s<=0)return"";if((s>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return _t(this,t,s);case"utf8":case"utf-8":return wt(this,t,s);case"ascii":return Et(this,t,s);case"latin1":case"binary":return bt(this,t,s);case"base64":return Ct(this,t,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return St(this,t,s);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function ht(e,t,s){var i=e[t];e[t]=e[s],e[s]=i}function pt(e,t,s,i,a){if(0===e.length)return-1;if("string"==typeof s?(i=s,s=0):s>2147483647?s=2147483647:s<-2147483648&&(s=-2147483648),s=+s,isNaN(s)&&(s=a?0:e.length-1),s<0&&(s=e.length+s),s>=e.length){if(a)return-1;s=e.length-1}else if(s<0){if(!a)return-1;s=0}if("string"==typeof t&&(t=st.from(t,i)),ot(t))return 0===t.length?-1:ut(e,t,s,i,a);if("number"==typeof t)return t&=255,st.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,s):Uint8Array.prototype.lastIndexOf.call(e,t,s):ut(e,[t],s,i,a);throw new TypeError("val must be string, number or Buffer")}function ut(e,t,s,i,a){var n,r=1,l=e.length,o=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;r=2,l/=2,o/=2,s/=2}function d(e,t){return 1===r?e[t]:e.readUInt16BE(t*r)}if(a){var c=-1;for(n=s;n<l;n++)if(d(e,n)===d(t,-1===c?0:n-c)){if(-1===c&&(c=n),n-c+1===o)return c*r}else-1!==c&&(n-=n-c),c=-1}else for(s+o>l&&(s=l-o),n=s;n>=0;n--){for(var h=!0,p=0;p<o;p++)if(d(e,n+p)!==d(t,p)){h=!1;break}if(h)return n}return-1}function mt(e,t,s,i){s=Number(s)||0;var a=e.length-s;i?(i=Number(i))>a&&(i=a):i=a;var n=t.length;if(n%2!=0)throw new TypeError("Invalid hex string");i>n/2&&(i=n/2);for(var r=0;r<i;++r){var l=parseInt(t.substr(2*r,2),16);if(isNaN(l))return r;e[s+r]=l}return r}function gt(e,t,s,i){return Vt(Tt(t,e.length-s),e,s,i)}function ft(e,t,s,i){return Vt(function(e){for(var t=[],s=0;s<e.length;++s)t.push(255&e.charCodeAt(s));return t}(t),e,s,i)}function vt(e,t,s,i){return ft(e,t,s,i)}function yt(e,t,s,i){return Vt(Pt(t),e,s,i)}function It(e,t,s,i){return Vt(function(e,t){for(var s,i,a,n=[],r=0;r<e.length&&!((t-=2)<0);++r)i=(s=e.charCodeAt(r))>>8,a=s%256,n.push(a),n.push(i);return n}(t,e.length-s),e,s,i)}function Ct(e,t,s){return 0===t&&s===e.length?We(e):We(e.slice(t,s))}function wt(e,t,s){s=Math.min(e.length,s);for(var i=[],a=t;a<s;){var n,r,l,o,d=e[a],c=null,h=d>239?4:d>223?3:d>191?2:1;if(a+h<=s)switch(h){case 1:d<128&&(c=d);break;case 2:128==(192&(n=e[a+1]))&&(o=(31&d)<<6|63&n)>127&&(c=o);break;case 3:n=e[a+1],r=e[a+2],128==(192&n)&&128==(192&r)&&(o=(15&d)<<12|(63&n)<<6|63&r)>2047&&(o<55296||o>57343)&&(c=o);break;case 4:n=e[a+1],r=e[a+2],l=e[a+3],128==(192&n)&&128==(192&r)&&128==(192&l)&&(o=(15&d)<<18|(63&n)<<12|(63&r)<<6|63&l)>65535&&o<1114112&&(c=o)}null===c?(c=65533,h=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),a+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var s="",i=0;for(;i<t;)s+=String.fromCharCode.apply(String,e.slice(i,i+=4096));return s}(i)}st.TYPED_ARRAY_SUPPORT=!1,st.poolSize=8192,st._augment=function(e){return e.__proto__=st.prototype,e},st.from=function(e,t,s){return it(null,e,t,s)},st.TYPED_ARRAY_SUPPORT&&(st.prototype.__proto__=Uint8Array.prototype,st.__proto__=Uint8Array),st.alloc=function(e,t,s){return function(e,t,s,i){return at(t),t<=0?tt(e,t):void 0!==s?"string"==typeof i?tt(e,t).fill(s,i):tt(e,t).fill(s):tt(e,t)}(null,e,t,s)},st.allocUnsafe=function(e){return nt(null,e)},st.allocUnsafeSlow=function(e){return nt(null,e)},st.isBuffer=function(e){return null!=e&&(!!e._isBuffer||jt(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&jt(e.slice(0,0))}(e))},st.compare=function(e,t){if(!ot(e)||!ot(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var s=e.length,i=t.length,a=0,n=Math.min(s,i);a<n;++a)if(e[a]!==t[a]){s=e[a],i=t[a];break}return s<i?-1:i<s?1:0},st.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},st.concat=function(e,t){if(!Xe(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return st.alloc(0);var s;if(void 0===t)for(t=0,s=0;s<e.length;++s)t+=e[s].length;var i=st.allocUnsafe(t),a=0;for(s=0;s<e.length;++s){var n=e[s];if(!ot(n))throw new TypeError('"list" argument must be an Array of Buffers');n.copy(i,a),a+=n.length}return i},st.byteLength=dt,st.prototype._isBuffer=!0,st.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)ht(this,t,t+1);return this},st.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)ht(this,t,t+3),ht(this,t+1,t+2);return this},st.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)ht(this,t,t+7),ht(this,t+1,t+6),ht(this,t+2,t+5),ht(this,t+3,t+4);return this},st.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?wt(this,0,e):ct.apply(this,arguments)},st.prototype.equals=function(e){if(!ot(e))throw new TypeError("Argument must be a Buffer");return this===e||0===st.compare(this,e)},st.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},st.prototype.compare=function(e,t,s,i,a){if(!ot(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===s&&(s=e?e.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),t<0||s>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=s)return 0;if(i>=a)return-1;if(t>=s)return 1;if(this===e)return 0;for(var n=(a>>>=0)-(i>>>=0),r=(s>>>=0)-(t>>>=0),l=Math.min(n,r),o=this.slice(i,a),d=e.slice(t,s),c=0;c<l;++c)if(o[c]!==d[c]){n=o[c],r=d[c];break}return n<r?-1:r<n?1:0},st.prototype.includes=function(e,t,s){return-1!==this.indexOf(e,t,s)},st.prototype.indexOf=function(e,t,s){return pt(this,e,t,s,!0)},st.prototype.lastIndexOf=function(e,t,s){return pt(this,e,t,s,!1)},st.prototype.write=function(e,t,s,i){if(void 0===t)i="utf8",s=this.length,t=0;else if(void 0===s&&"string"==typeof t)i=t,s=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(s)?(s|=0,void 0===i&&(i="utf8")):(i=s,s=void 0)}var a=this.length-t;if((void 0===s||s>a)&&(s=a),e.length>0&&(s<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var n=!1;;)switch(i){case"hex":return mt(this,e,t,s);case"utf8":case"utf-8":return gt(this,e,t,s);case"ascii":return ft(this,e,t,s);case"latin1":case"binary":return vt(this,e,t,s);case"base64":return yt(this,e,t,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return It(this,e,t,s);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),n=!0}},st.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Et(e,t,s){var i="";s=Math.min(e.length,s);for(var a=t;a<s;++a)i+=String.fromCharCode(127&e[a]);return i}function bt(e,t,s){var i="";s=Math.min(e.length,s);for(var a=t;a<s;++a)i+=String.fromCharCode(e[a]);return i}function _t(e,t,s){var i=e.length;(!t||t<0)&&(t=0),(!s||s<0||s>i)&&(s=i);for(var a="",n=t;n<s;++n)a+=kt(e[n]);return a}function St(e,t,s){for(var i=e.slice(t,s),a="",n=0;n<i.length;n+=2)a+=String.fromCharCode(i[n]+256*i[n+1]);return a}function xt(e,t,s){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>s)throw new RangeError("Trying to access beyond buffer length")}function Nt(e,t,s,i,a,n){if(!ot(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<n)throw new RangeError('"value" argument is out of bounds');if(s+i>e.length)throw new RangeError("Index out of range")}function Mt(e,t,s,i){t<0&&(t=65535+t+1);for(var a=0,n=Math.min(e.length-s,2);a<n;++a)e[s+a]=(t&255<<8*(i?a:1-a))>>>8*(i?a:1-a)}function Lt(e,t,s,i){t<0&&(t=4294967295+t+1);for(var a=0,n=Math.min(e.length-s,4);a<n;++a)e[s+a]=t>>>8*(i?a:3-a)&255}function Rt(e,t,s,i,a,n){if(s+i>e.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("Index out of range")}function At(e,t,s,i,a){return a||Rt(e,0,s,4),Ge(e,t,s,i,23,4),s+4}function Ot(e,t,s,i,a){return a||Rt(e,0,s,8),Ge(e,t,s,i,52,8),s+8}st.prototype.slice=function(e,t){var s,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e),st.TYPED_ARRAY_SUPPORT)(s=this.subarray(e,t)).__proto__=st.prototype;else{var a=t-e;s=new st(a,void 0);for(var n=0;n<a;++n)s[n]=this[n+e]}return s},st.prototype.readUIntLE=function(e,t,s){e|=0,t|=0,s||xt(e,t,this.length);for(var i=this[e],a=1,n=0;++n<t&&(a*=256);)i+=this[e+n]*a;return i},st.prototype.readUIntBE=function(e,t,s){e|=0,t|=0,s||xt(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},st.prototype.readUInt8=function(e,t){return t||xt(e,1,this.length),this[e]},st.prototype.readUInt16LE=function(e,t){return t||xt(e,2,this.length),this[e]|this[e+1]<<8},st.prototype.readUInt16BE=function(e,t){return t||xt(e,2,this.length),this[e]<<8|this[e+1]},st.prototype.readUInt32LE=function(e,t){return t||xt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},st.prototype.readUInt32BE=function(e,t){return t||xt(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},st.prototype.readIntLE=function(e,t,s){e|=0,t|=0,s||xt(e,t,this.length);for(var i=this[e],a=1,n=0;++n<t&&(a*=256);)i+=this[e+n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},st.prototype.readIntBE=function(e,t,s){e|=0,t|=0,s||xt(e,t,this.length);for(var i=t,a=1,n=this[e+--i];i>0&&(a*=256);)n+=this[e+--i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},st.prototype.readInt8=function(e,t){return t||xt(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},st.prototype.readInt16LE=function(e,t){t||xt(e,2,this.length);var s=this[e]|this[e+1]<<8;return 32768&s?4294901760|s:s},st.prototype.readInt16BE=function(e,t){t||xt(e,2,this.length);var s=this[e+1]|this[e]<<8;return 32768&s?4294901760|s:s},st.prototype.readInt32LE=function(e,t){return t||xt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},st.prototype.readInt32BE=function(e,t){return t||xt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},st.prototype.readFloatLE=function(e,t){return t||xt(e,4,this.length),Ke(this,e,!0,23,4)},st.prototype.readFloatBE=function(e,t){return t||xt(e,4,this.length),Ke(this,e,!1,23,4)},st.prototype.readDoubleLE=function(e,t){return t||xt(e,8,this.length),Ke(this,e,!0,52,8)},st.prototype.readDoubleBE=function(e,t){return t||xt(e,8,this.length),Ke(this,e,!1,52,8)},st.prototype.writeUIntLE=function(e,t,s,i){(e=+e,t|=0,s|=0,i)||Nt(this,e,t,s,Math.pow(2,8*s)-1,0);var a=1,n=0;for(this[t]=255&e;++n<s&&(a*=256);)this[t+n]=e/a&255;return t+s},st.prototype.writeUIntBE=function(e,t,s,i){(e=+e,t|=0,s|=0,i)||Nt(this,e,t,s,Math.pow(2,8*s)-1,0);var a=s-1,n=1;for(this[t+a]=255&e;--a>=0&&(n*=256);)this[t+a]=e/n&255;return t+s},st.prototype.writeUInt8=function(e,t,s){return e=+e,t|=0,s||Nt(this,e,t,1,255,0),st.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},st.prototype.writeUInt16LE=function(e,t,s){return e=+e,t|=0,s||Nt(this,e,t,2,65535,0),st.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Mt(this,e,t,!0),t+2},st.prototype.writeUInt16BE=function(e,t,s){return e=+e,t|=0,s||Nt(this,e,t,2,65535,0),st.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Mt(this,e,t,!1),t+2},st.prototype.writeUInt32LE=function(e,t,s){return e=+e,t|=0,s||Nt(this,e,t,4,4294967295,0),st.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Lt(this,e,t,!0),t+4},st.prototype.writeUInt32BE=function(e,t,s){return e=+e,t|=0,s||Nt(this,e,t,4,4294967295,0),st.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Lt(this,e,t,!1),t+4},st.prototype.writeIntLE=function(e,t,s,i){if(e=+e,t|=0,!i){var a=Math.pow(2,8*s-1);Nt(this,e,t,s,a-1,-a)}var n=0,r=1,l=0;for(this[t]=255&e;++n<s&&(r*=256);)e<0&&0===l&&0!==this[t+n-1]&&(l=1),this[t+n]=(e/r>>0)-l&255;return t+s},st.prototype.writeIntBE=function(e,t,s,i){if(e=+e,t|=0,!i){var a=Math.pow(2,8*s-1);Nt(this,e,t,s,a-1,-a)}var n=s-1,r=1,l=0;for(this[t+n]=255&e;--n>=0&&(r*=256);)e<0&&0===l&&0!==this[t+n+1]&&(l=1),this[t+n]=(e/r>>0)-l&255;return t+s},st.prototype.writeInt8=function(e,t,s){return e=+e,t|=0,s||Nt(this,e,t,1,127,-128),st.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},st.prototype.writeInt16LE=function(e,t,s){return e=+e,t|=0,s||Nt(this,e,t,2,32767,-32768),st.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Mt(this,e,t,!0),t+2},st.prototype.writeInt16BE=function(e,t,s){return e=+e,t|=0,s||Nt(this,e,t,2,32767,-32768),st.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Mt(this,e,t,!1),t+2},st.prototype.writeInt32LE=function(e,t,s){return e=+e,t|=0,s||Nt(this,e,t,4,2147483647,-2147483648),st.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Lt(this,e,t,!0),t+4},st.prototype.writeInt32BE=function(e,t,s){return e=+e,t|=0,s||Nt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),st.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Lt(this,e,t,!1),t+4},st.prototype.writeFloatLE=function(e,t,s){return At(this,e,t,!0,s)},st.prototype.writeFloatBE=function(e,t,s){return At(this,e,t,!1,s)},st.prototype.writeDoubleLE=function(e,t,s){return Ot(this,e,t,!0,s)},st.prototype.writeDoubleBE=function(e,t,s){return Ot(this,e,t,!1,s)},st.prototype.copy=function(e,t,s,i){if(s||(s=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<s&&(i=s),i===s)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-s&&(i=e.length-t+s);var a,n=i-s;if(this===e&&s<t&&t<i)for(a=n-1;a>=0;--a)e[a+t]=this[a+s];else if(n<1e3||!st.TYPED_ARRAY_SUPPORT)for(a=0;a<n;++a)e[a+t]=this[a+s];else Uint8Array.prototype.set.call(e,this.subarray(s,s+n),t);return n},st.prototype.fill=function(e,t,s,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,s=this.length):"string"==typeof s&&(i=s,s=this.length),1===e.length){var a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!st.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<s)throw new RangeError("Out of range index");if(s<=t)return this;var n;if(t>>>=0,s=void 0===s?this.length:s>>>0,e||(e=0),"number"==typeof e)for(n=t;n<s;++n)this[n]=e;else{var r=ot(e)?e:Tt(new st(e,i).toString()),l=r.length;for(n=0;n<s-t;++n)this[n+t]=r[n%l]}return this};var Dt=/[^+\/0-9A-Za-z-_]/g;function kt(e){return e<16?"0"+e.toString(16):e.toString(16)}function Tt(e,t){var s;t=t||1/0;for(var i=e.length,a=null,n=[],r=0;r<i;++r){if((s=e.charCodeAt(r))>55295&&s<57344){if(!a){if(s>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(r+1===i){(t-=3)>-1&&n.push(239,191,189);continue}a=s;continue}if(s<56320){(t-=3)>-1&&n.push(239,191,189),a=s;continue}s=65536+(a-55296<<10|s-56320)}else a&&(t-=3)>-1&&n.push(239,191,189);if(a=null,s<128){if((t-=1)<0)break;n.push(s)}else if(s<2048){if((t-=2)<0)break;n.push(s>>6|192,63&s|128)}else if(s<65536){if((t-=3)<0)break;n.push(s>>12|224,s>>6&63|128,63&s|128)}else{if(!(s<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(s>>18|240,s>>12&63|128,s>>6&63|128,63&s|128)}}return n}function Pt(e){return function(e){var t,s,i,a,n,r;$e||Je();var l=e.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");n="="===e[l-2]?2:"="===e[l-1]?1:0,r=new ze(3*l/4-n),i=n>0?l-4:l;var o=0;for(t=0,s=0;t<i;t+=4,s+=3)a=Ue[e.charCodeAt(t)]<<18|Ue[e.charCodeAt(t+1)]<<12|Ue[e.charCodeAt(t+2)]<<6|Ue[e.charCodeAt(t+3)],r[o++]=a>>16&255,r[o++]=a>>8&255,r[o++]=255&a;return 2===n?(a=Ue[e.charCodeAt(t)]<<2|Ue[e.charCodeAt(t+1)]>>4,r[o++]=255&a):1===n&&(a=Ue[e.charCodeAt(t)]<<10|Ue[e.charCodeAt(t+1)]<<4|Ue[e.charCodeAt(t+2)]>>2,r[o++]=a>>8&255,r[o++]=255&a),r}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Dt,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Vt(e,t,s,i){for(var a=0;a<i&&!(a+s>=t.length||a>=e.length);++a)t[a+s]=e[a];return a}function jt(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function Zt(e){return Array(2*e).fill(" ").join("")}function Bt(e,t=1){return void 0===e?"undefined":null===e?"null":e instanceof Date||e instanceof st||e instanceof Uint8Array||"object"!=typeof e?"string"==typeof(s=e)?`"${s}"`:"bigint"==typeof s?`BigInt(${s})`:s instanceof Date?`"${s.toISOString()}"`:s instanceof st?`Buffer.from("${s.toString("base64")}", "base64")`:s instanceof Uint8Array?`Buffer.from("${st.from(s).toString("base64")}", "base64")`:`${s}`:Array.isArray(e)?["[",e.map((e=>[Zt(t),Bt(e,t+1),","].join(""))).join("\n"),Zt(t-1)+"]"].join("\n"):["{",Object.entries(e).map((([e,s])=>[Zt(t),e,": ",Bt(s,t+1),","].join(""))).join("\n"),Zt(t-1)+"}"].join("\n");var s}const Ft=e=>{const t=[];return e.filter((e=>"delete"===e.type)).forEach((s=>{if(!s.record)throw B({path:"photonRequestsFromActions._delete",message:"Unrecognized Record in Action",context:{action:s.serialize()}});const i=s.record.model,a={where:zt(s)};t.push([`prisma.${i.photonNamespace}.delete(`,`${Bt(a)}`,")"].join("\n")),e=e.filter((e=>s.id!==e.id&&s.recordId!==e.recordId))})),{actions:e,requests:t}},Ht=e=>{const t=[];return e.filter((e=>"create"===e.type)).forEach((s=>{if(!s.record)throw B({path:"photonRequestsFromActions._create",message:"Unrecognized Record in Action",context:{action:s.serialize()}});const i=s.record.model,a={data:{},select:Ut(s)},r=e.find((e=>"update"===e.type&&e.sessionId===s.sessionId&&e.recordId===s.recordId));r&&(a.data=Jt(r),a.select=n(n({},a.select),Ut(r))),t.push([`prisma.${i.photonNamespace}.create(`,`${Bt(a)}`,")"].join("\n")),e=e.filter((e=>e.id!==(null==r?void 0:r.id)&&s.id!==e.id))})),{actions:e,requests:t}},qt=e=>{const t=[];return e.filter((e=>"update"===e.type)).forEach((s=>{if(!s.record)throw B({path:"photonRequestsFromActions._update",message:"Unrecognized Record in Action",context:{action:s.serialize()}});const i=s.record.model,a={where:zt(s),data:$t(s),select:Ut(s)};t.push([`prisma.${i.photonNamespace}.update(`,`${Bt(a)}`,")"].join("\n")),e=e.filter((e=>s.id!==e.id))})),{actions:e,requests:t}},Ut=e=>{if(!e.record)throw B({path:"photonRequestsFromActions._getRequestSelectArgument",message:"Unrecognized Record in Action",context:{action:e.serialize()}});const t=e.record.model.uniqueIdentifiers.reduce(((e,t)=>(e[t.name]=!0,e)),{});return"create"===e.type||"delete"===e.type?t:Object.keys(e.value).reduce(((e,t)=>(e[t]=!0,e)),t)},zt=e=>{if(!e.record)throw B({path:"photonRequestsFromActions._getRequestWhereArgument",message:"Unrecognized Record in Action",context:{action:e.serialize()}});const t=e.record.model.uniqueIdentifiers,s=t.map((e=>e.name)).join("_"),i=t.reduce(((t,s)=>(t[s.name]=e.record.valueInDB[s.name],t)),{});return 1===t.length?i:{[s]:i}},$t=e=>{if(!e.record)throw B({path:"photonRequestsFromActions._getUpdateRequestDataArgument",message:"Unrecognized Record in Action",context:{action:e.serialize()}});const t=e.record.model;return Object.keys(e.value).reduce(((s,i)=>{const a=t.getFieldByName(i),n=e.value[i];if(!a)throw B({path:"photonRequestsFromActions._getUpdateRequestDataArgument",message:"Malformed field in action",context:{action:e.serialize()}});if(a.isReadOnly)return s;if(void 0===n)return s;if(a.isScalar&&a.isList||a.isEnum&&a.isList)s[i]={set:n};else if(a.isScalar||a.isEnum)s[i]=n;else if(a.isList&&a.isRelation){if(!a.typeAsModel)throw B({path:"photonRequestsFromActions._getUpdateRequestDataArgument",message:"Invalid field type",context:{field:a.serialize()}});const t=(e.record.valueInDB[i]||[]).map((e=>Me(a.typeAsModel.id,e))),r=n.map((e=>Me(a.typeAsModel.id,e))),o=l.difference(r,t),d=l.difference(t,r);s[i]={},l.isEmpty(o)||(s[i].connect=o.map(((e,t)=>{const s=Vs.get(e)||Vs.add({id:e,modelId:a.typeAsModel.id,value:n[t]}),i=s.model.uniqueIdentifiers,r=i.map((e=>e.name)).join("_"),l=i.reduce(((e,t)=>(e[t.name]=s.valueInDB[t.name],e)),{});return 1===i.length?l:{[r]:l}}))),l.isEmpty(d)||(s[i].disconnect=d.map(((t,s)=>{const i=Vs.get(t);if(!i)throw B({path:"photonRequestsFromActions._getUpdateRequestDataArgument",message:"Attempting to disconnect a non-existent record",context:{action:e.serialize(),index:s}});const a=i.model.uniqueIdentifiers,n=a.map((e=>e.name)).join("_"),r=a.reduce(((e,t)=>(e[t.name]=i.valueInDB[t.name],e)),{});return 1===a.length?r:{[n]:r}})))}else if(a.isRelation)if(null===n)s[i]={disconnect:!0};else{if(!a.typeAsModel)throw B({path:"photonRequestsFromActions._getUpdateRequestDataArgument",message:"Invalid field type",context:{field:a.serialize()}});const e=Me(a.typeAsModel.id,n),t=Vs.get(e)||Vs.add({id:e,modelId:a.typeAsModel.id,value:n}),r=t.model.uniqueIdentifiers,l=r.map((e=>e.name)).join("_"),o=r.reduce(((e,s)=>(e[s.name]=t.valueInDB[s.name],e)),{});1===r.length?s[i]={connect:o}:s[i]={connect:{[l]:o}}}return s}),{})},Jt=e=>{const t=$t(e);return Object.keys(t).forEach((s=>{if(!e.record)throw B({path:"photonRequestsFromActions._getCreateRequestDataArgument",message:"Unrecognized Record in Action",context:{action:e.serialize()}});const i=e.record.model.getFieldByName(s);if(!i)throw B({path:"photonRequestsFromActions._getUpdateRequestDataArgument",message:"Malformed field in action",context:{action:e.serialize()}});i.isRelation&&!i.isList&&t[s].disconnect&&delete t[s],i.isRelation&&i.isList&&t[s].disconnect&&delete t[s].disconnect})),t};var Yt=Object.defineProperty,Wt=Object.getOwnPropertyDescriptor,Kt=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?Wt(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&Yt(t,s,n),n};class Gt{constructor(e){this.update=e=>{l.has(e,"selectedRecordIds")&&(this.selectedRecordIds=e.selectedRecordIds)},this.sessionId=e.sessionId,this.selectedRecordIds=[]}get session(){return gs.get(this.sessionId)}get maxRows(){var e,t;return(null==(t=null==(e=this.session)?void 0:e.script)?void 0:t.recordIds.length)||0}get maxColumns(){var e,t;return(null==(t=null==(e=this.session)?void 0:e.script)?void 0:t.fieldIds.length)||0}get selectedRecords(){return this.selectedRecordIds.map((e=>Vs.get(e)))}}Kt([o],Gt.prototype,"sessionId",2),Kt([o],Gt.prototype,"selectedRecordIds",2),Kt([g],Gt.prototype,"session",1),Kt([g],Gt.prototype,"maxRows",1),Kt([g],Gt.prototype,"maxColumns",1),Kt([g],Gt.prototype,"selectedRecords",1),Kt([d],Gt.prototype,"update",2);const Qt=(e,t)=>{const s=e.split("::"),i=Number(s[0].slice(1,-1));if(isNaN(i))throw B({path:"parseTreePath",message:"Invalid tree path: Failed to parse segment as index",context:{path:e,recordIdx:i}});const a=Vs.get(t[i]);if(!a)throw B({path:"parseTreePath",message:"Invalid tree path: Invalid record index",context:{path:e,recordIdx:i}});return s.slice(1).reduce((({model:t,field:s,index:i,record:a,value:n,arraySliceIndices:r},l)=>{var o,d,c,h,p,u;if(l.startsWith("[")&&l.endsWith("]"))if(s=null,i=Number(l.slice(1,-1)),isNaN(i)){const e=l.slice(1,-1).split("-");r=[Number(e[0]),Number(e[1])],i=null,a=null,n=n.slice(r[0],r[1]+1)}else if(t){const c=Me(t.id,n[i]);if(!c)throw B({path:"parseTreePath",message:"Invalid tree path: Failed to parse tree path segment as array",context:{path:e,fieldName:l,recordId:c,accumulator:{model:t,field:s,index:i,record:a,value:n,arraySliceIndices:r}}});n=null!=(d=null==(a=null!=(o=Vs.get(c))?o:null)?void 0:a.value)?d:null}else a=null,n=null!=(c=n[i])?c:null;else{if(!t)throw B({path:"parseTreePath",message:"Invalid tree path: Failed to parse tree path segment as field name",context:{path:e,fieldName:l,accumulator:{model:t,field:s,index:i,record:a,value:n,arraySliceIndices:r}}});if(!(s=t.getFieldByName(l)))throw B({path:"parseTreePath",message:"Invalid field name",context:{path:e,fieldName:l,accumulator:{model:t,field:s,index:i,record:a,value:n,arraySliceIndices:r}}});if(t=null!=(h=s.typeAsModel)?h:null,i=null,a=null,n=n[l],r=null,!s.isScalar&&!s.isEnum&&!Array.isArray(n)&&null!=n){const o=t&&Me(t.id,n);if(!o)throw B({path:"parseTreePath",message:"Invalid tree path: Failed to parse tree path segment as relation",context:{path:e,fieldName:l,recordId:o,accumulator:{model:t,field:s,index:i,record:a,value:n,arraySliceIndices:r}}});n=null!=(u=null==(a=null!=(p=Vs.get(o))?p:null)?void 0:a.value)?u:null}}return{model:t,field:s,index:i,record:a,value:n,arraySliceIndices:r}}),{model:a.model,field:null,index:null,record:a,value:a.value,arraySliceIndices:null})};var Xt=Object.defineProperty,es=Object.getOwnPropertyDescriptor,ts=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?es(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&Xt(t,s,n),n};class ss{constructor(e){this.selectionOrder=[],this.isExpanded=e=>this.expandedPaths.includes(e),this.select=e=>{this.activePath=e},this.move=(e,t)=>{0===this.selectionOrder.length&&this.setSelectionOrder();const s=this.selectionOrder.findIndex((e=>e===this.activePath));let i;switch(t){case"up":i=this.selectionOrder[s-e];break;case"down":i=this.selectionOrder[s+e]}this.activePath=i||"[0]"},this.expand=()=>{var e,t;if(this.isExpanded(this.activePath))return;if(!(null==(e=this.session)?void 0:e.script))throw B({path:"SessionSelectionTree.expand",message:"Unable to resolve recordIds",context:{sessionId:this.sessionId,scriptId:null==(t=this.session)?void 0:t.scriptId}});const{record:s,value:i,field:a}=Qt(this.activePath,this.session.script.recordIds);null!=i&&((null==a?void 0:a.isList)||!(null==a?void 0:a.isScalar)&&!(null==a?void 0:a.isEnum))&&0!==(null==i?void 0:i.length)&&(this.expandedPaths.push(this.activePath),this.setSelectionOrder(),s&&s.fetchRelations())},this.collapse=()=>{this.expandedPaths=this.expandedPaths.filter((e=>!e.startsWith(this.activePath))),this.setSelectionOrder()},this.update=e=>{l.has(e,"isEditing")&&(this.isEditing=e.isEditing)},this.reset=()=>{this.isEditing=!1},this.sessionId=e.sessionId,this.isEditing=e.isEditing,this.activePath="",this.expandedPaths=[]}get session(){return gs.get(this.sessionId)}jumpToParent(){const e=this.activePath.split("::").slice(0,-1).join("::");""!=e&&(this.activePath=e)}setSelectionOrder(){var e,t;if(!(null==(e=this.session)?void 0:e.script))throw B({path:"SessionSelectionTree.setSelectionOrder",message:"Unable to resolve recordIds",context:{sessionId:this.sessionId,scriptId:null==(t=this.session)?void 0:t.scriptId}});const{recordIds:s}=this.session.script;let i=s.map(((e,t)=>`[${t}]`));this.expandedPaths.forEach((e=>{const{value:t,model:a}=Qt(e,s),n=i.findIndex((t=>t===e)),r=[];if(r.push(i[n]),Array.isArray(t))if(t.length<=100)r.push(...Array.from({length:t.length}).map(((t,s)=>`${e}::[${s}]`)));else{const s=Math.floor(t.length/100);r.push(...Array.from({length:s}).map(((t,s)=>`${e}::[${100*s}-${100*(s+1)-1}]`))),t.length%100!=0&&r.push(`${e}::[${100*s}-${100*s+t.length%100-1}]`)}else null!==t&&a&&r.push(...a.fields.map((t=>`${e}::${t.name}`)));i=[...i.slice(0,n),...r,...i.slice(n+1)]})),this.selectionOrder=i}}ts([o],ss.prototype,"sessionId",2),ts([o],ss.prototype,"isEditing",2),ts([o],ss.prototype,"activePath",2),ts([o],ss.prototype,"expandedPaths",2),ts([o],ss.prototype,"selectionOrder",2),ts([g],ss.prototype,"session",1),ts([d],ss.prototype,"select",2),ts([d],ss.prototype,"move",2),ts([d],ss.prototype,"expand",2),ts([d],ss.prototype,"collapse",2),ts([d],ss.prototype,"jumpToParent",1),ts([d],ss.prototype,"setSelectionOrder",1),ts([d],ss.prototype,"update",2),ts([d],ss.prototype,"reset",2);var is=Object.defineProperty,as=Object.getOwnPropertyDescriptor,ns=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?as(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&is(t,s,n),n};class rs{constructor(e){this.table=new Gt(e.table),this.tree=new ss(e.tree)}}ns([o],rs.prototype,"table",2),ns([o],rs.prototype,"tree",2);var ls=Object.defineProperty,os=Object.getOwnPropertyDescriptor,ds=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?os(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&ls(t,s,n),n};class cs extends X{constructor(e){var t,s;super(e),this.createUncommittedRecord=()=>{if(!this.isScript)return;const e=Ms.add({type:"create",recordId:null,sessionId:this.id,value:{modelId:this.script.modelId}});Ms.add({type:"update",recordId:e.recordId,sessionId:this.id,value:this.script.model.fields.reduce(((e,t)=>(t.isId?e[t.name]=void 0:void 0!==t.default?t.isFunctionDefault?e[t.name]=void 0:e[t.name]=t.default:!t.isScalar&&!t.isEnum||t.isPartOfRelation?t.isRelation&&t.isList?e[t.name]=t.lowestValidValue:e[t.name]=void 0:e[t.name]=t.lowestValidValue,e)),{})})},this.update=(e,t={})=>{l.has(e,"lastSavedHash")&&(this.lastSavedHash=e.lastSavedHash),super.update(e,t)},this.serialize=()=>({projectId:_i.activeProjectId,id:this.id,type:this.type,lastSavedHash:this.lastSavedHash,scriptId:this.scriptId}),this.id=e.id,this.type=e.type,this.scriptId=null!=(t=e.scriptId)?t:null,this.lastSavedHash=null!=(s=e.lastSavedHash)?s:this.hash,this.selection=new rs({table:{sessionId:this.id,selectedRecordIds:[]},tree:{sessionId:this.id,isEditing:!1}})}get script(){if(!this.isScript)throw B({path:"Session.script",message:"Invalid `get` call to script: Session is not a `script` type",context:{type:this.type,scriptId:this.scriptId}});const e=ri.get(this.scriptId);if(!e)throw B({path:"Session.script",message:"Invalid scriptId in session",context:{type:this.type,scriptId:this.scriptId}});return e}get name(){return this.isScript?this.script.model.name:"Session Name"}get isScript(){return"script"===this.type}get isModelList(){return"model-list"===this.type}get isDirty(){return this.isScript?!this.script.frozen&&(null===this.script.name||(!!Object.values(Ms.values).filter((e=>e.sessionId===this.id))||null!==this.script.name&&this.lastSavedHash!==this.hash)):this.lastSavedHash!==this.hash}get hash(){return this.isScript?this.script.hash:""}forceSave(){this.isDirty&&this.update({lastSavedHash:this.hash})}discardChanges(){if(this.isScript)try{const{code:e,modelId:t,where:s,fieldIds:i,sortFieldId:a,sortOrder:n}=JSON.parse(this.lastSavedHash);this.script.update({code:e,modelId:t,where:s,fieldIds:i,sort:{fieldId:a,order:n}})}catch(e){console.log("Could not restore session",e)}}}ds([o],cs.prototype,"id",2),ds([o],cs.prototype,"type",2),ds([o],cs.prototype,"scriptId",2),ds([o],cs.prototype,"lastSavedHash",2),ds([g],cs.prototype,"script",1),ds([g],cs.prototype,"name",1),ds([g],cs.prototype,"isScript",1),ds([g],cs.prototype,"isModelList",1),ds([g],cs.prototype,"isDirty",1),ds([g],cs.prototype,"hash",1),ds([d],cs.prototype,"createUncommittedRecord",2),ds([d],cs.prototype,"forceSave",1),ds([d],cs.prototype,"discardChanges",1),ds([d],cs.prototype,"update",2);var hs=Object.defineProperty,ps=Object.getOwnPropertyDescriptor,us=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?ps(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&hs(t,s,n),n};class ms extends W{constructor(){super(cs,{idbTableName:"sessions"}),this.findOrCreate=({scriptId:e})=>Object.values(this.values).find((t=>t.scriptId===e))||this.add({type:"script",scriptId:e,lastSavedHash:null}),this.remove=e=>{const t=super.remove(e);return Object.values(Ms.values).forEach((t=>{t.sessionId===e&&Ms.remove(t.id)})),t}}}us([d],ms.prototype,"findOrCreate",2),us([d],ms.prototype,"remove",2);var gs=new ms;const fs=(e,t)=>e.isList?Array.isArray(t)?t.every((t=>e.isEnum?!vs(e,t):e.isRelation?!ys(e,t):!Is(e,t)))?void 0:"Every value in this list must be valid":"Value must be a list":e.isEnum?vs(e,t):e.isRelation?ys(e,t):Is(e,t),vs=(e,t)=>{if(!e.isRequired&&l.isNil(t))return;if(void 0===t&&void 0!==e.default)return;const s=e.typeAsEnum;return s&&s.values.includes(t)?void 0:"Value must be an Enum variant"},ys=(e,t)=>{if(!e.isRequired&&l.isNil(t))return;if(e.isRequired&&!t)return"Required fields must not be `null`";return e.typeAsModel?void 0:`Value must be a ${e.type} identifier`},Is=(e,t)=>{if((void 0!==t||void 0===e.default)&&(e.isList||e.isRequired||!l.isNil(t)))return e.isRequired&&l.isNil(t)?"Required fields must not be `null`":e.isString&&"string"!=typeof t?"Value must be a String":!e.isInt||"number"==typeof t&&!isNaN(t)&&Number.isInteger(t)?e.isFloat&&("number"!=typeof t||isNaN(t))?"Value must be a Float":e.isBigInt&&"bigint"!=typeof t?"Value must be a valid BigInt":e.isBoolean&&"boolean"!=typeof t?"Value must be a Boolean":e.isDateTime&&isNaN(new Date(String(t)))?"Value must be a valid DateTime":e.isJson&&"object"!=typeof t?"Value must be a valid Json":void 0:"Value must be an Integer"};var Cs=Object.defineProperty,ws=Object.getOwnPropertyDescriptor,Es=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?ws(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&Cs(t,s,n),n};class bs extends X{constructor(e){if(super(e),this.serialize=()=>({projectId:_i.activeProjectId,id:this.id,type:this.type,recordId:this.recordId,sessionId:this.sessionId,value:v(this.value)}),this.id=e.id,this.sessionId=e.sessionId,this.type=e.type,this.value=e.value,"create"===this.type){const t=`tmp--${this.id}`,s=e.value.modelId;Vs.add({id:t,modelId:s,value:{}}),this.recordId=t}else this.recordId=e.recordId}get record(){return this.recordId?Vs.get(this.recordId):null}get session(){return gs.get(this.sessionId)}get isValid(){return(e=>{const t=Ms.get(e);if(!t)throw B({path:"isActionValid",message:"Invalid action",context:{actionId:e}});const s=Vs.get(t.recordId);if(!s)return!1;const i=s.model;if(!i)return!1;const a=Object.keys(t.value);switch(t.type){case"create":return!!Ne.get(t.value.modelId);case"delete":return!!Vs.get(t.recordId);case"update":return a.every((e=>{const s=i.getFieldByName(e),a=t.value[e];return!!s&&!fs(s,a)}));default:return!1}})(this.id)}update(e,t={}){l.has(e,"recordId")&&(this.recordId=e.recordId),l.has(e,"sessionId")&&(this.sessionId=e.sessionId),l.has(e,"value")&&(this.value=e.value),super.update(e,t)}}Es([o],bs.prototype,"id",2),Es([o],bs.prototype,"recordId",2),Es([o],bs.prototype,"sessionId",2),Es([o],bs.prototype,"type",2),Es([o],bs.prototype,"value",2),Es([g],bs.prototype,"record",1),Es([g],bs.prototype,"session",1),Es([g],bs.prototype,"isValid",1),Es([d],bs.prototype,"update",1);var _s=Object.defineProperty,Ss=Object.getOwnPropertyDescriptor,xs=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?Ss(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&_s(t,s,n),n};class Ns extends W{constructor(){super(bs,{idbTableName:"actions"}),this.committing=!1,this.add=(e,t={})=>{var s;const i=super.add(e,t);return this.consolidate(),this.actions.length>0&&(null==(s=gi.activeTab)||s.update({preview:!1}),De.updateActions({visible:!0})),i},this.remove=e=>{const t=super.remove(e);return 0===this.actions.length&&De.updateActions({visible:!1}),t},this.commit=async()=>{var e,t;if(this.invalidActions.length>0)return console.error("Commit failed: Some actions are invalid",this.invalidActions),He.update({type:"fatal",description:"Failed to commit changes because some actions are invalid",dump:`Invalid actions: \n${JSON.stringify(this.invalidActions,null,2)}`}),void De.updateError({visible:!0});if(!(null==(t=null==(e=gi.activeTab)?void 0:e.session)?void 0:t.isScript))return;const s=this.actions;let i=[];try{i=(e=>{const t=e.map((e=>Ms.get(e))),s=[Ft,Ht,qt].reduce(((e,t)=>{const s=t(e.actions);return e.actions=s.actions,e.requests.push(...s.requests),e}),{actions:t,requests:[]});return s.actions.length>0&&console.warn("All actions were not processed. Pending actions: ",JSON.stringify(v(s.actions),null,2)),s.requests})(s.map((e=>e.id)))}catch(a){throw console.error("Commit failed: Unable to generate Prisma Client requests",a),He.update({type:"fatal",description:"An unexpected error occurred while saving your changes",dump:`Message: ${a.message}\n`}),De.updateError({visible:!0}),a}y((()=>this.committing=!0));try{const{error:e}=await window.transport.request({channel:"prisma",action:"clientRequest",payload:{data:{schemaHash:_i.activeProject.schemaHash,query:`prisma.$transaction([ ${i.join(",")} ])`}}});if(e)throw e;this.actions.filter((e=>"create"===e.type)).forEach((e=>{var t;return null==(t=e.record)?void 0:t.model.update({count:(e.record.model.count||0)+1})})),this.actions.filter((e=>"delete"===e.type)).forEach((e=>{var t;return null==(t=e.record)?void 0:t.model.update({count:(e.record.model.count||0)-1})})),this.discard(),y((()=>this.committing=!1))}catch(a){y((()=>this.committing=!1));const e=gi.activeTab.session.script.model;if("PrismaClientSchemaDriftedError"===a.type)He.update({type:"schemaDrift",description:"Your source Prisma Schema has changed. Please reload Studio to continue. Your changes will be saved.",dump:""});else if("PrismaClientRustPanicError"===a.type||"PrismaClientUnknownRequestError"===a.type)He.update({type:"fatal",description:`An unexpected error occurred while saving your changes to the \`${e.name}\` table`,dump:`Message: ${a.message}\n\nQuery: \n${i[0]}\n`});else{const e=`Type: ${a.type}\nMessage: ${a.message}\n\nCode: ${a.code}\n\nQuery:\n${i[0]}\n`;He.update({type:"client",description:`Failed to commit changes: ${a.message}`,dump:e})}throw De.updateError({visible:!0}),a}},this.discard=()=>{const e=[...this.actions];for(let t=0;t<e.length;t++)this.remove(e[t].id);De.updateActions({visible:!1})},this.consolidate=()=>{const e=Object.values(this.values).map((e=>e.id)),t=new Set,s=(i,a)=>{const r=this.get(i);if(!r)return;const l=e.findIndex(((e,t)=>{if(t<=a)return!1;const s=this.get(e);return!!s&&(s.sessionId===r.sessionId&&s.recordId===r.recordId&&s.type===r.type)}));if(-1===l)return;const o=this.get(e[l]);return o?(r.update({value:n(n({},r.value),o.value)}),t.add(e[l]),e.splice(l,1),s(i,a)):void 0};e.forEach(s);e.forEach((s=>{const i=this.get(s);i&&"delete"===i.type&&e.forEach((e=>{var a;const n=this.get(e);n&&(n&&"delete"!==n.type&&n.recordId===i.recordId&&t.add(e),(null==(a=n.record)?void 0:a.isCommitted)||t.add(s))}))})),t.forEach((e=>this.remove(e)))}}get actions(){return Object.values(this.values).filter((e=>{var t;return e.sessionId===(null==(t=gi.activeTab)?void 0:t.sessionId)}))}get invalidActions(){return this.actions.filter((e=>!e.isValid))}}xs([o],Ns.prototype,"committing",2),xs([g],Ns.prototype,"actions",1),xs([g],Ns.prototype,"invalidActions",1),xs([d],Ns.prototype,"add",2),xs([d],Ns.prototype,"remove",2),xs([d],Ns.prototype,"commit",2),xs([d],Ns.prototype,"discard",2),xs([d],Ns.prototype,"consolidate",2);var Ms=new Ns;const Ls=async e=>{let{error:t,data:s}=await window.transport.request({channel:"prisma",action:"clientRequest",payload:{data:{schemaHash:_i.activeProject.schemaHash,query:e}}});if(t)throw B({path:"runQuery",code:t.code,type:t.type,stack:t.stack,message:`Error in Prisma Client request: \n\n${t.message}`,context:{code:e,error:t}});if(!s)throw B({path:"runQuery",message:`Malformed response from Prisma Client: \n\n${s}`,context:{code:e}});let{params:i,response:a}=s;const n=Ne.getByName(i.model);if(!n)throw B({path:"runQuery",message:"Unrecognized Model",context:{params:i,response:a}});const r=Object.entries(i.args.select||i.args.include||{}).filter((([e,t])=>!!t)).map((([e])=>{var t;return null==(t=ye.getByName(n.id,e))?void 0:t.id})).filter((e=>!!e));if(!a)return Promise.resolve({modelId:n.id,fieldIds:r,recordIds:[]});Array.isArray(a)||(a=[a]);const l=a.map((e=>Vs.add({modelId:n.id,value:e}).id));return{modelId:n.id,fieldIds:r,recordIds:l}};var Rs=Object.defineProperty,As=Object.getOwnPropertyDescriptor,Os=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?As(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&Rs(t,s,n),n};class Ds extends X{constructor(e){super(e),this.fetchRelations=async()=>{try{if(!this.isCommitted)return;await Ls((e=>{const t=Vs.get(e);if(!t)throw B({path:"getFindOneQuery",message:"Invalid recordId",context:{recordId:e}});const s=t.model,i=s.uniqueIdentifiers,a=i.map((e=>e.name)).join("_"),n=i.map((e=>`${e.name}: ${Bt(t.value[e.name])}`)).join(", ");let r;return r=1===i.length?`{ ${n} }`:`{ ${a}: { ${n} } }`,[`prisma.${s.photonNamespace}.findUnique({`,` where: ${r},`," select: {",` ${s.fields.map((e=>`${e.name}: true`)).join(",\n ")}`," }","})"].join("\n")})(this.id))}catch(e){He.update({type:"client",description:"Unable to fetch record",dump:e.message}),De.updateError({visible:!0})}},this.id=e.id,this.valueInDB=e.value||{},this.modelId=e.modelId}get model(){let e=Ne.get(this.modelId);if(!e)throw B({path:"Record.model",message:"Invalid modelId",context:{modelId:this.modelId}});return e}get value(){const e=Ms.actions.filter((e=>e.recordId===this.id&&"update"===e.type));if(0==e.length)return this.valueInDB;const t=e[0];return this.model.fields.reduce(((e,s)=>void 0===t.value[s.name]?(e[s.name]=this.valueInDB[s.name],e):(e[s.name]=t.value[s.name],e)),{})}get isCommitted(){return!this.id.startsWith("tmp-")}get dirtyFieldNames(){if(!this.isCommitted)return this.model.fields.map((e=>e.name));const e=Ms.actions.filter((e=>{var t;return e.sessionId===(null==(t=gi.activeTab)?void 0:t.sessionId)&&e.recordId===this.id})).reduce(((e,t)=>(Object.keys(t.value).forEach((t=>{e.add(t)})),e)),new Set);return Array.from(e)}get invalidFields(){return Object.keys(this.value).map((e=>{const t=this.model.getFieldByName(e);if(!t)return;const s=fs(t,this.value[e]);return s?{field:t,reason:s}:void 0})).filter((e=>!!e))}update(e,t={}){l.has(e,"value")&&(this.valueInDB=n(n({},this.valueInDB),e.value)),super.update(e,t)}}Os([o],Ds.prototype,"id",2),Os([o],Ds.prototype,"modelId",2),Os([o],Ds.prototype,"valueInDB",2),Os([g],Ds.prototype,"model",1),Os([g],Ds.prototype,"value",1),Os([g],Ds.prototype,"isCommitted",1),Os([g],Ds.prototype,"dirtyFieldNames",1),Os([g],Ds.prototype,"invalidFields",1),Os([d],Ds.prototype,"update",1),Os([d],Ds.prototype,"fetchRelations",2);var ks=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor;class Ps extends W{constructor(){super(Ds)}add(e,t={}){var s;const i=null!=(s=e.id)?s:Me(e.modelId,e.value);if(!i)throw B({path:"RecordStore.add",message:"Unable to determine ID for record to create",context:{record:e}});const a=super.add(n({id:i},e));return Object.keys(e.value).forEach((s=>{var i;const n=a.model.getFieldByName(s);if(!n)throw B({path:"RecordStore.add",message:"Invalid field name",context:{fieldName:s,recordValue:e.value}});if(!n.isRelation)return;const r=null==(i=n.typeAsModel)?void 0:i.id;if(!r)throw B({path:"RecordStore.add",message:"Unable to create related records",context:{fieldId:n.id,type:n.type}});if(n.isList)e.value[s].map((e=>{const s=Me(r,e);!this.get(s)&&e&&this.add({modelId:r,value:e},t)}));else if(null!==e.value[s]){const i=Me(r,e.value[s]);!this.get(i)&&e.value[s]&&this.add({modelId:r,value:e.value[s]},t)}})),a}}((e,t,s,i)=>{for(var a,n=i>1?void 0:i?Ts(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);i&&n&&ks(t,s,n)})([d],Ps.prototype,"add",1);var Vs=new Ps;var js=new class{constructor(){this.inputObjectTypes=new Map,this.removeUnusedModels=e=>{const{models:t}=e.datamodel;l.difference(Object.values(Ne.values).map((e=>e.id)),t.map((e=>e.name))).forEach((e=>{Object.values(Ms.values).forEach((t=>{var s;(null==(s=t.session)?void 0:s.isScript)&&t.session.script.modelId===e&&Ms.remove(t.id)})),Object.values(gi.values).forEach((t=>{var s;(null==(s=t.session)?void 0:s.isScript)&&t.session.script.modelId===e&&gi.remove(t.id)})),Object.values(gs.values).forEach((t=>{(null==t?void 0:t.isScript)&&t.script.modelId===e&&gs.remove(t.id)})),Ne.remove(e)}))},this.removeUnusedFields=e=>{const{models:t}=e.datamodel;l.difference(Object.values(ye.values).map((e=>e.id)),l.flatten(t.map((e=>e.fields.map((t=>ve(e.name,t.name))))))).forEach((e=>ye.remove(e)))},this.removeUnusedEnums=e=>{const{enums:t}=e.datamodel;l.difference(Object.values(pe.values).map((e=>e.id)),t.map((e=>e.name))).forEach((e=>pe.remove(e)))}}get isPostgresDatasource(){return"postgresql"===this.datasourceProvider}hydrate(e,t){e.schema.inputObjectTypes.prisma.forEach((e=>this.inputObjectTypes.set(e.name,e))),this.datasourceProvider=t;const{models:s,enums:i}=e.datamodel;s.forEach((t=>{var s;const i=Ne.add({dbName:t.dbName,name:t.name,plural:(null==(s=e.mappings.modelOperations.find((e=>e.model===t.name)))?void 0:s.plural)||t.name,fieldIds:[],idFieldIds:[],uniqueFieldIds:[]}),a=t.fields.filter((e=>"unsupported"!==e.kind)).map((e=>ye.add({id:ve(i.id,e.name),modelId:i.id,name:e.name,type:e.type,kind:e.kind,default:e.default,isId:e.isId,isUnique:e.isUnique,isRequired:e.isRequired,isList:e.isList,isReadOnly:e.isReadOnly,isUpdatedAt:e.isUpdatedAt,relationName:e.relationName||"",relationFromFieldNames:e.relationFromFields||[],relationToFieldNames:e.relationToFields||[]}).id)),n=t.idFields.map((e=>ve(i.id,e)));let r=[];t.uniqueFields.length>0&&(r=t.uniqueFields[0].map((e=>ve(i.id,e)))),i.update({fieldIds:a,idFieldIds:n,uniqueFieldIds:r})})),i.forEach((e=>{pe.add({name:e.name,values:e.values.map((e=>e.name))})}))}};const Zs=(e,t)=>{if(!e.isScalar)return!1;if(e.isString)return"string"==typeof t;if(e.isInt||e.isFloat||e.isDecimal)return""!==t&&!isNaN(Number(t));if(e.isBigInt)try{return""!==t&&!!BigInt(t)}catch(s){return!1}if(e.isBoolean)return"true"===t||"false"===t;if(e.isDateTime)return!isNaN(new Date(t));if(e.isJson)try{return!!JSON.parse(t)}catch(s){return!1}return!!e.isBytes&&"string"==typeof t},Bs=(e,t)=>!!e.isEnum&&e.typeAsEnum.values.includes(t);var Fs=Object.defineProperty,Hs=Object.getOwnPropertyDescriptor,qs=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?Hs(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&Fs(t,s,n),n};class Us extends X{constructor(e){super(e),this.update=(e,t)=>{l.has(e,"fieldIds")&&(this.fieldIds=e.fieldIds),l.has(e,"operation")&&(this.operation=e.operation),l.has(e,"value")&&(this.value=e.value),l.has(e,"enabled")&&(this.enabled=e.enabled),this.script.update({where:[]}),super.update(e,t)},this.serialize=()=>({id:String(this.id),fieldIds:[...this.fieldIds],operation:String(this.operation),value:this.value,scriptId:String(this.scriptId),enabled:this.enabled}),this.id=e.id,this.fieldIds=e.fieldIds,this.operation=e.operation||this.supportedOperations[0],this.value=e.value,this.scriptId=e.scriptId,this.enabled=e.enabled||!0}get fields(){return this.fieldIds.map((e=>{const t=ye.get(e);if(!t)throw B({path:"ScriptWhereItem.fields",message:"Invalid fieldId",context:{fieldId:e}});return t}))}get script(){const e=ri.get(this.scriptId);if(!e)throw B({path:"ScriptWhereItem.script",message:"Invalid scriptId",context:{scriptId:this.scriptId}});return e}get supportedOperations(){const e=l.last(this.fields);if(!e)return[];let t;if(e.isRequired&&e.isString)t="StringFilter";else if(!e.isRequired&&e.isString)t="StringNullableFilter";else if(e.isRequired&&e.isInt)t="IntFilter";else if(!e.isRequired&&e.isInt)t="IntNullableFilter";else if(e.isRequired&&e.isFloat)t="FloatFilter";else if(!e.isRequired&&e.isFloat)t="FloatNullableFilter";else if(e.isRequired&&e.isBigInt)t="BigIntFilter";else if(!e.isRequired&&e.isBigInt)t="BigIntNullableFilter";else if(e.isRequired&&e.isDecimal)t="DecimalFilter";else if(!e.isRequired&&e.isDecimal)t="DecimalNullableFilter";else if(e.isRequired&&e.isBoolean)t="BoolFilter";else if(!e.isRequired&&e.isBoolean)t="BoolNullableFilter";else if(e.isRequired&&e.isDateTime)t="DateTimeFilter";else if(!e.isRequired&&e.isDateTime)t="DateTimeNullableFilter";else if(e.isRequired&&e.isJson)t="JsonFilter";else if(!e.isRequired&&e.isJson)t="JsonNullableFilter";else if(e.isRequired&&e.isBytes)t="BytesFilter";else if(!e.isRequired&&e.isBytes)t="BytesNullableFilter";else if(e.isRequired&&e.isEnum)t=`Enum${e.type}Filter`;else if(!e.isRequired&&e.isEnum)t=`Enum${e.type}NullableFilter`;else{if(!e.isRelation)throw B({path:"ScriptWhere.supportedOperations",message:"Unsupported field for `where` filter",context:{fields:this.fields.map((e=>null==e?void 0:e.serialize()))}});t=`${e.type}WhereInput`}const s=js.inputObjectTypes.get(t);if(!s)throw B({path:"ScriptWhere.supportedOperations",message:"Could not find appropriate InputType for this field type. This should never happen.",context:{inputTypeName:t,fields:this.fields.map((e=>null==e?void 0:e.serialize()))}});const i=s.fields.map((e=>e.name)).filter((e=>"mode"!==e));return e.isRequired||e.isRelation?i:i.concat(["isNull","isNotNull"])}get isValid(){return(e=>{var t,s,i,a,n,r,o;if(!e.enabled)return!0;if(!l.last(e.fields))return!1;if(!e.operation)return!1;if(!(null==(t=l.last(e.fields))?void 0:t.isScalar)&&!(null==(s=l.last(e.fields))?void 0:s.isEnum))return!1;if(e.fields.length>1&&!(null==(i=l.first(e.fields))?void 0:i.isRelation))return!1;if(["isNull","isNotNull"].includes(e.operation)&&!(null==(a=l.last(e.fields))?void 0:a.isRequired))return!0;if((null==(n=l.last(e.fields))?void 0:n.isRequired)&&(void 0===e.value||null===e.value))return!1;if(void 0===e.value||null===e.value)return!1;if(["in","notIn"].includes(e.operation))try{const t=JSON.parse(e.value);return Array.isArray(t)&&t.every((t=>{var s,i;return(null==(s=l.last(e.fields))?void 0:s.isScalar)?Zs(l.last(e.fields),t):!!(null==(i=l.last(e.fields))?void 0:i.isEnum)&&Bs(l.last(e.fields),t)}))}catch(d){return!1}return!!e.supportedOperations.includes(e.operation)&&((null==(r=l.last(e.fields))?void 0:r.isScalar)?Zs(l.last(e.fields),e.value):!(null==(o=l.last(e.fields))?void 0:o.isEnum)||Bs(l.last(e.fields),e.value))})(this)}getFilterableFieldsAtIndex(e){if(e>=this.fieldIds.length)throw B({path:"ScriptWhere.getFilterableFieldsAtIndex",message:"Index is out of range",context:{fieldIds:this.fieldIds,index:e}});if(0===e)return this.script.model.fields.filter((e=>e.isScalar&&!e.isList||e.isEnum&&!e.isList||e.isRelation));if(1===e){return ye.get(this.fieldIds[e-1]).typeAsModel.fields.filter((e=>e.isScalar&&!e.isList||e.isEnum&&!e.isList))}return[]}}qs([o],Us.prototype,"id",2),qs([o],Us.prototype,"fieldIds",2),qs([o],Us.prototype,"operation",2),qs([o],Us.prototype,"value",2),qs([o],Us.prototype,"scriptId",2),qs([o],Us.prototype,"enabled",2),qs([g],Us.prototype,"fields",1),qs([g],Us.prototype,"script",1),qs([g],Us.prototype,"supportedOperations",1),qs([g],Us.prototype,"isValid",1),qs([d],Us.prototype,"update",2);class zs extends W{constructor({modelId:e,scriptId:t}){super(Us),this.serialize=()=>Object.values(this.values).map((e=>e.serialize())),this.modelId=e,this.scriptId=t}get model(){let e=Ne.get(this.modelId);if(!e)throw B({path:"ScriptWhere.model",message:"Invalid modelId",context:{modelId:this.modelId}});return e}get script(){return ri.get(this.scriptId)}add(e,t){var s;const i=super.add(n(n({},e),{scriptId:this.scriptId}),t);return null==(s=this.script)||s.update({where:[]},t),i}}qs([o],zs.prototype,"modelId",2),qs([o],zs.prototype,"scriptId",2),qs([g],zs.prototype,"model",1),qs([g],zs.prototype,"script",1),qs([d],zs.prototype,"add",1);var $s=Object.defineProperty,Js=Object.getOwnPropertyDescriptor,Ys=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?Js(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&$s(t,s,n),n};class Ws{constructor(e){this.take=e.take,this.skip=e.skip}update(e={}){l.has(e,"take")&&(this.take=e.take),l.has(e,"skip")&&(this.skip=e.skip)}reset(){this.update({take:100,skip:0})}}Ys([o],Ws.prototype,"take",2),Ys([o],Ws.prototype,"skip",2),Ys([d],Ws.prototype,"update",1),Ys([d],Ws.prototype,"reset",1);var Ks=Object.defineProperty,Gs=Object.getOwnPropertyDescriptor,Qs=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?Gs(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&Ks(t,s,n),n};class Xs{constructor(e){this.fieldId=e.fieldId,this.order=e.order}get field(){return ye.get(this.fieldId)}update(e={}){l.has(e,"fieldId")&&(this.fieldId=e.fieldId),l.has(e,"order")&&(this.order=e.order)}reset(){this.update({fieldId:null,order:"asc"})}}Qs([o],Xs.prototype,"fieldId",2),Qs([o],Xs.prototype,"order",2),Qs([g],Xs.prototype,"field",1),Qs([d],Xs.prototype,"update",1),Qs([d],Xs.prototype,"reset",1);const ei=e=>Array.from(new Set(e)),ti=({modelId:e,where:t,fieldIds:s,sort:i,pagination:a})=>{const n=[],r=Ne.get(e);if(!r)throw B({path:"getFindManyQuery",message:"Invalid modelId",context:{modelId:e}});if(n.push(`prisma.${r.photonNamespace}.findMany({`),t&&(null==t?void 0:t.size)>0&&(n.push(" where: {"),n.push(" AND: ["),Object.values(t.values).forEach((e=>{var t,s,i,a,r,o,d,c,h,p,u,m,g,f,v,y,I,C,w,E,b,_,S,x,N,M;if(e.enabled&&e.isValid&&("isNull"===e.operation&&(n.push(" {"),(null==(t=l.first(e.fields))?void 0:t.isRelation)&&n.push(` ${null==(s=l.first(e.fields))?void 0:s.name}: {`),(null==(i=l.first(e.fields))?void 0:i.isList)&&n.push(" some: {"),n.push(` ${null==(a=l.last(e.fields))?void 0:a.name}: { equals: null },`),(null==(r=l.first(e.fields))?void 0:r.isList)&&n.push(" },"),(null==(o=l.first(e.fields))?void 0:o.isRelation)&&n.push(" },"),n.push(" },")),"isNotNull"===e.operation&&(n.push(" {"),(null==(d=l.first(e.fields))?void 0:d.isRelation)&&n.push(` ${null==(c=l.first(e.fields))?void 0:c.name}: {`),(null==(h=l.first(e.fields))?void 0:h.isList)&&n.push(" some: {"),n.push(` ${null==(p=l.last(e.fields))?void 0:p.name}: { not: { equals: null } },`),(null==(u=l.first(e.fields))?void 0:u.isList)&&n.push(" },"),(null==(m=l.first(e.fields))?void 0:m.isRelation)&&n.push(" },"),n.push(" },")),e.value)){if(n.push(" {"),(null==(g=l.first(e.fields))?void 0:g.isRelation)&&n.push(` ${null==(f=l.first(e.fields))?void 0:f.name}: {`),(null==(v=l.first(e.fields))?void 0:v.isList)&&n.push(" some: {"),n.push(` ${null==(y=l.last(e.fields))?void 0:y.name}: {`),["in","notIn"].includes(e.operation))n.push(` ${e.operation}: ${e.value},`);else{let t=e.value;(null==(I=l.last(e.fields))?void 0:I.isDateTime)&&!(null==(C=l.last(e.fields))?void 0:C.isList)&&(t=`"${new Date(t).toISOString()}"`),!(null==(w=l.last(e.fields))?void 0:w.isString)&&!(null==(E=l.last(e.fields))?void 0:E.isEnum)||t.startsWith('"')||(t='"'.concat(t)),!(null==(b=l.last(e.fields))?void 0:b.isString)&&!(null==(_=l.last(e.fields))?void 0:_.isEnum)||t.endsWith('"')||(t=t.concat('"')),(null==(S=l.last(e.fields))?void 0:S.isBigInt)&&(t=Bt(BigInt(t))),n.push(` ${e.operation}: ${t},`),(null==(x=l.last(e.fields))?void 0:x.isString)&&js.isPostgresDatasource&&n.push(' mode: "insensitive",')}n.push(" },"),(null==(N=l.first(e.fields))?void 0:N.isList)&&n.push(" },"),(null==(M=l.first(e.fields))?void 0:M.isRelation)&&n.push(" },"),n.push(" },")}})),n.push(" ]"),n.push(" },")),(null==i?void 0:i.fieldId)&&(null==i?void 0:i.order)){const e=ye.get(i.fieldId);if(!e)throw B({path:"getFindManyQuery",message:"Invalid sort fieldId",context:{sort:i}});n.push(" orderBy: [{"),n.push(` ${e.name}: "${i.order}",`),n.push(" }],")}void 0!==(null==a?void 0:a.take)&&null!==a.take&&n.push(` take: ${Number(a.take)},`),void 0!==(null==a?void 0:a.skip)&&null!==a.skip&&n.push(` skip: ${Number(a.skip)},`),s=s?ei([].concat(r.uniqueIdentifiers.map((e=>e.id)),s)):r.fieldIds;const o=((e,t)=>t.slice().sort(((t,s)=>e.fieldIds.findIndex((e=>e===t))-e.fieldIds.findIndex((e=>e===s)))))(r,s).map((e=>ye.get(e)));return n.push(" select: {"),o.forEach((e=>{e&&n.push(` ${e.name}: true,`)})),n.push(" }"),n.push("})"),n.join("\n")};var si=Object.defineProperty,ii=Object.getOwnPropertyDescriptor,ai=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?ii(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&si(t,s,n),n};class ni extends X{constructor(e){var t,s,i,a,n,r,o,d;super(e),this.run=async()=>{if(!this.model)throw B({path:"Script.run",message:"Invalid modelId",context:{modelId:this.modelId}});this.update({running:!0}),De.updateError({visible:!1});const e=this.frozen||"visual"===this.inputMode?ti({modelId:this.modelId,where:this.where,sort:this.sort,pagination:this.pagination}):this.code;try{this.model.runCountQuery();const{recordIds:t,modelId:s,fieldIds:i}=await Ls(e);this.update({recordIds:t}),"visual"===this.inputMode&&this.update({code:e}),"code"===this.inputMode&&this.update({modelId:s,fieldIds:i})}catch(t){"PrismaClientSchemaDriftedError"===t.type?He.update({type:"schemaDrift",description:"Your source Prisma Schema has changed. Please reload Studio to continue. Your changes will be saved.",dump:""}):He.update({type:"client",description:"Unable to run script",dump:`Message: ${t.message}\n \n Query:\n ${e}\n `}),De.updateError({visible:!0})}finally{this.update({running:!1})}},this.loadMore=async()=>{if(this.__recordIds.length>=(this.model.count||0)||"code"===this.inputMode)return[];this.update({running:!0});const e=ti({modelId:this.modelId,where:this.where,sort:this.sort,pagination:{take:100,skip:this.pagination.skip+this.__recordIds.length}});try{const{recordIds:t}=await Ls(e),s=ei([...this.__recordIds,...t]);return this.update({running:!1,recordIds:s,pagination:{take:s.length}}),t.map((e=>Vs.get(e))).filter((e=>!!e))}catch(t){throw this.update({running:!1}),console.log(t.type),"PrismaClientSchemaDriftedError"===t.type?He.update({type:"schemaDrift",description:"Your source Prisma Schema has changed. Please reload Studio to continue. Your changes will be saved.",dump:""}):He.update({type:"client",description:"Unable to fetch paginated records",dump:`Message: ${t.message}\n \n Stack: ${t.stack}\n \n Query:\n ${e}\n `}),De.updateError({visible:!0}),B({path:"Script.loadMore",message:"Unable to fetch next page of records",context:{take:this.pagination.take,skip:this.pagination.skip,lastFetchedRecordId:l.last(this.__recordIds)},nativeError:t})}},this.update=(e,t={})=>{l.has(e,"name")&&(this.name=e.name),l.has(e,"frozen")&&(this.frozen=e.frozen),l.has(e,"modelId")&&(this.modelId=e.modelId),l.has(e,"fieldIds")&&(this.fieldIds=e.fieldIds),l.has(e,"inputMode")&&(this.inputMode=e.inputMode),l.has(e,"viewMode")&&(this.viewMode=e.viewMode),l.has(e,"sort")&&this.sort.update(e.sort),l.has(e,"pagination")&&this.pagination.update(e.pagination),l.has(e,"code")&&(this.code=e.code),l.has(e,"recordIds")&&(this.__recordIds=e.recordIds.filter((e=>{var t;return(null==(t=Vs.get(e))?void 0:t.modelId)===this.modelId}))),l.has(e,"running")&&(this.running=e.running),super.update(e,t)},this.serialize=()=>({projectId:_i.activeProjectId,id:this.id,frozen:this.frozen,name:this.name,inputMode:this.inputMode,code:this.code,modelId:this.modelId,where:this.where.serialize(),fieldIds:this.fieldIds.map((e=>String(e))),sortFieldId:this.sort.fieldId,sortOrder:this.sort.order,viewMode:this.viewMode}),this.id=e.id,this.frozen=e.frozen,this.name=e.name,this.modelId=e.modelId,this.fieldIds=e.fieldIds||[],this.inputMode="visual",this.where=new zs({modelId:e.modelId,scriptId:this.id}),(e.where||[]).forEach((e=>this.where.add(e))),this.sort=new Xs({fieldId:null!=(s=null==(t=e.sort)?void 0:t.fieldId)?s:null,order:null!=(a=null==(i=e.sort)?void 0:i.order)?a:"asc"}),this.pagination=new Ws({take:null!=(r=null==(n=e.pagination)?void 0:n.take)?r:100,skip:null!=(d=null==(o=e.pagination)?void 0:o.skip)?d:0}),this.viewMode="table",this.code=e.code||ti({modelId:this.modelId,where:this.where,sort:this.sort,pagination:this.pagination}),this.__recordIds=[],this.running=!1}get hash(){return(({code:e,modelId:t,where:s,fieldIds:i})=>JSON.stringify({code:e,modelId:t,where:s.serialize(),fieldIds:i}))({code:this.code,modelId:this.modelId,where:this.where,fieldIds:this.fieldIds})}get model(){let e=Ne.get(this.modelId);if(!e)throw B({path:"Script.model",message:"Invalid modelId",context:{modelId:this.modelId}});return e}get fields(){return this.fieldIds.map((e=>{const t=ye.get(e);if(!t)throw B({path:"Script.fields",message:"Invalid fieldId",context:{fieldId:e}});return t}))}get recordIds(){const e=Ms.actions.filter((e=>{var t,s;return"create"===e.type&&e.sessionId===(null==(t=gi.activeTab)?void 0:t.sessionId)&&(null==(s=e.record)?void 0:s.modelId)===this.modelId})).map((e=>e.recordId)).filter((e=>!!e)),t=Ms.actions.filter((e=>{var t;return"delete"===e.type&&e.sessionId===(null==(t=gi.activeTab)?void 0:t.sessionId)})).map((e=>e.recordId));return[...e,...this.__recordIds.filter((e=>!t.includes(e)))]}get records(){return this.recordIds.map((e=>Vs.get(e))).filter((e=>!!e))}get uncommittedRecords(){return Ms.actions.filter((e=>{var t;return"create"===e.type&&(null==(t=e.record)?void 0:t.modelId)===this.modelId})).map((e=>e.record)).filter((e=>!!e))}reset(){this.update({recordIds:[],inputMode:"visual",viewMode:"table",running:!1}),this.sort.reset(),this.pagination.reset()}}ai([o],ni.prototype,"id",2),ai([o],ni.prototype,"frozen",2),ai([o],ni.prototype,"name",2),ai([o],ni.prototype,"modelId",2),ai([o],ni.prototype,"fieldIds",2),ai([o],ni.prototype,"inputMode",2),ai([o],ni.prototype,"where",2),ai([o],ni.prototype,"sort",2),ai([o],ni.prototype,"pagination",2),ai([o],ni.prototype,"viewMode",2),ai([o],ni.prototype,"code",2),ai([o],ni.prototype,"running",2),ai([o],ni.prototype,"__recordIds",2),ai([g],ni.prototype,"hash",1),ai([g],ni.prototype,"model",1),ai([g],ni.prototype,"fields",1),ai([g],ni.prototype,"recordIds",1),ai([g],ni.prototype,"records",1),ai([g],ni.prototype,"uncommittedRecords",1),ai([d],ni.prototype,"run",2),ai([d],ni.prototype,"loadMore",2),ai([d],ni.prototype,"update",2),ai([d],ni.prototype,"reset",1);var ri=new class extends W{constructor(){super(ni,{idbTableName:"scripts"})}},li=Object.defineProperty,oi=Object.getOwnPropertyDescriptor,di=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?oi(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&li(t,s,n),n};class ci extends X{constructor(e){super(e),this.save=()=>{this.session&&(this.session.forceSave(),this.session.isScript&&!this.session.script.name&&this.session.script.update({name:`Copy of ${this.session.script.model.name}`}))},this.discardChanges=()=>{this.session&&this.session.discardChanges()},this.load=({modelId:e,scriptId:t,sessionId:s})=>{if(!s&&!t&&!e)throw B({path:"Tab.load",message:"Invaid params",context:{modelId:e,scriptId:t,sessionId:s}});if(e){const s=Ne.get(e);if(!s)throw B({path:"Tab.load",message:"Invalid modelId",context:{modelId:e}});t=ri.add({frozen:!0,name:null,modelId:e,fieldIds:s.fieldIds}).id}t&&(s=gs.add({type:"script",scriptId:t,lastSavedHash:null}).id),s&&this.update({sessionId:s}),Ms.actions.length>0?De.updateActions({visible:!0}):De.updateActions({visible:!1})},this.update=(e,t={})=>(l.has(e,"sessionId")&&(this.sessionId=e.sessionId),l.has(e,"preview")&&(this.preview=e.preview),super.update(e,t)),this.serialize=()=>({projectId:_i.activeProjectId,id:this.id,sessionId:this.sessionId,preview:this.preview}),this.id=e.id,this.sessionId=e.sessionId,this.preview=e.preview||!1,this.preview&&(this.disposer=I((()=>{var e;return!!(null==(e=this.session)?void 0:e.isDirty)}),(()=>{this.update({preview:!1})})))}get title(){var e;return(null==(e=this.session)?void 0:e.isScript)?this.session.script.name||this.session.script.model&&this.session.script.model.name:"+"}get session(){return gs.get(this.sessionId)}get isDirty(){if(!this.session)return!1;if(!this.session.isScript)return!1;const e=this.session.script,t=Object.values(Ms.values).filter((e=>e.sessionId===this.sessionId));return e.where.size>0||e.fieldIds.length!==e.model.fieldIds.length||0!==e.pagination.skip||t.length>0}clean(){this.disposer&&this.disposer()}}di([o],ci.prototype,"id",2),di([o],ci.prototype,"sessionId",2),di([o],ci.prototype,"preview",2),di([g],ci.prototype,"title",1),di([g],ci.prototype,"session",1),di([g],ci.prototype,"isDirty",1),di([d],ci.prototype,"save",2),di([d],ci.prototype,"discardChanges",2),di([d],ci.prototype,"load",2),di([d],ci.prototype,"update",2),di([d],ci.prototype,"clean",1);var hi=Object.defineProperty,pi=Object.getOwnPropertyDescriptor,ui=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?pi(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&hi(t,s,n),n};class mi extends W{constructor(){super(ci,{idbTableName:"tabs"}),this.hydrate=({activeTabId:e})=>{let t=this.get(e);t&&t.session?(Object.values(this.values).forEach((e=>{if(e.session){if(e.session.isScript){if(!Ne.get(e.session.script.modelId))return void this.remove(e.id)}}else this.remove(e.id)})),t=this.get(e),t&&t.session?this.switch({id:e}):this.switch({id:"model-list-tab"})):this.switch({id:"model-list-tab"})},this.remove=e=>{var t,s;if(!this.get(e))return this.get("model-list-tab");const i=this.openTabs.findIndex((e=>e.id===this.activeTabId)),a=this.openTabs.findIndex((t=>t.id===e)),n=super.remove(e);if(Object.values(Ms.values).filter((e=>e.sessionId===n.sessionId)).forEach((e=>Ms.remove(e.id))),i===a){let e=a-1;-1===e&&(e=a),this.switch({id:null!=(s=null==(t=this.openTabs[e])?void 0:t.id)?s:"model-list-tab"})}return n},gs.add({id:"model-list-session",type:"model-list",scriptId:null,lastSavedHash:null},{skipPersist:!0}),super.add({id:"model-list-tab",sessionId:"model-list-session",preview:!1},{skipPersist:!0}),this.activeTabId="model-list-tab"}get activeTab(){return this.get(this.activeTabId)}get openTabs(){return Object.values(this.values).reverse().filter((e=>!!e&&!!e.session)).sort((e=>"model-list-tab"===e.id?1:-1))}get previewTab(){return Object.values(this.values).find((e=>e.preview))||null}add(e,t={}){var{modelId:s,scriptId:i,sessionId:a}=e,l=r(e,["modelId","scriptId","sessionId"]);let o;if(!a&&!i&&!s)throw B({path:"TabStore.add",message:"Invaid params",context:{modelId:s,scriptId:i,sessionId:a}});if(s){const e=Ne.get(s);if(!e)throw B({path:"TabStore.add",message:"Invalid modelId",context:{modelId:s}});i=ri.add({frozen:!0,name:null,modelId:s,fieldIds:e.fieldIds}).id}return i&&(a=gs.add({type:"script",scriptId:i,lastSavedHash:null}).id),a&&(o=super.add(n(n({},l),{sessionId:a}),t)),o}switch({id:e,index:t,direction:s}){if(!e&&void 0===t&&void 0===s)throw B({path:"TabStore.switch",message:"Invalid params",context:{id:e,index:t,direction:s}});let i;if(e?i=this.get(e):void 0!==t&&(i=this.openTabs[t]),s){const e=this.openTabs.findIndex((e=>e.id===this.activeTabId));-1!==e&&("right"===s?(i=this.openTabs[e+1],e===this.openTabs.length-1&&(i=this.openTabs[0])):"left"===s&&(i=this.openTabs[e-1]))}i||(i=this.get("model-list-tab")),this.activeTabId=i.id,Ms.actions.length>0?De.updateActions({visible:!0}):De.updateActions({visible:!1})}}ui([o],mi.prototype,"activeTabId",2),ui([g],mi.prototype,"activeTab",1),ui([g],mi.prototype,"openTabs",1),ui([g],mi.prototype,"previewTab",1),ui([d],mi.prototype,"hydrate",2),ui([d],mi.prototype,"add",1),ui([d],mi.prototype,"switch",1),ui([d],mi.prototype,"remove",2);var gi=new mi,fi=Object.defineProperty,vi=Object.getOwnPropertyDescriptor,yi=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?vi(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&fi(t,s,n),n};class Ii extends X{constructor(e){super(e),this.update=(e,t)=>{l.has(e,"name")&&(this.name=e.name),l.has(e,"schemaPath")&&(this.schemaPath=e.schemaPath),l.has(e,"schemaHash")&&(this.schemaHash=e.schemaHash),l.has(e,"recentModelIds")&&(this.recentModelIds=e.recentModelIds),super.update(e,t)},this.id=e.id,this.name=e.name,this.schemaPath=e.schemaPath,this.schemaHash=e.schemaHash,this.recentModelIds=e.recentModelIds||[],C((()=>[gi.activeTabId,ae.theme]),(()=>{Ti.ready&&z.save("projects",this.serialize())}),{fireImmediately:!0})}get recentModels(){return this.recentModelIds.map((e=>Ne.get(e))).filter((e=>!!e))}addRecentModel(e){this.recentModelIds.includes(e)&&(this.recentModelIds=this.recentModelIds.filter((t=>t!==e))),5===this.recentModelIds.length&&this.recentModelIds.pop(),this.recentModelIds.unshift(e)}serialize(){return{id:this.id,activeTabId:String(gi.activeTabId),recentModelIds:this.recentModelIds.map((e=>String(e)))}}}yi([o],Ii.prototype,"id",2),yi([o],Ii.prototype,"name",2),yi([o],Ii.prototype,"schemaPath",2),yi([o],Ii.prototype,"schemaHash",2),yi([o],Ii.prototype,"recentModelIds",2),yi([g],Ii.prototype,"recentModels",1),yi([d],Ii.prototype,"addRecentModel",1),yi([d],Ii.prototype,"update",2);var Ci=Object.defineProperty,wi=Object.getOwnPropertyDescriptor,Ei=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?wi(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&Ci(t,s,n),n};class bi extends W{constructor(){super(Ii,{idbTableName:"projects"}),this.activeProjectId=null}get activeProject(){const e=this.activeProjectId;return e?this.get(e):null}switch(e){this.activeProjectId=e}}Ei([o],bi.prototype,"activeProjectId",2),Ei([g],bi.prototype,"activeProject",1),Ei([d],bi.prototype,"switch",1);var _i=new bi,Si=Object.defineProperty,xi=Object.getOwnPropertyDescriptor,Ni=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?xi(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&Si(t,s,n),n};class Mi{constructor(){this.hasCheckedForUpdates=!1,this.latestVersion="0.371.0",this.changelog="",this.isDownloading=!1,this.isUpdateReady=!1,this.isInstalling=!1,this.check=async()=>{if(!T.updates)return;y((()=>{this.hasCheckedForUpdates=!1,this.isDownloading=!1,this.isUpdateReady=!1,this.isInstalling=!1}));const{error:e,data:t}=await window.transport.request({channel:"update",action:"check",payload:{data:null}});if(e)return void console.error("Update check failed",e);const{available:s,version:i,changelog:a}=t;y(s?()=>{this.hasCheckedForUpdates=!0,this.latestVersion=i,this.changelog=a}:()=>{this.hasCheckedForUpdates=!0,this.latestVersion="0.371.0"})},this.download=async()=>T.updates?this.isDownloading?Promise.reject("Another download is in progress"):(y((()=>{this.isDownloading=!0,this.isUpdateReady=!1,this.isInstalling=!1})),await window.transport.request({channel:"update",action:"download",payload:{data:null}}),void y((()=>{this.isDownloading=!1,this.isUpdateReady=!0}))):Promise.resolve(),this.cancelDownload=async()=>{if(T.updates){if(!this.isDownloading)return Promise.resolve();await window.transport.request({channel:"update",action:"downloadCancel",payload:{data:null}}),y((()=>{this.isDownloading=!1,this.isUpdateReady=!1}))}},this.install=async()=>{T.updates&&(y((()=>{this.isDownloading=!1,this.isUpdateReady=!0,this.isInstalling=!0})),await window.transport.request({channel:"update",action:"install",payload:{data:null}}),y((()=>{this.isUpdateReady=!1,this.isInstalling=!1})))}}get isUpToDate(){return"0.371.0"===this.latestVersion}}Ni([o],Mi.prototype,"hasCheckedForUpdates",2),Ni([o],Mi.prototype,"latestVersion",2),Ni([o],Mi.prototype,"changelog",2),Ni([o],Mi.prototype,"isDownloading",2),Ni([o],Mi.prototype,"isUpdateReady",2),Ni([o],Mi.prototype,"isInstalling",2),Ni([g],Mi.prototype,"isUpToDate",1),Ni([d],Mi.prototype,"check",2),Ni([d],Mi.prototype,"download",2),Ni([d],Mi.prototype,"cancelDownload",2);var Li=new Mi;const Ri=async()=>{const e=Object.values(Ne.values);if(js.isPostgresDatasource){const{error:t,data:s}=await window.transport.request({channel:"prisma",action:"clientRequest",payload:{data:{schemaHash:_i.activeProject.schemaHash,query:"prisma.$queryRaw(`\n SELECT schemaname,relname,n_live_tup\n FROM pg_stat_user_tables\n ORDER BY n_live_tup DESC;\n `)"}}});if(t)throw B({path:"getAllCounts",message:"Unable to process `count` query",context:{error:t}});if(!Array.isArray(s.response))throw B({path:"getAllCounts",message:"Malformed response for `count` query:\n\n",context:{error:t}});s.response.forEach((({relname:t,n_live_tup:s})=>{const i=e.find((e=>e.dbName===t||e.name===t));i&&i.update({count:s})}))}else{let t="prisma.$transaction([\n";t+=e.reduce(((e,t)=>e+=` ${Ie({modelId:t.id})},\n`),""),t+="])";const{error:s,data:i}=await window.transport.request({channel:"prisma",action:"clientRequest",payload:{data:{schemaHash:_i.activeProject.schemaHash,query:t}}});if(s)throw B({path:"getAllCounts",message:"Unable to process `count` query",context:{error:s}});if(!Array.isArray(i))throw B({path:"getAllCounts",message:"Malformed response for `count` query:\n\n",context:{error:s}});i.forEach((({response:t},s)=>{e[s].update({count:t})}))}};var Ai=Object.defineProperty,Oi=Object.getOwnPropertyDescriptor,Di=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?Oi(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&Ai(t,s,n),n};class ki{constructor(){this.ready=!1,this.initTransport=async()=>{var e,t;if("http"===T.transport){const{HTTPBrowserTransport:e}=await j((()=>__import__("./assets/browser.cdd2249a.js")),["/assets/browser.cdd2249a.js","/assets/vendor.c4d0f081.js"]);window.transport=new e}else{if("electron"!==T.transport)return void console.error("Unrecognized transport, aborting");{const{ElectronBrowserTransport:e}=await j((()=>__import__("./assets/browser.38b7fdb1.js")),void 0);window.transport=new e}}await(null==(t=(e=window.transport).init)?void 0:t.call(e)),window.toJS=v,window.stores={ActionStore:Ms,BootstrapStore:Ti,ConfigStore:T,DMMFStore:js,EnumStore:pe,ErrorStore:He,FieldStore:ye,LayoutStore:De,ModelStore:Ne,PersistenceStore:z,ProjectStore:_i,RecordStore:Vs,ScriptStore:ri,SessionStore:gs,TabStore:gi,TelemetryStore:Ve,ThemeStore:ae,UpdateStore:Li}},this.init=async()=>{console.time("Bootstrap Duration"),this.update({ready:!1}),this.disposeProjectReaction&&this.disposeProjectReaction();try{const{error:e,data:t}=await window.transport.request({channel:"prisma",action:"getDMMF",payload:{data:null}});if(e||!t)throw new Error(`Error starting Prisma Client: ${JSON.stringify(e,null,2)}`);const{dmmf:s,datasourceProvider:i,schemaHash:a}=t,{error:n,data:r}=await window.transport.request({channel:"project",action:"get",payload:{data:null}});if(n)throw new Error(`Error fetching project: ${n}`);const{name:l,schemaPath:o}=r,d=(e=>((e.endsWith("/")||e.endsWith("\\"))&&(e=e.slice(0,-1)),(e.startsWith("/")||e.startsWith("\\"))&&(e=e.slice(1)),e.replace(RegExp(/\/|\\/,"gi"),"-")))(o);_i.add({id:d,name:l,schemaPath:o,schemaHash:a,recentModelIds:[]},{skipPersist:!0}),_i.switch(d),await z.init({projectId:d}),js.hydrate(s,i);for(let h of[_i,ye,Ne,pe,ri,Vs,gs,Ms,gi])await h.restore();js.removeUnusedModels(s),js.removeUnusedFields(s),js.removeUnusedEnums(s),window.requestIdleCallback?window.requestIdleCallback(Ri):await Ri();Object.values(ri.values).filter((e=>e.frozen&&Ne.get(e.modelId))).forEach((e=>e.update({fieldIds:e.model.fieldIds})));const c=(await z.load("projects")).find((e=>e.id===d));c&&gi.hydrate({activeTabId:c.activeTabId}),await _i.activeProject.forceUpdate(),this.update({ready:!0}),console.timeEnd("Bootstrap Duration")}catch(e){throw this.update({ready:!0}),He.update({type:"fatal",description:"Unable to load project",dump:`${e.message}\n${e.stack}`}),De.updateError({visible:!0}),B({path:"BootstrapStore.init",message:"Studio bootstrap failed",context:{message:e.message,stack:e.stack},nativeError:e})}window.requestIdleCallback?window.requestIdleCallback(this.cleanupIndexedDB):this.cleanupIndexedDB()},this.update=(e={})=>{l.has(e,"ready")&&(this.ready=e.ready)},this.cleanupIndexedDB=()=>{const e=Object.values(gi.openTabs).map((e=>e.sessionId));Object.values(gs.values).filter((t=>!e.includes(t.id))).forEach((e=>gs.remove(e.id)));const t=Object.values(gs.values).map((e=>e.scriptId));Object.values(ri.values).filter((e=>!t.includes(e.id)&&null===e.name)).forEach((e=>ri.remove(e.id)))},w({dsn:"https://fb6e137ff2ea425da39d6e92a4d69b58@sentry.io/1762788"}),E({enforceActions:"always"}),console.log("Studio version","0.371.0")}}Di([o],ki.prototype,"ready",2),Di([d],ki.prototype,"initTransport",2),Di([d],ki.prototype,"init",2),Di([d],ki.prototype,"update",2);var Ti=new ki,Pi=Object.defineProperty,Vi=Object.getOwnPropertyDescriptor,ji=(e,t,s,i)=>{for(var a,n=i>1?void 0:i?Vi(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&Pi(t,s,n),n};class Zi{constructor(e){y((()=>{this.sessionId=e.sessionId}))}get session(){return gs.get(this.sessionId)}}ji([o],Zi.prototype,"sessionId",2),ji([g],Zi.prototype,"session",1);const Bi=new Zi({sessionId:"model-list-session"}),Fi=b.createContext(Bi),Hi=Fi.Provider;Fi.Consumer;const qi=Fi;var Ui="_container_1d62f_1",zi="_tab1_1d62f_11",$i="_tab2_1d62f_17",Ji="_tabEmptySpace_1d62f_22",Yi="_filter1_1d62f_28",Wi="_filter2_1d62f_29",Ki="_filter3_1d62f_30",Gi="_filter4_1d62f_31",Qi="_separator_1d62f_55",Xi="_button1_1d62f_61",ea="_btnSpace_1d62f_69",ta="_table_1d62f_90";class sa extends b.PureComponent{render(){return b.createElement("div",{"data-cy":"skeleton",className:Ui},b.createElement("div",{className:zi,style:{paddingLeft:T.headerLeftOffset}}),b.createElement("div",{className:$i}),b.createElement("div",{className:Ji}),b.createElement("div",{className:Yi}),b.createElement("div",{className:Wi}),b.createElement("div",{className:Ki}),b.createElement("div",{className:Gi}),b.createElement("div",{className:Qi}),b.createElement("div",{className:Xi}),b.createElement("div",{className:ea}," Getting things ready..."),b.createElement("div",{className:ta}))}}var ia=_(sa);var aa="_container_18uec_1",na="_wide_18uec_32",ra="_ghost_18uec_35",la="_blue_18uec_49",oa="_green_18uec_62",da="_red_18uec_75",ca="_disabled_18uec_85";var ha=_((e=>{var{innerRef:t,className:s,children:i,ghost:a=!1,wide:l=!1,blue:o=!1,green:d=!1,red:c=!1,disabled:h,onClick:p}=e,u=r(e,["innerRef","className","children","ghost","wide","blue","green","red","disabled","onClick"]);return b.createElement("button",n({ref:t,className:S(aa,{[na]:l,[ra]:a,[la]:o,[oa]:d,[da]:c,[ca]:h},s),onClick:e=>{h||p&&(e.stopPropagation(),e.preventDefault(),p(e))}},u),i)}));var pa="_container_vmd0x_1";var ua=_((e=>{var{className:t,children:s,onClick:i}=e,a=r(e,["className","children","onClick"]);return b.createElement(ha,n({className:S(pa,t),onClick:i},a),s)}));class ma extends b.PureComponent{componentDidMount(){var e;const{target:t,keys:s,preventDefault:i,stopPropagation:a,onMatch:n}=this.props,r=null!=(e=null==t?void 0:t.current)?e:document;this.instance=x(r),this.instance.bind(s,((e,t)=>{i&&e.preventDefault(),a&&e.stopImmediatePropagation(),n(e,t)}),"keydown")}componentWillUnmount(){this.instance.unbind(this.props.keys,"keydown")}render(){return b.createElement(b.Fragment,null)}}ma.defaultProps={preventDefault:!0,stopPropagation:!0};var ga="_mask_u1smr_1";var fa=_((({className:e,onClick:t})=>b.createElement("div",{"data-cy":"mask",className:S(ga,e),onClick:t})));var va="_container_1t3y0_1",ya="_transparent_1t3y0_8";class Ia extends b.PureComponent{constructor(){super(...arguments),this.state={top:0,bottom:0,left:0,right:0,minWidth:void 0,maxWidth:void 0,minHeight:void 0,maxHeight:void 0}}componentDidMount(){this.setPosition(this.props)}componentWillReceiveProps(e){this.setPosition(e)}setPosition({target:e,targetOffsetX:t,targetOffsetY:s}){e&&this.setState(((e,t={})=>{const s=e.current.getBoundingClientRect(),i={top:0,bottom:0,left:0,right:0};return t.x||(t.x=0),t.y||(t.y=0),window.innerWidth-s.right<100?(i.right=window.innerWidth-s.right-t.x,i.left=void 0,i.maxWidth=window.innerWidth-i.right-20):(i.left=s.left+t.x,i.right=void 0,i.maxWidth=window.innerWidth-i.left-20),window.innerHeight-s.bottom<100?(i.bottom=s.top-t.y,i.top=20,i.maxHeight=window.innerHeight-i.bottom-20):(i.top=s.bottom+t.y,i.bottom=void 0,i.maxHeight=window.innerHeight-i.top-20),i})(e,{x:t,y:s}))}render(){const e=this.props,{className:t,maskClassName:s,domElementId:i,target:a,targetOffsetX:l,targetOffsetY:o,darken:d,children:c,onClickOutside:h}=e,p=r(e,["className","maskClassName","domElementId","target","targetOffsetX","targetOffsetY","darken","children","onClickOutside"]);return b.createElement(b.Fragment,null,N.createPortal(b.createElement(b.Fragment,null,b.createElement(fa,{className:S({[ya]:!d},s),onClick:h}),b.createElement("div",n({"data-cy":"modal",className:S(va,t),style:a&&this.state},p),c)),document.getElementById(i)))}}Ia.defaultProps={domElementId:"modal-root",targetOffsetX:0,targetOffsetY:5,darken:!1};var Ca=_(Ia);function wa(e){return b.createElement("svg",Object.assign({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{d:"M8.70711 7.29289C8.31658 6.90237 7.68342 6.90237 7.29289 7.29289C6.90237 7.68342 6.90237 8.31658 7.29289 8.70711L8.70711 7.29289ZM15.7782 17.1924C16.1687 17.5829 16.8019 17.5829 17.1924 17.1924C17.5829 16.8019 17.5829 16.1687 17.1924 15.7782L15.7782 17.1924ZM7.29289 15.7782C6.90237 16.1687 6.90237 16.8019 7.29289 17.1924C7.68342 17.5829 8.31658 17.5829 8.70711 17.1924L7.29289 15.7782ZM17.1924 8.70711C17.5829 8.31658 17.5829 7.68342 17.1924 7.29289C16.8019 6.90237 16.1687 6.90237 15.7782 7.29289L17.1924 8.70711ZM7.29289 8.70711L15.7782 17.1924L17.1924 15.7782L8.70711 7.29289L7.29289 8.70711ZM8.70711 17.1924L17.1924 8.70711L15.7782 7.29289L7.29289 15.7782L8.70711 17.1924Z",fill:"currentColor"}))}function Ea(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),b.createElement("path",{d:"M12 9V13",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),b.createElement("path",{d:"M12 17H12.01",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))}var ba="_container_q775b_1",_a="_header_q775b_12",Sa="_error_q775b_22",xa="_closeButton_q775b_34",Na="_footer_q775b_40";class Ma extends b.Component{componentDidMount(){document.getElementById("dialog-root").style.pointerEvents="initial"}componentWillUnmount(){document.getElementById("dialog-root").style.pointerEvents="none"}render(){const{className:e,error:t,title:s,primaryButton:i,secondaryButton:a,children:n,onClose:r}=this.props;return b.createElement(Ca,{"data-cy":"dialog",className:S(ba,e),domElementId:"dialog-root",darken:!0,onClickOutside:r},b.createElement(b.Fragment,null,s&&b.createElement("div",{className:S(_a,{[Sa]:t})},t&&b.createElement(Ea,null),s),n,(i||a)&&b.createElement("div",{className:Na},i,a),r&&b.createElement(ua,{className:xa,onClick:r},b.createElement(wa,null))))}}var La=_(Ma);var Ra={container:"_container_os6jn_1",content:"_content_os6jn_10",description:"_description_os6jn_19"};class Aa extends b.Component{render(){const{onCancel:e,onDiscard:t}=this.props;return b.createElement(La,{className:Ra.container,title:"Discard changes?",primaryButton:b.createElement(ha,{"data-cy":"tab__discard--discard",red:!0,onClick:t},"Discard"),secondaryButton:b.createElement(ha,{"data-cy":"tab__discard--cancel",ghost:!0,className:Ra.cancelBtn,onClick:e},"Cancel")},b.createElement("div",{className:Ra.content},b.createElement("p",{className:Ra.description},"This tab contains unsaved changes. Do you want to discard them?")))}}var Oa=_(Aa);function Da(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 1.71429C14 0.767512 13.1046 0 12 0C10.8954 0 10 0.767512 10 1.71429V10L1.71429 10C0.767512 10 0 10.8954 0 12C0 13.1046 0.767512 14 1.71429 14L10 14V22.2857C10 23.2325 10.8954 24 12 24C13.1046 24 14 23.2325 14 22.2857V14L22.2857 14C23.2325 14 24 13.1046 24 12C24 10.8954 23.2325 10 22.2857 10L14 10V1.71429Z"}))}var ka={container:"_container_18ph6_1",title:"_title_18ph6_11",active:"_active_18ph6_14",preview:"_preview_18ph6_23",modelListTabButton:"_modelListTabButton_18ph6_27",closeButton:"_closeButton_18ph6_50",dirtyIndicator:"_dirtyIndicator_18ph6_59"};class Ta extends b.PureComponent{constructor(e){super(e),this.container=b.createRef(),this.handleClick=()=>{gi.switch({id:this.props.id})},this.handleDoubleClick=()=>{const e=gi.get(this.props.id);e&&e.preview&&e.update({preview:!1})},this.handleClose=e=>{e&&e.stopPropagation(),e&&e.preventDefault();const t=gi.get(this.props.id);t&&(t.isDirty?this.setState({isCloseDialogOpen:!0}):(gi.remove(this.props.id),this.setState({isCloseDialogOpen:!1})))},this.handleDiscardChanges=()=>{gi.remove(this.props.id),this.setState({isCloseDialogOpen:!1})},this.handleCancelClose=()=>{this.setState({isCloseDialogOpen:!1})},this.state={isCloseDialogOpen:!1},this.reaction=g((()=>gi.activeTabId)).observe((({newValue:t})=>{var s;t===e.id&&(null==(s=this.container.current)||s.scrollIntoView())}))}componentWillUnmount(){this.reaction()}render(){const{isCloseDialogOpen:e}=this.state,{id:t}=this.props,s=gi.get(t),i=gi.activeTabId===t;if(!s||!s.session)return null;const a=null==s?void 0:s.isDirty;return b.createElement("div",{ref:this.container,"data-cy":"tab","data-cy-active":i,"data-cy-dirty":a,"data-cy-preview":s.preview,className:S(ka.container,{[ka.active]:i,[ka.preview]:s.preview}),onClick:this.handleClick,onDoubleClick:this.handleDoubleClick},s.session.isModelList&&b.createElement("div",{"data-cy":"new-tab-btn",className:ka.modelListTabButton},b.createElement(Da,null)),s.session.isScript&&b.createElement(b.Fragment,null,b.createElement("div",{"data-cy":"tab__title",className:ka.title},s.title),b.createElement(ua,{"data-cy":"tab__close",className:S(ka.closeButton,{[ka.dirty]:a}),onClick:this.handleClose},a?b.createElement("div",{className:ka.dirtyIndicator}):b.createElement(Da,null)),e&&b.createElement(Oa,{onCancel:this.handleCancelClose,onDiscard:this.handleDiscardChanges})),b.createElement(ma,{keys:"mod+w",onMatch:()=>this.handleClose()}))}}var Pa=_(Ta);var Va="_container_13n52_1";class ja extends b.Component{render(){return b.createElement("div",{"data-cy":"tab-bar",className:Va},gi.openTabs.map((e=>b.createElement(Pa,{key:e.id,id:e.id}))))}}var Za=_(ja);var Ba="_container_58c43_1";var Fa=_((({className:e,target:t,targetOffsetX:s,targetOffsetY:i,darken:a,children:n,onClickOutside:r})=>b.createElement(Ca,{className:S(Ba,e),target:t,targetOffsetX:s,targetOffsetY:i,darken:a,onClickOutside:r},n)));var Ha="_container_ud69p_1";class qa extends b.Component{render(){const e=this.props,{children:t,className:s,style:i}=e,a=r(e,["children","className","style"]);return b.createElement("div",n({className:S(Ha,s),style:i},a),t)}}var Ua="_container_serom_1";var za=_((({type:e})=>b.createElement("div",{"data-cy":"shortcuts-key",className:Ua},e)));var $a="_container_o8wgd_1",Ja="_content_o8wgd_17",Ya="_section_o8wgd_22",Wa="_sectionName_o8wgd_28",Ka="_row_o8wgd_34",Ga="_name_o8wgd_39",Qa="_keys_o8wgd_43",Xa="_separator_o8wgd_49";class en extends b.PureComponent{constructor(){super(...arguments),this.handleClose=()=>{this.props.onClose()}}render(){const e={sections:[{name:"Results Table",shortcuts:[{name:"Move cell selection",mac:["←","→","↑","↓"],windowsAndLinux:["←","→","↑","↓"]},{name:"Move horizontally",mac:["tab","shift+tab"],windowsAndLinux:["tab","shift+tab"]},{name:"Move vertically",mac:["enter","shift+enter"],windowsAndLinux:["enter","shift+enter"]},{name:"Edit selected cell",mac:["enter"],windowsAndLinux:["enter"]},{name:"Jump to last cell in row",mac:["⌘+→"],windowsAndLinux:["ctrl+→"]},{name:"Jump to first cell in row",mac:["⌘+←"],windowsAndLinux:["ctrl+←"]},{name:"Copy selected rows to clipboard as JSON",mac:["⌘+c"],windowsAndLinux:["ctrl+c"]},{name:"Delete selected rows",mac:["⌫"],windowsAndLinux:["del"]},{name:"Commit unsaved changes to Database",mac:["⌘+s"],windowsAndLinux:["ctrl+s"]}]},T.isBrowser?null:{name:"Tabs",shortcuts:[{name:"Switch to tab on the left",mac:["⌘+shift+["],windowsAndLinux:["ctrl+tab"]},{name:"Switch to tab on the right",mac:["⌘+shift+]"],windowsAndLinux:["ctrl+shift+tab"]}]},{name:"Global",shortcuts:[{name:"Show this cheatsheet",mac:["⌘+/"],windowsAndLinux:["ctrl+/"]}]}].filter((e=>!!e))},t=/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"mac":"windowsAndLinux";return b.createElement(b.Fragment,null,b.createElement(La,{className:$a,title:"Shortcuts",onClose:this.handleClose},b.createElement("div",{className:Ja},e.sections.map((e=>b.createElement(qa,{key:e.name,className:Ya},b.createElement(b.Fragment,null,b.createElement("div",{className:Wa},e.name),e.shortcuts.map((e=>b.createElement("div",{key:e.name,className:Ka},b.createElement("div",{className:Ga},e.name),b.createElement("div",{className:Qa},e[t].map(((e,t)=>b.createElement(b.Fragment,{key:t},t>0&&b.createElement("span",{className:Xa},"/"),e.split("+").map((e=>b.createElement(za,{key:e,type:e})))))))))))))))),b.createElement(ma,{keys:"esc",onMatch:this.handleClose}))}}var tn=_(en);var sn={container:"_container_1z063_1",content:"_content_1z063_10",description:"_description_1z063_17"},an=Object.defineProperty,nn=Object.getOwnPropertyDescriptor;let rn=class extends b.Component{handleInstall(){Li.install()}render(){const{onClose:e}=this.props;return b.createElement(La,{className:sn.container,title:"Updates ready",primaryButton:b.createElement(ha,{green:!0,disabled:Li.isInstalling,onClick:this.handleInstall},"Install and restart"),secondaryButton:b.createElement(ha,{ghost:!0,className:sn.laterBtn,onClick:e},"Install Later")},b.createElement("div",{className:sn.content},b.createElement("p",{className:sn.description},"New updates have been downloaded and are ready to be installed. Doing this will restart Studio.",b.createElement("br",null),b.createElement("br",null),"Your current session will be saved and restored after the installation.")))}};rn=((e,t,s,i)=>{for(var a,n=i>1?void 0:i?nn(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&an(t,s,n),n})([_],rn);var ln=rn;function on(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.286 15.9606C19.2271 15.6362 19.2669 15.3017 19.4 15C19.5267 14.7042 19.7373 14.452 20.0055 14.2743C20.2738 14.0966 20.5882 14.0013 20.91 13.9999H21.0001C21.5304 13.9999 22.0391 13.7893 22.4142 13.4142C22.7893 13.0391 23 12.5305 23 12C23 11.4695 22.7893 10.9609 22.4142 10.5858C22.0391 10.2107 21.5304 10.0001 21.0001 10.0001H20.83C20.5082 9.9987 20.1938 9.90341 19.9255 9.72576C19.6572 9.54797 19.4467 9.29579 19.32 9V8.92001C19.1869 8.61839 19.1471 8.28381 19.206 7.95942C19.2648 7.63503 19.4195 7.33569 19.65 7.1L19.71 7.04001C19.8959 6.85426 20.0435 6.63368 20.1441 6.39088C20.2448 6.14809 20.2966 5.88784 20.2966 5.62501C20.2966 5.36218 20.2448 5.10192 20.1441 4.85912C20.0435 4.61632 19.8959 4.39574 19.71 4.21001C19.5243 4.02405 19.3037 3.87653 19.0609 3.77588C18.8181 3.67523 18.5578 3.62343 18.295 3.62343C18.0321 3.62343 17.772 3.67523 17.5292 3.77588C17.2863 3.87653 17.0658 4.02405 16.88 4.21001L16.8201 4.27C16.5844 4.50055 16.285 4.65519 15.9605 4.714C15.6362 4.77282 15.3017 4.73311 15 4.6C14.7042 4.47324 14.452 4.26275 14.2743 3.99446C14.0966 3.72617 14.0013 3.41179 13.9999 3.09V3.00001C13.9999 2.46957 13.7893 1.96086 13.4142 1.58579C13.0391 1.21072 12.5305 1 12 1C11.4695 1 10.9609 1.21072 10.5858 1.58579C10.2107 1.96086 10.0001 2.46957 10.0001 3.00001V3.17C9.99869 3.49179 9.9034 3.80617 9.72575 4.07446C9.54796 4.34275 9.29579 4.55324 9 4.68H8.92C8.61838 4.81311 8.2838 4.85282 7.95941 4.79401C7.63502 4.73519 7.33568 4.58054 7.1 4.35L7.04 4.29001C6.85425 4.10405 6.63368 3.95653 6.39088 3.85588C6.14808 3.75524 5.88784 3.70343 5.625 3.70343C5.36217 3.70343 5.10191 3.75524 4.85912 3.85588C4.61632 3.95653 4.39574 4.10405 4.21001 4.29001C4.02405 4.47576 3.87653 4.69633 3.77588 4.93912C3.67523 5.18191 3.62343 5.44218 3.62343 5.70501C3.62343 5.96784 3.67523 6.22808 3.77588 6.47088C3.87653 6.71368 4.02405 6.93426 4.21001 7.12001L4.27 7.18001C4.50054 7.41569 4.65519 7.71502 4.714 8.03941C4.77282 8.36382 4.73311 8.69838 4.6 9C4.48572 9.31078 4.2806 9.57987 4.01131 9.77251C3.74201 9.96515 3.42099 10.0723 3.09 10.08H3.00001C2.46957 10.08 1.96086 10.2907 1.58579 10.6658C1.21072 11.0408 1 11.5496 1 12.08C1 12.6105 1.21072 13.1191 1.58579 13.4942C1.96086 13.8693 2.46957 14.08 3.00001 14.08H3.17C3.49179 14.0813 3.80617 14.1766 4.07446 14.3543C4.34275 14.5319 4.55323 14.7842 4.68 15.08C4.81311 15.3817 4.85282 15.7162 4.79401 16.0406C4.73519 16.365 4.58054 16.6643 4.34999 16.9L4.29 16.9601C4.10405 17.1458 3.95653 17.3664 3.85588 17.6092C3.75524 17.8519 3.70343 18.1122 3.70343 18.3751C3.70343 18.6378 3.75524 18.8981 3.85588 19.1409C3.95653 19.3836 4.10405 19.6043 4.29 19.7901C4.47575 19.976 4.69633 20.1235 4.93911 20.2242C5.18191 20.3248 5.44217 20.3767 5.705 20.3767C5.96783 20.3767 6.22808 20.3248 6.47088 20.2242C6.71368 20.1235 6.93425 19.976 7.12 19.7901L7.18001 19.73C7.41568 19.4995 7.71502 19.3449 8.03941 19.286C8.36381 19.2272 8.69838 19.2669 9 19.4C9.31077 19.5143 9.57986 19.7194 9.7725 19.9888C9.96514 20.258 10.0722 20.5791 10.0799 20.91V21.0001C10.0799 21.5304 10.2907 22.0392 10.6658 22.4143C11.0408 22.7894 11.5496 23 12.08 23C12.6105 23 13.1191 22.7894 13.4942 22.4143C13.8693 22.0392 14.08 21.5304 14.08 21.0001V20.83C14.0813 20.5082 14.1766 20.1938 14.3543 19.9255C14.5319 19.6573 14.7842 19.4467 15.08 19.32C15.3817 19.1869 15.7162 19.1471 16.0406 19.206C16.3649 19.2648 16.6643 19.4195 16.8999 19.65L16.96 19.7101C17.1458 19.896 17.3663 20.0435 17.6092 20.1441C17.8519 20.2448 18.1122 20.2966 18.375 20.2966C18.6378 20.2966 18.8981 20.2448 19.1409 20.1441C19.3836 20.0435 19.6043 19.896 19.7901 19.7101C19.976 19.5243 20.1235 19.3037 20.2241 19.0609C20.3248 18.8181 20.3766 18.5578 20.3766 18.295C20.3766 18.0321 20.3248 17.772 20.2241 17.5292C20.1235 17.2863 19.976 17.0658 19.7901 16.88L19.73 16.8201C19.4995 16.5844 19.3448 16.2851 19.286 15.9606ZM14.75 12C14.75 13.5188 13.5188 14.75 12 14.75C10.4812 14.75 9.25 13.5188 9.25 12C9.25 10.4812 10.4812 9.25 12 9.25C13.5188 9.25 14.75 10.4812 14.75 12Z",fill:"currentColor"}),b.createElement("path",{d:"M19.4 15L19.8575 15.2018L19.8595 15.197L19.4 15ZM19.286 15.9606L19.778 15.8713L19.778 15.8713L19.286 15.9606ZM20.0055 14.2743L19.7295 13.8574L19.7293 13.8575L20.0055 14.2743ZM20.91 13.9999L20.91 13.4999L20.9079 13.5L20.91 13.9999ZM22.4142 13.4142L22.7678 13.7678L22.7678 13.7678L22.4142 13.4142ZM22.4142 10.5858L22.7678 10.2323L22.7678 10.2323L22.4142 10.5858ZM20.83 10.0001L20.8278 10.5001H20.83V10.0001ZM19.9255 9.72576L19.6493 10.1425L19.6494 10.1426L19.9255 9.72576ZM19.32 9H18.82V9.10264L18.8604 9.19698L19.32 9ZM19.32 8.92001H19.82V8.81459L19.7774 8.71815L19.32 8.92001ZM19.206 7.95942L19.6979 8.04867L19.6979 8.04867L19.206 7.95942ZM19.65 7.1L19.2967 6.74614L19.2924 6.75044L19.65 7.1ZM19.71 7.04001L20.0633 7.39384L20.0634 7.39371L19.71 7.04001ZM20.1441 6.39088L19.6822 6.19941L19.6822 6.19942L20.1441 6.39088ZM20.1441 4.85912L19.6822 5.05059L19.6822 5.05059L20.1441 4.85912ZM19.71 4.21001L19.3563 4.56338L19.3566 4.56372L19.71 4.21001ZM19.0609 3.77588L19.2524 3.31399L19.2524 3.31399L19.0609 3.77588ZM16.88 4.21001L17.2337 4.56344L17.2337 4.56338L16.88 4.21001ZM16.8201 4.27L17.1697 4.62745L17.1737 4.62343L16.8201 4.27ZM15.9605 4.714L15.8714 4.22202L15.8713 4.22203L15.9605 4.714ZM15 4.6L15.2018 4.14253L15.1969 4.14043L15 4.6ZM14.2743 3.99446L13.8574 4.27051L13.8575 4.27066L14.2743 3.99446ZM13.9999 3.09L13.4999 3.09L13.4999 3.09214L13.9999 3.09ZM13.4142 1.58579L13.0606 1.93936L13.0606 1.93936L13.4142 1.58579ZM10.5858 1.58579L10.9394 1.93936L10.9394 1.93936L10.5858 1.58579ZM10.0001 3.17L10.5001 3.17214V3.17H10.0001ZM9.72575 4.07446L10.1425 4.35066L10.1426 4.35051L9.72575 4.07446ZM9 4.68V5.18H9.10262L9.19695 5.13957L9 4.68ZM8.92 4.68V4.18H8.81457L8.71812 4.22257L8.92 4.68ZM7.95941 4.79401L7.8702 5.28599L7.87022 5.28599L7.95941 4.79401ZM7.1 4.35L6.74642 4.70358L6.75036 4.70743L7.1 4.35ZM7.04 4.29001L6.68625 4.64336L6.68645 4.64356L7.04 4.29001ZM6.39088 3.85588L6.58235 3.39399L6.58233 3.39398L6.39088 3.85588ZM4.85912 3.85588L4.66767 3.39398L4.66764 3.39399L4.85912 3.85588ZM4.21001 4.29001L4.56336 4.64376L4.56377 4.64335L4.21001 4.29001ZM3.77588 4.93912L3.314 4.74764L3.31399 4.74765L3.77588 4.93912ZM3.77588 6.47088L4.23776 6.27941L4.23776 6.27941L3.77588 6.47088ZM4.21001 7.12001L4.5636 6.76649L4.56336 6.76626L4.21001 7.12001ZM4.27 7.18001L4.62744 6.83035L4.62359 6.8265L4.27 7.18001ZM4.714 8.03941L4.22202 8.12861L4.22202 8.12862L4.714 8.03941ZM4.6 9L4.14256 8.79813L4.13618 8.8126L4.13072 8.82745L4.6 9ZM3.09 10.08L3.09 10.5801L3.10163 10.5798L3.09 10.08ZM1.58579 10.6658L1.93929 11.0195L1.93936 11.0194L1.58579 10.6658ZM1.58579 13.4942L1.93936 13.1407L1.93936 13.1407L1.58579 13.4942ZM3.17 14.08L3.17213 13.58H3.17V14.08ZM4.07446 14.3543L3.79841 14.7712L3.79841 14.7712L4.07446 14.3543ZM4.68 15.08L4.2204 15.277L4.22255 15.2819L4.68 15.08ZM4.79401 16.0406L5.28599 16.1298L5.28599 16.1298L4.79401 16.0406ZM4.34999 16.9L4.70385 17.2532L4.70742 17.2496L4.34999 16.9ZM4.29 16.9601L4.64337 17.3138L4.64384 17.3133L4.29 16.9601ZM3.85588 17.6092L4.31774 17.8007L4.31777 17.8006L3.85588 17.6092ZM3.85588 19.1409L3.39397 19.3324L3.39402 19.3325L3.85588 19.1409ZM4.29 19.7901L4.6437 19.4367L4.64337 19.4363L4.29 19.7901ZM4.93911 20.2242L4.74763 20.686L4.74764 20.6861L4.93911 20.2242ZM6.47088 20.2242L6.27941 19.7623L6.2794 19.7623L6.47088 20.2242ZM7.12 19.7901L7.4737 20.1435L7.4738 20.1434L7.12 19.7901ZM7.18001 19.73L6.83041 19.3725L6.82621 19.3767L7.18001 19.73ZM8.03941 19.286L7.95016 18.794L7.95016 18.794L8.03941 19.286ZM9 19.4L8.79814 19.8574L8.81261 19.8638L8.82746 19.8693L9 19.4ZM9.7725 19.9888L9.3658 20.2796L9.36587 20.2797L9.7725 19.9888ZM10.0799 20.91L10.5801 20.91L10.5798 20.8984L10.0799 20.91ZM10.6658 22.4143L11.0195 22.0608L11.0194 22.0607L10.6658 22.4143ZM13.4942 22.4143L13.8478 22.7678L13.8478 22.7678L13.4942 22.4143ZM14.08 20.83L13.58 20.8279V20.83H14.08ZM14.3543 19.9255L13.9374 19.6494L13.9374 19.6495L14.3543 19.9255ZM15.08 19.32L15.277 19.7796L15.2818 19.7774L15.08 19.32ZM16.0406 19.206L15.9513 19.6979L15.9513 19.6979L16.0406 19.206ZM16.8999 19.65L17.2535 19.2964L17.2495 19.2925L16.8999 19.65ZM16.96 19.7101L17.3137 19.3566L17.3136 19.3565L16.96 19.7101ZM17.6092 20.1441L17.8007 19.6823L17.8006 19.6822L17.6092 20.1441ZM19.1409 20.1441L19.3324 20.606L19.3325 20.606L19.1409 20.1441ZM19.7901 19.7101L19.4366 19.3564L19.4364 19.3566L19.7901 19.7101ZM20.2241 19.0609L20.686 19.2524L20.686 19.2524L20.2241 19.0609ZM20.2241 17.5292L20.686 17.3377L20.686 17.3377L20.2241 17.5292ZM19.7901 16.88L20.1435 16.5263L20.1432 16.5261L19.7901 16.88ZM19.73 16.8201L19.3725 17.1697L19.3768 17.174L19.73 16.8201ZM18.9425 14.7982C18.7691 15.1912 18.7173 15.6271 18.794 16.0498L19.778 15.8713C19.737 15.6453 19.7646 15.4122 19.8574 15.2018L18.9425 14.7982ZM19.7293 13.8575C19.3799 14.089 19.1056 14.4175 18.9404 14.803L19.8595 15.197C19.9479 14.9909 20.0946 14.8151 20.2817 14.691L19.7293 13.8575ZM20.9079 13.5C20.4888 13.5017 20.0791 13.6258 19.7295 13.8574L20.2816 14.6911C20.4685 14.5674 20.6877 14.5009 20.9121 14.4999L20.9079 13.5ZM21.0001 13.4999H20.91V14.4999H21.0001V13.4999ZM22.0607 13.0606C21.7794 13.342 21.3978 13.4999 21.0001 13.4999V14.4999C21.663 14.4999 22.2989 14.2366 22.7678 13.7678L22.0607 13.0606ZM22.5 12C22.5 12.3979 22.342 12.7793 22.0607 13.0606L22.7678 13.7678C23.2367 13.2989 23.5 12.6631 23.5 12H22.5ZM22.0607 10.9394C22.342 11.2207 22.5 11.6021 22.5 12H23.5C23.5 11.3369 23.2367 10.7011 22.7678 10.2323L22.0607 10.9394ZM21.0001 10.5001C21.3978 10.5001 21.7794 10.6581 22.0607 10.9394L22.7678 10.2323C22.2989 9.76338 21.663 9.50007 21.0001 9.50007V10.5001ZM20.83 10.5001H21.0001V9.50007H20.83V10.5001ZM19.6494 10.1426C19.9991 10.3742 20.4088 10.4983 20.8278 10.5001L20.8321 9.50007C20.6077 9.49912 20.3885 9.43264 20.2016 9.30888L19.6494 10.1426ZM18.8604 9.19698C19.0256 9.58246 19.2999 9.91099 19.6493 10.1425L20.2017 9.30898C20.0146 9.18495 19.8678 9.00913 19.7795 8.80303L18.8604 9.19698ZM18.82 8.92001V9H19.82V8.92001H18.82ZM18.714 7.87016C18.6373 8.29292 18.6891 8.72889 18.8625 9.12187L19.7774 8.71815C19.6846 8.50788 19.6569 8.27469 19.6979 8.04867L18.714 7.87016ZM19.2924 6.75044C18.9922 7.05749 18.7907 7.44748 18.714 7.87017L19.6979 8.04867C19.7389 7.82258 19.8468 7.61389 20.0075 7.44956L19.2924 6.75044ZM19.3568 6.68618L19.2967 6.74617L20.0032 7.45383L20.0633 7.39384L19.3568 6.68618ZM19.6822 6.19942C19.6068 6.3815 19.4961 6.54696 19.3566 6.68631L20.0634 7.39371C20.2958 7.16156 20.4802 6.88587 20.606 6.58235L19.6822 6.19942ZM19.7966 5.62501C19.7966 5.82209 19.7577 6.01728 19.6822 6.19941L20.606 6.58236C20.7318 6.2789 20.7966 5.95359 20.7966 5.62501H19.7966ZM19.6822 5.05059C19.7577 5.23272 19.7966 5.42792 19.7966 5.62501H20.7966C20.7966 5.29643 20.7318 4.97111 20.606 4.66765L19.6822 5.05059ZM19.3566 4.56372C19.4961 4.70305 19.6068 4.86851 19.6822 5.05059L20.606 4.66765C20.4802 4.36414 20.2958 4.08844 20.0634 3.8563L19.3566 4.56372ZM18.8694 4.23777C19.0515 4.31325 19.2169 4.42388 19.3563 4.56338L20.0638 3.85664C19.8316 3.62422 19.5559 3.43981 19.2524 3.31399L18.8694 4.23777ZM18.295 4.12343C18.4921 4.12343 18.6873 4.16228 18.8694 4.23777L19.2524 3.31399C18.9488 3.18818 18.6235 3.12343 18.295 3.12343V4.12343ZM17.7206 4.23777C17.9027 4.16227 18.0978 4.12343 18.295 4.12343V3.12343C17.9664 3.12343 17.6412 3.18818 17.3377 3.31399L17.7206 4.23777ZM17.2337 4.56338C17.3731 4.42388 17.5385 4.31325 17.7206 4.23777L17.3377 3.31399C17.0341 3.43981 16.7585 3.62422 16.5263 3.85664L17.2337 4.56338ZM17.1737 4.62343L17.2337 4.56344L16.5263 3.85658L16.4664 3.91657L17.1737 4.62343ZM16.0497 5.20599C16.4725 5.12936 16.8626 4.92785 17.1697 4.62742L16.4704 3.91258C16.3062 4.07324 16.0976 4.18102 15.8714 4.22202L16.0497 5.20599ZM14.7981 5.05745C15.1912 5.23087 15.6271 5.28263 16.0498 5.20598L15.8713 4.22203C15.6453 4.26302 15.4121 4.23536 15.2018 4.14255L14.7981 5.05745ZM13.8575 4.27066C14.089 4.6201 14.4176 4.89437 14.803 5.05957L15.1969 4.14043C14.9909 4.05211 14.8151 3.90541 14.691 3.71827L13.8575 4.27066ZM13.4999 3.09214C13.5017 3.51128 13.6258 3.92088 13.8574 4.27051L14.6911 3.71842C14.5674 3.53147 14.5009 3.31231 14.4999 3.08787L13.4999 3.09214ZM13.4999 3.00001V3.09H14.4999V3.00001H13.4999ZM13.0606 1.93936C13.3419 2.22063 13.4999 2.60214 13.4999 3.00001H14.4999C14.4999 2.337 14.2366 1.7011 13.7677 1.23223L13.0606 1.93936ZM12 1.5C12.3978 1.5 12.7793 1.65802 13.0606 1.93936L13.7677 1.23223C13.2989 0.763416 12.6631 0.5 12 0.5V1.5ZM10.9394 1.93936C11.2207 1.65802 11.6022 1.5 12 1.5V0.5C11.3369 0.5 10.7011 0.763416 10.2323 1.23223L10.9394 1.93936ZM10.5001 3.00001C10.5001 2.60214 10.6581 2.22063 10.9394 1.93936L10.2323 1.23223C9.76337 1.7011 9.50006 2.337 9.50006 3.00001H10.5001ZM10.5001 3.17V3.00001H9.50006V3.17H10.5001ZM10.1426 4.35051C10.3742 4.00088 10.4983 3.59128 10.5001 3.17214L9.50007 3.16786C9.49911 3.39231 9.43265 3.61146 9.30886 3.79842L10.1426 4.35051ZM9.19695 5.13957C9.58244 4.97437 9.91098 4.7001 10.1425 4.35066L9.30896 3.79827C9.18494 3.98541 9.00914 4.1321 8.80305 4.22042L9.19695 5.13957ZM8.92 5.18H9V4.18H8.92V5.18ZM7.87022 5.28599C8.29291 5.36262 8.72887 5.31088 9.12188 5.13743L8.71812 4.22257C8.5079 4.31534 8.2747 4.34302 8.0486 4.30203L7.87022 5.28599ZM6.75036 4.70743C7.05747 5.00783 7.44751 5.20934 7.8702 5.28599L8.04862 4.30204C7.82253 4.26104 7.6139 4.15325 7.44963 3.99257L6.75036 4.70743ZM6.68645 4.64356L6.74645 4.70356L7.45354 3.99644L7.39355 3.93645L6.68645 4.64356ZM6.19941 4.31776C6.3815 4.39325 6.54694 4.50389 6.68625 4.64336L7.39375 3.93665C7.16157 3.70421 6.88585 3.51981 6.58235 3.39399L6.19941 4.31776ZM5.625 4.20343C5.82212 4.20343 6.01731 4.24229 6.19943 4.31777L6.58233 3.39398C6.27885 3.2682 5.95355 3.20343 5.625 3.20343V4.20343ZM5.05057 4.31777C5.23268 4.24229 5.42789 4.20343 5.625 4.20343V3.20343C5.29646 3.20343 4.97115 3.26819 4.66767 3.39398L5.05057 4.31777ZM4.56377 4.64335C4.70306 4.50389 4.86849 4.39325 5.05059 4.31776L4.66764 3.39399C4.36414 3.51981 4.08842 3.70421 3.85624 3.93666L4.56377 4.64335ZM4.23776 5.1306C4.31325 4.94851 4.42389 4.78307 4.56336 4.64376L3.85665 3.93626C3.62421 4.16844 3.43981 4.44415 3.314 4.74764L4.23776 5.1306ZM4.12343 5.70501C4.12343 5.50787 4.16228 5.31267 4.23776 5.13059L3.31399 4.74765C3.18817 5.05116 3.12343 5.37648 3.12343 5.70501H4.12343ZM4.23776 6.27941C4.16228 6.09732 4.12343 5.90214 4.12343 5.70501H3.12343C3.12343 6.03354 3.18817 6.35885 3.31399 6.66235L4.23776 6.27941ZM4.56336 6.76626C4.42389 6.62694 4.31325 6.4615 4.23776 6.27941L3.31399 6.66235C3.43981 6.96586 3.62421 7.24157 3.85665 7.47376L4.56336 6.76626ZM4.62359 6.8265L4.5636 6.76649L3.85641 7.47352L3.9164 7.53352L4.62359 6.8265ZM5.20598 7.95022C5.12935 7.52752 4.92783 7.13747 4.62742 6.83037L3.91258 7.52965C4.07325 7.69391 4.18103 7.90253 4.22202 8.12861L5.20598 7.95022ZM5.05743 9.20188C5.23088 8.80887 5.28262 8.37292 5.20598 7.95021L4.22202 8.12862C4.26302 8.35472 4.23534 8.5879 4.14256 8.79813L5.05743 9.20188ZM4.30221 10.1792C4.65304 9.9282 4.92035 9.57757 5.06928 9.17256L4.13072 8.82745C4.05109 9.04399 3.90816 9.23154 3.7204 9.36584L4.30221 10.1792ZM3.10163 10.5798C3.53294 10.5698 3.95127 10.4302 4.30221 10.1792L3.7204 9.36584C3.53275 9.50008 3.30904 9.57473 3.07837 9.58009L3.10163 10.5798ZM3.00001 10.58H3.09V9.57996H3.00001V10.58ZM1.93936 11.0194C2.22069 10.738 2.60223 10.58 3.00001 10.58V9.57996C2.33691 9.57996 1.70104 9.84346 1.23223 10.3123L1.93936 11.0194ZM1.5 12.08C1.5 11.6821 1.65806 11.3006 1.93929 11.0195L1.23229 10.3122C0.763381 10.781 0.5 11.417 0.5 12.08H1.5ZM1.93936 13.1407C1.65802 12.8593 1.5 12.4779 1.5 12.08H0.5C0.5 12.7431 0.763415 13.3789 1.23223 13.8478L1.93936 13.1407ZM3.00001 13.58C2.60214 13.58 2.22063 13.422 1.93936 13.1407L1.23222 13.8478C1.7011 14.3167 2.337 14.58 3.00001 14.58V13.58ZM3.17 13.58H3.00001V14.58H3.17V13.58ZM4.35051 13.9374C4.00088 13.7059 3.59127 13.5818 3.17213 13.58L3.16786 14.58C3.3923 14.5809 3.61146 14.6474 3.79841 14.7712L4.35051 13.9374ZM5.13956 14.883C4.97441 14.4977 4.70016 14.1689 4.35051 13.9374L3.79841 14.7712C3.98534 14.895 4.13206 15.0708 4.22043 15.277L5.13956 14.883ZM5.28599 16.1298C5.36262 15.7071 5.31087 15.2712 5.13744 14.8782L4.22255 15.2819C4.31535 15.4922 4.34301 15.7253 4.30203 15.9514L5.28599 16.1298ZM4.70742 17.2496C5.00783 16.9425 5.20934 16.5525 5.28599 16.1298L4.30203 15.9514C4.26104 16.1774 4.15325 16.3861 3.99257 16.5503L4.70742 17.2496ZM4.64384 17.3133L4.70383 17.2532L3.99616 16.5467L3.93616 16.6068L4.64384 17.3133ZM4.31777 17.8006C4.39324 17.6186 4.50388 17.4531 4.64337 17.3138L3.93663 16.6063C3.70422 16.8385 3.51981 17.1142 3.39398 17.4177L4.31777 17.8006ZM4.20343 18.3751C4.20343 18.1778 4.2423 17.9826 4.31774 17.8007L3.39401 17.4177C3.26818 17.7211 3.20343 18.0465 3.20343 18.3751H4.20343ZM4.31778 18.9495C4.24228 18.7673 4.20343 18.5721 4.20343 18.3751H3.20343C3.20343 18.7035 3.26819 19.0289 3.39397 19.3324L4.31778 18.9495ZM4.64337 19.4363C4.50394 19.2971 4.39325 19.1315 4.31773 18.9494L3.39402 19.3325C3.5198 19.6358 3.70416 19.9116 3.93663 20.1438L4.64337 19.4363ZM5.13059 19.7623C4.94852 19.6868 4.78305 19.5761 4.6437 19.4367L3.93631 20.1435C4.16845 20.3758 4.44414 20.5602 4.74763 20.686L5.13059 19.7623ZM5.705 19.8767C5.50792 19.8767 5.31272 19.8378 5.13059 19.7623L4.74764 20.6861C5.0511 20.8118 5.37642 20.8767 5.705 20.8767V19.8767ZM6.2794 19.7623C6.09727 19.8378 5.90208 19.8767 5.705 19.8767V20.8767C6.03359 20.8767 6.35889 20.8118 6.66235 20.6861L6.2794 19.7623ZM6.7663 19.4367C6.62695 19.5761 6.46149 19.6868 6.27941 19.7623L6.66235 20.6861C6.96586 20.5602 7.24155 20.3758 7.4737 20.1435L6.7663 19.4367ZM6.82621 19.3767L6.7662 19.4368L7.4738 20.1434L7.53381 20.0833L6.82621 19.3767ZM7.95016 18.794C7.52747 18.8707 7.13748 19.0723 6.83044 19.3725L7.52957 20.0875C7.69388 19.9268 7.90256 19.819 8.12866 19.778L7.95016 18.794ZM9.20186 18.9425C8.80888 18.7691 8.37292 18.7173 7.95016 18.794L8.12866 19.778C8.3547 19.737 8.58788 19.7646 8.79814 19.8574L9.20186 18.9425ZM10.1792 19.6979C9.92824 19.347 9.57759 19.0796 9.17254 18.9307L8.82746 19.8693C9.04396 19.9489 9.23149 20.0918 9.3658 20.2796L10.1792 19.6979ZM10.5798 20.8984C10.5698 20.4671 10.4302 20.0487 10.1791 19.6978L9.36587 20.2797C9.50006 20.4673 9.57472 20.691 9.58008 20.9216L10.5798 20.8984ZM10.5799 21.0001V20.91H9.57995V21.0001H10.5799ZM11.0194 22.0607C10.738 21.7793 10.5799 21.3978 10.5799 21.0001H9.57995C9.57995 21.6631 9.84346 22.299 10.3123 22.7678L11.0194 22.0607ZM12.08 22.5C11.6821 22.5 11.3006 22.342 11.0195 22.0608L10.3122 22.7678C10.781 23.2367 11.417 23.5 12.08 23.5V22.5ZM13.1407 22.0607C12.8593 22.342 12.4779 22.5 12.08 22.5V23.5C12.7431 23.5 13.3789 23.2367 13.8478 22.7678L13.1407 22.0607ZM13.58 21.0001C13.58 21.3978 13.422 21.7794 13.1407 22.0607L13.8478 22.7678C14.3167 22.2989 14.58 21.663 14.58 21.0001H13.58ZM13.58 20.83V21.0001H14.58V20.83H13.58ZM13.9374 19.6495C13.7059 19.9991 13.5818 20.4088 13.58 20.8279L14.58 20.8321C14.5809 20.6077 14.6474 20.3885 14.7712 20.2016L13.9374 19.6495ZM14.883 18.8604C14.4977 19.0256 14.1689 19.2999 13.9374 19.6494L14.7712 20.2016C14.8949 20.0146 15.0708 19.8679 15.277 19.7795L14.883 18.8604ZM16.1298 18.714C15.7071 18.6373 15.2712 18.6891 14.8782 18.8625L15.2818 19.7774C15.4922 19.6846 15.7253 19.6569 15.9513 19.6979L16.1298 18.714ZM17.2495 19.2925C16.9425 18.9922 16.5525 18.7907 16.1298 18.714L15.9513 19.6979C16.1774 19.739 16.3861 19.8468 16.5504 20.0075L17.2495 19.2925ZM17.3136 19.3565L17.2535 19.2964L16.5464 20.0035L16.6065 20.0636L17.3136 19.3565ZM17.8006 19.6822C17.6185 19.6068 17.4531 19.4961 17.3137 19.3566L16.6064 20.0635C16.8385 20.2958 17.1142 20.4802 17.4177 20.606L17.8006 19.6822ZM18.375 19.7966C18.1779 19.7966 17.9827 19.7577 17.8007 19.6823L17.4176 20.606C17.7211 20.7318 18.0464 20.7966 18.375 20.7966V19.7966ZM18.9495 19.6822C18.7673 19.7578 18.5721 19.7966 18.375 19.7966V20.7966C18.7036 20.7966 19.0289 20.7318 19.3324 20.606L18.9495 19.6822ZM19.4364 19.3566C19.2971 19.4961 19.1315 19.6068 18.9494 19.6823L19.3325 20.606C19.6358 20.4802 19.9115 20.2958 20.1437 20.0635L19.4364 19.3566ZM19.7623 18.8695C19.6868 19.0515 19.5761 19.217 19.4366 19.3564L20.1435 20.0637C20.3758 19.8316 20.5602 19.5559 20.686 19.2524L19.7623 18.8695ZM19.8766 18.295C19.8766 18.492 19.8378 18.6873 19.7623 18.8695L20.686 19.2524C20.8118 18.9489 20.8766 18.6236 20.8766 18.295H19.8766ZM19.7623 17.7206C19.8378 17.9028 19.8766 18.0979 19.8766 18.295H20.8766C20.8766 17.9664 20.8118 17.6412 20.686 17.3377L19.7623 17.7206ZM19.4366 17.2337C19.5761 17.3731 19.6868 17.5385 19.7623 17.7206L20.686 17.3377C20.5602 17.0341 20.3758 16.7585 20.1435 16.5263L19.4366 17.2337ZM19.3768 17.174L19.4369 17.234L20.1432 16.5261L20.0831 16.4661L19.3768 17.174ZM18.794 16.0498C18.8707 16.4726 19.0722 16.8626 19.3725 17.1696L20.0875 16.4705C19.9268 16.3062 19.819 16.0975 19.778 15.8713L18.794 16.0498ZM12 15.25C13.795 15.25 15.25 13.795 15.25 12H14.25C14.25 13.2427 13.2427 14.25 12 14.25V15.25ZM8.75 12C8.75 13.795 10.205 15.25 12 15.25V14.25C10.7573 14.25 9.75 13.2427 9.75 12H8.75ZM12 8.75C10.205 8.75 8.75 10.205 8.75 12H9.75C9.75 10.7573 10.7573 9.75 12 9.75V8.75ZM15.25 12C15.25 10.205 13.795 8.75 12 8.75V9.75C13.2427 9.75 14.25 10.7573 14.25 12H15.25Z",fill:"currentColor"}))}var dn="_button_1t4fm_7",cn="_dot_1t4fm_14",hn="_menu_1t4fm_26",pn="_menuItem_1t4fm_31",un="_highlight_1t4fm_41",mn=Object.defineProperty,gn=Object.getOwnPropertyDescriptor;let fn=class extends b.Component{constructor(){super(...arguments),this.button=b.createRef(),this.state={isOpen:!1,isUpdateReadyDialogOpen:!1,isShortcutDialogOpen:!1},this.handleToggle=()=>{this.setState((e=>({isOpen:!e.isOpen})))},this.handleClose=()=>{this.setState({isOpen:!1})},this.handleSwitchTheme=()=>{ae.apply("light"===ae.theme?"dark":"light"),this.handleClose()},this.handleUpdateCheck=async()=>{this.handleClose(),await Li.check()},this.handleUpdateDownload=async()=>{this.handleClose(),await Li.download()},this.handleUpdateInstall=()=>{this.setState({isUpdateReadyDialogOpen:!0}),this.handleClose()},this.handleViewShortcuts=()=>{this.setState({isOpen:!1,isShortcutDialogOpen:!0})}}componentDidMount(){let e=g((()=>Li.isUpdateReady)).observe((({newValue:t})=>{t&&(e(),this.setState({isUpdateReadyDialogOpen:!0}))}))}render(){const{isOpen:e,isUpdateReadyDialogOpen:t,isShortcutDialogOpen:s}=this.state;return b.createElement(b.Fragment,null,b.createElement(ha,{innerRef:this.button,className:S(dn,{[cn]:!Li.isUpToDate||Li.isUpdateReady}),ghost:!0,onClick:this.handleToggle,"data-cy":"settings-dialog"},b.createElement(on,null)),e&&b.createElement(Fa,{target:this.button,onClickOutside:this.handleClose},b.createElement("ul",{className:hn},b.createElement("li",{className:pn,onClick:this.handleSwitchTheme},"light"===ae.theme?"Dark theme":"Light theme"),Li.hasCheckedForUpdates&&!Li.isUpToDate&&!Li.isDownloading&&!Li.isUpdateReady&&b.createElement("li",{className:S(pn,{[un]:!0}),onClick:this.handleUpdateDownload},"Download v",Li.latestVersion),Li.isDownloading&&b.createElement("li",{className:S(pn,{[un]:!0}),onClick:this.handleUpdateDownload},"Downloading v",Li.latestVersion),Li.isUpdateReady&&b.createElement("li",{className:S(pn,{[un]:!0}),onClick:this.handleUpdateInstall},"Install v",Li.latestVersion),T.updates&&b.createElement("li",{className:pn,onClick:this.handleUpdateCheck},"Check for updates"),b.createElement("li",{className:pn},b.createElement("a",{href:"https://github.com/prisma/studio/releases",target:"_blank",rel:"noreferrer noopener"},"View changelog")),b.createElement("li",{className:pn,onClick:this.handleViewShortcuts,"data-cy":"view-shortcuts"},"View shortcuts"))),t&&b.createElement(ln,{onClose:()=>this.setState({isUpdateReadyDialogOpen:!1})}),s&&b.createElement(tn,{onClose:()=>this.setState({isShortcutDialogOpen:!1})}))}};fn=((e,t,s,i)=>{for(var a,n=i>1?void 0:i?gn(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&mn(t,s,n),n})([_],fn);var vn=fn;var yn="_container_1ud7d_1";var In=_((({className:e})=>b.createElement("div",{"data-cy":"header",className:S(yn,e),style:{paddingLeft:T.headerLeftOffset}},b.createElement(Za,null),b.createElement(vn,null))));function Cn(e){return b.createElement("svg",Object.assign({viewBox:"0 0 9 7",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{d:"M4.5 7L8.39711 0.25H0.602886L4.5 7Z",fill:"currentColor"}))}var wn={container:"_container_1pcqt_1",content:"_content_1pcqt_10",description:"_description_1pcqt_20",reportBtn:"_reportBtn_1pcqt_25",detailsBtn:"_detailsBtn_1pcqt_36",open:"_open_1pcqt_49",dump:"_dump_1pcqt_52"};class En extends b.PureComponent{constructor(){super(...arguments),this.state={isDetailsOpen:!1},this.handleToggleDetails=()=>{this.setState((e=>({isDetailsOpen:!e.isDetailsOpen})))},this.handleDismiss=()=>{De.updateError({visible:!1})}}render(){const{isDetailsOpen:e}=this.state;return b.createElement(La,{className:wn.container,error:!0,title:"Prisma Client Error",primaryButton:b.createElement(ha,{className:wn.action,onClick:this.handleDismiss},"Dismiss"),secondaryButton:b.createElement("a",{href:"https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/error-reference#query-engine",target:"_blank",rel:"noreferrer noopener"},"Error Documentation")},b.createElement("div",{className:wn.content},b.createElement("p",{className:wn.description},He.description),b.createElement(ha,{ghost:!0,className:S(wn.detailsBtn,{[wn.open]:e}),onClick:this.handleToggleDetails},b.createElement(b.Fragment,null,b.createElement(Cn,null),e?"Hide":"Show"," details")),e&&b.createElement("pre",{className:wn.dump},He.dump)))}}var bn=_(En);class _n extends b.PureComponent{constructor(){super(...arguments),this.state={isDetailsOpen:!1,isSendingReport:!1,didFailErrorReport:!1,errorReportId:null},this.handleToggleDetails=()=>{this.setState((e=>({isDetailsOpen:!e.isDetailsOpen})))},this.handleDiscard=()=>{Ms.discard(),setTimeout((()=>{T.isBrowser?window.location.reload():window.transport.request({channel:"project",action:"close",payload:{data:null}})}),500)},this.handleRestart=()=>{window.location.reload()}}render(){const{isDetailsOpen:e}=this.state;return b.createElement(La,{className:wn.container,error:!0,title:"Fatal Error",primaryButton:b.createElement(ha,{className:wn.action,onClick:this.handleRestart},b.createElement(b.Fragment,null,"Reopen ",T.isBrowser?"Studio":"Project")),secondaryButton:b.createElement(ha,{ghost:!0,className:S(wn.action,wn.discardBtn),onClick:this.handleDiscard},b.createElement(b.Fragment,null,"Discard all unsaved changes and close"," ",T.isBrowser?"Studio":"project"))},b.createElement("div",{className:wn.content},b.createElement("p",{className:wn.description},"A non-recoverable error has occurred and Studio has to be restarted. Please consider reporting this error to us by opening an issue on GitHub and attaching the error details."),b.createElement("a",{href:"https://github.com/prisma/studio/issues/new",target:"_blank",rel:"noreferrer noopener",className:wn.reportBtn},"Report error in a new GitHub issue"),b.createElement(ha,{ghost:!0,className:S(wn.detailsBtn,{[wn.open]:e}),onClick:this.handleToggleDetails},b.createElement(b.Fragment,null,b.createElement(Cn,null),e?"Hide":"Show"," details")),e&&b.createElement("pre",{className:wn.dump},He.dump)))}}var Sn=_(_n);class xn extends b.PureComponent{constructor(){super(...arguments),this.handleRestart=()=>{window.location.reload()}}render(){return b.createElement(La,{className:wn.container,error:!0,title:"Prisma Schema Changed",primaryButton:b.createElement(ha,{className:wn.action,onClick:this.handleRestart},"Reload"),secondaryButton:b.createElement("a",{href:"https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/error-reference#query-engine",target:"_blank",rel:"noreferrer noopener"},"Error Documentation")},b.createElement("div",{className:wn.content},b.createElement("p",{className:wn.description},He.description)))}}var Nn=_(xn);var Mn="_container_32t9m_1",Ln="_mask_32t9m_25",Rn="_item_32t9m_29",An="_highlighted_32t9m_37";class On extends b.PureComponent{constructor(e){super(e),this.menuRef=b.createRef(),this.itemRefs=[],this.handleHighlightNext=()=>{const{items:e}=this.props;this.setState((t=>t.highlightIndex===e.length-1?{highlightIndex:0}:{highlightIndex:t.highlightIndex+1}),(()=>{var e,t;null==(e=this.itemRefs[this.state.highlightIndex].current)||e.scrollIntoView(!1),null==(t=this.itemRefs[this.state.highlightIndex].current)||t.scrollIntoView({block:"nearest"})}))},this.handleHighlightPrevious=()=>{const{items:e}=this.props;this.setState((t=>0===t.highlightIndex||-1===t.highlightIndex?{highlightIndex:e.length-1}:{highlightIndex:t.highlightIndex-1}),(()=>{var e,t;null==(e=this.itemRefs[this.state.highlightIndex].current)||e.scrollIntoView(!1),null==(t=this.itemRefs[this.state.highlightIndex].current)||t.scrollIntoView({block:"nearest"})}))},this.handleSelect=()=>{const{highlightIndex:e}=this.state,{items:t,onSelect:s}=this.props;e<0||e>=t.length||s(t[e])},this.handleCancel=e=>{e.preventDefault()},this.state={highlightIndex:-1},this.itemRefs=e.items.map((()=>b.createRef()))}componentDidMount(){var e,t;(null==(e=this.props.target.current)?void 0:e.getBoundingClientRect())&&(null==(t=this.menuRef.current)||t.focus())}render(){const{highlightIndex:e}=this.state,{target:t,items:s,onSelect:i,onBlur:a}=this.props;return b.createElement(Ca,{className:Mn,maskClassName:Ln,domElementId:"dropdown-root",target:t,targetOffsetY:0,darken:!1,onClickOutside:a},b.createElement(b.Fragment,null,b.createElement("div",{ref:this.menuRef,className:Mn,tabIndex:1},s.map(((t,s)=>b.createElement("div",{ref:this.itemRefs[s],key:t.id,"data-cy":"dropdown-menu__item",className:S(Rn,{[An]:e===s}),onClick:()=>i(t)},t.label)))),b.createElement(ma,{keys:"up",target:this.menuRef,onMatch:this.handleHighlightPrevious}),b.createElement(ma,{keys:"down",target:this.menuRef,onMatch:this.handleHighlightNext}),b.createElement(ma,{keys:"esc",target:this.menuRef,onMatch:()=>null==a?void 0:a()}),b.createElement(ma,{keys:"enter",target:this.menuRef,onMatch:this.handleSelect})))}}var Dn=_(On);function kn(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("g",null,b.createElement("circle",{cx:6,cy:12,r:2}),b.createElement("circle",{cx:12,cy:12,r:2}),b.createElement("circle",{cx:18,cy:12,r:2})))}var Tn="_container_1gnx9_1",Pn="_button_1gnx9_7",Vn="_open_1gnx9_18",jn="_textButton_1gnx9_27",Zn="_caret_1gnx9_45",Bn="_select_1gnx9_55";class Fn extends b.PureComponent{constructor(){super(...arguments),this.button=b.createRef(),this.state={isOpen:!1},this.handleToggle=()=>{this.state.isOpen?this.handleClose():this.handleOpen()},this.handleSelect=e=>{const{onSelect:t}=this.props;t&&t(e),setTimeout((()=>this.handleToggle()),0)},this.handleOpen=()=>{setTimeout((()=>this.setState({isOpen:!0})),0)},this.handleClose=()=>{setTimeout((()=>this.setState({isOpen:!1})),0)}}render(){const e=this.props,{className:t,type:s,nativeSelect:i,items:a,selectedItem:l,onSelect:o,innerRef:d,buttonClassName:c}=e,h=r(e,["className","type","nativeSelect","items","selectedItem","onSelect","innerRef","buttonClassName"]),{isOpen:p}=this.state;return b.createElement("div",{className:S(Tn,t)},b.createElement("div",n({ref:this.button,className:S(Pn,{[Vn]:p},c),onClick:this.handleToggle},h),"button"===s&&b.createElement(kn,null),"text"===s&&b.createElement("div",{"data-cy":"dropdown__item--selected",className:jn,title:null==l?void 0:l.label},b.createElement("span",null,(null==l?void 0:l.label)||""),b.createElement("div",{className:Zn}))),i&&b.createElement("select",{ref:d,className:Bn,value:null==l?void 0:l.id,onChange:e=>this.handleSelect(a.find((t=>t.id===e.currentTarget.value)))},a.map((e=>b.createElement("option",{key:e.id,value:e.id},e.label)))),p&&!i&&b.createElement(Dn,{target:this.button,items:a,onSelect:this.handleSelect,onBlur:this.handleClose}))}}var Hn=_(Fn);var qn="_tooltip_1r196_1",Un="_empty_1r196_7",zn="_emptyText_1r196_17",$n="_cell_1r196_29",Jn="_invalid_1r196_35",Yn="_fields_1r196_39",Wn="_field_1r196_39",Kn="_dropdown_1r196_48",Gn="_operation_1r196_54",Qn="_value_1r196_55",Xn="_deleteButton_1r196_108",er="_addButton_1r196_131";class tr extends b.PureComponent{constructor(){super(...arguments),this.runScriptDebounced=l.debounce((()=>{var e;(null==(e=gi.activeTab)?void 0:e.session.script).run()}),500,{leading:!1,trailing:!0}),this.handleChangeField=({id:e},t)=>{var s,i,a,n;const{whereId:r}=this.props;null==(s=gi.activeTab)||s.update({preview:!1});const l=null==(i=gi.activeTab)?void 0:i.session.script,o=l.where.get(r);if(o){if(l.update({frozen:!1}),0===t){const t=ye.get(e);if(null==t?void 0:t.isRelation){const t=null==(n=null==(a=ye.get(e))?void 0:a.typeAsModel)?void 0:n.uniqueIdentifiers[0].id;o.update({fieldIds:[e,t]})}else o.update({fieldIds:[e]})}else{const s=[...o.fieldIds];s[t]=e,o.update({fieldIds:s})}o.supportedOperations.includes(o.operation)||this.handleChangeOperation({id:o.supportedOperations[0]}),["in","notIn"].includes(o.operation)&&this.handleChangeValue("[]"),this.runScriptDebounced(),Ve.send({command:"filter_change",commandDetails:{total_filters_count:l.where.size,field_types:o.fields.map((e=>e.type)),operation:o.operation}})}},this.handleChangeOperation=({id:e})=>{var t,s;const{whereId:i}=this.props;null==(t=gi.activeTab)||t.update({preview:!1});const a=null==(s=gi.activeTab)?void 0:s.session.script,n=a.where.get(i);n&&(a.update({frozen:!1}),n.update({operation:e}),["in","notIn"].includes(n.operation)&&this.handleChangeValue("[]"),["isNull","isNotNull"].includes(n.operation)&&this.handleChangeValue(""),this.runScriptDebounced(),Ve.send({command:"filter_change",commandDetails:{total_filters_count:a.where.size,field_types:n.fields.map((e=>e.type)),operation:n.operation}}))},this.handleChangeValue=e=>{var t,s;const{whereId:i}=this.props;null==(t=gi.activeTab)||t.update({preview:!1});const a=null==(s=gi.activeTab)?void 0:s.session.script;a.update({frozen:!1});const n=a.where.get(i);n&&(n.update({value:e}),this.runScriptDebounced())},this.handleDelete=()=>{var e,t;const{whereId:s}=this.props;null==(e=gi.activeTab)||e.update({preview:!1});(null==(t=gi.activeTab)?void 0:t.session.script).where.remove(s),this.runScriptDebounced()}}render(){var e;const{whereId:t}=this.props,s=gi.activeTab.session.script.where.get(t);return s?b.createElement(b.Fragment,null,b.createElement("div",{className:S(Yn,$n,{[Jn]:!s.isValid})},s.fields.slice(0,2).map(((e,t)=>b.createElement("div",{className:Wn,key:t},b.createElement(Hn,{"data-cy":"where-filter__row__field"+(t>0?"_relation_scalars":""),"data-cy-invalid":!s.isValid,buttonClassName:Kn,type:"text",items:s.getFilterableFieldsAtIndex(t).map((e=>({id:e.id,label:e.name}))),selectedItem:{id:e.id,label:e.name},onSelect:e=>this.handleChangeField(e,t)}))))),b.createElement("div",{className:S(Gn,$n,{[Jn]:!s.isValid})},b.createElement(Hn,{"data-cy":"where-filter__row__operation",buttonClassName:Kn,type:"text",items:s.supportedOperations.map((e=>({id:e,label:e}))),selectedItem:{id:s.operation,label:s.operation},onSelect:this.handleChangeOperation})),b.createElement("div",{className:S(Qn,$n,{[Jn]:!s.isValid})},b.createElement("input",{"data-cy":"where-filter__row__value",type:"text",disabled:"isNull"===s.operation||"isNotNull"===s.operation,placeholder:null==(e=l.last(s.fields))?void 0:e.placeholder,value:null===s.value?"":s.value,onChange:e=>this.handleChangeValue(e.currentTarget.value)})),b.createElement("div",{className:S(Xn,$n,{[Jn]:!s.isValid})},b.createElement(ua,{"data-cy":"where-filter__row__delete-btn",onClick:this.handleDelete},b.createElement(Da,null)))):null}}var sr=_(tr);var ir="_container_bc1do_1",ar="_pill_bc1do_8",nr="_label_bc1do_26",rr="_open_bc1do_33",lr="_exists_bc1do_43";class or extends b.PureComponent{constructor(){super(...arguments),this.button=b.createRef(),this.state={isOpen:!1},this.handleToggle=()=>{this.setState((e=>({isOpen:!e.isOpen})))},this.handleAddWhere=()=>{var e,t;null==(e=gi.activeTab)||e.update({preview:!1});const s=null==(t=gi.activeTab)?void 0:t.session.script;s.update({frozen:!1});const i=s.where.add({fieldIds:[s.model.uniqueIdentifiers[0].id],value:null});s.pagination.reset(),Ve.send({command:"filter_change",commandDetails:{total_filters_count:s.where.size,field_types:i.fields.map((e=>e.type)),operation:i.operation}})}}render(){const{isOpen:e}=this.state,{where:t}=gi.activeTab.session.script;return b.createElement("div",{className:ir},b.createElement("div",{"data-cy":"where-filter",ref:this.button,className:S(ar,{[rr]:e,[lr]:t.size>0}),onClick:this.handleToggle}," ",b.createElement("span",{className:S(nr)},"Filters"),b.createElement("span",null,t.size||"None"," ")),e&&b.createElement(Fa,{className:S(qn,{[Un]:0===t.size}),target:this.button,onClickOutside:this.handleToggle},b.createElement(b.Fragment,null,0===t.size&&b.createElement("p",{className:zn},"Use filters to narrow down your data. Multiple filters show results at their intersection (AND)."),Object.values(t.values).map((e=>b.createElement(sr,{key:e.id,whereId:e.id}))),b.createElement(ha,{"data-cy":"create-where-filter-btn",className:er,blue:!0,onClick:this.handleAddWhere},"Add a new filter"))))}}var dr=_(or);var cr={container:"_container_1lyn8_1",input:"_input_1lyn8_6",file:"_file_1lyn8_16"};class hr extends b.PureComponent{constructor(){super(...arguments),this.input=b.createRef(),this.handleChange=e=>{const{disabled:t,onChange:s}=this.props;t||s(e.currentTarget.value)},this.handleBlur=()=>{const{disabled:e,onBlur:t}=this.props;e||t()}}componentDidMount(){var e;const t=null!=(e=this.props.innerRef)?e:this.input;t.current&&this.props.focusOnMount&&t.current.focus()}render(){const e=this.props,{className:t,innerRef:s,style:i,type:a,tabIndex:l,value:o,placeholder:d,disabled:c,focusOnMount:h,onChange:p,onBlur:u,onConfirm:m,onCancel:g}=e,f=r(e,["className","innerRef","style","type","tabIndex","value","placeholder","disabled","focusOnMount","onChange","onBlur","onConfirm","onCancel"]),v=null!=s?s:this.input;return b.createElement("div",n({className:S(cr.container,t),style:i},f),b.createElement("input",{ref:v,lang:"en",tabIndex:l,className:S(cr.input,{[cr.disabled]:c}),type:a,placeholder:d,disabled:c,value:null===o?"":o,onChange:this.handleChange,onBlur:this.handleBlur}),m&&b.createElement(ma,{keys:"enter",target:v,onMatch:m}),g&&b.createElement(ma,{keys:"esc",target:v,onMatch:g}))}}function pr(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.3327 2.54004C24.1705 3.30678 24.227 4.60642 23.4591 5.44287L9.78844 20.3338C9.3987 20.7583 8.8484 21 8.27163 21C7.69485 21 7.14456 20.7583 6.75481 20.3338L0.540861 13.5652C-0.227044 12.7287 -0.170453 11.4291 0.667261 10.6624C1.50497 9.89561 2.80659 9.95212 3.57449 10.7886L8.27163 15.9049L20.4255 2.66625C21.1934 1.82981 22.495 1.7733 23.3327 2.54004Z"}))}function ur(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("rect",{fillRule:"evenodd",clipRule:"evenodd",y:10,width:24,height:4,rx:2}))}hr.defaultProps={value:"",disabled:!1,focusOnMount:!1,onChange:()=>{},onBlur:()=>{}};var mr="_container_me63q_1",gr="_checkbox_me63q_8",fr="_checked_me63q_22";var vr=_((({className:e,checked:t=!1,indeterminate:s=!1,onChange:i})=>b.createElement("div",{"data-cy":"checkbox","data-cy-selected":t,className:S(mr,e),onClick:()=>i&&i(!t)},b.createElement("div",{className:S(gr,{[fr]:t})},t&&(s?b.createElement(ur,null):b.createElement(pr,null))))));var yr="_tooltip_1bhvr_1",Ir="_search_1bhvr_7",Cr="_checkbox_1bhvr_30",wr="_name_1bhvr_39",Er="_type_1bhvr_50";class br extends b.PureComponent{constructor(){super(...arguments),this.button=b.createRef(),this.state={isOpen:!1,searchValue:""},this.handleToggle=()=>{this.setState((e=>({isOpen:!e.isOpen})))},this.handleSelect=async e=>{var t,s;null==(t=gi.activeTab)||t.update({preview:!1});const i=null==(s=gi.activeTab)?void 0:s.session.script;let a;a=i.fieldIds.includes(e)?i.fieldIds.filter((t=>t!==e)):i.fieldIds.concat(e),i.update({frozen:!1,fieldIds:a})},this.handleSearch=e=>{this.setState({searchValue:e})},this.handleSelectAll=async()=>{var e,t;null==(e=gi.activeTab)||e.update({preview:!1});const s=null==(t=gi.activeTab)?void 0:t.session.script,i=s.fieldIds.length>0?[]:s.model.fieldIds;s.update({frozen:!1,fieldIds:i})}}render(){const{isOpen:e,searchValue:t}=this.state,{model:s,fieldIds:i}=gi.activeTab.session.script,a=s.fields.filter((e=>e.name.toLowerCase().includes(t.toLowerCase()))),n=s.fieldIds.filter((e=>i.includes(e)));return b.createElement("div",{className:ir},b.createElement("div",{"data-cy":"field-filter",ref:this.button,className:S(ar,{[rr]:e,[lr]:n.length<s.fields.length}),onClick:this.handleToggle},b.createElement("span",{className:nr},"Fields"),b.createElement("span",null,n.length===s.fields.length?"All":n.length)),e&&b.createElement(Fa,{className:yr,target:this.button,onClickOutside:this.handleToggle},b.createElement(b.Fragment,null,b.createElement(vr,{className:Cr,checked:n.length>0,indeterminate:n.length<s.fields.length,onChange:()=>this.handleSelectAll()}),b.createElement(hr,{type:"text",className:Ir,placeholder:"Search",value:t,onChange:this.handleSearch}),a.map((e=>{const t=n.includes(e.id);return b.createElement(b.Fragment,{key:e.id},b.createElement(vr,{className:Cr,checked:t,onChange:()=>this.handleSelect(e.id)}),b.createElement("div",{"data-cy":"filter-option",className:wr,onClick:()=>this.handleSelect(e.id)},e.name),b.createElement("div",{className:Er,onClick:()=>this.handleSelect(e.id)},e.typeAsLabel))})))))}}var _r=_(br);var Sr={tooltip:"_tooltip_13qj3_1",tooltipBody:"_tooltipBody_13qj3_4",text:"_text_13qj3_8",separator:"_separator_13qj3_15",input:"_input_13qj3_19"};class xr extends b.PureComponent{constructor(){super(...arguments),this.button=b.createRef(),this.tooltipBody=b.createRef(),this.runScriptDebounced=l.debounce((()=>{var e;(null==(e=gi.activeTab)?void 0:e.session.script).run()}),300,{leading:!1,trailing:!0}),this.state={isOpen:!1},this.handleToggle=()=>{this.setState((e=>({isOpen:!e.isOpen})))},this.handleChangeTake=e=>{var t,s;null==(t=gi.activeTab)||t.update({preview:!1});(null==(s=gi.activeTab)?void 0:s.session.script).update({frozen:!1,pagination:{take:Number(e)}}),this.runScriptDebounced(),Ve.send({command:"pagination_change",commandDetails:{take_change:!0,skip_change:!1}})},this.handleChangeSkip=e=>{var t,s;null==(t=gi.activeTab)||t.update({preview:!1});const i=Number(e);if(isNaN(i)||i<0)return;(null==(s=gi.activeTab)?void 0:s.session.script).update({frozen:!1,pagination:{skip:i}}),this.runScriptDebounced(),Ve.send({command:"pagination_change",commandDetails:{take_change:!1,skip_change:!0}})}}render(){var e;const{isOpen:t}=this.state,{recordIds:s,model:i,pagination:a}=gi.activeTab.session.script;return b.createElement("div",{className:ir},b.createElement("div",{"data-cy":"page-filter",ref:this.button,className:S(ar,{[rr]:t}),onClick:this.handleToggle},b.createElement("span",{className:nr}," Showing "),b.createElement("span",null,b.createElement("span",{className:Sr.noPadding,"data-cy":"pagination__take"},s.length)," of ",b.createElement("span",{className:Sr.noPadding,"data-cy":"pagination__total"},null!=(e=i.count)?e:"?"))),t&&b.createElement(Fa,{className:Sr.tooltip,target:this.button,onClickOutside:this.handleToggle},b.createElement("div",{className:Sr.tooltipBody,ref:this.tooltipBody},b.createElement("span",{className:Sr.text},"Take"),b.createElement(hr,{"data-cy":"pagination__take-input",type:"number",tabIndex:0,focusOnMount:!0,className:Sr.input,value:String(a.take),onChange:this.handleChangeTake}),b.createElement("div",{className:Sr.separator}),b.createElement("span",{className:Sr.text},"Skip"),b.createElement(hr,{"data-cy":"pagination__skip-input",type:"number",tabIndex:0,focusOnMount:!0,className:Sr.input,value:String(a.skip),onChange:this.handleChangeSkip}))),t&&b.createElement(ma,{keys:"esc",target:this.tooltipBody,onMatch:()=>this.handleToggle()}))}}var Nr=_(xr);function Mr(e){return b.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 1022.84 813.16"},e),b.createElement("defs",null,b.createElement("linearGradient",{id:"3cf802be-0480-4c68-848a-073112220499",x1:635.22,y1:545.34,x2:635.22,y2:43.42,gradientUnits:"userSpaceOnUse"},b.createElement("stop",{offset:0,stopColor:"gray",stopOpacity:.25}),b.createElement("stop",{offset:.54,stopColor:"gray",stopOpacity:.12}),b.createElement("stop",{offset:1,stopColor:"gray",stopOpacity:.1}))),b.createElement("title",null,"book lover"),b.createElement("path",{d:"M688.44,180.84c-64.72-2.25-126.37-23.14-185.23-46S386.05,86.65,322.88,74.54c-40.63-7.79-87.1-8.89-119.83,12.89-31.51,21-41.69,57.15-47.16,90.73-4.12,25.26-6.54,51.84,4.75,75.49,7.83,16.42,21.74,30.22,31.35,46,33.47,54.72,9.82,122.2-26.45,175.63-17,25.07-36.75,49-49.87,75.66s-19.2,57.25-7.72,84.47c11.39,27,38.52,47.24,67.9,61.49,59.69,28.95,130,37.23,198.61,41.92,151.83,10.39,304.46,5.89,456.69,1.39,56.34-1.67,112.92-3.36,168.34-12.07,30.78-4.84,62.55-12.51,84.9-31.05,28.36-23.53,35.39-63.38,16.39-92.88-31.89-49.49-120-61.78-142.32-114.9-12.26-29.23.34-61.79,18.16-88.91,38.24-58.16,102.33-109.19,105.71-175.67,2.32-45.67-28.5-91.39-76.14-113C956.26,89,887,91.88,850.18,129.37,812.24,168,745.58,182.82,688.44,180.84Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4",opacity:.1}),b.createElement("polygon",{points:"435.45 690.5 93.17 688.83 59.16 609.06 179.42 600.33 158.46 512.87 396.32 482.04 168.55 402.86 188.67 398.08 554.92 457.83 534.75 594.32 505.92 669.33 435.45 690.5",fill:"#9f6bf4"}),b.createElement("path",{d:"M187,698.84s21-3.36,33.6,11.48c0,0-9.24,7.28-29.12-2.8Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M184.8,698.51S171.4,715,178,733.36c0,0,10.92-4.37,12.11-26.63Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M172.76,671.4s8.4-15.41,42,6.16c0,0-4.48,10.36-19.32,9.52S176.68,679.52,172.76,671.4Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M170.59,670.29s-17.43-2-19.12,37.9c0,0,11.05,2.29,18.9-10.33S175,678.16,170.59,670.29Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M160.44,638.46s9.8-27.16,45.36-7.84c0,0-8.12,24.92-41.72,17.08Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M149.52,597.86s18.48-27.44,51.24-2c0,0-11.48,25.76-48.44,11.76Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M145.6,559.22s21.56-25.21,54,0c0,0-20.44,22.12-54,6.44Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M142.24,521.69s21.84-26.32,52.92-1.4c0,0-24.64,23.24-52.92,7.56Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M144.2,488.37s23-33.88,52.08-10.92c0,0-24.64,29.12-52.08,17.36Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M149.52,449.45s24.36-33.6,52.64-7.84c0,0-28.84,29.12-52.64,14Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M157.64,414.66s28.84-31.58,54-19c0,0-30.05,33.54-55.26,27.38Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M167.72,381.68S201,343,220.36,355.92c0,0-24.52,30-55,33Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M182.27,343.43s29.13-31.58,50.41-23.74c0,0-24.92,32.76-54.32,33.6Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M195.44,307.65s32.2-30.24,46.2-24.92c0,0-23.24,33.6-47.6,31.64Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M208.32,274.61s27.72-36.13,42.85-33.33c0,0-16.81,32.21-42.85,37Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M222.3,230.06s24.5-27.69,37.74-27.63c0,0-19.34,37-38.75,36.66Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M230.58,200.4l23.67-57.68s1.18,52.14-26.68,68.38Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M240.19,136.79s3.92-48.17,1.4-52.09c0,0,16.92,40.05-1.56,73.37Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M159.52,637.82s-24.54-15.21-40.43,22c0,0,21.84,14.5,43.32-12.51Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M148.73,596.31s-30.1-13.73-44.7,25.12c0,0,23.25,16,47.44-15.3Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M144.2,561.53s-21.56-25.21-54,0c0,0,20.44,22.12,54,6.44Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M141.5,521.69s-21.84-26.32-52.92-1.4c0,0,24.64,23.24,52.92,7.56Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M144.2,489.33s-15.32-37.95-48.62-21.63c0,0,18,33.65,47.26,27.93Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M151.45,449.26s-15.23-38.61-49-20.71c0,0,20.68,35.39,47.5,26.67Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M160.89,414.85s-6-42.33-34-46.12c0,0,5.94,44.64,30.23,53.75Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M168.43,381.76s-2.34-51-25.49-52.78c0,0,.78,38.71,22.88,60Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M184.67,342s-6.9-42.41-29-47.59c0,0,2.74,41.07,26.81,58Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M198.06,308s-.23-44.18-13.73-50.67c0,0-8.37,40,9.82,56.31Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M209.35,274.11s-1.89-45.49-15.87-51.9c0,0-4.78,36,13.78,54.88Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M224.25,233.69s-.08-37-10.06-45.68c0,0-9.92,40.53,4.85,53.12Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M229.41,198.58,219.7,137s-13.19,50.46,10.17,72.7Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M231.3,137.37s-24.92-41.4-24.41-46c0,0,2.65,43.39,34,65Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M234.22,125.14s-23.52-58.8-34.16-63.56c0,0,33.6,17.08,36.12,61.88Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M221.17,239.44l-1.61-.49c19.85-64.73,24.8-106,13.95-116.35l1.15-1.22C246.17,132.3,241.5,173.12,221.17,239.44Z",transform:"translate(-88.58 -43.42)",fill:"#444053"}),b.createElement("path",{d:"M166.51,391l-2.38-.85c2.11-5.93,4.38-11.95,6.76-17.88,20.72-51.64,38.36-99.68,49.67-136.56l2.07-1c-11.33,36.95-28.66,86.83-49.4,138.54C170.86,379.07,168.6,385.06,166.51,391Z",transform:"translate(-88.58 -43.42)",fill:"#444053"}),b.createElement("path",{d:"M216.59,747.28c-.32-.35-32.49-36.58-54.92-98.43A364.18,364.18,0,0,1,140,536.07c-1.54-48.13,8.56-101.87,25.86-150.69l1.88,2.2c-38.84,109.57-23.41,203.46-2.94,260,22.19,61.29,54,97.12,54.31,97.48Z",transform:"translate(-88.58 -43.42)",fill:"#444053"}),b.createElement("path",{d:"M719.31,670.36s-22.67,27.67-4.67,69.5l-181,78.5L516.27,822l-8-35,5.35-44.17V718.69Z",transform:"translate(-88.58 -43.42)",fill:"#d5d6db"}),b.createElement("polygon",{points:"59.16 609.06 309.68 563.39 641.63 616.27 435.45 690.5 59.16 609.06",fill:"#9f6bf4"}),b.createElement("polygon",{points:"59.16 609.06 309.68 563.39 641.63 616.27 435.45 690.5 59.16 609.06",fill:"#9f6bf4"}),b.createElement("path",{d:"M147.74,652.47s-23.43,44.39,3.57,85.39l371.5,80.5S499.75,783,524,733.92Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M147.74,652.47s-23.43,44.39,3.57,85.39l371.5,80.5S499.75,783,524,733.92Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M158.81,667.86s-13.39,32.48,0,53.5",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M522.81,818.36l207.4-88.5s11.6,2.5,4.1,11-207.5,86-207.5,86l-375.5-89Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M522.81,818.36l207.4-88.5s11.6,2.5,4.1,11-207.5,86-207.5,86l-375.5-89Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M505.81,742.86s-20,24,0,60",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("rect",{x:510.68,y:757.36,width:94.57,height:1,transform:"translate(-299.77 172.15) rotate(-18.45)",opacity:.1}),b.createElement("rect",{x:509.35,y:759.86,width:115.23,height:1,transform:"translate(-321.85 207.81) rotate(-20.82)",opacity:.1}),b.createElement("rect",{x:508.7,y:764.61,width:133.56,height:1,transform:"translate(-335.51 231.58) rotate(-22.26)",opacity:.1}),b.createElement("rect",{x:508.37,y:766.53,width:153.74,height:1,transform:"translate(-352.49 265.59) rotate(-24.31)",opacity:.1}),b.createElement("rect",{x:509.21,y:768.64,width:168.15,height:1,transform:"translate(-346.96 258.59) rotate(-23.61)",opacity:.1}),b.createElement("rect",{x:510.33,y:769.26,width:201.22,height:1,transform:"translate(-343.72 261.93) rotate(-23.36)",opacity:.1}),b.createElement("polygon",{points:"152.23 613.94 328.23 576.94 435.45 597.44 291.23 643.94 152.23 613.94",fill:"#fff",opacity:.3}),b.createElement("path",{d:"M730.21,659.69s9.1,3.67,3.76,9.34S524,733.92,524,733.92Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M818.6,574.18s-22.66,27.66-4.66,69.5l-181,78.5-17.37,3.66-8-35L613,646.68V622.51Z",transform:"translate(-88.58 -43.42)",fill:"#d5d6db"}),b.createElement("polygon",{points:"158.46 512.87 408.97 467.21 740.93 520.09 534.75 594.32 158.46 512.87",fill:"#3a3768"}),b.createElement("path",{d:"M247,556.29s-23.44,44.39,3.56,85.39l371.5,80.5s-23.05-35.39,1.23-84.45Z",transform:"translate(-88.58 -43.42)",fill:"#3a3768"}),b.createElement("path",{d:"M247,556.29s-23.44,44.39,3.56,85.39l371.5,80.5s-23.05-35.39,1.23-84.45L505.81,612.3Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M258.1,571.68s-13.38,32.47,0,53.5",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M622.1,722.18l207.41-88.5s11.59,2.5,4.09,11-207.5,86-207.5,86l-375.5-89Z",transform:"translate(-88.58 -43.42)",fill:"#3a3768"}),b.createElement("path",{d:"M622.1,722.18l207.41-88.5s11.59,2.5,4.09,11-207.5,86-207.5,86l-375.5-89Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M605.1,646.68s-20,24,0,60",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("rect",{x:609.97,y:661.18,width:94.57,height:1,transform:"translate(-264.22 198.64) rotate(-18.45)",opacity:.1}),b.createElement("rect",{x:608.65,y:663.68,width:115.23,height:1,transform:"translate(-281.17 236.83) rotate(-20.82)",opacity:.1}),b.createElement("rect",{x:608,y:668.43,width:133.56,height:1,transform:"translate(-291.68 262.02) rotate(-22.26)",opacity:.1}),b.createElement("rect",{x:607.66,y:670.34,width:153.74,height:1,transform:"translate(-304.07 297.94) rotate(-24.31)",opacity:.1}),b.createElement("rect",{x:608.51,y:672.45,width:168.15,height:1,transform:"translate(-300.13 290.3) rotate(-23.61)",opacity:.1}),b.createElement("rect",{x:609.63,y:673.07,width:201.22,height:1,transform:"translate(-297.44 293.41) rotate(-23.36)",opacity:.1}),b.createElement("polygon",{points:"251.53 517.76 427.53 480.76 534.75 501.26 390.53 547.76 251.53 517.76",fill:"#fff",opacity:.45}),b.createElement("path",{d:"M829.51,563.51s9.09,3.67,3.76,9.33-209.94,64.89-209.94,64.89Z",transform:"translate(-88.58 -43.42)",fill:"#3a3768"}),b.createElement("path",{d:"M828,464.15s-22.67,49.67-4.67,91.5l-181,56.5L625,615.82l-8-35,5.35-44.17V512.48Z",transform:"translate(-88.58 -43.42)",fill:"#d5d6db"}),b.createElement("polygon",{points:"167.89 402.85 418.41 357.18 750.37 410.06 544.18 484.29 167.89 402.85",fill:"#9f6bf4"}),b.createElement("path",{d:"M256.47,446.26S233,490.65,260,531.65l371.5,80.5s-23.06-35.39,1.22-84.44Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M256.47,446.26S233,490.65,260,531.65l371.5,80.5s-23.06-35.39,1.22-84.44Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M267.54,461.65s-13.39,32.48,0,53.5",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M631.54,612.15l207.4-66.5s11.6,2.5,4.1,11-207.5,64-207.5,64l-375.5-89Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M631.54,612.15l207.4-66.5s11.6,2.5,4.1,11-207.5,64-207.5,64l-375.5-89Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M614.54,536.65s-20,24,0,60",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("rect",{x:619.41,y:551.15,width:94.57,height:1,transform:"translate(-228.91 195.97) rotate(-18.45)",opacity:.1}),b.createElement("rect",{x:618.08,y:553.65,width:115.23,height:1,transform:"translate(-241.44 233) rotate(-20.82)",opacity:.1}),b.createElement("rect",{x:617.43,y:558.4,width:133.56,height:1,transform:"translate(-249.3 257.4) rotate(-22.26)",opacity:.1}),b.createElement("rect",{x:617.1,y:560.32,width:153.74,height:1,transform:"translate(-257.94 292.06) rotate(-24.31)",opacity:.1}),b.createElement("rect",{x:617.95,y:562.43,width:168.15,height:1,transform:"translate(-255.27 284.87) rotate(-23.61)",opacity:.1}),b.createElement("rect",{x:619.07,y:563.05,width:201.22,height:1,transform:"translate(-253.04 288.14) rotate(-23.36)",opacity:.1}),b.createElement("polygon",{points:"260.96 407.73 436.96 370.73 544.18 391.23 399.96 437.73 260.96 407.73",fill:"#fff",opacity:.3}),b.createElement("path",{d:"M838.94,453.48s9.1,3.67,3.76,9.34-209.94,64.89-209.94,64.89Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M399,149.92s-38-2.29-33.56,24.37c0,0-.89,4.71,3.38,6.85,0,0,.07-2,3.9-1.31a17.05,17.05,0,0,0,4.14.2,8.62,8.62,0,0,0,5.05-2.08h0s10.69-4.42,14.85-21.9c0,0,3.08-3.81,3-4.79L393.32,154s2.19,4.63.47,8.48c0,0-.21-8.31-1.45-8.12-.25,0-3.33,1.61-3.33,1.61s3.77,8.07.92,13.93c0,0,1.08-9.94-2.1-13.35l-4.52,2.64s4.41,8.33,1.42,15.13c0,0,.77-10.43-2.37-14.49l-4.1,3.2s4.15,8.21,1.62,13.85c0,0-.33-12.14-2.5-13.06,0,0-3.59,3.16-4.13,4.46,0,0,2.84,6,1.07,9.11,0,0-1.07-8.09-2-8.13,0,0-3.57,5.36-3.94,9a19.46,19.46,0,0,1,3.07-9.54,10.71,10.71,0,0,0-5.46,2.83s.55-3.79,6.35-4.12c0,0,2.95-4.07,3.74-4.31,0,0-5.77-.49-9.26,1.06,0,0,3.08-3.57,10.31-2l4-3.3s-7.58-1-10.8.11c0,0,3.71-3.16,11.89-.86l4.41-2.63s-6.47-1.39-10.32-.89c0,0,4.06-2.19,11.61.18l3.14-1.41s-4.73-.93-6.12-1.08-1.46-.53-1.46-.53a16.51,16.51,0,0,1,8.9,1S399.13,150.34,399,149.92Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M933.6,259.5s-38-2.29-33.56,24.37c0,0-.89,4.71,3.38,6.85,0,0,.07-2,3.9-1.31a17.62,17.62,0,0,0,4.14.2,8.59,8.59,0,0,0,5-2.08h0s10.7-4.42,14.85-21.9c0,0,3.08-3.81,3-4.79l-6.42,2.74s2.19,4.63.47,8.48c0,0-.21-8.31-1.44-8.12-.25,0-3.34,1.61-3.34,1.61s3.77,8.07.93,13.93c0,0,1.08-9.94-2.11-13.35l-4.52,2.64s4.41,8.33,1.42,15.13c0,0,.77-10.43-2.37-14.49l-4.09,3.2s4.14,8.21,1.61,13.85c0,0-.33-12.14-2.5-13.06,0,0-3.58,3.16-4.13,4.46,0,0,2.84,6,1.08,9.11,0,0-1.08-8.09-2-8.13,0,0-3.57,5.36-3.94,9a19.4,19.4,0,0,1,3.08-9.54,10.76,10.76,0,0,0-5.47,2.83s.56-3.79,6.35-4.12c0,0,2.95-4.07,3.74-4.32,0,0-5.76-.48-9.26,1.07,0,0,3.08-3.57,10.31-2l4-3.3s-7.59-1-10.8.11c0,0,3.7-3.16,11.89-.86l4.4-2.63s-6.47-1.39-10.32-.89c0,0,4.06-2.19,11.61.18l3.15-1.41s-4.74-.93-6.13-1.08-1.46-.53-1.46-.53a16.39,16.39,0,0,1,8.9,1S933.72,259.92,933.6,259.5Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4",opacity:.1}),b.createElement("path",{d:"M463,314.62s-16.56-34.33-37.64-17.41c0,0-4.55,1.52-4.33,6.29,0,0,1.75-.91,3,2.77a17.72,17.72,0,0,0,1.84,3.7,8.63,8.63,0,0,0,4.29,3.4h0s9.07,7.18,26.36,2.28c0,0,4.83.83,5.62.25l-5.52-4.27s-3,4.17-7.18,4.54c0,0,7.16-4.23,6.39-5.21-.16-.2-3-2.13-3-2.13s-5.21,7.23-11.71,7.6c0,0,9.2-3.9,10.62-8.35l-4.5-2.66s-5.13,7.92-12.52,8.62c0,0,9.48-4.41,11.49-9.13l-4.78-2s-5.15,7.62-11.31,8.17c0,0,10.44-6.21,10.18-8.56,0,0-4.51-1.58-5.91-1.43,0,0-3.82,5.39-7.42,5.39,0,0,6.53-4.89,6.13-5.68,0,0-6.42-.5-9.8,1a19.47,19.47,0,0,1,9.83-2,10.77,10.77,0,0,0-5.14-3.39s3.58-1.36,6.69,3.53c0,0,5,.59,5.59,1.16,0,0-2.39-5.26-5.44-7.55,0,0,4.62.93,6.73,8l4.85,1.92s-2.79-7.12-5.36-9.37c0,0,4.56,1.69,6.55,10l4.44,2.56s-1.93-6.33-4.25-9.44c0,0,3.89,2.48,5.5,10.22l2.77,2.06s-1.5-4.59-2-5.87-.25-1.54-.25-1.54a16.41,16.41,0,0,1,3.48,8.25S462.64,314.92,463,314.62Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4",opacity:.1}),b.createElement("path",{d:"M846.78,211s-16.55-34.33-37.64-17.41c0,0-4.54,1.52-4.33,6.29,0,0,1.76-.9,3,2.77a17.34,17.34,0,0,0,1.85,3.71,8.58,8.58,0,0,0,4.28,3.39h0s9.08,7.18,26.36,2.29c0,0,4.83.82,5.63.24L840.44,208s-3,4.18-7.17,4.55c0,0,7.15-4.24,6.38-5.22-.16-.2-3-2.13-3-2.13s-5.2,7.23-11.71,7.6c0,0,9.21-3.9,10.63-8.34L831,201.82s-5.12,7.91-12.52,8.62c0,0,9.48-4.42,11.5-9.14l-4.79-2s-5.15,7.63-11.3,8.17c0,0,10.43-6.21,10.17-8.55,0,0-4.5-1.59-5.9-1.43,0,0-3.82,5.38-7.43,5.38,0,0,6.54-4.89,6.14-5.68,0,0-6.42-.5-9.81,1a19.46,19.46,0,0,1,9.83-2,10.71,10.71,0,0,0-5.13-3.39s3.58-1.36,6.69,3.53c0,0,5,.6,5.59,1.17,0,0-2.39-5.27-5.45-7.56,0,0,4.62.94,6.73,8.05l4.86,1.92s-2.79-7.13-5.36-9.38c0,0,4.56,1.69,6.54,10l4.45,2.56s-1.94-6.32-4.26-9.44c0,0,3.9,2.48,5.5,10.22l2.77,2.06s-1.49-4.59-2-5.87-.25-1.53-.25-1.53a16.45,16.45,0,0,1,3.47,8.25S846.47,211.32,846.78,211Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4",opacity:.1}),b.createElement("path",{d:"M899.67,380.81S883.12,346.47,862,363.39c0,0-4.54,1.52-4.33,6.29,0,0,1.76-.9,3,2.77a17.33,17.33,0,0,0,1.84,3.71,8.58,8.58,0,0,0,4.28,3.39h0s9.08,7.19,26.37,2.29c0,0,4.82.83,5.62.24l-5.52-4.27s-3,4.18-7.18,4.55c0,0,7.15-4.24,6.38-5.22-.16-.2-3-2.13-3-2.13s-5.2,7.23-11.71,7.61c0,0,9.21-3.91,10.63-8.35l-4.51-2.66s-5.12,7.92-12.52,8.62c0,0,9.48-4.42,11.5-9.14l-4.79-2s-5.15,7.62-11.3,8.17c0,0,10.44-6.21,10.18-8.56,0,0-4.51-1.59-5.91-1.43,0,0-3.82,5.38-7.43,5.38,0,0,6.54-4.89,6.14-5.68,0,0-6.42-.5-9.81,1a19.52,19.52,0,0,1,9.84-2,10.69,10.69,0,0,0-5.14-3.39s3.58-1.37,6.69,3.53c0,0,5,.59,5.59,1.16,0,0-2.39-5.26-5.44-7.56,0,0,4.62.94,6.73,8.05l4.85,1.92s-2.79-7.13-5.36-9.37c0,0,4.56,1.68,6.54,10l4.45,2.55s-1.94-6.32-4.26-9.44c0,0,3.9,2.48,5.51,10.23l2.77,2s-1.5-4.59-2-5.87-.25-1.53-.25-1.53a16.35,16.35,0,0,1,3.47,8.25S899.36,381.11,899.67,380.81Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4",opacity:.1}),b.createElement("ellipse",{cx:201.95,cy:781.59,rx:22.99,ry:2.57,fill:"#9f6bf4",opacity:.1}),b.createElement("ellipse",{cx:51.24,cy:737.91,rx:22.99,ry:2.57,fill:"#9f6bf4",opacity:.1}),b.createElement("ellipse",{cx:316.83,cy:810.6,rx:22.99,ry:2.57,fill:"#9f6bf4",opacity:.1}),b.createElement("ellipse",{cx:905.53,cy:747.41,rx:22.99,ry:2.57,fill:"#9f6bf4",opacity:.1}),b.createElement("ellipse",{cx:714.22,cy:734.94,rx:22.99,ry:2.57,fill:"#9f6bf4",opacity:.1}),b.createElement("ellipse",{cx:590.46,cy:793.66,rx:27.19,ry:4.67,fill:"#9f6bf4",opacity:.1}),b.createElement("path",{d:"M691.17,790.14s-37.86,19.56-18.3,42.6c0,0,1.84,5,7.16,4.65,0,0-1.06-1.94,3-3.49a19.51,19.51,0,0,0,4.09-2.17,9.61,9.61,0,0,0,3.66-4.89h0s7.74-10.36,1.74-29.53c0,0,.78-5.42.1-6.3l-4.6,6.31s4.75,3.19,5.3,7.88c0,0-5-7.87-6-7-.22.18-2.28,3.45-2.28,3.45s8.24,5.59,8.85,12.85c0,0-4.64-10.17-9.65-11.62L681.37,808s9,5.48,10,13.72c0,0-5.23-10.45-10.57-12.56l-2.11,5.41s8.68,5.52,9.48,12.38c0,0-7.26-11.47-9.87-11.11,0,0-1.64,5.08-1.42,6.65,0,0,6.13,4.1,6.24,8.13,0,0-5.66-7.15-6.53-6.68,0,0-.36,7.19,1.38,10.93,0,0-3-5.34-2.51-10.93a12,12,0,0,0-3.63,5.84s-1.63-3.95,3.74-7.59c0,0,.51-5.59,1.13-6.28,0,0-5.81,2.84-8.28,6.32,0,0,.91-5.19,8.79-7.77l2-5.48s-7.88,3.34-10.31,6.28c0,0,1.75-5.15,10.93-7.62l2.72-5s-7,2.36-10.42,5c0,0,2.65-4.43,11.26-6.47l2.21-3.15s-5.08,1.81-6.5,2.46-1.7.33-1.7.33a18.39,18.39,0,0,1,9.11-4.14S691.52,790.48,691.17,790.14Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M803.54,420.71C797,402.94,761,401.27,745.38,405.8c-11.1,3.23-34.5,6.87-47,8.7l-.81-.77c1.62-.48,1.66-1.66,1.46-3.41a53.37,53.37,0,0,1,.1-6.92c7.66,2.38,14.48-3.25,14.48-3.25h0c9-4,6.58-21.12,8.3-25.8,1.29-3.5,2.68-24.12,3.3-34.4l.13,0,.07-3.45c.09-1.49.13-2.36.13-2.36s.88-25.14,2.6-30.23c1.6-4.68,2.9-28.26,3.1-32,0-.32,0-.49,0-.49l-.13-2.18c.09-1.59.13-3.36.12-5.22,0-8.55-.89-19.32-1-21.06,0-.25,0-.55,0-.91.07-3.65-.39-21.93-15.94-28.84-5.73-2.56-12.62-5.61-19.29-8.58-1.72-14.85-5.65-29.62-5.31-44.58,0-2.25.2-4.5.42-6.74,0,.65-.07,1.31-.08,2,0,1.45,0,2.91,0,4.36.59-18.71,7.66-37.52,7-55.83-.06,1.79-.19,3.59-.36,5.39a58.13,58.13,0,0,0-1.92-18.39c-.6-2.11-1.41-4.29-3.14-5.7a12.93,12.93,0,0,0-5.48-2.17,110.21,110.21,0,0,0-14.39-2.68A22.22,22.22,0,0,0,668.5,74c-10.14-13.92-25.16-27-42.92-30-8.91-1.5-19.16-.25-25.22,6.12a18.92,18.92,0,0,0-1.78,1.8c-3.26,3.89-4.66,9-8,12.88-.22.26-.47.5-.71.75-6.54,5.85-16.73,7.07-24,12.32A28.81,28.81,0,0,0,562.28,81a60.88,60.88,0,0,0-7.84,9.53c-3.27,4.6-6.63,9.39-7.67,14.88-2.09,11,5.4,21.43,6.79,32.5,3.1,24.77-24.31,46.75-19.12,71.19a32.6,32.6,0,0,0,8.82,15.83C532.57,234.61,523.47,244,523.47,244l0,.56-1.69,0,.17,2h-.17l.93,10.85-.93,15.8s0,.17,0,.49v.08l0,.43s0,.17,0,.49h.06c.31,5.79,1.54,26.61,3,31,1.72,5.09,2.59,30.23,2.59,30.23s1.9,35.53,3.64,40.23-.73,21.77,8.3,25.8h0a19,19,0,0,0,9.07,3.76c-.46,3.74-.17,6.45,1.32,7.3a4.36,4.36,0,0,0,2.1.6,22.29,22.29,0,0,0-1.63,2.85A42.36,42.36,0,0,1,539.75,414c-9.7-4-41.89-13-51.24-6.67s-31.85,12.07-21.46,37.55S482.28,471,482.28,471a37,37,0,0,1,8.31,8.35c3.12,4.69,32.19,15.42,39.46,15.42a71.19,71.19,0,0,1,9.25.46s-7.89,6.92-6.84,10.94-2.4,36.2-2.4,36.2,8,8.06,11.42-2.51l.12.16c.64.87,4.1,4.8,10.61-.16a59.48,59.48,0,0,1,8.46-5.36l31.52-4.46a89.24,89.24,0,0,1,9.87-.07c5,.41,9.91-2.55,13-4.84,6.53,2.48,13.87,5.19,17.36,6.18,7.08,2,39.62,10.73,47.23,8a10.57,10.57,0,0,0,4.1-2.92l7.26.23-3.4.68s6.62.11,15.62.23l-.38.22,11.29-.1c16.52.15,35.08.2,37.52-.35,3.82-.85,23.67-.25,29.52,0l1.63,0s21.81-4.35,12.81-26.48c-6.92-17-28.19-21.94-37.63-23.3,2.66-.53,4.95-.94,6.47-1.18,6.59-1,19.39-7,20.43-9.05s11.77-8,14.54-11.39S810.11,438.48,803.54,420.71ZM622.89,470.44l-1.07.35-.72.24-1.38,1.36c-1.1-.74-2.28-1.52-3.51-2.32C618.38,470.2,620.61,470.33,622.89,470.44Zm95.31,28.18h0Z",transform:"translate(-88.58 -43.42)",fill:"url(#3cf802be-0480-4c68-848a-073112220499)"}),b.createElement("path",{d:"M686.65,365s15.3,40,24,36,6.34-21,8-25.66,3.5-40,3.5-40,.84-25,2.5-30.06c1.54-4.65,2.79-28.1,3-31.79,0-.32,0-.49,0-.49L726,244l-9.34-2.33-21.66,8-3,17.13-1.17,6.69-.5,2.85Z",transform:"translate(-88.58 -43.42)",fill:"#be6f72"}),b.createElement("path",{d:"M691.69,358.3s14.6,11.95,19,13,7.1,10.37,7.1,10.37",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M567,366.75s-15.3,40-24,36-6.34-21-8-25.66-3.5-40-3.5-40-.84-25-2.5-30.06c-1.54-4.65-2.79-28.1-3-31.79,0-.32,0-.49,0-.49l1.66-29,9.34-2.33,21.66,8,3,17.13,1.17,6.69.5,2.85Z",transform:"translate(-88.58 -43.42)",fill:"#be6f72"}),b.createElement("rect",{x:543.9,y:109.27,width:34.15,height:53.23,fill:"#3e373a"}),b.createElement("rect",{x:543.9,y:109.27,width:34.15,height:53.23,opacity:.1}),b.createElement("path",{d:"M561,406.59s-11.67,12.83-7.34,15.16,32.34,46,32.34,46,92,11.33,109.35-5.67,17-47.37,17-47.37-13.94,3-15.46,1.37-9.87-9.49-9.87-9.49S569,399.43,561,406.59Z",transform:"translate(-88.58 -43.42)",fill:"#4b4b5b"}),b.createElement("path",{d:"M561,406.59s-11.67,12.83-7.34,15.16,32.34,46,32.34,46,92,11.33,109.35-5.67,17-47.37,17-47.37-13.94,3-15.46,1.37-9.87-9.49-9.87-9.49S569,399.43,561,406.59Z",transform:"translate(-88.58 -43.42)",opacity:.02}),b.createElement("path",{d:"M726.62,244.42l-30,24-9.07.66-3.33.24-55.93,4.1-58-4.24-8.63-.63-11-.8-23-22s16.28-17.44,30.54-29.21c5.62-4.65,10.93-8.41,14.8-9.89l.66-.23A16.46,16.46,0,0,0,580,202c11.26-11.61,21.67-40.26,21.67-40.26s49.67-25.66,43.67,8,22.33,25.34,22.33,25.34l9.34,4.26,3.69,1.69,9.41,4.31,21.23,9.74C728,222.75,726.62,244.42,726.62,244.42Z",transform:"translate(-88.58 -43.42)",fill:"#be6f72"}),b.createElement("circle",{cx:537.38,cy:101.06,r:44.67,opacity:.1}),b.createElement("path",{d:"M726.69,276.24H526c0-.32,0-.49,0-.49l1.66-29s16.28-17.44,30.54-29.21l126-5,5.86-6.18,21.23,9.74c16.67,7.66,15.33,29.33,15.33,29.33S728.9,270.54,726.69,276.24Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M726.69,275.24H526c0-.32,0-.49,0-.49l1.66-29s16.28-17.44,30.54-29.21l126-5,5.86-6.18,21.23,9.74c16.67,7.66,15.33,29.33,15.33,29.33S728.9,269.54,726.69,275.24Z",transform:"translate(-88.58 -43.42)",fill:"#e7c7ca"}),b.createElement("path",{d:"M593.79,193.92s31.66,40.34,73.83-.83,4.67,91.83,4.67,91.83l-91,10.8Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M593.79,195.92s31.66,40.34,73.83-.83,4.67,91.83,4.67,91.83l-91,10.8Z",transform:"translate(-88.58 -43.42)",fill:"#e7c7ca"}),b.createElement("path",{d:"M680.65,203,684,254.09l3.59,17,2.74,13s7,100,5,105,1,9,1.42,11.66-.42,9.34-.09,12.34,0,4.33-7.66,3.26-18.34-2.93-18.34-2.93-27,2-36.33-1.33-27-3.34-27-3.34-26.67.67-35.33-.33-13.34,10.67-19,7.33,6.66-35.66,10.66-45-5.33-33-5.33-33l12-66.57L573,256.09V208.65l.66-.23A16.46,16.46,0,0,0,580,204l3,47.74,94,3.34V201.35",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M680.65,201,684,252.09l3.59,17,2.74,13s7,100,5,105,1,9,1.42,11.66-.42,9.34-.09,12.34,0,4.33-7.66,3.26-18.34-2.93-18.34-2.93-27,2-36.33-1.33-27-3.34-27-3.34-26.67.67-35.33-.33-13.34,10.67-19,7.33,6.66-35.66,10.66-45-5.33-33-5.33-33l12-66.57L573,254.09V206.65l.66-.23A16.46,16.46,0,0,0,580,202l3,47.74,94,3.34V199.35",transform:"translate(-88.58 -43.42)",fill:"#e7c7ca"}),b.createElement("path",{d:"M691.46,94.38c-.57-2.09-1.36-4.26-3-5.66a12.28,12.28,0,0,0-5.28-2.16A104.32,104.32,0,0,0,669.3,83.9a22.22,22.22,0,0,0-3-6.23C656.5,63.83,642,50.78,624.94,47.83c-8.93-1.55-19.28-.16-25,6.88-3.14,3.87-4.49,9-7.66,12.8-6.11,7.38-17.14,8.29-24.84,14-4.11,3-7.09,7.35-10,11.57-3.15,4.57-6.39,9.33-7.39,14.79-2,10.91,5.21,21.31,6.54,32.32,3,24.63-23.4,46.48-18.41,70.78,2.91,14.17,16,24.15,29.54,29.21,4.77,1.79,10.22,3.57,12.45,8.15,1,2,1.17,4.31,2.11,6.33,3.16,6.74,13.55,7,19.13,2.09s7.34-12.85,8-20.26c2.68-32.36-10.28-64.33-8.77-96.77.45-9.81,3.21-20.94,12-25.38,11.83-6,26.06,4,39.08,2.09a77.53,77.53,0,0,1,3.74,47.31c-2.07,8.63-5.65,17-5.91,25.9-.39,13.55,6.92,25.93,13.24,37.91a20.17,20.17,0,0,1,2.67,7.31,17.62,17.62,0,0,1-1.43,7.65c-3.57,9.61-9.73,18.53-10.43,28.76a4.65,4.65,0,0,0,.75,3.42,4.3,4.3,0,0,0,2.58,1.16c10.8,1.85,20.14-7.72,25.41-17.33A81.24,81.24,0,0,0,692.36,224c1.09-20.36-6.21-40.39-5.76-60.77C687.12,140.06,697.59,116.73,691.46,94.38Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M692.46,93.38c-.57-2.09-1.36-4.26-3-5.66a12.28,12.28,0,0,0-5.28-2.16A104.32,104.32,0,0,0,670.3,82.9a22.22,22.22,0,0,0-3-6.23C657.5,62.83,643,49.78,625.94,46.83c-8.93-1.55-19.28-.16-25,6.88-3.14,3.87-4.49,9-7.66,12.8-6.11,7.38-17.14,8.29-24.84,14-4.11,3-7.09,7.35-10,11.57-3.15,4.57-6.39,9.33-7.39,14.79-2,10.91,5.21,21.31,6.54,32.32,3,24.63-23.4,46.48-18.41,70.78,2.91,14.17,16,24.15,29.54,29.21,4.77,1.79,10.22,3.57,12.45,8.15,1,2,1.17,4.31,2.11,6.33,3.16,6.74,13.55,7,19.13,2.09s7.34-12.85,8-20.26c2.68-32.36-10.28-64.33-8.77-96.77.45-9.81,3.21-20.94,12-25.38,11.83-6,26.06,4,39.08,2.09a77.53,77.53,0,0,1,3.74,47.31c-2.07,8.63-5.65,17-5.91,25.9-.39,13.55,6.92,25.93,13.24,37.91a20.17,20.17,0,0,1,2.67,7.31,17.62,17.62,0,0,1-1.43,7.65c-3.57,9.61-9.73,18.53-10.43,28.76a4.65,4.65,0,0,0,.75,3.42,4.3,4.3,0,0,0,2.58,1.16c10.8,1.85,20.14-7.72,25.41-17.33A81.24,81.24,0,0,0,693.36,223c1.09-20.36-6.21-40.39-5.76-60.77C688.12,139.06,698.59,115.73,692.46,93.38Z",transform:"translate(-88.58 -43.42)",fill:"#3e373a"}),b.createElement("polygon",{points:"581.79 492.73 621.46 494 615.77 464.58 585.38 467.47 581.79 492.73",fill:"#c3c7d9"}),b.createElement("path",{d:"M793.29,466.42c-2.67,3.33-13,9.33-14,11.33s-13.33,8-19.67,9-26.33,5.34-30,7.67c-2.63,1.68-23.74,7-37.61,9.95a106.75,106.75,0,0,1-11.39,2.05c-6,.33-71.66-22-71.66-22l12.66-13,.7-.24c3.58-1.21,20.12-6.8,29.3-9.46,10.34-3,22.34-15.33,22.34-15.33s17.66-6,20-6.67-6-23.33-6-23.33,38.33-5.32,53.33-9.83,49.67-2.84,56,14.83S796,463.09,793.29,466.42Z",transform:"translate(-88.58 -43.42)",fill:"#4b4b5b"}),b.createElement("path",{d:"M618.62,522.75s-7.66,8-15.33,7.34-34.49,2-34.49,2a53.77,53.77,0,0,0-13.51,7.83c-6.27,4.94-9.6,1-10.22.16l-.11-.16c-3.34,10.51-11,2.5-11,2.5s3.33-32,2.31-36,6.59-10.87,6.59-10.87l9-2.29,22.8-5.84,32.67,11.33Z",transform:"translate(-88.58 -43.42)",fill:"#e7c7ca"}),b.createElement("path",{d:"M551.82,493.26l-6.75,46.82-.11-.16c-3.34,10.51-11,2.5-11,2.5s3.33-32,2.31-36,6.59-10.87,6.59-10.87Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M599,360.08s17.66,6,33,0",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M659.29,371.42s7.33,3.66,13,0",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M659.29,380.1s12.33,1.65,14.67-1.68",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M655.29,398.75s23.16-3,28.91-7",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M584.62,391.75s13,7.33,22.67,7",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M692,504.37a106.75,106.75,0,0,1-11.39,2.05c-6,.33-71.66-22-71.66-22l12.66-13,.7-.24c2,1.41,3.64,2.62,4.81,3.54,5.51,4.34,10.83-1.33,12.83-1.33s19.33,14.33,19.33,14.33,16,3.67,18.67,7,12,2.67,13.66,5C692.11,500.44,692.17,502.21,692,504.37Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M568.8,417.75s-16.18.93-25.51-3-40.33-13-49.33-6.63-30.67,12-20.67,37.34,14.67,26,14.67,26a36.1,36.1,0,0,1,8,8.3c3,4.67,31,15.33,38,15.33s19.33,0,36.66,12,33,13.34,33,13.34,22,9,28.85,11,38.15,10.66,45.49,8,12-19.34,12-19.34,3.33-15,1.66-17.33-11-1.67-13.66-5-18.67-7-18.67-7S642,476.42,640,476.42s-7.32,5.66-12.83,1.33a292.69,292.69,0,0,0-34.51-22C580,449.08,568.8,417.75,568.8,417.75Z",transform:"translate(-88.58 -43.42)",fill:"#4b4b5b"}),b.createElement("path",{d:"M536.27,427.42a19.1,19.1,0,0,1,16.39,4.33c8,6.67,34.92,20.06,34.92,20.06",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M736.29,427s-35.67,5.4-42.33,12.73",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M777.29,537.42l-1.57,0c-5.64-.2-24.75-.8-28.43,0-4.33,1-61.67,0-61.67,0l11.21-2.33s-4.16-14.58-1.52-15.79c0,0-15-9.88-3.69-16.55s23.5-3.86,23.5-3.86l28.39-9.62,5.45-1.85s32,1.67,40.66,23.67S777.29,537.42,777.29,537.42Z",transform:"translate(-88.58 -43.42)",fill:"#e7c7ca"}),b.createElement("path",{d:"M777.29,537.42l-1.57,0c9.31-7.68,30.37-31.06-32.21-48.1l5.45-1.85s32,1.67,40.66,23.67S777.29,537.42,777.29,537.42Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("circle",{cx:629.88,cy:466.33,r:1.75,fill:"#4b4b5b"}),b.createElement("circle",{cx:619.71,cy:469.22,r:1.75,fill:"#4b4b5b"}),b.createElement("g",{opacity:.1},b.createElement("path",{d:"M658.74,142.83A77.59,77.59,0,0,0,653,110.69c-13,1.94-27.24-8.09-39.08-2.09-8.76,4.44-11.51,15.57-12,25.38-.12,2.59-.14,5.18-.09,7.77,0-.92,0-1.85.09-2.77.46-9.81,3.21-20.94,12-25.38,11.84-6,26.06,4,39.08,2.09A77.38,77.38,0,0,1,658.74,142.83Z",transform:"translate(-88.58 -43.42)"}),b.createElement("path",{d:"M558,141a33.32,33.32,0,0,0-.13-6.54c-1.06-8.8-5.87-17.21-6.74-25.79-1.12,10.35,5.47,20.29,6.74,30.79C558,140,558,140.48,558,141Z",transform:"translate(-88.58 -43.42)"}),b.createElement("path",{d:"M610.69,230.74c-.62,7.42-2.37,15.35-8,20.27s-16,4.65-19.13-2.09c-1-2-1.15-4.33-2.12-6.33-2.22-4.58-7.68-6.36-12.45-8.15-13.55-5.07-26.62-15-29.53-29.21a30.68,30.68,0,0,1-.53-3.9,31.52,31.52,0,0,0,.53,8.9c2.91,14.17,16,24.14,29.53,29.21,4.77,1.79,10.23,3.57,12.45,8.15,1,2,1.17,4.31,2.12,6.33,3.15,6.74,13.54,7,19.13,2.09s7.33-12.85,8-20.27A114.29,114.29,0,0,0,611,224C611,226.27,610.87,228.51,610.69,230.74Z",transform:"translate(-88.58 -43.42)"}),b.createElement("path",{d:"M687.93,157.49c0,1.45,0,2.89,0,4.33.56-18.6,7.38-37.3,6.71-55.51C694.12,123.15,688.31,140.37,687.93,157.49Z",transform:"translate(-88.58 -43.42)"}),b.createElement("path",{d:"M666.47,232.73a12.89,12.89,0,0,0,.23-3.61,20,20,0,0,0-2.67-7.31c-5.78-11-12.37-22.26-13.15-34.47,0,.52-.07,1-.08,1.56-.4,13.54,6.91,25.93,13.23,37.91A24,24,0,0,1,666.47,232.73Z",transform:"translate(-88.58 -43.42)"}),b.createElement("path",{d:"M693.68,218.26a81.37,81.37,0,0,1-10.09,34.52c-5.28,9.61-14.61,19.18-25.42,17.33a4.25,4.25,0,0,1-2.58-1.17,2.5,2.5,0,0,1-.47-.78c-.12.78-.22,1.57-.28,2.37a4.61,4.61,0,0,0,.75,3.41,4.25,4.25,0,0,0,2.58,1.17c10.81,1.85,20.14-7.72,25.42-17.33a81.37,81.37,0,0,0,10.09-34.52c.12-2.34.13-4.67.06-7C693.72,216.93,693.72,217.59,693.68,218.26Z",transform:"translate(-88.58 -43.42)"})),b.createElement("path",{d:"M695.31,519.3s25.31,10.62,42-12.88",transform:"translate(-88.58 -43.42)",fill:"none",stroke:"#000",strokeMiterlimit:10,opacity:.1}),b.createElement("path",{d:"M700.29,537.86s20.67-13.44,47-.44",transform:"translate(-88.58 -43.42)",fill:"none",stroke:"#000",strokeMiterlimit:10,opacity:.1}),b.createElement("path",{d:"M561.93,534.81s8.68-19.58,31.86-4.65",transform:"translate(-88.58 -43.42)",fill:"none",stroke:"#000",strokeMiterlimit:10,opacity:.1}),b.createElement("path",{d:"M533.79,245.25l17.7-16s68.63-4.5,71.47,18.83c0,0,24.33-27.66,75.5-21.5l21.65,17.24-59.84,26.26-58.15,20.17-42.83-19.17Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M533.79,246.25l17.7-16s68.63-4.5,71.47,18.83c0,0,24.33-27.66,75.5-21.5l21.65,17.24-59.84,26.26-58.15,20.17-42.83-19.17Z",transform:"translate(-88.58 -43.42)",fill:"#d5d6db"}),b.createElement("polygon",{points:"437.38 204.83 445.21 298.5 528.21 302.67 524.61 209.4 524.54 207.83 437.38 204.83",opacity:.1}),b.createElement("polygon",{points:"437.38 202.83 445.21 296.5 528.21 300.67 524.61 207.4 524.54 205.83 437.38 202.83",fill:"#9f6bf4"}),b.createElement("polygon",{points:"635.33 202.83 549.71 215.67 549.71 309.76 633.38 297.67 635.33 202.83",opacity:.1}),b.createElement("polygon",{points:"635.33 200.83 549.71 213.67 549.71 307.76 633.38 295.67 635.33 200.83",fill:"#9f6bf4"}),b.createElement("polygon",{points:"615.14 223.79 568.89 228.93 569.9 244.69 615.11 239.75 615.14 223.79",fill:"#fff",opacity:.3}),b.createElement("path",{d:"M538.29,390.08,543,402.75s7,6,14.66,3,14.34-4.49,17.67-7.41,8-17.59,8-17.59,4.67-16,9.33-20,17-59.11,0-53.72-30,55.39-30,55.39-3,3.66-7.33,4-13-.67-14.67,3S533.29,382.75,538.29,390.08Z",transform:"translate(-88.58 -43.42)",fill:"#be6f72"}),b.createElement("path",{d:"M638.29,259.08a28.8,28.8,0,0,1-25.11-6.26l3.61,93.26s8.5,9.2,21.5,7.1Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M638.29,257.08a28.8,28.8,0,0,1-25.11-6.26l3.61,93.26s8.5,9.2,21.5,7.1Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M638.29,257.08a28.8,28.8,0,0,1-25.11-6.26l3.61,93.26s8.5,9.2,21.5,7.1Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M640.29,246.57s34.83-10.65,43.91-9.15",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M601.33,241.92s-33.76-8-39.4-5.73",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M662.25,247.9s23.29-8.54,31.71-4.48",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M650.52,462.13A76.56,76.56,0,0,1,662,455c6-2.89,17-10.39,17-10.39",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M561.93,360.08s-14.61,11.95-19,13-7.1,10.37-7.1,10.37",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M715.32,388.3,710.66,401s-7,6-14.67,3-14.33-4.49-17.67-7.41-8-17.59-8-17.59-4.66-16-9.33-20-17-59.11,0-53.72,30,55.39,30,55.39,3,3.66,7.33,4,13-.67,14.67,3S720.32,381,715.32,388.3Z",transform:"translate(-88.58 -43.42)",fill:"#be6f72"}),b.createElement("path",{d:"M707.15,364.94s9.55,6.14,9.51,13.48",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("circle",{cx:537.54,cy:98.87,r:44.67,fill:"#be6f72"}),b.createElement("path",{d:"M598.07,130.3c5.42-.85,10.17-4,15.35-5.81,11.59-4.07,24.41-1.28,36.14,2.39,4.5,1.41,9.07,3,13.79,3s9.73-1.93,12.14-6c2.22-3.74,1.79-8.6-.08-12.53s-5-7.09-8.16-10.07c-10.4-9.82-23.3-19-37.57-18-5.74.41-11.23,2.46-16.51,4.73a182,182,0,0,0-19.38,9.76c-4.81,2.79-13.72,6.52-16.49,11.62C571,120.88,588.27,131.84,598.07,130.3Z",transform:"translate(-88.58 -43.42)",fill:"#3e373a"}),b.createElement("path",{d:"M675.49,119.68c-2.41,4.07-7.42,6-12.14,6s-9.29-1.53-13.8-2.94c-11.73-3.67-24.54-6.47-36.14-2.39-5.17,1.81-9.93,5-15.35,5.8-7.9,1.24-20.62-5.64-22-14.39-1.55,10.11,13.2,18.77,22,17.39,5.42-.85,10.18-4,15.35-5.8,11.6-4.08,24.41-1.28,36.14,2.39,4.51,1.41,9.07,3,13.8,2.94s9.73-1.92,12.14-6a11.71,11.71,0,0,0,1.4-7.31A10.78,10.78,0,0,1,675.49,119.68Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M1038,661.63s5.93,7.75-2.74,19.46-15.81,21.59-12.93,28.89c0,0,13.08-21.74,23.72-22.05S1049.69,674.7,1038,661.63Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M1038,661.63a9.6,9.6,0,0,1,1.21,2.43c10.38,12.2,15.92,23.59,5.93,23.87-9.3.27-20.45,16.9-23.12,21.09a9.78,9.78,0,0,0,.31,1s13.08-21.74,23.72-22.05S1049.69,674.7,1038,661.63Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M1049,671.51c0,2.73-.31,4.94-.68,4.94s-.69-2.21-.69-4.94.38-1.44.76-1.44S1049,668.78,1049,671.51Z",transform:"translate(-88.58 -43.42)",fill:"#ffd037"}),b.createElement("path",{d:"M1052.79,674.77c-2.39,1.3-4.48,2.09-4.66,1.76s1.61-1.66,4-3,1.45-.36,1.63,0S1055.19,673.46,1052.79,674.77Z",transform:"translate(-88.58 -43.42)",fill:"#ffd037"}),b.createElement("path",{d:"M1006.66,661.63s-5.93,7.75,2.74,19.46,15.81,21.59,12.92,28.89c0,0-13.07-21.74-23.72-22.05S995,674.7,1006.66,661.63Z",transform:"translate(-88.58 -43.42)",fill:"#9f6bf4"}),b.createElement("path",{d:"M1006.66,661.63a9.6,9.6,0,0,0-1.21,2.43c-10.38,12.2-15.92,23.59-5.93,23.87,9.29.27,20.45,16.9,23.12,21.09a7.72,7.72,0,0,1-.32,1s-13.07-21.74-23.72-22.05S995,674.7,1006.66,661.63Z",transform:"translate(-88.58 -43.42)",opacity:.1}),b.createElement("path",{d:"M995.64,671.51c0,2.73.3,4.94.68,4.94s.69-2.21.69-4.94-.39-1.44-.76-1.44S995.64,668.78,995.64,671.51Z",transform:"translate(-88.58 -43.42)",fill:"#ffd037"}),b.createElement("path",{d:"M991.86,674.77c2.39,1.3,4.48,2.09,4.66,1.76s-1.61-1.66-4-3-1.45-.36-1.63,0S989.46,673.46,991.86,674.77Z",transform:"translate(-88.58 -43.42)",fill:"#ffd037"}),b.createElement("ellipse",{cx:933.75,cy:716.37,rx:62,ry:9.51,fill:"#9f6bf4",opacity:.1}),b.createElement("path",{d:"M1054.24,699.53l-.3,2.42-.42,3.42-.17,1.43-.42,3.42-.18,1.43-.41,3.41-4.75,38.9c-.42,3.47-6.09,6.18-12.94,6.18H1010c-6.85,0-12.51-2.71-12.94-6.18l-4.75-38.9-.42-3.41-.17-1.43-.42-3.42-.18-1.43-.41-3.42-.3-2.42c-.23-2,2.83-3.62,6.71-3.62h50.42C1051.41,695.91,1054.48,697.56,1054.24,699.53Z",transform:"translate(-88.58 -43.42)",fill:"#65617d"}),b.createElement("polygon",{points:"965.36 658.53 964.95 661.95 902.55 661.95 902.13 658.53 965.36 658.53",fill:"#9d9cb5"}),b.createElement("polygon",{points:"964.77 663.38 964.36 666.8 903.14 666.8 902.72 663.38 964.77 663.38",fill:"#9d9cb5"}),b.createElement("polygon",{points:"964.18 668.23 963.76 671.65 903.73 671.65 903.32 668.23 964.18 668.23",fill:"#9d9cb5"}))}var Lr={dialog:"_dialog_1cxu2_1",container:"_container_1cxu2_6",illustration:"_illustration_1cxu2_14",title:"_title_1cxu2_20",content:"_content_1cxu2_28"};class Rr extends b.PureComponent{render(){const{onClose:e}=this.props;return b.createElement(La,{className:Lr.dialog,onClose:e},b.createElement("div",{className:Lr.container},b.createElement(Mr,{className:Lr.illustration}),b.createElement("div",{className:Lr.title},"Read-only zone"),b.createElement("div",{className:Lr.content},"Pending changes could not be saved because you do not have write permissions for this database"),b.createElement(ha,{green:!0,className:Lr.confirmButton,onClick:e},"Understood")))}}var Ar=_(Rr);var Or={container:"_container_1n6lm_1",separator:"_separator_1n6lm_6",action:"_action_1n6lm_13",discardBtn:"_discardBtn_1n6lm_16"};class Dr extends b.PureComponent{constructor(){super(...arguments),this.state={isReadonlyDialogOpen:!1},this.handleDiscard=()=>{const{onSuccess:e}=this.props;Ms.discard(),null==e||e(),Ve.send({command:"action_discard",commandDetails:{pending_action_count:Ms.actions.length}})},this.handleCommit=async()=>{const{onSuccess:e,onFailure:t}=this.props;if(T.readonly)return this.handleToggleReadonlyDialog();try{await Ms.commit(),null==e||e()}catch(s){null==t||t()}Ve.send({command:"action_commit",commandDetails:{pending_action_count:Ms.actions.length}})},this.handleToggleReadonlyDialog=()=>{this.setState((e=>({isReadonlyDialogOpen:!e.isReadonlyDialogOpen})))}}render(){const{isReadonlyDialogOpen:e}=this.state,t=Ms.actions.filter((e=>"create"!==e.type||!Ms.actions.find((t=>t.recordId===e.recordId)))).length,s=Ms.invalidActions.length;return 0===t?null:b.createElement(b.Fragment,null,b.createElement("div",{className:Or.separator}),b.createElement("div",{"data-cy":"pending-actions",className:S(Or.container,this.props.className)},b.createElement(ha,{"data-cy":"commit-actions",green:!0,className:S(Or.action,Or.confirmBtn),disabled:s>0||Ms.committing,onClick:this.handleCommit},Ms.committing?"Saving Changes":`Save ${t} change${t>1?"s":""}`),b.createElement(ha,{"data-cy":"discard-actions",ghost:!0,disabled:Ms.committing,className:S(Or.action,Or.discardBtn),onClick:this.handleDiscard},"Discard changes"),e&&b.createElement(Ar,{onClose:this.handleToggleReadonlyDialog}),b.createElement(ma,{keys:"mod+s",onMatch:()=>Ms.commit()})))}}var kr=_(Dr);const Tr=e=>(e.contextType=qi,e);var Pr="_container_av89p_1";class Vr extends b.Component{render(){return b.createElement("div",{"data-cy":"loading-overlay",className:Pr},"Fetching rows in this table...")}}class jr extends b.Component{render(){return b.createElement("div",{"data-cy":"empty-overlay",className:Pr},"There are no rows in this table")}}function Zr(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{d:"M18.327 24L16.5266 18.3105H7.4735L5.67304 24H0L8.76437 0H15.2018L24 24H18.327ZM15.2697 14.06C13.6051 8.90463 12.6653 5.98911 12.4502 5.31336C12.2463 4.63761 12.0991 4.10355 12.0085 3.71118C11.6349 5.10627 10.5648 8.55585 8.79833 14.06H15.2697Z"}))}function Br(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 8.0001C0 6.89554 0.89544 6.00015 1.99999 6.00015H22.0001C23.1046 6.00015 24 6.89554 24 8.0001C24 9.10465 23.1046 10.0001 22.0001 10.0001H1.99999C0.89544 10.0001 0 9.10465 0 8.0001Z"}),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 15.9999C0 14.8954 0.89544 14 1.99999 14H22.0001C23.1046 14 24 14.8954 24 15.9999C24 17.1046 23.1046 17.9998 22.0001 17.9998H1.99999C0.89544 17.9998 0 17.1046 0 15.9999Z"}),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29671 0.0223986C10.389 0.186247 11.1418 1.20459 10.9779 2.2969L7.97789 22.2965C7.81404 23.3887 6.7957 24.1414 5.70334 23.9777C4.611 23.8138 3.85829 22.7954 4.02216 21.7032L7.02216 1.70355C7.18601 0.611239 8.20435 -0.141449 9.29671 0.0223986Z"}),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.2967 0.0223986C19.3891 0.186247 20.1418 1.20459 19.9779 2.2969L16.9779 22.2965C16.8139 23.3887 15.7957 24.1414 14.7033 23.9777C13.611 23.8138 12.8583 22.7954 13.0222 21.7032L16.0222 1.70355C16.186 0.611239 17.2044 -0.141449 18.2967 0.0223986Z"}))}function Fr(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.85714 5C3.07006 5 0 8.13402 0 12C0 15.866 3.07006 19 6.85714 19H17.143C20.9299 19 24 15.866 24 12C24 8.13402 20.9299 5 17.143 5H6.85714ZM6.85714 17.25C9.69746 17.25 12 14.8995 12 12C12 9.10051 9.69746 6.75 6.85714 6.75C4.01683 6.75 1.7143 9.10051 1.7143 12C1.7143 14.8995 4.01683 17.25 6.85714 17.25Z"}))}function Hr(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 10V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10H4ZM0 6C0 2.68629 2.68629 0 6 0H18C21.3137 0 24 2.68629 24 6V18C24 21.3137 21.3137 24 18 24H6C2.68629 24 0 21.3137 0 18V6Z"}))}function qr(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24 4.8H0V0H24V4.8Z"}),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.8 14.4H0V9.60001H16.8V14.4Z"}),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24 24H0V19.2H24V24Z"}))}function Ur(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{d:"M9.5452 24V21.1961H8.44912C6.82779 21.1961 6.50809 20.7754 6.50809 18.6723V15.1291C6.50809 13.3829 5.38916 12.2613 3.32256 12.1211V11.8917C5.38916 11.7515 6.50809 10.6171 6.50809 8.88371V5.32767C6.50809 3.22464 6.82779 2.80404 8.44912 2.80404H9.5452V0H7.70696C4.40725 0 3.33397 1.15985 3.33397 4.72863V7.54542C3.33397 9.55924 2.51189 10.3367 0 10.222V13.778C2.51189 13.6761 3.33397 14.4535 3.33397 16.4674V19.2713C3.33397 22.8401 4.40725 24 7.70696 24H9.5452Z"}),b.createElement("path",{d:"M16.293 24C19.5929 24 20.6659 22.8401 20.6659 19.2713V16.4674C20.6659 14.4535 21.4882 13.6761 24 13.778V10.222C21.4882 10.3367 20.6659 9.55924 20.6659 7.54542V4.72863C20.6659 1.15985 19.5929 0 16.293 0H14.4548V2.80404H15.5509C17.1722 2.80404 17.4919 3.22464 17.4919 5.32767V8.88371C17.4919 10.6171 18.6108 11.7515 20.6774 11.8917V12.1211C18.6108 12.2613 17.4919 13.3829 17.4919 15.1291V18.6723C17.4919 20.7754 17.1722 21.1961 15.5509 21.1961H14.4548V24H16.293Z"}))}function zr(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99999 0H0V24H7.99999V21H4.00001V3H7.99999V0ZM16 0V3H19.9999V21H16V24H24V0H16Z"}))}var $r="_icon_f25b9_1",Jr="_required_f25b9_8";var Yr=_((({className:e,string:t=!1,int:s=!1,float:i=!1,boolean:a=!1,dateTime:n=!1,enumerable:r=!1,array:l=!1,required:o=!1})=>{let d;return d=l?zr:t?Zr:s||i?Br:a?Fr:r?qr:n?Hr:Ur,b.createElement(b.Fragment,null,b.createElement(d,{className:S($r,e)}),b.createElement("span",{className:Jr},!o&&"?"))}));var Wr={container:"_container_e5y85_1",sortable:"_sortable_e5y85_11",title:"_title_e5y85_15",spacer:"_spacer_e5y85_22",sortIndicator:"_sortIndicator_e5y85_26",visible:"_visible_e5y85_34",asc:"_asc_e5y85_37"};class Kr extends b.Component{constructor(){super(...arguments),this.state={wasReordered:!1},this.handleReorder=()=>{this.setState({wasReordered:!0})},this.handleSort=()=>{var e;const{wasReordered:t}=this.state,{field:s,script:i}=this.props;this.setState({wasReordered:!1}),s&&s.isSortable&&(t||(null==(e=gi.activeTab)||e.update({preview:!1}),i.sort.fieldId===s.id&&"asc"===i.sort.order?i.sort.update({fieldId:s.id,order:"desc"}):i.sort.fieldId===s.id&&"desc"===i.sort.order?i.sort.update({fieldId:null,order:"asc"}):i.sort.update({fieldId:s.id,order:"asc"}),i.run(),Ve.send({command:"sort_change",commandDetails:{field_type:s.type}})))}}componentDidMount(){this.props.column.addEventListener("movingChanged",this.handleReorder)}componentWillUnmount(){this.props.column.removeEventListener("movingChanged",this.handleReorder)}render(){var e,t;const{field:s,script:i,displayName:a,columnApi:n,column:r}=this.props,l=null!=(t=null==(e=n.getColumnState().find((e=>e.colId===r.getColId())))?void 0:e.width)?t:200;return b.createElement("div",{"data-cy":"table__header__cell",className:S(Wr.container,{[Wr.sortable]:s.isSortable}),style:{width:l},title:`${s.name} (${s.type})`,onClick:this.handleSort},b.createElement("span",{"data-cy":"table__header__cell__title",className:Wr.title},a),b.createElement(Yr,{required:s.isRequired,array:s.isList,object:s.isRelation,string:s.isString,int:s.isInt||s.isBigInt,float:s.isFloat||s.isDecimal,boolean:s.isBoolean,dateTime:s.isDateTime,enumerable:s.isEnum}),b.createElement("div",{className:Wr.spacer}),b.createElement(Cn,{"data-cy-asc":i.sort.fieldId===s.id&&"asc"===i.sort.order,"data-cy-desc":i.sort.fieldId===s.id&&"desc"===i.sort.order,className:S(Wr.sortIndicator,{[Wr.visible]:i.sort.fieldId===s.id,[Wr.asc]:"asc"===i.sort.order,[Wr.desc]:"desc"===i.sort.order})}))}}var Gr=_(Kr);var Qr="_pill_14n8h_1",Xr="_modelName_14n8h_18",el="_isNull_14n8h_21",tl="_isPressed_14n8h_21",sl="_count_14n8h_30";class il extends b.Component{render(){const{type:e,count:t=0,isList:s=!1,isNull:i=!1,isPressed:a=!1,onClick:n}=this.props;return b.createElement("div",{"data-cy":"relation-pill","data-cy-null":`${i}`,className:S(Qr,{[el]:i,[tl]:a}),onClick:n},s&&b.createElement("span",{className:sl},t),b.createElement("span",{className:Xr},e))}}var al="_container_1lgfw_1",nl="_placeholder_1lgfw_8",rl="_relation_1lgfw_11",ll="_loading_1lgfw_16";class ol extends b.Component{constructor(){super(...arguments),this.handleClickRelation=()=>{const{api:e,node:t,field:s}=this.props;this.props.resizeRowForRelation(t,s);const i=e.getFocusedCell();e.startEditingCell({rowIndex:i.rowIndex,colKey:i.column})},this.getRenderedValue=()=>{const{node:{data:e},field:t}=this.props,s=e,i=s.value[t.name];return s?t.isRelation?null:t.isJson?JSON.stringify(i||null):void 0===i?t.defaultAsString:null===i?"null":t.isBigInt?t.isList?"["+i.map((e=>e.toString())).join(", ")+"]":i.toString():t.isBytes?t.isList?"["+i.map((e=>(e instanceof Uint8Array?st.from(e):e).toString("base64"))).join(", ")+"]":(i instanceof Uint8Array?st.from(i):i).toString("base64"):t.isList?JSON.stringify(i):String(i):""}}render(){const{node:{data:e},field:t}=this.props,s=e;if(!s)return b.createElement("div",{className:ll});const i=s.value[t.name],a=void 0===i,n=null===i;return b.createElement("div",{className:S(al,{[nl]:a||n,[rl]:t.isRelation})},t.isRelation&&b.createElement(il,{type:t.type,isList:t.isList,isNull:!i,count:(i||[]).length,onClick:this.handleClickRelation}),this.getRenderedValue())}}var dl=_(ol);var cl="_input_1ebqz_1";class hl extends b.PureComponent{constructor(e){var t;super(e),this.input=b.createRef(),this.getValue=()=>this.state.value,this.focus=()=>{var e;null==(e=this.input.current)||e.focus()},this.handleChange=e=>{const{field:t}=this.props,s=e.currentTarget.value;t.isRequired||""!==s?this.setState({value:s}):this.setState({value:null})},this.state={value:null!=(t=e.initialValue)?t:null}}render(){const{value:e}=this.state;return b.createElement("input",{"data-cy":"input--string",ref:this.input,className:cl,type:"text",value:null==e?"":String(e),placeholder:"null",onChange:this.handleChange})}}var pl=_(hl);var ul="_container_1f6qf_1";class ml extends b.PureComponent{constructor(){super(...arguments),this.handleDragStart=e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/html",e.target.parentNode),e.dataTransfer.setDragImage(e.target.parentNode,20,20),this.props.onDragStart(e)},this.handleDragEnd=e=>{this.props.onDragEnd(e)}}render(){const e=this.props,{className:t,children:s}=e,i=r(e,["className","children"]);return b.createElement("div",n(n({draggable:!0,className:S(ul,t)},i),{onDragStart:e=>this.handleDragStart(e),onDragEnd:e=>this.handleDragEnd(e)}),s)}}var gl=_(ml);function fl(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{opacity:.5,fillRule:"evenodd",clipRule:"evenodd",d:"M24 10H0V6H24V10Z",fill:"currentColor"}),b.createElement("path",{opacity:.5,fillRule:"evenodd",clipRule:"evenodd",d:"M24 18H0V14H24V18Z",fill:"currentColor"}))}var vl="_container_i5u05_1",yl="_input_i5u05_7",Il="_itemContainer_i5u05_27",Cl="_itemScrollContainer_i5u05_45",wl="_item_i5u05_27",El="_invalid_i5u05_53",bl="_dragButton_i5u05_63",_l="_closeButton_i5u05_77",Sl="_addScalarListItemBtn_i5u05_101",xl="_separator_i5u05_109",Nl="_draggedOver_i5u05_113";class Ml extends b.PureComponent{constructor(e){super(e),this.items=[],this.draggedItem=null,this.getValue=()=>this.state.value,this.focus=()=>{var e;const{value:t}=this.state;t&&(null==(e=this.items[Math.max(t.length,0)].current)||e.focus())},this.handleChange=e=>{try{const t=JSON.parse(e.currentTarget.value);Array.isArray(t)&&this.setState({value:t.map((e=>String(e)))})}catch(t){}},this.handleChangeItem=(e,t)=>{const{value:s}=this.state,i=String(t.currentTarget.value);if(!Array.isArray(s))throw B({path:"StringListInput.handleChangeItem",message:"Invalid value",context:{value:s,idx:e,changedItem:i}});const a=[...s];return a.splice(e,1,i),this.setState({value:a})},this.handleChangeNewItem=e=>{const t=String(e.currentTarget.value);this.setState({newItem:t})},this.handleAddNewItem=()=>{const{value:e,newItem:t}=this.state;if(!Array.isArray(e))throw B({path:"StringListInput.handleAddItem",message:"Invalid value",context:{value:e,newItem:t}});this.items.push(b.createRef()),this.setState({value:[...e,t||""],newItem:null},(()=>{var e,t;null==(e=this.items[this.items.length-1].current)||e.focus(),null==(t=this.items[this.items.length-2].current)||t.scrollIntoView(!1)}))},this.handleEnterKeydown=e=>{const{value:t}=this.state;if(!Array.isArray(t))throw B({path:"StringListInput.handleEnterKeydown",message:"Invalid value",context:{value:t,idx:e}});let s=[...t];s.splice(e+1,0,""),this.items.push(b.createRef()),this.setState({value:s,newItem:null},(()=>{var t,s,i;null==(t=this.items[e+1].current)||t.focus(),null==(s=this.items[e+1].current)||s.scrollIntoView(!1),null==(i=this.items[e+1].current)||i.scrollIntoView({block:"nearest"})}))},this.handleRemoveItem=(e,t)=>{var s,i,a,n;const{value:r}=this.state;if(t.preventDefault(),t.stopPropagation(),!Array.isArray(r))throw B({path:"StringListInput.handleRemoveClick",message:"Invalid Value",context:{value:r,idx:e}});const l=[...r];l.splice(e,1),this.items.splice(e,1),null==(i=null==(s=this.items[e-1])?void 0:s.current)||i.focus(),null==(n=null==(a=this.items[e-1])?void 0:a.current)||n.scrollIntoView(),setTimeout((()=>this.setState({value:l})),0)},this.handleTabKeydown=(e,t)=>{var s;const{value:i}=this.state;if(!Array.isArray(i))throw B({path:"StringListInput.handleTabKeydown",message:"Invalid value",context:{value:i,idx:e}});e===i.length||(t.preventDefault(),t.stopPropagation(),null==(s=this.items[e+1].current)||s.focus())},this.handleShiftTabKeydown=(e,t)=>{var s;0===e||(t.preventDefault(),t.stopPropagation(),null==(s=this.items[e-1].current)||s.focus())},this.handleFinishEditing=()=>{this.props.stopEditing()},this.handleDragStart=e=>{this.draggedItem=this.items[e]},this.handleDragOver=(e,t)=>{t.preventDefault(),this.setState({draggedOverIdx:e})},this.handleDragEnd=e=>{var t;if(!this.draggedItem)return;const{value:s=[]}=this.state;if(!Array.isArray(s))throw B({path:"StringListInput.HandleDragEnd",message:"Invalid value",context:{value:s,idx:e}});const i=[...s],a=String(null==(t=this.draggedItem.current)?void 0:t.value);this.items.splice(e,1),i.splice(e,1),this.state.draggedOverIdx>e?(this.items.splice(this.state.draggedOverIdx-1,0,this.draggedItem),i.splice(this.state.draggedOverIdx-1,0,a)):(this.items.splice(this.state.draggedOverIdx,0,this.draggedItem),i.splice(this.state.draggedOverIdx,0,a)),this.draggedItem=null,this.setState({value:i,draggedOverIdx:-1})};const{initialValue:t}=e;if(!Array.isArray(t))throw B({path:"StringListInput.constructor",message:"Invalid initialValue",context:{initialValue:t}});this.state={value:t,newItem:null,draggedOverIdx:-1},this.items=Array.from({length:Math.max(t.length,1)}).map((()=>b.createRef())),this.items.push(b.createRef())}render(){const{value:e}=this.state;if(!Array.isArray(e))throw B({path:"StringListInput.render",message:"Invalid value",context:{value:e}});return b.createElement(b.Fragment,null,b.createElement("div",{"data-cy":"input--string-list",className:vl},b.createElement("input",{type:"text",className:yl,value:JSON.stringify(e),onChange:this.handleChange}),b.createElement("ul",{className:S(Il,"ag-theme-dark")},b.createElement("div",{className:Cl},b.createElement("div",{className:S(xl,{[Nl]:0===this.state.draggedOverIdx})}),e.map(((e,t)=>b.createElement(b.Fragment,{key:t},b.createElement(Ll,{innerRef:this.items[t],value:e,onChange:this.handleChangeItem.bind(this,t),onRemove:this.handleRemoveItem.bind(this,t),onEnter:this.handleEnterKeydown.bind(this,t),onTab:this.handleTabKeydown.bind(this,t),onShiftTab:this.handleShiftTabKeydown.bind(this,t),onModEnter:this.handleFinishEditing.bind(this,t),onDragStart:this.handleDragStart.bind(this,t),onDragEnd:this.handleDragEnd.bind(this,t),onDragOver:this.handleDragOver.bind(this,t)}),b.createElement("div",{className:S(xl,{[Nl]:this.state.draggedOverIdx===t+1})}))))),b.createElement(Ll,{innerRef:this.items[e.length],value:this.state.newItem||"",onChange:this.handleChangeNewItem,onAdd:this.handleAddNewItem,onEnter:this.handleAddNewItem,onShiftTab:this.handleShiftTabKeydown.bind(this,e.length),onDragOver:this.handleDragOver.bind(this,e.length)}))))}}class Ll extends b.Component{render(){return b.createElement("li",{className:wl,onDragOver:this.props.onDragOver},this.props.onDragStart&&this.props.onDragEnd&&b.createElement(gl,{className:bl,onDragStart:this.props.onDragStart,onDragEnd:this.props.onDragEnd},b.createElement(fl,null)),b.createElement("input",{ref:this.props.innerRef,className:yl,type:"text",value:this.props.value,tabIndex:this.props.tabIndex,onChange:this.props.onChange}),this.props.onAdd&&b.createElement(ha,{"data-cy":"input--string-list__add-btn",onClick:this.props.onAdd,className:Sl},"Add"),this.props.onRemove&&b.createElement(ha,{"data-cy":"input--string-list__remove-btn",onClick:this.props.onRemove,className:_l},b.createElement(Da,null)),this.props.onEnter&&b.createElement(ma,{keys:"enter",target:this.props.innerRef,onMatch:this.props.onEnter}),this.props.onTab&&b.createElement(ma,{keys:["tab"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onTab}),this.props.onShiftTab&&b.createElement(ma,{keys:["shift+tab"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onShiftTab}),this.props.onModEnter&&b.createElement(ma,{keys:["mod+enter"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onModEnter}))}}var Rl=_(Ml);class Al extends b.PureComponent{constructor(e){super(e),this.input=b.createRef(),this.getValue=()=>this.state.value,this.focus=()=>{var e;null==(e=this.input.current)||e.focus()},this.handleChange=e=>{const t=e.currentTarget.value;if(""===t)return void this.setState({value:null});const s=parseFloat(t);this.setState({value:s})};const{initialValue:t}=e,s=null==t?null:parseFloat(`${t}`);this.state={value:s}}render(){const{value:e}=this.state;return b.createElement("input",{"data-cy":"input--number",ref:this.input,className:cl,type:"number",value:null==e?"":String(e),placeholder:"null",onChange:this.handleChange})}}var Ol=_(Al);class Dl extends b.PureComponent{constructor(e){super(e),this.items=[],this.draggedItem=null,this.getValue=()=>this.state.value,this.focus=()=>{var e;const{value:t}=this.state;t&&(null==(e=this.items[Math.max(t.length,0)].current)||e.focus())},this.handleChange=e=>{try{const t=JSON.parse(e.currentTarget.value);Array.isArray(t)&&this.setState({value:t.map((e=>parseInt(e))).filter((e=>!isNaN(e)))})}catch(t){}},this.handleChangeItem=(e,t)=>{const{value:s}=this.state,{field:i}=this.props;let a=i.isInt?parseInt(t.currentTarget.value):parseFloat(t.currentTarget.value);if(isNaN(a)&&(a=null),!Array.isArray(s))throw B({path:"NumberListInput.handleChangeItem",message:"Invalid value",context:{value:s,idx:e,changedItem:a}});const n=[...s];return n.splice(e,1,a),this.setState({value:n})},this.handleChangeNewItem=e=>{const{field:t}=this.props;let s=t.isInt?parseInt(e.currentTarget.value):parseFloat(e.currentTarget.value);isNaN(s)&&(s=null),this.setState({newItem:s})},this.handleAddNewItem=()=>{const{value:e,newItem:t}=this.state;if(!Array.isArray(e))throw B({path:"NumberListInput.handleAddItem",message:"Invalid value",context:{value:e,newItem:t}});this.items.push(b.createRef()),this.setState({value:[...e,t||0],newItem:null},(()=>{var e,t;null==(e=this.items[this.items.length-1].current)||e.focus(),null==(t=this.items[this.items.length-2].current)||t.scrollIntoView(!1)}))},this.handleEnterKeydown=e=>{const{value:t}=this.state;if(!Array.isArray(t))throw B({path:"NumberListInput.handleEnterKeydown",message:"Invalid value",context:{value:t,idx:e}});let s=[...t];s.splice(e+1,0,null),this.items.push(b.createRef()),this.setState({value:s,newItem:null},(()=>{var t,s,i;null==(t=this.items[e+1].current)||t.focus(),null==(s=this.items[e+1].current)||s.scrollIntoView(!1),null==(i=this.items[e+1].current)||i.scrollIntoView({block:"nearest"})}))},this.handleRemoveItem=e=>{var t,s,i,a;const{value:n}=this.state;if(!Array.isArray(n))throw B({path:"NumberListInput.handleRemoveClick",message:"Invalid Value",context:{value:n,idx:e}});this.items.splice(e,1);const r=[...n];r.splice(e,1),null==(s=null==(t=this.items[e-1])?void 0:t.current)||s.focus(),null==(a=null==(i=this.items[e-1])?void 0:i.current)||a.scrollIntoView(),setTimeout((()=>this.setState({value:r})),0)},this.handleTabKeydown=(e,t)=>{var s;const{value:i}=this.state;if(!Array.isArray(i))throw B({path:"NumberListInput.handleTabKeydown",message:"Invalid value",context:{value:i,idx:e}});e===i.length||(t.preventDefault(),t.stopPropagation(),null==(s=this.items[e+1].current)||s.focus())},this.handleShiftTabKeydown=(e,t)=>{var s;0===e||(t.preventDefault(),t.stopPropagation(),null==(s=this.items[e-1].current)||s.focus())},this.handleFinishEditing=()=>{this.props.stopEditing()},this.handleDragStart=e=>{this.draggedItem=this.items[e]},this.handleDragOver=(e,t)=>{t.preventDefault(),this.setState({draggedOverIdx:e})},this.handleDragEnd=e=>{var t,s,i,a;if(!this.draggedItem)return;const{field:n}=this.props,{value:r=[]}=this.state;if(!Array.isArray(r))throw B({path:"NumberListInput.HandleDragEnd",message:"Invalid value",context:{value:r,idx:e}});const l=[...r];let o=n.isInt?parseInt(null!=(s=null==(t=this.draggedItem.current)?void 0:t.value)?s:""):parseFloat(null!=(a=null==(i=this.draggedItem.current)?void 0:i.value)?a:"");isNaN(o)&&(o=null),this.items.splice(e,1),l.splice(e,1),this.state.draggedOverIdx>e?(this.items.splice(this.state.draggedOverIdx-1,0,this.draggedItem),l.splice(this.state.draggedOverIdx-1,0,o)):(this.items.splice(this.state.draggedOverIdx,0,this.draggedItem),l.splice(this.state.draggedOverIdx,0,o)),this.draggedItem=null,this.setState({value:l,draggedOverIdx:-1})};const{initialValue:t}=e;if(!Array.isArray(t))throw B({path:"NumberListInput.constructor",message:"Invalid initialValue",context:{initialValue:t}});this.state={value:t,newItem:null,draggedOverIdx:-1},this.items=Array.from({length:Math.max(t.length,1)}).map((()=>b.createRef())),this.items.push(b.createRef())}render(){const{value:e}=this.state;if(!Array.isArray(e))throw B({path:"NumberListInput.render",message:"Invalid value",context:{value:e}});return b.createElement(b.Fragment,null,b.createElement("div",{"data-cy":"input--number-list",className:vl},b.createElement("input",{type:"text",className:yl,value:JSON.stringify(e),onChange:this.handleChange}),b.createElement("ul",{className:S(Il,"ag-theme-dark")},b.createElement("div",{className:Cl},b.createElement("div",{className:S(xl,{[Nl]:0===this.state.draggedOverIdx})}),e.map(((e,t)=>b.createElement(b.Fragment,{key:t},b.createElement(kl,{innerRef:this.items[t],value:null===e?"":String(e),invalid:null===e||Number.isNaN(e),onChange:this.handleChangeItem.bind(this,t),onRemove:this.handleRemoveItem.bind(this,t),onEnter:this.handleEnterKeydown.bind(this,t),onTab:this.handleTabKeydown.bind(this,t),onShiftTab:this.handleShiftTabKeydown.bind(this,t),onModEnter:this.handleFinishEditing.bind(this,t),onDragStart:this.handleDragStart.bind(this,t),onDragEnd:this.handleDragEnd.bind(this,t),onDragOver:this.handleDragOver.bind(this,t)}),b.createElement("div",{className:S(xl,{[Nl]:this.state.draggedOverIdx===t+1})}))))),b.createElement(kl,{innerRef:this.items[e.length],value:null===this.state.newItem?"":String(this.state.newItem),invalid:!1,onChange:this.handleChangeNewItem,onAdd:this.handleAddNewItem,onEnter:this.handleAddNewItem,onShiftTab:this.handleShiftTabKeydown.bind(this,e.length),onDragOver:this.handleDragOver.bind(this,e.length)}))))}}class kl extends b.Component{render(){return b.createElement("li",{className:S(wl,{[El]:this.props.invalid}),onDragOver:this.props.onDragOver},this.props.onDragStart&&this.props.onDragEnd&&b.createElement(gl,{className:bl,onDragStart:this.props.onDragStart,onDragEnd:this.props.onDragEnd},b.createElement(fl,null)),b.createElement("input",{ref:this.props.innerRef,className:yl,type:"number",value:this.props.value,tabIndex:this.props.tabIndex,onChange:this.props.onChange}),this.props.onAdd&&b.createElement(ha,{"data-cy":"input--number-list__add-btn",onClick:this.props.onAdd,className:Sl},"Add"),this.props.onRemove&&b.createElement(ha,{"data-cy":"input--number-list__remove-btn",onClick:e=>{var t,s;return null==(s=(t=this.props).onRemove)?void 0:s.call(t,e)},className:_l},b.createElement(Da,null)),this.props.onEnter&&b.createElement(ma,{keys:"enter",target:this.props.innerRef,onMatch:this.props.onEnter}),this.props.onTab&&b.createElement(ma,{keys:["tab"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onTab}),this.props.onShiftTab&&b.createElement(ma,{keys:["shift+tab"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onShiftTab}),this.props.onModEnter&&b.createElement(ma,{keys:["mod+enter"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onModEnter}))}}var Tl=_(Dl);class Pl extends b.PureComponent{constructor(e){super(e),this.input=b.createRef(),this.getValue=()=>BigInt(this.state.value),this.focus=()=>{var e;null==(e=this.input.current)||e.focus()},this.handleChange=e=>{const t=e.currentTarget.value;if(""!==t)try{const e=BigInt(t);this.setState({value:e})}catch(s){}else this.setState({value:null})};const{initialValue:t}=e,s=null==t?null:BigInt(t);this.state={value:s}}render(){const{value:e}=this.state;return b.createElement("input",{"data-cy":"input--bigint",ref:this.input,className:cl,type:"string",value:null==e?"":e.toString(),placeholder:"null",onChange:this.handleChange})}}var Vl=_(Pl);class jl extends b.PureComponent{constructor(e){super(e),this.items=[],this.draggedItem=null,this.getValue=()=>{var e;return null==(e=this.state.value)?void 0:e.map((e=>BigInt(e)))},this.focus=()=>{var e;const{value:t}=this.state;t&&(null==(e=this.items[Math.max(t.length,0)].current)||e.focus())},this.handleChange=e=>{try{const t=JSON.parse(e.currentTarget.value);Array.isArray(t)&&this.setState({value:t.map((e=>BigInt(e)))})}catch(t){}},this.handleChangeItem=(e,t)=>{const{value:s}=this.state;try{let i=BigInt(t.currentTarget.value);if(!Array.isArray(s))throw B({path:"BigIntListInput.handleChangeItem",message:"Invalid value",context:{value:s,idx:e,changedItem:i}});const a=[...s];return a.splice(e,1,i),this.setState({value:a})}catch(i){}},this.handleChangeNewItem=e=>{try{let t=BigInt(e.currentTarget.value);this.setState({newItem:t})}catch(t){}},this.handleAddNewItem=()=>{const{value:e,newItem:t}=this.state;if(!Array.isArray(e))throw B({path:"BigIntListInput.handleAddItem",message:"Invalid value",context:{value:e,newItem:t}});this.items.push(b.createRef()),this.setState({value:[...e,t||BigInt(0)],newItem:null},(()=>{var e,t;null==(e=this.items[this.items.length-1].current)||e.focus(),null==(t=this.items[this.items.length-2].current)||t.scrollIntoView(!1)}))},this.handleEnterKeydown=e=>{const{value:t}=this.state;if(!Array.isArray(t))throw B({path:"BigIntListInput.handleEnterKeydown",message:"Invalid value",context:{value:t,idx:e}});let s=[...t];s.splice(e+1,0,null),this.items.push(b.createRef()),this.setState({value:s,newItem:null},(()=>{var t,s,i;null==(t=this.items[e+1].current)||t.focus(),null==(s=this.items[e+1].current)||s.scrollIntoView(!1),null==(i=this.items[e+1].current)||i.scrollIntoView({block:"nearest"})}))},this.handleRemoveItem=e=>{var t,s,i,a;const{value:n}=this.state;if(!Array.isArray(n))throw B({path:"BigIntListInput.handleRemoveClick",message:"Invalid Value",context:{value:n,idx:e}});this.items.splice(e,1);const r=[...n];r.splice(e,1),null==(s=null==(t=this.items[e-1])?void 0:t.current)||s.focus(),null==(a=null==(i=this.items[e-1])?void 0:i.current)||a.scrollIntoView(),setTimeout((()=>this.setState({value:r})),0)},this.handleTabKeydown=(e,t)=>{var s;const{value:i}=this.state;if(!Array.isArray(i))throw B({path:"BigIntListInput.handleTabKeydown",message:"Invalid value",context:{value:i,idx:e}});e===i.length||(t.preventDefault(),t.stopPropagation(),null==(s=this.items[e+1].current)||s.focus())},this.handleShiftTabKeydown=(e,t)=>{var s;0===e||(t.preventDefault(),t.stopPropagation(),null==(s=this.items[e-1].current)||s.focus())},this.handleFinishEditing=()=>{this.props.stopEditing()},this.handleDragStart=e=>{this.draggedItem=this.items[e]},this.handleDragOver=(e,t)=>{t.preventDefault(),this.setState({draggedOverIdx:e})},this.handleDragEnd=e=>{var t,s;if(!this.draggedItem)return;const{value:i=[]}=this.state;if(!Array.isArray(i))throw B({path:"BigIntListInput.HandleDragEnd",message:"Invalid value",context:{value:i,idx:e}});const a=[...i];let n=BigInt(null!=(s=null==(t=this.draggedItem.current)?void 0:t.value)?s:0);this.items.splice(e,1),a.splice(e,1),this.state.draggedOverIdx>e?(this.items.splice(this.state.draggedOverIdx-1,0,this.draggedItem),a.splice(this.state.draggedOverIdx-1,0,n)):(this.items.splice(this.state.draggedOverIdx,0,this.draggedItem),a.splice(this.state.draggedOverIdx,0,n)),this.draggedItem=null,this.setState({value:a,draggedOverIdx:-1})};const{initialValue:t}=e;if(!Array.isArray(t))throw B({path:"BigIntListInput.constructor",message:"Invalid initialValue",context:{initialValue:t}});this.state={value:t.map((e=>BigInt(e))),newItem:null,draggedOverIdx:-1},this.items=Array.from({length:Math.max(t.length,1)}).map((()=>b.createRef())),this.items.push(b.createRef())}render(){const{value:e}=this.state;if(!Array.isArray(e))throw B({path:"BigIntListInput.render",message:"Invalid value",context:{value:e}});return b.createElement(b.Fragment,null,b.createElement("div",{"data-cy":"input--bigint-list",className:vl},b.createElement("input",{type:"text",className:yl,value:e.map((e=>(null==e?void 0:e.toString())||"null")),onChange:this.handleChange}),b.createElement("ul",{className:S(Il,"ag-theme-dark")},b.createElement("div",{className:Cl},b.createElement("div",{className:S(xl,{[Nl]:0===this.state.draggedOverIdx})}),e.map(((e,t)=>b.createElement(b.Fragment,{key:t},b.createElement(Zl,{innerRef:this.items[t],value:null===e?"":e.toString(),invalid:null===e||Number.isNaN(e),onChange:this.handleChangeItem.bind(this,t),onRemove:this.handleRemoveItem.bind(this,t),onEnter:this.handleEnterKeydown.bind(this,t),onTab:this.handleTabKeydown.bind(this,t),onShiftTab:this.handleShiftTabKeydown.bind(this,t),onModEnter:this.handleFinishEditing.bind(this,t),onDragStart:this.handleDragStart.bind(this,t),onDragEnd:this.handleDragEnd.bind(this,t),onDragOver:this.handleDragOver.bind(this,t)}),b.createElement("div",{className:S(xl,{[Nl]:this.state.draggedOverIdx===t+1})}))))),b.createElement(Zl,{innerRef:this.items[e.length],value:null===this.state.newItem?"":this.state.newItem.toString(),invalid:!1,onChange:this.handleChangeNewItem,onAdd:this.handleAddNewItem,onEnter:this.handleAddNewItem,onShiftTab:this.handleShiftTabKeydown.bind(this,e.length),onDragOver:this.handleDragOver.bind(this,e.length)}))))}}class Zl extends b.Component{render(){return b.createElement("li",{className:S(wl,{[El]:this.props.invalid}),onDragOver:this.props.onDragOver},this.props.onDragStart&&this.props.onDragEnd&&b.createElement(gl,{className:bl,onDragStart:this.props.onDragStart,onDragEnd:this.props.onDragEnd},b.createElement(fl,null)),b.createElement("input",{ref:this.props.innerRef,className:yl,type:"text",value:this.props.value,tabIndex:this.props.tabIndex,onChange:this.props.onChange}),this.props.onAdd&&b.createElement(ha,{"data-cy":"input--bigint-list__add-btn",onClick:this.props.onAdd,className:Sl},"Add"),this.props.onRemove&&b.createElement(ha,{"data-cy":"input--bigint-list__remove-btn",onClick:e=>{var t,s;return null==(s=(t=this.props).onRemove)?void 0:s.call(t,e)},className:_l},b.createElement(Da,null)),this.props.onEnter&&b.createElement(ma,{keys:"enter",target:this.props.innerRef,onMatch:this.props.onEnter}),this.props.onTab&&b.createElement(ma,{keys:["tab"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onTab}),this.props.onShiftTab&&b.createElement(ma,{keys:["shift+tab"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onShiftTab}),this.props.onModEnter&&b.createElement(ma,{keys:["mod+enter"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onModEnter}))}}var Bl=_(jl);var Fl="_container_z3tbz_1",Hl="_input_z3tbz_7",ql="_dropdown_z3tbz_19",Ul="_match_z3tbz_37",zl="_highlight_z3tbz_45";class $l extends b.Component{constructor(e){super(e),this.input=b.createRef(),this.focus=()=>{var e;null==(e=this.input.current)||e.focus()},this.handleChange=e=>{const{suggestions:t,onChange:s}=this.props,i=e.currentTarget.value,a=t.findIndex((e=>e.toUpperCase().startsWith(i.toUpperCase())));this.setState({phrase:i,highlightIdx:a}),s(t[a]||t[0])},this.handleSuggestionClick=e=>{const{suggestions:t,onChange:s,onSubmit:i}=this.props,a=t[e];s(a),null==i||i(a)},this.handleSubmit=()=>{const{highlightIdx:e}=this.state,{suggestions:t,onChange:s,onSubmit:i}=this.props,a=t[e]||t[0];s(a),null==i||i(a)},this.state={phrase:String(e.value),highlightIdx:0}}render(){const{phrase:e,highlightIdx:t}=this.state,{className:s,style:i,suggestions:a,dataCy:n}=this.props;return b.createElement("div",{"data-cy":n,className:S(Fl,s),style:i},b.createElement("input",{ref:this.input,type:"text",className:Hl,value:e,onChange:this.handleChange}),b.createElement("ul",{className:ql},a.map(((e,s)=>b.createElement("li",{key:e,"data-cy":"suggestion",className:S(Ul,{[zl]:t===s}),onClick:()=>this.handleSuggestionClick(s)},e)))),b.createElement(ma,{target:this.input,keys:"up",onMatch:()=>this.setState({highlightIdx:Math.max(t-1,0)})}),b.createElement(ma,{target:this.input,keys:"down",onMatch:()=>this.setState((e=>({highlightIdx:Math.min(e.highlightIdx+1,a.length-1)})))}),b.createElement(ma,{target:this.input,preventDefault:!1,stopPropagation:!1,keys:"enter",onMatch:this.handleSubmit}))}}var Jl=_($l);var Yl="_input_j8mok_1";class Wl extends b.PureComponent{constructor(e){super(e),this.input=b.createRef(),this.getValue=()=>this.state.value,this.focus=()=>{var e;null==(e=this.input.current)||e.focus()},this.handleChange=e=>{this.setState({value:"true"===e})},this.handleSubmit=e=>{this.setState({value:"true"===e},(()=>{this.props.stopEditing()}))},this.state={value:!!e.initialValue}}render(){const{value:e}=this.state;return b.createElement(Jl,{ref:this.input,dataCy:"input--boolean",className:Yl,value:null==e?"":String(e),suggestions:["true","false"],onChange:this.handleChange,onSubmit:this.handleSubmit})}}var Kl=_(Wl);var Gl="_itemContainer_1k9ef_1",Ql="_itemDropdown_1k9ef_5";class Xl extends b.PureComponent{constructor(e){var t;super(e),this.items=[],this.draggedItem=null,this.getValue=()=>this.state.value,this.focus=()=>{var e;const{value:t}=this.state;t&&(null==(e=this.items[Math.max(t.length-1,0)].current)||e.focus())},this.handleChangeItem=(e,t)=>{const{value:s}=this.state;if(!Array.isArray(s))throw B({path:"BooleanListInput.handleChangeItem",message:"Invalid value",context:{value:s,changedItem:e}});const i=[...s];return i.splice(t,1,"true"===e.id),this.setState({value:i})},this.handleChangeNewItem=e=>{this.setState({newItem:e},(()=>setTimeout((()=>this.handleAddNewItem()),0)))},this.handleAddNewItem=()=>{const{value:e,newItem:t}=this.state;if(t){if(!Array.isArray(e))throw B({path:"BooleanListInput.handleAddNewItem",message:"Invalid value",context:{value:e,newItem:t}});this.items.push(b.createRef()),this.setState({value:[...e,"true"===t.id],newItem:null},(()=>{var e,t,s;null==(t=null==(e=this.items[this.items.length-2])?void 0:e.current)||t.focus(),null==(s=this.items[this.items.length-2].current)||s.scrollIntoView(!1)}))}},this.handleRemoveItem=e=>{const{value:t}=this.state;if(!Array.isArray(t))throw B({path:"BooleanListInput.handleRemoveClick",message:"Invalid Value",context:{value:t,idx:e}});this.items.splice(e,1);const s=[...t];s.splice(e,1),setTimeout((()=>this.setState({value:s})),0)},this.handleDragStart=e=>{this.draggedItem=this.items[e]},this.handleDragOver=(e,t)=>{t.preventDefault(),this.setState({draggedOverIdx:e})},this.handleDragEnd=e=>{var t,s;if(!this.draggedItem)return;const i=null!=(t=this.state.value)?t:[];if(!Array.isArray(i))throw B({path:"BooleanListInput.HandleDragEnd",message:"Invalid value",context:{value:i,idx:e}});const a=String(null==(s=this.draggedItem.current)?void 0:s.value),n=[...i];this.items.splice(e,1),n.splice(e,1),this.state.draggedOverIdx>e?(this.items.splice(this.state.draggedOverIdx-1,0,this.draggedItem),n.splice(this.state.draggedOverIdx-1,0,"true"===a)):(this.items.splice(this.state.draggedOverIdx,0,this.draggedItem),n.splice(this.state.draggedOverIdx,0,"true"===a)),this.draggedItem=null,this.setState({value:n,draggedOverIdx:-1})};const{initialValue:s}=e;if(!Array.isArray(s))throw B({path:"BooleanListInput.constructor",message:"Invalid initialValue",context:{initialValue:s}});this.state={value:s,newItem:null,draggedOverIdx:-1},this.items=Array.from({length:Math.max(null!=(t=null==s?void 0:s.length)?t:0,1)}).map((()=>b.createRef())),this.items.push(b.createRef())}render(){const{value:e}=this.state;if(!Array.isArray(e))throw B({path:"BooleanListInput.render",message:"Invalid value",context:{value:e}});return b.createElement(b.Fragment,null,b.createElement("div",{"data-cy":"input--boolean-list",className:vl},b.createElement("input",{type:"text",className:yl,value:JSON.stringify(e),readOnly:!0}),b.createElement("ul",{className:S(Il,Gl,"ag-theme-dark")},b.createElement("div",{className:Cl},b.createElement("div",{className:S(xl,{[Nl]:0===this.state.draggedOverIdx})}),e.map(((e,t)=>b.createElement(b.Fragment,{key:t},b.createElement(eo,{innerRef:this.items[t],suggestions:[{id:"true",label:"true"},{id:"false",label:"false"}],value:{id:String(e),label:String(e)},invalid:!0!==e&&!1!==e,onChange:e=>this.handleChangeItem(e,t),onRemove:this.handleRemoveItem.bind(this,t),onDragStart:this.handleDragStart.bind(this,t),onDragEnd:this.handleDragEnd.bind(this,t),onDragOver:this.handleDragOver.bind(this,t)}),b.createElement("div",{className:S(xl,{[Nl]:this.state.draggedOverIdx===t+1})}))))),b.createElement(eo,{key:e.length,innerRef:this.items[e.length],suggestions:[{id:"",label:""},{id:"true",label:"true"},{id:"false",label:"false"}],value:{id:"",label:""},invalid:!1,onChange:e=>this.handleChangeNewItem(e),onAdd:this.handleAddNewItem,onDragOver:this.handleDragOver.bind(this,e.length)}))))}}class eo extends b.Component{render(){return b.createElement("li",{className:S(wl,{[El]:this.props.invalid}),onDragOver:this.props.onDragOver||void 0},this.props.onDragStart&&this.props.onDragEnd&&b.createElement(gl,{className:bl,onDragStart:this.props.onDragStart,onDragEnd:this.props.onDragEnd},b.createElement(fl,null)),b.createElement(Hn,{innerRef:this.props.innerRef,"data-cy":"input",className:Ql,type:"text",nativeSelect:!0,items:this.props.suggestions,selectedItem:this.props.value,onSelect:e=>this.props.onChange(e)}),this.props.onAdd&&b.createElement(ha,{"data-cy":"input--boolean-list__add-btn",onClick:this.props.onAdd,className:Sl},"Add"),this.props.onRemove&&b.createElement(ha,{"data-cy":"input--boolean-list__remove-btn",onClick:e=>{var t,s;return null==(s=(t=this.props).onRemove)?void 0:s.call(t,e)},className:_l},b.createElement(Da,null)))}}var to=_(Xl);class so extends b.PureComponent{constructor(e){super(e),this.input=b.createRef(),this.getValue=()=>{const{value:e}=this.state;if(!e)return e;try{return new Date(e).toISOString()}catch(t){return e}},this.focus=()=>{var e;null==(e=this.input.current)||e.focus()},this.handleChange=e=>{const{field:t}=this.props,s=e.currentTarget.value;t.isRequired||""!==s?this.setState({value:s}):this.setState({value:null})};const{initialValue:t}=e,s=null==t?null:t;this.state={value:s}}render(){const{value:e}=this.state;return b.createElement("input",{"data-cy":"input--datetime",ref:this.input,className:cl,type:"text",value:null==e?"":String(e),placeholder:"null",onChange:this.handleChange})}}var io=_(so);var ao="_input_c6cnd_1";class no extends b.PureComponent{constructor(e){var t;super(e),this.input=b.createRef(),this.getValue=()=>this.state.value,this.focus=()=>{var e;null==(e=this.input.current)||e.focus()},this.handleChange=(e=!1)=>{var t;const{api:s,field:i}=this.props,a=(null==(t=this.input.current)?void 0:t.innerText)||"";if(!i.isRequired&&""===a)return this.setState({value:null});try{const t=JSON.parse(a);if(i.isList&&!Array.isArray(t))throw new Error;return this.setState({value:t},(()=>e&&(null==s?void 0:s.stopEditing())))}catch(n){return this.setState({value:a},(()=>e&&(null==s?void 0:s.stopEditing())))}},this.state={value:null!=(t=e.initialValue)?t:null}}render(){const{initialValue:e}=this.props;return b.createElement(b.Fragment,null,b.createElement("div",{"data-cy":"input--json",ref:this.input,contentEditable:!0,className:ao,dangerouslySetInnerHTML:{__html:"string"==typeof e?e:JSON.stringify(e)},onInput:e=>this.handleChange()}),b.createElement(ma,{keys:"enter",target:this.input,preventDefault:!1,onMatch:()=>this.handleChange()}),b.createElement(ma,{keys:"cmd+enter",target:this.input,onMatch:()=>this.handleChange(!0)}))}}var ro=_(no);class lo extends b.PureComponent{constructor(e){super(e),this.items=[],this.draggedItem=null,this.getValue=()=>this.state.value,this.focus=()=>{var e;const{value:t}=this.state;t&&(null==(e=this.items[Math.max(t.length,0)].current)||e.focus())},this.handleChange=e=>{try{const t=JSON.parse(e.currentTarget.value);Array.isArray(t)&&this.setState({value:t.map((e=>String(e)))})}catch(t){}},this.handleChangeItem=(e,t)=>{var s;const{value:i}=this.state;if(!Array.isArray(i))throw B({path:"JsonListInput.handleChangeItem",message:"Invalid value",context:{value:i,idx:e}});let a=null!=(s=t.currentTarget.value)?s:"";try{a=JSON.parse(a)}catch(r){}const n=[...i];return n.splice(e,1,a),this.setState({value:n})},this.handleChangeNewItem=e=>{var t;let s=null!=(t=e.currentTarget.value)?t:"";try{s=JSON.parse(s)}catch(i){}this.setState({newItem:s})},this.handleAddNewItem=()=>{const{value:e,newItem:t}=this.state;if(!Array.isArray(e))throw B({path:"JsonListInput.handleAddItem",message:"Invalid value",context:{value:e,newItem:t}});this.items.push(b.createRef()),this.setState({value:[...e,t||""],newItem:null},(()=>{var e,t;null==(e=this.items[this.items.length-1].current)||e.focus(),null==(t=this.items[this.items.length-2].current)||t.scrollIntoView(!1)}))},this.handleEnterKeydown=e=>{const{value:t}=this.state;if(!Array.isArray(t))throw B({path:"JsonListInput.handleEnterKeydown",message:"Invalid value",context:{value:t,idx:e}});let s=[...t];s.splice(e+1,0,""),this.items.push(b.createRef()),this.setState({value:s,newItem:null},(()=>{var t,s,i;null==(t=this.items[e+1].current)||t.focus(),null==(s=this.items[e+1].current)||s.scrollIntoView(!1),null==(i=this.items[e+1].current)||i.scrollIntoView({block:"nearest"})}))},this.handleRemoveItem=e=>{var t,s,i,a;const{value:n}=this.state;if(!Array.isArray(n))throw B({path:"JsonListInput.handleRemoveClick",message:"Invalid Value",context:{value:n,idx:e}});const r=[...n];r.splice(e,1),this.items.splice(e,1),null==(s=null==(t=this.items[e-1])?void 0:t.current)||s.focus(),null==(a=null==(i=this.items[e-1])?void 0:i.current)||a.scrollIntoView(),setTimeout((()=>this.setState({value:r})),0)},this.handleTabKeydown=(e,t)=>{var s;const{value:i}=this.state;if(!Array.isArray(i))throw B({path:"JsonListInput.handleTabKeydown",message:"Invalid value",context:{value:i,idx:e}});e===i.length||(t.preventDefault(),t.stopPropagation(),null==(s=this.items[e+1].current)||s.focus())},this.handleShiftTabKeydown=(e,t)=>{var s;0===e||(t.preventDefault(),t.stopPropagation(),null==(s=this.items[e-1].current)||s.focus())},this.handleFinishEditing=()=>{this.props.stopEditing()},this.handleDragStart=e=>{this.draggedItem=this.items[e]},this.handleDragOver=(e,t)=>{t.preventDefault(),this.setState({draggedOverIdx:e})},this.handleDragEnd=e=>{var t,s;if(!this.draggedItem)return;const{value:i=[]}=this.state;if(!Array.isArray(i))throw B({path:"JsonListInput.HandleDragEnd",message:"Invalid value",context:{value:i,idx:e}});let a=null!=(s=null==(t=this.draggedItem.current)?void 0:t.value)?s:"";const n=[...i];try{a=JSON.parse(a)}catch(r){}this.items.splice(e,1),n.splice(e,1),this.state.draggedOverIdx>e?(this.items.splice(this.state.draggedOverIdx-1,0,this.draggedItem),n.splice(this.state.draggedOverIdx-1,0,a)):(this.items.splice(this.state.draggedOverIdx,0,this.draggedItem),n.splice(this.state.draggedOverIdx,0,a)),this.draggedItem=null,this.setState({value:n,draggedOverIdx:-1})};const{initialValue:t}=e;if(!Array.isArray(t))throw B({path:"JsonListInput.constructor",message:"Invalid initialValue",context:{initialValue:t}});this.state={value:t,newItem:null,draggedOverIdx:-1},this.items=Array.from({length:Math.max(t.length,1)}).map((()=>b.createRef())),this.items.push(b.createRef())}render(){const{value:e,newItem:t}=this.state;if(!Array.isArray(e))throw B({path:"JsonListInput.render",message:"Invalid value",context:{value:e}});return b.createElement(b.Fragment,null,b.createElement("div",{"data-cy":"input--json-list",className:vl},b.createElement("input",{type:"text",className:yl,value:JSON.stringify(e),onChange:this.handleChange}),b.createElement("ul",{className:S(Il,"ag-theme-dark")},b.createElement("div",{className:Cl},b.createElement("div",{className:S(xl,{[Nl]:0===this.state.draggedOverIdx})}),e.map(((e,t)=>b.createElement(b.Fragment,{key:t},b.createElement(oo,{innerRef:this.items[t],value:e,invalid:"string"==typeof e,onChange:this.handleChangeItem.bind(this,t),onRemove:this.handleRemoveItem.bind(this,t),onEnter:this.handleEnterKeydown.bind(this,t),onTab:this.handleTabKeydown.bind(this,t),onShiftTab:this.handleShiftTabKeydown.bind(this,t),onModEnter:this.handleFinishEditing.bind(this,t),onDragStart:this.handleDragStart.bind(this,t),onDragEnd:this.handleDragEnd.bind(this,t),onDragOver:this.handleDragOver.bind(this,t)}),b.createElement("div",{className:S(xl,{[Nl]:this.state.draggedOverIdx===t+1})}))))),b.createElement(oo,{innerRef:this.items[e.length],value:t,invalid:!1,onChange:this.handleChangeNewItem,onAdd:this.handleAddNewItem,onEnter:this.handleAddNewItem,onShiftTab:this.handleShiftTabKeydown.bind(this,e.length),onDragOver:this.handleDragOver.bind(this,e.length)}))))}}class oo extends b.Component{render(){return b.createElement("li",{className:S(wl,{[El]:this.props.invalid}),onDragOver:this.props.onDragOver},this.props.onDragStart&&this.props.onDragEnd&&b.createElement(gl,{className:bl,onDragStart:this.props.onDragStart,onDragEnd:this.props.onDragEnd},b.createElement(fl,null)),b.createElement("input",{ref:this.props.innerRef,className:yl,type:"text",value:null===this.props.value?"":"string"==typeof this.props.value?this.props.value:JSON.stringify(this.props.value),tabIndex:this.props.tabIndex,onChange:this.props.onChange}),this.props.onAdd&&b.createElement(ha,{"data-cy":"input--json-list__add-btn",onClick:this.props.onAdd,className:Sl},"Add"),this.props.onRemove&&b.createElement(ha,{"data-cy":"input--json-list__remove-btn",onClick:e=>{var t,s;return null==(s=(t=this.props).onRemove)?void 0:s.call(t,e)},className:_l},b.createElement(Da,null)),this.props.onEnter&&b.createElement(ma,{keys:"enter",target:this.props.innerRef,onMatch:this.props.onEnter}),this.props.onTab&&b.createElement(ma,{keys:["tab"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onTab}),this.props.onShiftTab&&b.createElement(ma,{keys:["shift+tab"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onShiftTab}),this.props.onModEnter&&b.createElement(ma,{keys:["mod+enter"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onModEnter}))}}var co=_(lo);class ho extends b.PureComponent{constructor(e){super(e),this.input=b.createRef(),this.getValue=()=>this.state.value?st.from(this.state.value,"base64"):null,this.focus=()=>{var e;null==(e=this.input.current)||e.focus()},this.handleChange=e=>{const{field:t}=this.props,s=e.currentTarget.value;t.isRequired||""!==s?this.setState({value:s}):this.setState({value:null})};const{initialValue:t}=e,s=null==t?null:(e.initialValue instanceof Uint8Array?st.from(e.initialValue):e.initialValue||st.from("")).toString("base64");this.state={value:s}}render(){const{value:e}=this.state;return b.createElement("input",{"data-cy":"input--bytes",ref:this.input,className:cl,type:"text",value:null==e?"":e,placeholder:"null",onChange:this.handleChange})}}var po=_(ho);class uo extends b.PureComponent{constructor(e){super(e),this.items=[],this.draggedItem=null,this.getValue=()=>{var e;return null==(e=this.state.value)?void 0:e.map((e=>st.from(e||"","base64")))},this.focus=()=>{var e;const{value:t}=this.state;t&&(null==(e=this.items[Math.max(t.length,0)].current)||e.focus())},this.handleChange=e=>{try{const t=JSON.parse(e.currentTarget.value);Array.isArray(t)&&this.setState({value:t})}catch(t){}},this.handleChangeItem=(e,t)=>{const{value:s}=this.state,i=t.currentTarget.value;if(!Array.isArray(s))throw B({path:"BytesListInput.handleChangeItem",message:"Invalid value",context:{value:s,idx:e,changedItem:i}});const a=[...s];return a.splice(e,1,i),this.setState({value:a})},this.handleChangeNewItem=e=>{const t=e.currentTarget.value;this.setState({newItem:t})},this.handleAddNewItem=()=>{const{value:e,newItem:t}=this.state;if(!Array.isArray(e))throw B({path:"BytesListInput.handleAddItem",message:"Invalid value",context:{value:e,newItem:t}});this.items.push(b.createRef()),this.setState({value:[...e,t],newItem:null},(()=>{var e,t;null==(e=this.items[this.items.length-1].current)||e.focus(),null==(t=this.items[this.items.length-2].current)||t.scrollIntoView(!1)}))},this.handleEnterKeydown=e=>{const{value:t}=this.state;if(!Array.isArray(t))throw B({path:"BytesListInput.handleEnterKeydown",message:"Invalid value",context:{value:t,idx:e}});let s=[...t];s.splice(e+1,0,""),this.items.push(b.createRef()),this.setState({value:s,newItem:null},(()=>{var t,s,i;null==(t=this.items[e+1].current)||t.focus(),null==(s=this.items[e+1].current)||s.scrollIntoView(!1),null==(i=this.items[e+1].current)||i.scrollIntoView({block:"nearest"})}))},this.handleRemoveItem=(e,t)=>{var s,i,a,n;const{value:r}=this.state;if(t.preventDefault(),t.stopPropagation(),!Array.isArray(r))throw B({path:"BytesListInput.handleRemoveClick",message:"Invalid Value",context:{value:r,idx:e}});const l=[...r];l.splice(e,1),this.items.splice(e,1),null==(i=null==(s=this.items[e-1])?void 0:s.current)||i.focus(),null==(n=null==(a=this.items[e-1])?void 0:a.current)||n.scrollIntoView(),setTimeout((()=>this.setState({value:l})),0)},this.handleTabKeydown=(e,t)=>{var s;const{value:i}=this.state;if(!Array.isArray(i))throw B({path:"BytesListInput.handleTabKeydown",message:"Invalid value",context:{value:i,idx:e}});e===i.length||(t.preventDefault(),t.stopPropagation(),null==(s=this.items[e+1].current)||s.focus())},this.handleShiftTabKeydown=(e,t)=>{var s;0===e||(t.preventDefault(),t.stopPropagation(),null==(s=this.items[e-1].current)||s.focus())},this.handleFinishEditing=()=>{this.props.stopEditing()},this.handleDragStart=e=>{this.draggedItem=this.items[e]},this.handleDragOver=(e,t)=>{t.preventDefault(),this.setState({draggedOverIdx:e})},this.handleDragEnd=e=>{var t;if(!this.draggedItem)return;const{value:s=[]}=this.state;if(!Array.isArray(s))throw B({path:"BytesListInput.HandleDragEnd",message:"Invalid value",context:{value:s,idx:e}});const i=[...s],a=(null==(t=this.draggedItem.current)?void 0:t.value)||"";this.items.splice(e,1),i.splice(e,1),this.state.draggedOverIdx>e?(this.items.splice(this.state.draggedOverIdx-1,0,this.draggedItem),i.splice(this.state.draggedOverIdx-1,0,a)):(this.items.splice(this.state.draggedOverIdx,0,this.draggedItem),i.splice(this.state.draggedOverIdx,0,a)),this.draggedItem=null,this.setState({value:i,draggedOverIdx:-1})};const{initialValue:t}=e;if(!Array.isArray(t))throw B({path:"BytesListInput.constructor",message:"Invalid initialValue",context:{initialValue:t}});this.state={value:t.map((e=>(e instanceof Uint8Array?st.from(e):e).toString("base64"))),newItem:null,draggedOverIdx:-1},this.items=Array.from({length:Math.max(t.length,1)}).map((()=>b.createRef())),this.items.push(b.createRef())}render(){const{value:e}=this.state;if(!Array.isArray(e))throw B({path:"BytesListInput.render",message:"Invalid value",context:{value:e}});return b.createElement(b.Fragment,null,b.createElement("div",{"data-cy":"input--bytes-list",className:vl},b.createElement("input",{type:"text",className:yl,value:e.join(", "),onChange:this.handleChange}),b.createElement("ul",{className:S(Il,"ag-theme-dark")},b.createElement("div",{className:Cl},b.createElement("div",{className:S(xl,{[Nl]:0===this.state.draggedOverIdx})}),e.map(((e,t)=>b.createElement(b.Fragment,{key:t},b.createElement(mo,{innerRef:this.items[t],value:null===e?"":e,onChange:this.handleChangeItem.bind(this,t),onRemove:this.handleRemoveItem.bind(this,t),onEnter:this.handleEnterKeydown.bind(this,t),onTab:this.handleTabKeydown.bind(this,t),onShiftTab:this.handleShiftTabKeydown.bind(this,t),onModEnter:this.handleFinishEditing.bind(this,t),onDragStart:this.handleDragStart.bind(this,t),onDragEnd:this.handleDragEnd.bind(this,t),onDragOver:this.handleDragOver.bind(this,t)}),b.createElement("div",{className:S(xl,{[Nl]:this.state.draggedOverIdx===t+1})}))))),b.createElement(mo,{innerRef:this.items[e.length],value:this.state.newItem||"",onChange:this.handleChangeNewItem,onAdd:this.handleAddNewItem,onEnter:this.handleAddNewItem,onShiftTab:this.handleShiftTabKeydown.bind(this,e.length),onDragOver:this.handleDragOver.bind(this,e.length)}))))}}class mo extends b.Component{render(){return b.createElement("li",{className:wl,onDragOver:this.props.onDragOver},this.props.onDragStart&&this.props.onDragEnd&&b.createElement(gl,{className:bl,onDragStart:this.props.onDragStart,onDragEnd:this.props.onDragEnd},b.createElement(fl,null)),b.createElement("input",{ref:this.props.innerRef,className:yl,type:"text",value:this.props.value,tabIndex:this.props.tabIndex,onChange:this.props.onChange}),this.props.onAdd&&b.createElement(ha,{"data-cy":"input--bytes-list__add-btn",onClick:this.props.onAdd,className:Sl},"Add"),this.props.onRemove&&b.createElement(ha,{"data-cy":"input--bytes-list__remove-btn",onClick:this.props.onRemove,className:_l},b.createElement(Da,null)),this.props.onEnter&&b.createElement(ma,{keys:"enter",target:this.props.innerRef,onMatch:this.props.onEnter}),this.props.onTab&&b.createElement(ma,{keys:["tab"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onTab}),this.props.onShiftTab&&b.createElement(ma,{keys:["shift+tab"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onShiftTab}),this.props.onModEnter&&b.createElement(ma,{keys:["mod+enter"],preventDefault:!1,stopPropagation:!1,target:this.props.innerRef,onMatch:this.props.onModEnter}))}}var go=_(uo);class fo extends b.PureComponent{constructor(e){var t;super(e),this.input=b.createRef(),this.getValue=()=>this.state.value,this.focus=()=>{var e;null==(e=this.input.current)||e.focus()},this.handleChange=e=>{this.setState({value:e})},this.handleSubmit=e=>{this.setState({value:e},(()=>{this.props.stopEditing()}))},this.state={value:null!=(t=e.initialValue)?t:null}}render(){const{value:e}=this.state,{field:t}=this.props;return b.createElement(Jl,{ref:this.input,dataCy:"input--enum",className:Yl,value:null==e?"":String(e),suggestions:t.typeAsEnum.values,onChange:this.handleChange,onSubmit:this.handleSubmit})}}var vo=_(fo);class yo extends b.PureComponent{constructor(e){super(e),this.items=[],this.draggedItem=null,this.getValue=()=>this.state.value,this.focus=()=>{var e;const{value:t}=this.state;t&&(null==(e=this.items[Math.max(t.length-1,0)].current)||e.focus())},this.handleChangeItem=(e,t)=>{const{value:s}=this.state,i=String(e.id);if(!Array.isArray(s))throw B({path:"EnumListInput.handleChangeItem",message:"Invalid value",context:{value:s,changedItem:i}});const a=[...s];return a.splice(t,1,i),this.setState({value:a})},this.handleChangeNewItem=e=>{this.setState({newItem:e},(()=>setTimeout((()=>this.handleAddNewItem()),0)))},this.handleAddNewItem=()=>{const{value:e,newItem:t}=this.state;if(t){if(!Array.isArray(e))throw B({path:"EnumListInput.handleAddNewItem",message:"Invalid value",context:{value:e,newItem:t}});this.items.push(b.createRef()),this.setState({value:[...e,String(t.id)],newItem:null},(()=>{var e,t,s;null==(t=null==(e=this.items[this.items.length-2])?void 0:e.current)||t.focus(),null==(s=this.items[this.items.length-2].current)||s.scrollIntoView(!1)}))}},this.handleRemoveItem=e=>{var t,s,i,a;const{value:n}=this.state;if(!Array.isArray(n))throw B({path:"EnumListInput.handleRemoveClick",message:"Invalid Value",context:{value:n,idx:e}});this.items.splice(e,1);const r=[...n];r.splice(e,1),null==(s=null==(t=this.items[e-1])?void 0:t.current)||s.focus(),null==(a=null==(i=this.items[e-1])?void 0:i.current)||a.scrollIntoView(),setTimeout((()=>this.setState({value:r})),0)},this.handleDragStart=e=>{this.draggedItem=this.items[e]},this.handleDragOver=(e,t)=>{t.preventDefault(),this.setState({draggedOverIdx:e})},this.handleDragEnd=e=>{var t;if(!this.draggedItem)return;const{value:s=[]}=this.state;if(!Array.isArray(s))throw B({path:"EnumListInput.HandleDragEnd",message:"Invalid value",context:{value:s,idx:e}});const i=String(null==(t=this.draggedItem.current)?void 0:t.value),a=[...s];this.items.splice(e,1),a.splice(e,1),this.state.draggedOverIdx>e?(this.items.splice(this.state.draggedOverIdx-1,0,this.draggedItem),a.splice(this.state.draggedOverIdx-1,0,i)):(this.items.splice(this.state.draggedOverIdx,0,this.draggedItem),a.splice(this.state.draggedOverIdx,0,i)),this.draggedItem=null,this.setState({value:a,draggedOverIdx:-1})};const{initialValue:t}=e;if(!Array.isArray(t))throw B({path:"EnumListInput.constructor",message:"Invalid initialValue",context:{initialValue:t}});this.state={value:t,newItem:null,draggedOverIdx:-1},this.items=Array.from({length:Math.max(t.length,1)}).map((()=>b.createRef())),this.items.push(b.createRef())}render(){const{value:e}=this.state,{field:t}=this.props;if(!Array.isArray(e))throw B({path:"EnumListInput.render",message:"Invalid value",context:{value:e}});return b.createElement(b.Fragment,null,b.createElement("div",{"data-cy":"input--enum-list",className:vl},b.createElement("input",{type:"text",className:yl,value:JSON.stringify(e),readOnly:!0}),b.createElement("ul",{className:S(Il,Gl,"ag-theme-dark")},b.createElement("div",{className:Cl},b.createElement("div",{className:S(xl,{[Nl]:0===this.state.draggedOverIdx})}),e.map(((e,s)=>b.createElement(b.Fragment,{key:s},b.createElement(Io,{innerRef:this.items[s],suggestions:t.typeAsEnum.values.map((e=>({id:e,label:e}))),value:{id:String(e),label:String(e)},onChange:e=>this.handleChangeItem(e,s),onRemove:this.handleRemoveItem.bind(this,s),onDragStart:this.handleDragStart.bind(this,s),onDragEnd:this.handleDragEnd.bind(this,s),onDragOver:this.handleDragOver.bind(this,s)}),b.createElement("div",{className:S(xl,{[Nl]:this.state.draggedOverIdx===s+1})}))))),b.createElement(Io,{key:e.length,innerRef:this.items[e.length],suggestions:[{id:"",label:""},...t.typeAsEnum.values.map((e=>({id:e,label:e})))],value:{id:"",label:""},onChange:e=>this.handleChangeNewItem(e),onAdd:this.handleAddNewItem.bind(this),onDragOver:this.handleDragOver.bind(this,e.length)}))))}}class Io extends b.Component{render(){return b.createElement("li",{className:wl,onDragOver:this.props.onDragOver||void 0},this.props.onDragStart&&this.props.onDragEnd&&b.createElement(gl,{className:bl,onDragStart:this.props.onDragStart,onDragEnd:this.props.onDragEnd},b.createElement(fl,null)),b.createElement(Hn,{innerRef:this.props.innerRef,"data-cy":"input",className:Ql,type:"text",nativeSelect:!0,items:this.props.suggestions,selectedItem:this.props.value,onSelect:e=>this.props.onChange(e)}),this.props.onAdd&&b.createElement(ha,{"data-cy":"input--enum-list__add-btn",onClick:this.props.onAdd,className:Sl},"Add"),this.props.onRemove&&b.createElement(ha,{"data-cy":"input--enum-list__remove-btn",onClick:e=>{var t,s;return null==(s=(t=this.props).onRemove)?void 0:s.call(t,e)},className:_l},b.createElement(Da,null)))}}var Co=_(yo);var wo="_container_dd10p_1",Eo="_title_dd10p_11",bo="_input_dd10p_16",_o="_inputPlaceholder_dd10p_32";class So extends b.Component{constructor(e){super(e),this.handleChangeSearch=e=>{const{field:t,script:s}=this.props,i=Object.values(s.where.values).find((e=>l.last(e.fieldIds)===t.id));if(!i)throw B({path:"TableCellHeaderWithSearch.handleChangeSearch",message:"Unable to find script `where` to update",context:{field:t.serialize(),script:s.serialize(),where:s.where.values}});i.update({enabled:!0,value:e.currentTarget.value}),this.handleSearchDebounced()},this.handleSearch=async()=>{this.props.onSearch()},this.handleSearchDebounced=l.debounce(this.handleSearch,500,{leading:!1,trailing:!0})}render(){var e,t;const{script:s,field:i}=this.props,a=Object.values(s.where.values).find((e=>l.last(e.fieldIds)===i.id));return b.createElement("div",{"data-cy":"header-field-search",className:wo},b.createElement("div",{className:Eo},i.name),a&&((null==(e=l.last(a.fields))?void 0:e.isScalar)||(null==(t=l.last(a.fields))?void 0:t.isEnum))?b.createElement("input",{className:bo,type:"text",placeholder:`search ${i.name}...`,value:a.value||"",onChange:this.handleChangeSearch}):b.createElement("div",{className:_o}))}}var xo=_(So);var No="_container_1o4a8_1",Mo="_table_1o4a8_11",Lo="_footer_1o4a8_23",Ro="_footerBtn_1o4a8_30",Ao="_disabled_1o4a8_39";class Oo extends b.Component{constructor(e){var t;if(super(e),this.container=b.createRef(),this.table=b.createRef(),this.getValue=()=>this.state.value,this.focus=()=>{},this.afterGuiAttached=async()=>{if(!this.container.current||!this.table.current)return;const{api:e,node:t,getTableDimensions:s}=this.props;if(!e)return;const i=s(),a=this.container.current.getBoundingClientRect(),n=t.rowHeight-Jo;this.table.current.style.height=`${n}px`,this.table.current.style.width=i.width-32-20+"px",this.table.current.style.left=i.left-a.left+32+10+"px"},this.handleGridReady=async e=>{const{value:t}=this.state,{field:s}=this.props;this.gridApi=e.api,await this.loadedScript.run();const i=t?Me(s.typeAsModel.id,t):null,a=Vs.get(i);this.gridApi.setRowData([...a?[a]:[],...this.loadedScript.records.filter((e=>e.id!==i))]),this.selectConnectedRecords()},this.handleScroll=async e=>{const{node:t}=this.props;if(this.gridApi.stopEditing(),"horizontal"===e.direction)return;if(this.loadedScript.recordIds.length>=(this.loadedScript.model.count||0))return;const s=t.rowHeight-Jo,i=this.loadedScript.pagination.take;!this.loadedScript.running&&e.top+s>=Jo*(i-20)&&(this.gridApi.applyTransaction({add:await this.loadedScript.loadMore()}),this.selectConnectedRecords())},this.selectConnectedRecords=async()=>{var e;const{value:t}=this.state,{field:s}=this.props;if(null===t)return;const i=Me(s.typeAsModel.id,t);null==(e=this.gridApi.getRowNode(i))||e.setSelected(!0,!0,!0)},this.handleSelectionChanged=e=>{var t;const{value:s}=this.state,{field:i}=this.props,a=s&&Me(i.typeAsModel.id,s),n=e.api.getSelectedNodes().map((e=>e.id))[0]||null;n?a!==n&&(null==(t=this.gridApi.getRowNode(n))||t.setSelected(!0,!0),this.setState({value:Vs.get(n).value})):this.setState({value:null})},this.handleSearch=async()=>{const{value:e}=this.state,{field:t}=this.props;await this.loadedScript.run();if(!!Object.values(this.loadedScript.where.values).find((e=>null!==e.value&&""!==e.value)))this.gridApi.setRowData(this.loadedScript.records);else{const s=e?Me(t.typeAsModel.id,e):null;this.gridApi.setRowData([...e?[Vs.get(s)]:[],...this.loadedScript.records.filter((e=>e.id!==s))])}this.selectConnectedRecords()},this.handleClickRelation=()=>{var e;null==(e=this.props.api)||e.stopEditing()},this.handleRowDoubleClicked=e=>{this.handleSelectionChanged(e),this.props.stopEditing()},this.handleViewConnections=()=>{const{field:e}=this.props,{value:t}=this.state;if(null===t)return;if(!e.typeAsModel)return;const s=e.typeAsModel,i=t?Me(e.typeAsModel.id,t):null,a=Vs.get(i);if(!a)return;const n=gi.add({modelId:s.id,preview:!1});s.uniqueIdentifiers.map((e=>{n.session.script.where.add({fieldIds:[e.id],operation:"equals",value:a.value[e.name]})})),gi.switch({id:n.id})},!e.field.typeAsModel)throw B({path:"RelationInput.constructor",message:"Invalid field.typeAsModel",context:{field:e.field.serialize()}});this.state={value:null!=(t=e.initialValue)?t:null},this.loadedScript=ri.add({name:null,frozen:!0,modelId:e.field.typeAsModel.id,fieldIds:e.field.typeAsModel.fieldIds},{skipPersist:!0}),this.loadedScript.fields.forEach((e=>{e.isScalar&&this.loadedScript.where.add({fieldIds:[e.id],operation:e.isInt||e.isFloat||e.isDecimal?"equals":"contains",value:null})}))}componentWillUnmount(){var e,t;null==(e=this.props.api)||e.resetRowHeights(),null==(t=this.props.api)||t.onRowHeightChanged()}render(){const{value:e}=this.state,{field:t}=this.props,s=t.typeAsModel.fields;return b.createElement(b.Fragment,null,b.createElement("div",{ref:this.container,className:No},b.createElement(il,{type:t.type,isNull:!e,isPressed:!0,onClick:this.handleClickRelation})),b.createElement("div",{"data-cy":"input--relation",ref:this.table,className:S(Mo,"ag-theme-relations")},b.createElement(M,{rowSelection:"single",getRowNodeId:e=>e.id,suppressCellSelection:!0,headerHeight:64,frameworkComponents:{TableCellRenderer:dl,TableCellHeaderWithSearch:xo,TableEmptyOverlay:jr},onGridReady:this.handleGridReady,onBodyScroll:this.handleScroll,onSelectionChanged:this.handleSelectionChanged,noRowsOverlayComponent:"TableEmptyOverlay"},b.createElement(L,{colId:"checkbox",headerName:"",editable:!1,resizable:!1,sortable:!1,pinned:!0,suppressNavigable:!0,suppressMovable:!0,maxWidth:32,checkboxSelection:!0}),s.map((e=>b.createElement(L,{key:e.id,editable:!1,resizable:!1,sortable:!1,suppressMovable:!0,headerComponent:"TableCellHeaderWithSearch",headerComponentParams:{field:e,script:this.loadedScript,onSearch:this.handleSearch},cellRenderer:"TableCellRenderer",cellRendererParams:{field:e}})))),b.createElement("div",{className:Lo},b.createElement("button",{"data-cy":"open-in-new-tab",className:S(Ro,{[Ao]:null===e}),onClick:this.handleViewConnections},"Open in new tab"))))}}var Do=_(Oo);class ko extends b.Component{constructor(e){if(super(e),this.container=b.createRef(),this.table=b.createRef(),this.getValue=()=>this.state.value,this.focus=()=>{},this.afterGuiAttached=async()=>{if(!this.container.current||!this.table.current)return;const{api:e,node:t,getTableDimensions:s}=this.props;if(!e)return;const i=s(),a=this.container.current.getBoundingClientRect(),n=t.rowHeight-Jo;this.table.current.style.height=`${n}px`,this.table.current.style.width=i.width-32-20+"px",this.table.current.style.left=i.left-a.left+32+10+"px"},this.handleGridReady=async e=>{const{value:t=[]}=this.state,{field:s}=this.props;this.gridApi=e.api,await this.loadedScript.run();const i=t.map((e=>Me(s.typeAsModel.id,e)));this.gridApi.setRowData([...i.map((e=>Vs.get(e))),...this.loadedScript.records.filter((e=>!i.includes(e.id)))]),this.selectConnectedRecords()},this.handleScroll=async e=>{const{value:t=[]}=this.state,{node:s,field:i}=this.props;if("horizontal"===e.direction)return;if(this.loadedScript.recordIds.length>=(this.loadedScript.model.count||0))return;const a=!!Object.values(this.loadedScript.where.values).find((e=>{var t;return e.id!==(null==(t=this.whereFilterThatFetchesUnconnectedRecords)?void 0:t.id)&&null!==e.value&&""!==e.value})),n=s.rowHeight-Jo,r=(a?0:t.length)+this.loadedScript.pagination.take;if(!this.loadedScript.running&&e.top+n>=Jo*(r-20)){const e=await this.loadedScript.loadMore(),s=t.map((e=>Me(i.typeAsModel.id,e)));this.gridApi.applyTransaction({add:e.filter((e=>!s.includes(e.id)))}),this.selectConnectedRecords()}},this.selectConnectedRecords=async()=>{const{value:e=[]}=this.state,{field:t}=this.props,s=e.map((e=>Me(t.typeAsModel.id,e)));this.selectedRecordIds=[],this.gridApi.forEachNode((e=>{s.includes(e.id)&&(e.setSelected(!0,!1,!0),this.selectedRecordIds.push(e.id))}))},this.handleSelectionChanged=()=>{var e,t;const{value:s=[]}=this.state,{field:i}=this.props,a=s.map((e=>Me(i.typeAsModel.id,e))),n=this.selectedRecordIds,r=this.gridApi.getSelectedNodes().map((e=>e.id));if(l.isEqual(n,r))return;let o;if(n.length>r.length){const t=l.difference(n,r);this.selectedRecordIds=this.selectedRecordIds.filter((e=>e!==t[0])),null==(e=this.gridApi.getRowNode(t[0]))||e.setSelected(!1),o=a.filter((e=>e!==t[0]))}else{const e=l.difference(r,n);this.selectedRecordIds.push(e[0]),null==(t=this.gridApi.getRowNode(e[0]))||t.setSelected(!0),o=a.concat([e[0]])}this.setState({value:o.map((e=>Vs.get(e).value))})},this.handleClickRelation=()=>{var e;null==(e=this.props.api)||e.stopEditing()},this.handleSearch=async()=>{var e,t;const{value:s=[]}=this.state,{field:i}=this.props,a=!!Object.values(this.loadedScript.where.values).find((e=>{var t;return e.id!==(null==(t=this.whereFilterThatFetchesUnconnectedRecords)?void 0:t.id)&&null!==e.value&&""!==e.value}));if(a?null==(e=this.whereFilterThatFetchesUnconnectedRecords)||e.update({enabled:!1}):null==(t=this.whereFilterThatFetchesUnconnectedRecords)||t.update({enabled:!0}),await this.loadedScript.run(),a)this.gridApi.setRowData(this.loadedScript.records);else{const e=s.map((e=>Me(i.typeAsModel.id,e)));this.gridApi.setRowData([...e.map((e=>Vs.get(e))),...this.loadedScript.records.filter((t=>!e.includes(t.id)))])}this.selectConnectedRecords()},this.handleSkipToUnconnected=()=>{const{value:e=[]}=this.state,{field:t}=this.props,s=e.length-1;if(-1===s)return;if(!t.typeAsModel)return;const i=Vs.get(Me(t.typeAsModel.id,e[s]));if(!i)return;const a=this.gridApi.getRowNode(i.id);this.gridApi.ensureNodeVisible(a,"top")},this.handleViewConnections=()=>{const{field:e,node:t}=this.props,{value:s=[]}=this.state;if(0===s.length)return;if(!e.isRelation||!e.typeAsModel)return;const i=Vs.get(t.id);if(!i)return;const a=e.typeAsModel,n=a.fields.find((t=>t.isRelation&&t.relationName===e.relationName));if(!n)return;const r=i.model.uniqueIdentifiers[0],l=gi.add({modelId:a.id,preview:!1});l.session.script.where.add({fieldIds:[n.id,r.id],operation:"equals",value:String(i.value[r.name])}),gi.switch({id:l.id})},!e.field.typeAsModel)throw B({path:"RelationListInput.constructor",message:"Invalid field.typeAsModel",context:{field:e.field.serialize()}});const{initialValue:t}=e;this.state={value:null!=t?t:[]},this.loadedScript=ri.add({name:null,frozen:!0,modelId:e.field.typeAsModel.id,fieldIds:e.field.typeAsModel.fieldIds},{skipPersist:!0}),this.loadedScript.fields.forEach((e=>{e.isScalar&&this.loadedScript.where.add({fieldIds:[e.id],operation:e.isInt||e.isFloat||e.isDecimal?"equals":"contains",value:null})}));const s=e.field.typeAsModel,i=Vs.get(e.node.id),a=s.fields.find((t=>t.isRelation&&t.relationName===e.field.relationName));if(s&&i&&a&&i.isCommitted){const e=JSON.stringify(i.model.uniqueIdentifiers.reduce(((e,t)=>(e[t.name]=i.value[t.name],e)),{}));this.whereFilterThatFetchesUnconnectedRecords=this.loadedScript.where.add({fieldIds:[a.id],operation:"equals",value:a.isList?`{ none: ${e} }`:`{ NOT: ${e} }`})}else this.whereFilterThatFetchesUnconnectedRecords=null;this.selectedRecordIds=[]}componentWillUnmount(){var e,t;null==(e=this.props.api)||e.resetRowHeights(),null==(t=this.props.api)||t.onRowHeightChanged()}render(){const{value:e=[]}=this.state,{field:t}=this.props,s=t.typeAsModel.fields;return b.createElement(b.Fragment,null,b.createElement("div",{ref:this.container,className:No},b.createElement(il,{type:t.type,isList:!0,count:e.length,isNull:!1,isPressed:!0,onClick:this.handleClickRelation})),b.createElement("div",{"data-cy":"input--relation-list",ref:this.table,className:S(Mo,"ag-theme-relations")},b.createElement(M,{rowSelection:"multiple",getRowNodeId:e=>e.id,suppressCellSelection:!0,headerHeight:64,frameworkComponents:{TableCellRenderer:dl,TableCellHeaderWithSearch:xo,TableEmptyOverlay:jr},rowMultiSelectWithClick:!0,onGridReady:this.handleGridReady,onBodyScroll:this.handleScroll,onSelectionChanged:this.handleSelectionChanged,noRowsOverlayComponent:"TableEmptyOverlay"},b.createElement(L,{colId:"checkbox",headerName:"",editable:!1,resizable:!1,sortable:!1,pinned:!0,suppressNavigable:!0,maxWidth:32,checkboxSelection:!0}),s.map((e=>b.createElement(L,{key:e.id,editable:!1,resizable:!1,sortable:!1,suppressMovable:!0,headerComponent:"TableCellHeaderWithSearch",headerComponentParams:{field:e,script:this.loadedScript,onSearch:this.handleSearch},cellRenderer:"TableCellRenderer",cellRendererParams:{field:e}})))),b.createElement("div",{className:Lo},b.createElement("button",{"data-cy":"open-in-new-tab",className:S(Ro,{[Ao]:0===e.length}),onClick:this.handleViewConnections},"Open in new tab"),b.createElement("button",{className:Ro,onClick:this.handleSkipToUnconnected},"Skip to unconnected records"))))}}var To=_(ko);var Po="_container_1mf95_1",Vo="_invalid_1mf95_6",jo="_phantom_1mf95_10";class Zo extends b.Component{constructor(e){super(e),this.container=b.createRef(),this.input=b.createRef(),this.afterGuiAttached=()=>{var e,t,s;const{api:i,node:a,field:n,resizeRowForRelation:r}=this.props;this.stopEditingImmediately?null==i||i.stopEditing():(r(a,n),null==(t=null==(e=this.input.current)?void 0:e.afterGuiAttached)||t.call(e),null==(s=this.input.current)||s.focus())},this.getValue=()=>{var e,t;return null==(t=null==(e=this.input.current)?void 0:e.getValue)?void 0:t.call(e)},this.isPopup=()=>!0,this.handleClickOutside=e=>{var t,s;(null==(t=this.container.current)?void 0:t.contains(e.target))||null==(s=this.props.api)||s.stopEditing()};const{node:{data:t},field:s}=e,i=t;this.stopEditingImmediately=!1,8===e.keyPress||127===e.keyPress?(this.initialValue=s.lowestValidValue,this.stopEditingImmediately=!0):e.charPress?e.field.isScalar&&!e.field.isList&&(this.initialValue=e.charPress):this.initialValue=i.value[s.name]}componentDidMount(){document.addEventListener("click",this.handleClickOutside)}componentWillUnmount(){document.removeEventListener("click",this.handleClickOutside)}render(){var e,t;const{node:{data:s},columnApi:i,column:a,field:r}=this.props,l=s,o=null!=(t=null==(e=i.getColumnState().find((e=>e.colId===a.getColId())))?void 0:e.width)?t:200,d=l.invalidFields.find((e=>e.field.id===r.id));return b.createElement("div",{ref:this.container,className:S(Po,{[Vo]:!!d}),style:{width:o}},r.isString&&(r.isList?b.createElement(Rl,n(n({ref:this.input},this.props),{initialValue:this.initialValue})):b.createElement(pl,n(n({ref:this.input},this.props),{initialValue:this.initialValue}))),(r.isInt||r.isFloat||r.isDecimal)&&(r.isList?b.createElement(Tl,n(n({ref:this.input},this.props),{initialValue:this.initialValue})):b.createElement(Ol,n(n({ref:this.input},this.props),{initialValue:this.initialValue}))),r.isBigInt&&(r.isList?b.createElement(Bl,n(n({ref:this.input},this.props),{initialValue:this.initialValue})):b.createElement(Vl,n(n({ref:this.input},this.props),{initialValue:this.initialValue}))),r.isBoolean&&(r.isList?b.createElement(to,n(n({ref:this.input},this.props),{initialValue:this.initialValue})):b.createElement(Kl,n(n({ref:this.input},this.props),{initialValue:this.initialValue}))),r.isDateTime&&(r.isList?b.createElement(Rl,n(n({ref:this.input},this.props),{initialValue:this.initialValue})):b.createElement(io,n(n({ref:this.input},this.props),{initialValue:this.initialValue}))),r.isJson&&(r.isList?b.createElement(co,n(n({ref:this.input},this.props),{initialValue:this.initialValue})):b.createElement(ro,n(n({ref:this.input},this.props),{initialValue:this.initialValue}))),r.isBytes&&(r.isList?b.createElement(go,n(n({ref:this.input},this.props),{initialValue:this.initialValue})):b.createElement(po,n(n({ref:this.input},this.props),{initialValue:this.initialValue}))),r.isEnum&&(r.isList?b.createElement(Co,n(n({ref:this.input},this.props),{initialValue:this.initialValue})):b.createElement(vo,n(n({ref:this.input},this.props),{initialValue:this.initialValue}))),r.isRelation&&(r.isList?b.createElement(To,n(n({ref:this.input},this.props),{initialValue:this.initialValue})):b.createElement(Do,n(n({ref:this.input},this.props),{initialValue:this.initialValue}))),d&&b.createElement("div",{className:jo},d.reason))}}var Bo=_(Zo);var Fo="_container_vkm8u_1",Ho="_firstCommittedRow_vkm8u_5",qo="_tableCell_vkm8u_9",Uo="_dirty_vkm8u_9",zo="_invalid_vkm8u_13",$o="_empty_vkm8u_17";const Jo=32;class Yo extends b.Component{constructor(e){super(e),this.table=b.createRef(),this.recordOrder=new Map,this.reactionDisposers=[],this.focus=()=>{var e;null==(e=this.table.current)||e.focus()},this.refresh=()=>{this.loadGridDataDebounced()},this.selectRows=(e=[])=>{this.gridApi.deselectAll(),e.forEach((e=>{var t,s;null==(s=null==(t=this.gridApi)?void 0:t.getRowNode(e))||s.setSelected(!0)}))},this.deleteSelectedRows=()=>{var e;const t=null==(e=gi.activeTab)?void 0:e.sessionId;if(!t)return;this.gridApi.getSelectedNodes().map((e=>Vs.get(e.id))).filter((e=>!!e)).forEach((e=>Ms.add({type:"delete",recordId:e.id,sessionId:t,value:{}})))},this.getDimensions=()=>{var e;return null==(e=this.table.current)?void 0:e.getBoundingClientRect()},this.resizeRowForRelation=(e,t)=>{if(!t.typeAsModel)return!1;const s=this.getDimensions();if(!s)return;const i=2*Jo,a=64+(s.height-4*Jo-64-15-36)+15+36,n=64+i+15+36,r=64+Jo*(t.typeAsModel.count||0)+15+36,l=Math.min(Math.max(n,r),a);e.setRowHeight(Jo+l),this.gridApi.onRowHeightChanged(),this.gridApi.ensureNodeVisible(e,"top")},this.loadGridData=async()=>{var e;const t=null==(e=gi.activeTab)?void 0:e.session;t&&t.isScript&&(0!==t.script.model.count||0!==t.script.recordIds.length?(this.gridApi.showLoadingOverlay(),await t.script.run(),this.gridApi.hideOverlay()):this.gridApi.showNoRowsOverlay())},this.configureGridColumns=()=>{var e;const t=null==(e=gi.activeTab)?void 0:e.session;t&&t.isScript&&(this.gridApi.stopEditing(),this.gridApi.setColumnDefs([{colId:"checkbox",headerName:"",editable:!1,resizable:!1,sortable:!1,pinned:!0,suppressMovable:!0,maxWidth:32,checkboxSelection:!0,headerCheckboxSelection:!0},...t.script.model.fields.map((e=>({colId:e.id,headerName:e.name,editable:!0,resizable:!0,sortable:!0,hide:!t.script.fieldIds.includes(e.id),valueGetter:t=>t.data.value[e.name],valueSetter:t=>this.handleCellValueChanged(t,e),comparator:(e,t,s,i,a)=>(this.recordOrder.get(s.id)-this.recordOrder.get(i.id)||0)*(a?-1:1),headerComponent:"TableCellHeader",headerComponentParams:{field:e,script:t.script},cellRenderer:"TableCellRenderer",cellRendererParams:{field:e,resizeRowForRelation:this.resizeRowForRelation},cellClassRules:{[qo]:()=>!0,[Uo]:({data:t})=>t.dirtyFieldNames.includes(e.name),[zo]:({data:t})=>!!t.invalidFields.find((t=>t.field.id===e.id)),[$o]:({data:t})=>void 0===t.value[e.name]||null===t.value[e.name]},cellEditor:"TableCellEditor",cellEditorParams:{field:e,sessionId:t.id,getTableDimensions:this.getDimensions,resizeRowForRelation:this.resizeRowForRelation}})))]),this.gridApi.ensureColumnVisible(t.script.model.fieldIds[0]))},this.configureReactions=()=>{this.disposeReactions();let e=g((()=>{var e;return[gi.activeTab,null==(e=gi.activeTab)?void 0:e.session]})).observe((()=>{this.configureGridColumns(),this.loadGridDataDebounced()}));this.reactionDisposers.push(e),e=g((()=>{var e,t,s,i,a;return(null==(t=null==(e=gi.activeTab)?void 0:e.session)?void 0:t.isScript)?null==(a=null==(i=null==(s=gi.activeTab)?void 0:s.session)?void 0:i.script)?void 0:a.fields:[]})).observe((({oldValue:e=[],newValue:t=[]})=>{var s,i;if(!(null==(i=null==(s=gi.activeTab)?void 0:s.session)?void 0:i.isScript))return;let a=[],n=[];const r=new Map;e.forEach((e=>r.set(e.id,e)));const l=new Map;t.forEach((e=>l.set(e.id,e))),l.forEach(((e,t)=>{r.has(t)||a.push(e),r.delete(t)})),r.forEach((e=>n.push(e))),a.forEach((e=>this.columnApi.setColumnVisible(e.id,!0))),n.forEach((e=>this.columnApi.setColumnVisible(e.id,!1)))})),this.reactionDisposers.push(e),e=g((()=>{var e,t,s,i,a;return(null==(t=null==(e=gi.activeTab)?void 0:e.session)?void 0:t.isScript)?null==(a=null==(i=null==(s=gi.activeTab)?void 0:s.session)?void 0:i.script)?void 0:a.records:[]})).observe((({oldValue:e=[],newValue:t=[]})=>{var s,i,a,n,r,o;if(!(null==(i=null==(s=gi.activeTab)?void 0:s.session)?void 0:i.isScript))return;const d=[],c=[],h=[],p=new Map;e.forEach((e=>p.set(e.id,e)));const u=new Map;t.forEach((e=>u.set(e.id,e)));let m=0;this.recordOrder.clear(),u.forEach((e=>{this.recordOrder.set(e.id,m++),p.has(e.id)&&this.gridApi.getRowNode(e.id)?c.push(e):d.push(e),p.delete(e.id)})),p.forEach((e=>{this.gridApi.getRowNode(e.id)&&h.push(e)}));l.findLast(d,(e=>!1===e.isCommitted))&&(this.gridApi.deselectAll(),this.gridApi.ensureIndexVisible(0),this.gridApi.setFocusedCell(gi.activeTab.session.script.uncommittedRecords.length-1,l.last(d).model.fieldIds[0])),this.gridApi.setSortModel(null),this.gridApi.applyTransaction({add:d,update:c,remove:h}),this.gridApi.setSortModel([{colId:null==(n=null==(a=gi.activeTab)?void 0:a.session)?void 0:n.script.fieldIds[0],sort:null==(o=null==(r=gi.activeTab)?void 0:r.session)?void 0:o.script.sort.order}])})),this.reactionDisposers.push(e)},this.disposeReactions=()=>{this.reactionDisposers.forEach((e=>e())),this.reactionDisposers=[]},this.handleGridReady=async e=>{this.columnApi=e.columnApi,this.gridApi=e.api,this.configureReactions(),this.configureGridColumns(),this.loadGridDataDebounced()},this.handleScroll=async e=>{var t,s;if("horizontal"===e.direction)return;const i=null==(s=null==(t=gi.activeTab)?void 0:t.session)?void 0:s.script;if(i.recordIds.length>=(i.model.count||0))return;const a=this.props.height;!i.running&&e.top+a>=32*(i.pagination.take-20)&&i.loadMore()},this.handleSelectionChanged=e=>{var t;null==(t=gi.activeTab)||t.session.selection.table.update({selectedRecordIds:e.api.getSelectedRows().map((e=>e.id))})},this.handleCellEditingStopped=e=>{const t=this.gridApi.getFocusedCell(),s=e;if(!t||!s)return;if(t.rowIndex===s.rowIndex&&t.column.getColId()!==s.column.getColId())return;if(t.rowIndex===s.rowIndex)return;const i=ye.get(t.column.getColId()),a=ye.get(e.column.getColId());(null==a?void 0:a.isRelation)&&(null==i?void 0:i.isRelation)&&this.gridApi.startEditingCell({rowIndex:t.rowIndex,colKey:t.column.getColId()})},this.handleCellValueChanged=(e,t)=>{var s,i,a,n;const{oldValue:r,newValue:o,node:{data:d}}=e,c=d,h=null==(s=gi.activeTab)?void 0:s.sessionId;if(!h)return!1;if(l.isEqual(r,o))return!1;if(!(null==(a=null==(i=gi.activeTab)?void 0:i.session)?void 0:a.isScript))return!1;if(gi.activeTab.session.script.update({frozen:!1}),Ms.add({type:"update",recordId:c.id,sessionId:h,value:{[t.name]:o}}),t.isRelation&&!t.isList){if(!t.typeAsModel)return!1;const e=t.relationFromFieldNames,s=t.relationToFieldNames;let i;i=null==o?null:Vs.get(Me(t.typeAsModel.id,o)),Ms.add({type:"update",sessionId:h,recordId:null!=(n=c.id)?n:null,value:e.reduce(((e,t,a)=>{var n;return e[t]=null!=(n=null==i?void 0:i.value[s[a]])?n:null,e}),{})})}if(t.isPartOfRelation&&t.relationItIsPartOf){if(!t.relationItIsPartOf.typeAsModel)return!1;const e=t.relationItIsPartOf.relationFromFieldNames,s=t.relationItIsPartOf.relationToFieldNames;Ms.add({type:"update",sessionId:h,recordId:c.id,value:{[t.relationItIsPartOf.name]:null==o?null:s.reduce(((t,s,i)=>(t[s]=c.value[e[i]],t)),{})}})}return!0},this.loadGridDataDebounced=l.debounce(this.loadGridData,300,{leading:!1,trailing:!0}),this.handleScrollThrottled=l.throttle(this.handleScroll,100,{leading:!0,trailing:!0})}componentWillUnmount(){this.disposeReactions()}copyToClipboard(){const e=Bt(this.gridApi.getSelectedRows().map((e=>v(e.value))),0);if(console.log(e),document.queryCommandSupported&&document.queryCommandSupported("copy")){var t=document.createElement("textarea");t.textContent=e,t.style.position="fixed",document.body.appendChild(t),t.select();try{return document.execCommand("copy")}catch(s){return console.warn("Copy to clipboard failed.",s),!1}finally{document.body.removeChild(t)}}}render(){var e;const t=null==(e=gi.activeTab)?void 0:e.session;return b.createElement(b.Fragment,null,b.createElement("div",{ref:this.table,className:S(Fo,"ag-theme-main")},b.createElement(M,{rowSelection:"multiple",rowDeselection:!0,suppressRowClickSelection:!0,frameworkComponents:{TableLoadingOverlay:Vr,TableEmptyOverlay:jr,TableCellHeader:Gr,TableCellRenderer:dl,TableCellEditor:Bo},rowClassRules:{[Ho]:e=>!!t.script.uncommittedRecords.length&&e.node.id===t.script.recordIds[t.script.uncommittedRecords.length]},loadingOverlayComponent:"TableLoadingOverlay",noRowsOverlayComponent:"TableEmptyOverlay",suppressColumnVirtualisation:!!window.Cypress,getRowNodeId:e=>e.id,onGridReady:this.handleGridReady,onBodyScroll:this.handleScrollThrottled,onSelectionChanged:this.handleSelectionChanged,onCellEditingStopped:this.handleCellEditingStopped})),b.createElement(ma,{keys:"mod+c",target:this.table,preventDefault:!1,stopPropagation:!1,onMatch:e=>{0!==this.gridApi.getSelectedRows().length&&(e.preventDefault(),e.stopPropagation(),this.copyToClipboard())}}),b.createElement(ma,{keys:"mod+up",target:this.table,preventDefault:!1,stopPropagation:!1,onMatch:e=>{this.gridApi.getEditingCells().length>0||(e.preventDefault(),e.stopPropagation(),this.gridApi.setFocusedCell(0,this.gridApi.getFocusedCell().column))}}),b.createElement(ma,{keys:"mod+down",target:this.table,preventDefault:!1,stopPropagation:!1,onMatch:e=>{this.gridApi.getEditingCells().length>0||(e.preventDefault(),e.stopPropagation(),this.gridApi.setFocusedCell(gi.activeTab.session.script.recordIds.length-1,this.gridApi.getFocusedCell().column))}}),b.createElement(ma,{keys:"mod+left",target:this.table,preventDefault:!1,stopPropagation:!1,onMatch:e=>{this.gridApi.getEditingCells().length>0||(e.preventDefault(),e.stopPropagation(),this.gridApi.setFocusedCell(this.gridApi.getFocusedCell().rowIndex,this.columnApi.getColumnState()[1].colId))}}),b.createElement(ma,{keys:"mod+right",target:this.table,preventDefault:!1,stopPropagation:!1,onMatch:e=>{if(this.gridApi.getEditingCells().length>0)return;e.preventDefault(),e.stopPropagation();const t=this.columnApi.getColumnState();this.gridApi.setFocusedCell(this.gridApi.getFocusedCell().rowIndex,t[t.length-1].colId)}}),b.createElement(ma,{keys:"enter",target:this.table,preventDefault:!1,stopPropagation:!1,onMatch:e=>{const t=this.gridApi.getFocusedCell();if("checkbox"===t.column.getColId()){e.preventDefault(),e.stopPropagation();const s=this.gridApi.getRowNode(gi.activeTab.session.script.recordIds[t.rowIndex]),i=this.gridApi.getSelectedNodes().find((e=>e.id===s.id));null==s||s.setSelected(!i)}}}))}}var Wo="_stickyItems_1qvgu_1",Ko="_outer_1qvgu_8";const Go=b.createContext({});class Qo extends b.PureComponent{constructor(e){super(e),this.list=b.createRef(),this.lastScrollTop=0,this.isLoading=!1,this.handleScroll=()=>{const e=this.list.current._outerRef;e.scrollTop!==this.lastScrollTop&&(this.lastScrollTop=e.scrollTop,this.handleHorizontalScrollThrottled())},this.handleHorizontalScroll=()=>{const{itemSize:e,onLoad:t}=this.props;if(this.isLoading||!t)return;const s=this.list.current._outerRef;s.scrollHeight-(s.scrollTop+s.clientHeight)<15*e&&(this.isLoading=!0,t())},this.handleHorizontalScrollThrottled=l.throttle(this.handleHorizontalScroll,100,{leading:!0,trailing:!0})}componentDidUpdate(){this.isLoading=!1}render(){const{className:e,outerElementRef:t,innerElementRef:s,height:i,width:a,itemCount:n,itemKey:r,itemSize:l,itemData:o,itemRenderer:d,stickyIndices:c,stickyItemsClassName:h,overscan:p}=this.props;return b.createElement(Go.Provider,{value:{stickyIndices:c,stickyItemsClassName:h,itemSize:l,itemData:o,itemKey:r,itemRenderer:d}},b.createElement("div",{"data-cy":"infinite-list",className:e,onScroll:this.handleScroll},b.createElement(R,{ref:this.list,outerRef:t,innerRef:s,height:i,width:a,itemCount:n,itemSize:l,itemKey:r,itemData:o,overscanCount:p,outerElementType:ed,innerElementType:Xo},d)))}}Qo.defaultProps={stickyIndices:[],stickyItemsClassName:"",overscan:10};const Xo=b.forwardRef(((e,t)=>{var{children:s}=e,i=r(e,["children"]);return b.createElement(Go.Consumer,null,(({stickyItemsClassName:e,stickyIndices:a=[],itemSize:r,itemData:l,itemKey:o,itemRenderer:d})=>b.createElement("div",n({ref:t},i),b.createElement("div",{className:S(Wo,e)},a.map((e=>b.createElement(d,{key:o(e),index:e,style:{display:"flex",position:"absolute",top:e*r,left:0,width:"100%",height:r},data:n(n({},l),{sticky:!0})})))),b.Children.map(s,((e,t)=>a.includes(t)?null:e)))))})),ed=b.forwardRef(((e,t)=>{var{children:s,className:i}=e,a=r(e,["children","className"]);return b.createElement("div",n({ref:t,tabIndex:1,className:S(Ko,i)},a),s)}));class td extends b.PureComponent{constructor(){super(...arguments),this.clickStartCoords={x:0,y:0},this.startClick=e=>{this.clickStartCoords={x:e.clientX,y:e.clientY}},this.finishClick=e=>{if(this.props.onClickButNotDrag&&Math.abs(this.clickStartCoords.x-e.clientX)<5&&Math.abs(this.clickStartCoords.y-e.clientY)<5)return this.props.onClickButNotDrag(e);this.props.onClick&&this.props.onClick(e)}}render(){const e=this.props,{onClickButNotDrag:t,children:s}=e,i=r(e,["onClickButNotDrag","children"]);return b.createElement("div",n(n({},i),{onMouseDown:this.startClick,onMouseUp:this.finishClick,onClick:void 0}),s)}}var sd="_container_fkswg_1",id="_one_fkswg_21",ad="_two_fkswg_22",nd="_three_fkswg_23";var rd=_((({className:e,size:t=3}={})=>b.createElement("div",{className:S(sd,e)},b.createElement("div",{className:id,style:{height:t,width:t}}),b.createElement("div",{className:ad,style:{height:t,width:t}}),b.createElement("div",{className:nd,style:{height:t,width:t}}))));function ld(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{d:"m2.314892,2.715466c0,-2.097726 2.320696,-3.364698 4.085258,-2.230334l13.864359,8.912782c1.89413,1.21769 1.89413,3.986482 0,5.204172l-13.864359,8.912782c-1.764597,1.134364 -4.085258,-0.132608 -4.085258,-2.230334l0,-18.569068z"}))}const od=(e,{maxLength:t=100}={})=>e.length<=t?e:`${e.slice(0,t-1)}…`,dd=(e,{maxLength:t}={maxLength:100})=>{if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return`"${od(e,{maxLength:t-2})}"`;if("number"==typeof e||"boolean"==typeof e)return od(`${e}`,{maxLength:t});const s=e=>"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?`${e}`:Array.isArray(e)?"[ … ]":"{ … }";if(Array.isArray(e)){t-="[ ]".length;const i=[];return e.some((e=>{const a=s(e),n=a.length+", ".length;return!(n<t)||(i.push(a),t-=n,!1)})),0===i.length?"[ … ]":i.length===e.length?`[ ${i.join(", ")} ]`:`[ ${i.join(", ")}, … ]`}const i=Object.keys(e);t-="{ }".length;const a=[];return i.some((i=>{const n=`${i}: ${s(e[i])}`,r=n.length+", ".length;return!(r<t)||(a.push(n),t-=r,!1)})),0===a.length?"{ … }":a.length===i.length?`{ ${a.join(", ")} }`:`{ ${a.join(", ")}, … }`};var cd={container:"_container_1rxo6_1",meta:"_meta_1rxo6_9",fieldValue:"_fieldValue_1rxo6_14",active:"_active_1rxo6_19",expanded:"_expanded_1rxo6_28",expandButton:"_expandButton_1rxo6_28",loader:"_loader_1rxo6_51",icon:"_icon_1rxo6_65",fieldName:"_fieldName_1rxo6_68",fieldType:"_fieldType_1rxo6_73"};class hd extends b.PureComponent{constructor(){super(...arguments),this.handleToggleCollapse=e=>{const{path:t,isLoading:s,onToggleCollapse:i}=this.props;e.stopPropagation(),s||i(t)},this.handleExpand=e=>{const{isExpanded:t}=this.props;t||this.handleToggleCollapse(e)}}render(){const{path:e,isSelected:t,isExpanded:s,fieldName:i,modelName:a,value:n,isLoading:r,style:l}=this.props,o=e.split("::").length-1;return b.createElement("div",{"data-cy":"tree__object","data-cy-expanded":"true",style:l,className:S(cd.container,{[cd.expanded]:s,[cd.active]:!s&&t}),tabIndex:1},b.createElement("div",{className:cd.depthGutter,style:{width:16*o}}),b.createElement("div",{"data-cy":"expand-btn",className:cd.expandButton,onClick:this.handleToggleCollapse},r&&b.createElement(rd,{size:3,className:cd.loader}),!r&&n&&b.createElement(ld,null)),b.createElement("div",{className:S(cd.meta,{[cd.active]:s&&t}),onClick:this.handleToggleCollapse},b.createElement(Yr,{className:cd.icon,object:!0,required:!0}),i&&b.createElement("div",{className:cd.fieldName},i,":"),b.createElement("div",{className:cd.fieldType},a)),b.createElement(td,{className:cd.fieldValue,onClickButNotDrag:this.handleExpand},n?dd(n,{maxLength:150}):"null"))}}var pd=_(hd);var ud={container:"_container_oc259_1",meta:"_meta_oc259_9",fieldValue:"_fieldValue_oc259_14",active:"_active_oc259_19",expanded:"_expanded_oc259_28",expandButton:"_expandButton_oc259_28",loader:"_loader_oc259_51",icon:"_icon_oc259_65",fieldName:"_fieldName_oc259_68",fieldType:"_fieldType_oc259_74"};class md extends b.PureComponent{constructor(){super(...arguments),this.handleToggleCollapse=e=>{const{path:t,isLoading:s,onToggleCollapse:i}=this.props;e.stopPropagation(),s||i(t)},this.handleExpand=e=>{const{isExpanded:t}=this.props;t||this.handleToggleCollapse(e)}}render(){const{path:e,isSelected:t,isExpanded:s,fieldName:i,modelName:a,value:n,isLoading:r,style:l}=this.props,o=e.split("::").length-1;return b.createElement("div",{tabIndex:1,"data-cy":"tree__array",className:S(ud.container,{[ud.expanded]:s,[ud.active]:!s&&t}),style:l},b.createElement("div",{className:ud.depthGutter,style:{width:16*o}}),b.createElement("div",{"data-cy":"expand-btn",className:ud.expandButton,onClick:this.handleToggleCollapse},r&&b.createElement(rd,{size:3,className:ud.loader}),!r&&n&&n.length>0&&b.createElement(ld,null)),b.createElement("div",{className:S(ud.meta,{[ud.active]:s&&t}),onClick:this.handleToggleCollapse},b.createElement(Yr,{className:ud.icon,array:!0,required:!0}),b.createElement("div",{className:ud.fieldName},i,":"),b.createElement("div",{className:ud.fieldType},a)),b.createElement(td,{className:ud.fieldValue,onClickButNotDrag:this.handleExpand},b.createElement(b.Fragment,null,`(${n?n.length:0}) `,r||0===(null==n?void 0:n.length)?"[ ]":dd(n,{maxLength:150}))))}}var gd=_(md);class fd extends b.PureComponent{constructor(){super(...arguments),this.handleToggleCollapse=e=>{const{path:t,isLoading:s,onToggleCollapse:i}=this.props;e.stopPropagation(),s||i(t)},this.handleExpand=e=>{const{isExpanded:t}=this.props;t||this.handleToggleCollapse(e)}}render(){const{path:e,isSelected:t,isExpanded:s,startIndex:i,endIndex:a,value:n,isLoading:r,style:l}=this.props,o=e.split("::").length-1;return b.createElement("div",{tabIndex:1,"data-cy":"tree__array",className:S(ud.container,{[ud.expanded]:s,[ud.active]:!s&&t}),style:l},b.createElement("div",{className:ud.depthGutter,style:{width:16*o}}),b.createElement("div",{"data-cy":"expand-btn",className:ud.expandButton},r?b.createElement(rd,{size:3,className:ud.loader}):b.createElement(ld,null)),b.createElement("div",{className:S(ud.meta,{[ud.active]:s&&t}),onClick:this.handleToggleCollapse},b.createElement(Yr,{className:ud.icon,array:!0,required:!0}),b.createElement("div",{className:ud.fieldName},`[${i}-${a}]:`)),b.createElement(td,{className:ud.fieldValue,onClickButNotDrag:this.handleExpand},b.createElement(b.Fragment,null,`(${n&&n.length}) `,dd(n,{maxLength:150}))))}}var vd=_(fd);var yd={container:"_container_w0wc7_1",meta:"_meta_w0wc7_8",fieldValue:"_fieldValue_w0wc7_14",active:"_active_w0wc7_20",icon:"_icon_w0wc7_36",fieldName:"_fieldName_w0wc7_39"};class Id extends b.PureComponent{constructor(){super(...arguments),this.handleClick=e=>{const{path:t,onClick:s}=this.props;e&&e.stopPropagation(),s(t)}}render(){const{path:e,isSelected:t,fieldName:s,value:i,isString:a,isInt:n,isFloat:r,isBoolean:l,isDateTime:o,style:d}=this.props,c=e.split("::").length-1;return b.createElement("div",{"data-cy":"tree__scalar",style:d,className:S(yd.container,{[yd.active]:t}),tabIndex:1,onClick:this.handleClick},b.createElement("div",{className:yd.depthGutter,style:{width:16*c}}),b.createElement("div",{className:yd.meta},((h=this.props).isString||h.isInt||h.isFloat||h.isBoolean||h.isDateTime)&&b.createElement(Yr,{className:yd.icon,required:!0,string:a,int:n,float:r,boolean:l,dateTime:o}),b.createElement("div",{className:yd.fieldName},s,":")),b.createElement("div",{className:yd.fieldValue},dd(i)));var h}}var Cd=_(Id);var wd={container:"_container_1m4mj_1",meta:"_meta_1m4mj_8",fieldValue:"_fieldValue_1m4mj_14",active:"_active_1m4mj_20",icon:"_icon_1m4mj_36",fieldName:"_fieldName_1m4mj_39"};class Ed extends b.PureComponent{constructor(){super(...arguments),this.handleClick=e=>{const{path:t,onClick:s}=this.props;e&&e.stopPropagation(),s(t)}}render(){const{path:e,isSelected:t,fieldName:s,value:i,style:a}=this.props,n=e.split("::").length-1;return b.createElement("div",{"data-cy":"tree__enum",style:a,className:S(wd.container,{[wd.active]:t}),tabIndex:1,onClick:this.handleClick},b.createElement("div",{className:wd.depthGutter,style:{width:16*n}}),b.createElement("div",{className:wd.meta},b.createElement(Yr,{className:wd.icon,enumerable:!0,required:!0}),s&&b.createElement("div",{className:wd.fieldName},s,":")),b.createElement("div",{className:wd.fieldValue},dd(i)))}}var bd=_(Ed);class _d extends b.PureComponent{constructor(){super(...arguments),this.isArraySlice=e=>null===e.record&&Array.isArray(e.arraySliceIndices)&&Array.isArray(e.value),this.handleToggleCollapse=e=>{const{selection:t}=this.context.session;this.handleSelect(e),t.tree.isExpanded(e)?t.tree.collapse():t.tree.expand()},this.handleSelect=e=>{const{selection:t}=this.context.session;t.tree.select(e)}}render(){var e,t,s,i,a,n,r,l,o,d,c,h,p;const{selection:u}=this.context.session,{style:m,index:g,data:{pathsToRender:f,recordIds:v}}=this.props,y=f[g],I=Qt(y,v),C=u.tree.activePath,w=u.tree.isExpanded(y);return this.isArraySlice(I)?b.createElement(vd,{path:y,isSelected:y===C,isExpanded:w,startIndex:I.arraySliceIndices[0],endIndex:I.arraySliceIndices[1],value:I.value,isLoading:!I.value,style:m,onToggleCollapse:this.handleToggleCollapse}):(null==(e=I.field)?void 0:e.isList)||Array.isArray(I.value)?b.createElement(gd,{path:y,isSelected:y===C,isExpanded:w,fieldName:I.field.name,modelName:I.field.typeAsLabel,value:I.value,isLoading:!I.value,style:m,onToggleCollapse:this.handleToggleCollapse}):(null==(t=I.field)?void 0:t.isRelation)||I.record?b.createElement(pd,{path:y,isSelected:y===C,isExpanded:w,fieldName:null==(s=I.field)?void 0:s.name,modelName:I.model.name,value:I.value,isLoading:null===(null==(i=I.record)?void 0:i.value),style:m,onToggleCollapse:this.handleToggleCollapse}):(null==(a=I.field)?void 0:a.isEnum)?b.createElement(bd,{path:y,isSelected:y===C,fieldName:null==(n=I.field)?void 0:n.name,value:I.value,style:m,onClick:this.handleSelect}):b.createElement(Cd,{path:y,isSelected:y===C,fieldName:(null==(r=I.field)?void 0:r.name)||`${I.index}`,value:I.value,isString:(null==(l=I.field)?void 0:l.isString)||!1,isInt:(null==(o=I.field)?void 0:o.isInt)||!1,isFloat:(null==(d=I.field)?void 0:d.isFloat)||(null==(c=I.field)?void 0:c.isDecimal)||!1,isBoolean:(null==(h=I.field)?void 0:h.isBoolean)||!1,isDateTime:(null==(p=I.field)?void 0:p.isDateTime)||!1,style:m,onClick:this.handleSelect})}}var Sd=_(Tr(_d));var xd="_container_wwbam_1";class Nd extends b.PureComponent{constructor(e){super(e),this.tree=b.createRef(),this.refresh=async()=>{const{session:e}=this.context;await e.script.run()},this._scrollIntoView=()=>{const{height:e}=this.props,t=this.getActivePathIndex(),s=this.tree.current,i=23*t,a=i+23;i<=s.scrollTop&&s.scrollTo({top:i}),a>=s.scrollTop+e&&s.scrollTo({top:a-e})},this.getActivePathIndex=()=>{const{session:e}=this.context;return e.selection.tree.selectionOrder.findIndex((t=>t===e.selection.tree.activePath))},this.handleLoadMore=()=>{const{session:e}=this.context;e.script.loadMore(),e.selection.tree.setSelectionOrder()},this.scrollIntoView=l.throttle(this._scrollIntoView,30,{leading:!0,trailing:!0})}focus(){var e;null==(e=this.tree.current)||e.focus()}componentDidMount(){this.context.session.selection.tree.setSelectionOrder()}render(){const{session:e}=this.context,{height:t,width:s,recordIds:i}=this.props,{tree:a}=e.selection,n=a.selectionOrder;return b.createElement(b.Fragment,null,b.createElement(Qo,{outerElementRef:this.tree,className:xd,height:t-20,width:s-20,itemCount:n.length,itemSize:23,itemData:{pathsToRender:n,recordIds:i},itemKey:e=>n[e],itemRenderer:Sd,onLoad:this.handleLoadMore}),b.createElement(ma,{keys:"up",target:this.tree,onMatch:e=>{a.move(1,"up"),this.scrollIntoView()}}),b.createElement(ma,{keys:"down",target:this.tree,onMatch:e=>{a.move(1,"down"),this.scrollIntoView()}}),b.createElement(ma,{keys:"left",target:this.tree,onMatch:e=>{a.isExpanded(a.activePath)?a.collapse():a.jumpToParent(),this.scrollIntoView()}}),b.createElement(ma,{keys:"right",target:this.tree,onMatch:e=>{a.expand(),this.scrollIntoView()}}),b.createElement(ma,{keys:"space",target:this.tree,onMatch:e=>{a.expand(),this.scrollIntoView()}}))}}var Md=_(Tr(Nd));var Ld="_container_ks368_1";class Rd extends b.PureComponent{constructor(){super(...arguments),this.table=b.createRef(),this.tree=b.createRef()}scrollIntoView(){this.table.current.scrollIntoView()}focus(){var e,t;const{session:s}=this.context;"table"===s.script.viewMode&&(null==(e=this.table.current)||e.focus()),"tree"===s.script.viewMode&&(null==(t=this.tree.current)||t.focus())}refresh(){var e,t;const{session:s}=this.context;"table"===s.script.viewMode&&(null==(e=this.table.current)||e.refresh()),"tree"===s.script.viewMode&&(null==(t=this.tree.current)||t.refresh())}selectRows(e){var t;const{session:s}=this.context;"table"===s.script.viewMode&&(null==(t=this.table.current)||t.selectRows(e))}deleteSelectedRows(){var e;const{session:t}=this.context;"table"===t.script.viewMode&&(null==(e=this.table.current)||e.deleteSelectedRows())}render(){const{sessionId:e,session:t}=this.context,{className:s,width:i,height:a}=this.props;return b.createElement("div",{className:S(Ld,s),"data-cy":"results"},"tree"===t.script.viewMode&&b.createElement(Md,{ref:this.tree,key:e,width:i,height:a,recordIds:t.script.recordIds}),"table"===t.script.viewMode&&b.createElement(Yo,{ref:this.table,width:i,height:a}))}}var Ad=_(Tr(Rd));function Od(e){return b.createElement("svg",Object.assign({viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{fill:"currentColor",d:"M8.53033 1.46948C7.62352 0.563232 6.37899 0.000732422 4.99687 0.000732422C2.23265 0.000732422 0 2.23823 0 5.00073C0 7.76323 2.23265 10.0007 4.99687 10.0007C7.32958 10.0007 9.27455 8.40698 9.83115 6.25073H8.53033C8.01751 7.70698 6.62914 8.75073 4.99687 8.75073C2.92683 8.75073 1.24453 7.06948 1.24453 5.00073C1.24453 2.93198 2.92683 1.25073 4.99687 1.25073C6.03502 1.25073 6.9606 1.68198 7.63602 2.36323L5.62226 4.37573H10V0.000732422L8.53033 1.46948Z"}))}var Dd={container:"_container_71gdd_1",header:"_header_71gdd_7",separator:"_separator_71gdd_15",refreshBtn:"_refreshBtn_71gdd_22",spin:"_spin_71gdd_50",deleteBtn:"_deleteBtn_71gdd_57",pendingActions:"_pendingActions_71gdd_65"};class kd extends b.PureComponent{constructor(){super(...arguments),this.results=b.createRef(),this.handleCreateRecord=()=>{var e,t;null==(t=null==(e=gi.activeTab)?void 0:e.session)||t.createUncommittedRecord(),Ve.send({command:"record_create",commandDetails:{}})},this.handleDeleteRecords=()=>{this.results.current.deleteSelectedRows(),this.results.current.selectRows([]),this.results.current.focus()},this.handleSuccess=()=>{this.results.current.selectRows([]),this.results.current.focus(),this.results.current.refresh()}}render(){var e;const t=null==(e=gi.activeTab)?void 0:e.session;return t&&(null==t?void 0:t.isScript)?b.createElement("div",{className:Dd.container,"data-cy":"databrowser"},b.createElement("div",{className:Dd.header},b.createElement(ha,{className:S(Dd.refreshBtn,{[Dd.spin]:t.script.running}),disabled:t.script.running,onClick:()=>t.script.run()},b.createElement(Od,null)),b.createElement(dr,null),b.createElement(_r,null),b.createElement(Nr,null),b.createElement("div",{className:Dd.separator}),b.createElement(ha,{"data-cy":"create-record-btn",onClick:this.handleCreateRecord,disabled:t.isScript&&"tree"===t.script.viewMode},"Add record"),t.selection.table.selectedRecordIds.length>0&&b.createElement(ha,{"data-cy":"delete-record-btn",className:Dd.deleteBtn,onClick:this.handleDeleteRecords},b.createElement(b.Fragment,null,"Delete ",t.selection.table.selectedRecordIds.length," record",t.selection.table.selectedRecordIds.length>1?"s":"")),b.createElement(kr,{className:Dd.pendingActions,onSuccess:this.handleSuccess})),b.createElement(Ad,{ref:this.results,className:Dd.results,width:window.innerWidth,height:window.innerHeight-36-44})):null}}var Td=_(kd);var Pd={container:"_container_1xigg_1",content:"_content_1xigg_10",header:"_header_1xigg_20",title:"_title_1xigg_24",search:"_search_1xigg_30",section:"_section_1xigg_41",allModels:"_allModels_1xigg_45",sectionTitle:"_sectionTitle_1xigg_50",list:"_list_1xigg_55",model:"_model_1xigg_60",active:"_active_1xigg_66",spacer:"_spacer_1xigg_72",count:"_count_1xigg_75",empty:"_empty_1xigg_79"};class Vd extends b.PureComponent{constructor(){var e;super(...arguments),this.state={searchValue:"",highlightedSection:"recent",highlightedIdx:0},this.input=b.createRef(),this.recentModelRefs=((null==(e=_i.activeProject)?void 0:e.recentModelIds)||[]).map((e=>b.createRef())),this.allModelRefs=Object.keys(Ne.values).map((e=>b.createRef())),this.filteredModelRefs=[],this.getRecentModels=()=>{var e;return(null==(e=_i.activeProject)?void 0:e.recentModels)||[]},this.getAllModels=()=>Object.values(Ne.values),this.getFilteredModels=e=>Object.values(Ne.values).filter((t=>t.name.toLowerCase().includes(e.toLowerCase()))),this.scrollToHighlightedIdx=()=>{var e,t,s,i,a,n;const{highlightedSection:r,highlightedIdx:l}=this.state;"recent"===r?null==(t=null==(e=this.recentModelRefs[l])?void 0:e.current)||t.scrollIntoView({behavior:"smooth",block:"nearest"}):"all"===r?null==(i=null==(s=this.allModelRefs[l])?void 0:s.current)||i.scrollIntoView({behavior:"smooth",block:"nearest"}):"filtered"===r&&(null==(n=null==(a=this.filteredModelRefs[l])?void 0:a.current)||n.scrollIntoView({behavior:"smooth",block:"nearest"}))},this.handleSelectModel=e=>{var t;const s=Ne.get(e);if(!s)return;null==(t=_i.activeProject)||t.addRecentModel(s.id);let i=Object.values(gi.values).find((e=>{var t;return(null==(t=e.session)?void 0:t.isScript)&&e.session.script.model.id===s.id&&e.session.script.frozen}))||null;return i?(i.update({preview:!1}),void gi.switch({id:i.id})):(i=gi.previewTab,i?(i.load({modelId:s.id}),i.update({preview:!1}),void gi.switch({id:i.id})):(i=gi.add({modelId:s.id,preview:!1}),void gi.switch({id:i.id})))},this.handleSelectHighlightedModel=()=>{var e,t,s;const{highlightedSection:i,highlightedIdx:a,searchValue:n}=this.state;"recent"===i?this.handleSelectModel(null==(e=this.getRecentModels()[a])?void 0:e.id):"all"===i?this.handleSelectModel(null==(t=this.getAllModels()[a])?void 0:t.id):"filtered"===i&&this.handleSelectModel(null==(s=this.getFilteredModels(n)[a])?void 0:s.id)},this.handleSearch=e=>{var t;this.filteredModelRefs=this.getFilteredModels(e).map((e=>b.createRef()));const s=(null==(t=_i.activeProject)?void 0:t.recentModels)||[];""===e?this.setState({searchValue:e,highlightedSection:s.length>0?"recent":"all",highlightedIdx:0}):this.setState({searchValue:e,highlightedSection:"filtered",highlightedIdx:0})},this.handleHighlightPrev=()=>{this.setState((e=>{var t;let s=e.highlightedSection,i=e.highlightedIdx;if("recent"===e.highlightedSection)e.highlightedIdx-1<0||(i-=1);else if("all"===e.highlightedSection)if(e.highlightedIdx-1<0){const e=(null==(t=_i.activeProject)?void 0:t.recentModels)||[];0===e.length||(s="recent",i=e.length-1)}else i-=1;else"filtered"===e.highlightedSection&&(e.highlightedIdx-1<0||(i-=1));return{highlightedSection:s,highlightedIdx:i}}),(()=>this.scrollToHighlightedIdx()))},this.handleHighlightNext=()=>{this.setState((e=>{var t;let s=e.highlightedSection,i=e.highlightedIdx;if("recent"===e.highlightedSection){const a=(null==(t=_i.activeProject)?void 0:t.recentModels)||[];e.highlightedIdx+1>=a.length?(s="all",i=0):i+=1}else if("all"===e.highlightedSection){const t=Object.values(Ne.values);e.highlightedIdx+1>=t.length||(i+=1)}else if("filtered"===e.highlightedSection){const t=this.getFilteredModels(e.searchValue);e.highlightedIdx+1>=t.length||(i+=1)}return{highlightedSection:s,highlightedIdx:i}}),(()=>this.scrollToHighlightedIdx()))}}render(){var e;const{searchValue:t,highlightedSection:s,highlightedIdx:i}=this.state,a=(null==(e=_i.activeProject)?void 0:e.recentModels)||[],n=Object.values(Ne.values),r=this.getFilteredModels(t);return b.createElement("div",{className:Pd.container,"data-cy":"model-list-tab"},b.createElement("div",{className:Pd.content},b.createElement("header",{className:Pd.header},b.createElement("div",{className:Pd.title},"Open a Model"),b.createElement(hr,{"data-cy":"search",innerRef:this.input,type:"text",className:Pd.search,focusOnMount:!0,value:t,onChange:this.handleSearch,placeholder:"Search"})),a.length>0&&""===t&&b.createElement("section",{"data-cy":"recent-model-list",className:Pd.section},b.createElement("div",{className:Pd.sectionTitle},"Recently Opened"),b.createElement("ul",{className:Pd.list},a.map(((e,t)=>{var a;return b.createElement("li",{key:e.id,ref:this.recentModelRefs[t],className:S(Pd.model,{[Pd.active]:"recent"===s&&i===t}),onClick:t=>this.handleSelectModel(e.id)},b.createElement("div",{"data-cy":"name",className:Pd.name},e.name),b.createElement("div",{className:Pd.spacer}),b.createElement("div",{"data-cy":"count",className:Pd.count},null!=(a=e.count)?a:""))})))),""===t&&b.createElement("section",{"data-cy":"model-list",className:S(Pd.section,Pd.allModels)},b.createElement("div",{className:Pd.sectionTitle},"All Models"),b.createElement("ul",{className:Pd.list},n.map(((e,t)=>{var a;return b.createElement("li",{key:e.id,ref:this.allModelRefs[t],className:S(Pd.model,{[Pd.active]:"all"===s&&i===t}),onClick:t=>this.handleSelectModel(e.id)},b.createElement("div",{"data-cy":"name",className:Pd.name},e.name),b.createElement("div",{className:Pd.spacer}),b.createElement("div",{"data-cy":"count",className:Pd.count},null!=(a=e.count)?a:""))})))),""!==t&&b.createElement("section",{"data-cy":"filtered-model-list",className:S(Pd.section,Pd.allModels)},b.createElement("div",{className:Pd.sectionTitle},"Matches"),b.createElement("ul",{className:Pd.list},r.map(((e,t)=>{var a;return b.createElement("li",{key:e.id,ref:this.filteredModelRefs[t],className:S(Pd.model,{[Pd.active]:"filtered"===s&&i===t}),onClick:t=>{var s;this.handleSelectModel(e.id),null==(s=gi.activeTab)||s.update({preview:!1})}},b.createElement("div",{"data-cy":"name",className:Pd.name},e.name),b.createElement("div",{className:Pd.spacer}),b.createElement("div",{"data-cy":"count",className:Pd.count},null!=(a=e.count)?a:""))}))),0===r.length&&b.createElement("div",{className:Pd.empty},"No matches"))),b.createElement(ma,{keys:["command+shift+[","command+option+right"],target:this.input,onMatch:()=>gi.switch({direction:"right"})}),b.createElement(ma,{keys:["command+shift+]","command+option+left"],target:this.input,onMatch:()=>gi.switch({direction:"left"})}),b.createElement(ma,{keys:"up",target:this.input,onMatch:()=>this.handleHighlightPrev()}),b.createElement(ma,{keys:"down",target:this.input,onMatch:()=>this.handleHighlightNext()}),b.createElement(ma,{keys:"enter",target:this.input,onMatch:()=>this.handleSelectHighlightedModel()}),b.createElement(ma,{keys:"cmd+enter",target:this.input,onMatch:()=>this.handleSelectHighlightedModel()}))}}var jd=_(Vd);var Zd="_container_dq66k_1",Bd="_header_dq66k_9",Fd="_body_dq66k_14";class Hd extends b.PureComponent{constructor(){super(...arguments),this.state={error:!1}}componentDidCatch(e){He.update({type:"fatal",description:e.message,dump:e.stack||""}),De.updateError({visible:!0}),B({path:"Studio.componentDidCatch",message:"Caught an error during rendering",nativeError:e})}static getDerivedStateFromError(e){return{error:!0,errorMessage:e.message}}render(){var e,t,s,i;const{error:a}=this.state;return a?b.createElement(Sn,null):b.createElement("div",{className:Zd},b.createElement(In,{className:Bd}),b.createElement("div",{className:Fd},(null==(t=null==(e=gi.activeTab)?void 0:e.session)?void 0:t.isScript)&&b.createElement(Td,null),(null==(i=null==(s=gi.activeTab)?void 0:s.session)?void 0:i.isModelList)&&b.createElement(jd,null)),De.error.visible&&"client"===He.type&&b.createElement(bn,null),De.error.visible&&"fatal"===He.type&&b.createElement(Sn,null),De.error.visible&&"schemaDrift"===He.type&&b.createElement(Nn,null))}}var qd=_(Hd);var Ud="_container_1w9ta_1";class zd extends b.Component{constructor(){super(...arguments),this.state={isShortcutDialogOpen:!1}}async componentDidMount(){Li.hasCheckedForUpdates||await Li.check()}render(){const{isShortcutDialogOpen:e}=this.state;return b.createElement(b.Fragment,null,b.createElement("div",{className:S(Ud,{"theme--light":"light"===ae.theme,"theme--dark":"dark"===ae.theme})},Ti.ready&&gi.activeTab?b.createElement(Hi,{value:new Zi({sessionId:gi.activeTab.sessionId})},b.createElement(qd,null)):b.createElement(ia,null),b.createElement("div",{id:"modal-root"}),b.createElement("div",{id:"dropdown-root"}),b.createElement("div",{id:"dialog-root"})),!T.isBrowser&&b.createElement(b.Fragment,null,b.createElement(ma,{keys:"mod+t",onMatch:()=>gi.switch({id:"model-list-tab"})}),b.createElement(ma,{keys:"mod+w",preventDefault:!0,stopPropagation:!0,onMatch:()=>{gi.remove(gi.activeTabId)}}),b.createElement(ma,{keys:["command+shift+]","command+option+right","ctrl+tab"],onMatch:()=>gi.switch({direction:"right"})}),b.createElement(ma,{keys:["command+shift+[","command+option+left","ctrl+shift+tab"],onMatch:()=>gi.switch({direction:"left"})})),b.createElement(ma,{keys:"mod+/",onMatch:()=>this.setState((e=>({isShortcutDialogOpen:!e.isShortcutDialogOpen})))}),e&&b.createElement(tn,{onClose:()=>this.setState({isShortcutDialogOpen:!1})}))}}var $d=_(zd);function Jd(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{d:"m23.968743,20.378119c0,0.634822 -0.252181,1.243672 -0.701129,1.69262c-0.448948,0.448948 -1.057797,0.701129 -1.69262,0.701129l-19.149988,0c-0.634858,0 -1.24372,-0.252181 -1.692632,-0.701129c-0.448924,-0.448948 -0.701117,-1.057797 -0.701117,-1.69262l0,-16.75624c0,-0.634858 0.252193,-1.24372 0.701117,-1.692632c0.448912,-0.448924 1.057774,-0.701117 1.692632,-0.701117l5.984371,0l2.393749,3.590623l10.771868,0c0.634822,0 1.243672,0.252193 1.69262,0.701117c0.448948,0.448912 0.701129,1.057774 0.701129,1.692632l0,13.165617z"}))}function Yd(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{fill:"none",d:"m10.7143,14.96883c2.6036,0 4.7143,-2.1106 4.7143,-4.7143c0,-2.60358 -2.1107,-4.71424 -4.7143,-4.71424c-2.60364,0 -4.7143,2.11066 -4.7143,4.71424c0,2.6037 2.11066,4.7143 4.7143,4.7143z"}),b.createElement("path",{fill:"none",d:"m18,17.54023l-3.4286,-3.4285",strokeLinecap:"round"}))}var Wd="_header_173e5_1",Kd="_search_173e5_15",Gd="_list_173e5_24",Qd="_project_173e5_31",Xd="_projectMeta_173e5_50",ec="_projectName_173e5_54",tc="_projectDir_173e5_58";class sc extends b.PureComponent{constructor(e){super(e),this.state={projects:[],searchText:""},this.handleSearch=e=>{this.setState({searchText:e})}}async componentDidMount(){const{error:e,data:t}=await window.transport.request({channel:"project",action:"getAll",payload:{data:null}});if(e)return B({path:"ProjectList.componentDidMount",message:"Failed to fetch all projects",context:{error:e}});this.setState({projects:t})}handleOpen(e){window.transport.request({channel:"project",action:"open",payload:{data:{schemaPath:e}}})}render(){const{projects:e,searchText:t}=this.state,s=e.filter((e=>{var s,i;return(null==(s=e.name)?void 0:s.toLowerCase().includes(null==t?void 0:t.toLowerCase()))||(null==(i=e.schemaPath)?void 0:i.toLowerCase().includes(null==t?void 0:t.toLowerCase()))}));return b.createElement(b.Fragment,null,b.createElement("div",{className:Wd},b.createElement(Yd,null),b.createElement(hr,{type:"text",className:Kd,value:"",placeholder:"Search",onChange:this.handleSearch})),b.createElement("div",{className:Gd},s.map((e=>b.createElement("div",{key:e.schemaPath,className:Qd,onClick:()=>this.handleOpen(e.schemaPath)},b.createElement(Jd,null),b.createElement("div",{className:Xd},b.createElement("span",{className:ec},e.name),b.createElement("span",{className:tc},e.schemaPath)))))))}}function ic(e){return b.createElement("svg",Object.assign({viewBox:"0 0 88 43",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{d:"M9.632 40.256C7.92533 40.256 6.432 39.9893 5.152 39.456C3.872 38.9013 2.88 38.1227 2.176 37.12C1.49333 36.096 1.152 34.912 1.152 33.568V32.864C1.152 32.7573 1.184 32.672 1.248 32.608C1.33333 32.5227 1.42933 32.48 1.536 32.48H5.184C5.29067 32.48 5.376 32.5227 5.44 32.608C5.52533 32.672 5.568 32.7573 5.568 32.864V33.344C5.568 34.1973 5.96267 34.9227 6.752 35.52C7.54133 36.096 8.608 36.384 9.952 36.384C11.0827 36.384 11.9253 36.1493 12.48 35.68C13.0347 35.1893 13.312 34.592 13.312 33.888C13.312 33.376 13.1413 32.9493 12.8 32.608C12.4587 32.2453 11.9893 31.936 11.392 31.68C10.816 31.4027 9.888 31.0293 8.608 30.56C7.17867 30.0693 5.96267 29.568 4.96 29.056C3.97867 28.544 3.14667 27.8507 2.464 26.976C1.80267 26.08 1.472 24.9813 1.472 23.68C1.472 22.4 1.80267 21.28 2.464 20.32C3.12533 19.36 4.04267 18.624 5.216 18.112C6.38933 17.6 7.744 17.344 9.28 17.344C10.9013 17.344 12.3413 17.632 13.6 18.208C14.88 18.784 15.872 19.5947 16.576 20.64C17.3013 21.664 17.664 22.8587 17.664 24.224V24.704C17.664 24.8107 17.6213 24.9067 17.536 24.992C17.472 25.056 17.3867 25.088 17.28 25.088H13.6C13.4933 25.088 13.3973 25.056 13.312 24.992C13.248 24.9067 13.216 24.8107 13.216 24.704V24.448C13.216 23.552 12.8427 22.7947 12.096 22.176C11.3707 21.536 10.368 21.216 9.088 21.216C8.08533 21.216 7.296 21.4293 6.72 21.856C6.16533 22.2827 5.888 22.8693 5.888 23.616C5.888 24.1493 6.048 24.5973 6.368 24.96C6.70933 25.3227 7.2 25.6533 7.84 25.952C8.50133 26.2293 9.51467 26.6133 10.88 27.104C12.3947 27.6587 13.5787 28.1493 14.432 28.576C15.3067 29.0027 16.0853 29.6427 16.768 30.496C17.472 31.328 17.824 32.416 17.824 33.76C17.824 35.7653 17.088 37.3547 15.616 38.528C14.144 39.68 12.1493 40.256 9.632 40.256ZM29.1753 26.784C29.1753 26.8907 29.1326 26.9867 29.0473 27.072C28.9833 27.136 28.8979 27.168 28.7913 27.168H25.7193C25.6126 27.168 25.5593 27.2213 25.5593 27.328V34.112C25.5593 34.816 25.6979 35.3387 25.9753 35.68C26.2739 36.0213 26.7433 36.192 27.3833 36.192H28.4393C28.5459 36.192 28.6313 36.2347 28.6953 36.32C28.7806 36.384 28.8233 36.4693 28.8233 36.576V39.616C28.8233 39.8507 28.6953 39.9893 28.4393 40.032C27.5433 40.0747 26.9033 40.096 26.5193 40.096C24.7486 40.096 23.4259 39.808 22.5513 39.232C21.6766 38.6347 21.2286 37.5253 21.2073 35.904V27.328C21.2073 27.2213 21.1539 27.168 21.0473 27.168H19.2233C19.1166 27.168 19.0206 27.136 18.9353 27.072C18.8713 26.9867 18.8393 26.8907 18.8393 26.784V23.936C18.8393 23.8293 18.8713 23.744 18.9353 23.68C19.0206 23.5947 19.1166 23.552 19.2233 23.552H21.0473C21.1539 23.552 21.2073 23.4987 21.2073 23.392V19.584C21.2073 19.4773 21.2393 19.392 21.3033 19.328C21.3886 19.2427 21.4846 19.2 21.5913 19.2H25.1753C25.2819 19.2 25.3673 19.2427 25.4313 19.328C25.5166 19.392 25.5593 19.4773 25.5593 19.584V23.392C25.5593 23.4987 25.6126 23.552 25.7193 23.552H28.7913C28.8979 23.552 28.9833 23.5947 29.0473 23.68C29.1326 23.744 29.1753 23.8293 29.1753 23.936V26.784ZM40.5315 23.936C40.5315 23.8293 40.5635 23.744 40.6275 23.68C40.7128 23.5947 40.8088 23.552 40.9155 23.552H44.6595C44.7662 23.552 44.8515 23.5947 44.9155 23.68C45.0008 23.744 45.0435 23.8293 45.0435 23.936V39.616C45.0435 39.7227 45.0008 39.8187 44.9155 39.904C44.8515 39.968 44.7662 40 44.6595 40H40.9155C40.8088 40 40.7128 39.968 40.6275 39.904C40.5635 39.8187 40.5315 39.7227 40.5315 39.616V38.528C40.5315 38.464 40.5102 38.432 40.4675 38.432C40.4248 38.4107 40.3822 38.432 40.3395 38.496C39.4862 39.648 38.1635 40.224 36.3715 40.224C34.7502 40.224 33.4168 39.7333 32.3715 38.752C31.3262 37.7707 30.8035 36.3947 30.8035 34.624V23.936C30.8035 23.8293 30.8355 23.744 30.8995 23.68C30.9848 23.5947 31.0808 23.552 31.1875 23.552H34.8995C35.0062 23.552 35.0915 23.5947 35.1555 23.68C35.2408 23.744 35.2835 23.8293 35.2835 23.936V33.504C35.2835 34.3573 35.5075 35.0507 35.9555 35.584C36.4248 36.1173 37.0648 36.384 37.8755 36.384C38.6008 36.384 39.1982 36.1707 39.6675 35.744C40.1368 35.296 40.4248 34.72 40.5315 34.016V23.936ZM57.617 17.984C57.617 17.8773 57.649 17.792 57.713 17.728C57.7983 17.6427 57.8943 17.6 58.001 17.6H61.745C61.8517 17.6 61.937 17.6427 62.001 17.728C62.0863 17.792 62.129 17.8773 62.129 17.984V39.616C62.129 39.7227 62.0863 39.8187 62.001 39.904C61.937 39.968 61.8517 40 61.745 40H58.001C57.8943 40 57.7983 39.968 57.713 39.904C57.649 39.8187 57.617 39.7227 57.617 39.616V38.56C57.617 38.496 57.5957 38.464 57.553 38.464C57.5103 38.4427 57.4677 38.4533 57.425 38.496C56.529 39.6693 55.3023 40.256 53.745 40.256C52.2517 40.256 50.961 39.84 49.873 39.008C48.8063 38.176 48.0383 37.0347 47.569 35.584C47.2063 34.4747 47.025 33.184 47.025 31.712C47.025 30.1973 47.217 28.8747 47.601 27.744C48.0917 26.3787 48.8597 25.3013 49.905 24.512C50.9717 23.7013 52.2837 23.296 53.841 23.296C55.377 23.296 56.5717 23.8293 57.425 24.896C57.4677 24.96 57.5103 24.9813 57.553 24.96C57.5957 24.9387 57.617 24.896 57.617 24.832V17.984ZM56.945 35.008C57.3717 34.2187 57.585 33.1413 57.585 31.776C57.585 30.3467 57.3503 29.2267 56.881 28.416C56.3903 27.584 55.6757 27.168 54.737 27.168C53.7343 27.168 52.977 27.584 52.465 28.416C51.9317 29.248 51.665 30.3787 51.665 31.808C51.665 33.088 51.889 34.1547 52.337 35.008C52.8703 35.9253 53.6597 36.384 54.705 36.384C55.665 36.384 56.4117 35.9253 56.945 35.008ZM67.006 21.696C66.2807 21.696 65.6727 21.4613 65.182 20.992C64.7127 20.5013 64.478 19.8933 64.478 19.168C64.478 18.4213 64.7127 17.8133 65.182 17.344C65.6513 16.8747 66.2593 16.64 67.006 16.64C67.7527 16.64 68.3607 16.8747 68.83 17.344C69.2993 17.8133 69.534 18.4213 69.534 19.168C69.534 19.8933 69.2887 20.5013 68.798 20.992C68.3287 21.4613 67.7313 21.696 67.006 21.696ZM65.086 40C64.9793 40 64.8833 39.968 64.798 39.904C64.734 39.8187 64.702 39.7227 64.702 39.616V23.904C64.702 23.7973 64.734 23.712 64.798 23.648C64.8833 23.5627 64.9793 23.52 65.086 23.52H68.83C68.9367 23.52 69.022 23.5627 69.086 23.648C69.1713 23.712 69.214 23.7973 69.214 23.904V39.616C69.214 39.7227 69.1713 39.8187 69.086 39.904C69.022 39.968 68.9367 40 68.83 40H65.086ZM79.0342 40.256C77.2422 40.256 75.7062 39.7867 74.4262 38.848C73.1462 37.9093 72.2716 36.6293 71.8022 35.008C71.5036 34.0053 71.3542 32.9173 71.3542 31.744C71.3542 30.4853 71.5036 29.3547 71.8022 28.352C72.2929 26.7733 73.1782 25.536 74.4582 24.64C75.7382 23.744 77.2742 23.296 79.0662 23.296C80.8156 23.296 82.3089 23.744 83.5462 24.64C84.7836 25.5147 85.6582 26.7413 86.1702 28.32C86.5116 29.3867 86.6822 30.5067 86.6822 31.68C86.6822 32.832 86.5329 33.9093 86.2342 34.912C85.7649 36.576 84.8902 37.888 83.6102 38.848C82.3516 39.7867 80.8262 40.256 79.0342 40.256ZM79.0342 36.384C79.7382 36.384 80.3356 36.1707 80.8262 35.744C81.3169 35.3173 81.6689 34.7307 81.8822 33.984C82.0529 33.3013 82.1382 32.5547 82.1382 31.744C82.1382 30.848 82.0529 30.0907 81.8822 29.472C81.6476 28.7467 81.2849 28.1813 80.7942 27.776C80.3036 27.3707 79.7062 27.168 79.0022 27.168C78.2769 27.168 77.6689 27.3707 77.1782 27.776C76.7089 28.1813 76.3676 28.7467 76.1542 29.472C75.9836 29.984 75.8982 30.7413 75.8982 31.744C75.8982 32.704 75.9729 33.4507 76.1222 33.984C76.3356 34.7307 76.6876 35.3173 77.1782 35.744C77.6902 36.1707 78.3089 36.384 79.0342 36.384Z",fill:"#2D3748"}),b.createElement("path",{d:"M5.9 3.186C6.516 3.186 7.05733 3.312 7.524 3.564C7.99067 3.816 8.35 4.17533 8.602 4.642C8.86333 5.09933 8.994 5.62667 8.994 6.224C8.994 6.812 8.85867 7.33 8.588 7.778C8.32667 8.226 7.95333 8.576 7.468 8.828C6.992 9.07067 6.44133 9.192 5.816 9.192H3.828C3.78133 9.192 3.758 9.21533 3.758 9.262V12.832C3.758 12.8787 3.73933 12.9207 3.702 12.958C3.674 12.986 3.63667 13 3.59 13H1.952C1.90533 13 1.86333 12.986 1.826 12.958C1.798 12.9207 1.784 12.8787 1.784 12.832V3.354C1.784 3.30733 1.798 3.27 1.826 3.242C1.86333 3.20467 1.90533 3.186 1.952 3.186H5.9ZM5.606 7.61C6.03533 7.61 6.38067 7.48867 6.642 7.246C6.90333 6.994 7.034 6.66733 7.034 6.266C7.034 5.85533 6.90333 5.524 6.642 5.272C6.38067 5.02 6.03533 4.894 5.606 4.894H3.828C3.78133 4.894 3.758 4.91733 3.758 4.964V7.54C3.758 7.58667 3.78133 7.61 3.828 7.61H5.606ZM16.0035 13C15.9102 13 15.8448 12.958 15.8075 12.874L14.0575 8.996C14.0388 8.95867 14.0108 8.94 13.9735 8.94H12.6715C12.6248 8.94 12.6015 8.96333 12.6015 9.01V12.832C12.6015 12.8787 12.5828 12.9207 12.5455 12.958C12.5175 12.986 12.4802 13 12.4335 13H10.7955C10.7488 13 10.7068 12.986 10.6695 12.958C10.6415 12.9207 10.6275 12.8787 10.6275 12.832V3.368C10.6275 3.32133 10.6415 3.284 10.6695 3.256C10.7068 3.21867 10.7488 3.2 10.7955 3.2H14.7995C15.3968 3.2 15.9195 3.32133 16.3675 3.564C16.8248 3.80667 17.1748 4.152 17.4175 4.6C17.6695 5.048 17.7955 5.566 17.7955 6.154C17.7955 6.78867 17.6368 7.33467 17.3195 7.792C17.0022 8.24 16.5588 8.55733 15.9895 8.744C15.9428 8.76267 15.9288 8.79533 15.9475 8.842L17.8515 12.804C17.8702 12.8413 17.8795 12.8693 17.8795 12.888C17.8795 12.9627 17.8282 13 17.7255 13H16.0035ZM12.6715 4.894C12.6248 4.894 12.6015 4.91733 12.6015 4.964V7.358C12.6015 7.40467 12.6248 7.428 12.6715 7.428H14.5055C14.8975 7.428 15.2148 7.31133 15.4575 7.078C15.7095 6.84467 15.8355 6.54133 15.8355 6.168C15.8355 5.79467 15.7095 5.49133 15.4575 5.258C15.2148 5.01533 14.8975 4.894 14.5055 4.894H12.6715ZM19.8151 13C19.7685 13 19.7265 12.986 19.6891 12.958C19.6611 12.9207 19.6471 12.8787 19.6471 12.832V3.368C19.6471 3.32133 19.6611 3.284 19.6891 3.256C19.7265 3.21867 19.7685 3.2 19.8151 3.2H21.4531C21.4998 3.2 21.5371 3.21867 21.5651 3.256C21.6025 3.284 21.6211 3.32133 21.6211 3.368V12.832C21.6211 12.8787 21.6025 12.9207 21.5651 12.958C21.5371 12.986 21.4998 13 21.4531 13H19.8151ZM27.1049 13.112C26.3582 13.112 25.7049 12.9953 25.1449 12.762C24.5849 12.5193 24.1509 12.1787 23.8429 11.74C23.5442 11.292 23.3949 10.774 23.3949 10.186V9.878C23.3949 9.83133 23.4089 9.794 23.4369 9.766C23.4742 9.72867 23.5162 9.71 23.5629 9.71H25.1589C25.2055 9.71 25.2429 9.72867 25.2709 9.766C25.3082 9.794 25.3269 9.83133 25.3269 9.878V10.088C25.3269 10.4613 25.4995 10.7787 25.8449 11.04C26.1902 11.292 26.6569 11.418 27.2449 11.418C27.7395 11.418 28.1082 11.3153 28.3509 11.11C28.5935 10.8953 28.7149 10.634 28.7149 10.326C28.7149 10.102 28.6402 9.91533 28.4909 9.766C28.3415 9.60733 28.1362 9.472 27.8749 9.36C27.6229 9.23867 27.2169 9.07533 26.6569 8.87C26.0315 8.65533 25.4995 8.436 25.0609 8.212C24.6315 7.988 24.2675 7.68467 23.9689 7.302C23.6795 6.91 23.5349 6.42933 23.5349 5.86C23.5349 5.3 23.6795 4.81 23.9689 4.39C24.2582 3.97 24.6595 3.648 25.1729 3.424C25.6862 3.2 26.2789 3.088 26.9509 3.088C27.6602 3.088 28.2902 3.214 28.8409 3.466C29.4009 3.718 29.8349 4.07267 30.1429 4.53C30.4602 4.978 30.6189 5.50067 30.6189 6.098V6.308C30.6189 6.35467 30.6002 6.39667 30.5629 6.434C30.5349 6.462 30.4975 6.476 30.4509 6.476H28.8409C28.7942 6.476 28.7522 6.462 28.7149 6.434C28.6869 6.39667 28.6729 6.35467 28.6729 6.308V6.196C28.6729 5.804 28.5095 5.47267 28.1829 5.202C27.8655 4.922 27.4269 4.782 26.8669 4.782C26.4282 4.782 26.0829 4.87533 25.8309 5.062C25.5882 5.24867 25.4669 5.50533 25.4669 5.832C25.4669 6.06533 25.5369 6.26133 25.6769 6.42C25.8262 6.57867 26.0409 6.72333 26.3209 6.854C26.6102 6.97533 27.0535 7.14333 27.6509 7.358C28.3135 7.60067 28.8315 7.81533 29.2049 8.002C29.5875 8.18867 29.9282 8.46867 30.2269 8.842C30.5349 9.206 30.6889 9.682 30.6889 10.27C30.6889 11.1473 30.3669 11.8427 29.7229 12.356C29.0789 12.86 28.2062 13.112 27.1049 13.112ZM38.791 3.312C38.8377 3.23733 38.903 3.2 38.987 3.2H40.625C40.6717 3.2 40.709 3.21867 40.737 3.256C40.7744 3.284 40.793 3.32133 40.793 3.368V12.832C40.793 12.8787 40.7744 12.9207 40.737 12.958C40.709 12.986 40.6717 13 40.625 13H38.987C38.9404 13 38.8984 12.986 38.861 12.958C38.833 12.9207 38.819 12.8787 38.819 12.832V6.658C38.819 6.62067 38.8097 6.602 38.791 6.602C38.7724 6.602 38.7537 6.616 38.735 6.644L37.251 8.968C37.2044 9.04267 37.139 9.08 37.055 9.08H36.229C36.145 9.08 36.0797 9.04267 36.033 8.968L34.549 6.644C34.5304 6.616 34.5117 6.60667 34.493 6.616C34.4744 6.616 34.465 6.63467 34.465 6.672V12.832C34.465 12.8787 34.4464 12.9207 34.409 12.958C34.381 12.986 34.3437 13 34.297 13H32.659C32.6124 13 32.5704 12.986 32.533 12.958C32.505 12.9207 32.491 12.8787 32.491 12.832V3.368C32.491 3.32133 32.505 3.284 32.533 3.256C32.5704 3.21867 32.6124 3.2 32.659 3.2H34.297C34.381 3.2 34.4464 3.23733 34.493 3.312L36.593 6.574C36.621 6.63 36.649 6.63 36.677 6.574L38.791 3.312ZM49.1488 13C49.0555 13 48.9948 12.9533 48.9668 12.86L48.5468 11.488C48.5282 11.4507 48.5048 11.432 48.4768 11.432H45.0328C45.0048 11.432 44.9815 11.4507 44.9628 11.488L44.5568 12.86C44.5288 12.9533 44.4682 13 44.3748 13H42.5968C42.5408 13 42.4988 12.986 42.4708 12.958C42.4428 12.9207 42.4382 12.8693 42.4568 12.804L45.4808 3.34C45.5088 3.24667 45.5695 3.2 45.6628 3.2H47.8608C47.9542 3.2 48.0148 3.24667 48.0428 3.34L51.0668 12.804C51.0762 12.8227 51.0808 12.846 51.0808 12.874C51.0808 12.958 51.0295 13 50.9268 13H49.1488ZM45.4668 9.822C45.4575 9.878 45.4762 9.906 45.5228 9.906H47.9868C48.0428 9.906 48.0615 9.878 48.0428 9.822L46.7828 5.664C46.7735 5.62667 46.7595 5.61267 46.7408 5.622C46.7222 5.622 46.7082 5.636 46.6988 5.664L45.4668 9.822Z",fill:"#718096"}))}function ac(e){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),b.createElement("path",{d:"M7.875 16.9722L12 21.25M12 21.25L16.125 16.9722M12 21.25V11.625",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),b.createElement("path",{d:"M20.8773 17.125C21.7462 16.5127 22.3978 15.6389 22.7375 14.6303C23.0773 13.6217 23.0874 12.5309 22.7666 11.5162C22.4458 10.5014 21.8107 9.6155 20.9534 8.987C20.0961 8.3585 19.0612 8.02011 17.999 8.02095H16.7398C16.4392 6.84701 15.8767 5.7567 15.0948 4.8321C14.3129 3.90751 13.3319 3.17272 12.2256 2.68306C11.1193 2.1934 9.91659 1.96162 8.70798 2.00518C7.49937 2.04873 6.31637 2.36649 5.24803 2.93452C4.1797 3.50255 3.25387 4.30606 2.54025 5.28455C1.82663 6.26304 1.34382 7.39102 1.12815 8.58356C0.912487 9.77611 0.969594 11.0021 1.29517 12.1694C1.62075 13.3366 2.20632 14.4146 3.00779 15.3222",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))}var nc={container:"_container_1mkul_1",left:"_left_1mkul_8",right:"_right_1mkul_9",logotype:"_logotype_1mkul_18",logo:"_logo_1mkul_18",fadeIn:"_fadeIn_1mkul_1",type:"_type_1mkul_32",updateContainer:"_updateContainer_1mkul_41",downloadIcon:"_downloadIcon_1mkul_49",updateText:"_updateText_1mkul_55",links:"_links_1mkul_62",link:"_link_1mkul_62",slideInRight:"_slideInRight_1mkul_1",footer:"_footer_1mkul_88"},rc=Object.defineProperty,lc=Object.getOwnPropertyDescriptor;let oc=class extends b.Component{constructor(){super(...arguments),this.handleOpen=async()=>{const{error:e,data:t}=await window.transport.request({channel:"window",action:"pickPrismaSchema",payload:{data:null}});e||await window.transport.request({channel:"project",action:"open",payload:{data:{schemaPath:t.path}}})},this.handleInstallUpdate=async()=>{await Li.download(),await Li.install()},this.handleCancelDownload=async()=>{await Li.cancelDownload()}}async componentDidMount(){await Li.check()}render(){return b.createElement("div",{className:S(nc.container,{"theme--light":"light"===ae.theme,"theme--dark":"dark"===ae.theme})},b.createElement("div",{className:nc.container},b.createElement("div",{className:nc.left},b.createElement("div",{className:nc.logotype},b.createElement("img",{src:"images/icon-1024.png",className:nc.logo}),b.createElement(ic,{className:nc.type})),Li.hasCheckedForUpdates&&!Li.isUpToDate&&b.createElement("div",{className:nc.updateContainer},b.createElement(ac,{className:nc.type}),!Li.isDownloading&&!Li.isInstalling&&b.createElement(b.Fragment,null,b.createElement("span",{className:nc.updateText},"New version available"),b.createElement(ha,{green:!0,onClick:this.handleInstallUpdate},"Update")),Li.isDownloading&&b.createElement(b.Fragment,null,b.createElement("span",{className:nc.updateText},"Downloading .."),b.createElement(ha,{red:!0,onClick:this.handleCancelDownload},"Cancel")),Li.isInstalling&&b.createElement(b.Fragment,null,b.createElement("span",{className:nc.updateText},"Installing .."),b.createElement(ha,{red:!0,onClick:this.handleCancelDownload},"Cancel"))),b.createElement("div",{className:nc.links},b.createElement("a",{className:nc.link},"0.371.0"),"|",b.createElement("a",{className:nc.link,href:"https://github.com/prisma/studio/releases",target:"_blank",rel:"noreferrer noopener"},"Changelog"))),b.createElement("div",{className:nc.right},b.createElement(sc,null),b.createElement("div",{className:nc.footer},b.createElement(ha,{className:nc.button,onClick:this.handleOpen},"Select Schema")))))}};oc=((e,t,s,i)=>{for(var a,n=i>1?void 0:i?lc(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(n=(i?a(t,s,n):a(n))||n);return i&&n&&rc(t,s,n),n})([_],oc);var dc=oc;window.PrismaStudio={databrowser:async(e={})=>{await T.update(e),await Ti.initTransport(),Ti.init(),N.render(b.createElement($d,null),document.getElementById("root"))},splash:async(e={})=>{await T.update(e),await Ti.initTransport(),N.render(b.createElement(dc,null),document.getElementById("root"))}};export{st as B};
|