sqlmesh 0.188.2.dev6__py3-none-any.whl → 0.188.2.dev8__py3-none-any.whl
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.
- sqlmesh/_version.py +2 -2
- sqlmesh/lsp/context.py +27 -1
- sqlmesh/lsp/custom.py +26 -0
- sqlmesh/lsp/main.py +60 -4
- {sqlmesh-0.188.2.dev6.dist-info → sqlmesh-0.188.2.dev8.dist-info}/METADATA +1 -1
- {sqlmesh-0.188.2.dev6.dist-info → sqlmesh-0.188.2.dev8.dist-info}/RECORD +53 -53
- web/client/dist/assets/{Audits-yd9300pl.js → Audits-CNkn30Bu.js} +1 -1
- web/client/dist/assets/{Banner-DQJLxQK4.js → Banner-BMu19thO.js} +1 -1
- web/client/dist/assets/{ChevronDownIcon-CglA7k4-.js → ChevronDownIcon-SI78_pgt.js} +1 -1
- web/client/dist/assets/{ChevronRightIcon-xw0l9rry.js → ChevronRightIcon-DvcjSEyM.js} +1 -1
- web/client/dist/assets/{Content-DdhorPW0.js → Content-BK6ZvWH8.js} +1 -1
- web/client/dist/assets/{Content-DQHjja2B.js → Content-BuovvkUB.js} +1 -1
- web/client/dist/assets/{Data-HtiT4UV2.js → Data-BdY6H-uU.js} +1 -1
- web/client/dist/assets/{DataCatalog-_7fRHUeM.js → DataCatalog-CVnpiGcp.js} +1 -1
- web/client/dist/assets/{Editor-BFYqqR17.js → Editor-ALoX4I6U.js} +1 -1
- web/client/dist/assets/{Editor-ncrD1ZO_.js → Editor-ttqMNvFU.js} +1 -1
- web/client/dist/assets/{Errors-BosrEbuf.js → Errors-1Z9mnHDd.js} +1 -1
- web/client/dist/assets/{FileExplorer-C6Imxadq.js → FileExplorer-N_rP1bCS.js} +1 -1
- web/client/dist/assets/{Footer-C9MHPzk1.js → Footer-C2z0sLXN.js} +1 -1
- web/client/dist/assets/{Header-DQF-wN9R.js → Header-BmTHO2La.js} +1 -1
- web/client/dist/assets/{Input-LXiA3uoO.js → Input-F4DL5_h8.js} +1 -1
- web/client/dist/assets/Lineage-B58aSBmy.js +1 -0
- web/client/dist/assets/{ListboxShow-BUIulc8M.js → ListboxShow-DlkxbLqo.js} +1 -1
- web/client/dist/assets/{ModelLineage-BbFqz62a.js → ModelLineage-DrZkk7za.js} +1 -1
- web/client/dist/assets/{Models-2zScbq9i.js → Models-BuOgiRPs.js} +1 -1
- web/client/dist/assets/{Page-Bf2QbngA.js → Page-BIRUe1KK.js} +1 -1
- web/client/dist/assets/{Plan-DIc3XAIr.js → Plan-CqEwcJdE.js} +1 -1
- web/client/dist/assets/{PlusCircleIcon-BIG5lKYN.js → PlusCircleIcon-DeWsoCUc.js} +1 -1
- web/client/dist/assets/{ReportErrors-DD5Tkzy2.js → ReportErrors-Dp7mrGQI.js} +1 -1
- web/client/dist/assets/{Root-B9zs-snk.js → Root-Cipvpumn.js} +1 -1
- web/client/dist/assets/{SearchList-DgKaZfJZ.js → SearchList-ISIumWZ3.js} +1 -1
- web/client/dist/assets/{SelectEnvironment-CP_GD64v.js → SelectEnvironment-CzaIoYWG.js} +1 -1
- web/client/dist/assets/{SourceList-DdN6hYD1.js → SourceList-DSwSywe1.js} +1 -1
- web/client/dist/assets/{SourceListItem-BynoG2tu.js → SourceListItem-DvsVB4rF.js} +1 -1
- web/client/dist/assets/{SplitPane-DrxVfnY9.js → SplitPane-orTCZ30m.js} +1 -1
- web/client/dist/assets/{Tests-A4Bnjxwk.js → Tests-DVP2w57x.js} +1 -1
- web/client/dist/assets/{Welcome-DbSZJpJE.js → Welcome-BU8aaKb1.js} +1 -1
- web/client/dist/assets/{context-Bxzp3TEa.js → context-BSTdE9fG.js} +1 -1
- web/client/dist/assets/{context-DUKxn1wN.js → context-CQWyuQhP.js} +1 -1
- web/client/dist/assets/{editor-CJ4oQlo_.js → editor-D2YqZoJd.js} +1 -1
- web/client/dist/assets/{file-CFuQwF_m.js → file-DgtoMe3u.js} +1 -1
- web/client/dist/assets/{floating-ui.react-dom-CN8_HaDW.js → floating-ui.react-dom-8hwAvuN1.js} +1 -1
- web/client/dist/assets/{help-BGO8vW5o.js → help-Dn6q7ttB.js} +1 -1
- web/client/dist/assets/{index-C_NFRX2g.js → index-DG6d5rM7.js} +1 -1
- web/client/dist/assets/{index-DGopuBhO.js → index-M-fcEAWc.js} +2 -2
- web/client/dist/assets/{plan-CN6Tq0vs.js → plan-0w1YtXVA.js} +1 -1
- web/client/dist/assets/{popover-DJJmvGdj.js → popover-BW7hkI4p.js} +1 -1
- web/client/dist/assets/{project-CmqDHjoE.js → project-st7AD14m.js} +1 -1
- web/client/dist/index.html +1 -1
- web/client/dist/assets/Lineage-BbURajUV.js +0 -1
- {sqlmesh-0.188.2.dev6.dist-info → sqlmesh-0.188.2.dev8.dist-info}/WHEEL +0 -0
- {sqlmesh-0.188.2.dev6.dist-info → sqlmesh-0.188.2.dev8.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.188.2.dev6.dist-info → sqlmesh-0.188.2.dev8.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.188.2.dev6.dist-info → sqlmesh-0.188.2.dev8.dist-info}/top_level.txt +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as E,d as z,a as H,j as J,a8 as O,ab as P,v as y,F as R,ac as C,I as Q,i as x,ad as Z,ae as k,b,g as ee}from"./index-
|
|
1
|
+
import{r as E,d as z,a as H,j as J,a8 as O,ab as P,v as y,F as R,ac as C,I as Q,i as x,ad as Z,ae as k,b,g as ee}from"./index-M-fcEAWc.js";import{u as h,M as g}from"./project-st7AD14m.js";import{M as V}from"./file-DgtoMe3u.js";import{u as te}from"./editor-D2YqZoJd.js";const le={Added:1,Modified:2,Deleted:3},G=E.createContext({artifactRename:void 0,setArtifactRename:()=>{},selectArtifactsInRange:()=>new Set,createDirectory:()=>{},createFile:()=>{},renameArtifact:()=>{},removeArtifacts:()=>{},removeArtifactWithConfirmation:()=>{},moveArtifacts:()=>{},isTopGroupInActiveRange:()=>!1,isBottomGroupInActiveRange:()=>!1,isMiddleGroupInActiveRange:()=>!1});function re({children:$}){const{addError:v}=z(),A=h(e=>e.activeRange),l=h(e=>e.project),_=h(e=>e.files),D=h(e=>e.setActiveRange),M=h(e=>e.setSelectedFile),I=h(e=>e.setFiles),c=h(e=>e.inActiveRange),S=H(e=>e.addConfirmation),p=te(e=>e.tab),[F,r]=E.useState(!1),[N,w]=E.useState();E.useEffect(()=>{M(p==null?void 0:p.file)},[p==null?void 0:p.id]);function L(e){const n=A.length-1,s=l.allVisibleArtifacts,u=A[0],a=A[n],i=s.indexOf(e),o=u==null?0:s.indexOf(u),m=a==null?n:s.indexOf(a),f=i>o?o:i,d=i>m||i>o&&i<m?i:m;D(s.slice(f,d+1))}function X(e){if(F)return;r(!0);const t=O("new_directory");P([e.path,t].join("/"),{}).then(n=>{y(n)||e.open()}).catch(n=>v(R.FileExplorer,n)).finally(()=>{r(!1)})}function W(e,t){if(F)return;y(t)&&(e.isModels?t=".sql":e.isTests?t=".yaml":t=".py"),r(!0);const n=O("new_file",t);C(`${e.path}/${n}`,{content:""}).then(s=>{y(s)||e.open()}).catch(s=>v(R.FileExplorer,s)).finally(()=>{r(!1)})}function Y(e,t){var i;t=t==null?void 0:t.replaceAll("/","").trim();const s=(((i=e.parent)==null?void 0:i.artifacts)??[]).some(o=>o.name===t);if(F||Q(t)||s)return;r(!0);const u=e.name,a=e.path;e.rename(t),e instanceof g&&P(a,{new_path:e.path}).catch(o=>{v(R.FileExplorer,o),e.rename(u)}).finally(()=>{r(!1),x(p)&&e.hasFile(p.file)&&M(p.file),I(l.allFiles)}),e instanceof V&&C(a,{new_path:e.path}).then(o=>{e.update(o),_.set(e.path,e),_.delete(a)}).catch(o=>{v(R.FileExplorer,o),e.rename(u)}).finally(()=>{r(!1),I(l.allFiles)})}function T(e){if(F)return;r(!0);const t=e.map(n=>n instanceof V?Z(n.path):k(n.path));Promise.all(t).then(()=>{D([])}).catch(n=>v(R.FileExplorer,n)).finally(()=>{r(!1)})}function q(e){c(e)?S({headline:"Removing Selected Files/Directories",description:`Are you sure you want to remove ${A.length} items?`,yesText:"Yes, Remove",noText:"No, Cancel",details:A.map(t=>t.path),action:()=>{T(A)}}):S({headline:`Removing ${e instanceof g?"Directory":"File"}`,description:`Are you sure you want to remove the ${e instanceof g?"directory":"file"} "${e.name}"?`,yesText:"Yes, Remove",noText:"No, Cancel",action:()=>{x(e.parent)&&T([e])}})}function j(e,t,n=!1){if(F)return;r(!0);const s=[],u=[],a=[];if(e.forEach(i=>{const o=t.containsName(i.name),m=i.path;if(o&&b(n))return a.push(i);n&&i.rename(i.copyName());let f=[t.path,i.name].join("/");for(;f.startsWith("/");)f=f.slice(1).trim();i instanceof g&&(s.push(()=>{var d;(d=i.parent)==null||d.removeDirectory(i),t.addDirectory(i)}),u.push(P(m,{new_path:f})),i.allVisibleArtifacts.forEach(d=>e.splice(e.indexOf(d),1))),i instanceof V&&(s.push(()=>{var d;(d=i.parent)==null||d.removeFile(i),t.addFile(i)}),u.push(C(m,{new_path:f})))}),ee(a)){S({headline:"Moving Duplicates",description:"All duplicated names will be renamed!",yesText:"Yes, Rename",noText:"No, Cancel",details:a.map(i=>i.path),action:()=>{j(e,t,!0)}});return}Promise.all(u).then(i=>{i.forEach((o,m)=>{var f;return(f=s[m])==null?void 0:f.call(s)})}).catch(i=>{console.log(i)}).finally(()=>{r(!1),D([]),I(l.allFiles)})}function B(e){const t=l.allVisibleArtifacts.indexOf(e),n=l.allVisibleArtifacts[t-1],s=l.allVisibleArtifacts[t+1];return c(e)&&(y(n)||b(c(n)))&&x(s)&&c(s)}function K(e){const t=l.allVisibleArtifacts.indexOf(e),n=l.allVisibleArtifacts[t-1],s=l.allVisibleArtifacts[t+1];return c(e)&&(y(s)||b(c(s)))&&x(n)&&c(n)}function U(e){const t=l.allVisibleArtifacts.indexOf(e),n=l.allVisibleArtifacts[t-1],s=l.allVisibleArtifacts[t+1];return c(e)&&x(s)&&c(s)&&x(n)&&c(n)}return J.jsx(G.Provider,{value:{artifactRename:N,setArtifactRename:w,createDirectory:X,createFile:W,renameArtifact:Y,removeArtifacts:T,removeArtifactWithConfirmation:q,moveArtifacts:j,selectArtifactsInRange:L,isTopGroupInActiveRange:B,isBottomGroupInActiveRange:K,isMiddleGroupInActiveRange:U},children:$})}function ce(){return E.useContext(G)}export{le as EnumFileExplorerChange,G as FileExplorerContext,re as default,ce as useFileExplorer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a0 as W,ay as y,v as l,b as m,az as A}from"./index-
|
|
1
|
+
import{a0 as W,ay as y,v as l,b as m,az as A}from"./index-M-fcEAWc.js";import{M as Z}from"./file-DgtoMe3u.js";const I=`(function(){"use strict";function l(n){return n===!1}function w(n){return n===""}function y(n){return a(n)||w(n)}function a(n){return n==null}function D(...n){return n.filter(Boolean).join("__")}const r={Upstream:"upstream",Downstream:"downstream"},m=self;m.onmessage=async n=>{if(n.data.topic==="lineage")try{const{currentLineage:t,newLineage:s,mainNode:o}=n.data.payload,e=await g(t,s),c=await N(o,e);m.postMessage({topic:"lineage",payload:{lineage:e,nodesConnections:c}})}catch(t){m.postMessage({topic:"error",error:t})}};async function g(n={},t={}){return Object.entries(t).reduce((s,[o,e=[]])=>{var c;return o=encodeURI(o),s[o]={models:e.map(encodeURI),columns:((c=n==null?void 0:n[o])==null?void 0:c.columns)??void 0},s},{})}async function N(n,t={}){return new Promise((s,o)=>{if(a(t)||a(n))return{};const e={};try{f(r.Upstream,n,t,e),f(r.Downstream,n,t,e)}catch(c){o(c)}s(e)})}function f(n=r.Downstream,t,s={},o={}){var u;const e=n===r.Downstream;let c=[];e?c=Object.keys(s).filter(i=>s[i].models.includes(t)):c=((u=s[t])==null?void 0:u.models)??[],l(t in o)&&(o[t]=d());for(const i of c){const p=e?d(t,i,[o[t]]):d(i,t,[o[t]]);i in o?o[i].edges.push(p):(o[i]=p,f(n,i,s,o))}}function d(n,t,s=[]){const o=D(n,t);return{id:y(o)?void 0:o,edges:s}}})();
|
|
2
2
|
`,r=typeof self<"u"&&self.Blob&&new Blob([I],{type:"text/javascript;charset=utf-8"});function F(t){let s;try{if(s=r&&(self.URL||self.webkitURL).createObjectURL(r),!s)throw"";const e=new Worker(s,{name:t==null?void 0:t.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(s)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(I),{name:t==null?void 0:t.name})}finally{s&&(self.URL||self.webkitURL).revokeObjectURL(s)}}const b=`(function(){"use strict";const g=self;import("https://cdn.jsdelivr.net/pyodide/v0.23.2/full/pyodide.js").then(()=>{const c=s();g.onmessage=async a=>{var i,l,t;const{sqlglot:C}=await c;if(a.data.topic==="validate"){let I;try{I=JSON.parse((i=C.get("validate"))==null?void 0:i(a.data.payload))}catch{I=!1}g.postMessage({topic:"validate",payload:I})}if(a.data.topic==="dialect"){let I;try{I=JSON.parse((l=C.get("get_dialect"))==null?void 0:l(a.data.payload))}catch{I={keywords:"",types:""}}g.postMessage({topic:"dialect",payload:I})}if(a.data.topic==="dialects"){let I;try{I=JSON.parse(C.get("dialects"))}catch{I=[]}g.postMessage({topic:"dialects",payload:I})}a.data.topic==="format"&&g.postMessage({topic:"format",payload:((t=C.get("format"))==null?void 0:t(a.data.payload.sql,a.data.payload.dialect))??""}),a.data.topic==="init"&&g.postMessage({topic:"init"})}}).catch(console.error);async function s(){g.pyodide=await g.loadPyodide(),await g.pyodide.loadPackage("micropip");const c=g.pyodide.pyimport("micropip");await c.install("sqlglot"),await c.install("typing-extensions");const a=await(await fetch(new URL("data:application/octet-stream;base64,aW1wb3J0IGpzb24KCmltcG9ydCBzcWxnbG90CmZyb20gc3FsZ2xvdCBpbXBvcnQgZXhwCmZyb20gc3FsZ2xvdC5kaWFsZWN0cy5kaWFsZWN0IGltcG9ydCBEaWFsZWN0LCBEaWFsZWN0VHlwZQoKZGlhbGVjdHMgPSBqc29uLmR1bXBzKAogICAgWwogICAgICAgIHsKICAgICAgICAgICAgImRpYWxlY3RfdGl0bGUiOiAiU1FMR2xvdCIgaWYgZGlhbGVjdCA9PSAiIiBlbHNlIGRpYWxlY3RfY2xhc3MuX19uYW1lX18sCiAgICAgICAgICAgICJkaWFsZWN0X25hbWUiOiBkaWFsZWN0LAogICAgICAgIH0KICAgICAgICBmb3IgZGlhbGVjdCwgZGlhbGVjdF9jbGFzcyBpbiBEaWFsZWN0LmNsYXNzZXMuaXRlbXMoKQogICAgXQopCgoKZGVmIHBhcnNlX3RvX2pzb24oc3FsOiBzdHIsIHJlYWQ6IERpYWxlY3RUeXBlID0gTm9uZSkgLT4gc3RyOgogICAgcmV0dXJuIGpzb24uZHVtcHMoCiAgICAgICAgW2V4cC5kdW1wKCkgaWYgZXhwIGVsc2Uge30gZm9yIGV4cCBpbiBzcWxnbG90LnBhcnNlKHNxbCwgcmVhZD1yZWFkLCBlcnJvcl9sZXZlbD0iaWdub3JlIildCiAgICApCgoKZGVmIGdldF9kaWFsZWN0KG5hbWU6IHN0ciA9ICIiKSAtPiBzdHI6CiAgICBkaWFsZWN0ID0gRGlhbGVjdC5jbGFzc2VzLmdldChuYW1lLCBEaWFsZWN0KQogICAga2V5d29yZHMgPSBkaWFsZWN0LnRva2VuaXplcl9jbGFzcy5LRVlXT1JEUwogICAgdHlwZV9tYXBwaW5nID0gZGlhbGVjdC5nZW5lcmF0b3JfY2xhc3MuVFlQRV9NQVBQSU5HCgogICAgcmV0dXJuIGpzb24uZHVtcHMoCiAgICAgICAgewogICAgICAgICAgICAia2V5d29yZHMiOiAiICIuam9pbihrZXl3b3JkcyksCiAgICAgICAgICAgICJ0eXBlcyI6ICIgIi5qb2luKHR5cGVfbWFwcGluZy5nZXQodCwgdC52YWx1ZSkgZm9yIHQgaW4gZXhwLkRhdGFUeXBlLlR5cGUpLAogICAgICAgIH0KICAgICkKCgpkZWYgZm9ybWF0KHNxbDogc3RyID0gIiIsIHJlYWQ6IERpYWxlY3RUeXBlID0gTm9uZSkgLT4gc3RyOgogICAgcmV0dXJuICJcbiIuam9pbigKICAgICAgICBzcWxnbG90LnRyYW5zcGlsZShzcWwsIHJlYWQ9cmVhZCwgZXJyb3JfbGV2ZWw9c3FsZ2xvdC5lcnJvcnMuRXJyb3JMZXZlbC5JR05PUkUsIHByZXR0eT1UcnVlKQogICAgKQoKCmRlZiB2YWxpZGF0ZShzcWw6IHN0ciA9ICIiLCByZWFkOiBEaWFsZWN0VHlwZSA9IE5vbmUpIC0+IHN0cjoKICAgIHRyeToKICAgICAgICBzcWxnbG90LnRyYW5zcGlsZSgKICAgICAgICAgICAgc3FsLCByZWFkPXJlYWQsIHByZXR0eT1GYWxzZSwgdW5zdXBwb3J0ZWRfbGV2ZWw9c3FsZ2xvdC5lcnJvcnMuRXJyb3JMZXZlbC5JTU1FRElBVEUKICAgICAgICApCiAgICBleGNlcHQgc3FsZ2xvdC5lcnJvcnMuUGFyc2VFcnJvcjoKICAgICAgICByZXR1cm4ganNvbi5kdW1wcyhGYWxzZSkKCiAgICByZXR1cm4ganNvbi5kdW1wcyhUcnVlKQoKCnsKICAgICJkaWFsZWN0cyI6IGRpYWxlY3RzLAogICAgImdldF9kaWFsZWN0IjogZ2V0X2RpYWxlY3QsCiAgICAicGFyc2VfdG9fanNvbiI6IHBhcnNlX3RvX2pzb24sCiAgICAidmFsaWRhdGUiOiB2YWxpZGF0ZSwKICAgICJmb3JtYXQiOiBmb3JtYXQsCn0K",self.location.href))).text();return g.postMessage({topic:"init"}),{sqlglot:g.pyodide.runPython(a)}}})();
|
|
3
3
|
`,d=typeof self<"u"&&self.Blob&&new Blob([b],{type:"text/javascript;charset=utf-8"});function w(t){let s;try{if(s=d&&(self.URL||self.webkitURL).createObjectURL(d),!s)throw"";const e=new Worker(s,{name:t==null?void 0:t.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(s)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(b),{name:t==null?void 0:t.name})}finally{s&&(self.URL||self.webkitURL).revokeObjectURL(s)}}const R=w(),[v,g]=y("tabs"),{tabs:h=[],id:G}=v()??{},C=p(),f=u(C),B=new Map([[C,f]]),U=W((t,s)=>({storedTabs:h,storedTabId:G,tab:f,tabs:B,engine:R,dialects:[],previewQuery:void 0,previewTable:void 0,previewDiff:void 0,direction:"vertical",inTabs(e){return s().tabs.has(e)},replaceTab(e,a){const n=s(),i=Array.from(n.tabs.entries()),o=i.findIndex(([c])=>c===e.file);i[o]=[a.file,a],t(()=>({tabs:new Map(i)})),n.updateStoredTabsIds()},updateStoredTabsIds(){const e=s();if(l(e.tab)){g({id:void 0,tabs:[]}),t(()=>({storedTabId:void 0,storedTabs:[]}));return}const a=[];for(const i of e.tabs.values())m(i.file.isChanged)&&i.file.isLocal||a.push({id:i.file.id,content:i.file.content});const n=e.tab.file.isChanged||e.tab.file.isRemote?e.tab.file.id:void 0;g({id:n,tabs:a}),t(()=>({storedTabId:n,storedTabs:a}))},refreshTab(e){l(e)||s().selectTab({...e})},setDialects(e){t(()=>({dialects:e}))},selectTab(e){const a=s();t(()=>({tab:e})),a.updateStoredTabsIds()},addTabs(e){const a=s();for(const n of e)a.tabs.set(n.file,n);t(()=>({tabs:new Map(a.tabs)}))},addTab(e){const a=s();if(a.tabs.has(e.file))a.tabs.set(e.file,e),t(()=>({tabs:new Map(a.tabs)}));else{const n=Array.from(a.tabs.entries()),i=n.findIndex(([o])=>{var c;return o===((c=a.tab)==null?void 0:c.file)});n.splice(i<0?n.length:i+1,0,[e.file,e]),t(()=>({tabs:new Map(n)}))}a.updateStoredTabsIds()},closeTab(e){var n;const a=s();if(e.removeChanges(),a.tabs.delete(e),a.tabs.size===0)a.selectTab(void 0);else if(a.tabs.size===1){const i=Array.from(a.tabs.values());a.selectTab(i.at(0))}else if(e.id===((n=a.tab)==null?void 0:n.file.id)){const i=Array.from(a.tabs.values()),o=i.findIndex(c=>c.file===e);a.selectTab(i.at(o-1))}t(()=>({tabs:new Map(a.tabs)})),a.updateStoredTabsIds()},createTab:u,setPreviewQuery(e){t(()=>({previewQuery:e}))},setPreviewTable(e){t(()=>({previewTable:e}))},setPreviewDiff(e){t(()=>({previewDiff:e}))},setDirection(e){t(()=>({direction:e}))}}));function u(t=p()){return{id:A(),file:t,isValid:!0}}function p(t){return new Z({id:t,name:"",path:"",content:`-- Create arbitrary SQL queries
|
|
4
4
|
-- and execute them against different environments
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=Object.defineProperty;var g=(r,e,t)=>e in r?u(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var h=(r,e,t)=>g(r,typeof e!="symbol"?e+"":e,t);import{$ as _,I as x,a8 as m,a9 as n,aa as c,W as d,b as f}from"./index-
|
|
1
|
+
var u=Object.defineProperty;var g=(r,e,t)=>e in r?u(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var h=(r,e,t)=>g(r,typeof e!="symbol"?e+"":e,t);import{$ as _,I as x,a8 as m,a9 as n,aa as c,W as d,b as f}from"./index-M-fcEAWc.js";class y extends _{constructor(t,s){super(t!=null&&t.isModel?t.initial:{...t,name:(t==null?void 0:t.name)??"",path:(t==null?void 0:t.path)??""});h(this,"_path");h(this,"_name");h(this,"parent");h(this,"remove",!1);this._path=(t==null?void 0:t.path)??this.initial.path,this._name=(t==null?void 0:t.name)??this.initial.name,this.parent=s}get id(){return x(this.path)?this.initial.id:this.path}get name(){return this._name}get path(){return this._path}get isUntitled(){return this.name===""}get isLocal(){return this.path===""}get isRemote(){return this.path!==""}get withParent(){var t;return!!((t=this.parent)!=null&&t.isModel)}copyName(){return`Copy of ${this.name}__${m()}`}rename(t){this.isRemote&&(this._path=this._path.replace(this.name,t)),this._name=t}static findArtifactByPath(t,s){return t.path===s?t:t.allArtifacts.find(a=>a.path===s)}}const p={SQL:".sql",PY:".py",YAML:".yaml",YML:".yml"};class o extends y{constructor(t,s){super(o.getInitialArtifact(t),s);h(this,"_content","");h(this,"content");h(this,"extension");h(this,"isFormatted");this.content=this._content=n((t==null?void 0:t.content)??this.initial.content),this.extension=n((t==null?void 0:t.extension)??this.initial.extension),this.isFormatted=t==null?void 0:t.isFormatted}get basename(){return this.name.replace(this.extension,"")}get isEmpty(){return c(this.content)}get isChanged(){return d(this._content)&&this.content!==this._content}get isSQL(){return this.extension===p.SQL}get fingerprint(){return`${this._content}${this.name}${this.path}`}removeChanges(){this.content=this._content}copyName(){return`Copy of ${n(this.name.split(this.extension)[0])}__${m()}${this.extension}`}update(t){const s=n(t==null?void 0:t.content);(c(this._content)||f(this.isChanged))&&(this.content=s),this._content=s,this.extension=n(t==null?void 0:t.extension)}static getInitialArtifact(t){return o.isModelFile(t)?t.initial:{name:n(t==null?void 0:t.name),path:n(t==null?void 0:t.path),extension:(t==null?void 0:t.extension)??p.SQL,content:n(t==null?void 0:t.content)}}static isModelFile(t){return t instanceof o}}export{p as E,o as M,y as a};
|
web/client/dist/assets/{floating-ui.react-dom-CN8_HaDW.js → floating-ui.react-dom-8hwAvuN1.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ax as It,a1 as Yt,r as S}from"./index-DGopuBhO.js";var kt=It();const Be=Yt(kt);function at(){return typeof window<"u"}function tt(t){return Ft(t)?(t.nodeName||"").toLowerCase():"#document"}function $(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function I(t){var e;return(e=(Ft(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ft(t){return at()?t instanceof Node||t instanceof $(t).Node:!1}function H(t){return at()?t instanceof Element||t instanceof $(t).Element:!1}function j(t){return at()?t instanceof HTMLElement||t instanceof $(t).HTMLElement:!1}function Ct(t){return!at()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof $(t).ShadowRoot}function ot(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=N(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function qt(t){return["table","td","th"].includes(tt(t))}function ut(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function xt(t){const e=yt(),n=H(t)?N(t):t;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Xt(t){let e=U(t);for(;j(e)&&!Q(e);){if(xt(e))return e;if(ut(e))return null;e=U(e)}return null}function yt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Q(t){return["html","body","#document"].includes(tt(t))}function N(t){return $(t).getComputedStyle(t)}function dt(t){return H(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function U(t){if(tt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ct(t)&&t.host||I(t);return Ct(e)?e.host:e}function $t(t){const e=U(t);return Q(e)?t.ownerDocument?t.ownerDocument.body:t.body:j(e)&&ot(e)?e:$t(e)}function nt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=$t(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=$(i);if(r){const c=ht(s);return e.concat(s,s.visualViewport||[],ot(i)?i:[],c&&n?nt(c):[])}return e.concat(i,nt(i,[],n))}function ht(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const Ut=["top","right","bottom","left"],K=Math.min,F=Math.max,st=Math.round,it=Math.floor,z=t=>({x:t,y:t}),Kt={left:"right",right:"left",bottom:"top",top:"bottom"},Gt={start:"end",end:"start"};function pt(t,e,n){return F(t,K(e,n))}function Y(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function vt(t){return t==="x"?"y":"x"}function bt(t){return t==="y"?"height":"width"}function _(t){return["top","bottom"].includes(q(t))?"y":"x"}function At(t){return vt(_(t))}function Jt(t,e,n){n===void 0&&(n=!1);const o=et(t),i=At(t),r=bt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ct(s)),[s,ct(s)]}function Qt(t){const e=ct(t);return[wt(t),e,wt(e)]}function wt(t){return t.replace(/start|end/g,e=>Gt[e])}function Zt(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:s;default:return[]}}function te(t,e,n,o){const i=et(t);let r=Zt(q(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(wt)))),r}function ct(t){return t.replace(/left|right|bottom|top/g,e=>Kt[e])}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Wt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function lt(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:i}=t;const r=_(e),s=At(e),c=bt(s),f=q(e),l=r==="y",a=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2;let u;switch(f){case"top":u={x:a,y:o.y-i.height};break;case"bottom":u={x:a,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:d};break;case"left":u={x:o.x-i.width,y:d};break;default:u={x:o.x,y:o.y}}switch(et(e)){case"start":u[s]-=m*(n&&l?-1:1);break;case"end":u[s]+=m*(n&&l?-1:1);break}return u}const ne=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),f=await(s.isRTL==null?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:a,y:d}=Et(l,o,f),m=o,u={},g=0;for(let h=0;h<c.length;h++){const{name:p,fn:w}=c[h],{x,y:v,data:b,reset:y}=await w({x:a,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:u,rects:l,platform:s,elements:{reference:t,floating:e}});a=x??a,d=v??d,u={...u,[p]:{...u[p],...b}},y&&g<=50&&(g++,typeof y=="object"&&(y.placement&&(m=y.placement),y.rects&&(l=y.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):y.rects),{x:a,y:d}=Et(l,m,f)),h=-1)}return{x:a,y:d,placement:m,strategy:i,middlewareData:u}};async function Z(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:c,strategy:f}=t,{boundary:l="clippingAncestors",rootBoundary:a="viewport",elementContext:d="floating",altBoundary:m=!1,padding:u=0}=Y(e,t),g=Wt(u),p=c[m?d==="floating"?"reference":"floating":d],w=lt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(p)))==null||n?p:p.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:l,rootBoundary:a,strategy:f})),x=d==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),b=await(r.isElement==null?void 0:r.isElement(v))?await(r.getScale==null?void 0:r.getScale(v))||{x:1,y:1}:{x:1,y:1},y=lt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:v,strategy:f}):x);return{top:(w.top-y.top+g.top)/b.y,bottom:(y.bottom-w.bottom+g.bottom)/b.y,left:(w.left-y.left+g.left)/b.x,right:(y.right-w.right+g.right)/b.x}}const oe=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:f}=e,{element:l,padding:a=0}=Y(t,e)||{};if(l==null)return{};const d=Wt(a),m={x:n,y:o},u=At(i),g=bt(u),h=await s.getDimensions(l),p=u==="y",w=p?"top":"left",x=p?"bottom":"right",v=p?"clientHeight":"clientWidth",b=r.reference[g]+r.reference[u]-m[u]-r.floating[g],y=m[u]-r.reference[u],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let R=O?O[v]:0;(!R||!await(s.isElement==null?void 0:s.isElement(O)))&&(R=c.floating[v]||r.floating[g]);const L=b/2-y/2,W=R/2-h[g]/2-1,D=K(d[w],W),B=K(d[x],W),M=D,T=R-h[g]-B,C=R/2-h[g]/2+L,V=pt(M,C,T),E=!f.arrow&&et(i)!=null&&C!==V&&r.reference[g]/2-(C<M?D:B)-h[g]/2<0,P=E?C<M?C-M:C-T:0;return{[u]:m[u]+P,data:{[u]:V,centerOffset:C-V-P,...E&&{alignmentOffset:P}},reset:E}}}),ie=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:f,elements:l}=e,{mainAxis:a=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...p}=Y(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const w=q(i),x=_(c),v=q(c)===c,b=await(f.isRTL==null?void 0:f.isRTL(l.floating)),y=m||(v||!h?[ct(c)]:Qt(c)),O=g!=="none";!m&&O&&y.push(...te(c,h,g,b));const R=[c,...y],L=await Z(e,p),W=[];let D=((o=r.flip)==null?void 0:o.overflows)||[];if(a&&W.push(L[w]),d){const C=Jt(i,s,b);W.push(L[C[0]],L[C[1]])}if(D=[...D,{placement:i,overflows:W}],!W.every(C=>C<=0)){var B,M;const C=(((B=r.flip)==null?void 0:B.index)||0)+1,V=R[C];if(V&&(!(d==="alignment"?x!==_(V):!1)||D.every(A=>A.overflows[0]>0&&_(A.placement)===x)))return{data:{index:C,overflows:D},reset:{placement:V}};let E=(M=D.filter(P=>P.overflows[0]<=0).sort((P,A)=>P.overflows[1]-A.overflows[1])[0])==null?void 0:M.placement;if(!E)switch(u){case"bestFit":{var T;const P=(T=D.filter(A=>{if(O){const k=_(A.placement);return k===x||k==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(k=>k>0).reduce((k,X)=>k+X,0)]).sort((A,k)=>A[1]-k[1])[0])==null?void 0:T[0];P&&(E=P);break}case"initialPlacement":E=c;break}if(i!==E)return{reset:{placement:E}}}return{}}}};function St(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Dt(t){return Ut.some(e=>t[e]>=0)}const re=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=Y(t,e);switch(o){case"referenceHidden":{const r=await Z(e,{...i,elementContext:"reference"}),s=St(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Dt(s)}}}case"escaped":{const r=await Z(e,{...i,altBoundary:!0}),s=St(r,n.floating);return{data:{escapedOffsets:s,escaped:Dt(s)}}}default:return{}}}}};async function se(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=q(n),c=et(n),f=_(n)==="y",l=["left","top"].includes(s)?-1:1,a=r&&f?-1:1,d=Y(e,t);let{mainAxis:m,crossAxis:u,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof g=="number"&&(u=c==="end"?g*-1:g),f?{x:u*a,y:m*l}:{x:m*l,y:u*a}}const ce=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:c}=e,f=await se(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+f.x,y:r+f.y,data:{...f,placement:s}}}}},le=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:p=>{let{x:w,y:x}=p;return{x:w,y:x}}},...f}=Y(t,e),l={x:n,y:o},a=await Z(e,f),d=_(q(i)),m=vt(d);let u=l[m],g=l[d];if(r){const p=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=u+a[p],v=u-a[w];u=pt(x,u,v)}if(s){const p=d==="y"?"top":"left",w=d==="y"?"bottom":"right",x=g+a[p],v=g-a[w];g=pt(x,g,v)}const h=c.fn({...e,[m]:u,[d]:g});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[m]:r,[d]:s}}}}}},fe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:c=0,mainAxis:f=!0,crossAxis:l=!0}=Y(t,e),a={x:n,y:o},d=_(i),m=vt(d);let u=a[m],g=a[d];const h=Y(c,e),p=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(f){const v=m==="y"?"height":"width",b=r.reference[m]-r.floating[v]+p.mainAxis,y=r.reference[m]+r.reference[v]-p.mainAxis;u<b?u=b:u>y&&(u=y)}if(l){var w,x;const v=m==="y"?"width":"height",b=["top","left"].includes(q(i)),y=r.reference[d]-r.floating[v]+(b&&((w=s.offset)==null?void 0:w[d])||0)+(b?0:p.crossAxis),O=r.reference[d]+r.reference[v]+(b?0:((x=s.offset)==null?void 0:x[d])||0)-(b?p.crossAxis:0);g<y?g=y:g>O&&(g=O)}return{[m]:u,[d]:g}}}},ae=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:c}=e,{apply:f=()=>{},...l}=Y(t,e),a=await Z(e,l),d=q(i),m=et(i),u=_(i)==="y",{width:g,height:h}=r.floating;let p,w;d==="top"||d==="bottom"?(p=d,w=m===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(w=d,p=m==="end"?"top":"bottom");const x=h-a.top-a.bottom,v=g-a.left-a.right,b=K(h-a[p],x),y=K(g-a[w],v),O=!e.middlewareData.shift;let R=b,L=y;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(L=v),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(R=x),O&&!m){const D=F(a.left,0),B=F(a.right,0),M=F(a.top,0),T=F(a.bottom,0);u?L=g-2*(D!==0||B!==0?D+B:F(a.left,a.right)):R=h-2*(M!==0||T!==0?M+T:F(a.top,a.bottom))}await f({...e,availableWidth:L,availableHeight:R});const W=await s.getDimensions(c.floating);return g!==W.width||h!==W.height?{reset:{rects:!0}}:{}}}};function Bt(t){const e=N(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=j(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=st(n)!==r||st(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function Rt(t){return H(t)?t:t.contextElement}function J(t){const e=Rt(t);if(!j(e))return z(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Bt(e);let s=(r?st(n.width):n.width)/o,c=(r?st(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const ue=z(0);function Ht(t){const e=$(t);return!yt()||!e.visualViewport?ue:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function de(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==$(t)?!1:e}function G(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Rt(t);let s=z(1);e&&(o?H(o)&&(s=J(o)):s=J(t));const c=de(r,n,o)?Ht(r):z(0);let f=(i.left+c.x)/s.x,l=(i.top+c.y)/s.y,a=i.width/s.x,d=i.height/s.y;if(r){const m=$(r),u=o&&H(o)?$(o):o;let g=m,h=ht(g);for(;h&&o&&u!==g;){const p=J(h),w=h.getBoundingClientRect(),x=N(h),v=w.left+(h.clientLeft+parseFloat(x.paddingLeft))*p.x,b=w.top+(h.clientTop+parseFloat(x.paddingTop))*p.y;f*=p.x,l*=p.y,a*=p.x,d*=p.y,f+=v,l+=b,g=$(h),h=ht(g)}}return lt({width:a,height:d,x:f,y:l})}function Ot(t,e){const n=dt(t).scrollLeft;return e?e.left+n:G(I(t)).left+n}function Nt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=o.left+e.scrollLeft-(n?0:Ot(t,o)),r=o.top+e.scrollTop;return{x:i,y:r}}function me(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=I(o),c=e?ut(e.floating):!1;if(o===s||c&&r)return n;let f={scrollLeft:0,scrollTop:0},l=z(1);const a=z(0),d=j(o);if((d||!d&&!r)&&((tt(o)!=="body"||ot(s))&&(f=dt(o)),j(o))){const u=G(o);l=J(o),a.x=u.x+o.clientLeft,a.y=u.y+o.clientTop}const m=s&&!d&&!r?Nt(s,f,!0):z(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-f.scrollLeft*l.x+a.x+m.x,y:n.y*l.y-f.scrollTop*l.y+a.y+m.y}}function ge(t){return Array.from(t.getClientRects())}function he(t){const e=I(t),n=dt(t),o=t.ownerDocument.body,i=F(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=F(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Ot(t);const c=-n.scrollTop;return N(o).direction==="rtl"&&(s+=F(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}function pe(t,e){const n=$(t),o=I(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,c=0,f=0;if(i){r=i.width,s=i.height;const l=yt();(!l||l&&e==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}return{width:r,height:s,x:c,y:f}}function we(t,e){const n=G(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=j(t)?J(t):z(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,f=i*r.x,l=o*r.y;return{width:s,height:c,x:f,y:l}}function Lt(t,e,n){let o;if(e==="viewport")o=pe(t,n);else if(e==="document")o=he(I(t));else if(H(e))o=we(e,n);else{const i=Ht(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return lt(o)}function Vt(t,e){const n=U(t);return n===e||!H(n)||Q(n)?!1:N(n).position==="fixed"||Vt(n,e)}function xe(t,e){const n=e.get(t);if(n)return n;let o=nt(t,[],!1).filter(c=>H(c)&&tt(c)!=="body"),i=null;const r=N(t).position==="fixed";let s=r?U(t):t;for(;H(s)&&!Q(s);){const c=N(s),f=xt(s);!f&&c.position==="fixed"&&(i=null),(r?!f&&!i:!f&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ot(s)&&!f&&Vt(t,s))?o=o.filter(a=>a!==s):i=c,s=U(s)}return e.set(t,o),o}function ye(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?ut(e)?[]:xe(e,this._c):[].concat(n),o],c=s[0],f=s.reduce((l,a)=>{const d=Lt(e,a,i);return l.top=F(d.top,l.top),l.right=K(d.right,l.right),l.bottom=K(d.bottom,l.bottom),l.left=F(d.left,l.left),l},Lt(e,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function ve(t){const{width:e,height:n}=Bt(t);return{width:e,height:n}}function be(t,e,n){const o=j(e),i=I(e),r=n==="fixed",s=G(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const f=z(0);function l(){f.x=Ot(i)}if(o||!o&&!r)if((tt(e)!=="body"||ot(i))&&(c=dt(e)),o){const u=G(e,!0,r,e);f.x=u.x+e.clientLeft,f.y=u.y+e.clientTop}else i&&l();r&&!o&&i&&l();const a=i&&!o&&!r?Nt(i,c):z(0),d=s.left+c.scrollLeft-f.x-a.x,m=s.top+c.scrollTop-f.y-a.y;return{x:d,y:m,width:s.width,height:s.height}}function mt(t){return N(t).position==="static"}function Tt(t,e){if(!j(t)||N(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return I(t)===n&&(n=n.ownerDocument.body),n}function _t(t,e){const n=$(t);if(ut(t))return n;if(!j(t)){let i=U(t);for(;i&&!Q(i);){if(H(i)&&!mt(i))return i;i=U(i)}return n}let o=Tt(t,e);for(;o&&qt(o)&&mt(o);)o=Tt(o,e);return o&&Q(o)&&mt(o)&&!xt(o)?n:o||Xt(t)||n}const Ae=async function(t){const e=this.getOffsetParent||_t,n=this.getDimensions,o=await n(t.floating);return{reference:be(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Re(t){return N(t).direction==="rtl"}const Oe={convertOffsetParentRelativeRectToViewportRelativeRect:me,getDocumentElement:I,getClippingRect:ye,getOffsetParent:_t,getElementRects:Ae,getClientRects:ge,getDimensions:ve,getScale:J,isElement:H,isRTL:Re};function zt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ce(t,e){let n=null,o;const i=I(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),r();const l=t.getBoundingClientRect(),{left:a,top:d,width:m,height:u}=l;if(c||e(),!m||!u)return;const g=it(d),h=it(i.clientWidth-(a+m)),p=it(i.clientHeight-(d+u)),w=it(a),v={rootMargin:-g+"px "+-h+"px "+-p+"px "+-w+"px",threshold:F(0,K(1,f))||1};let b=!0;function y(O){const R=O[0].intersectionRatio;if(R!==f){if(!b)return s();R?s(!1,R):o=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!zt(l,t.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(y,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(y,v)}n.observe(t)}return s(!0),r}function He(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,l=Rt(t),a=i||r?[...l?nt(l):[],...nt(e)]:[];a.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const d=l&&c?Ce(l,n):null;let m=-1,u=null;s&&(u=new ResizeObserver(w=>{let[x]=w;x&&x.target===l&&u&&(u.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=u)==null||v.observe(e)})),n()}),l&&!f&&u.observe(l),u.observe(e));let g,h=f?G(t):null;f&&p();function p(){const w=G(t);h&&!zt(h,w)&&n(),h=w,g=requestAnimationFrame(p)}return n(),()=>{var w;a.forEach(x=>{i&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),d==null||d(),(w=u)==null||w.disconnect(),u=null,f&&cancelAnimationFrame(g)}}const Ne=Z,Ee=ce,Se=le,De=ie,Le=ae,Te=re,Pt=oe,Pe=fe,Me=(t,e,n)=>{const o=new Map,i={platform:Oe,...n},r={...i.platform,_c:o};return ne(t,e,{...i,platform:r})};var ke=typeof document<"u",Fe=function(){},rt=ke?S.useLayoutEffect:Fe;function ft(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!ft(t[o],e[o]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,i[o]))return!1;for(o=n;o--!==0;){const r=i[o];if(!(r==="_owner"&&t.$$typeof)&&!ft(t[r],e[r]))return!1}return!0}return t!==t&&e!==e}function jt(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Mt(t,e){const n=jt(t);return Math.round(e*n)/n}function gt(t){const e=S.useRef(t);return rt(()=>{e.current=t}),e}function Ve(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:r,floating:s}={},transform:c=!0,whileElementsMounted:f,open:l}=t,[a,d]=S.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,u]=S.useState(o);ft(m,o)||u(o);const[g,h]=S.useState(null),[p,w]=S.useState(null),x=S.useCallback(A=>{A!==O.current&&(O.current=A,h(A))},[]),v=S.useCallback(A=>{A!==R.current&&(R.current=A,w(A))},[]),b=r||g,y=s||p,O=S.useRef(null),R=S.useRef(null),L=S.useRef(a),W=f!=null,D=gt(f),B=gt(i),M=gt(l),T=S.useCallback(()=>{if(!O.current||!R.current)return;const A={placement:e,strategy:n,middleware:m};B.current&&(A.platform=B.current),Me(O.current,R.current,A).then(k=>{const X={...k,isPositioned:M.current!==!1};C.current&&!ft(L.current,X)&&(L.current=X,kt.flushSync(()=>{d(X)}))})},[m,e,n,B,M]);rt(()=>{l===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,d(A=>({...A,isPositioned:!1})))},[l]);const C=S.useRef(!1);rt(()=>(C.current=!0,()=>{C.current=!1}),[]),rt(()=>{if(b&&(O.current=b),y&&(R.current=y),b&&y){if(D.current)return D.current(b,y,T);T()}},[b,y,T,D,W]);const V=S.useMemo(()=>({reference:O,floating:R,setReference:x,setFloating:v}),[x,v]),E=S.useMemo(()=>({reference:b,floating:y}),[b,y]),P=S.useMemo(()=>{const A={position:n,left:0,top:0};if(!E.floating)return A;const k=Mt(E.floating,a.x),X=Mt(E.floating,a.y);return c?{...A,transform:"translate("+k+"px, "+X+"px)",...jt(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:X}},[n,c,E.floating,a.x,a.y]);return S.useMemo(()=>({...a,update:T,refs:V,elements:E,floatingStyles:P}),[a,T,V,E,P])}const $e=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:i}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?Pt({element:o.current,padding:i}).fn(n):{}:o?Pt({element:o,padding:i}).fn(n):{}}}},_e=(t,e)=>({...Ee(t),options:[t,e]}),ze=(t,e)=>({...Se(t),options:[t,e]}),je=(t,e)=>({...Pe(t),options:[t,e]}),Ie=(t,e)=>({...De(t),options:[t,e]}),Ye=(t,e)=>({...Le(t),options:[t,e]}),qe=(t,e)=>({...Te(t),options:[t,e]}),Xe=(t,e)=>({...$e(t),options:[t,e]});export{Be as R,Ye as a,Xe as b,He as c,Ne as d,Y as e,Ie as f,st as g,qe as h,H as i,K as j,je as l,F as m,_e as o,kt as r,ze as s,Ve as u};
|
|
1
|
+
import{ax as It,a1 as Yt,r as S}from"./index-M-fcEAWc.js";var kt=It();const Be=Yt(kt);function at(){return typeof window<"u"}function tt(t){return Ft(t)?(t.nodeName||"").toLowerCase():"#document"}function $(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function I(t){var e;return(e=(Ft(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ft(t){return at()?t instanceof Node||t instanceof $(t).Node:!1}function H(t){return at()?t instanceof Element||t instanceof $(t).Element:!1}function j(t){return at()?t instanceof HTMLElement||t instanceof $(t).HTMLElement:!1}function Ct(t){return!at()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof $(t).ShadowRoot}function ot(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=N(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function qt(t){return["table","td","th"].includes(tt(t))}function ut(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function xt(t){const e=yt(),n=H(t)?N(t):t;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Xt(t){let e=U(t);for(;j(e)&&!Q(e);){if(xt(e))return e;if(ut(e))return null;e=U(e)}return null}function yt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Q(t){return["html","body","#document"].includes(tt(t))}function N(t){return $(t).getComputedStyle(t)}function dt(t){return H(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function U(t){if(tt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ct(t)&&t.host||I(t);return Ct(e)?e.host:e}function $t(t){const e=U(t);return Q(e)?t.ownerDocument?t.ownerDocument.body:t.body:j(e)&&ot(e)?e:$t(e)}function nt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=$t(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=$(i);if(r){const c=ht(s);return e.concat(s,s.visualViewport||[],ot(i)?i:[],c&&n?nt(c):[])}return e.concat(i,nt(i,[],n))}function ht(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const Ut=["top","right","bottom","left"],K=Math.min,F=Math.max,st=Math.round,it=Math.floor,z=t=>({x:t,y:t}),Kt={left:"right",right:"left",bottom:"top",top:"bottom"},Gt={start:"end",end:"start"};function pt(t,e,n){return F(t,K(e,n))}function Y(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function vt(t){return t==="x"?"y":"x"}function bt(t){return t==="y"?"height":"width"}function _(t){return["top","bottom"].includes(q(t))?"y":"x"}function At(t){return vt(_(t))}function Jt(t,e,n){n===void 0&&(n=!1);const o=et(t),i=At(t),r=bt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ct(s)),[s,ct(s)]}function Qt(t){const e=ct(t);return[wt(t),e,wt(e)]}function wt(t){return t.replace(/start|end/g,e=>Gt[e])}function Zt(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:s;default:return[]}}function te(t,e,n,o){const i=et(t);let r=Zt(q(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(wt)))),r}function ct(t){return t.replace(/left|right|bottom|top/g,e=>Kt[e])}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Wt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function lt(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:i}=t;const r=_(e),s=At(e),c=bt(s),f=q(e),l=r==="y",a=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2;let u;switch(f){case"top":u={x:a,y:o.y-i.height};break;case"bottom":u={x:a,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:d};break;case"left":u={x:o.x-i.width,y:d};break;default:u={x:o.x,y:o.y}}switch(et(e)){case"start":u[s]-=m*(n&&l?-1:1);break;case"end":u[s]+=m*(n&&l?-1:1);break}return u}const ne=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),f=await(s.isRTL==null?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:a,y:d}=Et(l,o,f),m=o,u={},g=0;for(let h=0;h<c.length;h++){const{name:p,fn:w}=c[h],{x,y:v,data:b,reset:y}=await w({x:a,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:u,rects:l,platform:s,elements:{reference:t,floating:e}});a=x??a,d=v??d,u={...u,[p]:{...u[p],...b}},y&&g<=50&&(g++,typeof y=="object"&&(y.placement&&(m=y.placement),y.rects&&(l=y.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):y.rects),{x:a,y:d}=Et(l,m,f)),h=-1)}return{x:a,y:d,placement:m,strategy:i,middlewareData:u}};async function Z(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:c,strategy:f}=t,{boundary:l="clippingAncestors",rootBoundary:a="viewport",elementContext:d="floating",altBoundary:m=!1,padding:u=0}=Y(e,t),g=Wt(u),p=c[m?d==="floating"?"reference":"floating":d],w=lt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(p)))==null||n?p:p.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:l,rootBoundary:a,strategy:f})),x=d==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),b=await(r.isElement==null?void 0:r.isElement(v))?await(r.getScale==null?void 0:r.getScale(v))||{x:1,y:1}:{x:1,y:1},y=lt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:v,strategy:f}):x);return{top:(w.top-y.top+g.top)/b.y,bottom:(y.bottom-w.bottom+g.bottom)/b.y,left:(w.left-y.left+g.left)/b.x,right:(y.right-w.right+g.right)/b.x}}const oe=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:f}=e,{element:l,padding:a=0}=Y(t,e)||{};if(l==null)return{};const d=Wt(a),m={x:n,y:o},u=At(i),g=bt(u),h=await s.getDimensions(l),p=u==="y",w=p?"top":"left",x=p?"bottom":"right",v=p?"clientHeight":"clientWidth",b=r.reference[g]+r.reference[u]-m[u]-r.floating[g],y=m[u]-r.reference[u],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let R=O?O[v]:0;(!R||!await(s.isElement==null?void 0:s.isElement(O)))&&(R=c.floating[v]||r.floating[g]);const L=b/2-y/2,W=R/2-h[g]/2-1,D=K(d[w],W),B=K(d[x],W),M=D,T=R-h[g]-B,C=R/2-h[g]/2+L,V=pt(M,C,T),E=!f.arrow&&et(i)!=null&&C!==V&&r.reference[g]/2-(C<M?D:B)-h[g]/2<0,P=E?C<M?C-M:C-T:0;return{[u]:m[u]+P,data:{[u]:V,centerOffset:C-V-P,...E&&{alignmentOffset:P}},reset:E}}}),ie=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:f,elements:l}=e,{mainAxis:a=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...p}=Y(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const w=q(i),x=_(c),v=q(c)===c,b=await(f.isRTL==null?void 0:f.isRTL(l.floating)),y=m||(v||!h?[ct(c)]:Qt(c)),O=g!=="none";!m&&O&&y.push(...te(c,h,g,b));const R=[c,...y],L=await Z(e,p),W=[];let D=((o=r.flip)==null?void 0:o.overflows)||[];if(a&&W.push(L[w]),d){const C=Jt(i,s,b);W.push(L[C[0]],L[C[1]])}if(D=[...D,{placement:i,overflows:W}],!W.every(C=>C<=0)){var B,M;const C=(((B=r.flip)==null?void 0:B.index)||0)+1,V=R[C];if(V&&(!(d==="alignment"?x!==_(V):!1)||D.every(A=>A.overflows[0]>0&&_(A.placement)===x)))return{data:{index:C,overflows:D},reset:{placement:V}};let E=(M=D.filter(P=>P.overflows[0]<=0).sort((P,A)=>P.overflows[1]-A.overflows[1])[0])==null?void 0:M.placement;if(!E)switch(u){case"bestFit":{var T;const P=(T=D.filter(A=>{if(O){const k=_(A.placement);return k===x||k==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(k=>k>0).reduce((k,X)=>k+X,0)]).sort((A,k)=>A[1]-k[1])[0])==null?void 0:T[0];P&&(E=P);break}case"initialPlacement":E=c;break}if(i!==E)return{reset:{placement:E}}}return{}}}};function St(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Dt(t){return Ut.some(e=>t[e]>=0)}const re=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=Y(t,e);switch(o){case"referenceHidden":{const r=await Z(e,{...i,elementContext:"reference"}),s=St(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Dt(s)}}}case"escaped":{const r=await Z(e,{...i,altBoundary:!0}),s=St(r,n.floating);return{data:{escapedOffsets:s,escaped:Dt(s)}}}default:return{}}}}};async function se(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=q(n),c=et(n),f=_(n)==="y",l=["left","top"].includes(s)?-1:1,a=r&&f?-1:1,d=Y(e,t);let{mainAxis:m,crossAxis:u,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof g=="number"&&(u=c==="end"?g*-1:g),f?{x:u*a,y:m*l}:{x:m*l,y:u*a}}const ce=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:c}=e,f=await se(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+f.x,y:r+f.y,data:{...f,placement:s}}}}},le=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:p=>{let{x:w,y:x}=p;return{x:w,y:x}}},...f}=Y(t,e),l={x:n,y:o},a=await Z(e,f),d=_(q(i)),m=vt(d);let u=l[m],g=l[d];if(r){const p=m==="y"?"top":"left",w=m==="y"?"bottom":"right",x=u+a[p],v=u-a[w];u=pt(x,u,v)}if(s){const p=d==="y"?"top":"left",w=d==="y"?"bottom":"right",x=g+a[p],v=g-a[w];g=pt(x,g,v)}const h=c.fn({...e,[m]:u,[d]:g});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[m]:r,[d]:s}}}}}},fe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:c=0,mainAxis:f=!0,crossAxis:l=!0}=Y(t,e),a={x:n,y:o},d=_(i),m=vt(d);let u=a[m],g=a[d];const h=Y(c,e),p=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(f){const v=m==="y"?"height":"width",b=r.reference[m]-r.floating[v]+p.mainAxis,y=r.reference[m]+r.reference[v]-p.mainAxis;u<b?u=b:u>y&&(u=y)}if(l){var w,x;const v=m==="y"?"width":"height",b=["top","left"].includes(q(i)),y=r.reference[d]-r.floating[v]+(b&&((w=s.offset)==null?void 0:w[d])||0)+(b?0:p.crossAxis),O=r.reference[d]+r.reference[v]+(b?0:((x=s.offset)==null?void 0:x[d])||0)-(b?p.crossAxis:0);g<y?g=y:g>O&&(g=O)}return{[m]:u,[d]:g}}}},ae=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:c}=e,{apply:f=()=>{},...l}=Y(t,e),a=await Z(e,l),d=q(i),m=et(i),u=_(i)==="y",{width:g,height:h}=r.floating;let p,w;d==="top"||d==="bottom"?(p=d,w=m===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(w=d,p=m==="end"?"top":"bottom");const x=h-a.top-a.bottom,v=g-a.left-a.right,b=K(h-a[p],x),y=K(g-a[w],v),O=!e.middlewareData.shift;let R=b,L=y;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(L=v),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(R=x),O&&!m){const D=F(a.left,0),B=F(a.right,0),M=F(a.top,0),T=F(a.bottom,0);u?L=g-2*(D!==0||B!==0?D+B:F(a.left,a.right)):R=h-2*(M!==0||T!==0?M+T:F(a.top,a.bottom))}await f({...e,availableWidth:L,availableHeight:R});const W=await s.getDimensions(c.floating);return g!==W.width||h!==W.height?{reset:{rects:!0}}:{}}}};function Bt(t){const e=N(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=j(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=st(n)!==r||st(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function Rt(t){return H(t)?t:t.contextElement}function J(t){const e=Rt(t);if(!j(e))return z(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Bt(e);let s=(r?st(n.width):n.width)/o,c=(r?st(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const ue=z(0);function Ht(t){const e=$(t);return!yt()||!e.visualViewport?ue:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function de(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==$(t)?!1:e}function G(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Rt(t);let s=z(1);e&&(o?H(o)&&(s=J(o)):s=J(t));const c=de(r,n,o)?Ht(r):z(0);let f=(i.left+c.x)/s.x,l=(i.top+c.y)/s.y,a=i.width/s.x,d=i.height/s.y;if(r){const m=$(r),u=o&&H(o)?$(o):o;let g=m,h=ht(g);for(;h&&o&&u!==g;){const p=J(h),w=h.getBoundingClientRect(),x=N(h),v=w.left+(h.clientLeft+parseFloat(x.paddingLeft))*p.x,b=w.top+(h.clientTop+parseFloat(x.paddingTop))*p.y;f*=p.x,l*=p.y,a*=p.x,d*=p.y,f+=v,l+=b,g=$(h),h=ht(g)}}return lt({width:a,height:d,x:f,y:l})}function Ot(t,e){const n=dt(t).scrollLeft;return e?e.left+n:G(I(t)).left+n}function Nt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=o.left+e.scrollLeft-(n?0:Ot(t,o)),r=o.top+e.scrollTop;return{x:i,y:r}}function me(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=I(o),c=e?ut(e.floating):!1;if(o===s||c&&r)return n;let f={scrollLeft:0,scrollTop:0},l=z(1);const a=z(0),d=j(o);if((d||!d&&!r)&&((tt(o)!=="body"||ot(s))&&(f=dt(o)),j(o))){const u=G(o);l=J(o),a.x=u.x+o.clientLeft,a.y=u.y+o.clientTop}const m=s&&!d&&!r?Nt(s,f,!0):z(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-f.scrollLeft*l.x+a.x+m.x,y:n.y*l.y-f.scrollTop*l.y+a.y+m.y}}function ge(t){return Array.from(t.getClientRects())}function he(t){const e=I(t),n=dt(t),o=t.ownerDocument.body,i=F(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=F(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Ot(t);const c=-n.scrollTop;return N(o).direction==="rtl"&&(s+=F(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}function pe(t,e){const n=$(t),o=I(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,c=0,f=0;if(i){r=i.width,s=i.height;const l=yt();(!l||l&&e==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}return{width:r,height:s,x:c,y:f}}function we(t,e){const n=G(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=j(t)?J(t):z(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,f=i*r.x,l=o*r.y;return{width:s,height:c,x:f,y:l}}function Lt(t,e,n){let o;if(e==="viewport")o=pe(t,n);else if(e==="document")o=he(I(t));else if(H(e))o=we(e,n);else{const i=Ht(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return lt(o)}function Vt(t,e){const n=U(t);return n===e||!H(n)||Q(n)?!1:N(n).position==="fixed"||Vt(n,e)}function xe(t,e){const n=e.get(t);if(n)return n;let o=nt(t,[],!1).filter(c=>H(c)&&tt(c)!=="body"),i=null;const r=N(t).position==="fixed";let s=r?U(t):t;for(;H(s)&&!Q(s);){const c=N(s),f=xt(s);!f&&c.position==="fixed"&&(i=null),(r?!f&&!i:!f&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ot(s)&&!f&&Vt(t,s))?o=o.filter(a=>a!==s):i=c,s=U(s)}return e.set(t,o),o}function ye(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?ut(e)?[]:xe(e,this._c):[].concat(n),o],c=s[0],f=s.reduce((l,a)=>{const d=Lt(e,a,i);return l.top=F(d.top,l.top),l.right=K(d.right,l.right),l.bottom=K(d.bottom,l.bottom),l.left=F(d.left,l.left),l},Lt(e,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function ve(t){const{width:e,height:n}=Bt(t);return{width:e,height:n}}function be(t,e,n){const o=j(e),i=I(e),r=n==="fixed",s=G(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const f=z(0);function l(){f.x=Ot(i)}if(o||!o&&!r)if((tt(e)!=="body"||ot(i))&&(c=dt(e)),o){const u=G(e,!0,r,e);f.x=u.x+e.clientLeft,f.y=u.y+e.clientTop}else i&&l();r&&!o&&i&&l();const a=i&&!o&&!r?Nt(i,c):z(0),d=s.left+c.scrollLeft-f.x-a.x,m=s.top+c.scrollTop-f.y-a.y;return{x:d,y:m,width:s.width,height:s.height}}function mt(t){return N(t).position==="static"}function Tt(t,e){if(!j(t)||N(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return I(t)===n&&(n=n.ownerDocument.body),n}function _t(t,e){const n=$(t);if(ut(t))return n;if(!j(t)){let i=U(t);for(;i&&!Q(i);){if(H(i)&&!mt(i))return i;i=U(i)}return n}let o=Tt(t,e);for(;o&&qt(o)&&mt(o);)o=Tt(o,e);return o&&Q(o)&&mt(o)&&!xt(o)?n:o||Xt(t)||n}const Ae=async function(t){const e=this.getOffsetParent||_t,n=this.getDimensions,o=await n(t.floating);return{reference:be(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Re(t){return N(t).direction==="rtl"}const Oe={convertOffsetParentRelativeRectToViewportRelativeRect:me,getDocumentElement:I,getClippingRect:ye,getOffsetParent:_t,getElementRects:Ae,getClientRects:ge,getDimensions:ve,getScale:J,isElement:H,isRTL:Re};function zt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ce(t,e){let n=null,o;const i=I(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),r();const l=t.getBoundingClientRect(),{left:a,top:d,width:m,height:u}=l;if(c||e(),!m||!u)return;const g=it(d),h=it(i.clientWidth-(a+m)),p=it(i.clientHeight-(d+u)),w=it(a),v={rootMargin:-g+"px "+-h+"px "+-p+"px "+-w+"px",threshold:F(0,K(1,f))||1};let b=!0;function y(O){const R=O[0].intersectionRatio;if(R!==f){if(!b)return s();R?s(!1,R):o=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!zt(l,t.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(y,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(y,v)}n.observe(t)}return s(!0),r}function He(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,l=Rt(t),a=i||r?[...l?nt(l):[],...nt(e)]:[];a.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const d=l&&c?Ce(l,n):null;let m=-1,u=null;s&&(u=new ResizeObserver(w=>{let[x]=w;x&&x.target===l&&u&&(u.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=u)==null||v.observe(e)})),n()}),l&&!f&&u.observe(l),u.observe(e));let g,h=f?G(t):null;f&&p();function p(){const w=G(t);h&&!zt(h,w)&&n(),h=w,g=requestAnimationFrame(p)}return n(),()=>{var w;a.forEach(x=>{i&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),d==null||d(),(w=u)==null||w.disconnect(),u=null,f&&cancelAnimationFrame(g)}}const Ne=Z,Ee=ce,Se=le,De=ie,Le=ae,Te=re,Pt=oe,Pe=fe,Me=(t,e,n)=>{const o=new Map,i={platform:Oe,...n},r={...i.platform,_c:o};return ne(t,e,{...i,platform:r})};var ke=typeof document<"u",Fe=function(){},rt=ke?S.useLayoutEffect:Fe;function ft(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!ft(t[o],e[o]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,i[o]))return!1;for(o=n;o--!==0;){const r=i[o];if(!(r==="_owner"&&t.$$typeof)&&!ft(t[r],e[r]))return!1}return!0}return t!==t&&e!==e}function jt(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Mt(t,e){const n=jt(t);return Math.round(e*n)/n}function gt(t){const e=S.useRef(t);return rt(()=>{e.current=t}),e}function Ve(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:r,floating:s}={},transform:c=!0,whileElementsMounted:f,open:l}=t,[a,d]=S.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,u]=S.useState(o);ft(m,o)||u(o);const[g,h]=S.useState(null),[p,w]=S.useState(null),x=S.useCallback(A=>{A!==O.current&&(O.current=A,h(A))},[]),v=S.useCallback(A=>{A!==R.current&&(R.current=A,w(A))},[]),b=r||g,y=s||p,O=S.useRef(null),R=S.useRef(null),L=S.useRef(a),W=f!=null,D=gt(f),B=gt(i),M=gt(l),T=S.useCallback(()=>{if(!O.current||!R.current)return;const A={placement:e,strategy:n,middleware:m};B.current&&(A.platform=B.current),Me(O.current,R.current,A).then(k=>{const X={...k,isPositioned:M.current!==!1};C.current&&!ft(L.current,X)&&(L.current=X,kt.flushSync(()=>{d(X)}))})},[m,e,n,B,M]);rt(()=>{l===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,d(A=>({...A,isPositioned:!1})))},[l]);const C=S.useRef(!1);rt(()=>(C.current=!0,()=>{C.current=!1}),[]),rt(()=>{if(b&&(O.current=b),y&&(R.current=y),b&&y){if(D.current)return D.current(b,y,T);T()}},[b,y,T,D,W]);const V=S.useMemo(()=>({reference:O,floating:R,setReference:x,setFloating:v}),[x,v]),E=S.useMemo(()=>({reference:b,floating:y}),[b,y]),P=S.useMemo(()=>{const A={position:n,left:0,top:0};if(!E.floating)return A;const k=Mt(E.floating,a.x),X=Mt(E.floating,a.y);return c?{...A,transform:"translate("+k+"px, "+X+"px)",...jt(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:X}},[n,c,E.floating,a.x,a.y]);return S.useMemo(()=>({...a,update:T,refs:V,elements:E,floatingStyles:P}),[a,T,V,E,P])}const $e=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:i}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?Pt({element:o.current,padding:i}).fn(n):{}:o?Pt({element:o,padding:i}).fn(n):{}}}},_e=(t,e)=>({...Ee(t),options:[t,e]}),ze=(t,e)=>({...Se(t),options:[t,e]}),je=(t,e)=>({...Pe(t),options:[t,e]}),Ie=(t,e)=>({...De(t),options:[t,e]}),Ye=(t,e)=>({...Le(t),options:[t,e]}),qe=(t,e)=>({...Te(t),options:[t,e]}),Xe=(t,e)=>({...$e(t),options:[t,e]});export{Be as R,Ye as a,Xe as b,He as c,Ne as d,Y as e,Ie as f,st as g,qe as h,H as i,K as j,je as l,F as m,_e as o,kt as r,ze as s,Ve as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as I,j as w,g as le,c as X,i as Fe,l as xe,v as de}from"./index-
|
|
1
|
+
import{r as I,j as w,g as le,c as X,i as Fe,l as xe,v as de}from"./index-M-fcEAWc.js";import{u as $e}from"./index-DG6d5rM7.js";import{r as Ve,s as Me,t as Pe,I as se}from"./Input-F4DL5_h8.js";/**
|
|
2
2
|
* table-core
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) TanStack
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as x}from"./index-
|
|
1
|
+
import{r as x}from"./index-M-fcEAWc.js";import{r as C}from"./floating-ui.react-dom-8hwAvuN1.js";function p(r,l,e){let s=e.initialDeps??[],t;function n(){var i,o,a,c;let h;e.key&&((i=e.debug)!=null&&i.call(e))&&(h=Date.now());const u=r();if(!(u.length!==s.length||u.some((m,f)=>s[f]!==m)))return t;s=u;let v;if(e.key&&((o=e.debug)!=null&&o.call(e))&&(v=Date.now()),t=l(...u),e.key&&((a=e.debug)!=null&&a.call(e))){const m=Math.round((Date.now()-h)*100)/100,f=Math.round((Date.now()-v)*100)/100,S=f/16,b=(g,O)=>{for(g=String(g);g.length<O;)g=" "+g;return g};console.info(`%c⏱ ${b(f,5)} /${b(m,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,e==null?void 0:e.key)}return(c=e==null?void 0:e.onChange)==null||c.call(e,t),t}return n.updateDeps=i=>{s=i},n}function M(r,l){if(r===void 0)throw new Error("Unexpected undefined");return r}const T=(r,l)=>Math.abs(r-l)<=1,R=(r,l,e)=>{let s;return function(...t){r.clearTimeout(s),s=r.setTimeout(()=>l.apply(this,t),e)}},y=r=>{const{offsetWidth:l,offsetHeight:e}=r;return{width:l,height:e}},_=r=>r,A=r=>{const l=Math.max(r.startIndex-r.overscan,0),e=Math.min(r.endIndex+r.overscan,r.count-1),s=[];for(let t=l;t<=e;t++)s.push(t);return s},D=(r,l)=>{const e=r.scrollElement;if(!e)return;const s=r.targetWindow;if(!s)return;const t=i=>{const{width:o,height:a}=i;l({width:Math.round(o),height:Math.round(a)})};if(t(y(e)),!s.ResizeObserver)return()=>{};const n=new s.ResizeObserver(i=>{const o=()=>{const a=i[0];if(a!=null&&a.borderBoxSize){const c=a.borderBoxSize[0];if(c){t({width:c.inlineSize,height:c.blockSize});return}}t(y(e))};r.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return n.observe(e,{box:"border-box"}),()=>{n.unobserve(e)}},w={passive:!0},I=typeof window>"u"?!0:"onscrollend"in window,k=(r,l)=>{const e=r.scrollElement;if(!e)return;const s=r.targetWindow;if(!s)return;let t=0;const n=r.options.useScrollendEvent&&I?()=>{}:R(s,()=>{l(t,!1)},r.options.isScrollingResetDelay),i=h=>()=>{const{horizontal:u,isRtl:d}=r.options;t=u?e.scrollLeft*(d&&-1||1):e.scrollTop,n(),l(t,h)},o=i(!0),a=i(!1);a(),e.addEventListener("scroll",o,w);const c=r.options.useScrollendEvent&&I;return c&&e.addEventListener("scrollend",a,w),()=>{e.removeEventListener("scroll",o),c&&e.removeEventListener("scrollend",a)}},F=(r,l,e)=>{if(l!=null&&l.borderBoxSize){const s=l.borderBoxSize[0];if(s)return Math.round(s[e.options.horizontal?"inlineSize":"blockSize"])}return r[e.options.horizontal?"offsetWidth":"offsetHeight"]},W=(r,{adjustments:l=0,behavior:e},s)=>{var t,n;const i=r+l;(n=(t=s.scrollElement)==null?void 0:t.scrollTo)==null||n.call(t,{[s.options.horizontal?"left":"top"]:i,behavior:e})};class j{constructor(l){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const s=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(t=>{t.forEach(n=>{const i=()=>{this._measureElement(n.target,n)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var t;(t=s())==null||t.disconnect(),e=null},observe:t=>{var n;return(n=s())==null?void 0:n.observe(t,{box:"border-box"})},unobserve:t=>{var n;return(n=s())==null?void 0:n.unobserve(t)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([s,t])=>{typeof t>"u"&&delete e[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:_,rangeExtractor:A,onChange:()=>{},measureElement:F,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var s,t;(t=(s=this.options).onChange)==null||t.call(s,this,e)},this.maybeNotify=p(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(t=>{this.observer.observe(t)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,t=>{this.scrollRect=t,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(t,n)=>{this.scrollAdjustments=0,this.scrollDirection=n?this.getScrollOffset()<t?"forward":"backward":null,this.scrollOffset=t,this.isScrolling=n,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,s)=>{const t=new Map,n=new Map;for(let i=s-1;i>=0;i--){const o=e[i];if(t.has(o.lane))continue;const a=n.get(o.lane);if(a==null||o.end>a.end?n.set(o.lane,o):o.end<a.end&&t.set(o.lane,!0),t.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((i,o)=>i.end===o.end?i.index-o.index:i.end-o.end)[0]:void 0},this.getMeasurementOptions=p(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,s,t,n,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:s,scrollMargin:t,getItemKey:n,enabled:i}),{key:!1}),this.getMeasurements=p(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:s,scrollMargin:t,getItemKey:n,enabled:i},o)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,a);for(let h=a;h<e;h++){const u=n(h),d=this.options.lanes===1?c[h-1]:this.getFurthestMeasurement(c,h),v=d?d.end+this.options.gap:s+t,m=o.get(u),f=typeof m=="number"?m:this.options.estimateSize(h),S=v+f,b=d?d.lane:h%this.options.lanes;c[h]={index:h,start:v,size:f,end:S,key:u,lane:b}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=p(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,s,t,n)=>this.range=e.length>0&&s>0?L({measurements:e,outerSize:s,scrollOffset:t,lanes:n}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=p(()=>{let e=null,s=null;const t=this.calculateRange();return t&&(e=t.startIndex,s=t.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,s]},(e,s,t,n,i)=>n===null||i===null?[]:e({startIndex:n,endIndex:i,overscan:s,count:t}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const s=this.options.indexAttribute,t=e.getAttribute(s);return t?parseInt(t,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(e,s)=>{const t=this.indexFromElement(e),n=this.measurementsCache[t];if(!n)return;const i=n.key,o=this.elementsCache.get(i);o!==e&&(o&&this.observer.unobserve(o),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(t,this.options.measureElement(e,s,this))},this.resizeItem=(e,s)=>{const t=this.measurementsCache[e];if(!t)return;const n=this.itemSizeCache.get(t.key)??t.size,i=s-n;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(t,i,this):t.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(t.index),this.itemSizeCache=new Map(this.itemSizeCache.set(t.key,s)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((s,t)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(t))});return}this._measureElement(e,void 0)},this.getVirtualItems=p(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,s)=>{const t=[];for(let n=0,i=e.length;n<i;n++){const o=e[n],a=s[o];t.push(a)}return t},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const s=this.getMeasurements();if(s.length!==0)return M(s[z(0,s.length-1,t=>M(s[t]).start,e)])},this.getOffsetForAlignment=(e,s,t=0)=>{const n=this.getSize(),i=this.getScrollOffset();s==="auto"&&(s=e>=i+n?"end":"start"),s==="center"?e+=(t-n)/2:s==="end"&&(e-=n);const o=this.getTotalSize()-n;return Math.max(Math.min(o,e),0)},this.getOffsetForIndex=(e,s="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const t=this.measurementsCache[e];if(!t)return;const n=this.getSize(),i=this.getScrollOffset();if(s==="auto")if(t.end>=i+n-this.options.scrollPaddingEnd)s="end";else if(t.start<=i+this.options.scrollPaddingStart)s="start";else return[i,s];const o=s==="end"?t.end+this.options.scrollPaddingEnd:t.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,s,t.size),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:s="start",behavior:t}={})=>{this.cancelScrollToIndex(),t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,s),{adjustments:void 0,behavior:t})},this.scrollToIndex=(e,{align:s="auto",behavior:t}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const n=this.getOffsetForIndex(e,s);if(!n)return;const[i,o]=n;this._scrollToOffset(i,{adjustments:void 0,behavior:t}),t!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(e))){const c=this.getOffsetForIndex(e,o);if(!c)return;const[h]=c,u=this.getScrollOffset();T(h,u)||this.scrollToIndex(e,{align:o,behavior:t})}else this.scrollToIndex(e,{align:o,behavior:t})}))},this.scrollBy=(e,{behavior:s}={})=>{this.cancelScrollToIndex(),s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:s})},this.getTotalSize=()=>{var e;const s=this.getMeasurements();let t;if(s.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=((e=s[s.length-1])==null?void 0:e.end)??0;else{const n=Array(this.options.lanes).fill(null);let i=s.length-1;for(;i>=0&&n.some(o=>o===null);){const o=s[i];n[o.lane]===null&&(n[o.lane]=o.end),i--}t=Math.max(...n.filter(o=>o!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:s,behavior:t})=>{this.options.scrollToFn(e,{behavior:t,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(l)}}const z=(r,l,e,s)=>{for(;r<=l;){const t=(r+l)/2|0,n=e(t);if(n<s)r=t+1;else if(n>s)l=t-1;else return t}return r>0?r-1:0};function L({measurements:r,outerSize:l,scrollOffset:e,lanes:s}){const t=r.length-1,n=a=>r[a].start;if(r.length<=s)return{startIndex:0,endIndex:t};let i=z(0,t,n,e),o=i;if(s===1)for(;o<t&&r[o].end<e+l;)o++;else if(s>1){const a=Array(s).fill(0);for(;o<t&&a.some(h=>h<e+l);){const h=r[o];a[h.lane]=h.end,o++}const c=Array(s).fill(e+l);for(;i>=0&&c.some(h=>h>=e);){const h=r[i];c[h.lane]=h.start,i--}i=Math.max(0,i-i%s),o=Math.min(t,o+(s-1-o%s))}return{startIndex:i,endIndex:o}}const E=typeof document<"u"?x.useLayoutEffect:x.useEffect;function P(r){const l=x.useReducer(()=>({}),{})[1],e={...r,onChange:(t,n)=>{var i;n?C.flushSync(l):l(),(i=r.onChange)==null||i.call(r,t,n)}},[s]=x.useState(()=>new j(e));return s.setOptions(e),E(()=>s._didMount(),[]),E(()=>s._willUpdate()),s}function N(r){return P({observeElementRect:D,observeElementOffset:k,scrollToFn:W,...r})}export{N as u};
|